BaseKagManager.cs 162 KB

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