BaseKagManager.cs 150 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488
  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. return false;
  4645. }
  4646. public bool TagEndSubtitleDisplay(KagTagSupport tag_data)
  4647. {
  4648. SubtitleMovieManager.DestroyGlobalInstance();
  4649. return false;
  4650. }
  4651. public bool TagSubtitleDisplayForPlayVoice(KagTagSupport tag_data)
  4652. {
  4653. return false;
  4654. }
  4655. public bool TagSubtitleDisplay(KagTagSupport tag_data)
  4656. {
  4657. return false;
  4658. }
  4659. protected virtual void PlayMaidMotion(Maid maid, string fn, bool additive = false, bool loop = false, bool boAddQue = false, float val = 0.5f)
  4660. {
  4661. if (!GameMain.Instance.ScriptMgr.is_motion_blend)
  4662. {
  4663. val = 0f;
  4664. }
  4665. maid.CrossFade(fn, this.script_mgr_.file_system, additive, loop, boAddQue, val, 1f);
  4666. }
  4667. protected virtual void PlayMaidMotionAbs(Maid maid, string fn, bool additive = false, bool loop = false, bool boAddQue = false, float val = 0.5f)
  4668. {
  4669. if (!GameMain.Instance.ScriptMgr.is_motion_blend)
  4670. {
  4671. val = 0f;
  4672. }
  4673. maid.CrossFadeAbsolute(fn, this.script_mgr_.file_system, additive, loop, boAddQue, val, 1f);
  4674. }
  4675. public static Maid GetVoiceTargetMaid(KagTagSupport tag_data)
  4676. {
  4677. Maid maid = null;
  4678. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  4679. if (tag_data.IsValid("maid"))
  4680. {
  4681. maid = characterMgr.GetMaid(int.Parse(tag_data.GetTagProperty("maid").AsString()));
  4682. }
  4683. else if (tag_data.IsValid("name") || tag_data.IsValid("real"))
  4684. {
  4685. string text = string.Empty;
  4686. if (tag_data.IsValid("real"))
  4687. {
  4688. text = tag_data.GetTagProperty("real").AsString().Trim();
  4689. }
  4690. else
  4691. {
  4692. text = tag_data.GetTagProperty("name").AsString().Trim();
  4693. }
  4694. if (tag_data.IsValid("real") && text == "フリー" && GameMain.Instance.ScriptMgr.compatibilityMode)
  4695. {
  4696. text = "[HF16]";
  4697. }
  4698. if (text.IndexOf("[HF") == 0)
  4699. {
  4700. string text2 = text.Replace("[HF", string.Empty).Replace("]", string.Empty);
  4701. if (string.IsNullOrEmpty(text2))
  4702. {
  4703. text2 = "0";
  4704. }
  4705. int nMaidNo = int.Parse(text2);
  4706. maid = characterMgr.GetMaid(nMaidNo);
  4707. }
  4708. else
  4709. {
  4710. for (int i = 0; i < characterMgr.GetMaidCount(); i++)
  4711. {
  4712. Maid maid2 = characterMgr.GetMaid(i);
  4713. if (maid2 != null && maid2.boNPC && maid2.status.firstName == text)
  4714. {
  4715. maid = maid2;
  4716. break;
  4717. }
  4718. }
  4719. }
  4720. if (maid == null)
  4721. {
  4722. Debug.LogWarning("ボイス再生対象のメイドを特定できませんでした");
  4723. }
  4724. }
  4725. return maid;
  4726. }
  4727. public Maid GetMaidAndMan(string tag_str)
  4728. {
  4729. int num = 0;
  4730. tag_str = tag_str.ToLower();
  4731. int num2 = tag_str.IndexOf(':');
  4732. if (num2 != -1)
  4733. {
  4734. string[] array = tag_str.Split(new char[]
  4735. {
  4736. ':'
  4737. });
  4738. NDebug.Assert(array.Length == 2, tag_str + "\nメイド,もしくは男の指定が不正です");
  4739. num = int.Parse(array[1]);
  4740. tag_str = array[0];
  4741. }
  4742. if (tag_str == "maid")
  4743. {
  4744. return this.GetMaid(num);
  4745. }
  4746. if (tag_str == "man")
  4747. {
  4748. return this.GetMan(num);
  4749. }
  4750. NDebug.Assert(tag_str + "\nメイド,もしくは男の指定が不正です", false);
  4751. return null;
  4752. }
  4753. public Maid GetMaidAndMan(KagTagSupport tag_data)
  4754. {
  4755. int num = 0;
  4756. bool flag = false;
  4757. if (tag_data.IsValid("maid"))
  4758. {
  4759. num = tag_data.GetTagProperty("maid").AsInteger();
  4760. }
  4761. else if (tag_data.IsValid("man"))
  4762. {
  4763. flag = true;
  4764. num = tag_data.GetTagProperty("man").AsInteger();
  4765. if (this.script_mgr_.compatibilityMode && 6 <= num)
  4766. {
  4767. num = 5;
  4768. }
  4769. }
  4770. else
  4771. {
  4772. NDebug.Assert("スクリプトのman/maid指定が不正です。", false);
  4773. }
  4774. return flag ? this.GetMan(num) : this.GetMaid(num);
  4775. }
  4776. public virtual Maid GetMaid(int maid_no)
  4777. {
  4778. return GameMain.Instance.CharacterMgr.GetMaid(maid_no);
  4779. }
  4780. public virtual Maid GetMan(int man_no)
  4781. {
  4782. return GameMain.Instance.CharacterMgr.GetMan(man_no);
  4783. }
  4784. protected WaitEventList GetWaitEventList(string list_name)
  4785. {
  4786. if (!this.wait_event_list_.ContainsKey(list_name))
  4787. {
  4788. this.wait_event_list_.Add(list_name, new WaitEventList());
  4789. }
  4790. return this.wait_event_list_[list_name];
  4791. }
  4792. public void CheckAbsolutelyNecessaryTag(KagTagSupport tag_data, string tag_name, params string[] check_tag)
  4793. {
  4794. for (int i = 0; i < check_tag.Length; i++)
  4795. {
  4796. NDebug.Assert(tag_data.IsValid(check_tag[i]), string.Concat(new string[]
  4797. {
  4798. "@",
  4799. tag_name,
  4800. "\n必須タグ[",
  4801. check_tag[i],
  4802. "]が指定されていません"
  4803. }));
  4804. }
  4805. }
  4806. protected bool SetWait(int time, bool skip_possible)
  4807. {
  4808. this.SetExecWait(time, skip_possible);
  4809. return true;
  4810. }
  4811. public void ExecForcWaitEvent()
  4812. {
  4813. WaitEventList waitEventList = this.GetWaitEventList("tex_mul_add");
  4814. if (waitEventList.list == null || waitEventList.list.Count == 0)
  4815. {
  4816. return;
  4817. }
  4818. for (int i = 0; i < waitEventList.list.Count; i++)
  4819. {
  4820. waitEventList.list[i].call_back_delegate();
  4821. }
  4822. waitEventList.Clear();
  4823. }
  4824. public void ClearForcExecWaitEvent()
  4825. {
  4826. WaitEventList waitEventList = this.GetWaitEventList("tex_mul_add");
  4827. if (waitEventList.list == null || waitEventList.list.Count == 0)
  4828. {
  4829. return;
  4830. }
  4831. waitEventList.Clear();
  4832. }
  4833. public void Dispose()
  4834. {
  4835. this.Dispose(true);
  4836. GC.SuppressFinalize(this);
  4837. }
  4838. protected void Dispose(bool is_release_managed_code)
  4839. {
  4840. if (this.is_disposed_)
  4841. {
  4842. return;
  4843. }
  4844. this.wait_event_list_.Clear();
  4845. this.kag_.Dispose();
  4846. this.kag_ = null;
  4847. this.script_mgr_ = null;
  4848. this.is_disposed_ = true;
  4849. }
  4850. public KagScript kag
  4851. {
  4852. get
  4853. {
  4854. return this.kag_;
  4855. }
  4856. }
  4857. protected bool exec_wait_enabled
  4858. {
  4859. get
  4860. {
  4861. return this.exec_wait_data_.use;
  4862. }
  4863. }
  4864. protected bool IsFadeProc()
  4865. {
  4866. return GameMain.Instance.MainCamera.IsFadeProc() || GameMain.Instance.MainCamera.IsFadeProcNoUI();
  4867. }
  4868. private void OnScenarioLoadEvent(string file_name, string label_name)
  4869. {
  4870. this.subtitle_data.Clear();
  4871. }
  4872. public virtual string GetKagClassName()
  4873. {
  4874. return "ベースkag";
  4875. }
  4876. private string ReplaceFileNameCallBack(string file_name)
  4877. {
  4878. Maid maid = this.GetMaid(0);
  4879. if (maid == null)
  4880. {
  4881. return file_name;
  4882. }
  4883. int maidCount = GameMain.Instance.CharacterMgr.GetMaidCount();
  4884. Maid[] array = new Maid[maidCount];
  4885. for (int i = 0; i < maidCount; i++)
  4886. {
  4887. array[i] = this.GetMaid(i);
  4888. }
  4889. return ScriptManager.ReplacePersonal(array, file_name);
  4890. }
  4891. public void Serialize(BinaryWriter binary)
  4892. {
  4893. binary.Write("CM3D2_KAG");
  4894. binary.Write(1180);
  4895. byte[] array = this.kag_.Serialize();
  4896. int value = array.Length;
  4897. binary.Write(value);
  4898. binary.Write(array);
  4899. binary.Write(this.fade_wait_);
  4900. binary.Write(this.enabled);
  4901. }
  4902. public void Deserialize(BinaryReader binary)
  4903. {
  4904. string a = binary.ReadString();
  4905. NDebug.Assert(a == "CM3D2_KAG", "KAGのヘッダーが不正です。");
  4906. int num = binary.ReadInt32();
  4907. int count = binary.ReadInt32();
  4908. byte[] serialize_data = binary.ReadBytes(count);
  4909. this.kag_.Deserialize(serialize_data);
  4910. this.fade_wait_ = binary.ReadBoolean();
  4911. this.enabled = binary.ReadBoolean();
  4912. this.exec_wait_data_.Clear();
  4913. this.wait_event_list_.Clear();
  4914. this.subtitle_data.Clear();
  4915. }
  4916. public bool enabled { get; set; }
  4917. public List<Maid> maidOffsetSetList { get; protected set; }
  4918. protected readonly TJSScript tjs_;
  4919. protected ScriptManager script_mgr_;
  4920. protected KagScript kag_;
  4921. protected bool fade_wait_;
  4922. protected BaseKagManager.ExecWaitData exec_wait_data_ = new BaseKagManager.ExecWaitData();
  4923. protected Dictionary<string, WaitEventList> wait_event_list_ = new Dictionary<string, WaitEventList>();
  4924. protected BaseKagManager.SubtitleData subtitle_data = new BaseKagManager.SubtitleData();
  4925. private bool is_disposed_;
  4926. [CompilerGenerated]
  4927. private static Comparison<Maid> <>f__mg$cache0;
  4928. [CompilerGenerated]
  4929. private static Comparison<Maid> <>f__mg$cache1;
  4930. private class PerthOffsetPosTagData
  4931. {
  4932. public static CharacterMgr.CharaPer CreateCharaPer(TJSScript tjs, KagTagSupport tag_data)
  4933. {
  4934. CharacterMgr.CharaPer charaPer = BaseKagManager.PerthOffsetPosTagData.GetCharaPer(tjs, tag_data, string.Empty);
  4935. NDebug.AssertNull(charaPer != null);
  4936. return charaPer;
  4937. }
  4938. public static List<KeyValuePair<Maid, CharacterMgr.CharaPer>> CreateMultiCharaPer(TJSScript tjs, KagTagSupport tag_data, BaseKagManager kag_mgr)
  4939. {
  4940. List<KeyValuePair<Maid, CharacterMgr.CharaPer>> list = new List<KeyValuePair<Maid, CharacterMgr.CharaPer>>();
  4941. for (int i = 0; i < GameMain.Instance.CharacterMgr.GetMaidCount(); i++)
  4942. {
  4943. CharacterMgr.CharaPer charaPer = BaseKagManager.PerthOffsetPosTagData.GetCharaPer(tjs, tag_data, "-Maid:" + i);
  4944. if (charaPer != null)
  4945. {
  4946. KeyValuePair<Maid, CharacterMgr.CharaPer> item = new KeyValuePair<Maid, CharacterMgr.CharaPer>(kag_mgr.GetMaid(i), charaPer);
  4947. list.Add(item);
  4948. }
  4949. }
  4950. return list;
  4951. }
  4952. public static KeyValuePair<CharacterMgr.CharaPer, CharacterMgr.PenisPer> CreateCharaPerAndPenisPer(TJSScript tjs, KagTagSupport tag_data)
  4953. {
  4954. CharacterMgr.CharaPer charaPer = BaseKagManager.PerthOffsetPosTagData.GetCharaPer(tjs, tag_data, string.Empty);
  4955. if (charaPer == null)
  4956. {
  4957. charaPer = new CharacterMgr.CharaPer();
  4958. }
  4959. CharacterMgr.PenisPer penisPer = BaseKagManager.PerthOffsetPosTagData.GetPenisPer(tjs, tag_data);
  4960. if (penisPer == null)
  4961. {
  4962. penisPer = new CharacterMgr.PenisPer();
  4963. }
  4964. return new KeyValuePair<CharacterMgr.CharaPer, CharacterMgr.PenisPer>(charaPer, penisPer);
  4965. }
  4966. private static CharacterMgr.CharaPer GetCharaPer(TJSScript tjs, KagTagSupport tag_data, string add_tag_string)
  4967. {
  4968. CharacterMgr.CharaPer charaPer = null;
  4969. BaseKagManager.PerthOffsetPosTagData.TagArrayData tagArrayData = BaseKagManager.PerthOffsetPosTagData.TagArrayData.Create(tjs, tag_data, "OffsDouPar" + add_tag_string);
  4970. if (tagArrayData.valid)
  4971. {
  4972. if (charaPer == null)
  4973. {
  4974. charaPer = new CharacterMgr.CharaPer();
  4975. }
  4976. tagArrayData.GetVector3(ref charaPer.vecOffsDouParGreater, ref charaPer.vecOffsDouParLess);
  4977. }
  4978. BaseKagManager.PerthOffsetPosTagData.TagArrayData.Rlease();
  4979. tagArrayData = BaseKagManager.PerthOffsetPosTagData.TagArrayData.Create(tjs, tag_data, "OffsShinCho" + add_tag_string);
  4980. if (tagArrayData.valid)
  4981. {
  4982. if (charaPer == null)
  4983. {
  4984. charaPer = new CharacterMgr.CharaPer();
  4985. }
  4986. tagArrayData.GetVector3(ref charaPer.vecOffsShinChoGreater, ref charaPer.vecOffsShinChoLess);
  4987. }
  4988. BaseKagManager.PerthOffsetPosTagData.TagArrayData.Rlease();
  4989. tagArrayData = BaseKagManager.PerthOffsetPosTagData.TagArrayData.Create(tjs, tag_data, "OffsMuneL" + add_tag_string);
  4990. if (tagArrayData.valid)
  4991. {
  4992. if (charaPer == null)
  4993. {
  4994. charaPer = new CharacterMgr.CharaPer();
  4995. }
  4996. tagArrayData.GetVector3(ref charaPer.vecOffsMuneLGreater, ref charaPer.vecOffsMuneLLess);
  4997. }
  4998. BaseKagManager.PerthOffsetPosTagData.TagArrayData.Rlease();
  4999. tagArrayData = BaseKagManager.PerthOffsetPosTagData.TagArrayData.Create(tjs, tag_data, "HaremDouPer" + add_tag_string);
  5000. if (tagArrayData.valid)
  5001. {
  5002. if (charaPer == null)
  5003. {
  5004. charaPer = new CharacterMgr.CharaPer();
  5005. }
  5006. tagArrayData.GetVector3(ref charaPer.vecHaremDouPerGreater, ref charaPer.vecHaremDouPerLess);
  5007. }
  5008. BaseKagManager.PerthOffsetPosTagData.TagArrayData.Rlease();
  5009. tagArrayData = BaseKagManager.PerthOffsetPosTagData.TagArrayData.Create(tjs, tag_data, "HaremShinCho" + add_tag_string);
  5010. if (tagArrayData.valid)
  5011. {
  5012. if (charaPer == null)
  5013. {
  5014. charaPer = new CharacterMgr.CharaPer();
  5015. }
  5016. tagArrayData.GetVector3(ref charaPer.vecHaremShinChoGreater, ref charaPer.vecHaremShinChoLess);
  5017. }
  5018. BaseKagManager.PerthOffsetPosTagData.TagArrayData.Rlease();
  5019. tagArrayData = BaseKagManager.PerthOffsetPosTagData.TagArrayData.Create(tjs, tag_data, "HaremMuneL" + add_tag_string);
  5020. if (tagArrayData.valid)
  5021. {
  5022. if (charaPer == null)
  5023. {
  5024. charaPer = new CharacterMgr.CharaPer();
  5025. }
  5026. tagArrayData.GetVector3(ref charaPer.vecHaremMuneLGreater, ref charaPer.vecHaremMuneLLess);
  5027. }
  5028. BaseKagManager.PerthOffsetPosTagData.TagArrayData.Rlease();
  5029. return charaPer;
  5030. }
  5031. private static CharacterMgr.PenisPer GetPenisPer(TJSScript tjs, KagTagSupport tag_data)
  5032. {
  5033. CharacterMgr.PenisPer penisPer = null;
  5034. BaseKagManager.PerthOffsetPosTagData.TagArrayData tagArrayData = BaseKagManager.PerthOffsetPosTagData.TagArrayData.Create(tjs, tag_data, "PenisCommonBase");
  5035. if (tagArrayData.valid)
  5036. {
  5037. if (penisPer == null)
  5038. {
  5039. penisPer = new CharacterMgr.PenisPer();
  5040. }
  5041. tagArrayData.GetVector3(ref penisPer.vecPenisCommonBase);
  5042. }
  5043. BaseKagManager.PerthOffsetPosTagData.TagArrayData.Rlease();
  5044. tagArrayData = BaseKagManager.PerthOffsetPosTagData.TagArrayData.Create(tjs, tag_data, "PenisAmend");
  5045. if (tagArrayData.valid)
  5046. {
  5047. if (penisPer == null)
  5048. {
  5049. penisPer = new CharacterMgr.PenisPer();
  5050. }
  5051. tagArrayData.GetVector3(ref penisPer.vecPenisAmend);
  5052. }
  5053. BaseKagManager.PerthOffsetPosTagData.TagArrayData.Rlease();
  5054. tagArrayData = BaseKagManager.PerthOffsetPosTagData.TagArrayData.Create(tjs, tag_data, "PenisDouPer");
  5055. if (tagArrayData.valid)
  5056. {
  5057. if (penisPer == null)
  5058. {
  5059. penisPer = new CharacterMgr.PenisPer();
  5060. }
  5061. tagArrayData.GetVector3(ref penisPer.vecPenisDouPerGreater, ref penisPer.vecPenisDouPerLess);
  5062. }
  5063. BaseKagManager.PerthOffsetPosTagData.TagArrayData.Rlease();
  5064. tagArrayData = BaseKagManager.PerthOffsetPosTagData.TagArrayData.Create(tjs, tag_data, "PenisShincho");
  5065. if (tagArrayData.valid)
  5066. {
  5067. if (penisPer == null)
  5068. {
  5069. penisPer = new CharacterMgr.PenisPer();
  5070. }
  5071. tagArrayData.GetVector3(ref penisPer.vecPenisShinchoGreater, ref penisPer.vecPenisShinchoLess);
  5072. }
  5073. BaseKagManager.PerthOffsetPosTagData.TagArrayData.Rlease();
  5074. return penisPer;
  5075. }
  5076. private class TagArrayData
  5077. {
  5078. private TagArrayData(TJSScript tjs, KagTagSupport tag_data, string tag_name)
  5079. {
  5080. this.tjs_ = tjs;
  5081. this.is_valid_ = tag_data.IsValid(tag_name);
  5082. if (this.is_valid_)
  5083. {
  5084. string eval_str = this.kTjsGlobalVarName + "=" + tag_data.GetTagProperty(tag_name).AsString();
  5085. this.tjs_.EvalScript(eval_str);
  5086. TJSVariant tjsvariant = new TJSVariant();
  5087. this.tjs_.EvalScript(this.kTjsGlobalVarName + ".count", tjsvariant);
  5088. this.array_count_ = tjsvariant.AsInteger();
  5089. tjsvariant.Dispose();
  5090. NDebug.Assert(this.array_count_ == 3 || this.array_count_ == 6, tag_name + "の指定数が不正です(6 or 7 only)");
  5091. }
  5092. }
  5093. public static BaseKagManager.PerthOffsetPosTagData.TagArrayData Create(TJSScript tjs, KagTagSupport tag_data, string tag_name)
  5094. {
  5095. NDebug.Assert(BaseKagManager.PerthOffsetPosTagData.TagArrayData.instans_data_ == null, "TagArrayDataインスタンスの重複");
  5096. tag_name = tag_name.ToLower();
  5097. BaseKagManager.PerthOffsetPosTagData.TagArrayData.instans_data_ = new BaseKagManager.PerthOffsetPosTagData.TagArrayData(tjs, tag_data, tag_name);
  5098. return BaseKagManager.PerthOffsetPosTagData.TagArrayData.instans_data_;
  5099. }
  5100. public static void Rlease()
  5101. {
  5102. if (BaseKagManager.PerthOffsetPosTagData.TagArrayData.instans_data_ == null)
  5103. {
  5104. return;
  5105. }
  5106. BaseKagManager.PerthOffsetPosTagData.TagArrayData.instans_data_.tjs_.EvalScript(BaseKagManager.PerthOffsetPosTagData.TagArrayData.instans_data_.kTjsGlobalVarName + " = void");
  5107. BaseKagManager.PerthOffsetPosTagData.TagArrayData.instans_data_ = null;
  5108. }
  5109. public void GetVector3(ref Vector3 dest)
  5110. {
  5111. if (!this.is_valid_)
  5112. {
  5113. return;
  5114. }
  5115. NDebug.Assert(this.array_count_ == 3, "Vector3*2の要素に対してVector3を1つのみ作成しようとしています");
  5116. using (TJSVariant tjsvariant = new TJSVariant())
  5117. {
  5118. this.tjs_.EvalScript(this.kTjsGlobalVarName + "[0]", tjsvariant);
  5119. dest.x = tjsvariant.AsReal();
  5120. this.tjs_.EvalScript(this.kTjsGlobalVarName + "[1]", tjsvariant);
  5121. dest.y = tjsvariant.AsReal();
  5122. this.tjs_.EvalScript(this.kTjsGlobalVarName + "[2]", tjsvariant);
  5123. dest.z = tjsvariant.AsReal();
  5124. }
  5125. }
  5126. public void GetVector3(ref Vector3 first_dest, ref Vector3 second_dest)
  5127. {
  5128. if (!this.is_valid_)
  5129. {
  5130. return;
  5131. }
  5132. NDebug.Assert(this.array_count_ == 6, "要素xyzのみに対してVector3を2つ作成しようとしています");
  5133. using (TJSVariant tjsvariant = new TJSVariant())
  5134. {
  5135. this.tjs_.EvalScript(this.kTjsGlobalVarName + "[0]", tjsvariant);
  5136. first_dest.x = tjsvariant.AsReal();
  5137. this.tjs_.EvalScript(this.kTjsGlobalVarName + "[1]", tjsvariant);
  5138. first_dest.y = tjsvariant.AsReal();
  5139. this.tjs_.EvalScript(this.kTjsGlobalVarName + "[2]", tjsvariant);
  5140. first_dest.z = tjsvariant.AsReal();
  5141. this.tjs_.EvalScript(this.kTjsGlobalVarName + "[3]", tjsvariant);
  5142. second_dest.x = tjsvariant.AsReal();
  5143. this.tjs_.EvalScript(this.kTjsGlobalVarName + "[4]", tjsvariant);
  5144. second_dest.y = tjsvariant.AsReal();
  5145. this.tjs_.EvalScript(this.kTjsGlobalVarName + "[5]", tjsvariant);
  5146. second_dest.z = tjsvariant.AsReal();
  5147. }
  5148. }
  5149. public int vecotr_element_count
  5150. {
  5151. get
  5152. {
  5153. return (this.array_count_ != 3) ? 2 : 1;
  5154. }
  5155. }
  5156. public int count
  5157. {
  5158. get
  5159. {
  5160. return this.array_count_;
  5161. }
  5162. }
  5163. public bool valid
  5164. {
  5165. get
  5166. {
  5167. return this.is_valid_;
  5168. }
  5169. }
  5170. private string kTjsGlobalVarName = "global.__tmp_array";
  5171. private static BaseKagManager.PerthOffsetPosTagData.TagArrayData instans_data_;
  5172. private TJSScript tjs_;
  5173. private bool is_valid_;
  5174. private int array_count_;
  5175. }
  5176. }
  5177. protected class ExecWaitData
  5178. {
  5179. public virtual bool Check()
  5180. {
  5181. return !this.use || this.wait_time <= GameMain.tick_count - this.start_tick_count;
  5182. }
  5183. public virtual void Clear()
  5184. {
  5185. this.start_tick_count = (this.wait_time = 0);
  5186. this.use = false;
  5187. this.skip_possible = true;
  5188. }
  5189. public int start_tick_count;
  5190. public int wait_time;
  5191. public bool skip_possible;
  5192. public bool use;
  5193. }
  5194. protected class MaidPropSeqWaitData : BaseKagManager.ExecWaitData
  5195. {
  5196. public override bool Check()
  5197. {
  5198. return !this.use || this.maid == null || !this.maid.IsBusy;
  5199. }
  5200. public override void Clear()
  5201. {
  5202. base.Clear();
  5203. this.maid = null;
  5204. }
  5205. public Maid maid;
  5206. }
  5207. protected class MaidVoiceWaitData : BaseKagManager.ExecWaitData
  5208. {
  5209. public override bool Check()
  5210. {
  5211. if (!this.use || this.maid == null)
  5212. {
  5213. return true;
  5214. }
  5215. AudioSourceMgr audioMan = this.maid.AudioMan;
  5216. return audioMan == null || !audioMan.isPlay();
  5217. }
  5218. public override void Clear()
  5219. {
  5220. base.Clear();
  5221. this.maid = null;
  5222. }
  5223. public Maid maid;
  5224. }
  5225. protected class DummyVoiceWaitData : BaseKagManager.ExecWaitData
  5226. {
  5227. public override bool Check()
  5228. {
  5229. return !this.use || !GameMain.Instance.SoundMgr.IsPlayDummyVoice();
  5230. }
  5231. public override void Clear()
  5232. {
  5233. base.Clear();
  5234. }
  5235. }
  5236. protected class SubtitleData
  5237. {
  5238. public SubtitleData()
  5239. {
  5240. this.Clear();
  5241. }
  5242. public void Clear()
  5243. {
  5244. this.text = string.Empty;
  5245. this.displayTime = -1;
  5246. this.addDisplayTime = 0;
  5247. this.casinoType = false;
  5248. }
  5249. public string text;
  5250. public int displayTime;
  5251. public int addDisplayTime;
  5252. public bool casinoType;
  5253. }
  5254. }