BaseKagManager.cs 159 KB

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