BaseKagManager.cs 156 KB

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