BaseKagManager.cs 152 KB

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