BaseKagManager.cs 148 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Runtime.CompilerServices;
  5. using MaidStatus;
  6. using Schedule;
  7. using script;
  8. using UnityEngine;
  9. using wf;
  10. public class BaseKagManager : IDisposable
  11. {
  12. public BaseKagManager(TJSScript tjs, ScriptManager script_mgr)
  13. {
  14. NDebug.AssertNull(tjs != null);
  15. this.maidOffsetSetList = new List<Maid>();
  16. this.tjs_ = tjs;
  17. this.script_mgr_ = script_mgr;
  18. this.kag_ = new KagScript(this.tjs_);
  19. this.kag_.SetReplaceEvent(new KagScript.ReplaceCallBack(this.ReplaceFileNameCallBack));
  20. this.kag_.onScenarioLoadEventList.Add(new KagScript.OnScenarioLoadCallBack(this.OnScenarioLoadEvent));
  21. this.exec_wait_data_.Clear();
  22. }
  23. ~BaseKagManager()
  24. {
  25. this.Dispose(false);
  26. }
  27. public virtual void Initialize()
  28. {
  29. this.kag_.AddTagCallBack("wait", new KagScript.KagTagCallBack(this.TagWait));
  30. this.kag_.AddTagCallBack("face", new KagScript.KagTagCallBack(this.TagFace));
  31. this.kag_.AddTagCallBack("faceblend", new KagScript.KagTagCallBack(this.TagFaceBlend));
  32. this.kag_.AddTagCallBack("faceblend2", new KagScript.KagTagCallBack(this.TagFaceBlend2));
  33. this.kag_.AddTagCallBack("startkuchipakupattern", new KagScript.KagTagCallBack(this.TagStartKuchipakuPattern));
  34. this.kag_.AddTagCallBack("stopkuchipakupattern", new KagScript.KagTagCallBack(this.TagStopKuchipakuPattern));
  35. this.kag_.AddTagCallBack("motion", new KagScript.KagTagCallBack(this.TagMotion));
  36. this.kag_.AddTagCallBack("motionnext", new KagScript.KagTagCallBack(this.TagMotionNext));
  37. this.kag_.AddTagCallBack("motionnextabs", new KagScript.KagTagCallBack(this.TagMotionNextAbs));
  38. this.kag_.AddTagCallBack("motionstop", new KagScript.KagTagCallBack(this.TagMotionStop));
  39. this.kag_.AddTagCallBack("motionlayerstop", new KagScript.KagTagCallBack(this.TagMotionLayerStop));
  40. this.kag_.AddTagCallBack("motionautotwist", new KagScript.KagTagCallBack(this.TagMotionAutoTwist));
  41. this.kag_.AddTagCallBack("motionblendenabled", new KagScript.KagTagCallBack(this.TagMotionBlendEnabled));
  42. this.kag_.AddTagCallBack("motionscript", new KagScript.KagTagCallBack(this.TagMotionScript));
  43. this.kag_.AddTagCallBack("itemanime", new KagScript.KagTagCallBack(this.TagItemAnime));
  44. this.kag_.AddTagCallBack("hairphisics", new KagScript.KagTagCallBack(this.TagHairPhisics));
  45. this.kag_.AddTagCallBack("bustmove", new KagScript.KagTagCallBack(this.TagBustMove));
  46. this.kag_.AddTagCallBack("phisicshit", new KagScript.KagTagCallBack(this.TagPhisicsHit));
  47. this.kag_.AddTagCallBack("ikattachpoint", new KagScript.KagTagCallBack(this.TagIKAttachPoint));
  48. this.kag_.AddTagCallBack("ikattachbone", new KagScript.KagTagCallBack(this.TagIKAttachBone));
  49. this.kag_.AddTagCallBack("ikdetach", new KagScript.KagTagCallBack(this.TagIKDetach));
  50. this.kag_.AddTagCallBack("allikdetach", new KagScript.KagTagCallBack(this.TagAllIKDetach));
  51. this.kag_.AddTagCallBack("ikattachodogu", new KagScript.KagTagCallBack(this.TagIKAttachOdogu));
  52. this.kag_.AddTagCallBack("ikattachikbone", new KagScript.KagTagCallBack(this.TagIKAttachIKBone));
  53. this.kag_.AddTagCallBack("iksetbodypos", new KagScript.KagTagCallBack(this.TagIKSetBodyPos));
  54. this.kag_.AddTagCallBack("ikcheckthrough", new KagScript.KagTagCallBack(this.TagIKCheckThrough));
  55. this.kag_.AddTagCallBack("ikbendbonectrl", new KagScript.KagTagCallBack(this.TagIKBendBoneCtrl));
  56. this.kag_.AddTagCallBack("nextikflag", new KagScript.KagTagCallBack(this.TagNextIKFlag));
  57. this.kag_.AddTagCallBack("ikattachpointnext", new KagScript.KagTagCallBack(this.TagIKAttachPointNext));
  58. this.kag_.AddTagCallBack("ikattachbonenext", new KagScript.KagTagCallBack(this.TagIKAttachBoneNext));
  59. this.kag_.AddTagCallBack("ikattachodogunext", new KagScript.KagTagCallBack(this.TagIKAttachOdoguNext));
  60. this.kag_.AddTagCallBack("ikattachikbonenext", new KagScript.KagTagCallBack(this.TagIKAttachIKBoneNext));
  61. this.kag_.AddTagCallBack("allpos", new KagScript.KagTagCallBack(this.TagAllPos));
  62. this.kag_.AddTagCallBack("alloffset", new KagScript.KagTagCallBack(this.TagAllOffSet));
  63. this.kag_.AddTagCallBack("addalloffset", new KagScript.KagTagCallBack(this.TagAddAllOffset));
  64. this.kag_.AddTagCallBack("offset", new KagScript.KagTagCallBack(this.TagOffSet));
  65. this.kag_.AddTagCallBack("allresetpos", new KagScript.KagTagCallBack(this.TagAllResetPos));
  66. this.kag_.AddTagCallBack("transform", new KagScript.KagTagCallBack(this.TagTransform));
  67. this.kag_.AddTagCallBack("position", new KagScript.KagTagCallBack(this.TagPosition));
  68. this.kag_.AddTagCallBack("rotation", new KagScript.KagTagCallBack(this.TagRotation));
  69. this.kag_.AddTagCallBack("camera", new KagScript.KagTagCallBack(this.TagCamera));
  70. this.kag_.AddTagCallBack("camerachase", new KagScript.KagTagCallBack(this.TagCameraChase));
  71. this.kag_.AddTagCallBack("camerachasestop", new KagScript.KagTagCallBack(this.TagCameraChaseStop));
  72. this.kag_.AddTagCallBack("cameraanimationstart", new KagScript.KagTagCallBack(this.TagCameraAnimationStart));
  73. this.kag_.AddTagCallBack("cameracontrol", new KagScript.KagTagCallBack(this.TagCameraControl));
  74. this.kag_.AddTagCallBack("lightmain", new KagScript.KagTagCallBack(this.TagLightMain));
  75. this.kag_.AddTagCallBack("playbgm", new KagScript.KagTagCallBack(this.TagPlayBgm));
  76. this.kag_.AddTagCallBack("stopbgm", new KagScript.KagTagCallBack(this.TagStopBgm));
  77. this.kag_.AddTagCallBack("playenv", new KagScript.KagTagCallBack(this.TagPlayEnv));
  78. this.kag_.AddTagCallBack("stopenv", new KagScript.KagTagCallBack(this.TagStopEnv));
  79. this.kag_.AddTagCallBack("playse", new KagScript.KagTagCallBack(this.TagPlaySe));
  80. this.kag_.AddTagCallBack("stopse", new KagScript.KagTagCallBack(this.TagStopSe));
  81. this.kag_.AddTagCallBack("playvoice", new KagScript.KagTagCallBack(this.TagPlayVoice));
  82. this.kag_.AddTagCallBack("stopvoice", new KagScript.KagTagCallBack(this.TagStopVoice));
  83. this.kag_.AddTagCallBack("stopsound", new KagScript.KagTagCallBack(this.TagStopSound));
  84. this.kag_.AddTagCallBack("fade3d", new KagScript.KagTagCallBack(this.TagFade3D));
  85. this.kag_.AddTagCallBack("setbg", new KagScript.KagTagCallBack(this.TagSetBg));
  86. this.kag_.AddTagCallBack("draw2dtex", new KagScript.KagTagCallBack(this.TagDraw2DTex));
  87. this.kag_.AddTagCallBack("clear2dtex", new KagScript.KagTagCallBack(this.TagClear2DTex));
  88. this.kag_.AddTagCallBack("itemchange", new KagScript.KagTagCallBack(this.TagItemChange));
  89. this.kag_.AddTagCallBack("itemset", new KagScript.KagTagCallBack(this.TagItemSet));
  90. this.kag_.AddTagCallBack("itemreset", new KagScript.KagTagCallBack(this.TagItemReset));
  91. this.kag_.AddTagCallBack("itempos", new KagScript.KagTagCallBack(this.TagItemPos));
  92. this.kag_.AddTagCallBack("allprocpropseqstart", new KagScript.KagTagCallBack(this.TagAllProcPropSeqStart));
  93. this.kag_.AddTagCallBack("itemmask", new KagScript.KagTagCallBack(this.TagItemMask));
  94. this.kag_.AddTagCallBack("itemmaskmode", new KagScript.KagTagCallBack(this.TagItemMaskMode));
  95. this.kag_.AddTagCallBack("maidreset", new KagScript.KagTagCallBack(this.TagMaidReset));
  96. this.kag_.AddTagCallBack("propset", new KagScript.KagTagCallBack(this.TagPropSet));
  97. this.kag_.AddTagCallBack("propreset", new KagScript.KagTagCallBack(this.TagPropReset));
  98. this.kag_.AddTagCallBack("addprefabbg", new KagScript.KagTagCallBack(this.TagAddPrefabBg));
  99. this.kag_.AddTagCallBack("setprefabbgtransformdata", new KagScript.KagTagCallBack(this.TagSetPrefabBgTransformData));
  100. this.kag_.AddTagCallBack("delprefabbg", new KagScript.KagTagCallBack(this.TagDelPrefabBg));
  101. this.kag_.AddTagCallBack("delprefabbgall", new KagScript.KagTagCallBack(this.TagDelPrefabBgAll));
  102. this.kag_.AddTagCallBack("moveprefabtochara", new KagScript.KagTagCallBack(this.TagMovePrefabToChara));
  103. this.kag_.AddTagCallBack("addprefabworld", new KagScript.KagTagCallBack(this.TagAddPrefabWorld));
  104. this.kag_.AddTagCallBack("releaseprefab", new KagScript.KagTagCallBack(this.TagReleasePrefab));
  105. this.kag_.AddTagCallBack("prefabanimatorsetparam", new KagScript.KagTagCallBack(this.TagPrefabAnimatorSetParam));
  106. this.kag_.AddTagCallBack("chinko", new KagScript.KagTagCallBack(this.TagChinko));
  107. this.kag_.AddTagCallBack("setloacalposition", new KagScript.KagTagCallBack(this.TagSetLoacalPosition));
  108. this.kag_.AddTagCallBack("addlocalposition", new KagScript.KagTagCallBack(this.TagAddLocalPosition));
  109. this.kag_.AddTagCallBack("openmouth", new KagScript.KagTagCallBack(this.TagOpenMouth));
  110. this.kag_.AddTagCallBack("eyetoposition", new KagScript.KagTagCallBack(this.TagEyeToPosition));
  111. this.kag_.AddTagCallBack("eyetotarget", new KagScript.KagTagCallBack(this.TagEyeToTarget));
  112. this.kag_.AddTagCallBack("eyetocamera", new KagScript.KagTagCallBack(this.TagEyeToCamera));
  113. this.kag_.AddTagCallBack("eyetoreset", new KagScript.KagTagCallBack(this.TagEyeToReset));
  114. this.kag_.AddTagCallBack("setmaidoffsetpos", new KagScript.KagTagCallBack(this.TagSetMaidOffsetPos));
  115. this.kag_.AddTagCallBack("setmaidoffsetmultipos", new KagScript.KagTagCallBack(this.TagSetMaidOffsetMultiPos));
  116. this.kag_.AddTagCallBack("setmanoffsetpos", new KagScript.KagTagCallBack(this.TagSetManOffsetPos));
  117. this.kag_.AddTagCallBack("setmaidoffsetposcategory", new KagScript.KagTagCallBack(this.TagSetMaidOffsetPosCategory));
  118. this.kag_.AddTagCallBack("addprefabchara", new KagScript.KagTagCallBack(this.TagAddPrefabChara));
  119. this.kag_.AddTagCallBack("delprefabchara", new KagScript.KagTagCallBack(this.TagDelPrefabChara));
  120. this.kag_.AddTagCallBack("delprefabcharaall", new KagScript.KagTagCallBack(this.TagDelPrefabCharaAll));
  121. this.kag_.AddTagCallBack("animobjchara", new KagScript.KagTagCallBack(this.TagAnimObjChara));
  122. this.kag_.AddTagCallBack("charaactivate", new KagScript.KagTagCallBack(this.TagCharaActivate));
  123. this.kag_.AddTagCallBack("charaactivatefreenpc", new KagScript.KagTagCallBack(this.TagConCharaActivateFreeNPC));
  124. this.kag_.AddTagCallBack("CharaActivate1stRanking", new KagScript.KagTagCallBack(this.TagConCharaActivate1stRanking));
  125. this.kag_.AddTagCallBack("CharaActivateLeader", new KagScript.KagTagCallBack(this.TagConCharaActivateLeader));
  126. this.kag_.AddTagCallBack("manpresetmenuload", new KagScript.KagTagCallBack(this.TagManPresetMenuLoad));
  127. this.kag_.AddTagCallBack("charadeactivate", new KagScript.KagTagCallBack(this.TagCharaDeactivate));
  128. this.kag_.AddTagCallBack("charavisible", new KagScript.KagTagCallBack(this.TagCharaVisible));
  129. this.kag_.AddTagCallBack("charavisiblealloff", new KagScript.KagTagCallBack(this.TagCharaVisibleAllOff));
  130. this.kag_.AddTagCallBack("texmuladd", new KagScript.KagTagCallBack(this.TagTexMulAdd));
  131. this.kag_.AddTagCallBack("texmuldel", new KagScript.KagTagCallBack(this.TagTexMulDel));
  132. this.kag_.AddTagCallBack("startday", new KagScript.KagTagCallBack(this.TagStartDay));
  133. this.kag_.AddTagCallBack("schedulestartmanage", new KagScript.KagTagCallBack(this.TagScheduleStartManage));
  134. this.kag_.AddTagCallBack("endday", new KagScript.KagTagCallBack(this.TagEndDay));
  135. this.kag_.AddTagCallBack("updatemaidpoint", new KagScript.KagTagCallBack(this.TagConUpdateMaidPoint));
  136. this.kag_.AddTagCallBack("vrbgchangeinit", new KagScript.KagTagCallBack(this.TagVRBGChangeInit));
  137. this.kag_.AddTagCallBack("vreventobj", new KagScript.KagTagCallBack(this.TagVREventObj));
  138. this.kag_.AddTagCallBack("vreventgroup", new KagScript.KagTagCallBack(this.TagVREventGroup));
  139. this.kag_.AddTagCallBack("vrfreescene", new KagScript.KagTagCallBack(this.TagVRFreeScene));
  140. this.kag_.AddTagCallBack("vrcamera", new KagScript.KagTagCallBack(this.TagVRCamera));
  141. this.kag_.AddTagCallBack("vrtablet", new KagScript.KagTagCallBack(this.TagVRTablet));
  142. this.kag_.AddTagCallBack("vrchoicesset", new KagScript.KagTagCallBack(this.TagVRChoicesSet));
  143. this.kag_.AddTagCallBack("vrchoicesshow", new KagScript.KagTagCallBack(this.TagVRChoicesShow));
  144. this.kag_.AddTagCallBack("vrchoicesshownonstop", new KagScript.KagTagCallBack(this.TagVRChoicesShowNonStop));
  145. this.kag_.AddTagCallBack("vrdonexttime", new KagScript.KagTagCallBack(this.TagVRDoNextTime));
  146. this.kag_.AddTagCallBack("vrresetheadpos", new KagScript.KagTagCallBack(this.TagVRResetHeadPos));
  147. this.kag_.AddTagCallBack("vrtouchscript", new KagScript.KagTagCallBack(this.TagVRTouchScript));
  148. this.kag_.AddTagCallBack("vrdaytimeshow", new KagScript.KagTagCallBack(this.TagVRDayTimeShow));
  149. this.kag_.AddTagCallBack("vrdialog", new KagScript.KagTagCallBack(this.TagVRDialog));
  150. this.kag_.AddTagCallBack("vrstartmoviemusicplayertv", new KagScript.KagTagCallBack(this.TagVRStartMovieMusicPlayerTV));
  151. this.kag_.AddTagCallBack("vrmovietv", new KagScript.KagTagCallBack(this.TagVRMovieTV));
  152. this.kag_.AddTagCallBack("vrplantwindowshow", new KagScript.KagTagCallBack(this.TagVRPlantWindowShow));
  153. this.kag_.AddTagCallBack("vrplantupdate", new KagScript.KagTagCallBack(this.TagVRPlantUpdate));
  154. this.kag_.AddTagCallBack("vrtutorialstart", new KagScript.KagTagCallBack(this.TagVRTutorialStart));
  155. this.kag_.AddTagCallBack("vrphotomodestart", new KagScript.KagTagCallBack(this.TagVRPhotoModeStart));
  156. this.kag_.AddTagCallBack("vrnochangebg", new KagScript.KagTagCallBack(this.TagVRNoChangeBG));
  157. this.kag_.AddTagCallBack("vrcamtomanhead", new KagScript.KagTagCallBack(this.TagVRCamToManHead));
  158. this.kag_.AddTagCallBack("vrtrophytext", new KagScript.KagTagCallBack(this.TagVRTrophyText));
  159. this.kag_.AddTagCallBack("vrrentalmaidselectstart", new KagScript.KagTagCallBack(this.TagVRRentalMaidSelectStart));
  160. this.kag_.AddTagCallBack("vrtouchuseselect", new KagScript.KagTagCallBack(this.TagVRTouchUseSelect));
  161. this.kag_.AddTagCallBack("vrhintshow", new KagScript.KagTagCallBack(this.TagVRHintShow));
  162. this.kag_.AddTagCallBack("vrkaraokewindowshow", new KagScript.KagTagCallBack(this.TagVRKaraokeWindowShow));
  163. this.kag_.AddTagCallBack("danceresult", new KagScript.KagTagCallBack(this.TagDanceResultStart));
  164. this.kag_.AddTagCallBack("setdance", new KagScript.KagTagCallBack(this.TagSetDanceType));
  165. this.kag_.AddTagCallBack("cutinshoot", new KagScript.KagTagCallBack(this.TagCutinTexShoot));
  166. this.kag_.AddTagCallBack("battlecutin", new KagScript.KagTagCallBack(this.TagBattleCutInStart));
  167. this.kag_.AddTagCallBack("motioncheck", new KagScript.KagTagCallBack(this.TagMotionCheckStart));
  168. this.kag_.AddTagCallBack("setmcskip", new KagScript.KagTagCallBack(this.TagSetMcSkip));
  169. this.kag_.AddTagCallBack("addeventdisplay", new KagScript.KagTagCallBack(this.TagAddedEventDisplay));
  170. this.kag_.AddTagCallBack("tutorialstart", new KagScript.KagTagCallBack(this.TagTutorialStart));
  171. this.kag_.AddTagCallBack("loadsubtitlefile", new KagScript.KagTagCallBack(this.TagLoadSubtitleFile));
  172. this.kag_.AddTagCallBack("endsubtitledisplay", new KagScript.KagTagCallBack(this.TagEndSubtitleDisplay));
  173. this.kag_.AddTagCallBack("subtitledisplayforplayvoice", new KagScript.KagTagCallBack(this.TagSubtitleDisplayForPlayVoice));
  174. this.kag_.AddTagCallBack("subtitledisplay", new KagScript.KagTagCallBack(this.TagSubtitleDisplay));
  175. }
  176. public virtual void Update()
  177. {
  178. if (!this.enabled)
  179. {
  180. return;
  181. }
  182. if (this.fade_wait_)
  183. {
  184. if (this.IsFadeProc())
  185. {
  186. return;
  187. }
  188. this.fade_wait_ = false;
  189. this.Exec();
  190. }
  191. if (0 < this.wait_event_list_.Count)
  192. {
  193. foreach (KeyValuePair<string, WaitEventList> keyValuePair in this.wait_event_list_)
  194. {
  195. keyValuePair.Value.EventCheck();
  196. }
  197. }
  198. if (this.exec_wait_data_.use && this.exec_wait_data_.Check())
  199. {
  200. this.exec_wait_data_.Clear();
  201. this.Exec();
  202. }
  203. }
  204. public virtual bool Exec()
  205. {
  206. if (!this.enabled)
  207. {
  208. return false;
  209. }
  210. if (this.fade_wait_ && this.IsFadeProc())
  211. {
  212. return false;
  213. }
  214. if (this.exec_wait_data_.use)
  215. {
  216. if (!this.exec_wait_data_.Check())
  217. {
  218. return false;
  219. }
  220. this.exec_wait_data_.Clear();
  221. }
  222. this.maidOffsetSetList.Clear();
  223. return this.kag_.Exec();
  224. }
  225. public virtual bool IsExec()
  226. {
  227. return !this.exec_wait_data_.use && this.enabled;
  228. }
  229. public void SetFadeWait(bool value)
  230. {
  231. this.fade_wait_ = value;
  232. }
  233. public void SetExecWait(int wait_time, bool skip_possible)
  234. {
  235. this.exec_wait_data_.Clear();
  236. if (wait_time <= 0)
  237. {
  238. return;
  239. }
  240. this.exec_wait_data_ = new BaseKagManager.ExecWaitData();
  241. this.exec_wait_data_.wait_time = wait_time;
  242. this.exec_wait_data_.skip_possible = skip_possible;
  243. this.exec_wait_data_.start_tick_count = GameMain.tick_count;
  244. this.exec_wait_data_.use = true;
  245. }
  246. public bool SetMaidAllPropSeqWait(Maid maid)
  247. {
  248. if (maid == null || !maid.IsBusy)
  249. {
  250. return false;
  251. }
  252. this.exec_wait_data_ = new BaseKagManager.MaidPropSeqWaitData
  253. {
  254. skip_possible = false,
  255. use = true,
  256. maid = maid
  257. };
  258. return true;
  259. }
  260. public bool SetMaidVoiceWait(Maid maid)
  261. {
  262. if (maid == null)
  263. {
  264. return false;
  265. }
  266. this.exec_wait_data_ = new BaseKagManager.MaidVoiceWaitData
  267. {
  268. skip_possible = false,
  269. use = true,
  270. maid = maid
  271. };
  272. return true;
  273. }
  274. public bool SetDummyVoiceWait()
  275. {
  276. this.exec_wait_data_ = new BaseKagManager.DummyVoiceWaitData
  277. {
  278. skip_possible = false,
  279. use = true
  280. };
  281. return true;
  282. }
  283. public void ClearExecWait()
  284. {
  285. if (this.exec_wait_data_.use && !this.exec_wait_data_.skip_possible)
  286. {
  287. return;
  288. }
  289. this.exec_wait_data_.Clear();
  290. }
  291. public virtual void LoadScriptFile(string file_name, string label_name = "")
  292. {
  293. WaitEventList waitEventList = this.GetWaitEventList("se");
  294. waitEventList.Clear();
  295. this.exec_wait_data_.Clear();
  296. this.kag_.LoadScenario(file_name);
  297. if (label_name != string.Empty)
  298. {
  299. this.kag_.GoToLabel(label_name);
  300. }
  301. }
  302. public virtual void JumpLabel(string label_name)
  303. {
  304. this.exec_wait_data_.Clear();
  305. if (label_name != string.Empty)
  306. {
  307. this.kag_.GoToLabel(label_name);
  308. }
  309. }
  310. public virtual bool TagWait(KagTagSupport tag_data)
  311. {
  312. this.CheckAbsolutelyNecessaryTag(tag_data, "wait", new string[]
  313. {
  314. "time"
  315. });
  316. this.exec_wait_data_.Clear();
  317. int num = tag_data.GetTagProperty("time").AsInteger();
  318. if (num <= 0)
  319. {
  320. return false;
  321. }
  322. bool skip_possible = !tag_data.IsValid("skip") || tag_data.GetTagProperty("skip").AsBool();
  323. this.SetWait(num, skip_possible);
  324. return true;
  325. }
  326. public bool TagFace(KagTagSupport tag_data)
  327. {
  328. Maid maid = this.GetMaidAndMan(tag_data);
  329. if (maid == null)
  330. {
  331. return false;
  332. }
  333. this.CheckAbsolutelyNecessaryTag(tag_data, "face", new string[]
  334. {
  335. "name"
  336. });
  337. string face_name = tag_data.GetTagProperty("name").AsString();
  338. int num = 0;
  339. if (tag_data.IsValid("wait"))
  340. {
  341. num = tag_data.GetTagProperty("wait").AsInteger();
  342. }
  343. WaitEventList waitEventList = this.GetWaitEventList("face");
  344. if (num <= 0)
  345. {
  346. maid.FaceAnime(face_name, 1f, 0);
  347. waitEventList.Clear();
  348. }
  349. else
  350. {
  351. waitEventList.Add(delegate
  352. {
  353. if (maid != null && maid.body0 != null && maid.body0.isLoadedBody)
  354. {
  355. maid.FaceAnime(face_name, 1f, 0);
  356. }
  357. }, num);
  358. }
  359. return false;
  360. }
  361. public bool TagFaceBlend(KagTagSupport tag_data)
  362. {
  363. this.CheckAbsolutelyNecessaryTag(tag_data, "faceblend", new string[]
  364. {
  365. "name"
  366. });
  367. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  368. if (maidAndMan == null)
  369. {
  370. return false;
  371. }
  372. string text = tag_data.GetTagProperty("name").AsString();
  373. if (text == "なし")
  374. {
  375. text = "無し";
  376. }
  377. maidAndMan.FaceBlend(text);
  378. return false;
  379. }
  380. public bool TagFaceBlend2(KagTagSupport tag_data)
  381. {
  382. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  383. if (maidAndMan == null)
  384. {
  385. return false;
  386. }
  387. if (tag_data.IsValid("reset"))
  388. {
  389. maidAndMan.FaceBlend("無し");
  390. }
  391. else
  392. {
  393. TMorph.AddBlendType addBlendType = TMorph.AddBlendType.None;
  394. if (tag_data.IsValid("頬1") || tag_data.IsValid("頬1"))
  395. {
  396. addBlendType |= TMorph.AddBlendType.Cheek1;
  397. }
  398. if (tag_data.IsValid("頬2") || tag_data.IsValid("頬2"))
  399. {
  400. addBlendType |= TMorph.AddBlendType.Cheek2;
  401. }
  402. if (tag_data.IsValid("頬3") || tag_data.IsValid("頬3"))
  403. {
  404. addBlendType |= TMorph.AddBlendType.Cheek3;
  405. }
  406. if (tag_data.IsValid("涙1") || tag_data.IsValid("涙1"))
  407. {
  408. addBlendType |= TMorph.AddBlendType.Tear1;
  409. }
  410. if (tag_data.IsValid("涙2") || tag_data.IsValid("涙2"))
  411. {
  412. addBlendType |= TMorph.AddBlendType.Tear2;
  413. }
  414. if (tag_data.IsValid("涙3") || tag_data.IsValid("涙3"))
  415. {
  416. addBlendType |= TMorph.AddBlendType.Tear3;
  417. }
  418. if (tag_data.IsValid("ショック"))
  419. {
  420. addBlendType |= TMorph.AddBlendType.Shock;
  421. }
  422. if (tag_data.IsValid("よだれ") || tag_data.IsValid("涎"))
  423. {
  424. addBlendType |= TMorph.AddBlendType.Yodare;
  425. }
  426. if (tag_data.IsValid("赤面"))
  427. {
  428. addBlendType |= TMorph.AddBlendType.Blush;
  429. }
  430. if (tag_data.IsValid("玉涙"))
  431. {
  432. addBlendType |= TMorph.AddBlendType.TearBig;
  433. }
  434. maidAndMan.body0.Face.morph.SetValueOriginalBlendSet(addBlendType);
  435. maidAndMan.FaceBlend("オリジナル");
  436. }
  437. return false;
  438. }
  439. public bool TagStartKuchipakuPattern(KagTagSupport tag_data)
  440. {
  441. this.CheckAbsolutelyNecessaryTag(tag_data, "startkuchipakupattern", new string[]
  442. {
  443. "offsettime",
  444. "pattern"
  445. });
  446. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  447. if (maidAndMan == null)
  448. {
  449. return false;
  450. }
  451. maidAndMan.StartKuchipakuPattern(tag_data.GetTagProperty("offsettime").AsReal(), tag_data.GetTagProperty("pattern").AsString(), false);
  452. return false;
  453. }
  454. public bool TagStopKuchipakuPattern(KagTagSupport tag_data)
  455. {
  456. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  457. if (maidAndMan == null)
  458. {
  459. return false;
  460. }
  461. maidAndMan.StopKuchipakuPattern();
  462. return false;
  463. }
  464. public bool TagLipsync(KagTagSupport tag_data)
  465. {
  466. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  467. if (maidAndMan == null)
  468. {
  469. return false;
  470. }
  471. maidAndMan.Lipsync(tag_data.IsValid("on"));
  472. return false;
  473. }
  474. public bool TagMotion(KagTagSupport tag_data)
  475. {
  476. string text = tag_data.GetTagProperty("mot").AsString() + ".anm";
  477. Maid maid = this.GetMaidAndMan(tag_data);
  478. if (maid == null)
  479. {
  480. return false;
  481. }
  482. this.CheckAbsolutelyNecessaryTag(tag_data, "motion", new string[]
  483. {
  484. "mot"
  485. });
  486. string play_motion_name = tag_data.GetTagProperty("mot").AsString() + ".anm";
  487. int blend = 500;
  488. if (tag_data.IsValid("blend"))
  489. {
  490. blend = tag_data.GetTagProperty("blend").AsInteger();
  491. }
  492. bool loop = false;
  493. if (tag_data.IsValid("loop"))
  494. {
  495. loop = tag_data.GetTagProperty("loop").AsBool();
  496. }
  497. int num = 0;
  498. if (tag_data.IsValid("wait"))
  499. {
  500. num = tag_data.GetTagProperty("wait").AsInteger();
  501. }
  502. WaitEventList waitEventList = this.GetWaitEventList("motion");
  503. if (num <= 0)
  504. {
  505. if (maid.Visible)
  506. {
  507. this.PlayMaidMotion(maid, play_motion_name, false, loop, false, GameUty.MillisecondToSecond(blend));
  508. }
  509. waitEventList.Clear();
  510. }
  511. else
  512. {
  513. waitEventList.Add(delegate
  514. {
  515. if (maid != null && maid.Visible && maid.body0 != null && maid.body0.isLoadedBody)
  516. {
  517. this.PlayMaidMotion(maid, play_motion_name, false, loop, false, GameUty.MillisecondToSecond(blend));
  518. }
  519. }, num);
  520. }
  521. return false;
  522. }
  523. public bool TagMotionNext(KagTagSupport tag_data)
  524. {
  525. Maid maid = this.GetMaidAndMan(tag_data);
  526. if (maid == null)
  527. {
  528. return false;
  529. }
  530. this.CheckAbsolutelyNecessaryTag(tag_data, "motionnext", new string[]
  531. {
  532. "mot"
  533. });
  534. string play_motion_name = tag_data.GetTagProperty("mot").AsString() + ".anm";
  535. int blend = 500;
  536. if (tag_data.IsValid("blend"))
  537. {
  538. blend = tag_data.GetTagProperty("blend").AsInteger();
  539. }
  540. bool loop = false;
  541. if (tag_data.IsValid("loop"))
  542. {
  543. loop = tag_data.GetTagProperty("loop").AsBool();
  544. }
  545. WaitEventList waitEventList = this.GetWaitEventList("motion");
  546. if (waitEventList.list.Count <= 0)
  547. {
  548. if (maid.Visible)
  549. {
  550. this.PlayMaidMotion(maid, play_motion_name, false, loop, true, GameUty.MillisecondToSecond(blend));
  551. }
  552. waitEventList.Clear();
  553. }
  554. else
  555. {
  556. int wait_time = waitEventList.list[waitEventList.list.Count - 1].wait_time;
  557. waitEventList.Add(delegate
  558. {
  559. if (maid != null && maid.Visible)
  560. {
  561. this.PlayMaidMotion(maid, play_motion_name, false, loop, true, GameUty.MillisecondToSecond(blend));
  562. }
  563. }, wait_time);
  564. }
  565. return false;
  566. }
  567. public bool TagMotionNextAbs(KagTagSupport tag_data)
  568. {
  569. Maid maid = this.GetMaidAndMan(tag_data);
  570. if (maid == null)
  571. {
  572. return false;
  573. }
  574. this.CheckAbsolutelyNecessaryTag(tag_data, "motionnextabs", new string[]
  575. {
  576. "mot"
  577. });
  578. string play_motion_name = tag_data.GetTagProperty("mot").AsString() + ".anm";
  579. int blend = 500;
  580. if (tag_data.IsValid("blend"))
  581. {
  582. blend = tag_data.GetTagProperty("blend").AsInteger();
  583. }
  584. bool loop = false;
  585. if (tag_data.IsValid("loop"))
  586. {
  587. loop = tag_data.GetTagProperty("loop").AsBool();
  588. }
  589. WaitEventList waitEventList = this.GetWaitEventList("motion");
  590. if (waitEventList.list.Count <= 0)
  591. {
  592. if (maid.Visible)
  593. {
  594. this.PlayMaidMotionAbs(maid, play_motion_name, false, loop, true, GameUty.MillisecondToSecond(blend));
  595. }
  596. waitEventList.Clear();
  597. }
  598. else
  599. {
  600. int wait_time = waitEventList.list[waitEventList.list.Count - 1].wait_time;
  601. waitEventList.Add(delegate
  602. {
  603. if (maid != null && maid.Visible)
  604. {
  605. this.PlayMaidMotionAbs(maid, play_motion_name, false, loop, true, GameUty.MillisecondToSecond(blend));
  606. }
  607. }, wait_time);
  608. }
  609. return false;
  610. }
  611. public bool TagMotionStop(KagTagSupport tag_data)
  612. {
  613. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  614. if (maidAndMan == null)
  615. {
  616. return false;
  617. }
  618. maidAndMan.StopAnime(string.Empty);
  619. WaitEventList waitEventList = this.GetWaitEventList("motion");
  620. waitEventList.Clear();
  621. return false;
  622. }
  623. public bool TagMotionLayerStop(KagTagSupport tag_data)
  624. {
  625. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  626. if (maidAndMan == null)
  627. {
  628. return false;
  629. }
  630. if (tag_data.IsValid("layer"))
  631. {
  632. string[] array = tag_data.GetTagProperty("layer").AsString().Split(new char[]
  633. {
  634. ','
  635. });
  636. for (int i = 0; i < array.Length; i++)
  637. {
  638. maidAndMan.body0.StopAnimeLayer(int.Parse(array[i]));
  639. }
  640. }
  641. if (tag_data.IsValid("range"))
  642. {
  643. string[] array2 = tag_data.GetTagProperty("range").AsString().Split(new char[]
  644. {
  645. '-'
  646. });
  647. NDebug.Assert(array2.Length == 2, "motionlayerstopのrange設定が不正です.個数不一致");
  648. int num = int.Parse(array2[0]);
  649. int num2 = int.Parse(array2[1]);
  650. NDebug.Assert(num <= num2, "motionlayerstopのrange設定が不正です.範囲不一致");
  651. for (int j = num; j <= num2; j++)
  652. {
  653. maidAndMan.body0.StopAnimeLayer(j);
  654. }
  655. }
  656. return false;
  657. }
  658. public bool TagMotionAutoTwist(KagTagSupport tag_data)
  659. {
  660. Maid maid = this.GetMaidAndMan(tag_data);
  661. if (maid == null)
  662. {
  663. return false;
  664. }
  665. Func<string, Maid.AutoTwist[], bool> func = delegate(string tag_name, Maid.AutoTwist[] change_type_array)
  666. {
  667. bool flag = tag_data.IsValid(tag_name);
  668. if (flag && change_type_array != null)
  669. {
  670. string a = tag_data.GetTagProperty(tag_name).AsString();
  671. bool f_bEnable = a == "on";
  672. for (int i = 0; i < change_type_array.Length; i++)
  673. {
  674. maid.SetAutoTwist(change_type_array[i], f_bEnable);
  675. }
  676. }
  677. return flag;
  678. };
  679. if (!func("kata", new Maid.AutoTwist[]
  680. {
  681. Maid.AutoTwist.ShoulderL,
  682. Maid.AutoTwist.ShoulderR
  683. }))
  684. {
  685. func("kata_r", new Maid.AutoTwist[]
  686. {
  687. Maid.AutoTwist.ShoulderR
  688. });
  689. func("kata_l", new Maid.AutoTwist[1]);
  690. }
  691. if (!func("tekubi", new Maid.AutoTwist[]
  692. {
  693. Maid.AutoTwist.WristL,
  694. Maid.AutoTwist.WristR
  695. }))
  696. {
  697. func("tekubi_r", new Maid.AutoTwist[]
  698. {
  699. Maid.AutoTwist.WristR
  700. });
  701. func("tekubi_l", new Maid.AutoTwist[]
  702. {
  703. Maid.AutoTwist.WristL
  704. });
  705. }
  706. if (!func("momo", new Maid.AutoTwist[]
  707. {
  708. Maid.AutoTwist.ThighL,
  709. Maid.AutoTwist.ThighR
  710. }))
  711. {
  712. func("momo_r", new Maid.AutoTwist[]
  713. {
  714. Maid.AutoTwist.ThighR
  715. });
  716. func("momo_l", new Maid.AutoTwist[]
  717. {
  718. Maid.AutoTwist.ThighL
  719. });
  720. }
  721. return false;
  722. }
  723. public bool TagMotionBlendEnabled(KagTagSupport tag_data)
  724. {
  725. bool is_motion_blend = true;
  726. if (tag_data.IsValid("false"))
  727. {
  728. is_motion_blend = false;
  729. }
  730. this.script_mgr_.is_motion_blend = is_motion_blend;
  731. return false;
  732. }
  733. public bool TagMotionScript(KagTagSupport tag_data)
  734. {
  735. string maid_guid = string.Empty;
  736. if (tag_data.IsValid("maid"))
  737. {
  738. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  739. if (maidAndMan != null)
  740. {
  741. maid_guid = maidAndMan.status.guid;
  742. }
  743. }
  744. string man_guid = string.Empty;
  745. if (tag_data.IsValid("man"))
  746. {
  747. Maid maidAndMan2 = this.GetMaidAndMan(tag_data);
  748. if (maidAndMan2 != null)
  749. {
  750. man_guid = maidAndMan2.status.guid;
  751. }
  752. }
  753. this.CheckAbsolutelyNecessaryTag(tag_data, "motionscript", new string[]
  754. {
  755. "file"
  756. });
  757. string file_name = tag_data.GetTagProperty("file").AsString() + ".ks";
  758. string label_name = string.Empty;
  759. if (tag_data.IsValid("label"))
  760. {
  761. label_name = tag_data.GetTagProperty("label").AsString();
  762. }
  763. int num = 0;
  764. if (tag_data.IsValid("wait"))
  765. {
  766. num = tag_data.GetTagProperty("wait").AsInteger();
  767. }
  768. bool vailed_pos = !tag_data.IsValid("npos");
  769. int sloat = 0;
  770. if (tag_data.IsValid("sloat"))
  771. {
  772. sloat = tag_data.GetTagProperty("sloat").AsInteger();
  773. }
  774. WaitEventList waitEventList = this.GetWaitEventList("motion_script");
  775. if (num <= 0)
  776. {
  777. this.script_mgr_.LoadMotionScript(sloat, false, file_name, label_name, maid_guid, man_guid, false, vailed_pos);
  778. waitEventList.Clear();
  779. if (this.script_mgr_.is_motion_all_prop_seq && this.script_mgr_.motion_all_prop_seq_maid != null)
  780. {
  781. this.script_mgr_.motion_all_prop_seq_maid.AllProcPropSeqStart();
  782. this.SetMaidAllPropSeqWait(this.script_mgr_.motion_all_prop_seq_maid);
  783. this.script_mgr_.motion_all_prop_seq_maid = null;
  784. this.script_mgr_.is_motion_all_prop_seq = false;
  785. return true;
  786. }
  787. }
  788. else
  789. {
  790. waitEventList.Add(delegate
  791. {
  792. Maid maid = null;
  793. for (int i = 0; i < GameMain.Instance.CharacterMgr.GetMaidCount(); i++)
  794. {
  795. Maid maid2 = GameMain.Instance.CharacterMgr.GetMaid(i);
  796. if (maid2 != null && maid2.status.guid == maid_guid)
  797. {
  798. maid = maid2;
  799. break;
  800. }
  801. }
  802. if (maid != null && maid.body0 != null && maid.body0.isLoadedBody)
  803. {
  804. this.script_mgr_.LoadMotionScript(sloat, false, file_name, label_name, maid_guid, man_guid, false, vailed_pos);
  805. NDebug.Assert(!this.script_mgr_.is_motion_all_prop_seq, "motionscript wait内でのAllProcPropSeqStartはできません");
  806. }
  807. }, num);
  808. }
  809. return false;
  810. }
  811. public bool TagItemAnime(KagTagSupport tag_data)
  812. {
  813. this.CheckAbsolutelyNecessaryTag(tag_data, "itemanime", new string[]
  814. {
  815. "slot"
  816. });
  817. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  818. if (maidAndMan == null)
  819. {
  820. return false;
  821. }
  822. TBody.SlotID f_slot = (TBody.SlotID)Enum.Parse(typeof(TBody.SlotID), tag_data.GetTagProperty("slot").AsString(), true);
  823. string f_strAnimName = tag_data.GetTagProperty("file").AsString();
  824. maidAndMan.body0.ItemAnimationLoad(f_slot, f_strAnimName);
  825. if (tag_data.IsValid("start"))
  826. {
  827. maidAndMan.body0.ItemAnimationPlay(f_slot, f_strAnimName, tag_data.IsValid("loop"));
  828. }
  829. else if (tag_data.IsValid("stop"))
  830. {
  831. maidAndMan.body0.ItemAnimationStop(f_slot);
  832. }
  833. return false;
  834. }
  835. public bool TagHairPhisics(KagTagSupport tag_data)
  836. {
  837. this.CheckAbsolutelyNecessaryTag(tag_data, "hairphisics", new string[]
  838. {
  839. "hairr"
  840. });
  841. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  842. if (maidAndMan == null)
  843. {
  844. return false;
  845. }
  846. string text = tag_data.GetTagProperty("hairr").AsString();
  847. if (text == "normal")
  848. {
  849. maidAndMan.SetModeHairR(TBody.ModeHirR.Normal);
  850. }
  851. else if (text == "nofront")
  852. {
  853. maidAndMan.SetModeHairR(TBody.ModeHirR.NoFront);
  854. }
  855. else
  856. {
  857. NDebug.Assert("hairrの指定[" + text + "]は間違っています", false);
  858. }
  859. return false;
  860. }
  861. public bool TagBustMove(KagTagSupport tag_data)
  862. {
  863. this.CheckAbsolutelyNecessaryTag(tag_data, "bustmove", new string[]
  864. {
  865. "move"
  866. });
  867. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  868. if (maidAndMan == null)
  869. {
  870. return false;
  871. }
  872. string a = tag_data.GetTagProperty("move").AsString().ToLower();
  873. if (a == "stop")
  874. {
  875. maidAndMan.body0.MuneYureL(0f);
  876. maidAndMan.body0.MuneYureR(0f);
  877. }
  878. else if (a == "lstop")
  879. {
  880. maidAndMan.body0.MuneYureL(0f);
  881. }
  882. else if (a == "rstop")
  883. {
  884. maidAndMan.body0.MuneYureR(0f);
  885. }
  886. else if (a == "non")
  887. {
  888. maidAndMan.body0.MuneYureL(1f);
  889. maidAndMan.body0.MuneYureR(1f);
  890. }
  891. return false;
  892. }
  893. public bool TagPhisicsHit(KagTagSupport tag_data)
  894. {
  895. this.CheckAbsolutelyNecessaryTag(tag_data, "phisicshit", new string[]
  896. {
  897. "height"
  898. });
  899. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  900. if (maidAndMan == null)
  901. {
  902. return false;
  903. }
  904. maidAndMan.body0.SetBoneHitHeightY(tag_data.GetTagProperty("height").AsReal());
  905. return false;
  906. }
  907. public bool TagIKAttachPoint(KagTagSupport tag_data)
  908. {
  909. this.CheckAbsolutelyNecessaryTag(tag_data, "ikattachpoint", new string[]
  910. {
  911. "src",
  912. "srcbone",
  913. "target",
  914. "targetobj",
  915. "targetpoint"
  916. });
  917. Maid maidAndMan = this.GetMaidAndMan(tag_data.GetTagProperty("src").AsString());
  918. Maid maidAndMan2 = this.GetMaidAndMan(tag_data.GetTagProperty("target").AsString());
  919. if (maidAndMan == null || maidAndMan2 == null)
  920. {
  921. return false;
  922. }
  923. string text = tag_data.GetTagProperty("srcbone").AsString();
  924. string attachpoint_name = tag_data.GetTagProperty("targetpoint").AsString();
  925. string tgt_name = tag_data.GetTagProperty("targetobj").AsString();
  926. IKCtrlData ikdata = maidAndMan.IKCtrl.GetIKData(text, false);
  927. if (!ikdata)
  928. {
  929. return false;
  930. }
  931. Vector3 zero = Vector3.zero;
  932. if (tag_data.IsValid("offsetx"))
  933. {
  934. zero.x = tag_data.GetTagProperty("offsetx").AsReal();
  935. }
  936. if (tag_data.IsValid("offsety"))
  937. {
  938. zero.y = tag_data.GetTagProperty("offsety").AsReal();
  939. }
  940. if (tag_data.IsValid("offsetz"))
  941. {
  942. zero.z = tag_data.GetTagProperty("offsetz").AsReal();
  943. }
  944. IKCtrlData.IKAttachType ikattachType = IKCtrlData.IKAttachType.Point;
  945. if (tag_data.IsValid("attach_type"))
  946. {
  947. ikattachType = (IKCtrlData.IKAttachType)Enum.Parse(typeof(IKCtrlData.IKAttachType), tag_data.GetTagProperty("attach_type").AsString());
  948. }
  949. if (ikattachType == IKCtrlData.IKAttachType.NewPoint)
  950. {
  951. ikdata.OffsetWorld = tag_data.IsValid("offset_world");
  952. ikdata.OffsetBone = tag_data.IsValid("offset_bone");
  953. }
  954. ikdata.GetIKEnable(ikattachType).Recet();
  955. if (tag_data.IsValid("disable"))
  956. {
  957. string[] array = tag_data.GetTagProperty("disable").AsString().Split(new char[]
  958. {
  959. ','
  960. });
  961. int i = 0;
  962. while (i < array.Length)
  963. {
  964. string text2 = array[i];
  965. string text3 = text2.ToLower();
  966. if (text3 != null)
  967. {
  968. if (!(text3 == "x"))
  969. {
  970. if (!(text3 == "y"))
  971. {
  972. if (text3 == "z")
  973. {
  974. ikdata.GetIKEnable(ikattachType).EnableZ = false;
  975. }
  976. }
  977. else
  978. {
  979. ikdata.GetIKEnable(ikattachType).EnableY = false;
  980. }
  981. }
  982. else
  983. {
  984. ikdata.GetIKEnable(ikattachType).EnableX = false;
  985. }
  986. }
  987. IL_28C:
  988. i++;
  989. continue;
  990. goto IL_28C;
  991. }
  992. }
  993. string axisbone = string.Empty;
  994. if (tag_data.IsValid("axisbone"))
  995. {
  996. axisbone = tag_data.GetTagProperty("axisbone").AsString();
  997. }
  998. bool do_animation = false;
  999. if (tag_data.IsValid("do_animation"))
  1000. {
  1001. do_animation = true;
  1002. }
  1003. maidAndMan.IKTargetToAttachPoint(text, maidAndMan2, tgt_name, attachpoint_name, zero, ikattachType, axisbone, do_animation, false);
  1004. return false;
  1005. }
  1006. public bool TagIKAttachBone(KagTagSupport tag_data)
  1007. {
  1008. this.CheckAbsolutelyNecessaryTag(tag_data, "ikattachbone", new string[]
  1009. {
  1010. "src",
  1011. "srcbone",
  1012. "target",
  1013. "targetbone"
  1014. });
  1015. Maid maidAndMan = this.GetMaidAndMan(tag_data.GetTagProperty("src").AsString());
  1016. Maid maidAndMan2 = this.GetMaidAndMan(tag_data.GetTagProperty("target").AsString());
  1017. if (maidAndMan == null || maidAndMan2 == null)
  1018. {
  1019. return false;
  1020. }
  1021. string text = tag_data.GetTagProperty("srcbone").AsString();
  1022. string tgtbone_name = tag_data.GetTagProperty("targetbone").AsString();
  1023. IKCtrlData ikdata = maidAndMan.IKCtrl.GetIKData(text, false);
  1024. if (!ikdata)
  1025. {
  1026. return false;
  1027. }
  1028. bool search_sm = tag_data.IsValid("Search_SM_Body");
  1029. Vector3 zero = Vector3.zero;
  1030. if (tag_data.IsValid("offsetx"))
  1031. {
  1032. zero.x = tag_data.GetTagProperty("offsetx").AsReal();
  1033. }
  1034. if (tag_data.IsValid("offsety"))
  1035. {
  1036. zero.y = tag_data.GetTagProperty("offsety").AsReal();
  1037. }
  1038. if (tag_data.IsValid("offsetz"))
  1039. {
  1040. zero.z = tag_data.GetTagProperty("offsetz").AsReal();
  1041. }
  1042. IKCtrlData.IKAttachType ikattachType = IKCtrlData.IKAttachType.Point;
  1043. if (tag_data.IsValid("attach_type"))
  1044. {
  1045. ikattachType = (IKCtrlData.IKAttachType)Enum.Parse(typeof(IKCtrlData.IKAttachType), tag_data.GetTagProperty("attach_type").AsString());
  1046. }
  1047. if (ikattachType == IKCtrlData.IKAttachType.NewPoint)
  1048. {
  1049. ikdata.OffsetWorld = tag_data.IsValid("offset_world");
  1050. ikdata.OffsetBone = tag_data.IsValid("offset_bone");
  1051. }
  1052. ikdata.GetIKEnable(ikattachType).Recet();
  1053. if (tag_data.IsValid("disable"))
  1054. {
  1055. string[] array = tag_data.GetTagProperty("disable").AsString().Split(new char[]
  1056. {
  1057. ','
  1058. });
  1059. int i = 0;
  1060. while (i < array.Length)
  1061. {
  1062. string text2 = array[i];
  1063. string text3 = text2.ToLower();
  1064. if (text3 != null)
  1065. {
  1066. if (!(text3 == "x"))
  1067. {
  1068. if (!(text3 == "y"))
  1069. {
  1070. if (text3 == "z")
  1071. {
  1072. ikdata.GetIKEnable(ikattachType).EnableZ = false;
  1073. }
  1074. }
  1075. else
  1076. {
  1077. ikdata.GetIKEnable(ikattachType).EnableY = false;
  1078. }
  1079. }
  1080. else
  1081. {
  1082. ikdata.GetIKEnable(ikattachType).EnableX = false;
  1083. }
  1084. }
  1085. IL_27F:
  1086. i++;
  1087. continue;
  1088. goto IL_27F;
  1089. }
  1090. }
  1091. bool do_animation = false;
  1092. if (tag_data.IsValid("do_animation"))
  1093. {
  1094. do_animation = true;
  1095. }
  1096. maidAndMan.IKTargetToBone(text, maidAndMan2, tgtbone_name, zero, ikattachType, search_sm, do_animation, false);
  1097. return false;
  1098. }
  1099. public bool TagIKDetach(KagTagSupport tag_data)
  1100. {
  1101. this.CheckAbsolutelyNecessaryTag(tag_data, "ikdetach", new string[]
  1102. {
  1103. "src",
  1104. "srcbone"
  1105. });
  1106. Maid maidAndMan = this.GetMaidAndMan(tag_data.GetTagProperty("src").AsString());
  1107. if (maidAndMan == null)
  1108. {
  1109. return false;
  1110. }
  1111. string text = tag_data.GetTagProperty("srcbone").AsString();
  1112. IKCtrlData ikdata = maidAndMan.IKCtrl.GetIKData(text, false);
  1113. if (!ikdata)
  1114. {
  1115. return false;
  1116. }
  1117. maidAndMan.IKDetach(text);
  1118. return false;
  1119. }
  1120. public bool TagAllIKDetach(KagTagSupport tag_data)
  1121. {
  1122. this.CheckAbsolutelyNecessaryTag(tag_data, "allikdetach", new string[]
  1123. {
  1124. "src"
  1125. });
  1126. Maid maidAndMan = this.GetMaidAndMan(tag_data.GetTagProperty("src").AsString());
  1127. if (maidAndMan == null)
  1128. {
  1129. return false;
  1130. }
  1131. float blendtime = 0f;
  1132. if (tag_data.IsValid("blendtime"))
  1133. {
  1134. blendtime = GameUty.MillisecondToSecond(tag_data.GetTagProperty("blendtime").AsInteger());
  1135. }
  1136. maidAndMan.AllIKDetach(blendtime);
  1137. return false;
  1138. }
  1139. public bool TagIKAttachOdogu(KagTagSupport tag_data)
  1140. {
  1141. this.CheckAbsolutelyNecessaryTag(tag_data, "ikattachodogu", new string[]
  1142. {
  1143. "src",
  1144. "srcbone",
  1145. "odogu"
  1146. });
  1147. Maid maidAndMan = this.GetMaidAndMan(tag_data.GetTagProperty("src").AsString());
  1148. if (!maidAndMan)
  1149. {
  1150. return false;
  1151. }
  1152. string text = tag_data.GetTagProperty("srcbone").AsString();
  1153. string odogu_name = tag_data.GetTagProperty("odogu").AsString();
  1154. IKCtrlData ikdata = maidAndMan.IKCtrl.GetIKData(text, false);
  1155. if (!ikdata)
  1156. {
  1157. return false;
  1158. }
  1159. string tgt_name = string.Empty;
  1160. if (tag_data.IsValid("target"))
  1161. {
  1162. tgt_name = tag_data.GetTagProperty("target").AsString();
  1163. }
  1164. Vector3 zero = Vector3.zero;
  1165. if (tag_data.IsValid("offsetx"))
  1166. {
  1167. zero.x = tag_data.GetTagProperty("offsetx").AsReal();
  1168. }
  1169. if (tag_data.IsValid("offsety"))
  1170. {
  1171. zero.y = tag_data.GetTagProperty("offsety").AsReal();
  1172. }
  1173. if (tag_data.IsValid("offsetz"))
  1174. {
  1175. zero.z = tag_data.GetTagProperty("offsetz").AsReal();
  1176. }
  1177. IKCtrlData.IKAttachType ikattachType = IKCtrlData.IKAttachType.Point;
  1178. if (tag_data.IsValid("attach_type"))
  1179. {
  1180. ikattachType = (IKCtrlData.IKAttachType)Enum.Parse(typeof(IKCtrlData.IKAttachType), tag_data.GetTagProperty("attach_type").AsString());
  1181. }
  1182. if (ikattachType == IKCtrlData.IKAttachType.NewPoint)
  1183. {
  1184. ikdata.OffsetWorld = tag_data.IsValid("offset_world");
  1185. ikdata.OffsetBone = tag_data.IsValid("offset_bone");
  1186. }
  1187. ikdata.GetIKEnable(ikattachType).Recet();
  1188. if (tag_data.IsValid("disable"))
  1189. {
  1190. string[] array = tag_data.GetTagProperty("disable").AsString().Split(new char[]
  1191. {
  1192. ','
  1193. });
  1194. int i = 0;
  1195. while (i < array.Length)
  1196. {
  1197. string text2 = array[i];
  1198. string text3 = text2.ToLower();
  1199. if (text3 != null)
  1200. {
  1201. if (!(text3 == "x"))
  1202. {
  1203. if (!(text3 == "y"))
  1204. {
  1205. if (text3 == "z")
  1206. {
  1207. ikdata.GetIKEnable(ikattachType).EnableZ = false;
  1208. }
  1209. }
  1210. else
  1211. {
  1212. ikdata.GetIKEnable(ikattachType).EnableY = false;
  1213. }
  1214. }
  1215. else
  1216. {
  1217. ikdata.GetIKEnable(ikattachType).EnableX = false;
  1218. }
  1219. }
  1220. IL_267:
  1221. i++;
  1222. continue;
  1223. goto IL_267;
  1224. }
  1225. }
  1226. bool do_animation = false;
  1227. if (tag_data.IsValid("do_animation"))
  1228. {
  1229. do_animation = true;
  1230. }
  1231. maidAndMan.IKTargetToOdogu(text, odogu_name, tgt_name, zero, ikattachType, do_animation, false);
  1232. return false;
  1233. }
  1234. public bool TagIKAttachIKBone(KagTagSupport tag_data)
  1235. {
  1236. this.CheckAbsolutelyNecessaryTag(tag_data, "ikattachbone", new string[]
  1237. {
  1238. "src",
  1239. "srcbone",
  1240. "target",
  1241. "targetbone"
  1242. });
  1243. Maid maidAndMan = this.GetMaidAndMan(tag_data.GetTagProperty("src").AsString());
  1244. Maid maidAndMan2 = this.GetMaidAndMan(tag_data.GetTagProperty("target").AsString());
  1245. if (maidAndMan == null || maidAndMan2 == null)
  1246. {
  1247. return false;
  1248. }
  1249. string text = tag_data.GetTagProperty("srcbone").AsString();
  1250. string bone_name = tag_data.GetTagProperty("targetbone").AsString();
  1251. IKCtrlData ikdata = maidAndMan.IKCtrl.GetIKData(text, false);
  1252. if (!ikdata)
  1253. {
  1254. return false;
  1255. }
  1256. Vector3 zero = Vector3.zero;
  1257. if (tag_data.IsValid("offsetx"))
  1258. {
  1259. zero.x = tag_data.GetTagProperty("offsetx").AsReal();
  1260. }
  1261. if (tag_data.IsValid("offsety"))
  1262. {
  1263. zero.y = tag_data.GetTagProperty("offsety").AsReal();
  1264. }
  1265. if (tag_data.IsValid("offsetz"))
  1266. {
  1267. zero.z = tag_data.GetTagProperty("offsetz").AsReal();
  1268. }
  1269. IKCtrlData.IKAttachType ikattachType = IKCtrlData.IKAttachType.Point;
  1270. if (tag_data.IsValid("attach_type"))
  1271. {
  1272. ikattachType = (IKCtrlData.IKAttachType)Enum.Parse(typeof(IKCtrlData.IKAttachType), tag_data.GetTagProperty("attach_type").AsString());
  1273. }
  1274. if (ikattachType == IKCtrlData.IKAttachType.NewPoint)
  1275. {
  1276. ikdata.OffsetWorld = tag_data.IsValid("offset_world");
  1277. ikdata.OffsetBone = tag_data.IsValid("offset_bone");
  1278. }
  1279. ikdata.GetIKEnable(ikattachType).Recet();
  1280. if (tag_data.IsValid("disable"))
  1281. {
  1282. string[] array = tag_data.GetTagProperty("disable").AsString().Split(new char[]
  1283. {
  1284. ','
  1285. });
  1286. int i = 0;
  1287. while (i < array.Length)
  1288. {
  1289. string text2 = array[i];
  1290. string text3 = text2.ToLower();
  1291. if (text3 != null)
  1292. {
  1293. if (!(text3 == "x"))
  1294. {
  1295. if (!(text3 == "y"))
  1296. {
  1297. if (text3 == "z")
  1298. {
  1299. ikdata.GetIKEnable(ikattachType).EnableZ = false;
  1300. }
  1301. }
  1302. else
  1303. {
  1304. ikdata.GetIKEnable(ikattachType).EnableY = false;
  1305. }
  1306. }
  1307. else
  1308. {
  1309. ikdata.GetIKEnable(ikattachType).EnableX = false;
  1310. }
  1311. }
  1312. IL_272:
  1313. i++;
  1314. continue;
  1315. goto IL_272;
  1316. }
  1317. }
  1318. bool do_animation = tag_data.IsValid("do_animation");
  1319. maidAndMan.IKTargetToIKBone(text, maidAndMan2, bone_name, zero, ikattachType, do_animation, false);
  1320. return false;
  1321. }
  1322. public bool TagIKSetBodyPos(KagTagSupport tag_data)
  1323. {
  1324. this.CheckAbsolutelyNecessaryTag(tag_data, "iksetbodypos", new string[]
  1325. {
  1326. "src",
  1327. "srcbone",
  1328. "target",
  1329. "targetbone"
  1330. });
  1331. Maid maidAndMan = this.GetMaidAndMan(tag_data.GetTagProperty("src").AsString());
  1332. Maid maidAndMan2 = this.GetMaidAndMan(tag_data.GetTagProperty("target").AsString());
  1333. if (maidAndMan == null || maidAndMan2 == null)
  1334. {
  1335. return false;
  1336. }
  1337. string tgtbone_name = tag_data.GetTagProperty("targetbone").AsString();
  1338. Vector3 zero = Vector3.zero;
  1339. if (tag_data.IsValid("offsetx"))
  1340. {
  1341. zero.x = tag_data.GetTagProperty("offsetx").AsReal();
  1342. }
  1343. if (tag_data.IsValid("offsety"))
  1344. {
  1345. zero.y = tag_data.GetTagProperty("offsety").AsReal();
  1346. }
  1347. if (tag_data.IsValid("offsetz"))
  1348. {
  1349. zero.z = tag_data.GetTagProperty("offsetz").AsReal();
  1350. }
  1351. IKCtrlData.IKAttachType attach_type = IKCtrlData.IKAttachType.NewPoint;
  1352. bool search_sm = tag_data.IsValid("Search_SM_Body");
  1353. maidAndMan.IKCtrl.BodyCtrlData.OffsetEnable.Recet();
  1354. if (tag_data.IsValid("disable"))
  1355. {
  1356. string[] array = tag_data.GetTagProperty("disable").AsString().Split(new char[]
  1357. {
  1358. ','
  1359. });
  1360. int i = 0;
  1361. while (i < array.Length)
  1362. {
  1363. string text = array[i];
  1364. string text2 = text.ToLower();
  1365. if (text2 != null)
  1366. {
  1367. if (!(text2 == "x"))
  1368. {
  1369. if (!(text2 == "y"))
  1370. {
  1371. if (text2 == "z")
  1372. {
  1373. maidAndMan.IKCtrl.BodyCtrlData.OffsetEnable.EnableZ = false;
  1374. }
  1375. }
  1376. else
  1377. {
  1378. maidAndMan.IKCtrl.BodyCtrlData.OffsetEnable.EnableY = false;
  1379. }
  1380. }
  1381. else
  1382. {
  1383. maidAndMan.IKCtrl.BodyCtrlData.OffsetEnable.EnableX = false;
  1384. }
  1385. }
  1386. IL_20A:
  1387. i++;
  1388. continue;
  1389. goto IL_20A;
  1390. }
  1391. }
  1392. if (tag_data.IsValid("heighttype"))
  1393. {
  1394. BodyCtrlData.HeightFitType heightFit = (BodyCtrlData.HeightFitType)Enum.Parse(typeof(BodyCtrlData.HeightFitType), tag_data.GetTagProperty("heighttype").AsString());
  1395. maidAndMan.IKCtrl.BodyCtrlData.HeightFit = heightFit;
  1396. }
  1397. maidAndMan.IKCtrl.BodyCtrlData.PosBaseBone = maidAndMan.body0.GetBone(tag_data.GetTagProperty("srcbone").AsString());
  1398. maidAndMan.IKCtrl.BodyCtrlData.OffsetWorld = tag_data.IsValid("offset_world");
  1399. maidAndMan.IKCtrl.BodyCtrlData.OffsetBone = tag_data.IsValid("offset_bone");
  1400. maidAndMan.IKTargetToBone("体全体", maidAndMan2, tgtbone_name, zero, attach_type, search_sm, false, false);
  1401. return false;
  1402. }
  1403. public bool TagIKCheckThrough(KagTagSupport tag_data)
  1404. {
  1405. this.CheckAbsolutelyNecessaryTag(tag_data, "ikcheckthrough", new string[]
  1406. {
  1407. "src",
  1408. "srcbone",
  1409. "checkobj"
  1410. });
  1411. Maid maidAndMan = this.GetMaidAndMan(tag_data.GetTagProperty("src").AsString());
  1412. if (maidAndMan == null)
  1413. {
  1414. return false;
  1415. }
  1416. string tag_name = tag_data.GetTagProperty("srcbone").AsString();
  1417. BipedIKCtrlData ikdata = maidAndMan.IKCtrl.GetIKData<BipedIKCtrlData>(tag_name, false);
  1418. if (tag_data.IsValid("correctbone"))
  1419. {
  1420. ikdata.ToCorrectBone = maidAndMan.body0.GetBone(tag_data.GetTagProperty("correctbone").AsString());
  1421. }
  1422. string text = tag_data.GetTagProperty("checkobj").AsString();
  1423. float weight = 1f;
  1424. if (tag_data.IsValid("bendweight"))
  1425. {
  1426. weight = tag_data.GetTagProperty("bendweight").AsReal();
  1427. }
  1428. BipedIKCtrlData.BorderCorrectData borderCorrectData;
  1429. if (text.Contains("Floor"))
  1430. {
  1431. borderCorrectData = ikdata.FloorCorrect;
  1432. }
  1433. else
  1434. {
  1435. if (!text.Contains("Wall"))
  1436. {
  1437. Debug.LogErrorFormat("{0}は定義できません", new object[]
  1438. {
  1439. text
  1440. });
  1441. return false;
  1442. }
  1443. borderCorrectData = ikdata.WallCorrect;
  1444. }
  1445. if (tag_data.IsValid("correcttype"))
  1446. {
  1447. ikdata.CorrectType = (BipedIKCtrlData.BorderCorrectType)Enum.Parse(typeof(BipedIKCtrlData.BorderCorrectType), tag_data.GetTagProperty("correcttype").AsString());
  1448. if (ikdata.CorrectType == BipedIKCtrlData.BorderCorrectType.HalfBody)
  1449. {
  1450. ikdata.RootEffector.positionWeight = 1f;
  1451. }
  1452. }
  1453. ikdata.Chain.bendConstraint.weight = weight;
  1454. borderCorrectData.Enable = true;
  1455. borderCorrectData.Border = float.Parse(text.Split(new char[]
  1456. {
  1457. ':'
  1458. })[1]);
  1459. return false;
  1460. }
  1461. public bool TagIKBendBoneCtrl(KagTagSupport tag_data)
  1462. {
  1463. this.CheckAbsolutelyNecessaryTag(tag_data, "ikbendbonectrl", new string[]
  1464. {
  1465. "src",
  1466. "srcbone",
  1467. "flagobj"
  1468. });
  1469. Maid maidAndMan = this.GetMaidAndMan(tag_data.GetTagProperty("src").AsString());
  1470. if (maidAndMan == null)
  1471. {
  1472. return false;
  1473. }
  1474. string tag_name = tag_data.GetTagProperty("srcbone").AsString();
  1475. BipedIKCtrlData ikdata = maidAndMan.IKCtrl.GetIKData<BipedIKCtrlData>(tag_name, false);
  1476. if (!ikdata)
  1477. {
  1478. return false;
  1479. }
  1480. string bendweightCtrl = tag_data.GetTagProperty("flagobj").AsString();
  1481. ikdata.SetBendweightCtrl(bendweightCtrl);
  1482. return false;
  1483. }
  1484. public bool TagNextIKFlag(KagTagSupport tag_data)
  1485. {
  1486. this.CheckAbsolutelyNecessaryTag(tag_data, "nextikflag", new string[]
  1487. {
  1488. "src",
  1489. "srcbone",
  1490. "flagobj"
  1491. });
  1492. Maid maidAndMan = this.GetMaidAndMan(tag_data.GetTagProperty("src").AsString());
  1493. if (maidAndMan == null)
  1494. {
  1495. return false;
  1496. }
  1497. string tag_name = tag_data.GetTagProperty("srcbone").AsString();
  1498. IKCtrlData ik_data = maidAndMan.IKCtrl.GetIKData(tag_name, false);
  1499. if (!ik_data)
  1500. {
  1501. return false;
  1502. }
  1503. Action<IKCtrlData.IKAttachType> action = delegate(IKCtrlData.IKAttachType attach_type)
  1504. {
  1505. if (tag_data.IsValid("axis"))
  1506. {
  1507. ik_data.GetFlagData(attach_type).Axis = KasaiUtility.Vec3Parse(tag_data.GetTagProperty("axis").AsString(), ',');
  1508. }
  1509. if (tag_data.IsValid("value"))
  1510. {
  1511. ik_data.GetFlagData(attach_type).OnValue = tag_data.GetTagProperty("value").AsReal();
  1512. }
  1513. ik_data.GetFlagData(attach_type).BlendCtrlSelf = tag_data.IsValid("blendself");
  1514. string name = tag_data.GetTagProperty("flagobj").AsString();
  1515. ik_data.SetFlagTarget(attach_type, name);
  1516. };
  1517. if (tag_data.IsValid("attach_type"))
  1518. {
  1519. IKCtrlData.IKAttachType obj = (IKCtrlData.IKAttachType)Enum.Parse(typeof(IKCtrlData.IKAttachType), tag_data.GetTagProperty("attach_type").AsString());
  1520. action(obj);
  1521. }
  1522. else
  1523. {
  1524. action(IKCtrlData.IKAttachType.NewPoint);
  1525. action(IKCtrlData.IKAttachType.Rotate);
  1526. }
  1527. return false;
  1528. }
  1529. public bool TagIKAttachPointNext(KagTagSupport tag_data)
  1530. {
  1531. this.CheckAbsolutelyNecessaryTag(tag_data, "ikattachpointnext", new string[]
  1532. {
  1533. "src",
  1534. "srcbone",
  1535. "target",
  1536. "targetobj",
  1537. "targetpoint"
  1538. });
  1539. Maid maidAndMan = this.GetMaidAndMan(tag_data.GetTagProperty("src").AsString());
  1540. Maid maidAndMan2 = this.GetMaidAndMan(tag_data.GetTagProperty("target").AsString());
  1541. if (maidAndMan == null || maidAndMan2 == null)
  1542. {
  1543. return false;
  1544. }
  1545. string text = tag_data.GetTagProperty("srcbone").AsString();
  1546. string attachpoint_name = tag_data.GetTagProperty("targetpoint").AsString();
  1547. string tgt_name = tag_data.GetTagProperty("targetobj").AsString();
  1548. IKCtrlData ikdata = maidAndMan.IKCtrl.GetIKData(text, false);
  1549. if (!ikdata)
  1550. {
  1551. return false;
  1552. }
  1553. Vector3 zero = Vector3.zero;
  1554. if (tag_data.IsValid("offsetx"))
  1555. {
  1556. zero.x = tag_data.GetTagProperty("offsetx").AsReal();
  1557. }
  1558. if (tag_data.IsValid("offsety"))
  1559. {
  1560. zero.y = tag_data.GetTagProperty("offsety").AsReal();
  1561. }
  1562. if (tag_data.IsValid("offsetz"))
  1563. {
  1564. zero.z = tag_data.GetTagProperty("offsetz").AsReal();
  1565. }
  1566. IKCtrlData.IKAttachType ikattachType = IKCtrlData.IKAttachType.Point;
  1567. if (tag_data.IsValid("attach_type"))
  1568. {
  1569. ikattachType = (IKCtrlData.IKAttachType)Enum.Parse(typeof(IKCtrlData.IKAttachType), tag_data.GetTagProperty("attach_type").AsString());
  1570. }
  1571. if (ikattachType == IKCtrlData.IKAttachType.NewPoint)
  1572. {
  1573. ikdata.OffsetWorld = tag_data.IsValid("offset_world");
  1574. ikdata.OffsetBone = tag_data.IsValid("offset_bone");
  1575. }
  1576. ikdata.GetIKEnable(ikattachType).Recet();
  1577. if (tag_data.IsValid("disable"))
  1578. {
  1579. string[] array = tag_data.GetTagProperty("disable").AsString().Split(new char[]
  1580. {
  1581. ','
  1582. });
  1583. int i = 0;
  1584. while (i < array.Length)
  1585. {
  1586. string text2 = array[i];
  1587. string text3 = text2.ToLower();
  1588. if (text3 != null)
  1589. {
  1590. if (!(text3 == "x"))
  1591. {
  1592. if (!(text3 == "y"))
  1593. {
  1594. if (text3 == "z")
  1595. {
  1596. ikdata.GetIKEnable(ikattachType).EnableZ = false;
  1597. }
  1598. }
  1599. else
  1600. {
  1601. ikdata.GetIKEnable(ikattachType).EnableY = false;
  1602. }
  1603. }
  1604. else
  1605. {
  1606. ikdata.GetIKEnable(ikattachType).EnableX = false;
  1607. }
  1608. }
  1609. IL_28C:
  1610. i++;
  1611. continue;
  1612. goto IL_28C;
  1613. }
  1614. }
  1615. string axisbone = string.Empty;
  1616. if (tag_data.IsValid("axisbone"))
  1617. {
  1618. axisbone = tag_data.GetTagProperty("axisbone").AsString();
  1619. }
  1620. bool do_animation = false;
  1621. if (tag_data.IsValid("do_animation"))
  1622. {
  1623. do_animation = true;
  1624. }
  1625. maidAndMan.IKTargetToAttachPoint(text, maidAndMan2, tgt_name, attachpoint_name, zero, ikattachType, axisbone, do_animation, true);
  1626. return false;
  1627. }
  1628. public bool TagIKAttachBoneNext(KagTagSupport tag_data)
  1629. {
  1630. this.CheckAbsolutelyNecessaryTag(tag_data, "ikattachbonenext", new string[]
  1631. {
  1632. "src",
  1633. "srcbone",
  1634. "target",
  1635. "targetbone"
  1636. });
  1637. Maid maidAndMan = this.GetMaidAndMan(tag_data.GetTagProperty("src").AsString());
  1638. Maid maidAndMan2 = this.GetMaidAndMan(tag_data.GetTagProperty("target").AsString());
  1639. if (maidAndMan == null || maidAndMan2 == null)
  1640. {
  1641. return false;
  1642. }
  1643. string text = tag_data.GetTagProperty("srcbone").AsString();
  1644. string tgtbone_name = tag_data.GetTagProperty("targetbone").AsString();
  1645. IKCtrlData ikdata = maidAndMan.IKCtrl.GetIKData(text, false);
  1646. if (!ikdata)
  1647. {
  1648. return false;
  1649. }
  1650. bool search_sm = tag_data.IsValid("Search_SM_Body");
  1651. Vector3 zero = Vector3.zero;
  1652. if (tag_data.IsValid("offsetx"))
  1653. {
  1654. zero.x = tag_data.GetTagProperty("offsetx").AsReal();
  1655. }
  1656. if (tag_data.IsValid("offsety"))
  1657. {
  1658. zero.y = tag_data.GetTagProperty("offsety").AsReal();
  1659. }
  1660. if (tag_data.IsValid("offsetz"))
  1661. {
  1662. zero.z = tag_data.GetTagProperty("offsetz").AsReal();
  1663. }
  1664. IKCtrlData.IKAttachType ikattachType = IKCtrlData.IKAttachType.Point;
  1665. if (tag_data.IsValid("attach_type"))
  1666. {
  1667. ikattachType = (IKCtrlData.IKAttachType)Enum.Parse(typeof(IKCtrlData.IKAttachType), tag_data.GetTagProperty("attach_type").AsString());
  1668. }
  1669. if (ikattachType == IKCtrlData.IKAttachType.NewPoint)
  1670. {
  1671. ikdata.OffsetWorld = tag_data.IsValid("offset_world");
  1672. ikdata.OffsetBone = tag_data.IsValid("offset_bone");
  1673. }
  1674. ikdata.GetIKEnable(ikattachType).Recet();
  1675. if (tag_data.IsValid("disable"))
  1676. {
  1677. string[] array = tag_data.GetTagProperty("disable").AsString().Split(new char[]
  1678. {
  1679. ','
  1680. });
  1681. int i = 0;
  1682. while (i < array.Length)
  1683. {
  1684. string text2 = array[i];
  1685. string text3 = text2.ToLower();
  1686. if (text3 != null)
  1687. {
  1688. if (!(text3 == "x"))
  1689. {
  1690. if (!(text3 == "y"))
  1691. {
  1692. if (text3 == "z")
  1693. {
  1694. ikdata.GetIKEnable(ikattachType).EnableZ = false;
  1695. }
  1696. }
  1697. else
  1698. {
  1699. ikdata.GetIKEnable(ikattachType).EnableY = false;
  1700. }
  1701. }
  1702. else
  1703. {
  1704. ikdata.GetIKEnable(ikattachType).EnableX = false;
  1705. }
  1706. }
  1707. IL_27F:
  1708. i++;
  1709. continue;
  1710. goto IL_27F;
  1711. }
  1712. }
  1713. bool do_animation = false;
  1714. if (tag_data.IsValid("do_animation"))
  1715. {
  1716. do_animation = true;
  1717. }
  1718. maidAndMan.IKTargetToBone(text, maidAndMan2, tgtbone_name, zero, ikattachType, search_sm, do_animation, true);
  1719. return false;
  1720. }
  1721. public bool TagIKAttachOdoguNext(KagTagSupport tag_data)
  1722. {
  1723. this.CheckAbsolutelyNecessaryTag(tag_data, "ikattachodogunext", new string[]
  1724. {
  1725. "src",
  1726. "srcbone",
  1727. "odogu"
  1728. });
  1729. Maid maidAndMan = this.GetMaidAndMan(tag_data.GetTagProperty("src").AsString());
  1730. if (!maidAndMan)
  1731. {
  1732. return false;
  1733. }
  1734. string text = tag_data.GetTagProperty("srcbone").AsString();
  1735. string odogu_name = tag_data.GetTagProperty("odogu").AsString();
  1736. IKCtrlData ikdata = maidAndMan.IKCtrl.GetIKData(text, false);
  1737. if (!ikdata)
  1738. {
  1739. return false;
  1740. }
  1741. string tgt_name = string.Empty;
  1742. if (tag_data.IsValid("target"))
  1743. {
  1744. tgt_name = tag_data.GetTagProperty("target").AsString();
  1745. }
  1746. Vector3 zero = Vector3.zero;
  1747. if (tag_data.IsValid("offsetx"))
  1748. {
  1749. zero.x = tag_data.GetTagProperty("offsetx").AsReal();
  1750. }
  1751. if (tag_data.IsValid("offsety"))
  1752. {
  1753. zero.y = tag_data.GetTagProperty("offsety").AsReal();
  1754. }
  1755. if (tag_data.IsValid("offsetz"))
  1756. {
  1757. zero.z = tag_data.GetTagProperty("offsetz").AsReal();
  1758. }
  1759. IKCtrlData.IKAttachType ikattachType = IKCtrlData.IKAttachType.Point;
  1760. if (tag_data.IsValid("attach_type"))
  1761. {
  1762. ikattachType = (IKCtrlData.IKAttachType)Enum.Parse(typeof(IKCtrlData.IKAttachType), tag_data.GetTagProperty("attach_type").AsString());
  1763. }
  1764. if (ikattachType == IKCtrlData.IKAttachType.NewPoint)
  1765. {
  1766. ikdata.OffsetWorld = tag_data.IsValid("offset_world");
  1767. ikdata.OffsetBone = tag_data.IsValid("offset_bone");
  1768. }
  1769. ikdata.GetIKEnable(ikattachType).Recet();
  1770. if (tag_data.IsValid("disable"))
  1771. {
  1772. string[] array = tag_data.GetTagProperty("disable").AsString().Split(new char[]
  1773. {
  1774. ','
  1775. });
  1776. int i = 0;
  1777. while (i < array.Length)
  1778. {
  1779. string text2 = array[i];
  1780. string text3 = text2.ToLower();
  1781. if (text3 != null)
  1782. {
  1783. if (!(text3 == "x"))
  1784. {
  1785. if (!(text3 == "y"))
  1786. {
  1787. if (text3 == "z")
  1788. {
  1789. ikdata.GetIKEnable(ikattachType).EnableZ = false;
  1790. }
  1791. }
  1792. else
  1793. {
  1794. ikdata.GetIKEnable(ikattachType).EnableY = false;
  1795. }
  1796. }
  1797. else
  1798. {
  1799. ikdata.GetIKEnable(ikattachType).EnableX = false;
  1800. }
  1801. }
  1802. IL_267:
  1803. i++;
  1804. continue;
  1805. goto IL_267;
  1806. }
  1807. }
  1808. bool do_animation = false;
  1809. if (tag_data.IsValid("do_animation"))
  1810. {
  1811. do_animation = true;
  1812. }
  1813. maidAndMan.IKTargetToOdogu(text, odogu_name, tgt_name, zero, ikattachType, do_animation, true);
  1814. return false;
  1815. }
  1816. public bool TagIKAttachIKBoneNext(KagTagSupport tag_data)
  1817. {
  1818. this.CheckAbsolutelyNecessaryTag(tag_data, "ikattachbonenext", new string[]
  1819. {
  1820. "src",
  1821. "srcbone",
  1822. "target",
  1823. "targetbone"
  1824. });
  1825. Maid maidAndMan = this.GetMaidAndMan(tag_data.GetTagProperty("src").AsString());
  1826. Maid maidAndMan2 = this.GetMaidAndMan(tag_data.GetTagProperty("target").AsString());
  1827. if (maidAndMan == null || maidAndMan2 == null)
  1828. {
  1829. return false;
  1830. }
  1831. string text = tag_data.GetTagProperty("srcbone").AsString();
  1832. string bone_name = tag_data.GetTagProperty("targetbone").AsString();
  1833. IKCtrlData ikdata = maidAndMan.IKCtrl.GetIKData(text, false);
  1834. if (!ikdata)
  1835. {
  1836. return false;
  1837. }
  1838. Vector3 zero = Vector3.zero;
  1839. if (tag_data.IsValid("offsetx"))
  1840. {
  1841. zero.x = tag_data.GetTagProperty("offsetx").AsReal();
  1842. }
  1843. if (tag_data.IsValid("offsety"))
  1844. {
  1845. zero.y = tag_data.GetTagProperty("offsety").AsReal();
  1846. }
  1847. if (tag_data.IsValid("offsetz"))
  1848. {
  1849. zero.z = tag_data.GetTagProperty("offsetz").AsReal();
  1850. }
  1851. IKCtrlData.IKAttachType ikattachType = IKCtrlData.IKAttachType.Point;
  1852. if (tag_data.IsValid("attach_type"))
  1853. {
  1854. ikattachType = (IKCtrlData.IKAttachType)Enum.Parse(typeof(IKCtrlData.IKAttachType), tag_data.GetTagProperty("attach_type").AsString());
  1855. }
  1856. if (ikattachType == IKCtrlData.IKAttachType.NewPoint)
  1857. {
  1858. ikdata.OffsetWorld = tag_data.IsValid("offset_world");
  1859. ikdata.OffsetBone = tag_data.IsValid("offset_bone");
  1860. }
  1861. ikdata.GetIKEnable(ikattachType).Recet();
  1862. if (tag_data.IsValid("disable"))
  1863. {
  1864. string[] array = tag_data.GetTagProperty("disable").AsString().Split(new char[]
  1865. {
  1866. ','
  1867. });
  1868. int i = 0;
  1869. while (i < array.Length)
  1870. {
  1871. string text2 = array[i];
  1872. string text3 = text2.ToLower();
  1873. if (text3 != null)
  1874. {
  1875. if (!(text3 == "x"))
  1876. {
  1877. if (!(text3 == "y"))
  1878. {
  1879. if (text3 == "z")
  1880. {
  1881. ikdata.GetIKEnable(ikattachType).EnableZ = false;
  1882. }
  1883. }
  1884. else
  1885. {
  1886. ikdata.GetIKEnable(ikattachType).EnableY = false;
  1887. }
  1888. }
  1889. else
  1890. {
  1891. ikdata.GetIKEnable(ikattachType).EnableX = false;
  1892. }
  1893. }
  1894. IL_272:
  1895. i++;
  1896. continue;
  1897. goto IL_272;
  1898. }
  1899. }
  1900. bool do_animation = tag_data.IsValid("do_animation");
  1901. maidAndMan.IKTargetToIKBone(text, maidAndMan2, bone_name, zero, ikattachType, do_animation, true);
  1902. return false;
  1903. }
  1904. public bool TagAllPos(KagTagSupport tag_data)
  1905. {
  1906. bool flag = false;
  1907. bool flag2 = false;
  1908. Vector3 zero = Vector3.zero;
  1909. Vector3 zero2 = Vector3.zero;
  1910. if (tag_data.IsValid("x"))
  1911. {
  1912. flag = true;
  1913. zero.x = tag_data.GetTagProperty("x").AsReal();
  1914. }
  1915. if (tag_data.IsValid("y"))
  1916. {
  1917. flag = true;
  1918. zero.y = tag_data.GetTagProperty("y").AsReal();
  1919. }
  1920. if (tag_data.IsValid("z"))
  1921. {
  1922. flag = true;
  1923. zero.z = tag_data.GetTagProperty("z").AsReal();
  1924. }
  1925. if (tag_data.IsValid("rx"))
  1926. {
  1927. flag2 = true;
  1928. zero2.x = tag_data.GetTagProperty("rx").AsReal();
  1929. }
  1930. if (tag_data.IsValid("ry"))
  1931. {
  1932. flag2 = true;
  1933. zero2.y = tag_data.GetTagProperty("ry").AsReal();
  1934. }
  1935. if (tag_data.IsValid("rz"))
  1936. {
  1937. flag2 = true;
  1938. zero2.z = tag_data.GetTagProperty("rz").AsReal();
  1939. }
  1940. if (flag)
  1941. {
  1942. GameMain.Instance.CharacterMgr.SetCharaAllPos(zero);
  1943. if (!this.script_mgr_.compatibilityMode)
  1944. {
  1945. for (int i = 0; i < GameMain.Instance.CharacterMgr.GetMaidCount(); i++)
  1946. {
  1947. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(i);
  1948. if (maid != null && maid.body0 != null)
  1949. {
  1950. maid.body0.SetBoneHitHeightY(zero.y);
  1951. }
  1952. }
  1953. }
  1954. }
  1955. if (flag2)
  1956. {
  1957. GameMain.Instance.CharacterMgr.SetCharaAllRot(zero2);
  1958. }
  1959. return false;
  1960. }
  1961. public bool TagAllOffSet(KagTagSupport tag_data)
  1962. {
  1963. bool flag = false;
  1964. bool flag2 = false;
  1965. Vector3 zero = Vector3.zero;
  1966. Vector3 zero2 = Vector3.zero;
  1967. if (tag_data.IsValid("x"))
  1968. {
  1969. flag = true;
  1970. zero.x = tag_data.GetTagProperty("x").AsReal();
  1971. }
  1972. if (tag_data.IsValid("y"))
  1973. {
  1974. flag = true;
  1975. zero.y = tag_data.GetTagProperty("y").AsReal();
  1976. }
  1977. if (tag_data.IsValid("z"))
  1978. {
  1979. flag = true;
  1980. zero.z = tag_data.GetTagProperty("z").AsReal();
  1981. }
  1982. if (tag_data.IsValid("rx"))
  1983. {
  1984. flag2 = true;
  1985. zero2.x = tag_data.GetTagProperty("rx").AsReal();
  1986. }
  1987. if (tag_data.IsValid("ry"))
  1988. {
  1989. flag2 = true;
  1990. zero2.y = tag_data.GetTagProperty("ry").AsReal();
  1991. }
  1992. if (tag_data.IsValid("rz"))
  1993. {
  1994. flag2 = true;
  1995. zero2.z = tag_data.GetTagProperty("rz").AsReal();
  1996. }
  1997. if (flag)
  1998. {
  1999. GameMain.Instance.CharacterMgr.CharaAllOfsetPos(zero);
  2000. }
  2001. if (flag2)
  2002. {
  2003. GameMain.Instance.CharacterMgr.CharaAllOfsetRot(zero2);
  2004. }
  2005. return false;
  2006. }
  2007. public bool TagAddAllOffset(KagTagSupport tag_data)
  2008. {
  2009. bool flag = false;
  2010. bool flag2 = false;
  2011. Vector3 zero = Vector3.zero;
  2012. Vector3 zero2 = Vector3.zero;
  2013. if (tag_data.IsValid("x"))
  2014. {
  2015. flag = true;
  2016. zero.x = tag_data.GetTagProperty("x").AsReal();
  2017. }
  2018. if (tag_data.IsValid("y"))
  2019. {
  2020. flag = true;
  2021. zero.y = tag_data.GetTagProperty("y").AsReal();
  2022. }
  2023. if (tag_data.IsValid("z"))
  2024. {
  2025. flag = true;
  2026. zero.z = tag_data.GetTagProperty("z").AsReal();
  2027. }
  2028. if (tag_data.IsValid("rx"))
  2029. {
  2030. flag2 = true;
  2031. zero2.x = tag_data.GetTagProperty("rx").AsReal();
  2032. }
  2033. if (tag_data.IsValid("ry"))
  2034. {
  2035. flag2 = true;
  2036. zero2.y = tag_data.GetTagProperty("ry").AsReal();
  2037. }
  2038. if (tag_data.IsValid("rz"))
  2039. {
  2040. flag2 = true;
  2041. zero2.z = tag_data.GetTagProperty("rz").AsReal();
  2042. }
  2043. if (flag)
  2044. {
  2045. Vector3 charaAllOfsetPos = GameMain.Instance.CharacterMgr.GetCharaAllOfsetPos();
  2046. GameMain.Instance.CharacterMgr.CharaAllOfsetPos(charaAllOfsetPos + zero);
  2047. }
  2048. if (flag2)
  2049. {
  2050. Vector3 charaAllOfsetRot = GameMain.Instance.CharacterMgr.GetCharaAllOfsetRot();
  2051. GameMain.Instance.CharacterMgr.CharaAllOfsetRot(charaAllOfsetRot + zero2);
  2052. }
  2053. return false;
  2054. }
  2055. public bool TagOffSet(KagTagSupport tag_data)
  2056. {
  2057. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  2058. if (maidAndMan == null)
  2059. {
  2060. return false;
  2061. }
  2062. bool flag = false;
  2063. bool flag2 = false;
  2064. Vector3 zero = Vector3.zero;
  2065. Vector3 zero2 = Vector3.zero;
  2066. if (tag_data.IsValid("x"))
  2067. {
  2068. flag = true;
  2069. zero.x = tag_data.GetTagProperty("x").AsReal();
  2070. }
  2071. if (tag_data.IsValid("y"))
  2072. {
  2073. flag = true;
  2074. zero.y = tag_data.GetTagProperty("y").AsReal();
  2075. }
  2076. if (tag_data.IsValid("z"))
  2077. {
  2078. flag = true;
  2079. zero.z = tag_data.GetTagProperty("z").AsReal();
  2080. }
  2081. if (tag_data.IsValid("rx"))
  2082. {
  2083. flag2 = true;
  2084. zero2.x = tag_data.GetTagProperty("rx").AsReal();
  2085. }
  2086. if (tag_data.IsValid("ry"))
  2087. {
  2088. flag2 = true;
  2089. zero2.y = tag_data.GetTagProperty("ry").AsReal();
  2090. }
  2091. if (tag_data.IsValid("rz"))
  2092. {
  2093. flag2 = true;
  2094. zero2.z = tag_data.GetTagProperty("rz").AsReal();
  2095. }
  2096. if (flag)
  2097. {
  2098. maidAndMan.SetPos(zero);
  2099. }
  2100. if (flag2)
  2101. {
  2102. maidAndMan.SetRot(zero2);
  2103. }
  2104. return false;
  2105. }
  2106. public bool TagAllResetPos(KagTagSupport tag_data)
  2107. {
  2108. GameMain.Instance.CharacterMgr.ResetCharaPosAll();
  2109. return false;
  2110. }
  2111. public bool TagTransform(KagTagSupport tag_data)
  2112. {
  2113. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  2114. return maidAndMan == null && false;
  2115. }
  2116. public bool TagPosition(KagTagSupport tag_data)
  2117. {
  2118. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  2119. return maidAndMan == null && false;
  2120. }
  2121. public bool TagRotation(KagTagSupport tag_data)
  2122. {
  2123. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  2124. return maidAndMan == null && false;
  2125. }
  2126. public bool TagCamera(KagTagSupport tag_data)
  2127. {
  2128. Vector3 zero = Vector3.zero;
  2129. Vector2 zero2 = Vector2.zero;
  2130. float f_fRadius = 0f;
  2131. if (tag_data.IsValid("reset"))
  2132. {
  2133. GameMain.Instance.MainCamera.ResetFromScriptOnTarget();
  2134. return false;
  2135. }
  2136. if (tag_data.IsValid("radius"))
  2137. {
  2138. f_fRadius = tag_data.GetTagProperty("radius").AsReal();
  2139. }
  2140. if (tag_data.IsValid("cx"))
  2141. {
  2142. zero.x = tag_data.GetTagProperty("cx").AsReal();
  2143. }
  2144. if (tag_data.IsValid("cy"))
  2145. {
  2146. zero.y = tag_data.GetTagProperty("cy").AsReal();
  2147. }
  2148. if (tag_data.IsValid("cz"))
  2149. {
  2150. zero.z = tag_data.GetTagProperty("cz").AsReal();
  2151. }
  2152. if (tag_data.IsValid("rx"))
  2153. {
  2154. zero2.x = tag_data.GetTagProperty("rx").AsReal();
  2155. }
  2156. if (tag_data.IsValid("ry"))
  2157. {
  2158. zero2.y = tag_data.GetTagProperty("ry").AsReal();
  2159. }
  2160. GameMain.Instance.MainCamera.SetFromScriptOnTarget(zero, f_fRadius, zero2);
  2161. return false;
  2162. }
  2163. public bool TagCameraChase(KagTagSupport tag_data)
  2164. {
  2165. this.CheckAbsolutelyNecessaryTag(tag_data, "camerachase", new string[]
  2166. {
  2167. "chase"
  2168. });
  2169. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  2170. if (maidAndMan == null)
  2171. {
  2172. return false;
  2173. }
  2174. string f_strAttachBone = tag_data.GetTagProperty("chase").AsString();
  2175. Vector3 zero = Vector3.zero;
  2176. if (tag_data.IsValid("offsx"))
  2177. {
  2178. zero.x = tag_data.GetTagProperty("offsx").AsReal();
  2179. }
  2180. if (tag_data.IsValid("offsy"))
  2181. {
  2182. zero.y = tag_data.GetTagProperty("offsy").AsReal();
  2183. }
  2184. if (tag_data.IsValid("offsz"))
  2185. {
  2186. zero.z = tag_data.GetTagProperty("offsz").AsReal();
  2187. }
  2188. bool f_fOnece = true;
  2189. if (tag_data.IsValid("continue"))
  2190. {
  2191. f_fOnece = false;
  2192. }
  2193. int millisecond = 0;
  2194. if (tag_data.IsValid("time"))
  2195. {
  2196. millisecond = tag_data.GetTagProperty("time").AsInteger();
  2197. }
  2198. GameMain.Instance.MainCamera.SetChaseCamera(maidAndMan, f_strAttachBone, zero, f_fOnece, GameUty.MillisecondToSecond(millisecond));
  2199. return false;
  2200. }
  2201. public bool TagCameraChaseStop(KagTagSupport tag_data)
  2202. {
  2203. this.CheckAbsolutelyNecessaryTag(tag_data, "camerachasestop", new string[0]);
  2204. GameMain.Instance.MainCamera.RemoveChaseCameraAll();
  2205. return false;
  2206. }
  2207. public bool TagCameraAnimationStart(KagTagSupport tag_data)
  2208. {
  2209. this.CheckAbsolutelyNecessaryTag(tag_data, "cameraanimationstart", new string[]
  2210. {
  2211. "time"
  2212. });
  2213. bool f_bStart = false;
  2214. Vector3 zero = Vector3.zero;
  2215. Vector3 zero2 = Vector3.zero;
  2216. Vector2 zero3 = Vector2.zero;
  2217. Vector2 zero4 = Vector2.zero;
  2218. float f_fRadius = 0f;
  2219. float f_fSRadius = 0f;
  2220. float f_fTime = GameUty.MillisecondToSecond(tag_data.GetTagProperty("time").AsInteger());
  2221. string f_strEaseType = string.Empty;
  2222. bool f_bSkip = tag_data.IsValid("skip");
  2223. if (tag_data.IsValid("radius"))
  2224. {
  2225. f_fRadius = tag_data.GetTagProperty("radius").AsReal();
  2226. }
  2227. if (tag_data.IsValid("cx"))
  2228. {
  2229. zero.x = tag_data.GetTagProperty("cx").AsReal();
  2230. }
  2231. if (tag_data.IsValid("cy"))
  2232. {
  2233. zero.y = tag_data.GetTagProperty("cy").AsReal();
  2234. }
  2235. if (tag_data.IsValid("cz"))
  2236. {
  2237. zero.z = tag_data.GetTagProperty("cz").AsReal();
  2238. }
  2239. if (tag_data.IsValid("rx"))
  2240. {
  2241. zero3.x = tag_data.GetTagProperty("rx").AsReal();
  2242. }
  2243. if (tag_data.IsValid("ry"))
  2244. {
  2245. zero3.y = tag_data.GetTagProperty("ry").AsReal();
  2246. }
  2247. if (tag_data.IsValid("sradius"))
  2248. {
  2249. f_fSRadius = tag_data.GetTagProperty("sradius").AsReal();
  2250. f_bStart = true;
  2251. }
  2252. if (tag_data.IsValid("scx"))
  2253. {
  2254. zero2.x = tag_data.GetTagProperty("scx").AsReal();
  2255. f_bStart = true;
  2256. }
  2257. if (tag_data.IsValid("scy"))
  2258. {
  2259. zero2.y = tag_data.GetTagProperty("scy").AsReal();
  2260. f_bStart = true;
  2261. }
  2262. if (tag_data.IsValid("scz"))
  2263. {
  2264. zero2.z = tag_data.GetTagProperty("scz").AsReal();
  2265. f_bStart = true;
  2266. }
  2267. if (tag_data.IsValid("srx"))
  2268. {
  2269. zero4.x = tag_data.GetTagProperty("srx").AsReal();
  2270. f_bStart = true;
  2271. }
  2272. if (tag_data.IsValid("sry"))
  2273. {
  2274. zero4.y = tag_data.GetTagProperty("sry").AsReal();
  2275. f_bStart = true;
  2276. }
  2277. if (tag_data.IsValid("easetype"))
  2278. {
  2279. f_strEaseType = tag_data.GetTagProperty("easetype").AsString();
  2280. }
  2281. float f_fDelay = 0f;
  2282. if (tag_data.IsValid("delay"))
  2283. {
  2284. f_fDelay = GameUty.MillisecondToSecond(tag_data.GetTagProperty("delay").AsInteger());
  2285. }
  2286. GameMain.Instance.MainCamera.StartAnimationTo(f_bStart, zero2, f_fSRadius, zero4, zero, f_fRadius, zero3, f_fTime, f_strEaseType, f_bSkip, f_fDelay);
  2287. return false;
  2288. }
  2289. public bool TagCameraControl(KagTagSupport tag_data)
  2290. {
  2291. GameMain.Instance.MainCamera.SetControl(tag_data.IsValid("true"));
  2292. return false;
  2293. }
  2294. public bool TagLightMain(KagTagSupport tag_data)
  2295. {
  2296. Vector3 zero = Vector3.zero;
  2297. float intensity = 0f;
  2298. bool flag = false;
  2299. bool flag2 = false;
  2300. if (tag_data.IsValid("rx"))
  2301. {
  2302. zero.x = tag_data.GetTagProperty("rx").AsReal();
  2303. flag = true;
  2304. }
  2305. if (tag_data.IsValid("ry"))
  2306. {
  2307. zero.y = tag_data.GetTagProperty("ry").AsReal();
  2308. flag = true;
  2309. }
  2310. if (tag_data.IsValid("rz"))
  2311. {
  2312. zero.z = tag_data.GetTagProperty("rz").AsReal();
  2313. flag = true;
  2314. }
  2315. if (tag_data.IsValid("intensity"))
  2316. {
  2317. intensity = tag_data.GetTagProperty("intensity").AsReal();
  2318. flag2 = true;
  2319. }
  2320. if (flag)
  2321. {
  2322. GameMain.Instance.MainLight.SetRotation(zero);
  2323. }
  2324. if (flag2)
  2325. {
  2326. GameMain.Instance.MainLight.SetIntensity(intensity);
  2327. }
  2328. return false;
  2329. }
  2330. public bool TagPlayBgm(KagTagSupport tag_data)
  2331. {
  2332. this.CheckAbsolutelyNecessaryTag(tag_data, "playbgm", new string[]
  2333. {
  2334. "file"
  2335. });
  2336. string text = tag_data.GetTagProperty("file").AsString();
  2337. text = Path.ChangeExtension(text, ".ogg");
  2338. int millisecond = 0;
  2339. if (tag_data.IsValid("fade"))
  2340. {
  2341. millisecond = tag_data.GetTagProperty("fade").AsInteger();
  2342. }
  2343. if (tag_data.IsValid("old"))
  2344. {
  2345. string f_strFileName = Path.GetFileNameWithoutExtension(text) + "_OLD.ogg";
  2346. if (GameUty.FileSystem.IsExistentFile(f_strFileName))
  2347. {
  2348. GameMain.Instance.SoundMgr.PlayBGM(f_strFileName, GameUty.MillisecondToSecond(millisecond), true);
  2349. }
  2350. else
  2351. {
  2352. GameMain.Instance.SoundMgr.PlayBGMLegacy(text, GameUty.MillisecondToSecond(millisecond), true);
  2353. }
  2354. }
  2355. else
  2356. {
  2357. GameMain.Instance.SoundMgr.PlayBGM(text, GameUty.MillisecondToSecond(millisecond), true);
  2358. }
  2359. return false;
  2360. }
  2361. public bool TagStopBgm(KagTagSupport tag_data)
  2362. {
  2363. int millisecond = 0;
  2364. if (tag_data.IsValid("fade"))
  2365. {
  2366. millisecond = tag_data.GetTagProperty("fade").AsInteger();
  2367. }
  2368. GameMain.Instance.SoundMgr.StopBGM(GameUty.MillisecondToSecond(millisecond));
  2369. return false;
  2370. }
  2371. public bool TagPlayEnv(KagTagSupport tag_data)
  2372. {
  2373. this.CheckAbsolutelyNecessaryTag(tag_data, "playenv", new string[]
  2374. {
  2375. "file"
  2376. });
  2377. string text = tag_data.GetTagProperty("file").AsString();
  2378. text = Path.ChangeExtension(text, ".ogg");
  2379. int millisecond = 0;
  2380. if (tag_data.IsValid("fade"))
  2381. {
  2382. millisecond = tag_data.GetTagProperty("fade").AsInteger();
  2383. }
  2384. GameMain.Instance.SoundMgr.PlayEnv(text, GameUty.MillisecondToSecond(millisecond));
  2385. return false;
  2386. }
  2387. public bool TagStopEnv(KagTagSupport tag_data)
  2388. {
  2389. int millisecond = 0;
  2390. if (tag_data.IsValid("fade"))
  2391. {
  2392. millisecond = tag_data.GetTagProperty("fade").AsInteger();
  2393. }
  2394. GameMain.Instance.SoundMgr.StopEnv(GameUty.MillisecondToSecond(millisecond));
  2395. return false;
  2396. }
  2397. public bool TagPlaySe(KagTagSupport tag_data)
  2398. {
  2399. this.CheckAbsolutelyNecessaryTag(tag_data, "playse", new string[]
  2400. {
  2401. "file"
  2402. });
  2403. string bgm_file_name = tag_data.GetTagProperty("file").AsString();
  2404. bgm_file_name = Path.ChangeExtension(bgm_file_name, ".ogg");
  2405. if (bgm_file_name == "SE016.ogg" && !GameMain.Instance.CMSystem.EjaculationSeEnabled)
  2406. {
  2407. return false;
  2408. }
  2409. bool loop = tag_data.IsValid("loop");
  2410. int num = 0;
  2411. if (tag_data.IsValid("wait"))
  2412. {
  2413. num = tag_data.GetTagProperty("wait").AsInteger();
  2414. }
  2415. WaitEventList waitEventList = this.GetWaitEventList("se");
  2416. if (num <= 0)
  2417. {
  2418. GameMain.Instance.SoundMgr.PlaySe(bgm_file_name, loop);
  2419. waitEventList.Clear();
  2420. }
  2421. else
  2422. {
  2423. waitEventList.Add(delegate
  2424. {
  2425. GameMain.Instance.SoundMgr.PlaySe(bgm_file_name, loop);
  2426. }, num);
  2427. }
  2428. return false;
  2429. }
  2430. public bool TagStopSe(KagTagSupport tag_data)
  2431. {
  2432. string text = string.Empty;
  2433. if (tag_data.IsValid("file"))
  2434. {
  2435. text = tag_data.GetTagProperty("file").AsString();
  2436. text = Path.ChangeExtension(text, ".ogg");
  2437. }
  2438. if (!string.IsNullOrEmpty(text))
  2439. {
  2440. GameMain.Instance.SoundMgr.StopSe(text);
  2441. }
  2442. else
  2443. {
  2444. GameMain.Instance.SoundMgr.StopSe();
  2445. }
  2446. return false;
  2447. }
  2448. public bool TagPlayVoice(KagTagSupport tag_data)
  2449. {
  2450. bool result = false;
  2451. this.CheckAbsolutelyNecessaryTag(tag_data, "playvoice", new string[]
  2452. {
  2453. "voice"
  2454. });
  2455. string text = tag_data.GetTagProperty("voice").AsString();
  2456. text = Path.ChangeExtension(text, ".ogg");
  2457. bool f_bLoop = tag_data.IsValid("loop");
  2458. int millisecond = 0;
  2459. if (tag_data.IsValid("fade"))
  2460. {
  2461. millisecond = tag_data.GetTagProperty("fade").AsInteger();
  2462. }
  2463. int num = -1;
  2464. if (!tag_data.IsValid("dummy"))
  2465. {
  2466. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  2467. if (maidAndMan != null && maidAndMan.Visible)
  2468. {
  2469. maidAndMan.AudioMan.LoadPlay(text, GameUty.MillisecondToSecond(millisecond), true, f_bLoop);
  2470. if (maidAndMan.AudioMan.isPlay() && maidAndMan.AudioMan.audiosource.clip != null)
  2471. {
  2472. num = (int)(maidAndMan.AudioMan.audiosource.clip.length * 1000f);
  2473. }
  2474. if (tag_data.IsValid("wait"))
  2475. {
  2476. result = this.SetMaidVoiceWait(maidAndMan);
  2477. }
  2478. }
  2479. else
  2480. {
  2481. GameMain.Instance.SoundMgr.PlayDummyVoice(text, GameUty.MillisecondToSecond(millisecond), true, f_bLoop, 50);
  2482. }
  2483. }
  2484. else
  2485. {
  2486. GameMain.Instance.SoundMgr.PlayDummyVoice(text, GameUty.MillisecondToSecond(millisecond), true, f_bLoop, 50);
  2487. if (GameMain.Instance.SoundMgr.m_AudioDummyVoice.isPlay() && GameMain.Instance.SoundMgr.m_AudioDummyVoice.audiosource.clip != null)
  2488. {
  2489. num = (int)(GameMain.Instance.SoundMgr.m_AudioDummyVoice.audiosource.clip.length * 1000f);
  2490. }
  2491. if (tag_data.IsValid("wait"))
  2492. {
  2493. result = this.SetDummyVoiceWait();
  2494. }
  2495. }
  2496. if (!string.IsNullOrEmpty(this.subtitle_data.text) && (0 <= this.subtitle_data.displayTime || 0 < num))
  2497. {
  2498. SubtitleMovieManager globalInstance = SubtitleMovieManager.GetGlobalInstance(this.subtitle_data.casinoType);
  2499. globalInstance.autoDestroy = true;
  2500. int num2 = (0 > this.subtitle_data.displayTime) ? num : this.subtitle_data.displayTime;
  2501. num2 += this.subtitle_data.addDisplayTime;
  2502. globalInstance.Play(this.subtitle_data.text, num2);
  2503. this.subtitle_data.Clear();
  2504. }
  2505. return result;
  2506. }
  2507. public bool TagStopVoice(KagTagSupport tag_data)
  2508. {
  2509. if (!tag_data.IsValid("dummy"))
  2510. {
  2511. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  2512. if (maidAndMan == null)
  2513. {
  2514. return false;
  2515. }
  2516. maidAndMan.AudioMan.Stop();
  2517. }
  2518. else
  2519. {
  2520. GameMain.Instance.SoundMgr.StopDummyVoide();
  2521. }
  2522. return false;
  2523. }
  2524. public bool TagStopSound(KagTagSupport tag_data)
  2525. {
  2526. GameMain.Instance.SoundMgr.StopAll();
  2527. return false;
  2528. }
  2529. public bool TagFade3D(KagTagSupport tag_data)
  2530. {
  2531. this.CheckAbsolutelyNecessaryTag(tag_data, "fade3D", new string[]
  2532. {
  2533. "time"
  2534. });
  2535. int millisecond = tag_data.GetTagProperty("time").AsInteger();
  2536. float f_fTime = GameUty.MillisecondToSecond(millisecond);
  2537. bool flag = tag_data.IsValid("sync");
  2538. if (tag_data.IsValid("in"))
  2539. {
  2540. GameMain.Instance.MainCamera.FadeInNoUI(f_fTime, true);
  2541. }
  2542. else
  2543. {
  2544. GameMain.Instance.MainCamera.FadeOutNoUI(f_fTime, true);
  2545. }
  2546. if (flag)
  2547. {
  2548. this.SetFadeWait(true);
  2549. }
  2550. return flag;
  2551. }
  2552. public bool TagSetBg(KagTagSupport tag_data)
  2553. {
  2554. this.CheckAbsolutelyNecessaryTag(tag_data, "setbg", new string[]
  2555. {
  2556. "file"
  2557. });
  2558. string text = tag_data.GetTagProperty("file").AsString();
  2559. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(0);
  2560. if (0 <= text.IndexOf("?"))
  2561. {
  2562. if (maid != null)
  2563. {
  2564. text = ScriptManager.ReplacePersonal(GameMain.Instance.CharacterMgr.GetMaid(0), text);
  2565. }
  2566. else
  2567. {
  2568. Debug.LogError("@SetBgで指定されたファイルに?がありましたが、スロット0にメイドがいないので性格置換できませんでした");
  2569. }
  2570. }
  2571. GameMain.Instance.BgMgr.ChangeBg(text);
  2572. return false;
  2573. }
  2574. public bool TagDraw2DTex(KagTagSupport tag_data)
  2575. {
  2576. this.CheckAbsolutelyNecessaryTag(tag_data, "draw2dtex", new string[]
  2577. {
  2578. "file",
  2579. "x",
  2580. "y"
  2581. });
  2582. GameObject gameObject = GameObject.Find("__GameMain__/SystemUI Root/MessageWindowPanel/tex2dplate");
  2583. bool flag = false;
  2584. if (gameObject == null)
  2585. {
  2586. gameObject = Utility.CreatePrefab(GameObject.Find("__GameMain__/SystemUI Root"), "System/Prefab/tex2dplate", true);
  2587. gameObject.name = "tex2dplate";
  2588. flag = true;
  2589. }
  2590. UITexture component = gameObject.GetComponent<UITexture>();
  2591. component.mainTexture = Resources.Load<Texture2D>(tag_data.GetTagProperty("file").AsString());
  2592. component.SetDimensions(component.mainTexture.width, component.mainTexture.height);
  2593. Vector3 localPosition = new Vector3((float)(-960 + tag_data.GetTagProperty("x").AsInteger()), (float)(540 - tag_data.GetTagProperty("y").AsInteger()), 0f);
  2594. gameObject.transform.localPosition = localPosition;
  2595. if (flag)
  2596. {
  2597. gameObject.transform.parent = GameObject.Find("__GameMain__/SystemUI Root/MessageWindowPanel").transform;
  2598. }
  2599. return false;
  2600. }
  2601. public bool TagClear2DTex(KagTagSupport tag_data)
  2602. {
  2603. GameObject gameObject = GameObject.Find("__GameMain__/SystemUI Root/MessageWindowPanel/tex2dplate");
  2604. if (gameObject != null)
  2605. {
  2606. UnityEngine.Object.DestroyImmediate(gameObject);
  2607. }
  2608. return false;
  2609. }
  2610. public bool TagItemChange(KagTagSupport tag_data)
  2611. {
  2612. this.CheckAbsolutelyNecessaryTag(tag_data, "itemchange", new string[]
  2613. {
  2614. "category",
  2615. "name"
  2616. });
  2617. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  2618. if (maidAndMan == null)
  2619. {
  2620. return false;
  2621. }
  2622. maidAndMan.ItemChangeTemp(tag_data.GetTagProperty("category").AsString().ToLower(), tag_data.GetTagProperty("name").AsString());
  2623. return false;
  2624. }
  2625. public bool TagItemSet(KagTagSupport tag_data)
  2626. {
  2627. this.CheckAbsolutelyNecessaryTag(tag_data, "itemset", new string[]
  2628. {
  2629. "category",
  2630. "item"
  2631. });
  2632. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  2633. if (maidAndMan == null)
  2634. {
  2635. return false;
  2636. }
  2637. maidAndMan.SetProp(tag_data.GetTagProperty("category").AsString().ToLower(), tag_data.GetTagProperty("item").AsString(), 0, tag_data.IsValid("temp"), tag_data.IsValid("noscale"));
  2638. return false;
  2639. }
  2640. public bool TagItemReset(KagTagSupport tag_data)
  2641. {
  2642. this.CheckAbsolutelyNecessaryTag(tag_data, "itemreset", new string[0]);
  2643. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  2644. if (maidAndMan == null)
  2645. {
  2646. return false;
  2647. }
  2648. if (tag_data.IsValid("allwear"))
  2649. {
  2650. for (int i = 53; i <= 82; i++)
  2651. {
  2652. maidAndMan.ResetProp((MPN)i, true);
  2653. }
  2654. }
  2655. else if (tag_data.IsValid("multi"))
  2656. {
  2657. string text = tag_data.GetTagProperty("multi").AsString();
  2658. string[] array = text.Split(new char[]
  2659. {
  2660. ':'
  2661. });
  2662. foreach (string mpn in array)
  2663. {
  2664. maidAndMan.ResetProp(mpn, true);
  2665. }
  2666. }
  2667. else
  2668. {
  2669. maidAndMan.ResetProp(tag_data.GetTagProperty("category").AsString().ToLower(), true);
  2670. }
  2671. return false;
  2672. }
  2673. public bool TagItemPos(KagTagSupport tag_data)
  2674. {
  2675. this.CheckAbsolutelyNecessaryTag(tag_data, "itempos", new string[]
  2676. {
  2677. "slot",
  2678. "target"
  2679. });
  2680. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  2681. if (maidAndMan == null)
  2682. {
  2683. return false;
  2684. }
  2685. string f_strSlotName = tag_data.GetTagProperty("slot").AsString();
  2686. string f_strObjTarget = tag_data.GetTagProperty("target").AsString();
  2687. Vector3 f_vPos = default(Vector3);
  2688. bool flag = false;
  2689. Vector3 f_vRot = default(Vector3);
  2690. bool flag2 = false;
  2691. if (tag_data.IsValid("x"))
  2692. {
  2693. f_vPos.x = tag_data.GetTagProperty("x").AsReal();
  2694. flag = true;
  2695. }
  2696. if (tag_data.IsValid("y"))
  2697. {
  2698. f_vPos.y = tag_data.GetTagProperty("y").AsReal();
  2699. flag = true;
  2700. }
  2701. if (tag_data.IsValid("z"))
  2702. {
  2703. f_vPos.z = tag_data.GetTagProperty("z").AsReal();
  2704. flag = true;
  2705. }
  2706. if (tag_data.IsValid("rx"))
  2707. {
  2708. f_vRot.x = tag_data.GetTagProperty("rx").AsReal();
  2709. flag2 = true;
  2710. }
  2711. if (tag_data.IsValid("ry"))
  2712. {
  2713. f_vRot.y = tag_data.GetTagProperty("ry").AsReal();
  2714. flag2 = true;
  2715. }
  2716. if (tag_data.IsValid("rz"))
  2717. {
  2718. f_vRot.z = tag_data.GetTagProperty("rz").AsReal();
  2719. flag2 = true;
  2720. }
  2721. if (flag)
  2722. {
  2723. maidAndMan.body0.SetSlotOffsetPos(f_strSlotName, f_strObjTarget, f_vPos);
  2724. }
  2725. if (flag2)
  2726. {
  2727. maidAndMan.body0.SetSlotOffsetRot(f_strSlotName, f_strObjTarget, f_vRot);
  2728. }
  2729. return false;
  2730. }
  2731. public bool TagAllProcPropSeqStart(KagTagSupport tag_data)
  2732. {
  2733. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  2734. if (maidAndMan == null)
  2735. {
  2736. return false;
  2737. }
  2738. if (tag_data.IsValid("fix"))
  2739. {
  2740. maidAndMan.AllProcProp();
  2741. }
  2742. else
  2743. {
  2744. maidAndMan.AllProcPropSeqStart();
  2745. if (tag_data.IsValid("sync") && maidAndMan.Visible)
  2746. {
  2747. this.SetMaidAllPropSeqWait(maidAndMan);
  2748. return true;
  2749. }
  2750. }
  2751. return false;
  2752. }
  2753. public bool TagItemMask(KagTagSupport tag_data)
  2754. {
  2755. this.CheckAbsolutelyNecessaryTag(tag_data, "itemmask", new string[]
  2756. {
  2757. "slot",
  2758. "hide"
  2759. });
  2760. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  2761. if (maidAndMan == null)
  2762. {
  2763. return false;
  2764. }
  2765. string text = tag_data.GetTagProperty("slot").AsString();
  2766. bool f_bVisible = tag_data.GetTagProperty("hide").AsBool();
  2767. TBody.SlotID f_eSlot = TBody.SlotID.accAnl;
  2768. try
  2769. {
  2770. f_eSlot = (TBody.SlotID)Enum.Parse(typeof(TBody.SlotID), text);
  2771. }
  2772. catch
  2773. {
  2774. NDebug.Assert("@itemmask TBody.SlotID enum convert error.\\n" + text, false);
  2775. }
  2776. maidAndMan.body0.SetMask(f_eSlot, f_bVisible);
  2777. return false;
  2778. }
  2779. public bool TagItemMaskMode(KagTagSupport tag_data)
  2780. {
  2781. this.CheckAbsolutelyNecessaryTag(tag_data, "itemmaskmode", new string[]
  2782. {
  2783. "type"
  2784. });
  2785. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  2786. if (maidAndMan == null)
  2787. {
  2788. return false;
  2789. }
  2790. string text = tag_data.GetTagProperty("type").AsString();
  2791. TBody.MaskMode maskMode = TBody.MaskMode.None;
  2792. try
  2793. {
  2794. maskMode = (TBody.MaskMode)Enum.Parse(typeof(TBody.MaskMode), text);
  2795. }
  2796. catch
  2797. {
  2798. NDebug.Assert("@itemmaskmode TBody.MaskMode enum convert error.\\n" + text, false);
  2799. }
  2800. maidAndMan.body0.SetMaskMode(maskMode);
  2801. return false;
  2802. }
  2803. public bool TagMaidReset(KagTagSupport tag_data)
  2804. {
  2805. this.CheckAbsolutelyNecessaryTag(tag_data, "maidreset", new string[]
  2806. {
  2807. "maid"
  2808. });
  2809. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  2810. if (maidAndMan == null)
  2811. {
  2812. return false;
  2813. }
  2814. maidAndMan.ResetAll();
  2815. return this.SetMaidAllPropSeqWait(maidAndMan);
  2816. }
  2817. public bool TagPropSet(KagTagSupport tag_data)
  2818. {
  2819. this.CheckAbsolutelyNecessaryTag(tag_data, "propset", new string[]
  2820. {
  2821. "category"
  2822. });
  2823. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  2824. if (maidAndMan == null)
  2825. {
  2826. return false;
  2827. }
  2828. bool f_bTemp = tag_data.IsValid("temp");
  2829. string text = tag_data.GetTagProperty("category").AsString();
  2830. if (tag_data.IsValid("autofix"))
  2831. {
  2832. string slotname = tag_data.GetTagProperty("slot").AsString();
  2833. TBodySkin slot = maidAndMan.body0.GetSlot(slotname);
  2834. string param = slot.GetParam2("autofix_" + text);
  2835. if (!string.IsNullOrEmpty(param))
  2836. {
  2837. int val = 0;
  2838. if (int.TryParse(param, out val))
  2839. {
  2840. maidAndMan.SetProp(text, val, f_bTemp);
  2841. }
  2842. }
  2843. }
  2844. else if (tag_data.IsValid("val"))
  2845. {
  2846. int val2 = tag_data.GetTagProperty("val").AsInteger();
  2847. maidAndMan.SetProp(text, val2, f_bTemp);
  2848. }
  2849. else
  2850. {
  2851. Debug.LogError("@PropSet には val か autofix のどちらかの指定が必要です。");
  2852. }
  2853. return false;
  2854. }
  2855. public bool TagPropReset(KagTagSupport tag_data)
  2856. {
  2857. this.CheckAbsolutelyNecessaryTag(tag_data, "propreset", new string[]
  2858. {
  2859. "category"
  2860. });
  2861. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  2862. if (maidAndMan == null)
  2863. {
  2864. return false;
  2865. }
  2866. string mpn = tag_data.GetTagProperty("category").AsString();
  2867. maidAndMan.ResetProp(mpn, false);
  2868. return false;
  2869. }
  2870. public bool TagAddPrefabBg(KagTagSupport tag_data)
  2871. {
  2872. this.CheckAbsolutelyNecessaryTag(tag_data, "addprefabbg", new string[]
  2873. {
  2874. "name"
  2875. });
  2876. string text = string.Empty;
  2877. string f_strSrc = string.Empty;
  2878. if (tag_data.IsValid("src"))
  2879. {
  2880. text = tag_data.GetTagProperty("src").AsString();
  2881. }
  2882. else if (tag_data.IsValid("ab"))
  2883. {
  2884. f_strSrc = tag_data.GetTagProperty("ab").AsString();
  2885. }
  2886. string f_strName = tag_data.GetTagProperty("name").AsString();
  2887. string f_strDest = string.Empty;
  2888. if (tag_data.IsValid("dest"))
  2889. {
  2890. f_strDest = tag_data.GetTagProperty("dest").AsString();
  2891. }
  2892. Vector3 zero = Vector3.zero;
  2893. Vector3 zero2 = Vector3.zero;
  2894. if (tag_data.IsValid("x"))
  2895. {
  2896. zero.x = tag_data.GetTagProperty("x").AsReal();
  2897. }
  2898. if (tag_data.IsValid("y"))
  2899. {
  2900. zero.y = tag_data.GetTagProperty("y").AsReal();
  2901. }
  2902. if (tag_data.IsValid("z"))
  2903. {
  2904. zero.z = tag_data.GetTagProperty("z").AsReal();
  2905. }
  2906. if (tag_data.IsValid("rx"))
  2907. {
  2908. zero2.x = tag_data.GetTagProperty("rx").AsReal();
  2909. }
  2910. if (tag_data.IsValid("ry"))
  2911. {
  2912. zero2.y = tag_data.GetTagProperty("ry").AsReal();
  2913. }
  2914. if (tag_data.IsValid("rz"))
  2915. {
  2916. zero2.z = tag_data.GetTagProperty("rz").AsReal();
  2917. }
  2918. if (this.script_mgr_.compatibilityMode && text.ToLower() == "odogu_manaita")
  2919. {
  2920. zero = new Vector3(2.2485f, 0.772f, -0.953f);
  2921. }
  2922. if (!string.IsNullOrEmpty(text))
  2923. {
  2924. GameMain.Instance.BgMgr.AddPrefabToBg(text, f_strName, f_strDest, zero, zero2);
  2925. }
  2926. else
  2927. {
  2928. GameMain.Instance.BgMgr.AddAssetsBundleToBg(f_strSrc, f_strName, f_strDest, zero, zero2);
  2929. }
  2930. return false;
  2931. }
  2932. public bool TagSetPrefabBgTransformData(KagTagSupport tag_data)
  2933. {
  2934. this.CheckAbsolutelyNecessaryTag(tag_data, "SetPrefabBgTransformData", new string[]
  2935. {
  2936. "name"
  2937. });
  2938. GameObject prefabFromBg = GameMain.Instance.BgMgr.GetPrefabFromBg(tag_data.GetTagProperty("name").AsString());
  2939. if (prefabFromBg != null)
  2940. {
  2941. Transform transform = prefabFromBg.transform;
  2942. Vector3 localPosition = transform.localPosition;
  2943. Vector3 eulerAngles = transform.localRotation.eulerAngles;
  2944. Vector3 localScale = transform.localScale;
  2945. if (tag_data.IsValid("x"))
  2946. {
  2947. localPosition.x = tag_data.GetTagProperty("x").AsReal();
  2948. }
  2949. if (tag_data.IsValid("y"))
  2950. {
  2951. localPosition.y = tag_data.GetTagProperty("y").AsReal();
  2952. }
  2953. if (tag_data.IsValid("z"))
  2954. {
  2955. localPosition.z = tag_data.GetTagProperty("z").AsReal();
  2956. }
  2957. if (tag_data.IsValid("rx"))
  2958. {
  2959. eulerAngles.x = tag_data.GetTagProperty("rx").AsReal();
  2960. }
  2961. if (tag_data.IsValid("ry"))
  2962. {
  2963. eulerAngles.y = tag_data.GetTagProperty("ry").AsReal();
  2964. }
  2965. if (tag_data.IsValid("rz"))
  2966. {
  2967. eulerAngles.z = tag_data.GetTagProperty("rz").AsReal();
  2968. }
  2969. if (tag_data.IsValid("sx"))
  2970. {
  2971. localScale.x = tag_data.GetTagProperty("sx").AsReal();
  2972. }
  2973. if (tag_data.IsValid("sy"))
  2974. {
  2975. localScale.y = tag_data.GetTagProperty("sy").AsReal();
  2976. }
  2977. if (tag_data.IsValid("sz"))
  2978. {
  2979. localScale.z = tag_data.GetTagProperty("sz").AsReal();
  2980. }
  2981. transform.localPosition = localPosition;
  2982. transform.localRotation = Quaternion.Euler(eulerAngles);
  2983. transform.localScale = localScale;
  2984. }
  2985. return false;
  2986. }
  2987. public bool TagDelPrefabBg(KagTagSupport tag_data)
  2988. {
  2989. this.CheckAbsolutelyNecessaryTag(tag_data, "delprefabBg", new string[]
  2990. {
  2991. "name"
  2992. });
  2993. GameMain.Instance.BgMgr.DelPrefabFromBg(tag_data.GetTagProperty("name").AsString());
  2994. return false;
  2995. }
  2996. public bool TagDelPrefabBgAll(KagTagSupport tag_data)
  2997. {
  2998. GameMain.Instance.BgMgr.DelPrefabFromBgAll();
  2999. return false;
  3000. }
  3001. public bool TagMovePrefabToChara(KagTagSupport tag_data)
  3002. {
  3003. this.CheckAbsolutelyNecessaryTag(tag_data, "moveprefabtochara", new string[]
  3004. {
  3005. "bone",
  3006. "name"
  3007. });
  3008. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  3009. if (maidAndMan == null)
  3010. {
  3011. return false;
  3012. }
  3013. string f_strDestBone = tag_data.GetTagProperty("bone").AsString();
  3014. string f_strPrefabName = tag_data.GetTagProperty("name").AsString();
  3015. Vector3 zero = Vector3.zero;
  3016. if (tag_data.IsValid("offsx"))
  3017. {
  3018. zero.x = tag_data.GetTagProperty("offsx").AsReal();
  3019. }
  3020. if (tag_data.IsValid("offsy"))
  3021. {
  3022. zero.y = tag_data.GetTagProperty("offsy").AsReal();
  3023. }
  3024. if (tag_data.IsValid("offsz"))
  3025. {
  3026. zero.z = tag_data.GetTagProperty("offsz").AsReal();
  3027. }
  3028. int millisecond = 0;
  3029. if (tag_data.IsValid("time"))
  3030. {
  3031. millisecond = tag_data.GetTagProperty("time").AsInteger();
  3032. }
  3033. GameMain.Instance.BgMgr.MovePrefabToChara(f_strPrefabName, maidAndMan, f_strDestBone, zero, Vector3.zero, GameUty.MillisecondToSecond(millisecond));
  3034. return false;
  3035. }
  3036. public bool TagAddPrefabWorld(KagTagSupport tag_data)
  3037. {
  3038. return false;
  3039. }
  3040. public bool TagReleasePrefab(KagTagSupport tag_data)
  3041. {
  3042. return false;
  3043. }
  3044. public bool TagPrefabAnimatorSetParam(KagTagSupport tag_data)
  3045. {
  3046. this.CheckAbsolutelyNecessaryTag(tag_data, "name", new string[]
  3047. {
  3048. "param"
  3049. });
  3050. string f_strName = tag_data.GetTagProperty("name").AsString();
  3051. string f_strParam = tag_data.GetTagProperty("param").AsString();
  3052. if (tag_data.IsValid("bool"))
  3053. {
  3054. GameMain.Instance.BgMgr.PrefabAnimatorSetParam<bool>(f_strName, f_strParam, tag_data.GetTagProperty("bool").AsBool());
  3055. }
  3056. else if (tag_data.IsValid("int"))
  3057. {
  3058. GameMain.Instance.BgMgr.PrefabAnimatorSetParam<int>(f_strName, f_strParam, tag_data.GetTagProperty("int").AsInteger());
  3059. }
  3060. else if (tag_data.IsValid("float"))
  3061. {
  3062. GameMain.Instance.BgMgr.PrefabAnimatorSetParam<float>(f_strName, f_strParam, tag_data.GetTagProperty("float").AsReal());
  3063. }
  3064. else if (tag_data.IsValid("trigger"))
  3065. {
  3066. GameMain.Instance.BgMgr.PrefabAnimatorTrigger(f_strName, f_strParam, tag_data.IsValid("reset"));
  3067. }
  3068. return false;
  3069. }
  3070. public bool TagChinko(KagTagSupport tag_data)
  3071. {
  3072. bool chinkoVisible = tag_data.IsValid("on");
  3073. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  3074. if (maidAndMan == null || !maidAndMan.boMAN)
  3075. {
  3076. return false;
  3077. }
  3078. maidAndMan.body0.SetChinkoVisible(chinkoVisible);
  3079. return false;
  3080. }
  3081. public bool TagSetLoacalPosition(KagTagSupport tag_data)
  3082. {
  3083. return false;
  3084. }
  3085. public bool TagAddLocalPosition(KagTagSupport tag_data)
  3086. {
  3087. return false;
  3088. }
  3089. public bool TagOpenMouth(KagTagSupport tag_data)
  3090. {
  3091. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  3092. if (maidAndMan == null)
  3093. {
  3094. return false;
  3095. }
  3096. if (tag_data.IsValid("open"))
  3097. {
  3098. maidAndMan.OpenMouth(true);
  3099. }
  3100. if (tag_data.IsValid("close"))
  3101. {
  3102. maidAndMan.OpenMouth(false);
  3103. }
  3104. return false;
  3105. }
  3106. public bool TagEyeToPosition(KagTagSupport tag_data)
  3107. {
  3108. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  3109. if (maidAndMan == null)
  3110. {
  3111. return false;
  3112. }
  3113. Vector3 f_vecTargetPos = default(Vector3);
  3114. if (tag_data.IsValid("x"))
  3115. {
  3116. f_vecTargetPos.x = tag_data.GetTagProperty("x").AsReal();
  3117. }
  3118. if (tag_data.IsValid("y"))
  3119. {
  3120. f_vecTargetPos.y = tag_data.GetTagProperty("y").AsReal();
  3121. }
  3122. if (tag_data.IsValid("z"))
  3123. {
  3124. f_vecTargetPos.z = tag_data.GetTagProperty("z").AsReal();
  3125. }
  3126. int millisecond = 500;
  3127. if (tag_data.IsValid("blend"))
  3128. {
  3129. millisecond = tag_data.GetTagProperty("blend").AsInteger();
  3130. }
  3131. maidAndMan.EyeToPosition(f_vecTargetPos, GameUty.MillisecondToSecond(millisecond));
  3132. return false;
  3133. }
  3134. public bool TagEyeToTarget(KagTagSupport tag_data)
  3135. {
  3136. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  3137. if (maidAndMan == null)
  3138. {
  3139. return false;
  3140. }
  3141. this.CheckAbsolutelyNecessaryTag(tag_data, "eyetotarget", new string[]
  3142. {
  3143. "target"
  3144. });
  3145. Maid maidAndMan2 = this.GetMaidAndMan(tag_data.GetTagProperty("target").AsString());
  3146. int millisecond = 500;
  3147. if (tag_data.IsValid("blend"))
  3148. {
  3149. millisecond = tag_data.GetTagProperty("blend").AsInteger();
  3150. }
  3151. string text = string.Empty;
  3152. if (tag_data.IsValid("bone"))
  3153. {
  3154. text = tag_data.GetTagProperty("bone").AsString();
  3155. }
  3156. if (text == string.Empty)
  3157. {
  3158. maidAndMan.EyeToTarget(maidAndMan2, GameUty.MillisecondToSecond(millisecond), "Bip01 Head");
  3159. }
  3160. else
  3161. {
  3162. maidAndMan.EyeToTarget(maidAndMan2, GameUty.MillisecondToSecond(millisecond), text);
  3163. }
  3164. return false;
  3165. }
  3166. public bool TagEyeToCamera(KagTagSupport tag_data)
  3167. {
  3168. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  3169. if (maidAndMan == null)
  3170. {
  3171. return false;
  3172. }
  3173. this.CheckAbsolutelyNecessaryTag(tag_data, "eyetocamera", new string[]
  3174. {
  3175. "move"
  3176. });
  3177. string text = tag_data.GetTagProperty("move").AsString();
  3178. Maid.EyeMoveType f_eType = Maid.EyeMoveType.無し;
  3179. try
  3180. {
  3181. f_eType = (Maid.EyeMoveType)Enum.Parse(typeof(Maid.EyeMoveType), text);
  3182. }
  3183. catch (ArgumentException)
  3184. {
  3185. NDebug.Assert("Maid.EyeMoveType\nenum parse error.[" + text + "]", false);
  3186. }
  3187. int millisecond = 500;
  3188. if (tag_data.IsValid("blend"))
  3189. {
  3190. millisecond = tag_data.GetTagProperty("blend").AsInteger();
  3191. }
  3192. maidAndMan.EyeToCamera(f_eType, GameUty.MillisecondToSecond(millisecond));
  3193. return false;
  3194. }
  3195. public bool TagEyeToReset(KagTagSupport tag_data)
  3196. {
  3197. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  3198. if (maidAndMan == null)
  3199. {
  3200. return false;
  3201. }
  3202. int millisecond = 500;
  3203. if (tag_data.IsValid("blend"))
  3204. {
  3205. millisecond = tag_data.GetTagProperty("blend").AsInteger();
  3206. }
  3207. maidAndMan.EyeToReset(GameUty.MillisecondToSecond(millisecond));
  3208. return false;
  3209. }
  3210. public bool TagSetMaidOffsetPos(KagTagSupport tag_data)
  3211. {
  3212. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  3213. if (maidAndMan == null)
  3214. {
  3215. return false;
  3216. }
  3217. this.CheckAbsolutelyNecessaryTag(tag_data, "setmaidoffsetpos", new string[]
  3218. {
  3219. "splitnum"
  3220. });
  3221. int f_nCSTSplitNum = tag_data.GetTagProperty("splitnum").AsInteger();
  3222. CharacterMgr.CharaPer f_cIn = BaseKagManager.PerthOffsetPosTagData.CreateCharaPer(this.tjs_, tag_data);
  3223. GameMain.Instance.CharacterMgr.SetMaidOffsetPos(maidAndMan, f_nCSTSplitNum, f_cIn);
  3224. return false;
  3225. }
  3226. public bool TagSetMaidOffsetMultiPos(KagTagSupport tag_data)
  3227. {
  3228. this.CheckAbsolutelyNecessaryTag(tag_data, "setmaidoffsetpos", new string[]
  3229. {
  3230. "splitnum"
  3231. });
  3232. int f_nCSTSplitNum = tag_data.GetTagProperty("splitnum").AsInteger();
  3233. List<KeyValuePair<Maid, CharacterMgr.CharaPer>> list = BaseKagManager.PerthOffsetPosTagData.CreateMultiCharaPer(this.tjs_, tag_data, this);
  3234. GameMain.Instance.CharacterMgr.SetMaidOffsetOther(list, f_nCSTSplitNum);
  3235. if (!this.script_mgr_.compatibilityMode)
  3236. {
  3237. for (int i = 0; i < list.Count; i++)
  3238. {
  3239. Maid targetMaid = list[i].Key;
  3240. if (this.maidOffsetSetList.Find((Maid maid) => maid == targetMaid) == null)
  3241. {
  3242. this.maidOffsetSetList.Add(targetMaid);
  3243. }
  3244. }
  3245. }
  3246. return false;
  3247. }
  3248. public bool TagSetManOffsetPos(KagTagSupport tag_data)
  3249. {
  3250. this.CheckAbsolutelyNecessaryTag(tag_data, "TagSetManOffsetPos", new string[]
  3251. {
  3252. "man",
  3253. "splitnum",
  3254. "target",
  3255. "penisdetail"
  3256. });
  3257. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  3258. if (maidAndMan == null)
  3259. {
  3260. return false;
  3261. }
  3262. string tag_str = tag_data.GetTagProperty("target").AsString();
  3263. Maid maidAndMan2 = this.GetMaidAndMan(tag_str);
  3264. int f_nCSTSplitNum = tag_data.GetTagProperty("splitnum").AsInteger();
  3265. bool f_bPenisDetailMode = tag_data.GetTagProperty("penisdetail").AsBool();
  3266. KeyValuePair<CharacterMgr.CharaPer, CharacterMgr.PenisPer> keyValuePair = BaseKagManager.PerthOffsetPosTagData.CreateCharaPerAndPenisPer(this.tjs_, tag_data);
  3267. GameMain.Instance.CharacterMgr.SetManOffsetPos(maidAndMan, maidAndMan2, f_nCSTSplitNum, f_bPenisDetailMode, keyValuePair.Key, keyValuePair.Value);
  3268. if (!this.script_mgr_.compatibilityMode)
  3269. {
  3270. Maid targetMan = maidAndMan;
  3271. if (this.maidOffsetSetList.Find((Maid maid) => maid == targetMan) == null)
  3272. {
  3273. this.maidOffsetSetList.Add(targetMan);
  3274. }
  3275. }
  3276. return false;
  3277. }
  3278. public bool TagSetMaidOffsetPosCategory(KagTagSupport tag_data)
  3279. {
  3280. this.CheckAbsolutelyNecessaryTag(tag_data, "setmaidoffsetposcategory", new string[]
  3281. {
  3282. "category"
  3283. });
  3284. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  3285. if (maidAndMan == null)
  3286. {
  3287. return false;
  3288. }
  3289. string category = tag_data.GetTagProperty("category").AsString();
  3290. if (tag_data.IsValid("x"))
  3291. {
  3292. maidAndMan.SetPosOffsetFromUdeSclX(category, tag_data.GetTagProperty("x").AsReal());
  3293. }
  3294. if (tag_data.IsValid("y"))
  3295. {
  3296. maidAndMan.SetPosOffsetFromUdeSclY(category, tag_data.GetTagProperty("y").AsReal());
  3297. }
  3298. if (tag_data.IsValid("z"))
  3299. {
  3300. maidAndMan.SetPosOffsetFromUdeSclZ(category, tag_data.GetTagProperty("z").AsReal());
  3301. }
  3302. return false;
  3303. }
  3304. public bool TagAddPrefabChara(KagTagSupport tag_data)
  3305. {
  3306. this.CheckAbsolutelyNecessaryTag(tag_data, "addprefabchara", new string[]
  3307. {
  3308. "src",
  3309. "bone"
  3310. });
  3311. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  3312. if (maidAndMan == null)
  3313. {
  3314. return false;
  3315. }
  3316. string text = tag_data.GetTagProperty("src").AsString();
  3317. string f_strDestBone = tag_data.GetTagProperty("bone").AsString();
  3318. string f_strName = text;
  3319. if (tag_data.IsValid("name"))
  3320. {
  3321. f_strName = tag_data.GetTagProperty("name").AsString();
  3322. }
  3323. Vector3 zero = Vector3.zero;
  3324. Vector3 zero2 = Vector3.zero;
  3325. if (tag_data.IsValid("x"))
  3326. {
  3327. zero.x = tag_data.GetTagProperty("x").AsReal();
  3328. }
  3329. if (tag_data.IsValid("y"))
  3330. {
  3331. zero.y = tag_data.GetTagProperty("y").AsReal();
  3332. }
  3333. if (tag_data.IsValid("z"))
  3334. {
  3335. zero.z = tag_data.GetTagProperty("z").AsReal();
  3336. }
  3337. if (tag_data.IsValid("rx"))
  3338. {
  3339. zero2.x = tag_data.GetTagProperty("rx").AsReal();
  3340. }
  3341. if (tag_data.IsValid("ry"))
  3342. {
  3343. zero2.y = tag_data.GetTagProperty("ry").AsReal();
  3344. }
  3345. if (tag_data.IsValid("rz"))
  3346. {
  3347. zero2.z = tag_data.GetTagProperty("rz").AsReal();
  3348. }
  3349. maidAndMan.AddPrefab(text, f_strName, f_strDestBone, zero, zero2);
  3350. return false;
  3351. }
  3352. public bool TagDelPrefabChara(KagTagSupport tag_data)
  3353. {
  3354. this.CheckAbsolutelyNecessaryTag(tag_data, "delprefabchara", new string[]
  3355. {
  3356. "name"
  3357. });
  3358. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  3359. if (maidAndMan == null)
  3360. {
  3361. return false;
  3362. }
  3363. maidAndMan.DelPrefab(tag_data.GetTagProperty("name").AsString());
  3364. return false;
  3365. }
  3366. public bool TagDelPrefabCharaAll(KagTagSupport tag_data)
  3367. {
  3368. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  3369. if (maidAndMan == null)
  3370. {
  3371. return false;
  3372. }
  3373. maidAndMan.DelPrefabAll();
  3374. return false;
  3375. }
  3376. public bool TagAnimObjChara(KagTagSupport tag_data)
  3377. {
  3378. this.CheckAbsolutelyNecessaryTag(tag_data, "animobjchara", new string[]
  3379. {
  3380. "name",
  3381. "mot",
  3382. "play",
  3383. "loop"
  3384. });
  3385. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  3386. if (maidAndMan == null)
  3387. {
  3388. return false;
  3389. }
  3390. string f_strName = tag_data.GetTagProperty("name").AsString();
  3391. string f_strAnimName = tag_data.GetTagProperty("mot").AsString();
  3392. bool f_bNowPlay = tag_data.GetTagProperty("play").AsBool();
  3393. bool f_bLoop = tag_data.GetTagProperty("loop").AsBool();
  3394. maidAndMan.AnimationObject(f_strName, f_strAnimName, f_bNowPlay, f_bLoop);
  3395. return false;
  3396. }
  3397. public bool TagCharaActivate(KagTagSupport tag_data)
  3398. {
  3399. if (this.script_mgr_.compatibilityMode)
  3400. {
  3401. return this.TagCompatibilityCharaActivate(tag_data);
  3402. }
  3403. GameMain.Instance.ScriptMgr.StopMotionScript();
  3404. int num = 0;
  3405. bool flag = false;
  3406. if (tag_data.IsValid("maid"))
  3407. {
  3408. num = tag_data.GetTagProperty("maid").AsInteger();
  3409. }
  3410. else if (tag_data.IsValid("man"))
  3411. {
  3412. flag = true;
  3413. num = tag_data.GetTagProperty("man").AsInteger();
  3414. }
  3415. else
  3416. {
  3417. NDebug.Assert("@charaactivate error.", false);
  3418. }
  3419. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  3420. Maid maid = null;
  3421. if (tag_data.IsValid("leader"))
  3422. {
  3423. NDebug.Assert(!flag, "@charaactivateのleaderタグはメイド専用です。man指定がされています。");
  3424. for (int i = 0; i < characterMgr.GetStockMaidCount(); i++)
  3425. {
  3426. Maid stockMaid = characterMgr.GetStockMaid(i);
  3427. if (stockMaid != null && stockMaid.status.leader)
  3428. {
  3429. characterMgr.SetActiveMaid(stockMaid, num);
  3430. maid = stockMaid;
  3431. break;
  3432. }
  3433. }
  3434. NDebug.Assert(maid != null, "メイド長を探せませんでした");
  3435. }
  3436. else if (tag_data.IsValid("rank1"))
  3437. {
  3438. NDebug.Assert(!flag, "@charaactivateのrank1タグはメイド専用です。man指定がされています。");
  3439. List<Maid> list = new List<Maid>();
  3440. for (int j = 0; j < characterMgr.GetStockMaidCount(); j++)
  3441. {
  3442. Maid stockMaid2 = characterMgr.GetStockMaid(j);
  3443. if (stockMaid2 != null)
  3444. {
  3445. list.Add(stockMaid2);
  3446. }
  3447. }
  3448. List<Maid> list2 = list;
  3449. if (BaseKagManager.<>f__mg$cache0 == null)
  3450. {
  3451. BaseKagManager.<>f__mg$cache0 = new Comparison<Maid>(CharacterSelectManager.SortMaidRanking);
  3452. }
  3453. list2.Sort(BaseKagManager.<>f__mg$cache0);
  3454. for (int k = 0; k < list.Count; k++)
  3455. {
  3456. if (list[k].status.popularRank == 1)
  3457. {
  3458. characterMgr.SetActiveMaid(list[k], num);
  3459. maid = list[k];
  3460. break;
  3461. }
  3462. }
  3463. }
  3464. else if (tag_data.IsValid("main"))
  3465. {
  3466. Personal.Data data = Personal.GetData(tag_data.GetTagProperty("main").AsString());
  3467. NDebug.Assert(!flag, "@charaactivateのmainタグはメイド専用です。man指定がされています。");
  3468. for (int l = 0; l < characterMgr.GetStockMaidCount(); l++)
  3469. {
  3470. Maid stockMaid3 = characterMgr.GetStockMaid(l);
  3471. if (stockMaid3 != null && stockMaid3.status.mainChara && stockMaid3.status.personal.id == data.id)
  3472. {
  3473. characterMgr.SetActiveMaid(stockMaid3, num);
  3474. maid = stockMaid3;
  3475. break;
  3476. }
  3477. }
  3478. NDebug.Assert(maid != null, data.drawName + "性格のメインキャラを探せませんでした");
  3479. }
  3480. else if (tag_data.IsValid("npc"))
  3481. {
  3482. string text = tag_data.GetTagProperty("npc").AsString();
  3483. if (SubMaid.Contains(text))
  3484. {
  3485. NDebug.Assert(!flag, "npc指定の男は日対応です[" + text + "]");
  3486. maid = characterMgr.ActivateNpc(num);
  3487. NDebug.Assert(maid.boNPC, "NPCメイドではないメイドにNPCプリセットを適用しようとしました");
  3488. SubMaid.Data.CharacterStatus characterStatus = (!GameMain.Instance.CharacterMgr.status.lockUserDraftMaid) ? SubMaid.GetData(text).status : SubMaid.GetData(text).secondStatus;
  3489. if (characterStatus == null)
  3490. {
  3491. characterStatus = SubMaid.GetData(text).status;
  3492. }
  3493. CharacterMgr.npcDatas[characterStatus.presetName].Apply(maid, false);
  3494. }
  3495. else
  3496. {
  3497. NDebug.Assert(CharacterMgr.npcDatas.ContainsKey(text), "キャラクタープリセット設定[" + text + "]の情報が見つかりませんでした");
  3498. if (!flag)
  3499. {
  3500. maid = characterMgr.ActivateNpc(num);
  3501. }
  3502. else
  3503. {
  3504. maid = characterMgr.GetMan(num);
  3505. NDebug.Assert(maid != null, "男スロット指定が限界数を超えています。指定可能範囲は0~" + 5.ToString() + "までです");
  3506. }
  3507. if (!flag)
  3508. {
  3509. NDebug.Assert(maid.boNPC, "NPCメイドではないメイドにNPCプリセットを適用しようとしました");
  3510. }
  3511. CharacterMgr.npcDatas[text].Apply(maid, false);
  3512. }
  3513. maid.gameObject.name = ((!flag) ? "Maid[" : "Man[") + num.ToString() + "]";
  3514. if (!flag)
  3515. {
  3516. GameObject gameObject = maid.gameObject;
  3517. string name = gameObject.name;
  3518. gameObject.name = string.Concat(new string[]
  3519. {
  3520. name,
  3521. " ",
  3522. maid.status.firstName,
  3523. " ",
  3524. maid.status.lastName
  3525. });
  3526. }
  3527. }
  3528. else if (tag_data.IsValid("sub"))
  3529. {
  3530. string b = tag_data.GetTagProperty("sub").AsString();
  3531. NDebug.Assert(!flag, "@charaactivateのsubタグはメイド専用です。man指定がされています。");
  3532. for (int m = 0; m < characterMgr.GetStockMaidCount(); m++)
  3533. {
  3534. Maid stockMaid4 = characterMgr.GetStockMaid(m);
  3535. if (stockMaid4 != null && stockMaid4.status.heroineType == HeroineType.Sub && stockMaid4.status.subCharaData != null && stockMaid4.status.subCharaData.uniqueName == b)
  3536. {
  3537. characterMgr.SetActiveMaid(stockMaid4, num);
  3538. maid = stockMaid4;
  3539. break;
  3540. }
  3541. }
  3542. }
  3543. else if (tag_data.IsValid("slot"))
  3544. {
  3545. NDebug.Assert(!flag, "@charaactivateのslotタグはメイド専用です。man指定がされています。");
  3546. int f_nStockSlot = tag_data.GetTagProperty("slot").AsInteger();
  3547. maid = GameMain.Instance.CharacterMgr.Activate(num, f_nStockSlot, flag, false);
  3548. }
  3549. else if (tag_data.IsValid("swap"))
  3550. {
  3551. int slotNoB = tag_data.GetTagProperty("swap").AsInteger();
  3552. GameMain.Instance.CharacterMgr.SwapActiveSlot(num, slotNoB, flag);
  3553. }
  3554. else
  3555. {
  3556. NDebug.Assert("@charaactivate error.", false);
  3557. }
  3558. bool result = false;
  3559. if (maid != null && !tag_data.IsValid("noload"))
  3560. {
  3561. maid.Visible = true;
  3562. result = this.SetMaidAllPropSeqWait(maid);
  3563. }
  3564. return result;
  3565. }
  3566. public bool TagCompatibilityCharaActivate(KagTagSupport tag_data)
  3567. {
  3568. int num = 0;
  3569. bool flag = false;
  3570. if (tag_data.IsValid("maid"))
  3571. {
  3572. num = tag_data.GetTagProperty("maid").AsInteger();
  3573. }
  3574. else if (tag_data.IsValid("man"))
  3575. {
  3576. flag = true;
  3577. num = tag_data.GetTagProperty("man").AsInteger();
  3578. if (this.script_mgr_.compatibilityMode && 6 <= num)
  3579. {
  3580. num = 5;
  3581. }
  3582. }
  3583. else if (tag_data.IsValid("file"))
  3584. {
  3585. num = 16;
  3586. }
  3587. else
  3588. {
  3589. NDebug.Assert("@charaactivate error.", false);
  3590. }
  3591. Maid maid = null;
  3592. if (tag_data.IsValid("npc") || tag_data.IsValid("file"))
  3593. {
  3594. string text = string.Empty;
  3595. if (tag_data.IsValid("npc"))
  3596. {
  3597. text = tag_data.GetTagProperty("npc").AsString();
  3598. }
  3599. else
  3600. {
  3601. text = tag_data.GetTagProperty("file").AsString();
  3602. }
  3603. if (this.script_mgr_.compatibilityMode)
  3604. {
  3605. if (text == "叔父メイド" || text == "メイド秘書" || text == "エステメイド")
  3606. {
  3607. text = "旧" + text;
  3608. }
  3609. else if (text == "pre_尾高千夏")
  3610. {
  3611. text = "旧千夏";
  3612. }
  3613. else if (text == "その他1")
  3614. {
  3615. text = "客2";
  3616. }
  3617. }
  3618. NDebug.Assert(CharacterMgr.npcDatas.ContainsKey(text), "サブキャラクター[" + text + "]の情報が見つかりませんでした");
  3619. if (!flag)
  3620. {
  3621. maid = GameMain.Instance.CharacterMgr.ActivateNpc(num);
  3622. }
  3623. else
  3624. {
  3625. maid = GameMain.Instance.CharacterMgr.GetMan(num);
  3626. NDebug.Assert(maid != null, "男スロット指定が限界数を超えています。指定可能範囲は0~" + 5.ToString() + "までです");
  3627. }
  3628. if (!flag)
  3629. {
  3630. NDebug.Assert(maid.boNPC, "NPCメイドではないメイドにNPCプリセットを適用しようとしました");
  3631. }
  3632. CharacterMgr.npcDatas[text].Apply(maid, false);
  3633. }
  3634. else if (tag_data.IsValid("pc"))
  3635. {
  3636. int f_nStockSlot = tag_data.GetTagProperty("pc").AsInteger();
  3637. maid = GameMain.Instance.CharacterMgr.Activate(num, f_nStockSlot, false, false);
  3638. }
  3639. else
  3640. {
  3641. NDebug.Assert("@charaactivate error.", false);
  3642. }
  3643. bool result = false;
  3644. if (maid != null)
  3645. {
  3646. result = this.SetMaidAllPropSeqWait(maid);
  3647. }
  3648. return result;
  3649. }
  3650. public bool TagConCharaActivateFreeNPC(KagTagSupport tag_data)
  3651. {
  3652. return this.TagCompatibilityCharaActivate(tag_data);
  3653. }
  3654. public bool TagConCharaActivate1stRanking(KagTagSupport tag_data)
  3655. {
  3656. GameMain.Instance.ScriptMgr.StopMotionScript();
  3657. int f_nActiveSlotNo = 0;
  3658. if (tag_data.IsValid("maid"))
  3659. {
  3660. f_nActiveSlotNo = tag_data.GetTagProperty("maid").AsInteger();
  3661. }
  3662. List<Maid> list = new List<Maid>();
  3663. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  3664. for (int i = 0; i < characterMgr.GetStockMaidCount(); i++)
  3665. {
  3666. Maid stockMaid = characterMgr.GetStockMaid(i);
  3667. if (stockMaid != null)
  3668. {
  3669. list.Add(stockMaid);
  3670. }
  3671. }
  3672. List<Maid> list2 = list;
  3673. if (BaseKagManager.<>f__mg$cache1 == null)
  3674. {
  3675. BaseKagManager.<>f__mg$cache1 = new Comparison<Maid>(CharacterSelectManager.SortMaidRanking);
  3676. }
  3677. list2.Sort(BaseKagManager.<>f__mg$cache1);
  3678. bool result = false;
  3679. for (int j = 0; j < list.Count; j++)
  3680. {
  3681. if (list[j].status.popularRank == 1)
  3682. {
  3683. characterMgr.SetActiveMaid(list[j], f_nActiveSlotNo);
  3684. list[j].Visible = true;
  3685. result = this.SetMaidAllPropSeqWait(list[j]);
  3686. break;
  3687. }
  3688. }
  3689. return result;
  3690. }
  3691. public bool TagConCharaActivateLeader(KagTagSupport tag_data)
  3692. {
  3693. GameMain.Instance.ScriptMgr.StopMotionScript();
  3694. int f_nActiveSlotNo = 0;
  3695. if (tag_data.IsValid("maid"))
  3696. {
  3697. f_nActiveSlotNo = tag_data.GetTagProperty("maid").AsInteger();
  3698. }
  3699. bool result = false;
  3700. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  3701. for (int i = 0; i < characterMgr.GetStockMaidCount(); i++)
  3702. {
  3703. Maid stockMaid = characterMgr.GetStockMaid(i);
  3704. if (stockMaid != null && stockMaid.status.leader)
  3705. {
  3706. characterMgr.SetActiveMaid(stockMaid, f_nActiveSlotNo);
  3707. stockMaid.Visible = true;
  3708. result = this.SetMaidAllPropSeqWait(stockMaid);
  3709. break;
  3710. }
  3711. }
  3712. return result;
  3713. }
  3714. public bool TagManPresetMenuLoad(KagTagSupport tag_data)
  3715. {
  3716. int nManNo = 0;
  3717. if (tag_data.IsValid("man"))
  3718. {
  3719. nManNo = tag_data.GetTagProperty("man").AsInteger();
  3720. }
  3721. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  3722. Maid man = characterMgr.GetMan(nManNo);
  3723. if (man != null)
  3724. {
  3725. man.SetUpModel(tag_data.GetTagProperty("file").AsString());
  3726. }
  3727. return false;
  3728. }
  3729. public bool TagCharaDeactivate(KagTagSupport tag_data)
  3730. {
  3731. int num = 0;
  3732. bool flag = false;
  3733. if (tag_data.IsValid("maid"))
  3734. {
  3735. num = tag_data.GetTagProperty("maid").AsInteger();
  3736. }
  3737. else if (tag_data.IsValid("man"))
  3738. {
  3739. flag = true;
  3740. num = tag_data.GetTagProperty("man").AsInteger();
  3741. if (this.script_mgr_.compatibilityMode && 6 <= num)
  3742. {
  3743. num = 5;
  3744. }
  3745. }
  3746. else
  3747. {
  3748. NDebug.Assert("@CharaDeactivate error.", false);
  3749. }
  3750. ScriptManager scriptMgr = GameMain.Instance.ScriptMgr;
  3751. scriptMgr.ClearForcExecWaitEvent();
  3752. foreach (KeyValuePair<int, MotionKagManager> keyValuePair in scriptMgr.kag_mot_dic)
  3753. {
  3754. if (!flag)
  3755. {
  3756. if (keyValuePair.Value.main_maid != null && keyValuePair.Value.main_maid == GameMain.Instance.CharacterMgr.GetMaid(num))
  3757. {
  3758. keyValuePair.Value.ClearMotion();
  3759. keyValuePair.Value.enabled = false;
  3760. }
  3761. }
  3762. else if (!scriptMgr.compatibilityMode)
  3763. {
  3764. Maid man = GameMain.Instance.CharacterMgr.GetMan(num);
  3765. if (man != null && man.body0 != null)
  3766. {
  3767. man.body0.SetChinkoVisible(true);
  3768. }
  3769. if (keyValuePair.Value.main_man != null && keyValuePair.Value.main_man == man)
  3770. {
  3771. keyValuePair.Value.ClearMotion();
  3772. keyValuePair.Value.enabled = false;
  3773. }
  3774. }
  3775. }
  3776. if (!flag)
  3777. {
  3778. GameMain.Instance.CharacterMgr.Deactivate(num, flag);
  3779. }
  3780. else
  3781. {
  3782. GameMain.Instance.CharacterMgr.CharaVisible(num, false, flag);
  3783. }
  3784. return false;
  3785. }
  3786. public bool TagCharaVisible(KagTagSupport tag_data)
  3787. {
  3788. int num = 0;
  3789. bool flag = false;
  3790. if (tag_data.IsValid("maid"))
  3791. {
  3792. num = tag_data.GetTagProperty("maid").AsInteger();
  3793. }
  3794. else if (tag_data.IsValid("man"))
  3795. {
  3796. flag = true;
  3797. num = tag_data.GetTagProperty("man").AsInteger();
  3798. if (this.script_mgr_.compatibilityMode && 6 <= num)
  3799. {
  3800. num = 5;
  3801. }
  3802. }
  3803. else
  3804. {
  3805. NDebug.Assert("@charavisible error.", false);
  3806. }
  3807. bool flag2 = tag_data.IsValid("true");
  3808. Maid maid = GameMain.Instance.CharacterMgr.CharaVisible(num, flag2, flag);
  3809. if (maid == null && this.script_mgr_.compatibilityMode)
  3810. {
  3811. return false;
  3812. }
  3813. NDebug.Assert(maid != null, string.Concat(new object[]
  3814. {
  3815. "@charavisibleエラー。指定の",
  3816. (!flag) ? "メイド" : "男",
  3817. "はいません。スロット番号",
  3818. num
  3819. }));
  3820. if (!this.script_mgr_.compatibilityMode && maid != null && maid.body0 != null && flag && !flag2)
  3821. {
  3822. maid.body0.SetChinkoVisible(true);
  3823. }
  3824. bool result = false;
  3825. if (flag2 && maid != null)
  3826. {
  3827. result = this.SetMaidAllPropSeqWait(maid);
  3828. }
  3829. return result;
  3830. }
  3831. public bool TagCharaVisibleAllOff(KagTagSupport tag_data)
  3832. {
  3833. bool flag = tag_data.IsValid("man");
  3834. bool flag2 = false;
  3835. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  3836. if (!flag)
  3837. {
  3838. for (int i = 0; i < characterMgr.GetMaidCount(); i++)
  3839. {
  3840. if (characterMgr.GetMaid(i) != null)
  3841. {
  3842. characterMgr.CharaVisible(i, flag2, flag);
  3843. }
  3844. }
  3845. }
  3846. else
  3847. {
  3848. for (int j = 0; j < characterMgr.GetManCount(); j++)
  3849. {
  3850. Maid man = characterMgr.GetMan(j);
  3851. if (man != null)
  3852. {
  3853. if (!flag2 && man.body0 != null)
  3854. {
  3855. man.body0.SetChinkoVisible(true);
  3856. }
  3857. characterMgr.CharaVisible(j, flag2, flag);
  3858. }
  3859. }
  3860. }
  3861. return false;
  3862. }
  3863. public bool TagTexMulAdd(KagTagSupport tag_data)
  3864. {
  3865. this.CheckAbsolutelyNecessaryTag(tag_data, "layer", new string[]
  3866. {
  3867. "x",
  3868. "y",
  3869. "r",
  3870. "s"
  3871. });
  3872. Maid maid = this.GetMaidAndMan(tag_data);
  3873. if (maid == null)
  3874. {
  3875. return false;
  3876. }
  3877. Func<string, string> func = delegate(string ran_str)
  3878. {
  3879. string[] array5 = ran_str.Split(new char[]
  3880. {
  3881. ':'
  3882. });
  3883. return array5[UnityEngine.Random.Range(0, array5.Length)];
  3884. };
  3885. string slot = "body";
  3886. if (tag_data.IsValid("slot"))
  3887. {
  3888. slot = tag_data.GetTagProperty("slot").AsString();
  3889. }
  3890. int matno = 0;
  3891. if (tag_data.IsValid("matno"))
  3892. {
  3893. matno = tag_data.GetTagProperty("matno").AsInteger();
  3894. }
  3895. string propname = "_MainTex";
  3896. if (tag_data.IsValid("propname"))
  3897. {
  3898. propname = tag_data.GetTagProperty("propname").AsString();
  3899. }
  3900. int layer = tag_data.GetTagProperty("layer").AsInteger();
  3901. string file = string.Empty;
  3902. if (tag_data.IsValid("file"))
  3903. {
  3904. file = tag_data.GetTagProperty("file").AsString();
  3905. }
  3906. else if (tag_data.IsValid("res"))
  3907. {
  3908. file = tag_data.GetTagProperty("res").AsString();
  3909. }
  3910. NDebug.Assert(!string.IsNullOrEmpty(file), "@texmuladd [file] or [res] error.");
  3911. file = func(file);
  3912. if (tag_data.IsValid("res"))
  3913. {
  3914. file = "res:" + file;
  3915. }
  3916. string text = tag_data.GetTagProperty("x").AsString();
  3917. string[] array = text.Split(new char[]
  3918. {
  3919. ':'
  3920. });
  3921. NDebug.Assert(array.Length == 2, "@texmuladd [x] error.");
  3922. int x = UnityEngine.Random.Range(int.Parse(array[0]), int.Parse(array[1]) + 1);
  3923. string text2 = tag_data.GetTagProperty("y").AsString();
  3924. string[] array2 = text2.Split(new char[]
  3925. {
  3926. ':'
  3927. });
  3928. NDebug.Assert(array2.Length == 2, "@texmuladd [y] error.");
  3929. int y = UnityEngine.Random.Range(int.Parse(array2[0]), int.Parse(array2[1]) + 1);
  3930. string text3 = tag_data.GetTagProperty("r").AsString();
  3931. string[] array3 = text3.Split(new char[]
  3932. {
  3933. ':'
  3934. });
  3935. NDebug.Assert(array3.Length == 2, "@texmuladd [r] error.");
  3936. float r = (float)UnityEngine.Random.Range((int)(float.Parse(array3[0]) * 100f), (int)(float.Parse(array3[1]) * 100f + 1f)) / 100f;
  3937. string text4 = tag_data.GetTagProperty("s").AsString();
  3938. string[] array4 = text4.Split(new char[]
  3939. {
  3940. ':'
  3941. });
  3942. NDebug.Assert(array4.Length == 2, "@texmuladd [s] error.");
  3943. float s = (float)UnityEngine.Random.Range((int)(float.Parse(array4[0]) * 100f), (int)(float.Parse(array4[1]) * 100f + 1f)) / 100f;
  3944. int num = 0;
  3945. if (tag_data.IsValid("delay"))
  3946. {
  3947. num = tag_data.GetTagProperty("delay").AsInteger();
  3948. }
  3949. WaitEventList waitEventList = this.GetWaitEventList("tex_mul_add");
  3950. if (num <= 0)
  3951. {
  3952. this.ExecForcWaitEvent();
  3953. if (maid != null && maid.body0 != null && maid.body0.isLoadedBody)
  3954. {
  3955. maid.body0.MulTexSet(slot, matno, propname, layer, file, GameUty.SystemMaterial.Alpha, true, x, y, r, s, false, null, 1f, 1024);
  3956. if (propname == "_MainTex")
  3957. {
  3958. maid.body0.MulTexSet(slot, matno, "_ShadowTex", layer, file, GameUty.SystemMaterial.Alpha, true, x, y, r, s, false, null, 1f, 1024);
  3959. }
  3960. maid.body0.MulTexProc(slot);
  3961. }
  3962. }
  3963. else
  3964. {
  3965. waitEventList.Add(delegate
  3966. {
  3967. if (maid != null && maid.body0 != null && maid.body0.isLoadedBody)
  3968. {
  3969. maid.body0.MulTexSet(slot, matno, propname, layer, file, GameUty.SystemMaterial.Alpha, true, x, y, r, s, false, null, 1f, 1024);
  3970. if (propname == "_MainTex")
  3971. {
  3972. maid.body0.MulTexSet(slot, matno, "_ShadowTex", layer, file, GameUty.SystemMaterial.Alpha, true, x, y, r, s, false, null, 1f, 1024);
  3973. }
  3974. maid.body0.MulTexProc(slot);
  3975. }
  3976. }, num);
  3977. }
  3978. return false;
  3979. }
  3980. public bool TagTexMulDel(KagTagSupport tag_data)
  3981. {
  3982. Maid maidAndMan = this.GetMaidAndMan(tag_data);
  3983. if (maidAndMan == null)
  3984. {
  3985. return false;
  3986. }
  3987. int f_nMatNo = 0;
  3988. if (tag_data.IsValid("matno"))
  3989. {
  3990. f_nMatNo = tag_data.GetTagProperty("matno").AsInteger();
  3991. }
  3992. string text = "_MainTex";
  3993. if (tag_data.IsValid("propname"))
  3994. {
  3995. text = tag_data.GetTagProperty("propname").AsString();
  3996. }
  3997. string text2 = "body";
  3998. if (tag_data.IsValid("slot"))
  3999. {
  4000. text2 = tag_data.GetTagProperty("slot").AsString();
  4001. }
  4002. this.script_mgr_.ClearForcExecWaitEvent();
  4003. string text3 = "10:20";
  4004. if (tag_data.IsValid("layer"))
  4005. {
  4006. text3 = tag_data.GetTagProperty("layer").AsString();
  4007. }
  4008. int num = 10;
  4009. int num2 = 20;
  4010. string[] array = text3.Split(new char[]
  4011. {
  4012. ':'
  4013. });
  4014. if (array.Length == 2)
  4015. {
  4016. num = int.Parse(array[0].Trim());
  4017. num2 = int.Parse(array[1].Trim());
  4018. }
  4019. else if (array.Length == 1)
  4020. {
  4021. num2 = (num = int.Parse(array[0].Trim()));
  4022. }
  4023. for (int i = num; i <= num2; i++)
  4024. {
  4025. maidAndMan.body0.MulTexRemove(text2, f_nMatNo, text, i);
  4026. if (text == "_MainTex")
  4027. {
  4028. maidAndMan.body0.MulTexRemove(text2, f_nMatNo, "_ShadowTex", i);
  4029. }
  4030. }
  4031. maidAndMan.Visible = true;
  4032. maidAndMan.body0.MulTexProc(text2);
  4033. return false;
  4034. }
  4035. public bool TagStartDay(KagTagSupport tag_data)
  4036. {
  4037. GameMain.Instance.OnStartDay();
  4038. return false;
  4039. }
  4040. public bool TagEndDay(KagTagSupport tag_data)
  4041. {
  4042. GameMain.Instance.OnEndDay();
  4043. return false;
  4044. }
  4045. public bool TagScheduleStartManage(KagTagSupport tag_data)
  4046. {
  4047. ScheduleAPI.DayStartManage();
  4048. return false;
  4049. }
  4050. public bool TagConUpdateMaidPoint(KagTagSupport tag_data)
  4051. {
  4052. return false;
  4053. }
  4054. public bool TagVRBGChangeInit(KagTagSupport tag_data)
  4055. {
  4056. SceneVRCommunication.Instance.KagBGChangeInit(tag_data.GetTagList());
  4057. return false;
  4058. }
  4059. public bool TagVREventObj(KagTagSupport tag_data)
  4060. {
  4061. string f_strName = tag_data.GetTagProperty("name").AsString();
  4062. int f_nVisible = 0;
  4063. if (tag_data.IsValid("visible"))
  4064. {
  4065. f_nVisible = ((!tag_data.GetTagProperty("visible").AsBool()) ? 2 : 1);
  4066. }
  4067. int f_nTrigger = 0;
  4068. if (tag_data.IsValid("trigger"))
  4069. {
  4070. f_nTrigger = ((!tag_data.GetTagProperty("trigger").AsBool()) ? 2 : 1);
  4071. }
  4072. int f_nGrab = 0;
  4073. if (tag_data.IsValid("grab"))
  4074. {
  4075. f_nGrab = ((!tag_data.GetTagProperty("grab").AsBool()) ? 2 : 1);
  4076. }
  4077. string f_strAnimation = string.Empty;
  4078. if (tag_data.IsValid("animation"))
  4079. {
  4080. f_strAnimation = tag_data.GetTagProperty("animation").AsString();
  4081. }
  4082. SceneVRCommunication.Instance.KagEventObj(f_strName, f_nVisible, f_nTrigger, f_nGrab, f_strAnimation);
  4083. return false;
  4084. }
  4085. public bool TagVREventGroup(KagTagSupport tag_data)
  4086. {
  4087. string f_strName = tag_data.GetTagProperty("name").AsString();
  4088. int f_nVisible = 0;
  4089. if (tag_data.IsValid("visible"))
  4090. {
  4091. f_nVisible = ((!tag_data.GetTagProperty("visible").AsBool()) ? 2 : 1);
  4092. }
  4093. int f_nTrigger = 0;
  4094. if (tag_data.IsValid("trigger"))
  4095. {
  4096. f_nTrigger = ((!tag_data.GetTagProperty("trigger").AsBool()) ? 2 : 1);
  4097. }
  4098. int f_nGrab = 0;
  4099. if (tag_data.IsValid("grab"))
  4100. {
  4101. f_nGrab = ((!tag_data.GetTagProperty("grab").AsBool()) ? 2 : 1);
  4102. }
  4103. SceneVRCommunication.Instance.KagEventObjGroup(f_strName, f_nVisible, f_nTrigger, f_nGrab);
  4104. return false;
  4105. }
  4106. public bool TagVRFreeScene(KagTagSupport tag_data)
  4107. {
  4108. if (tag_data.IsValid("start"))
  4109. {
  4110. SceneVRCommunication.Instance.kagFreeSceneSwitch(true, true, false);
  4111. }
  4112. else if (tag_data.IsValid("end"))
  4113. {
  4114. bool f_bEnableSkip = !tag_data.IsValid("noskip");
  4115. SceneVRCommunication.Instance.kagFreeSceneSwitch(false, f_bEnableSkip, false);
  4116. }
  4117. return false;
  4118. }
  4119. public bool TagVRCamera(KagTagSupport tag_data)
  4120. {
  4121. float num = 0f;
  4122. bool flag = false;
  4123. float x = tag_data.GetTagProperty("x").AsReal();
  4124. float z = tag_data.GetTagProperty("z").AsReal();
  4125. if (tag_data.IsValid("height"))
  4126. {
  4127. num = tag_data.GetTagProperty("height").AsReal();
  4128. }
  4129. else if (tag_data.IsValid("stand"))
  4130. {
  4131. num = GameMain.Instance.CMSystem.VRCameraHeightStandOffs;
  4132. }
  4133. else if (tag_data.IsValid("sit"))
  4134. {
  4135. num = GameMain.Instance.CMSystem.VRCameraHeightSitOffs;
  4136. flag = true;
  4137. }
  4138. bool f_bYFromFloor = true;
  4139. if (tag_data.IsValid("nofloor"))
  4140. {
  4141. f_bYFromFloor = false;
  4142. if (flag)
  4143. {
  4144. num += 0.4f;
  4145. }
  4146. }
  4147. GameMain.Instance.MainCamera.SetRealHeadPos(new Vector3(x, num, z), f_bYFromFloor);
  4148. if (tag_data.IsValid("angle"))
  4149. {
  4150. float y = tag_data.GetTagProperty("angle").AsReal();
  4151. GameMain.Instance.MainCamera.SetRealHeadRot(new Vector3(0f, y, 0f), true);
  4152. }
  4153. return false;
  4154. }
  4155. public bool TagVRTablet(KagTagSupport tag_data)
  4156. {
  4157. if (tag_data.IsValid("show"))
  4158. {
  4159. GameMain.Instance.OvrMgr.OvrCamera.ShowUI(true);
  4160. }
  4161. else if (tag_data.IsValid("hide"))
  4162. {
  4163. GameMain.Instance.OvrMgr.OvrCamera.ShowUI(false);
  4164. }
  4165. if (tag_data.IsValid("reset"))
  4166. {
  4167. float f_fOffsetRotY = 0f;
  4168. if (tag_data.IsValid("rot"))
  4169. {
  4170. f_fOffsetRotY = tag_data.GetTagProperty("rot").AsReal();
  4171. }
  4172. GameMain.Instance.OvrMgr.OvrCamera.UIPosReset(f_fOffsetRotY);
  4173. }
  4174. if (tag_data.IsValid("nomove"))
  4175. {
  4176. bool uiNoMoveMode = tag_data.GetTagProperty("nomove").AsBool();
  4177. SceneVRCommunication.Instance.UiNoMoveMode = uiNoMoveMode;
  4178. }
  4179. if (tag_data.IsValid("nohome"))
  4180. {
  4181. bool uiNoHomeMode = tag_data.GetTagProperty("nohome").AsBool();
  4182. SceneVRCommunication.Instance.UiNoHomeMode = uiNoHomeMode;
  4183. }
  4184. if (tag_data.IsValid("notime"))
  4185. {
  4186. bool uiNoTimeMode = tag_data.GetTagProperty("notime").AsBool();
  4187. SceneVRCommunication.Instance.UiNoTimeMode = uiNoTimeMode;
  4188. }
  4189. return false;
  4190. }
  4191. public bool TagVRChoicesSet(KagTagSupport tag_data)
  4192. {
  4193. int f_nMaidNo = -1;
  4194. VRChoices.SelectPair.Type f_type = VRChoices.SelectPair.Type.Text;
  4195. string f_strRegionSplitOfColon = string.Empty;
  4196. this.CheckAbsolutelyNecessaryTag(tag_data, "text", new string[]
  4197. {
  4198. "label"
  4199. });
  4200. string text = tag_data.GetTagProperty("text").AsString();
  4201. text = ScriptManager.ReplaceCharaName(text);
  4202. string f_strLabel = tag_data.GetTagProperty("label").AsString();
  4203. if (tag_data.IsValid("maid"))
  4204. {
  4205. f_nMaidNo = tag_data.GetTagProperty("maid").AsInteger();
  4206. }
  4207. if (tag_data.IsValid("type"))
  4208. {
  4209. string text2 = tag_data.GetTagProperty("type").AsString();
  4210. if (text2 == "touch")
  4211. {
  4212. f_type = VRChoices.SelectPair.Type.Touch;
  4213. }
  4214. else if (text2 == "look")
  4215. {
  4216. f_type = VRChoices.SelectPair.Type.Look;
  4217. }
  4218. else
  4219. {
  4220. NDebug.Assert("typeに不正な文字列 " + text2, false);
  4221. }
  4222. }
  4223. float f_fTimeOut = -1f;
  4224. if (tag_data.IsValid("time"))
  4225. {
  4226. f_fTimeOut = tag_data.GetTagProperty("time").AsReal();
  4227. }
  4228. if (tag_data.IsValid("region"))
  4229. {
  4230. f_strRegionSplitOfColon = tag_data.GetTagProperty("region").AsString();
  4231. }
  4232. SceneVRCommunication.Instance.Choices.Add(text, f_strLabel, f_nMaidNo, f_type, f_strRegionSplitOfColon, f_fTimeOut);
  4233. return false;
  4234. }
  4235. public bool TagVRChoicesShow(KagTagSupport tag_data)
  4236. {
  4237. if (tag_data.IsValid("end"))
  4238. {
  4239. SceneVRCommunication.Instance.Choices.Finalize(null);
  4240. return false;
  4241. }
  4242. int f_nTimeOutMS = 0;
  4243. string f_strTimeOutLabel = string.Empty;
  4244. int f_nRandom = 0;
  4245. if (tag_data.IsValid("timeout"))
  4246. {
  4247. f_nTimeOutMS = tag_data.GetTagProperty("timeout").AsInteger();
  4248. }
  4249. if (tag_data.IsValid("timeoutlabel"))
  4250. {
  4251. f_strTimeOutLabel = tag_data.GetTagProperty("timeoutlabel").AsString();
  4252. }
  4253. if (tag_data.IsValid("random"))
  4254. {
  4255. f_nRandom = tag_data.GetTagProperty("random").AsInteger();
  4256. }
  4257. SceneVRCommunication.Instance.Choices.Show(f_nTimeOutMS, f_strTimeOutLabel, f_nRandom);
  4258. return true;
  4259. }
  4260. public bool TagVRChoicesShowNonStop(KagTagSupport tag_data)
  4261. {
  4262. if (tag_data.IsValid("end"))
  4263. {
  4264. SceneVRCommunication.Instance.Choices.Finalize(null);
  4265. return false;
  4266. }
  4267. int f_nTimeOutMS = 0;
  4268. string f_strTimeOutLabel = string.Empty;
  4269. int f_nRandom = 0;
  4270. if (tag_data.IsValid("timeout"))
  4271. {
  4272. f_nTimeOutMS = tag_data.GetTagProperty("timeout").AsInteger();
  4273. }
  4274. if (tag_data.IsValid("timeoutlabel"))
  4275. {
  4276. f_strTimeOutLabel = tag_data.GetTagProperty("timeoutlabel").AsString();
  4277. }
  4278. if (tag_data.IsValid("random"))
  4279. {
  4280. f_nRandom = tag_data.GetTagProperty("random").AsInteger();
  4281. }
  4282. SceneVRCommunication.Instance.Choices.Show(f_nTimeOutMS, f_strTimeOutLabel, f_nRandom);
  4283. return false;
  4284. }
  4285. public bool TagVRDoNextTime(KagTagSupport tag_data)
  4286. {
  4287. SceneVRCommunication.Instance.KagDoNextTime();
  4288. return false;
  4289. }
  4290. public bool TagVRResetHeadPos(KagTagSupport tag_data)
  4291. {
  4292. GameMain.Instance.OvrMgr.OvrCamera.ReCallcOffset();
  4293. return false;
  4294. }
  4295. public bool TagVRTouchScript(KagTagSupport tag_data)
  4296. {
  4297. SceneVRCommunication.Instance.TouchComm.Touch_Operator(tag_data);
  4298. return false;
  4299. }
  4300. public bool TagVRDayTimeShow(KagTagSupport tag_data)
  4301. {
  4302. string f_strReturnFile = string.Empty;
  4303. string f_strReturnLabel = string.Empty;
  4304. if (tag_data.IsValid("file"))
  4305. {
  4306. f_strReturnFile = tag_data.GetTagProperty("file").AsString();
  4307. }
  4308. if (tag_data.IsValid("label"))
  4309. {
  4310. f_strReturnLabel = tag_data.GetTagProperty("label").AsString();
  4311. }
  4312. SceneVRCommunication.Instance.KagStartDayTimeShow(f_strReturnFile, f_strReturnLabel);
  4313. return false;
  4314. }
  4315. public bool TagVRDialog(KagTagSupport tag_data)
  4316. {
  4317. string text = string.Empty;
  4318. string f_strLabelOk = string.Empty;
  4319. string f_strLabelCancel = string.Empty;
  4320. string f_strLabelYes = string.Empty;
  4321. string strLabelNo = string.Empty;
  4322. if (tag_data.IsValid("text"))
  4323. {
  4324. text = tag_data.GetTagProperty("text").AsString();
  4325. text = ScriptManager.ReplaceCharaName(text);
  4326. }
  4327. if (tag_data.IsValid("ok"))
  4328. {
  4329. f_strLabelOk = tag_data.GetTagProperty("ok").AsString();
  4330. }
  4331. if (tag_data.IsValid("cancel"))
  4332. {
  4333. f_strLabelCancel = tag_data.GetTagProperty("cancel").AsString();
  4334. }
  4335. if (tag_data.IsValid("yes"))
  4336. {
  4337. f_strLabelYes = tag_data.GetTagProperty("yes").AsString();
  4338. }
  4339. if (tag_data.IsValid("no"))
  4340. {
  4341. strLabelNo = tag_data.GetTagProperty("no").AsString();
  4342. }
  4343. SceneVRCommunication.Instance.KagDialog(text, f_strLabelOk, f_strLabelCancel, f_strLabelYes, strLabelNo);
  4344. return true;
  4345. }
  4346. public bool TagVRStartMovieMusicPlayerTV(KagTagSupport tag_data)
  4347. {
  4348. SceneVRCommunication.Instance.KagStartMovieMusicPlayerTV();
  4349. return false;
  4350. }
  4351. public bool TagVRMovieTV(KagTagSupport tag_data)
  4352. {
  4353. string f_strFileName = string.Empty;
  4354. bool f_bLoop = false;
  4355. bool f_bStart = tag_data.IsValid("start");
  4356. if (tag_data.IsValid("file"))
  4357. {
  4358. f_strFileName = tag_data.GetTagProperty("file").AsString();
  4359. }
  4360. if (tag_data.IsValid("loop"))
  4361. {
  4362. f_bLoop = tag_data.IsValid("loop");
  4363. }
  4364. SceneVRCommunication.Instance.KagVRMovieTV(f_bStart, f_strFileName, f_bLoop);
  4365. return false;
  4366. }
  4367. public bool TagVRPlantWindowShow(KagTagSupport tag_data)
  4368. {
  4369. string strFileName = string.Empty;
  4370. string strLabelOK = string.Empty;
  4371. string strLabelCancel = string.Empty;
  4372. if (tag_data.IsValid("file"))
  4373. {
  4374. strFileName = tag_data.GetTagProperty("file").AsString();
  4375. }
  4376. if (tag_data.IsValid("ok"))
  4377. {
  4378. strLabelOK = tag_data.GetTagProperty("ok").AsString();
  4379. }
  4380. if (tag_data.IsValid("cancel"))
  4381. {
  4382. strLabelCancel = tag_data.GetTagProperty("cancel").AsString();
  4383. }
  4384. SceneVRCommunication.Instance.KagPlantWindowShow(strFileName, strLabelOK, strLabelCancel);
  4385. return false;
  4386. }
  4387. public bool TagVRPlantUpdate(KagTagSupport tag_data)
  4388. {
  4389. SceneVRCommunication.Instance.KagPlantUpdate();
  4390. return false;
  4391. }
  4392. public bool TagVRTutorialStart(KagTagSupport tag_data)
  4393. {
  4394. string f_strReturnLabel = string.Empty;
  4395. if (tag_data.IsValid("end"))
  4396. {
  4397. f_strReturnLabel = tag_data.GetTagProperty("end").AsString();
  4398. }
  4399. SceneVRCommunication.Instance.KagTutorialStart(f_strReturnLabel);
  4400. return true;
  4401. }
  4402. public bool TagVRPhotoModeStart(KagTagSupport tag_data)
  4403. {
  4404. bool f_bStart = true;
  4405. if (tag_data.IsValid("start"))
  4406. {
  4407. f_bStart = true;
  4408. }
  4409. else if (tag_data.IsValid("end"))
  4410. {
  4411. f_bStart = false;
  4412. }
  4413. GameMain.Instance.OvrMgr.OvrCamera.ChangeToCameraMode(f_bStart);
  4414. return false;
  4415. }
  4416. public bool TagVRNoChangeBG(KagTagSupport tag_data)
  4417. {
  4418. bool f_bStart = true;
  4419. if (tag_data.IsValid("start"))
  4420. {
  4421. f_bStart = true;
  4422. }
  4423. else if (tag_data.IsValid("end"))
  4424. {
  4425. f_bStart = false;
  4426. }
  4427. SceneVRCommunication.Instance.KagVRNoChangeBG(f_bStart);
  4428. return false;
  4429. }
  4430. public bool TagVRCamToManHead(KagTagSupport tag_data)
  4431. {
  4432. float f_fTime = 1f;
  4433. if (tag_data.IsValid("time"))
  4434. {
  4435. f_fTime = (float)tag_data.GetTagProperty("time").AsInteger() / 1000f;
  4436. }
  4437. GameMain.Instance.OvrMgr.OvrCamera.PosToManHead(f_fTime);
  4438. return false;
  4439. }
  4440. public bool TagVRTrophyText(KagTagSupport tag_data)
  4441. {
  4442. string f_strText = string.Empty;
  4443. if (tag_data.IsValid("text"))
  4444. {
  4445. f_strText = tag_data.GetTagProperty("text").AsString();
  4446. }
  4447. SceneVRCommunication.Instance.KagVRTrophyGet(f_strText);
  4448. return false;
  4449. }
  4450. public bool TagVRRentalMaidSelectStart(KagTagSupport tag_data)
  4451. {
  4452. SceneVRCommunication.Instance.KagRentalMaidSelectStart();
  4453. return true;
  4454. }
  4455. public bool TagVRTouchUseSelect(KagTagSupport tag_data)
  4456. {
  4457. string f_strReturnLabel = string.Empty;
  4458. if (tag_data.IsValid("end"))
  4459. {
  4460. f_strReturnLabel = tag_data.GetTagProperty("end").AsString();
  4461. }
  4462. SceneVRCommunication.Instance.KagTouchUseSelect(f_strReturnLabel);
  4463. return true;
  4464. }
  4465. public bool TagVRHintShow(KagTagSupport tag_data)
  4466. {
  4467. string f_strHintMsg = string.Empty;
  4468. if (tag_data.IsValid("text"))
  4469. {
  4470. f_strHintMsg = tag_data.GetTagProperty("text").AsString();
  4471. }
  4472. SceneVRCommunication.Instance.KagHintShow(f_strHintMsg);
  4473. return false;
  4474. }
  4475. public bool TagVRKaraokeWindowShow(KagTagSupport tag_data)
  4476. {
  4477. string f_strReturnFile = string.Empty;
  4478. string f_strReturnLabel = string.Empty;
  4479. if (tag_data.IsValid("cancel_file"))
  4480. {
  4481. f_strReturnFile = tag_data.GetTagProperty("cancel_file").AsString();
  4482. }
  4483. if (tag_data.IsValid("cancel_label"))
  4484. {
  4485. f_strReturnLabel = tag_data.GetTagProperty("cancel_label").AsString();
  4486. }
  4487. SceneVRCommunication.Instance.KagKaraokeWindowShow(f_strReturnFile, f_strReturnLabel);
  4488. return false;
  4489. }
  4490. public bool TagDanceResultStart(KagTagSupport tag_data)
  4491. {
  4492. Result_Display.StartDisplay(tag_data.GetTagProperty("label").AsString());
  4493. return false;
  4494. }
  4495. public bool TagSetDanceType(KagTagSupport tag_data)
  4496. {
  4497. if (!tag_data.IsValid("dancetype"))
  4498. {
  4499. return false;
  4500. }
  4501. string value = tag_data.GetTagProperty("dancetype").AsString();
  4502. RhythmAction_Mgr.SetDanceType((RhythmAction_Mgr.DanceType)Enum.Parse(typeof(RhythmAction_Mgr.DanceType), value));
  4503. return false;
  4504. }
  4505. public bool TagCutinTexShoot(KagTagSupport tag_data)
  4506. {
  4507. string cut_name = string.Empty;
  4508. string label = string.Empty;
  4509. if (tag_data.IsValid("cut"))
  4510. {
  4511. cut_name = tag_data.GetTagProperty("cut").AsString();
  4512. }
  4513. if (tag_data.IsValid("label"))
  4514. {
  4515. label = tag_data.GetTagProperty("label").AsString();
  4516. }
  4517. ShootCutInTex.CutInTexShoot(cut_name, label);
  4518. return false;
  4519. }
  4520. public bool TagBattleCutInStart(KagTagSupport tag_data)
  4521. {
  4522. string end_label = string.Empty;
  4523. if (tag_data.IsValid("label"))
  4524. {
  4525. end_label = tag_data.GetTagProperty("label").AsString();
  4526. }
  4527. ConfrontCutIn.CutInStart(end_label);
  4528. return false;
  4529. }
  4530. public bool TagMotionCheckStart(KagTagSupport tag_data)
  4531. {
  4532. MotionAction_Mgr.ResponceStart(tag_data);
  4533. return false;
  4534. }
  4535. public bool TagSetMcSkip(KagTagSupport tag_data)
  4536. {
  4537. if (tag_data.IsValid("end"))
  4538. {
  4539. McSkip.SkipRelease();
  4540. }
  4541. else if (tag_data.IsValid("label"))
  4542. {
  4543. McSkip.SkipWait(tag_data.GetTagProperty("label").AsString());
  4544. }
  4545. return false;
  4546. }
  4547. public bool TagAddedEventDisplay(KagTagSupport tag_data)
  4548. {
  4549. string label = string.Empty;
  4550. if (tag_data.IsValid("label"))
  4551. {
  4552. label = tag_data.GetTagProperty("label").AsString();
  4553. }
  4554. else
  4555. {
  4556. Debug.LogError("タグ関数.eventrelease:Labelが指定されてません");
  4557. }
  4558. GameMain.Instance.ScenarioSelectMgr.AddedDisplay(label);
  4559. return false;
  4560. }
  4561. public bool TagTutorialStart(KagTagSupport tag_data)
  4562. {
  4563. this.CheckAbsolutelyNecessaryTag(tag_data, "name", new string[0]);
  4564. string sceneName = tag_data.GetTagProperty("name").AsString();
  4565. string returnLabelName = string.Empty;
  4566. if (tag_data.IsValid("end"))
  4567. {
  4568. returnLabelName = tag_data.GetTagProperty("end").AsString();
  4569. }
  4570. bool absoluteCall = tag_data.IsValid("absolute");
  4571. if (uGUITutorialPanel.IsOpened())
  4572. {
  4573. uGUITutorialPanel.CloseTutorial(true, false);
  4574. }
  4575. uGUITutorialPanel.OpenTutorial(sceneName, delegate
  4576. {
  4577. if (!string.IsNullOrEmpty(returnLabelName))
  4578. {
  4579. GameMain.Instance.ScriptMgr.adv_kag.JumpLabel(returnLabelName);
  4580. }
  4581. GameMain.Instance.ScriptMgr.adv_kag.Exec();
  4582. }, absoluteCall);
  4583. return true;
  4584. }
  4585. public bool TagLoadSubtitleFile(KagTagSupport tag_data)
  4586. {
  4587. return false;
  4588. }
  4589. public bool TagEndSubtitleDisplay(KagTagSupport tag_data)
  4590. {
  4591. SubtitleMovieManager.DestroyGlobalInstance();
  4592. return false;
  4593. }
  4594. public bool TagSubtitleDisplayForPlayVoice(KagTagSupport tag_data)
  4595. {
  4596. return false;
  4597. }
  4598. public bool TagSubtitleDisplay(KagTagSupport tag_data)
  4599. {
  4600. return false;
  4601. }
  4602. protected virtual void PlayMaidMotion(Maid maid, string fn, bool additive = false, bool loop = false, bool boAddQue = false, float val = 0.5f)
  4603. {
  4604. if (!GameMain.Instance.ScriptMgr.is_motion_blend)
  4605. {
  4606. val = 0f;
  4607. }
  4608. maid.IKCtrl.BlendTime = val;
  4609. maid.CrossFade(fn, this.script_mgr_.file_system, additive, loop, boAddQue, val, 1f);
  4610. }
  4611. protected virtual void PlayMaidMotionAbs(Maid maid, string fn, bool additive = false, bool loop = false, bool boAddQue = false, float val = 0.5f)
  4612. {
  4613. if (!GameMain.Instance.ScriptMgr.is_motion_blend)
  4614. {
  4615. val = 0f;
  4616. }
  4617. maid.IKCtrl.BlendTime = val;
  4618. maid.CrossFadeAbsolute(fn, this.script_mgr_.file_system, additive, loop, boAddQue, val, 1f);
  4619. }
  4620. public static Maid GetVoiceTargetMaid(KagTagSupport tag_data)
  4621. {
  4622. Maid maid = null;
  4623. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  4624. if (tag_data.IsValid("maid"))
  4625. {
  4626. maid = characterMgr.GetMaid(int.Parse(tag_data.GetTagProperty("maid").AsString()));
  4627. }
  4628. else if (tag_data.IsValid("name") || tag_data.IsValid("real"))
  4629. {
  4630. string text = string.Empty;
  4631. if (tag_data.IsValid("real"))
  4632. {
  4633. text = tag_data.GetTagProperty("real").AsString().Trim();
  4634. }
  4635. else
  4636. {
  4637. text = tag_data.GetTagProperty("name").AsString().Trim();
  4638. }
  4639. if (tag_data.IsValid("real") && text == "フリー" && GameMain.Instance.ScriptMgr.compatibilityMode)
  4640. {
  4641. text = "[HF16]";
  4642. }
  4643. if (text.IndexOf("[HF") == 0)
  4644. {
  4645. string text2 = text.Replace("[HF", string.Empty).Replace("]", string.Empty);
  4646. if (string.IsNullOrEmpty(text2))
  4647. {
  4648. text2 = "0";
  4649. }
  4650. int nMaidNo = int.Parse(text2);
  4651. maid = characterMgr.GetMaid(nMaidNo);
  4652. }
  4653. else
  4654. {
  4655. for (int i = 0; i < characterMgr.GetMaidCount(); i++)
  4656. {
  4657. Maid maid2 = characterMgr.GetMaid(i);
  4658. if (maid2 != null && maid2.boNPC && maid2.status.firstName == text)
  4659. {
  4660. maid = maid2;
  4661. break;
  4662. }
  4663. }
  4664. }
  4665. if (maid == null)
  4666. {
  4667. Debug.LogWarning("ボイス再生対象のメイドを特定できませんでした");
  4668. }
  4669. }
  4670. return maid;
  4671. }
  4672. public Maid GetMaidAndMan(string tag_str)
  4673. {
  4674. int num = 0;
  4675. tag_str = tag_str.ToLower();
  4676. int num2 = tag_str.IndexOf(':');
  4677. if (num2 != -1)
  4678. {
  4679. string[] array = tag_str.Split(new char[]
  4680. {
  4681. ':'
  4682. });
  4683. NDebug.Assert(array.Length == 2, tag_str + "\nメイド,もしくは男の指定が不正です");
  4684. num = int.Parse(array[1]);
  4685. tag_str = array[0];
  4686. }
  4687. if (tag_str == "maid")
  4688. {
  4689. return this.GetMaid(num);
  4690. }
  4691. if (tag_str == "man")
  4692. {
  4693. return this.GetMan(num);
  4694. }
  4695. NDebug.Assert(tag_str + "\nメイド,もしくは男の指定が不正です", false);
  4696. return null;
  4697. }
  4698. public Maid GetMaidAndMan(KagTagSupport tag_data)
  4699. {
  4700. int num = 0;
  4701. bool flag = false;
  4702. if (tag_data.IsValid("maid"))
  4703. {
  4704. num = tag_data.GetTagProperty("maid").AsInteger();
  4705. }
  4706. else if (tag_data.IsValid("man"))
  4707. {
  4708. flag = true;
  4709. num = tag_data.GetTagProperty("man").AsInteger();
  4710. if (this.script_mgr_.compatibilityMode && 6 <= num)
  4711. {
  4712. num = 5;
  4713. }
  4714. }
  4715. else
  4716. {
  4717. NDebug.Assert("スクリプトのman/maid指定が不正です。", false);
  4718. }
  4719. return flag ? this.GetMan(num) : this.GetMaid(num);
  4720. }
  4721. public virtual Maid GetMaid(int maid_no)
  4722. {
  4723. return GameMain.Instance.CharacterMgr.GetMaid(maid_no);
  4724. }
  4725. public virtual Maid GetMan(int man_no)
  4726. {
  4727. return GameMain.Instance.CharacterMgr.GetMan(man_no);
  4728. }
  4729. protected WaitEventList GetWaitEventList(string list_name)
  4730. {
  4731. if (!this.wait_event_list_.ContainsKey(list_name))
  4732. {
  4733. this.wait_event_list_.Add(list_name, new WaitEventList());
  4734. }
  4735. return this.wait_event_list_[list_name];
  4736. }
  4737. public void CheckAbsolutelyNecessaryTag(KagTagSupport tag_data, string tag_name, params string[] check_tag)
  4738. {
  4739. for (int i = 0; i < check_tag.Length; i++)
  4740. {
  4741. NDebug.Assert(tag_data.IsValid(check_tag[i]), string.Concat(new string[]
  4742. {
  4743. "@",
  4744. tag_name,
  4745. "\n必須タグ[",
  4746. check_tag[i],
  4747. "]が指定されていません"
  4748. }));
  4749. }
  4750. }
  4751. protected bool SetWait(int time, bool skip_possible)
  4752. {
  4753. this.SetExecWait(time, skip_possible);
  4754. return true;
  4755. }
  4756. public void ExecForcWaitEvent()
  4757. {
  4758. WaitEventList waitEventList = this.GetWaitEventList("tex_mul_add");
  4759. if (waitEventList.list == null || waitEventList.list.Count == 0)
  4760. {
  4761. return;
  4762. }
  4763. for (int i = 0; i < waitEventList.list.Count; i++)
  4764. {
  4765. waitEventList.list[i].call_back_delegate();
  4766. }
  4767. waitEventList.Clear();
  4768. }
  4769. public void ClearForcExecWaitEvent()
  4770. {
  4771. WaitEventList waitEventList = this.GetWaitEventList("tex_mul_add");
  4772. if (waitEventList.list == null || waitEventList.list.Count == 0)
  4773. {
  4774. return;
  4775. }
  4776. waitEventList.Clear();
  4777. }
  4778. public void Dispose()
  4779. {
  4780. this.Dispose(true);
  4781. GC.SuppressFinalize(this);
  4782. }
  4783. protected void Dispose(bool is_release_managed_code)
  4784. {
  4785. if (this.is_disposed_)
  4786. {
  4787. return;
  4788. }
  4789. this.wait_event_list_.Clear();
  4790. this.kag_.Dispose();
  4791. this.kag_ = null;
  4792. this.script_mgr_ = null;
  4793. this.is_disposed_ = true;
  4794. }
  4795. public KagScript kag
  4796. {
  4797. get
  4798. {
  4799. return this.kag_;
  4800. }
  4801. }
  4802. protected bool exec_wait_enabled
  4803. {
  4804. get
  4805. {
  4806. return this.exec_wait_data_.use;
  4807. }
  4808. }
  4809. protected bool IsFadeProc()
  4810. {
  4811. return GameMain.Instance.MainCamera.IsFadeProc() || GameMain.Instance.MainCamera.IsFadeProcNoUI();
  4812. }
  4813. private void OnScenarioLoadEvent(string file_name, string label_name)
  4814. {
  4815. this.subtitle_data.Clear();
  4816. }
  4817. public virtual string GetKagClassName()
  4818. {
  4819. return "ベースkag";
  4820. }
  4821. private string ReplaceFileNameCallBack(string file_name)
  4822. {
  4823. Maid maid = this.GetMaid(0);
  4824. if (maid == null)
  4825. {
  4826. return file_name;
  4827. }
  4828. int maidCount = GameMain.Instance.CharacterMgr.GetMaidCount();
  4829. Maid[] array = new Maid[maidCount];
  4830. for (int i = 0; i < maidCount; i++)
  4831. {
  4832. array[i] = this.GetMaid(i);
  4833. }
  4834. return ScriptManager.ReplacePersonal(array, file_name);
  4835. }
  4836. public void Serialize(BinaryWriter binary)
  4837. {
  4838. binary.Write("CM3D2_KAG");
  4839. binary.Write(1200);
  4840. byte[] array = this.kag_.Serialize();
  4841. int value = array.Length;
  4842. binary.Write(value);
  4843. binary.Write(array);
  4844. binary.Write(this.fade_wait_);
  4845. binary.Write(this.enabled);
  4846. }
  4847. public void Deserialize(BinaryReader binary)
  4848. {
  4849. string a = binary.ReadString();
  4850. NDebug.Assert(a == "CM3D2_KAG", "KAGのヘッダーが不正です。");
  4851. int num = binary.ReadInt32();
  4852. int count = binary.ReadInt32();
  4853. byte[] serialize_data = binary.ReadBytes(count);
  4854. this.kag_.Deserialize(serialize_data);
  4855. this.fade_wait_ = binary.ReadBoolean();
  4856. this.enabled = binary.ReadBoolean();
  4857. this.exec_wait_data_.Clear();
  4858. this.wait_event_list_.Clear();
  4859. this.subtitle_data.Clear();
  4860. }
  4861. public bool enabled { get; set; }
  4862. public List<Maid> maidOffsetSetList { get; protected set; }
  4863. protected readonly TJSScript tjs_;
  4864. protected ScriptManager script_mgr_;
  4865. protected KagScript kag_;
  4866. protected bool fade_wait_;
  4867. protected BaseKagManager.ExecWaitData exec_wait_data_ = new BaseKagManager.ExecWaitData();
  4868. protected Dictionary<string, WaitEventList> wait_event_list_ = new Dictionary<string, WaitEventList>();
  4869. protected BaseKagManager.SubtitleData subtitle_data = new BaseKagManager.SubtitleData();
  4870. private bool is_disposed_;
  4871. [CompilerGenerated]
  4872. private static Comparison<Maid> <>f__mg$cache0;
  4873. [CompilerGenerated]
  4874. private static Comparison<Maid> <>f__mg$cache1;
  4875. private class PerthOffsetPosTagData
  4876. {
  4877. public static CharacterMgr.CharaPer CreateCharaPer(TJSScript tjs, KagTagSupport tag_data)
  4878. {
  4879. CharacterMgr.CharaPer charaPer = BaseKagManager.PerthOffsetPosTagData.GetCharaPer(tjs, tag_data, string.Empty);
  4880. NDebug.AssertNull(charaPer != null);
  4881. return charaPer;
  4882. }
  4883. public static List<KeyValuePair<Maid, CharacterMgr.CharaPer>> CreateMultiCharaPer(TJSScript tjs, KagTagSupport tag_data, BaseKagManager kag_mgr)
  4884. {
  4885. List<KeyValuePair<Maid, CharacterMgr.CharaPer>> list = new List<KeyValuePair<Maid, CharacterMgr.CharaPer>>();
  4886. for (int i = 0; i < GameMain.Instance.CharacterMgr.GetMaidCount(); i++)
  4887. {
  4888. CharacterMgr.CharaPer charaPer = BaseKagManager.PerthOffsetPosTagData.GetCharaPer(tjs, tag_data, "-Maid:" + i);
  4889. if (charaPer != null)
  4890. {
  4891. KeyValuePair<Maid, CharacterMgr.CharaPer> item = new KeyValuePair<Maid, CharacterMgr.CharaPer>(kag_mgr.GetMaid(i), charaPer);
  4892. list.Add(item);
  4893. }
  4894. }
  4895. return list;
  4896. }
  4897. public static KeyValuePair<CharacterMgr.CharaPer, CharacterMgr.PenisPer> CreateCharaPerAndPenisPer(TJSScript tjs, KagTagSupport tag_data)
  4898. {
  4899. CharacterMgr.CharaPer charaPer = BaseKagManager.PerthOffsetPosTagData.GetCharaPer(tjs, tag_data, string.Empty);
  4900. if (charaPer == null)
  4901. {
  4902. charaPer = new CharacterMgr.CharaPer();
  4903. }
  4904. CharacterMgr.PenisPer penisPer = BaseKagManager.PerthOffsetPosTagData.GetPenisPer(tjs, tag_data);
  4905. if (penisPer == null)
  4906. {
  4907. penisPer = new CharacterMgr.PenisPer();
  4908. }
  4909. return new KeyValuePair<CharacterMgr.CharaPer, CharacterMgr.PenisPer>(charaPer, penisPer);
  4910. }
  4911. private static CharacterMgr.CharaPer GetCharaPer(TJSScript tjs, KagTagSupport tag_data, string add_tag_string)
  4912. {
  4913. CharacterMgr.CharaPer charaPer = null;
  4914. BaseKagManager.PerthOffsetPosTagData.TagArrayData tagArrayData = BaseKagManager.PerthOffsetPosTagData.TagArrayData.Create(tjs, tag_data, "OffsDouPar" + add_tag_string);
  4915. if (tagArrayData.valid)
  4916. {
  4917. if (charaPer == null)
  4918. {
  4919. charaPer = new CharacterMgr.CharaPer();
  4920. }
  4921. tagArrayData.GetVector3(ref charaPer.vecOffsDouParGreater, ref charaPer.vecOffsDouParLess);
  4922. }
  4923. BaseKagManager.PerthOffsetPosTagData.TagArrayData.Rlease();
  4924. tagArrayData = BaseKagManager.PerthOffsetPosTagData.TagArrayData.Create(tjs, tag_data, "OffsShinCho" + add_tag_string);
  4925. if (tagArrayData.valid)
  4926. {
  4927. if (charaPer == null)
  4928. {
  4929. charaPer = new CharacterMgr.CharaPer();
  4930. }
  4931. tagArrayData.GetVector3(ref charaPer.vecOffsShinChoGreater, ref charaPer.vecOffsShinChoLess);
  4932. }
  4933. BaseKagManager.PerthOffsetPosTagData.TagArrayData.Rlease();
  4934. tagArrayData = BaseKagManager.PerthOffsetPosTagData.TagArrayData.Create(tjs, tag_data, "OffsMuneL" + add_tag_string);
  4935. if (tagArrayData.valid)
  4936. {
  4937. if (charaPer == null)
  4938. {
  4939. charaPer = new CharacterMgr.CharaPer();
  4940. }
  4941. tagArrayData.GetVector3(ref charaPer.vecOffsMuneLGreater, ref charaPer.vecOffsMuneLLess);
  4942. }
  4943. BaseKagManager.PerthOffsetPosTagData.TagArrayData.Rlease();
  4944. tagArrayData = BaseKagManager.PerthOffsetPosTagData.TagArrayData.Create(tjs, tag_data, "HaremDouPer" + add_tag_string);
  4945. if (tagArrayData.valid)
  4946. {
  4947. if (charaPer == null)
  4948. {
  4949. charaPer = new CharacterMgr.CharaPer();
  4950. }
  4951. tagArrayData.GetVector3(ref charaPer.vecHaremDouPerGreater, ref charaPer.vecHaremDouPerLess);
  4952. }
  4953. BaseKagManager.PerthOffsetPosTagData.TagArrayData.Rlease();
  4954. tagArrayData = BaseKagManager.PerthOffsetPosTagData.TagArrayData.Create(tjs, tag_data, "HaremShinCho" + add_tag_string);
  4955. if (tagArrayData.valid)
  4956. {
  4957. if (charaPer == null)
  4958. {
  4959. charaPer = new CharacterMgr.CharaPer();
  4960. }
  4961. tagArrayData.GetVector3(ref charaPer.vecHaremShinChoGreater, ref charaPer.vecHaremShinChoLess);
  4962. }
  4963. BaseKagManager.PerthOffsetPosTagData.TagArrayData.Rlease();
  4964. tagArrayData = BaseKagManager.PerthOffsetPosTagData.TagArrayData.Create(tjs, tag_data, "HaremMuneL" + add_tag_string);
  4965. if (tagArrayData.valid)
  4966. {
  4967. if (charaPer == null)
  4968. {
  4969. charaPer = new CharacterMgr.CharaPer();
  4970. }
  4971. tagArrayData.GetVector3(ref charaPer.vecHaremMuneLGreater, ref charaPer.vecHaremMuneLLess);
  4972. }
  4973. BaseKagManager.PerthOffsetPosTagData.TagArrayData.Rlease();
  4974. return charaPer;
  4975. }
  4976. private static CharacterMgr.PenisPer GetPenisPer(TJSScript tjs, KagTagSupport tag_data)
  4977. {
  4978. CharacterMgr.PenisPer penisPer = null;
  4979. BaseKagManager.PerthOffsetPosTagData.TagArrayData tagArrayData = BaseKagManager.PerthOffsetPosTagData.TagArrayData.Create(tjs, tag_data, "PenisCommonBase");
  4980. if (tagArrayData.valid)
  4981. {
  4982. if (penisPer == null)
  4983. {
  4984. penisPer = new CharacterMgr.PenisPer();
  4985. }
  4986. tagArrayData.GetVector3(ref penisPer.vecPenisCommonBase);
  4987. }
  4988. BaseKagManager.PerthOffsetPosTagData.TagArrayData.Rlease();
  4989. tagArrayData = BaseKagManager.PerthOffsetPosTagData.TagArrayData.Create(tjs, tag_data, "PenisAmend");
  4990. if (tagArrayData.valid)
  4991. {
  4992. if (penisPer == null)
  4993. {
  4994. penisPer = new CharacterMgr.PenisPer();
  4995. }
  4996. tagArrayData.GetVector3(ref penisPer.vecPenisAmend);
  4997. }
  4998. BaseKagManager.PerthOffsetPosTagData.TagArrayData.Rlease();
  4999. tagArrayData = BaseKagManager.PerthOffsetPosTagData.TagArrayData.Create(tjs, tag_data, "PenisDouPer");
  5000. if (tagArrayData.valid)
  5001. {
  5002. if (penisPer == null)
  5003. {
  5004. penisPer = new CharacterMgr.PenisPer();
  5005. }
  5006. tagArrayData.GetVector3(ref penisPer.vecPenisDouPerGreater, ref penisPer.vecPenisDouPerLess);
  5007. }
  5008. BaseKagManager.PerthOffsetPosTagData.TagArrayData.Rlease();
  5009. tagArrayData = BaseKagManager.PerthOffsetPosTagData.TagArrayData.Create(tjs, tag_data, "PenisShincho");
  5010. if (tagArrayData.valid)
  5011. {
  5012. if (penisPer == null)
  5013. {
  5014. penisPer = new CharacterMgr.PenisPer();
  5015. }
  5016. tagArrayData.GetVector3(ref penisPer.vecPenisShinchoGreater, ref penisPer.vecPenisShinchoLess);
  5017. }
  5018. BaseKagManager.PerthOffsetPosTagData.TagArrayData.Rlease();
  5019. return penisPer;
  5020. }
  5021. private class TagArrayData
  5022. {
  5023. private TagArrayData(TJSScript tjs, KagTagSupport tag_data, string tag_name)
  5024. {
  5025. this.tjs_ = tjs;
  5026. this.is_valid_ = tag_data.IsValid(tag_name);
  5027. if (this.is_valid_)
  5028. {
  5029. string eval_str = this.kTjsGlobalVarName + "=" + tag_data.GetTagProperty(tag_name).AsString();
  5030. this.tjs_.EvalScript(eval_str);
  5031. TJSVariant tjsvariant = new TJSVariant();
  5032. this.tjs_.EvalScript(this.kTjsGlobalVarName + ".count", tjsvariant);
  5033. this.array_count_ = tjsvariant.AsInteger();
  5034. tjsvariant.Dispose();
  5035. NDebug.Assert(this.array_count_ == 3 || this.array_count_ == 6, tag_name + "の指定数が不正です(6 or 7 only)");
  5036. }
  5037. }
  5038. public static BaseKagManager.PerthOffsetPosTagData.TagArrayData Create(TJSScript tjs, KagTagSupport tag_data, string tag_name)
  5039. {
  5040. NDebug.Assert(BaseKagManager.PerthOffsetPosTagData.TagArrayData.instans_data_ == null, "TagArrayDataインスタンスの重複");
  5041. tag_name = tag_name.ToLower();
  5042. BaseKagManager.PerthOffsetPosTagData.TagArrayData.instans_data_ = new BaseKagManager.PerthOffsetPosTagData.TagArrayData(tjs, tag_data, tag_name);
  5043. return BaseKagManager.PerthOffsetPosTagData.TagArrayData.instans_data_;
  5044. }
  5045. public static void Rlease()
  5046. {
  5047. if (BaseKagManager.PerthOffsetPosTagData.TagArrayData.instans_data_ == null)
  5048. {
  5049. return;
  5050. }
  5051. BaseKagManager.PerthOffsetPosTagData.TagArrayData.instans_data_.tjs_.EvalScript(BaseKagManager.PerthOffsetPosTagData.TagArrayData.instans_data_.kTjsGlobalVarName + " = void");
  5052. BaseKagManager.PerthOffsetPosTagData.TagArrayData.instans_data_ = null;
  5053. }
  5054. public void GetVector3(ref Vector3 dest)
  5055. {
  5056. if (!this.is_valid_)
  5057. {
  5058. return;
  5059. }
  5060. NDebug.Assert(this.array_count_ == 3, "Vector3*2の要素に対してVector3を1つのみ作成しようとしています");
  5061. using (TJSVariant tjsvariant = new TJSVariant())
  5062. {
  5063. this.tjs_.EvalScript(this.kTjsGlobalVarName + "[0]", tjsvariant);
  5064. dest.x = tjsvariant.AsReal();
  5065. this.tjs_.EvalScript(this.kTjsGlobalVarName + "[1]", tjsvariant);
  5066. dest.y = tjsvariant.AsReal();
  5067. this.tjs_.EvalScript(this.kTjsGlobalVarName + "[2]", tjsvariant);
  5068. dest.z = tjsvariant.AsReal();
  5069. }
  5070. }
  5071. public void GetVector3(ref Vector3 first_dest, ref Vector3 second_dest)
  5072. {
  5073. if (!this.is_valid_)
  5074. {
  5075. return;
  5076. }
  5077. NDebug.Assert(this.array_count_ == 6, "要素xyzのみに対してVector3を2つ作成しようとしています");
  5078. using (TJSVariant tjsvariant = new TJSVariant())
  5079. {
  5080. this.tjs_.EvalScript(this.kTjsGlobalVarName + "[0]", tjsvariant);
  5081. first_dest.x = tjsvariant.AsReal();
  5082. this.tjs_.EvalScript(this.kTjsGlobalVarName + "[1]", tjsvariant);
  5083. first_dest.y = tjsvariant.AsReal();
  5084. this.tjs_.EvalScript(this.kTjsGlobalVarName + "[2]", tjsvariant);
  5085. first_dest.z = tjsvariant.AsReal();
  5086. this.tjs_.EvalScript(this.kTjsGlobalVarName + "[3]", tjsvariant);
  5087. second_dest.x = tjsvariant.AsReal();
  5088. this.tjs_.EvalScript(this.kTjsGlobalVarName + "[4]", tjsvariant);
  5089. second_dest.y = tjsvariant.AsReal();
  5090. this.tjs_.EvalScript(this.kTjsGlobalVarName + "[5]", tjsvariant);
  5091. second_dest.z = tjsvariant.AsReal();
  5092. }
  5093. }
  5094. public int vecotr_element_count
  5095. {
  5096. get
  5097. {
  5098. return (this.array_count_ != 3) ? 2 : 1;
  5099. }
  5100. }
  5101. public int count
  5102. {
  5103. get
  5104. {
  5105. return this.array_count_;
  5106. }
  5107. }
  5108. public bool valid
  5109. {
  5110. get
  5111. {
  5112. return this.is_valid_;
  5113. }
  5114. }
  5115. private string kTjsGlobalVarName = "global.__tmp_array";
  5116. private static BaseKagManager.PerthOffsetPosTagData.TagArrayData instans_data_;
  5117. private TJSScript tjs_;
  5118. private bool is_valid_;
  5119. private int array_count_;
  5120. }
  5121. }
  5122. protected class ExecWaitData
  5123. {
  5124. public virtual bool Check()
  5125. {
  5126. return !this.use || this.wait_time <= GameMain.tick_count - this.start_tick_count;
  5127. }
  5128. public virtual void Clear()
  5129. {
  5130. this.start_tick_count = (this.wait_time = 0);
  5131. this.use = false;
  5132. this.skip_possible = true;
  5133. }
  5134. public int start_tick_count;
  5135. public int wait_time;
  5136. public bool skip_possible;
  5137. public bool use;
  5138. }
  5139. protected class MaidPropSeqWaitData : BaseKagManager.ExecWaitData
  5140. {
  5141. public override bool Check()
  5142. {
  5143. return !this.use || this.maid == null || !this.maid.IsBusy;
  5144. }
  5145. public override void Clear()
  5146. {
  5147. base.Clear();
  5148. this.maid = null;
  5149. }
  5150. public Maid maid;
  5151. }
  5152. protected class MaidVoiceWaitData : BaseKagManager.ExecWaitData
  5153. {
  5154. public override bool Check()
  5155. {
  5156. if (!this.use || this.maid == null)
  5157. {
  5158. return true;
  5159. }
  5160. AudioSourceMgr audioMan = this.maid.AudioMan;
  5161. return audioMan == null || !audioMan.isPlay();
  5162. }
  5163. public override void Clear()
  5164. {
  5165. base.Clear();
  5166. this.maid = null;
  5167. }
  5168. public Maid maid;
  5169. }
  5170. protected class DummyVoiceWaitData : BaseKagManager.ExecWaitData
  5171. {
  5172. public override bool Check()
  5173. {
  5174. return !this.use || !GameMain.Instance.SoundMgr.IsPlayDummyVoice();
  5175. }
  5176. public override void Clear()
  5177. {
  5178. base.Clear();
  5179. }
  5180. }
  5181. protected class SubtitleData
  5182. {
  5183. public SubtitleData()
  5184. {
  5185. this.Clear();
  5186. }
  5187. public void Clear()
  5188. {
  5189. this.text = string.Empty;
  5190. this.displayTime = -1;
  5191. this.addDisplayTime = 0;
  5192. this.casinoType = false;
  5193. }
  5194. public string text;
  5195. public int displayTime;
  5196. public int addDisplayTime;
  5197. public bool casinoType;
  5198. }
  5199. }