BaseKagManager.cs 156 KB

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