BaseKagManager.cs 144 KB

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