BaseKagManager.cs 152 KB

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