BaseKagManager.cs 151 KB

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