BaseKagManager.cs 149 KB

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