BaseKagManager.cs 161 KB

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