BaseKagManager.cs 151 KB

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