ScriptManager.cs 117 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Runtime.CompilerServices;
  5. using System.Text;
  6. using Kasizuki;
  7. using MaidStatus;
  8. using MaidStatus.CsvData;
  9. using MaidStatus.Old;
  10. using PlayerStatus;
  11. using PrivateMaidMode;
  12. using Schedule;
  13. using scoutmode;
  14. using UnityEngine;
  15. using wf;
  16. public class ScriptManager : IDisposable
  17. {
  18. public static bool isGP001Mode
  19. {
  20. get
  21. {
  22. return GameMain.Instance.CMSystem.GetTmpGenericFlag("AddAllOffset_Ignore") != 0;
  23. }
  24. }
  25. public static string ReplaceCharaName(string text)
  26. {
  27. if (string.IsNullOrEmpty(text))
  28. {
  29. return text;
  30. }
  31. string[] array = new string[]
  32. {
  33. "[HF]",
  34. "[HF1]",
  35. "[HF2]",
  36. "[HF3]",
  37. "[HF4]"
  38. };
  39. string[] array2 = new string[]
  40. {
  41. "[HL]",
  42. "[HL1]",
  43. "[HL2]",
  44. "[HL3]",
  45. "[HL4]"
  46. };
  47. string[] array3 = new string[]
  48. {
  49. "[HLF]",
  50. "[HLF1]",
  51. "[HLF2]",
  52. "[HLF3]",
  53. "[HLF4]"
  54. };
  55. for (int i = 0; i < array.Length; i++)
  56. {
  57. for (int j = 0; j < 2; j++)
  58. {
  59. string text2 = (j != 0) ? "[HF]" : "[hf]";
  60. string text3 = (j != 0) ? array[i].ToUpper() : array[i].ToLower();
  61. if (0 <= text.IndexOf(text3))
  62. {
  63. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(i);
  64. if (maid != null)
  65. {
  66. if (text3 != text2)
  67. {
  68. text = text.Replace(text3, text2);
  69. }
  70. text = text.Replace(text2, maid.status.callName);
  71. }
  72. }
  73. text2 = ((j != 0) ? "[HL]" : "[hl]");
  74. text3 = ((j != 0) ? array2[i].ToUpper() : array2[i].ToLower());
  75. if (0 <= text.IndexOf(text3))
  76. {
  77. Maid maid2 = GameMain.Instance.CharacterMgr.GetMaid(i);
  78. if (maid2 != null)
  79. {
  80. if (text3 != text2)
  81. {
  82. text = text.Replace(text3, text2);
  83. }
  84. text = text.Replace(text2, maid2.status.lastName);
  85. }
  86. }
  87. text2 = ((j != 0) ? "[HLF]" : "[hlf]");
  88. text3 = ((j != 0) ? array3[i].ToUpper() : array3[i].ToLower());
  89. if (0 <= text.IndexOf(text3))
  90. {
  91. Maid maid3 = GameMain.Instance.CharacterMgr.GetMaid(i);
  92. if (maid3 != null)
  93. {
  94. if (text3 != text2)
  95. {
  96. text = text.Replace(text3, text2);
  97. }
  98. text = text.Replace(text2, maid3.status.charaName.GetFullName(" "));
  99. }
  100. }
  101. }
  102. }
  103. if (0 <= text.IndexOf("[SF]"))
  104. {
  105. text = text.Replace("[SF]", GameMain.Instance.CharacterMgr.status.playerName);
  106. }
  107. if (0 <= text.IndexOf("[sf]"))
  108. {
  109. text = text.Replace("[sf]", GameMain.Instance.CharacterMgr.status.playerName);
  110. }
  111. return text;
  112. }
  113. public static string ReplaceCharaName(Maid maid, string text)
  114. {
  115. if (text == null)
  116. {
  117. return string.Empty;
  118. }
  119. if (maid == null)
  120. {
  121. maid = GameMain.Instance.CharacterMgr.GetMaid(0);
  122. }
  123. if (maid == null)
  124. {
  125. return text;
  126. }
  127. if (0 <= text.IndexOf("[HF]"))
  128. {
  129. if (maid.status.isFirstNameCall)
  130. {
  131. text = text.Replace("[HF]", maid.status.firstName);
  132. }
  133. else
  134. {
  135. text = text.Replace("[HF]", maid.status.lastName);
  136. }
  137. }
  138. if (0 <= text.IndexOf("[HL]"))
  139. {
  140. text = text.Replace("[HL]", maid.status.lastName);
  141. }
  142. if (0 <= text.IndexOf("[SF]"))
  143. {
  144. text = text.Replace("[SF]", GameMain.Instance.CharacterMgr.status.playerName);
  145. }
  146. return text;
  147. }
  148. public static string ReplacePersonal(Maid maid, string text)
  149. {
  150. return ScriptManager.ReplacePersonal(new Maid[]
  151. {
  152. maid
  153. }, text);
  154. }
  155. public static string ReplacePersonal(Maid[] maid_array, string text)
  156. {
  157. if (string.IsNullOrEmpty(text))
  158. {
  159. return string.Empty;
  160. }
  161. Maid maid = null;
  162. string oldValue = string.Empty;
  163. if (0 <= text.IndexOf("?4"))
  164. {
  165. maid = maid_array[4];
  166. oldValue = "?4";
  167. }
  168. else if (0 <= text.IndexOf("?3"))
  169. {
  170. maid = maid_array[3];
  171. oldValue = "?3";
  172. }
  173. else if (0 <= text.IndexOf("?2"))
  174. {
  175. maid = maid_array[2];
  176. oldValue = "?2";
  177. }
  178. else if (0 <= text.IndexOf("?1"))
  179. {
  180. maid = maid_array[1];
  181. oldValue = "?1";
  182. }
  183. else if (0 <= text.IndexOf("?0"))
  184. {
  185. maid = maid_array[0];
  186. oldValue = "?0";
  187. }
  188. else if (0 <= text.IndexOf("?"))
  189. {
  190. maid = maid_array[0];
  191. oldValue = "?";
  192. }
  193. if (maid == null)
  194. {
  195. return text;
  196. }
  197. if (maid.status.subCharaData == null)
  198. {
  199. text = text.Replace(oldValue, maid.status.personal.replaceText);
  200. }
  201. else
  202. {
  203. text = text.Replace(oldValue, maid.status.subCharaData.replaceText);
  204. }
  205. return text;
  206. }
  207. public void Initialize()
  208. {
  209. this.is_motion_blend = true;
  210. GameObject gameObject = GameObject.Find("SystemUI Root/Manager_SystemUI/MessageWindowMgr");
  211. NDebug.Assert(gameObject != null, "MessageWindowMgrが見つかりません");
  212. this.message_mgr_ = gameObject.GetComponent<MessageWindowMgr>();
  213. NDebug.Assert(this.message_mgr_ != null, "コンポーネント:MessageWindowMgrが見つかりません");
  214. this.tjs_ = TJSScript.Create(this.file_system);
  215. this.tjs_.AddFunction("GetMaidMPN", new TJSScript.FunctionCallBack(this.TJSFuncGetMaidMPN));
  216. this.tjs_.AddFunction("GetMenuFileNameFromMaidMPN", new TJSScript.FunctionCallBack(this.TJSFuncGetMenuFileNameFromMaidMPN));
  217. this.tjs_.AddFunction("IsMenuFileDelFromMaidMPN", new TJSScript.FunctionCallBack(this.TJSFuncIsMenuFileDelFromMaidMPN));
  218. this.tjs_.AddFunction("HasItemNameFromMaidMPN", new TJSScript.FunctionCallBack(this.TJSFuncHasItemNameFromMaidMPN));
  219. this.tjs_.AddFunction("IsEquipTatoo", new TJSScript.FunctionCallBack(this.TJSFuncIsEquipTatoo));
  220. this.tjs_.AddFunction("SetMaidFlag", new TJSScript.FunctionCallBack(this.TJSFuncSetMaidFlag));
  221. this.tjs_.AddFunction("SetManFlag", new TJSScript.FunctionCallBack(this.TJSFuncSetManFlag));
  222. this.tjs_.AddFunction("SetTmpFlag", new TJSScript.FunctionCallBack(this.TJSFuncSetTmpFlag));
  223. this.tjs_.AddFunction("GetMaidFlag", new TJSScript.FunctionCallBack(this.TJSFuncGetMaidFlag));
  224. this.tjs_.AddFunction("GetManFlag", new TJSScript.FunctionCallBack(this.TJSFuncGetManFlag));
  225. this.tjs_.AddFunction("GetTmpFlag", new TJSScript.FunctionCallBack(this.TJSFuncGetTmpFlag));
  226. this.tjs_.AddFunction("SetSystemFlag", new TJSScript.FunctionCallBack(this.TJSFuncSetSystemFlag));
  227. this.tjs_.AddFunction("GetSystemFlag", new TJSScript.FunctionCallBack(this.TJSFuncGetSystemFlag));
  228. this.tjs_.AddFunction("GetMaidStatus", new TJSScript.FunctionCallBack(this.TJSFuncGetMaidStatus));
  229. this.tjs_.AddFunction("SetMainCharaFlag", new TJSScript.FunctionCallBack(this.TJSFuncSetMainCharaFlag));
  230. this.tjs_.AddFunction("IsSeikantai", new TJSScript.FunctionCallBack(this.OldTJSFuncConIsSeikantai));
  231. this.tjs_.AddFunction("CreateNewMaid", new TJSScript.FunctionCallBack(this.TJSFuncCreateNewMaid));
  232. this.tjs_.AddFunction("PresetLoad", new TJSScript.FunctionCallBack(this.TJSFuncPresetLoad));
  233. this.tjs_.AddFunction("PresetLoadNPC", new TJSScript.FunctionCallBack(this.TJSFuncPresetLoadNPC));
  234. this.tjs_.AddFunction("AddMaidStatus", new TJSScript.FunctionCallBack(this.TJSFuncAddMaidStatus));
  235. this.tjs_.AddFunction("IsMaidFeature", new TJSScript.FunctionCallBack(this.TJSFuncIsMaidFeature));
  236. this.tjs_.AddFunction("IsMaidPropensity", new TJSScript.FunctionCallBack(this.TJSFuncIsMaidPropensity));
  237. this.tjs_.AddFunction("GetYotogiSkillLevel", new TJSScript.FunctionCallBack(this.TJSFuncGetYotogiSkillLevel));
  238. this.tjs_.AddFunction("IsYotogiSkill", new TJSScript.FunctionCallBack(this.TJSFuncIsYotogiSkill));
  239. this.tjs_.AddFunction("GetStockMaidCount", new TJSScript.FunctionCallBack(this.TJSFuncGetStockMaidCount));
  240. this.tjs_.AddFunction("SetSalonGrade", new TJSScript.FunctionCallBack(this.TJSFuncSetSalonGrade));
  241. this.tjs_.AddFunction("GetSalonGrade", new TJSScript.FunctionCallBack(this.TJSFuncGetSalonGrade));
  242. this.tjs_.AddFunction("GetClubEvaluation", new TJSScript.FunctionCallBack(this.TJSFuncGetClubEvaluation));
  243. this.tjs_.AddFunction("SetClubGauge", new TJSScript.FunctionCallBack(this.TJSFuncSetClubGauge));
  244. this.tjs_.AddFunction("GetClubGauge", new TJSScript.FunctionCallBack(this.TJSFuncGetClubGauge));
  245. this.tjs_.AddFunction("GetBGName", new TJSScript.FunctionCallBack(this.TJSFuncGetBGName));
  246. this.tjs_.AddFunction("IsItemParam", new TJSScript.FunctionCallBack(this.TJSFuncIsItemParam));
  247. this.tjs_.AddFunction("IsItemSlot", new TJSScript.FunctionCallBack(this.TJSFuncIsItemSlot));
  248. this.tjs_.AddFunction("IsMaidClass", new TJSScript.FunctionCallBack(this.OldTJSFuncIsMaidClass));
  249. this.tjs_.AddFunction("GetMaidClassLevel", new TJSScript.FunctionCallBack(this.OldTJSFuncGetMaidClassLevel));
  250. this.tjs_.AddFunction("IsJobMaid", new TJSScript.FunctionCallBack(this.TJSFuncIsJobMaid));
  251. this.tjs_.AddFunction("GetJobMaidLevel", new TJSScript.FunctionCallBack(this.TJSFuncGetJobMaidLevel));
  252. this.tjs_.AddFunction("IsYotogiClass", new TJSScript.FunctionCallBack(this.TJSFuncIsYotogiClass));
  253. this.tjs_.AddFunction("GetYotogiClassLevel", new TJSScript.FunctionCallBack(this.TJSFuncGetYotogiClassLevel));
  254. this.tjs_.AddFunction("GetNoonScuccessLevel", new TJSScript.FunctionCallBack(this.TJSFuncGetNoonScuccessLevel));
  255. this.tjs_.AddFunction("IsMaid", new TJSScript.FunctionCallBack(this.TJSFuncIsMaid));
  256. this.tjs_.AddFunction("IsOldPersonal", new TJSScript.FunctionCallBack(this.TJSFuncIsOldPersonal));
  257. this.tjs_.AddFunction("GetSalonLoan", new TJSScript.FunctionCallBack(this.TJSFuncConGetSalonLoan));
  258. this.tjs_.AddFunction("GetPhase", new TJSScript.FunctionCallBack(this.TJSFuncConGetPhase));
  259. this.tjs_.AddFunction("GetDay", new TJSScript.FunctionCallBack(this.TJSFuncGetDay));
  260. this.tjs_.AddFunction("CreateStockMaidLoopData", new TJSScript.FunctionCallBack(this.TJSFuncCreateStockMaidLoopData));
  261. this.tjs_.AddFunction("CreateCompetitiveShowLoopData", new TJSScript.FunctionCallBack(this.TJSFuncCreateCompetitiveShowLoopData));
  262. this.tjs_.AddFunction("GetCompetitiveShowLoopCount", new TJSScript.FunctionCallBack(this.TJSFuncGetCompetitiveShowLoopCount));
  263. this.tjs_.AddFunction("SetActiveSlotFromStockMaidLoopData", new TJSScript.FunctionCallBack(this.TJSFuncSetActiveSlotFromStockMaidLoopData));
  264. this.tjs_.AddFunction("SetMaidCondition", new TJSScript.FunctionCallBack(this.TJSFuncSetMaidCondition));
  265. this.tjs_.AddFunction("SetSeikeikenFront", new TJSScript.FunctionCallBack(this.TJSFuncSetSeikeikenFront));
  266. this.tjs_.AddFunction("SetSeikeikenBack", new TJSScript.FunctionCallBack(this.TJSFuncSetSeikeikenBack));
  267. this.tjs_.AddFunction("SetInitSeikeiken", new TJSScript.FunctionCallBack(this.TJSFuncSetInitSeikeiken));
  268. this.tjs_.AddFunction("SetNewItem", new TJSScript.FunctionCallBack(this.TJSFuncSetNewItem));
  269. this.tjs_.AddFunction("IsGameInShopItemPurchased", new TJSScript.FunctionCallBack(this.TJSFuncIsGameInShopItemPurchased));
  270. this.tjs_.AddFunction("SetContractType", new TJSScript.FunctionCallBack(this.TJSFuncSetContractType));
  271. this.tjs_.AddFunction("SetFeature", new TJSScript.FunctionCallBack(this.TJSFuncSetFeature));
  272. this.tjs_.AddFunction("SetPropensity", new TJSScript.FunctionCallBack(this.TJSFuncSetPropensity));
  273. this.tjs_.AddFunction("SetSexualParam", new TJSScript.FunctionCallBack(this.TJSFuncComSetSexualParam));
  274. this.tjs_.AddFunction("SetNewTrophy", new TJSScript.FunctionCallBack(this.TJSFuncSetNewTrophy));
  275. this.tjs_.AddFunction("CheckTrophyContractType", new TJSScript.FunctionCallBack(this.TJSFuncCheckTrophyContractType));
  276. this.tjs_.AddFunction("SetYotogiSelectStageName", new TJSScript.FunctionCallBack(this.TJSFuncSetYotogiSelectStageName));
  277. this.tjs_.AddFunction("GetYotogiSelectStageName", new TJSScript.FunctionCallBack(this.TJSFuncGetYotogiSelectStageName));
  278. this.tjs_.AddFunction("ClearCallStack", new TJSScript.FunctionCallBack(this.TJSFuncClearCallStack));
  279. this.tjs_.AddFunction("IsCommunicationChara", new TJSScript.FunctionCallBack(this.OldTJSFuncIsCommunicationChara));
  280. this.tjs_.AddFunction("SetCommunicationChara", new TJSScript.FunctionCallBack(this.TJSFuncSetCommunicationChara));
  281. this.tjs_.AddFunction("SetRandomCommuChara", new TJSScript.FunctionCallBack(this.TJSFuncSetRandomCommuChara));
  282. this.tjs_.AddFunction("CreateYotogiCharaList", new TJSScript.FunctionCallBack(this.TJSFuncCreateYotogiCharaList));
  283. this.tjs_.AddFunction("CreateNewYotogiCharaList", new TJSScript.FunctionCallBack(this.TJSFuncCreateNewYotogiCharaList));
  284. this.tjs_.AddFunction("CreateNewYotogiHaremPairCharaList", new TJSScript.FunctionCallBack(this.TJSFuncCreateNewYotogiHaremPairCharaList));
  285. this.tjs_.AddFunction("CreateVipCharaList", new TJSScript.FunctionCallBack(this.TJSFuncCreateVipCharaList));
  286. this.tjs_.AddFunction("CreateFacilityCharaList", new TJSScript.FunctionCallBack(this.TJSFuncCreateFacilityCharaList));
  287. this.tjs_.AddFunction("CreateLifeModeCharaList", new TJSScript.FunctionCallBack(this.TJSFuncCreateLifeModeCharaList));
  288. this.tjs_.AddFunction("BackupStoreCharaList", new TJSScript.FunctionCallBack(this.TJSFuncBackupStoreCharaList));
  289. this.tjs_.AddFunction("BackupReStoreCharaList", new TJSScript.FunctionCallBack(this.TJSFuncBackupReStoreCharaList));
  290. this.tjs_.AddFunction("IsReceptionChara", new TJSScript.FunctionCallBack(this.TJSFuncIsReceptionChara));
  291. this.tjs_.AddFunction("SetRandomReceptionChara", new TJSScript.FunctionCallBack(this.TJSFuncSetRandomReceptionChara));
  292. this.tjs_.AddFunction("IsSelectChara", new TJSScript.FunctionCallBack(this.TJSFuncIsSelectChara));
  293. this.tjs_.AddFunction("GetDateYear", new TJSScript.FunctionCallBack(this.TJSFuncGetDateYear));
  294. this.tjs_.AddFunction("GetDateMonth", new TJSScript.FunctionCallBack(this.TJSFuncGetDateMonth));
  295. this.tjs_.AddFunction("GetDateDay", new TJSScript.FunctionCallBack(this.TJSFuncGetDateDay));
  296. this.tjs_.AddFunction("UpdateMaidRanking", new TJSScript.FunctionCallBack(this.TJSFuncUpdateMaidRanking));
  297. this.tjs_.AddFunction("ResetMaidRanking", new TJSScript.FunctionCallBack(this.TJSFuncResetMaidRanking));
  298. this.tjs_.AddFunction("SetMaidRanking1st", new TJSScript.FunctionCallBack(this.TJSFuncSetMaidRanking1st));
  299. this.tjs_.AddFunction("IsAvailableRanking", new TJSScript.FunctionCallBack(this.TJSFuncIsAvailableRanking));
  300. this.tjs_.AddFunction("IsMVPEvent", new TJSScript.FunctionCallBack(this.TJSFuncIsMVPEvent));
  301. this.tjs_.AddFunction("IsYotogiSubCharaSelect", new TJSScript.FunctionCallBack(this.TJSFuncIsYotogiSubCharaSelect));
  302. this.tjs_.AddFunction("GetYotogiSkillSpecialType", new TJSScript.FunctionCallBack(this.TJSFuncGetYotogiSkillSpecialType));
  303. this.tjs_.AddFunction("IsSelectedYotogiSkill", new TJSScript.FunctionCallBack(this.TJSFuncIsSelectedYotogiSkill));
  304. this.tjs_.AddFunction("LearningYotogiSkill", new TJSScript.FunctionCallBack(this.TJSFuncLearningYotogiSkill));
  305. this.tjs_.AddFunction("IsExistentFile", new TJSScript.FunctionCallBack(this.TJSFuncIsExistentFile));
  306. this.tjs_.AddFunction("IsExistentFileLegacy", new TJSScript.FunctionCallBack(this.TJSFuncIsExistentFileLegacy));
  307. this.tjs_.AddFunction("CheckClearVIP", new TJSScript.FunctionCallBack(this.TJSFuncCheckClearVIP));
  308. this.tjs_.AddFunction("IsCBLVersion", new TJSScript.FunctionCallBack(this.TJSFuncIsCBLVersion));
  309. this.tjs_.AddFunction("GetRentalNPCName", new TJSScript.FunctionCallBack(this.OldTJSFuncGetRentalNPCName));
  310. this.tjs_.AddFunction("IsMarriage", new TJSScript.FunctionCallBack(this.OldTJSFuncIsMarriage));
  311. this.tjs_.AddFunction("IsNewWifeFlag", new TJSScript.FunctionCallBack(this.OldTJSFuncIsNewWifeFlag));
  312. this.tjs_.AddFunction("IsPluginPack", new TJSScript.FunctionCallBack(this.TJSFuncIsPluginPack));
  313. this.tjs_.AddFunction("AddShopLineup", new TJSScript.FunctionCallBack(this.TJSFuncAddShopLineup));
  314. this.tjs_.AddFunction("SetEventItemFlag", new TJSScript.FunctionCallBack(this.TJSFuncSetEventItemFlag));
  315. this.tjs_.AddFunction("IsEventItemFlag", new TJSScript.FunctionCallBack(this.TJSFuncIsEventItemFlag));
  316. this.tjs_.AddFunction("GetVRMode", new TJSScript.FunctionCallBack(this.TJSFuncGetVRMode));
  317. this.tjs_.AddFunction("IsVRMode", new TJSScript.FunctionCallBack(this.TJSFuncIsVRMode));
  318. this.tjs_.AddFunction("SetDanceData", new TJSScript.FunctionCallBack(this.TJSFuncSetDanceData));
  319. this.tjs_.AddFunction("GetEventAdded", new TJSScript.FunctionCallBack(this.TJSFuncGetEventAdded));
  320. this.tjs_.AddFunction("GetLockNTRPlayFlag", new TJSScript.FunctionCallBack(this.TJSFuncGetLockNTRPlayFlag));
  321. this.tjs_.AddFunction("GetLockUserDraftMaid", new TJSScript.FunctionCallBack(this.TJSFuncGetLockUserDraftMaid));
  322. this.tjs_.AddFunction("IsComPlayer", new TJSScript.FunctionCallBack(this.TJSFuncIsComPlayer));
  323. this.tjs_.AddFunction("SetPlayerMoney", new TJSScript.FunctionCallBack(this.TJSFuncSetPlayerMoney));
  324. this.tjs_.AddFunction("GetPlayerMoney", new TJSScript.FunctionCallBack(this.TJSFuncGetPlayerMoney));
  325. this.tjs_.AddFunction("SetMaidLeader", new TJSScript.FunctionCallBack(this.TJSFuncSetMaidLeader));
  326. this.tjs_.AddFunction("SetMaidCostumeFacility", new TJSScript.FunctionCallBack(this.TJSFuncSetMaidCostumeFacility));
  327. this.tjs_.AddFunction("ResetMaidCostumeFacility", new TJSScript.FunctionCallBack(this.TJSFuncResetMaidCostumeFacility));
  328. this.tjs_.AddFunction("CallTitleBar", new TJSScript.FunctionCallBack(this.TJSFuncCallTitleBar));
  329. this.tjs_.AddFunction("SetCompatibilityMode", new TJSScript.FunctionCallBack(this.TJSFuncSetCompatibilityMode));
  330. this.tjs.AddFunction("IsBuildingFacility", new TJSScript.FunctionCallBack(this.TJSFuncIsBuildingFacility));
  331. this.tjs.AddFunction("IsBuildingFacilityUpward", new TJSScript.FunctionCallBack(this.TJSFuncIsBuildingFacilityUpward));
  332. this.tjs.AddFunction("CheckDanceType", new TJSScript.FunctionCallBack(this.TJSCheckDanceType));
  333. this.tjs.AddFunction("SetMusicRelease", new TJSScript.FunctionCallBack(this.TJSSetMusicRelease));
  334. this.tjs.AddFunction("GetChallengeRank", new TJSScript.FunctionCallBack(this.TJSGetChallengeRank));
  335. this.tjs.AddFunction("SetVsSetting", new TJSScript.FunctionCallBack(this.TJSSetVsSetting));
  336. this.tjs.AddFunction("NeedDanceResult", new TJSScript.FunctionCallBack(this.TJSNeedDanceResult));
  337. this.tjs.AddFunction("BjDayFirst", new TJSScript.FunctionCallBack(this.TJSBjDayFirst));
  338. this.tjs.AddFunction("CasinoShopBuy", new TJSScript.FunctionCallBack(this.TJSCasinoShopBuy));
  339. this.tjs.AddFunction("SetEventEndFlag", new TJSScript.FunctionCallBack(this.TJSSetEventEndFlag));
  340. this.tjs_.AddFunction("IsKasizukiGuest", new TJSScript.FunctionCallBack(this.TJSFuncIsKasizukiGuest));
  341. this.tjs_.AddFunction("GetKasizukiSelectRoomName", new TJSScript.FunctionCallBack(this.TJSFuncGetKasizukiSelectRoomName));
  342. this.tjs_.AddFunction("GetKasizukiMaidLikability", new TJSScript.FunctionCallBack(this.TJSFuncGetKasizukiMaidLikability));
  343. this.tjs_.AddFunction("GetKasizukiMaidLikabilityName", new TJSScript.FunctionCallBack(this.TJSFuncGetKasizukiMaidLikabilityName));
  344. this.tjs_.AddFunction("GetKasizukiMaidWorkCount", new TJSScript.FunctionCallBack(this.TJSFuncGetKasizukiMaidWorkCount));
  345. this.tjs_.AddFunction("GetKasizukiMaidWorkCountName", new TJSScript.FunctionCallBack(this.TJSFuncGetKasizukiMaidWorkCountName));
  346. this.tjs_.AddFunction("GetKasizukiSystemFlag", new TJSScript.FunctionCallBack(this.TJSFuncGetKasizukiSystemFlag));
  347. this.tjs_.AddFunction("SetKasizukiSystemFlag", new TJSScript.FunctionCallBack(this.TJSFuncSetKasizukiSystemFlag));
  348. this.tjs_.AddFunction("AddKasizukiSystemFlag", new TJSScript.FunctionCallBack(this.TJSFuncAddKasizukiSystemFlag));
  349. this.tjs_.AddFunction("SetKasizukiPassFlag", new TJSScript.FunctionCallBack(this.TJSFuncSetKasizukiPassFlag));
  350. this.tjs_.AddFunction("GetKasizukiMaidFlag", new TJSScript.FunctionCallBack(this.TJSFuncGetKasizukiMaidFlag));
  351. this.tjs_.AddFunction("SetKasizukiMaidFlag", new TJSScript.FunctionCallBack(this.TJSFuncSetKasizukiMaidFlag));
  352. this.tjs_.AddFunction("IsKasizukiCorrectSenarioFlag", new TJSScript.FunctionCallBack(this.TJSFuncIsKasizukiCorrectSenarioFlag));
  353. this.tjs_.AddFunction("GetKasizukiGuestID", new TJSScript.FunctionCallBack(this.TJSFuncGetKasizukiGuestID));
  354. this.tjs_.AddFunction("IsVRKaraokeMode", new TJSScript.FunctionCallBack(this.TJSFuncIsVRKaraokeMode));
  355. this.tjs_.AddFunction("GetRemainingDanceTime", new TJSScript.FunctionCallBack(this.TJSFuncGetRemainingDanceTime));
  356. this.tjs_.AddFunction("GetYotogiCommandClickCount", new TJSScript.FunctionCallBack(this.TJSFuncGetYotogiCommandClickCount));
  357. this.tjs_.AddFunction("SetYotogiStage", new TJSScript.FunctionCallBack(this.TJSFuncSetYotogiStage));
  358. this.tjs_.AddFunction("GetGameMode", new TJSScript.FunctionCallBack(this.TJSFuncGetGameMode));
  359. this.tjs_.AddFunction("IsLifeMode", new TJSScript.FunctionCallBack(this.TJSFuncIsLifeMode));
  360. this.tjs_.AddFunction("IsPrivateModeMaid", new TJSScript.FunctionCallBack(this.TJSFuncIsPrivateModeMaid));
  361. this.tjs_.AddFunction("IsPrivateModeDayTalkEnabled", new TJSScript.FunctionCallBack(this.TJSFuncIsPrivateModeDayTalkEnabled));
  362. this.tjs_.AddFunction("IsPrivateModeNightTalkEnabled", new TJSScript.FunctionCallBack(this.TJSFuncIsPrivateModeNightTalkEnabled));
  363. this.tjs_.AddFunction("IsPrivateModeHEventEnabled", new TJSScript.FunctionCallBack(this.TJSFuncIsPrivateModeHEventEnabled));
  364. this.tjs_.AddFunction("SetPrivateModeMaid", new TJSScript.FunctionCallBack(this.TJSFuncSetPrivateModeMaid));
  365. this.tjs_.AddFunction("SetLockNTRPlay", new TJSScript.FunctionCallBack(this.TJSFuncSetLockNTRPlay));
  366. this.tjs_.AddFunction("IsEnabeldAdditionalRelation", new TJSScript.FunctionCallBack(this.TJSFuncIsEnabeldAdditionalRelation));
  367. this.tjs_.AddFunction("HireScoutMaid", new TJSScript.FunctionCallBack(this.TJSFuncHireScoutMaid));
  368. this.tjs_.AddFunction("SuspendedScout", new TJSScript.FunctionCallBack(this.TJSFuncSuspendedScout));
  369. this.tjs_.AddFunction("CancelScout", new TJSScript.FunctionCallBack(this.TJSFuncCancelScout));
  370. this.tjs_.AddFunction("IsCRCBody", new TJSScript.FunctionCallBack(this.TJSFuncIsCRCBody));
  371. MotionKagManager motionKagManager = new MotionKagManager(this.tjs_, this);
  372. motionKagManager.Initialize();
  373. motionKagManager.SetSloatNo(0);
  374. this.kag_mot_dic_.Add(0, motionKagManager);
  375. this.adv_kag_ = new ADVKagManager(this.tjs_, this, this.message_mgr_);
  376. this.adv_kag_.Initialize();
  377. this.adv_kag_.kag.SetOnReturnFunction(new KagScript.OnReturnCallBack(this.OnReturnEvent));
  378. this.adv_kag_.kag.SetOnRReturnFunction(new KagScript.OnScenarioLoadCallBack(this.OnRReturnEvent));
  379. this.yotogi_kag_ = new YotogiKagManager(this.tjs_, this);
  380. this.yotogi_kag_.Initialize();
  381. this.privatemode_touch_kag = new PrivateMaidTouchKagManager(this.tjs_, this);
  382. this.privatemode_touch_kag.Initialize();
  383. this.tmp_kag_ = new BaseKagManager(this.tjs_, this);
  384. this.tmp_kag_.Initialize();
  385. using (AFileBase afileBase = this.file_system.FileOpen("startup.tjs"))
  386. {
  387. this.tjs_.ExecScript(afileBase);
  388. }
  389. }
  390. ~ScriptManager()
  391. {
  392. this.Dispose(false);
  393. }
  394. public void ClearCallStack()
  395. {
  396. foreach (KeyValuePair<int, MotionKagManager> keyValuePair in this.kag_mot_dic_)
  397. {
  398. keyValuePair.Value.kag.ClearCallStack();
  399. }
  400. this.adv_kag_.kag.ClearCallStack();
  401. this.yotogi_kag_.kag.ClearCallStack();
  402. this.privatemode_touch_kag.kag.ClearCallStack();
  403. this.tmp_kag_.kag.ClearCallStack();
  404. }
  405. public void Update()
  406. {
  407. foreach (KeyValuePair<int, MotionKagManager> keyValuePair in this.kag_mot_dic_)
  408. {
  409. keyValuePair.Value.Update();
  410. }
  411. this.adv_kag_.Update();
  412. this.yotogi_kag_.Update();
  413. this.privatemode_touch_kag.Update();
  414. this.tmp_kag_.Update();
  415. }
  416. public void ExecScript(string exec_str, ref TJSVariant result)
  417. {
  418. this.tjs_.ExecScript(exec_str, ref result);
  419. }
  420. public void ExecScript(string exec_str)
  421. {
  422. this.tjs_.ExecScript(exec_str);
  423. }
  424. public void ExecScriptFile(string file_name, ref TJSVariant result)
  425. {
  426. using (AFileBase afileBase = this.file_system.FileOpen(file_name))
  427. {
  428. NDebug.Assert(afileBase.IsValid(), "not found file.\n" + file_name);
  429. this.tjs_.ExecScript(afileBase, ref result);
  430. }
  431. }
  432. public void ExecScriptFile(string file_name)
  433. {
  434. using (AFileBase afileBase = this.file_system.FileOpen(file_name))
  435. {
  436. NDebug.Assert(afileBase.IsValid(), "not found file.\n" + file_name);
  437. this.tjs_.ExecScript(afileBase);
  438. }
  439. }
  440. public void EvalScript(string eval_str, TJSVariant result)
  441. {
  442. this.tjs_.EvalScript(eval_str, result);
  443. }
  444. public void EvalScript(string eval_str)
  445. {
  446. this.tjs_.EvalScript(eval_str);
  447. }
  448. public void EvalScriptFile(string file_name, TJSVariant result)
  449. {
  450. using (AFileBase afileBase = this.file_system.FileOpen(file_name))
  451. {
  452. NDebug.Assert(afileBase.IsValid(), "not found file.\n" + file_name);
  453. this.tjs_.EvalScript(afileBase, result);
  454. }
  455. }
  456. public void EvalScriptFile(string file_name)
  457. {
  458. using (AFileBase afileBase = this.file_system.FileOpen(file_name))
  459. {
  460. NDebug.Assert(afileBase.IsValid(), "not found file.\n" + file_name);
  461. this.tjs_.EvalScript(afileBase);
  462. }
  463. }
  464. public void LoadAdvScenarioScript(string file_name, string label_name = "")
  465. {
  466. this.adv_kag_.enabled = true;
  467. this.adv_kag_.LoadScriptFile(file_name, label_name);
  468. }
  469. public void LoadYotogiScript(string file_name, string label_name = "")
  470. {
  471. if (Time.frameCount == this.asyncCheckPrevFrame)
  472. {
  473. Debug.LogError(string.Concat(new object[]
  474. {
  475. "LoadYotogiScript でスクリプトが中断された可能性があります。-> ",
  476. this.asyncCheckPrevFileName,
  477. " : ",
  478. this.asyncCheckPrevFileLine
  479. }));
  480. }
  481. this.yotogi_kag_.enabled = true;
  482. this.yotogi_kag_.LoadScriptFile(file_name, string.Empty);
  483. bool flag = this.yotogi_kag_.Exec();
  484. if (flag)
  485. {
  486. this.asyncCheckPrevFrame = Time.frameCount;
  487. this.asyncCheckPrevFileName = this.yotogi_kag_.kag.GetCurrentFileName();
  488. this.asyncCheckPrevFileLine = this.yotogi_kag_.kag.GetCurrentLine();
  489. }
  490. else
  491. {
  492. this.asyncCheckPrevFrame = -1;
  493. }
  494. }
  495. public void LoadTempScript(string file_name, string label_name = "")
  496. {
  497. this.tmp_kag_.enabled = true;
  498. this.tmp_kag_.LoadScriptFile(file_name, label_name);
  499. }
  500. public void LoadMotionScript(int sloat, bool is_next, string file_name, string label_name = "", string maid_guid = "", string man_guid = "", bool face_fix = false, bool valid_pos = true, bool disable_diff_pos = false, bool body_mix_ok = false)
  501. {
  502. if (!string.IsNullOrEmpty(maid_guid))
  503. {
  504. Maid x = null;
  505. for (int i = 0; i < GameMain.Instance.CharacterMgr.GetMaidCount(); i++)
  506. {
  507. Maid maid3 = GameMain.Instance.CharacterMgr.GetMaid(i);
  508. if (maid3 != null && maid3.status.guid == maid_guid)
  509. {
  510. x = maid3;
  511. break;
  512. }
  513. }
  514. if (x == null)
  515. {
  516. return;
  517. }
  518. }
  519. if (!string.IsNullOrEmpty(man_guid))
  520. {
  521. Maid x2 = null;
  522. for (int j = 0; j < GameMain.Instance.CharacterMgr.GetManCount(); j++)
  523. {
  524. Maid man = GameMain.Instance.CharacterMgr.GetMan(j);
  525. if (man != null && man.status.guid == man_guid)
  526. {
  527. x2 = man;
  528. break;
  529. }
  530. }
  531. if (x2 == null)
  532. {
  533. return;
  534. }
  535. }
  536. this.is_motion_all_prop_seq = false;
  537. this.motion_all_prop_seq_maid = null;
  538. MotionKagManager motionKagManager2;
  539. if (!this.kag_mot_dic_.ContainsKey(sloat))
  540. {
  541. MotionKagManager motionKagManager = new MotionKagManager(this.tjs_, this);
  542. motionKagManager.Initialize();
  543. motionKagManager.SetSloatNo(sloat);
  544. motionKagManager.kag.SetFileSystem(this.file_system);
  545. this.kag_mot_dic_.Add(sloat, motionKagManager);
  546. motionKagManager2 = motionKagManager;
  547. }
  548. else
  549. {
  550. motionKagManager2 = this.kag_mot_dic_[sloat];
  551. }
  552. Maid mainMaid = motionKagManager2.SetMainMaid(maid_guid);
  553. Maid maid2 = motionKagManager2.SetMainMan(man_guid);
  554. if (mainMaid == null && maid2 != null)
  555. {
  556. mainMaid = maid2;
  557. }
  558. motionKagManager2.valid_pos = valid_pos;
  559. motionKagManager2.isBodyMixOK = body_mix_ok;
  560. motionKagManager2.enabled = true;
  561. motionKagManager2.ExecForcWaitEvent();
  562. motionKagManager2.LoadScriptFile(file_name, label_name);
  563. motionKagManager2.SetNextMotion(is_next);
  564. motionKagManager2.SetFaceFix(face_fix);
  565. Vector3 b = Vector3.zero;
  566. if (mainMaid != null)
  567. {
  568. b = mainMaid.transform.position;
  569. }
  570. motionKagManager2.Exec();
  571. if (!ScriptManager.isGP001Mode && !disable_diff_pos && mainMaid != null && motionKagManager2.maidOffsetSetList.Find((Maid maid) => maid == mainMaid) != null)
  572. {
  573. Vector3 b2 = mainMaid.transform.position - b;
  574. Quaternion rotation = mainMaid.transform.rotation;
  575. for (int k = 0; k < motionKagManager2.maidOffsetSetList.Count; k++)
  576. {
  577. motionKagManager2.maidOffsetSetList[k].transform.rotation = rotation;
  578. motionKagManager2.maidOffsetSetList[k].transform.position -= b2;
  579. }
  580. }
  581. }
  582. public void StopMotionScript()
  583. {
  584. this.ClearForcExecWaitEvent();
  585. foreach (KeyValuePair<int, MotionKagManager> keyValuePair in this.kag_mot_dic_)
  586. {
  587. keyValuePair.Value.ClearMotion();
  588. keyValuePair.Value.enabled = false;
  589. }
  590. }
  591. public void ClearForcExecWaitEvent()
  592. {
  593. foreach (KeyValuePair<int, MotionKagManager> keyValuePair in this.kag_mot_dic_)
  594. {
  595. keyValuePair.Value.ClearForcExecWaitEvent();
  596. }
  597. }
  598. private void TJSFuncGetMaidMPN(TJSVariantRef[] param, TJSVariantRef result)
  599. {
  600. NDebug.Assert(2 == param.Length, "GetMaidMPN args count error.");
  601. if (result == null)
  602. {
  603. return;
  604. }
  605. TJSVariantRef.Type[] array = new TJSVariantRef.Type[]
  606. {
  607. TJSVariantRef.Type.tvtInteger,
  608. TJSVariantRef.Type.tvtString
  609. };
  610. for (int i = 0; i < param.Length; i++)
  611. {
  612. NDebug.Assert(param[i].type == array[i], "TJSFuncGetMaidProp args[" + i + "] type error.");
  613. }
  614. int nMaidNo = param[0].AsInteger();
  615. string text = param[1].AsString();
  616. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(nMaidNo);
  617. MPN mpn = (MPN)Enum.Parse(typeof(MPN), text);
  618. MaidProp prop = maid.GetProp(mpn);
  619. NDebug.Assert(prop != null, "[" + text + "] 指定MPNが不正です。");
  620. if (prop.type == 3)
  621. {
  622. result.SetString(prop.name);
  623. }
  624. else
  625. {
  626. result.SetInteger(prop.value);
  627. }
  628. }
  629. private void TJSFuncGetMenuFileNameFromMaidMPN(TJSVariantRef[] param, TJSVariantRef result)
  630. {
  631. NDebug.Assert(2 == param.Length, "GetMenuFileNameFromMaidMPN args count error.");
  632. if (result == null)
  633. {
  634. return;
  635. }
  636. TJSVariantRef.Type[] array = new TJSVariantRef.Type[]
  637. {
  638. TJSVariantRef.Type.tvtInteger,
  639. TJSVariantRef.Type.tvtString
  640. };
  641. for (int i = 0; i < param.Length; i++)
  642. {
  643. NDebug.Assert(param[i].type == array[i], "TJSFuncGetMaidProp args[" + i + "] type error.");
  644. }
  645. int nMaidNo = param[0].AsInteger();
  646. string text = param[1].AsString();
  647. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(nMaidNo);
  648. MPN mpn = (MPN)Enum.Parse(typeof(MPN), text);
  649. MaidProp prop = maid.GetProp(mpn);
  650. NDebug.Assert(prop != null, "[" + text + "] 指定MPNが不正です。");
  651. if (prop.type == 3)
  652. {
  653. result.SetString(prop.strFileName.ToLower());
  654. }
  655. else
  656. {
  657. result.SetString(string.Empty);
  658. }
  659. }
  660. private void TJSFuncIsMenuFileDelFromMaidMPN(TJSVariantRef[] param, TJSVariantRef result)
  661. {
  662. NDebug.Assert(2 == param.Length, "IsMenuFileDelFromMaidMPN args count error.");
  663. if (result == null)
  664. {
  665. return;
  666. }
  667. TJSVariantRef.Type[] array = new TJSVariantRef.Type[]
  668. {
  669. TJSVariantRef.Type.tvtInteger,
  670. TJSVariantRef.Type.tvtString
  671. };
  672. for (int i = 0; i < param.Length; i++)
  673. {
  674. NDebug.Assert(param[i].type == array[i], "TJSFuncIsMenuFileDelFromMaidMPN args[" + i + "] type error.");
  675. }
  676. int nMaidNo = param[0].AsInteger();
  677. string text = param[1].AsString();
  678. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(nMaidNo);
  679. MPN mpn = (MPN)Enum.Parse(typeof(MPN), text);
  680. MaidProp prop = maid.GetProp(mpn);
  681. NDebug.Assert(prop != null, "[" + text + "] 指定MPNが不正です。");
  682. if (prop.type == 3)
  683. {
  684. bool flag;
  685. if (!maid.IsCrcBody)
  686. {
  687. flag = prop.strFileName.ToLower().Contains("_del");
  688. }
  689. else
  690. {
  691. flag = prop.strFileName.ToLower().Contains("_del");
  692. if (!flag)
  693. {
  694. Menu.MenuHeader menuHeader = Menu.ReadMenuHeader(prop.strFileName);
  695. if (menuHeader != null)
  696. {
  697. string[] array2 = menuHeader.srcFileName.Split(new char[]
  698. {
  699. '|'
  700. });
  701. flag = (array2.Length == 0);
  702. if (!flag)
  703. {
  704. int num = array2.Length;
  705. foreach (string text2 in array2)
  706. {
  707. string text3 = null;
  708. string[] array4 = text2.Split(new char[]
  709. {
  710. ':'
  711. });
  712. if (array4.Length == 1)
  713. {
  714. text3 = array4[0];
  715. }
  716. else if (array4.Length == 2)
  717. {
  718. text3 = array4[1];
  719. }
  720. if (string.IsNullOrEmpty(text3) || text3.Contains("_del"))
  721. {
  722. num--;
  723. }
  724. }
  725. if (num == 0)
  726. {
  727. flag = true;
  728. }
  729. }
  730. }
  731. }
  732. }
  733. result.SetBool(flag);
  734. }
  735. else
  736. {
  737. string str = "パーツ系MPNにしか使えません。IsMenuFileDelFromMaidMPN -> ";
  738. MPN idx = (MPN)prop.idx;
  739. Debug.LogError(str + idx.ToString());
  740. result.SetBool(false);
  741. }
  742. }
  743. private void TJSFuncHasItemNameFromMaidMPN(TJSVariantRef[] param, TJSVariantRef result)
  744. {
  745. NDebug.Assert(3 == param.Length, "HasItemNameFromMaidMPN args count error.");
  746. if (result == null)
  747. {
  748. return;
  749. }
  750. TJSVariantRef.Type[] array = new TJSVariantRef.Type[3];
  751. RuntimeHelpers.InitializeArray(array, fieldof(<PrivateImplementationDetails>.$field-AD6FA4B5EC3AD70674F3E959B5FDF69348B2242D).FieldHandle);
  752. TJSVariantRef.Type[] array2 = array;
  753. for (int i = 0; i < param.Length; i++)
  754. {
  755. NDebug.Assert(param[i].type == array2[i], "TJSFuncHasItemNameFromMaidMPN args[" + i + "] type error.");
  756. }
  757. int nMaidNo = param[0].AsInteger();
  758. string text = param[1].AsString();
  759. string value = param[2].AsString();
  760. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(nMaidNo);
  761. MPN mpn = (MPN)Enum.Parse(typeof(MPN), text);
  762. if (maid.IsCrcBody)
  763. {
  764. if (mpn == MPN.acchat || mpn == MPN.headset)
  765. {
  766. mpn = MPN.acchead;
  767. }
  768. else if (mpn == MPN.acckubiwa)
  769. {
  770. mpn = MPN.acckubi;
  771. }
  772. }
  773. MaidProp prop = maid.GetProp(mpn);
  774. NDebug.Assert(prop != null, "[" + text + "] 指定MPNが不正です。");
  775. if (prop.type == 3)
  776. {
  777. if (string.IsNullOrEmpty(prop.strFileName))
  778. {
  779. result.SetBool(false);
  780. return;
  781. }
  782. Menu.MenuHeader menuHeader = Menu.ReadMenuHeader(prop.strFileName);
  783. if (menuHeader != null)
  784. {
  785. string[] array3 = menuHeader.itemName.Split(new char[]
  786. {
  787. '|'
  788. });
  789. foreach (string text2 in array3)
  790. {
  791. string text3 = null;
  792. string[] array5 = text2.Split(new char[]
  793. {
  794. ':'
  795. });
  796. if (array5.Length == 1)
  797. {
  798. text3 = array5[0];
  799. }
  800. else if (array5.Length == 2)
  801. {
  802. text3 = array5[1];
  803. }
  804. if (!string.IsNullOrEmpty(text3) && text3.Contains(value))
  805. {
  806. result.SetBool(true);
  807. return;
  808. }
  809. }
  810. }
  811. }
  812. else
  813. {
  814. string str = "パーツ系MPNにしか使えません。HasItemNameFromMaidMPN -> ";
  815. MPN idx = (MPN)prop.idx;
  816. Debug.LogError(str + idx.ToString());
  817. }
  818. result.SetBool(false);
  819. }
  820. private void TJSFuncIsEquipTatoo(TJSVariantRef[] param, TJSVariantRef result)
  821. {
  822. NDebug.Assert(1 == param.Length, "IsEquipTatoo args count error.");
  823. if (result == null)
  824. {
  825. return;
  826. }
  827. TJSVariantRef.Type[] array = new TJSVariantRef.Type[]
  828. {
  829. TJSVariantRef.Type.tvtInteger
  830. };
  831. for (int i = 0; i < param.Length; i++)
  832. {
  833. NDebug.Assert(param[i].type == array[i], "TJSFuncGetMaidProp args[" + i + "] type error.");
  834. }
  835. int nMaidNo = param[0].AsInteger();
  836. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(nMaidNo);
  837. MaidProp prop = maid.GetProp(MPN.acctatoo);
  838. if (maid.IsCrcBody && !string.IsNullOrEmpty(prop.strFileName) && prop.strFileName.Contains("crc_acctatoo_use_dummy"))
  839. {
  840. result.SetBool(true);
  841. return;
  842. }
  843. result.SetBool(false);
  844. if (prop != null && prop.listSubProp != null)
  845. {
  846. foreach (SubProp subProp in prop.listSubProp)
  847. {
  848. if (subProp != null && !string.IsNullOrEmpty(subProp.strFileName))
  849. {
  850. result.SetBool(true);
  851. break;
  852. }
  853. }
  854. }
  855. }
  856. private void TJSFuncSetMaidFlag(TJSVariantRef[] param, TJSVariantRef result)
  857. {
  858. NDebug.Assert(param.Length == 2 || 3 == param.Length, "SetMaidFlag args count error.");
  859. int nMaidNo = 0;
  860. string flagName = string.Empty;
  861. int num;
  862. if (param.Length == 3)
  863. {
  864. nMaidNo = param[0].AsInteger();
  865. flagName = param[1].AsString();
  866. num = param[2].AsInteger();
  867. }
  868. else
  869. {
  870. flagName = param[0].AsString();
  871. num = param[1].AsInteger();
  872. }
  873. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(nMaidNo);
  874. if (this.compatibilityMode || this.tjsLegacyMode)
  875. {
  876. maid.status.OldStatus.SetFlag(flagName, num);
  877. }
  878. else
  879. {
  880. maid.status.SetFlag(flagName, num);
  881. }
  882. if (result != null)
  883. {
  884. result.SetInteger(num);
  885. }
  886. }
  887. private void TJSFuncSetManFlag(TJSVariantRef[] param, TJSVariantRef result)
  888. {
  889. NDebug.Assert(param.Length == 2 || 3 == param.Length, "SetManFlag args count error.");
  890. string flagName = string.Empty;
  891. int value;
  892. if (param.Length == 3)
  893. {
  894. int num = param[0].AsInteger();
  895. flagName = param[1].AsString();
  896. value = param[2].AsInteger();
  897. }
  898. else
  899. {
  900. flagName = param[0].AsString();
  901. value = param[1].AsInteger();
  902. }
  903. if (!this.compatibilityMode)
  904. {
  905. GameMain.Instance.CharacterMgr.status.SetFlag(flagName, value);
  906. }
  907. }
  908. private void TJSFuncSetTmpFlag(TJSVariantRef[] param, TJSVariantRef result)
  909. {
  910. NDebug.Assert(2 == param.Length, "SetTmpFlag args count error.");
  911. string flag_name = string.Empty;
  912. flag_name = param[0].AsString();
  913. int num = param[1].AsInteger();
  914. GameMain.Instance.CMSystem.SetTmpGenericFlag(flag_name, num);
  915. if (result != null)
  916. {
  917. result.SetInteger(num);
  918. }
  919. }
  920. private void TJSFuncGetMaidFlag(TJSVariantRef[] param, TJSVariantRef result)
  921. {
  922. NDebug.Assert(param.Length == 1 || param.Length == 2 || 3 == param.Length, "GetMaidFlag args count error.");
  923. if (result == null)
  924. {
  925. return;
  926. }
  927. int nMaidNo = 0;
  928. string flagName = string.Empty;
  929. bool flag = false;
  930. if (param.Length == 3)
  931. {
  932. nMaidNo = param[0].AsInteger();
  933. flagName = param[1].AsString();
  934. if (param[2].AsBool())
  935. {
  936. flag = true;
  937. }
  938. }
  939. else if (param.Length == 2)
  940. {
  941. nMaidNo = param[0].AsInteger();
  942. flagName = param[1].AsString();
  943. }
  944. else
  945. {
  946. flagName = param[0].AsString();
  947. }
  948. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(nMaidNo);
  949. if ((this.compatibilityMode || this.tjsLegacyMode) && !flag)
  950. {
  951. result.SetInteger(maid.status.OldStatus.GetFlag(flagName));
  952. }
  953. else
  954. {
  955. result.SetInteger(maid.status.GetFlag(flagName));
  956. }
  957. }
  958. private void TJSFuncGetManFlag(TJSVariantRef[] param, TJSVariantRef result)
  959. {
  960. NDebug.Assert(param.Length == 1 || 2 == param.Length, "GetManFlag args count error.");
  961. if (result == null)
  962. {
  963. return;
  964. }
  965. string flagName = string.Empty;
  966. if (param.Length == 2)
  967. {
  968. int num = param[0].AsInteger();
  969. flagName = param[1].AsString();
  970. }
  971. else
  972. {
  973. flagName = param[0].AsString();
  974. }
  975. result.SetInteger(GameMain.Instance.CharacterMgr.status.GetFlag(flagName));
  976. }
  977. private void TJSFuncGetTmpFlag(TJSVariantRef[] param, TJSVariantRef result)
  978. {
  979. NDebug.Assert(1 == param.Length, "GetTmpFlag args count error.");
  980. if (result == null)
  981. {
  982. return;
  983. }
  984. string flag_name = param[0].AsString();
  985. result.SetInteger(GameMain.Instance.CMSystem.GetTmpGenericFlag(flag_name));
  986. }
  987. private void TJSFuncSetSystemFlag(TJSVariantRef[] param, TJSVariantRef result)
  988. {
  989. NDebug.Assert(2 == param.Length, "SetSystemFlag args count error.");
  990. string f_strKey = string.Empty;
  991. f_strKey = param[0].AsString();
  992. int integer = param[1].AsInteger();
  993. GameMain.Instance.CMSystem.SetSystemVers(f_strKey, integer.ToString());
  994. if (result != null)
  995. {
  996. result.SetInteger(integer);
  997. }
  998. }
  999. private void TJSFuncGetSystemFlag(TJSVariantRef[] param, TJSVariantRef result)
  1000. {
  1001. NDebug.Assert(1 == param.Length, "GetSystemFlag args count error.");
  1002. if (result == null)
  1003. {
  1004. return;
  1005. }
  1006. string f_strKey = param[0].AsString();
  1007. string text = GameMain.Instance.CMSystem.GetSystemVers(f_strKey);
  1008. if (string.IsNullOrEmpty(text))
  1009. {
  1010. text = "0";
  1011. }
  1012. result.SetInteger(int.Parse(text));
  1013. }
  1014. private void TJSFuncGetMaidStatus(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1015. {
  1016. NDebug.Assert(2 == tjs_param.Length, "GetMaidStatus args count error.");
  1017. if (result == null)
  1018. {
  1019. return;
  1020. }
  1021. int nMaidNo = tjs_param[0].AsInteger();
  1022. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(nMaidNo);
  1023. MaidStatus.Status status = maid.status;
  1024. string a = tjs_param[1].AsString();
  1025. bool flag = this.compatibilityMode || this.tjsLegacyMode;
  1026. if (flag && a == "状態")
  1027. {
  1028. a = "旧関係";
  1029. }
  1030. if (a == "性経験")
  1031. {
  1032. result.SetString(EnumConvert.GetString(status.seikeiken));
  1033. }
  1034. else if (a == "初期性経験")
  1035. {
  1036. result.SetString(EnumConvert.GetString(status.initSeikeiken));
  1037. }
  1038. else if (a == "性格")
  1039. {
  1040. result.SetString(status.personal.drawName);
  1041. }
  1042. else if (a == "契約タイプ")
  1043. {
  1044. result.SetString(EnumConvert.GetString(status.contract));
  1045. }
  1046. else if (a == "ヒロインタイプ")
  1047. {
  1048. result.SetString(EnumConvert.GetString(status.heroineType));
  1049. }
  1050. else if (a == "サブメイドユニークネーム")
  1051. {
  1052. if (status.subCharaData != null)
  1053. {
  1054. result.SetString(status.subCharaData.uniqueName);
  1055. }
  1056. else
  1057. {
  1058. result.SetString(string.Empty);
  1059. }
  1060. }
  1061. else if (a == "ジョブメイド")
  1062. {
  1063. result.SetString(status.selectedJobClass.data.uniqueName);
  1064. }
  1065. else if (a == "夜伽クラス")
  1066. {
  1067. if (status.selectedJobClass.data.classType == AbstractClassData.ClassType.New)
  1068. {
  1069. result.SetString("Debut");
  1070. }
  1071. else
  1072. {
  1073. result.SetString(status.selectedYotogiClass.data.drawName);
  1074. }
  1075. }
  1076. else if (a == "関係")
  1077. {
  1078. result.SetString(EnumConvert.GetString(status.relation));
  1079. }
  1080. else if (a == "追加関係")
  1081. {
  1082. result.SetString(EnumConvert.GetString(status.additionalRelation));
  1083. }
  1084. else if (a == "特殊関係")
  1085. {
  1086. result.SetString(EnumConvert.GetString(status.specialRelation));
  1087. }
  1088. else if (a == "旧関係")
  1089. {
  1090. if (status.OldStatus != null)
  1091. {
  1092. result.SetString(EnumConvert.GetString(status.OldStatus.relation));
  1093. }
  1094. else
  1095. {
  1096. result.SetString(EnumConvert.GetString(status.relation));
  1097. }
  1098. }
  1099. else if (a == "カップ")
  1100. {
  1101. result.SetString(status.body.cup);
  1102. }
  1103. else if (a == "苗字")
  1104. {
  1105. result.SetString(status.lastName);
  1106. }
  1107. else if (a == "名前")
  1108. {
  1109. result.SetString(status.firstName);
  1110. }
  1111. else if (a == "身長")
  1112. {
  1113. result.SetInteger(status.body.height);
  1114. }
  1115. else if (a == "夜伽プレイ回数")
  1116. {
  1117. result.SetInteger(status.playCountYotogi);
  1118. }
  1119. else if (a == "接客プレイ回数")
  1120. {
  1121. result.SetInteger(status.playCountNightWork);
  1122. }
  1123. else if (a == "興奮値")
  1124. {
  1125. result.SetInteger(status.currentExcite);
  1126. }
  1127. else if (a == "好感度")
  1128. {
  1129. result.SetInteger(status.likability);
  1130. if (flag && 300 <= status.likability)
  1131. {
  1132. result.SetInteger(299);
  1133. }
  1134. }
  1135. else if (a == "習得率")
  1136. {
  1137. result.SetInteger(status.studyRate);
  1138. }
  1139. else if (a == "接待")
  1140. {
  1141. result.SetInteger(status.reception);
  1142. }
  1143. else if (a == "お世話")
  1144. {
  1145. result.SetInteger(status.care);
  1146. }
  1147. else if (a == "可憐")
  1148. {
  1149. result.SetInteger(status.lovely);
  1150. }
  1151. else if (a == "淫欲")
  1152. {
  1153. result.SetInteger(status.inyoku);
  1154. }
  1155. else if (a == "気品")
  1156. {
  1157. result.SetInteger(status.elegance);
  1158. }
  1159. else if (a == "M性")
  1160. {
  1161. result.SetInteger(status.mvalue);
  1162. }
  1163. else if (a == "魅惑")
  1164. {
  1165. result.SetInteger(status.charm);
  1166. }
  1167. else if (a == "変態")
  1168. {
  1169. result.SetInteger(status.hentai);
  1170. }
  1171. else if (a == "奉仕")
  1172. {
  1173. result.SetInteger(status.housi);
  1174. }
  1175. else if (a == "料理")
  1176. {
  1177. result.SetInteger(status.cooking);
  1178. }
  1179. else if (a == "ボーカル")
  1180. {
  1181. result.SetInteger(status.vocal);
  1182. }
  1183. else if (a == "ダンス")
  1184. {
  1185. result.SetInteger(status.dance);
  1186. }
  1187. else if (a == "アピール")
  1188. {
  1189. result.SetInteger(status.appealPoint);
  1190. }
  1191. else if (a == "指導")
  1192. {
  1193. result.SetInteger(status.teachRate);
  1194. }
  1195. else if (a == "経験人数")
  1196. {
  1197. result.SetInteger(status.sexPlayNumberOfPeople);
  1198. }
  1199. else if (a == "昼仕事ID")
  1200. {
  1201. result.SetInteger(status.noonWorkId);
  1202. }
  1203. else if (a == "夜仕事ID")
  1204. {
  1205. result.SetInteger(status.nightWorkId);
  1206. }
  1207. else if (a == "昼仕事レベル")
  1208. {
  1209. if (!status.workDatas.ContainsKey(status.noonWorkId))
  1210. {
  1211. result.SetInteger(1);
  1212. }
  1213. else
  1214. {
  1215. result.SetInteger(status.workDatas.Get(status.noonWorkId).level);
  1216. }
  1217. }
  1218. else if (a == "夜仕事レベル")
  1219. {
  1220. if (!status.workDatas.ContainsKey(status.nightWorkId))
  1221. {
  1222. result.SetInteger(1);
  1223. }
  1224. else
  1225. {
  1226. result.SetInteger(status.workDatas.Get(status.nightWorkId).level);
  1227. }
  1228. }
  1229. else if (a == "夜伽クラスレベル")
  1230. {
  1231. result.SetInteger(status.selectedYotogiClass.level);
  1232. }
  1233. else if (a == "ジョブメイドレベル")
  1234. {
  1235. result.SetInteger(status.selectedJobClass.level);
  1236. }
  1237. else if (a == "スリーサイズB")
  1238. {
  1239. result.SetInteger(status.body.bust);
  1240. }
  1241. else if (a == "スリーサイズW")
  1242. {
  1243. result.SetInteger(status.body.waist);
  1244. }
  1245. else if (a == "スリーサイズH")
  1246. {
  1247. result.SetInteger(status.body.hip);
  1248. }
  1249. else if (flag)
  1250. {
  1251. if (a == "レンタルメイド")
  1252. {
  1253. result.SetInteger(0);
  1254. }
  1255. else if (a == "雇用中")
  1256. {
  1257. result.SetInteger(1);
  1258. }
  1259. else if (a == "特殊状態")
  1260. {
  1261. result.SetString(EnumConvert.GetString(status.OldStatus.condition));
  1262. }
  1263. else if (a == "欲求不満")
  1264. {
  1265. result.SetInteger(status.OldStatus.frustration);
  1266. }
  1267. else if (a == "淫乱ギャップ値")
  1268. {
  1269. result.SetInteger(status.inranGap);
  1270. }
  1271. else if (a == "M性ギャップ値")
  1272. {
  1273. result.SetInteger(status.mValueGap);
  1274. }
  1275. else if (a == "変態ギャップ値")
  1276. {
  1277. result.SetInteger(status.hentaiGap);
  1278. }
  1279. else if (a == "メイドクラス")
  1280. {
  1281. if (status.selectedJobClass.data.classType == AbstractClassData.ClassType.Old)
  1282. {
  1283. result.SetString(status.selectedJobClass.data.drawName);
  1284. }
  1285. else
  1286. {
  1287. result.SetString("ノービスメイド");
  1288. }
  1289. }
  1290. }
  1291. }
  1292. private void TJSFuncSetMainCharaFlag(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1293. {
  1294. NDebug.Assert(2 == tjs_param.Length, "SetMainCharaFlag args count error.");
  1295. int nMaidNo = tjs_param[0].AsInteger();
  1296. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(nMaidNo);
  1297. if (maid == null)
  1298. {
  1299. Debug.LogError("SetMainCharaFlag error\nメイド[" + nMaidNo.ToString() + "]にはメイドはいません");
  1300. }
  1301. else
  1302. {
  1303. maid.status.mainChara = tjs_param[1].AsBool();
  1304. }
  1305. }
  1306. private void OldTJSFuncConIsSeikantai(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1307. {
  1308. NDebug.Assert(this.compatibilityMode || this.tjsLegacyMode, "互換モードではないの、互換モード用関数@IsSeikantaiがよばれました");
  1309. NDebug.Assert(2 == tjs_param.Length, "IsSeikantai args count error.");
  1310. if (result == null)
  1311. {
  1312. return;
  1313. }
  1314. int nMaidNo = tjs_param[0].AsInteger();
  1315. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(nMaidNo);
  1316. MaidStatus.Old.Status oldStatus = maid.status.OldStatus;
  1317. string text = tjs_param[1].AsString();
  1318. int num = 1000;
  1319. if (text == "口")
  1320. {
  1321. result.SetBool(num <= oldStatus.sexual.mouth);
  1322. }
  1323. else if (text == "喉")
  1324. {
  1325. result.SetBool(num <= oldStatus.sexual.throat);
  1326. }
  1327. else if (text == "乳首")
  1328. {
  1329. result.SetBool(num <= oldStatus.sexual.nipple);
  1330. }
  1331. else if (text == "前穴")
  1332. {
  1333. result.SetBool(num <= oldStatus.sexual.front);
  1334. }
  1335. else if (text == "後穴")
  1336. {
  1337. result.SetBool(num <= oldStatus.sexual.back);
  1338. }
  1339. else if (text == "クリ")
  1340. {
  1341. result.SetBool(num <= oldStatus.sexual.curi);
  1342. }
  1343. else
  1344. {
  1345. NDebug.Assert("IsSeikantai error.\n" + text, false);
  1346. }
  1347. }
  1348. private void TJSFuncCreateNewMaid(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1349. {
  1350. NDebug.Assert(1 == tjs_param.Length, "CreateNewMaid args count error.");
  1351. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  1352. Maid maid = null;
  1353. string text = tjs_param[0].AsString();
  1354. if (!MaidStatus.Personal.Contains(text))
  1355. {
  1356. NDebug.Assert(SubMaid.Contains(text), "CreateNewMaidの指定名が間違っています[" + text + "]");
  1357. SubMaid.Data data = SubMaid.GetData(text);
  1358. GameMain.Instance.ScriptMgr.StopMotionScript();
  1359. bool flag = false;
  1360. for (int i = 0; i < GameMain.Instance.CharacterMgr.GetStockMaidCount(); i++)
  1361. {
  1362. Maid stockMaid = GameMain.Instance.CharacterMgr.GetStockMaid(i);
  1363. if (stockMaid != null && stockMaid.status.heroineType == HeroineType.Sub && stockMaid.status.subCharaData.id == data.id)
  1364. {
  1365. flag = true;
  1366. break;
  1367. }
  1368. }
  1369. if (!flag)
  1370. {
  1371. maid = characterMgr.AddStockMaid();
  1372. List<SubMaid.BackupStatus> subMaidBackupStatusList = GameMain.Instance.CharacterMgr.subMaidBackupStatusList;
  1373. int index = -1;
  1374. SubMaid.BackupStatus backupStatus = null;
  1375. for (int j = 0; j < subMaidBackupStatusList.Count; j++)
  1376. {
  1377. if (subMaidBackupStatusList[j].subCharaUniqueName == data.uniqueName)
  1378. {
  1379. index = j;
  1380. backupStatus = subMaidBackupStatusList[j];
  1381. break;
  1382. }
  1383. }
  1384. data.ApplyStatus(maid.status, characterMgr.status.lockUserDraftMaid);
  1385. data.ApplyPreset(maid, characterMgr.status.lockUserDraftMaid, backupStatus == null);
  1386. if (backupStatus != null)
  1387. {
  1388. backupStatus.Apply(maid.status);
  1389. subMaidBackupStatusList.RemoveAt(index);
  1390. }
  1391. }
  1392. }
  1393. else
  1394. {
  1395. NDebug.Assert(MaidStatus.Personal.IsEnabled(text), "CreateNewMaidで指定された対象名[" + text + "]は有効状態ではありません");
  1396. MaidStatus.Personal.Data data2 = MaidStatus.Personal.GetData(text);
  1397. GameMain.Instance.ScriptMgr.StopMotionScript();
  1398. maid = characterMgr.AddStockMaid();
  1399. maid.status.SetPersonal(data2);
  1400. }
  1401. if (maid != null)
  1402. {
  1403. characterMgr.SetActiveMaid(maid, 0);
  1404. maid.Visible = true;
  1405. maid.AllProcPropSeqStart();
  1406. }
  1407. }
  1408. private void TJSFuncPresetLoad(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1409. {
  1410. NDebug.Assert(2 == tjs_param.Length, "PresetLoad args count error.");
  1411. int nMaidNo = tjs_param[0].AsInteger();
  1412. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(nMaidNo);
  1413. if (maid == null)
  1414. {
  1415. NDebug.Assert("PresetLoad\nmaid null.", false);
  1416. return;
  1417. }
  1418. byte[] array = null;
  1419. string text = tjs_param[1].AsString();
  1420. if (text == "pre_maid_secretary")
  1421. {
  1422. CharacterMgr.Preset f_prest = GameMain.Instance.CharacterMgr.PresetLoadFromResources(text);
  1423. GameMain.Instance.CharacterMgr.PresetSet(maid, f_prest, false);
  1424. }
  1425. else
  1426. {
  1427. if (this.file_system.IsExistentFile(text + ".preset"))
  1428. {
  1429. using (AFileBase afileBase = GameUty.FileOpen(text + ".preset", null))
  1430. {
  1431. if (afileBase != null && afileBase.IsValid())
  1432. {
  1433. array = afileBase.ReadAll();
  1434. }
  1435. }
  1436. }
  1437. if (array == null)
  1438. {
  1439. NDebug.Assert("PresetLoad\n[" + text + "] file not fund.", false);
  1440. return;
  1441. }
  1442. using (BinaryReader binaryReader = new BinaryReader(new MemoryStream(array), Encoding.UTF8))
  1443. {
  1444. CharacterMgr.Preset f_prest2 = GameMain.Instance.CharacterMgr.PresetLoad(binaryReader, text);
  1445. GameMain.Instance.CharacterMgr.PresetSet(maid, f_prest2, false);
  1446. }
  1447. array = null;
  1448. }
  1449. if (this.compatibilityMode && !maid.boMAN)
  1450. {
  1451. maid.status.voiceGroup = VoiceGroup.Sub;
  1452. }
  1453. }
  1454. private void TJSFuncPresetLoadNPC(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1455. {
  1456. NDebug.Assert("未実装TJS関数[PresetLoadNPC]が呼ばれました", false);
  1457. }
  1458. private void TJSFuncAddMaidStatus(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1459. {
  1460. NDebug.Assert(3 == tjs_param.Length, "AddMaidStatus args count error.");
  1461. int nMaidNo = tjs_param[0].AsInteger();
  1462. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(nMaidNo);
  1463. MaidStatus.Status status = maid.status;
  1464. string a = tjs_param[1].AsString();
  1465. int num = tjs_param[2].AsInteger();
  1466. Action<int> action = null;
  1467. if (a == "夜伽プレイ回数")
  1468. {
  1469. maid.status.playCountNightWork += num;
  1470. }
  1471. else if (a == "接客プレイ回数")
  1472. {
  1473. maid.status.playCountNightWork += num;
  1474. }
  1475. else if (a == "好感度")
  1476. {
  1477. maid.status.likability += num;
  1478. }
  1479. else if (a == "習得率")
  1480. {
  1481. maid.status.studyRate += num;
  1482. }
  1483. else if (a == "接待")
  1484. {
  1485. maid.status.baseReception += num;
  1486. }
  1487. else if (a == "お世話")
  1488. {
  1489. maid.status.baseCare += num;
  1490. }
  1491. else if (a == "可憐")
  1492. {
  1493. maid.status.baseLovely += num;
  1494. }
  1495. else if (a == "気品")
  1496. {
  1497. maid.status.baseElegance += num;
  1498. }
  1499. else if (a == "魅惑")
  1500. {
  1501. maid.status.baseCharm += num;
  1502. }
  1503. else if (a == "淫欲")
  1504. {
  1505. maid.status.baseInyoku += num;
  1506. }
  1507. else if (a == "M性")
  1508. {
  1509. maid.status.baseMvalue += num;
  1510. }
  1511. else if (a == "変態")
  1512. {
  1513. maid.status.baseHentai += num;
  1514. }
  1515. else if (a == "奉仕")
  1516. {
  1517. maid.status.baseHousi += num;
  1518. }
  1519. else if (a == "指導")
  1520. {
  1521. maid.status.baseTeachRate += num;
  1522. }
  1523. else if (a == "経験人数")
  1524. {
  1525. maid.status.sexPlayNumberOfPeople += num;
  1526. }
  1527. if (action != null)
  1528. {
  1529. action(num);
  1530. }
  1531. }
  1532. private void TJSFuncIsMaidFeature(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1533. {
  1534. NDebug.Assert(2 == tjs_param.Length, "IsMaidFeature args count error.");
  1535. if (result == null)
  1536. {
  1537. return;
  1538. }
  1539. int nMaidNo = tjs_param[0].AsInteger();
  1540. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(nMaidNo);
  1541. MaidStatus.Status status = maid.status;
  1542. string uniqueName = tjs_param[1].AsString();
  1543. Feature.Data data = Feature.GetData(uniqueName);
  1544. result.SetInteger(Convert.ToInt32(status.features.ContainsKey(data.id)));
  1545. }
  1546. private void TJSFuncIsMaidPropensity(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1547. {
  1548. NDebug.Assert(2 == tjs_param.Length, "IsMaidPropensity args count error.");
  1549. if (result == null)
  1550. {
  1551. return;
  1552. }
  1553. int nMaidNo = tjs_param[0].AsInteger();
  1554. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(nMaidNo);
  1555. MaidStatus.Status status = maid.status;
  1556. string uniqueName = tjs_param[1].AsString();
  1557. Propensity.Data data = Propensity.GetData(uniqueName);
  1558. result.SetInteger(Convert.ToInt32(status.propensitys.ContainsKey(data.id)));
  1559. }
  1560. private void TJSFuncGetYotogiSkillLevel(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1561. {
  1562. NDebug.Assert(2 == tjs_param.Length, "GetYotogiSkillLevel args count error.");
  1563. if (result == null)
  1564. {
  1565. return;
  1566. }
  1567. int nMaidNo = tjs_param[0].AsInteger();
  1568. int skillId = tjs_param[1].AsInteger();
  1569. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(nMaidNo);
  1570. MaidStatus.Status status = maid.status;
  1571. result.SetInteger(0);
  1572. if (status.yotogiSkill.Contains(skillId))
  1573. {
  1574. YotogiSkillData yotogiSkillData = status.yotogiSkill.Get(skillId);
  1575. result.SetInteger(yotogiSkillData.level);
  1576. }
  1577. }
  1578. private void TJSFuncIsYotogiSkill(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1579. {
  1580. NDebug.Assert(2 == tjs_param.Length, "IsYotogiSkill args count error.");
  1581. if (result == null)
  1582. {
  1583. return;
  1584. }
  1585. int nMaidNo = tjs_param[0].AsInteger();
  1586. int skillId = tjs_param[1].AsInteger();
  1587. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(nMaidNo);
  1588. result.SetBool(maid.status.yotogiSkill.Contains(skillId));
  1589. }
  1590. private void TJSFuncGetStockMaidCount(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1591. {
  1592. if (result == null)
  1593. {
  1594. return;
  1595. }
  1596. result.SetInteger(GameMain.Instance.CharacterMgr.GetStockMaidCount());
  1597. }
  1598. private void TJSFuncSetSalonGrade(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1599. {
  1600. NDebug.Assert(1 == tjs_param.Length, "SetSalonGrade args count error.");
  1601. GameMain.Instance.CharacterMgr.status.clubGrade = tjs_param[0].AsInteger();
  1602. }
  1603. private void TJSFuncGetSalonGrade(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1604. {
  1605. if (result == null)
  1606. {
  1607. return;
  1608. }
  1609. result.SetInteger(GameMain.Instance.CharacterMgr.status.clubGrade);
  1610. }
  1611. private void TJSFuncGetClubEvaluation(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1612. {
  1613. if (result == null)
  1614. {
  1615. return;
  1616. }
  1617. result.SetInteger(GameMain.Instance.CharacterMgr.status.clubEvaluation);
  1618. }
  1619. private void TJSFuncSetClubGauge(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1620. {
  1621. NDebug.Assert(1 == tjs_param.Length, "SetClubGauge args count error.");
  1622. GameMain.Instance.CharacterMgr.status.clubGauge = tjs_param[0].AsInteger();
  1623. }
  1624. private void TJSFuncGetClubGauge(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1625. {
  1626. if (result == null)
  1627. {
  1628. return;
  1629. }
  1630. result.SetInteger(GameMain.Instance.CharacterMgr.status.clubGauge);
  1631. }
  1632. private void TJSFuncGetBGName(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1633. {
  1634. if (result == null)
  1635. {
  1636. return;
  1637. }
  1638. result.SetString(GameMain.Instance.BgMgr.GetBGName());
  1639. }
  1640. private void TJSFuncIsItemParam(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1641. {
  1642. if (result == null)
  1643. {
  1644. return;
  1645. }
  1646. NDebug.Assert(2 == tjs_param.Length, "IsItemParam args count error.");
  1647. if (result == null)
  1648. {
  1649. return;
  1650. }
  1651. int nMaidNo = tjs_param[0].AsInteger();
  1652. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(nMaidNo);
  1653. string f_strTag = tjs_param[1].AsString();
  1654. result.SetInteger(Convert.ToInt32(!string.IsNullOrEmpty(maid.body0.GetPartsParam(f_strTag))));
  1655. }
  1656. private void TJSFuncIsItemSlot(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1657. {
  1658. if (result == null)
  1659. {
  1660. return;
  1661. }
  1662. NDebug.Assert(2 == tjs_param.Length, "IsItemSlot args count error.");
  1663. if (result == null)
  1664. {
  1665. return;
  1666. }
  1667. int nMaidNo = tjs_param[0].AsInteger();
  1668. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(nMaidNo);
  1669. string text = tjs_param[1].AsString();
  1670. TBody.SlotID f_eSlot = TBody.SlotID.wear;
  1671. try
  1672. {
  1673. f_eSlot = (TBody.SlotID)Enum.Parse(typeof(TBody.SlotID), text);
  1674. }
  1675. catch
  1676. {
  1677. NDebug.Assert("Parse error.[TBody.SlotID]\n" + text, false);
  1678. }
  1679. result.SetBool(maid.body0.GetSlotLoaded(f_eSlot));
  1680. }
  1681. private void OldTJSFuncIsMaidClass(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1682. {
  1683. NDebug.Assert(this.compatibilityMode || this.tjsLegacyMode, "互換モードではないの、互換モード用関数@IsMaidClassがよばれました");
  1684. this.TJSFuncIsJobMaid(tjs_param, result);
  1685. }
  1686. private void TJSFuncIsJobMaid(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1687. {
  1688. if (result == null)
  1689. {
  1690. return;
  1691. }
  1692. NDebug.Assert(tjs_param.Length == 2, "IsJobMaid args count error.");
  1693. NDebug.Assert(tjs_param[0].type == TJSVariantRef.Type.tvtInteger && tjs_param[1].type == TJSVariantRef.Type.tvtString, "error.");
  1694. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(tjs_param[0].AsInteger());
  1695. string uniqueName = tjs_param[1].AsString();
  1696. JobClass.Data data = JobClass.GetData(uniqueName);
  1697. if (maid.status.jobClass.Contains(data.id))
  1698. {
  1699. result.SetInteger(1);
  1700. }
  1701. else
  1702. {
  1703. result.SetInteger(0);
  1704. }
  1705. }
  1706. private void OldTJSFuncGetMaidClassLevel(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1707. {
  1708. NDebug.Assert(this.compatibilityMode || this.tjsLegacyMode, "互換モードではないの、互換モード用関数@GetMaidClassLevelがよばれました");
  1709. this.TJSFuncGetJobMaidLevel(tjs_param, result);
  1710. }
  1711. private void TJSFuncGetJobMaidLevel(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1712. {
  1713. if (result == null)
  1714. {
  1715. return;
  1716. }
  1717. NDebug.Assert(tjs_param.Length == 2, "GetJobMaidLevel args count error.");
  1718. NDebug.Assert(tjs_param[0].type == TJSVariantRef.Type.tvtInteger && tjs_param[1].type == TJSVariantRef.Type.tvtString, "error.");
  1719. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(tjs_param[0].AsInteger());
  1720. string uniqueName = tjs_param[1].AsString();
  1721. JobClass.Data data = JobClass.GetData(uniqueName);
  1722. if (maid.status.jobClass.Contains(data.id))
  1723. {
  1724. result.SetInteger(maid.status.jobClass.Get(data.id).level);
  1725. }
  1726. else
  1727. {
  1728. result.SetInteger(0);
  1729. }
  1730. }
  1731. private void TJSFuncIsYotogiClass(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1732. {
  1733. if (result == null)
  1734. {
  1735. return;
  1736. }
  1737. NDebug.Assert(tjs_param.Length == 2, "IsYotogiClass args count error.");
  1738. NDebug.Assert(tjs_param[0].type == TJSVariantRef.Type.tvtInteger && tjs_param[1].type == TJSVariantRef.Type.tvtString, "error.");
  1739. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(tjs_param[0].AsInteger());
  1740. string uniqueName = tjs_param[1].AsString();
  1741. YotogiClass.Data data = YotogiClass.GetData(uniqueName);
  1742. if (maid.status.yotogiClass.Contains(data.id))
  1743. {
  1744. result.SetInteger(1);
  1745. }
  1746. else
  1747. {
  1748. result.SetInteger(0);
  1749. }
  1750. }
  1751. private void TJSFuncGetYotogiClassLevel(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1752. {
  1753. if (result == null)
  1754. {
  1755. return;
  1756. }
  1757. NDebug.Assert(tjs_param.Length == 2, "GetYotogiClassLevel args count error.");
  1758. NDebug.Assert(tjs_param[0].type == TJSVariantRef.Type.tvtInteger && tjs_param[1].type == TJSVariantRef.Type.tvtString, "error.");
  1759. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(tjs_param[0].AsInteger());
  1760. string uniqueName = tjs_param[1].AsString();
  1761. YotogiClass.Data data = YotogiClass.GetData(uniqueName);
  1762. if (maid.status.yotogiClass.Contains(data.id))
  1763. {
  1764. result.SetInteger(maid.status.yotogiClass.Get(data.id).level);
  1765. }
  1766. else
  1767. {
  1768. result.SetInteger(0);
  1769. }
  1770. }
  1771. private void TJSFuncGetNoonScuccessLevel(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1772. {
  1773. if (result == null)
  1774. {
  1775. return;
  1776. }
  1777. NDebug.Assert(tjs_param.Length == 1, "TJSFuncGetNoonScuccessLevel args count error.");
  1778. NDebug.Assert(tjs_param[0].type == TJSVariantRef.Type.tvtInteger, "error.");
  1779. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  1780. Maid maid = characterMgr.GetMaid(tjs_param[0].AsInteger());
  1781. ScheduleData[] scheduleSlot = characterMgr.status.scheduleSlot;
  1782. int integer = -1;
  1783. for (int i = 0; i < scheduleSlot.Length; i++)
  1784. {
  1785. if (scheduleSlot[i] != null)
  1786. {
  1787. if (scheduleSlot[i].maid_guid == maid.status.guid)
  1788. {
  1789. integer = (int)scheduleSlot[i].noon_success_level;
  1790. break;
  1791. }
  1792. }
  1793. }
  1794. result.SetInteger(integer);
  1795. }
  1796. private void TJSFuncIsMaid(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1797. {
  1798. if (result == null)
  1799. {
  1800. return;
  1801. }
  1802. NDebug.Assert(tjs_param.Length == 1, "IsMaid args count error.");
  1803. NDebug.Assert(tjs_param[0].type == TJSVariantRef.Type.tvtInteger, "error.");
  1804. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  1805. Maid maid = characterMgr.GetMaid(tjs_param[0].AsInteger());
  1806. result.SetBool(maid != null);
  1807. }
  1808. private void TJSFuncIsOldPersonal(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1809. {
  1810. if (result == null)
  1811. {
  1812. return;
  1813. }
  1814. NDebug.Assert(tjs_param.Length == 1, "IsOldPersonal args count error.");
  1815. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  1816. Maid maid = characterMgr.GetMaid(tjs_param[0].AsInteger());
  1817. if (maid == null)
  1818. {
  1819. result.SetBool(false);
  1820. }
  1821. else
  1822. {
  1823. result.SetBool(maid.status.personal.oldPersonal);
  1824. }
  1825. }
  1826. public void TJSFuncConGetSalonLoan(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1827. {
  1828. if (result == null)
  1829. {
  1830. return;
  1831. }
  1832. result.SetInteger(0);
  1833. }
  1834. public void TJSFuncConGetPhase(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1835. {
  1836. if (result == null)
  1837. {
  1838. return;
  1839. }
  1840. result.SetInteger(2);
  1841. }
  1842. public void TJSFuncGetDay(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1843. {
  1844. if (result == null)
  1845. {
  1846. return;
  1847. }
  1848. PlayerStatus.Status status = GameMain.Instance.CharacterMgr.status;
  1849. result.SetInteger(status.days);
  1850. }
  1851. public void TJSFuncCreateStockMaidLoopData(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1852. {
  1853. this.stock_maid_loop_list.Clear();
  1854. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  1855. for (int i = 0; i < characterMgr.GetStockMaidCount(); i++)
  1856. {
  1857. this.stock_maid_loop_list.Add(characterMgr.GetStockMaid(i));
  1858. }
  1859. List<Maid> list = this.stock_maid_loop_list;
  1860. if (ScriptManager.<>f__mg$cache0 == null)
  1861. {
  1862. ScriptManager.<>f__mg$cache0 = new Comparison<Maid>(CharacterSelectManager.SortMaidStandard);
  1863. }
  1864. list.Sort(ScriptManager.<>f__mg$cache0);
  1865. if (result != null)
  1866. {
  1867. result.SetInteger(this.stock_maid_loop_list.Count);
  1868. }
  1869. }
  1870. public void TJSFuncCreateCompetitiveShowLoopData(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1871. {
  1872. this.stock_maid_loop_list.Clear();
  1873. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  1874. if (CompetitiveShowMgr.is_effect_ones)
  1875. {
  1876. for (int i = 0; i < CompetitiveShowMgr.check_maid_list.Count; i++)
  1877. {
  1878. this.stock_maid_loop_list.Add(CompetitiveShowMgr.check_maid_list[i]);
  1879. }
  1880. }
  1881. else if (0 < CompetitiveShowMgr.check_maid_list.Count)
  1882. {
  1883. this.stock_maid_loop_list.Add(CompetitiveShowMgr.check_maid_list[0]);
  1884. CompetitiveShowMgr.check_maid_list.RemoveAt(0);
  1885. }
  1886. if (result != null)
  1887. {
  1888. result.SetInteger(this.stock_maid_loop_list.Count);
  1889. }
  1890. }
  1891. public void TJSFuncGetCompetitiveShowLoopCount(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1892. {
  1893. if (result != null)
  1894. {
  1895. result.SetInteger(CompetitiveShowMgr.check_maid_list.Count);
  1896. }
  1897. }
  1898. public void TJSFuncSetActiveSlotFromStockMaidLoopData(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1899. {
  1900. GameMain.Instance.ScriptMgr.StopMotionScript();
  1901. NDebug.Assert(tjs_param.Length == 1, "SetActiveSlotFromStockMaidLoopData args count error.");
  1902. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  1903. Maid maid = this.stock_maid_loop_list[tjs_param[0].AsInteger()];
  1904. maid.Visible = false;
  1905. characterMgr.SetActiveMaid(maid, 0);
  1906. }
  1907. private void TJSFuncClearCallStack(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1908. {
  1909. this.ClearCallStack();
  1910. }
  1911. private void OldTJSFuncIsCommunicationChara(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1912. {
  1913. NDebug.Assert(this.compatibilityMode || this.tjsLegacyMode, "互換モードではないの、互換モード用関数@IsCommunicationCharaeがよばれました");
  1914. if (result == null)
  1915. {
  1916. return;
  1917. }
  1918. result.SetBool(false);
  1919. result.SetBool(0 < ScheduleAPI.CanCommunicationMaids(GameMain.Instance.CharacterMgr.status.isDaytime).Count);
  1920. }
  1921. private void TJSFuncSetCommunicationChara(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1922. {
  1923. bool isDaytime = GameMain.Instance.CharacterMgr.status.isDaytime;
  1924. Maid communicationMaid = ScheduleAPI.GetCommunicationMaid(isDaytime);
  1925. if (communicationMaid == null)
  1926. {
  1927. if (result != null)
  1928. {
  1929. result.SetBool(false);
  1930. }
  1931. return;
  1932. }
  1933. GameMain.Instance.CharacterMgr.SetActiveMaid(communicationMaid, 0);
  1934. communicationMaid.Visible = true;
  1935. ScheduleCSVData.ScheduleBase schedule = ScheduleAPI.GetSchedule(communicationMaid, isDaytime);
  1936. if (schedule.type == ScheduleTaskCtrl.TaskType.Training)
  1937. {
  1938. ScheduleCSVData.Training training = (ScheduleCSVData.Training)schedule;
  1939. if (training.trainingType == ScheduleCSVData.TrainingType.Trainee)
  1940. {
  1941. Maid maid;
  1942. if (isDaytime)
  1943. {
  1944. maid = ScheduleAPI.GetNoonTrainerMaid();
  1945. }
  1946. else
  1947. {
  1948. maid = ScheduleAPI.GetNightTrainerMaid();
  1949. }
  1950. if (maid != null)
  1951. {
  1952. GameMain.Instance.CharacterMgr.SetActiveMaid(maid, 1);
  1953. maid.Visible = true;
  1954. }
  1955. }
  1956. if (training.trainingType == ScheduleCSVData.TrainingType.Trainer)
  1957. {
  1958. Maid maid2;
  1959. if (isDaytime)
  1960. {
  1961. maid2 = ScheduleAPI.GetNoonTraineeMaid();
  1962. }
  1963. else
  1964. {
  1965. maid2 = ScheduleAPI.GetNightTraineeMaid();
  1966. }
  1967. if (maid2 != null)
  1968. {
  1969. GameMain.Instance.CharacterMgr.SetActiveMaid(maid2, 1);
  1970. maid2.Visible = true;
  1971. }
  1972. }
  1973. }
  1974. if (result != null)
  1975. {
  1976. result.SetBool(true);
  1977. }
  1978. }
  1979. private void TJSFuncSetRandomCommuChara(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1980. {
  1981. GameMain.Instance.ScriptMgr.StopMotionScript();
  1982. Maid[] array = ScheduleAPI.CanCommunicationMaids(GameMain.Instance.CharacterMgr.status.isDaytime).ToArray();
  1983. if (array.Length == 0)
  1984. {
  1985. GameMain.Instance.CharacterMgr.DeactivateMaid(0);
  1986. return;
  1987. }
  1988. Maid maid = array[UnityEngine.Random.Range(0, array.Length)];
  1989. NDebug.Assert(maid != null, "SetRandomCommuChara()\n選択されたメイドが空です");
  1990. GameMain.Instance.CharacterMgr.SetActiveMaid(maid, 0);
  1991. maid.Visible = true;
  1992. }
  1993. private void TJSFuncCreateYotogiCharaList(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1994. {
  1995. SceneCharacterSelect.CreateYotogiCharaList();
  1996. }
  1997. private void TJSFuncCreateNewYotogiCharaList(TJSVariantRef[] tjs_param, TJSVariantRef result)
  1998. {
  1999. SceneCharacterSelect.CreateNewYotogiCharaList();
  2000. }
  2001. private void TJSFuncCreateNewYotogiHaremPairCharaList(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2002. {
  2003. SceneCharacterSelect.CreateNewYotogiHaremPairCharaList();
  2004. }
  2005. private void TJSFuncCreateVipCharaList(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2006. {
  2007. SceneCharacterSelect.CreateVipCharaList();
  2008. }
  2009. private void TJSFuncCreateFacilityCharaList(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2010. {
  2011. SceneCharacterSelect.CreateFacilityCharaList();
  2012. }
  2013. private void TJSFuncCreateLifeModeCharaList(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2014. {
  2015. SceneCharacterSelect.CreateLifeModeCharaList();
  2016. }
  2017. private void TJSFuncBackupStoreCharaList(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2018. {
  2019. SceneCharacterSelect.StoreCharaGuidStockList();
  2020. }
  2021. private void TJSFuncBackupReStoreCharaList(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2022. {
  2023. SceneCharacterSelect.ReStoreCharaGuidStockList();
  2024. }
  2025. private void TJSFuncIsReceptionChara(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2026. {
  2027. if (result == null)
  2028. {
  2029. return;
  2030. }
  2031. result.SetBool(0 < ScheduleAPI.GetEntertainMaids().Count);
  2032. }
  2033. private void TJSFuncSetRandomReceptionChara(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2034. {
  2035. GameMain.Instance.ScriptMgr.StopMotionScript();
  2036. Maid[] array = ScheduleAPI.GetEntertainMaids().ToArray();
  2037. NDebug.Assert(0 < array.Length, "SetRandomReceptionChara()\nメイドリストが空です");
  2038. Maid maid = array[UnityEngine.Random.Range(0, array.Length)];
  2039. NDebug.Assert(maid != null, "SetRandomReceptionChara()\n選択されたメイドが空です");
  2040. GameMain.Instance.CharacterMgr.SetActiveMaid(maid, 0);
  2041. maid.Visible = true;
  2042. }
  2043. private void TJSFuncIsSelectChara(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2044. {
  2045. if (result == null)
  2046. {
  2047. return;
  2048. }
  2049. result.SetBool(SceneCharacterSelect.IsSelectChara());
  2050. }
  2051. private void TJSFuncGetDateYear(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2052. {
  2053. if (result == null)
  2054. {
  2055. return;
  2056. }
  2057. result.SetInteger(DateTime.Now.Year);
  2058. }
  2059. private void TJSFuncGetDateMonth(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2060. {
  2061. if (result == null)
  2062. {
  2063. return;
  2064. }
  2065. result.SetInteger(DateTime.Now.Month);
  2066. }
  2067. private void TJSFuncGetDateDay(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2068. {
  2069. if (result == null)
  2070. {
  2071. return;
  2072. }
  2073. result.SetInteger(DateTime.Now.Day);
  2074. }
  2075. private void TJSFuncUpdateMaidRanking(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2076. {
  2077. Maid.UpdateMaidRanking();
  2078. }
  2079. private void TJSFuncResetMaidRanking(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2080. {
  2081. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  2082. for (int i = 0; i < characterMgr.GetStockMaidCount(); i++)
  2083. {
  2084. Maid stockMaid = characterMgr.GetStockMaid(i);
  2085. if (stockMaid != null)
  2086. {
  2087. stockMaid.status.popularRank = 0;
  2088. stockMaid.status.evaluation = 0;
  2089. stockMaid.status.sales = 0L;
  2090. }
  2091. }
  2092. characterMgr.status.SetFlag("__ランキング日数", 0);
  2093. }
  2094. private void TJSFuncSetMaidRanking1st(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2095. {
  2096. GameMain.Instance.ScriptMgr.StopMotionScript();
  2097. Maid maid = null;
  2098. for (int i = 0; i < GameMain.Instance.CharacterMgr.GetStockMaidCount(); i++)
  2099. {
  2100. maid = GameMain.Instance.CharacterMgr.GetStockMaid(i);
  2101. if (!(maid == null))
  2102. {
  2103. if (maid.status.popularRank == 1)
  2104. {
  2105. break;
  2106. }
  2107. }
  2108. }
  2109. if (maid == null)
  2110. {
  2111. maid = GameMain.Instance.CharacterMgr.GetStockMaid(0);
  2112. }
  2113. GameMain.Instance.CharacterMgr.SetActiveMaid(maid, 0);
  2114. maid.Visible = true;
  2115. }
  2116. private void TJSFuncIsAvailableRanking(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2117. {
  2118. if (result == null)
  2119. {
  2120. return;
  2121. }
  2122. result.SetBool(GameMain.Instance.CharacterMgr.status.isAvailableRanking);
  2123. }
  2124. private void TJSFuncIsYotogiSubCharaSelect(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2125. {
  2126. if (result == null)
  2127. {
  2128. return;
  2129. }
  2130. result.SetBool(false);
  2131. GameObject gameObject = GameObject.Find("UI Root/YotogiManager");
  2132. if (gameObject == null)
  2133. {
  2134. return;
  2135. }
  2136. if (this.compatibilityMode || this.tjsLegacyMode)
  2137. {
  2138. YotogiOldManager component = gameObject.GetComponent<YotogiOldManager>();
  2139. if (component == null)
  2140. {
  2141. return;
  2142. }
  2143. result.SetBool(component.IsCallShouldSubCharaSelect());
  2144. }
  2145. else
  2146. {
  2147. YotogiManager component2 = gameObject.GetComponent<YotogiManager>();
  2148. if (component2 == null)
  2149. {
  2150. return;
  2151. }
  2152. result.SetBool(component2.IsCallShouldSubCharaSelect());
  2153. }
  2154. }
  2155. private void TJSFuncGetYotogiSkillSpecialType(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2156. {
  2157. GameObject gameObject = GameObject.Find("UI Root/YotogiManager");
  2158. if (result == null || gameObject == null)
  2159. {
  2160. return;
  2161. }
  2162. YotogiManager component = gameObject.GetComponent<YotogiManager>();
  2163. if (component == null || component.play_skill_array == null || component.play_skill_array.Length == 0)
  2164. {
  2165. return;
  2166. }
  2167. result.SetString(component.play_skill_array[0].skill_pair.base_data.specialConditionType.ToString());
  2168. }
  2169. private void TJSFuncIsSelectedYotogiSkill(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2170. {
  2171. NDebug.Assert(tjs_param.Length == 1, "IsSelectedYotogiSkill args count error.");
  2172. GameObject gameObject = GameObject.Find("UI Root/YotogiManager");
  2173. if (result == null || gameObject == null)
  2174. {
  2175. return;
  2176. }
  2177. YotogiManager component = gameObject.GetComponent<YotogiManager>();
  2178. if (component == null || component.play_skill_array == null || component.play_skill_array.Length == 0)
  2179. {
  2180. return;
  2181. }
  2182. result.SetBool(false);
  2183. int num = tjs_param[0].AsInteger();
  2184. foreach (YotogiManager.PlayingSkillData playingSkillData in component.play_skill_array)
  2185. {
  2186. if (playingSkillData != null && playingSkillData.skill_pair != null && playingSkillData.skill_pair.skill_data != null)
  2187. {
  2188. if (playingSkillData.skill_pair.skill_data.data.id == num)
  2189. {
  2190. result.SetBool(true);
  2191. break;
  2192. }
  2193. }
  2194. }
  2195. }
  2196. private void TJSFuncLearningYotogiSkill(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2197. {
  2198. NDebug.Assert(tjs_param.Length == 2, "LearningYotogiSkill args count error.");
  2199. NDebug.Assert(tjs_param[0].type == TJSVariantRef.Type.tvtInteger && tjs_param[1].type == TJSVariantRef.Type.tvtInteger, "error.");
  2200. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(tjs_param[0].AsInteger());
  2201. if (maid == null)
  2202. {
  2203. Debug.LogError("maid is null. LearningYotogiSkill");
  2204. return;
  2205. }
  2206. int skillId = tjs_param[1].AsInteger();
  2207. maid.status.yotogiSkill.Add(skillId);
  2208. }
  2209. private void TJSFuncIsExistentFile(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2210. {
  2211. if (result == null)
  2212. {
  2213. return;
  2214. }
  2215. if (this.compatibilityMode)
  2216. {
  2217. result.SetBool(false);
  2218. }
  2219. else
  2220. {
  2221. NDebug.Assert(1 == tjs_param.Length, "TJSFuncIsExistentFile args count error.");
  2222. result.SetBool(this.file_system.IsExistentFile(tjs_param[0].AsString()));
  2223. }
  2224. }
  2225. private void TJSFuncIsExistentFileLegacy(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2226. {
  2227. if (result == null)
  2228. {
  2229. return;
  2230. }
  2231. NDebug.Assert(1 == tjs_param.Length, "IsExistentFileLegacy args count error.");
  2232. result.SetBool(GameUty.FileSystemOld.IsExistentFile(tjs_param[0].AsString()));
  2233. }
  2234. private void TJSFuncCheckClearVIP(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2235. {
  2236. if (result == null)
  2237. {
  2238. return;
  2239. }
  2240. NDebug.Assert(1 == tjs_param.Length, "CheckClearVIP args count error.");
  2241. int key = tjs_param[0].AsInteger();
  2242. ReadOnlyDictionary<int, NightWorkState> night_works_state_dic = GameMain.Instance.CharacterMgr.status.night_works_state_dic;
  2243. bool @bool = false;
  2244. if (night_works_state_dic.ContainsKey(key) && night_works_state_dic[key].finish)
  2245. {
  2246. @bool = true;
  2247. }
  2248. result.SetBool(@bool);
  2249. }
  2250. private void TJSFuncIsCBLVersion(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2251. {
  2252. if (result == null)
  2253. {
  2254. return;
  2255. }
  2256. result.SetBool(false);
  2257. }
  2258. private void OldTJSFuncGetRentalNPCName(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2259. {
  2260. NDebug.Assert(this.compatibilityMode || this.tjsLegacyMode, "互換モードではないの、互換モード用関数@GetRentalNPCNameがよばれました");
  2261. if (result == null)
  2262. {
  2263. return;
  2264. }
  2265. result.SetString(string.Empty);
  2266. }
  2267. private void OldTJSFuncIsMarriage(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2268. {
  2269. NDebug.Assert(this.compatibilityMode || this.tjsLegacyMode, "互換モードではないの、互換モード用関数@IsMarriageがよばれました");
  2270. if (result == null)
  2271. {
  2272. return;
  2273. }
  2274. NDebug.Assert(1 == tjs_param.Length, "TJSFuncIsMarriage args count error.");
  2275. int nMaidNo = tjs_param[0].AsInteger();
  2276. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(nMaidNo);
  2277. if (maid != null && maid.status.OldStatus != null)
  2278. {
  2279. result.SetBool(maid.status.OldStatus.isMarriage);
  2280. }
  2281. else
  2282. {
  2283. result.SetBool(false);
  2284. }
  2285. }
  2286. private void OldTJSFuncIsNewWifeFlag(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2287. {
  2288. NDebug.Assert(this.compatibilityMode || this.tjsLegacyMode, "互換モードではないの、互換モード用関数@IsNewWifeFlagがよばれました");
  2289. if (result == null)
  2290. {
  2291. return;
  2292. }
  2293. NDebug.Assert(1 == tjs_param.Length, "TJSFuncIsMarriage args count error.");
  2294. int nMaidNo = tjs_param[0].AsInteger();
  2295. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(nMaidNo);
  2296. if (maid != null && maid.status.OldStatus != null)
  2297. {
  2298. result.SetBool(maid.status.OldStatus.isNewWife);
  2299. }
  2300. else
  2301. {
  2302. result.SetBool(false);
  2303. }
  2304. }
  2305. private void TJSFuncIsMVPEvent(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2306. {
  2307. if (result == null)
  2308. {
  2309. return;
  2310. }
  2311. PlayerStatus.Status status = GameMain.Instance.CharacterMgr.status;
  2312. if (!status.isAvailableRanking)
  2313. {
  2314. result.SetBool(false);
  2315. }
  2316. else if (status.GetFlag("__ランキング日数") % 7 == 0)
  2317. {
  2318. bool @bool = false;
  2319. for (int i = 0; i < GameMain.Instance.CharacterMgr.GetStockMaidCount(); i++)
  2320. {
  2321. Maid stockMaid = GameMain.Instance.CharacterMgr.GetStockMaid(i);
  2322. if (!(stockMaid == null))
  2323. {
  2324. if (stockMaid.status.popularRank == 1)
  2325. {
  2326. @bool = true;
  2327. break;
  2328. }
  2329. }
  2330. }
  2331. result.SetBool(@bool);
  2332. }
  2333. else
  2334. {
  2335. result.SetBool(false);
  2336. }
  2337. }
  2338. private void TJSFuncSetMaidCondition(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2339. {
  2340. NDebug.Assert(2 == tjs_param.Length, "SetMaidCondition args count error.");
  2341. int nMaidNo = tjs_param[0].AsInteger();
  2342. string a = tjs_param[1].AsString();
  2343. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(nMaidNo);
  2344. if (this.compatibilityMode || this.tjsLegacyMode)
  2345. {
  2346. if (a == "緊張")
  2347. {
  2348. maid.status.OldStatus.relation = MaidStatus.Old.Relation.Tonus;
  2349. }
  2350. else if (a == "お近づき")
  2351. {
  2352. maid.status.OldStatus.relation = MaidStatus.Old.Relation.Contact;
  2353. }
  2354. else if (a == "信頼")
  2355. {
  2356. maid.status.OldStatus.relation = MaidStatus.Old.Relation.Trust;
  2357. }
  2358. else if (a == "恋人")
  2359. {
  2360. maid.status.OldStatus.relation = MaidStatus.Old.Relation.Lover;
  2361. }
  2362. else if (a == "愛奴")
  2363. {
  2364. maid.status.OldStatus.relation = MaidStatus.Old.Relation.Slave;
  2365. }
  2366. else if (a == "酔い")
  2367. {
  2368. maid.status.OldStatus.condition = Condition.Drunk;
  2369. }
  2370. else if (a == "お仕置き")
  2371. {
  2372. maid.status.OldStatus.condition = Condition.Osioki;
  2373. }
  2374. else if (a == "酔い解除" || a == "お仕置き解除")
  2375. {
  2376. maid.status.OldStatus.condition = Condition.Null;
  2377. }
  2378. }
  2379. else if (a == "お近づき")
  2380. {
  2381. maid.status.relation = MaidStatus.Relation.Contact;
  2382. }
  2383. else if (a == "信頼")
  2384. {
  2385. maid.status.relation = MaidStatus.Relation.Trust;
  2386. }
  2387. else if (a == "恋人")
  2388. {
  2389. maid.status.relation = MaidStatus.Relation.Lover;
  2390. }
  2391. else if (a == "警戒")
  2392. {
  2393. maid.status.additionalRelation = AdditionalRelation.Vigilance;
  2394. }
  2395. else if (a == "恋人+")
  2396. {
  2397. maid.status.additionalRelation = AdditionalRelation.LoverPlus;
  2398. }
  2399. else if (a == "愛奴")
  2400. {
  2401. maid.status.additionalRelation = AdditionalRelation.Slave;
  2402. }
  2403. else if (a == "Null")
  2404. {
  2405. maid.status.additionalRelation = AdditionalRelation.Null;
  2406. }
  2407. else if (a == "嫁")
  2408. {
  2409. maid.status.specialRelation = SpecialRelation.Married;
  2410. }
  2411. else if (a == "特殊関係解除")
  2412. {
  2413. maid.status.specialRelation = SpecialRelation.Null;
  2414. }
  2415. }
  2416. private void TJSFuncSetSeikeikenFront(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2417. {
  2418. NDebug.Assert(2 == tjs_param.Length, "SetSeikeikenFront args count error.");
  2419. int num = tjs_param[0].AsInteger();
  2420. bool seikeikenFront = tjs_param[1].AsBool();
  2421. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(num);
  2422. Seikeiken seikeiken = maid.status.seikeiken;
  2423. maid.status.SetSeikeikenFront(seikeikenFront);
  2424. if (num == 0 && maid.status.seikeiken != seikeiken)
  2425. {
  2426. if ((this.compatibilityMode || this.tjsLegacyMode) && YotogiOldManager.instans != null)
  2427. {
  2428. YotogiOldManager.instans.OnChangeSeikeiken();
  2429. }
  2430. else if (YotogiManager.instans != null)
  2431. {
  2432. YotogiManager.instans.OnChangeSeikeiken();
  2433. }
  2434. }
  2435. }
  2436. private void TJSFuncSetSeikeikenBack(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2437. {
  2438. NDebug.Assert(2 == tjs_param.Length, "SetSeikeikenBack args count error.");
  2439. int nMaidNo = tjs_param[0].AsInteger();
  2440. bool seikeikenBack = tjs_param[1].AsBool();
  2441. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(nMaidNo);
  2442. maid.status.SetSeikeikenBack(seikeikenBack);
  2443. }
  2444. private void TJSFuncSetInitSeikeiken(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2445. {
  2446. NDebug.Assert(2 == tjs_param.Length, "SetInitSeikeiken args count error.");
  2447. int nMaidNo = tjs_param[0].AsInteger();
  2448. string text = tjs_param[1].AsString();
  2449. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(nMaidNo);
  2450. try
  2451. {
  2452. Seikeiken initSeikeiken = (Seikeiken)Enum.Parse(typeof(Seikeiken), text);
  2453. maid.status.initSeikeiken = initSeikeiken;
  2454. }
  2455. catch (ArgumentException)
  2456. {
  2457. Debug.Log("MaidStatus.Seikeiken\nenum parse error.[" + text + "]");
  2458. }
  2459. }
  2460. private void TJSFuncSetNewItem(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2461. {
  2462. NDebug.Assert(1 == tjs_param.Length, "SetNewItem args count error.");
  2463. if (this.compatibilityMode || this.tjsLegacyMode)
  2464. {
  2465. return;
  2466. }
  2467. string itemName = tjs_param[0].AsString();
  2468. GameMain.Instance.CharacterMgr.status.AddHavePartsItem(itemName);
  2469. }
  2470. private void TJSFuncIsGameInShopItemPurchased(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2471. {
  2472. NDebug.Assert(1 == tjs_param.Length, "IsGameInShopItemPurchased args count error.");
  2473. if (result == null)
  2474. {
  2475. return;
  2476. }
  2477. int num = tjs_param[0].AsInteger();
  2478. PlayerStatus.Status status = GameMain.Instance.CharacterMgr.status;
  2479. if (!status.IsShopLineupItem(num))
  2480. {
  2481. result.SetBool(false);
  2482. }
  2483. if (status.shopLineups.ContainsKey(num))
  2484. {
  2485. result.SetBool(status.shopLineups.Get(num) == ShopItemStatus.Purchased);
  2486. }
  2487. else
  2488. {
  2489. result.SetBool(false);
  2490. }
  2491. }
  2492. private void TJSFuncSetContractType(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2493. {
  2494. NDebug.Assert(2 == tjs_param.Length, "SetContractType args count error.");
  2495. int nMaidNo = tjs_param[0].AsInteger();
  2496. string text = tjs_param[1].AsString();
  2497. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(nMaidNo);
  2498. if (text == "育成中")
  2499. {
  2500. maid.status.contract = Contract.Trainee;
  2501. }
  2502. else if (text == "フリー")
  2503. {
  2504. maid.status.contract = Contract.Free;
  2505. }
  2506. else if (text == "専属")
  2507. {
  2508. maid.status.contract = Contract.Exclusive;
  2509. }
  2510. else
  2511. {
  2512. NDebug.Assert(text + "は不正です", false);
  2513. }
  2514. }
  2515. private void TJSFuncSetFeature(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2516. {
  2517. NDebug.Assert(3 == tjs_param.Length, "SetFeature args count error.");
  2518. int nMaidNo = tjs_param[0].AsInteger();
  2519. string uniqueName = tjs_param[1].AsString();
  2520. bool flag = tjs_param[2].AsBool();
  2521. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(nMaidNo);
  2522. Feature.Data data = Feature.GetData(uniqueName);
  2523. maid.status.AddFeature(data);
  2524. }
  2525. private void TJSFuncSetPropensity(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2526. {
  2527. NDebug.Assert(3 == tjs_param.Length, "SetPropensity args count error.");
  2528. int nMaidNo = tjs_param[0].AsInteger();
  2529. string uniqueName = tjs_param[1].AsString();
  2530. bool flag = tjs_param[2].AsBool();
  2531. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(nMaidNo);
  2532. Propensity.Data data = Propensity.GetData(uniqueName);
  2533. maid.status.AddPropensity(data);
  2534. }
  2535. private void TJSFuncComSetSexualParam(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2536. {
  2537. }
  2538. private void TJSFuncSetNewTrophy(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2539. {
  2540. if (this.compatibilityMode || this.tjsLegacyMode)
  2541. {
  2542. return;
  2543. }
  2544. NDebug.Assert(1 == tjs_param.Length, "SetNewTrophy args count error.");
  2545. int trophyId = tjs_param[0].AsInteger();
  2546. GameMain.Instance.CharacterMgr.status.AddHaveTrophy(trophyId);
  2547. }
  2548. private void TJSFuncCheckTrophyContractType(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2549. {
  2550. if (this.compatibilityMode || this.tjsLegacyMode)
  2551. {
  2552. return;
  2553. }
  2554. GameMain.Instance.CharacterMgr.status.CheckTrophyContractTypeAndrelation();
  2555. }
  2556. private void TJSFuncSetYotogiSelectStageName(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2557. {
  2558. NDebug.Assert(1 == tjs_param.Length, "SetYotogiSelectStageName args count error.");
  2559. this.debug_yotogi_stage_ = tjs_param[0].AsString();
  2560. }
  2561. private void TJSFuncGetYotogiSelectStageName(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2562. {
  2563. if (result == null)
  2564. {
  2565. return;
  2566. }
  2567. if (this.compatibilityMode || this.tjsLegacyMode)
  2568. {
  2569. result.SetString(YotogiOldStageSelectManager.StageName);
  2570. }
  2571. else
  2572. {
  2573. result.SetString(YotogiStageSelectManager.SelectedStage.uniqueName);
  2574. }
  2575. }
  2576. public void TJSFuncIsPluginPack(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2577. {
  2578. if (result == null)
  2579. {
  2580. return;
  2581. }
  2582. NDebug.Assert(1 == tjs_param.Length, "IsPluginPack args count error.");
  2583. if (this.compatibilityMode)
  2584. {
  2585. result.SetBool(false);
  2586. }
  2587. else
  2588. {
  2589. string text = tjs_param[0].AsString();
  2590. if (!PluginData.Contains(text))
  2591. {
  2592. Debug.LogError("IsPluginPackで指定された[" + text + "]は設定されていないプラグイン名です");
  2593. }
  2594. result.SetBool(PluginData.IsEnabled(text));
  2595. }
  2596. }
  2597. public void TJSFuncAddShopLineup(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2598. {
  2599. NDebug.Assert(1 == tjs_param.Length, "TJSFuncAddShopLineup args count error.");
  2600. PlayerStatus.Status status = GameMain.Instance.CharacterMgr.status;
  2601. int num = tjs_param[0].AsInteger();
  2602. if (!status.shopLineups.ContainsKey(num))
  2603. {
  2604. status.AddShopLineup(num);
  2605. }
  2606. }
  2607. public void TJSFuncSetEventItemFlag(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2608. {
  2609. NDebug.Assert(2 == tjs_param.Length, "SetEventItemFlag args count error.");
  2610. PlayerStatus.Status status = GameMain.Instance.CharacterMgr.status;
  2611. bool flag = tjs_param[1].AsInteger() != 0;
  2612. if (flag)
  2613. {
  2614. status.AddHaveItem(tjs_param[0].AsString());
  2615. }
  2616. else
  2617. {
  2618. status.RemoveHaveItem(tjs_param[0].AsString());
  2619. }
  2620. }
  2621. public void TJSFuncIsEventItemFlag(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2622. {
  2623. if (result == null)
  2624. {
  2625. NDebug.Assert("error IsEventItemFlag", false);
  2626. }
  2627. NDebug.Assert(1 == tjs_param.Length, "IsEventItemFlag args count error.");
  2628. PlayerStatus.Status status = GameMain.Instance.CharacterMgr.status;
  2629. result.SetBool(status.IsHaveItem(tjs_param[0].AsString()));
  2630. }
  2631. public void TJSFuncGetVRMode(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2632. {
  2633. if (result == null)
  2634. {
  2635. NDebug.Assert("error GetVRMode", false);
  2636. }
  2637. result.SetInteger((int)GameMain.Instance.VRDeviceTypeID);
  2638. }
  2639. public void TJSFuncIsVRMode(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2640. {
  2641. if (result == null)
  2642. {
  2643. NDebug.Assert("error IsVRMode", false);
  2644. }
  2645. result.SetInteger((!GameMain.Instance.VRMode) ? 0 : 1);
  2646. }
  2647. public void TJSFuncSetDanceData(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2648. {
  2649. NDebug.Assert(1 == tjs_param.Length, "TJSFuncAddShopLineup args count error.");
  2650. string bgm_file_name = tjs_param[0].AsString();
  2651. DanceMain.SelectDanceData = new DanceData
  2652. {
  2653. bgm_file_name = bgm_file_name,
  2654. preset_name = new List<string>(),
  2655. preset_name =
  2656. {
  2657. string.Empty
  2658. }
  2659. };
  2660. DanceMain.KaraokeMode = true;
  2661. RhythmAction_Mgr.KaraokeRecet();
  2662. GameMain.Instance.CMSystem.SetTmpGenericFlag("ダンスOVRカメラタイプ", 0);
  2663. }
  2664. public void TJSFuncGetEventAdded(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2665. {
  2666. if (result == null)
  2667. {
  2668. NDebug.Assert("error GetEventAdded", false);
  2669. }
  2670. result.SetBool(GameMain.Instance.ScenarioSelectMgr.IsEventAdded());
  2671. }
  2672. public void TJSFuncGetLockNTRPlayFlag(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2673. {
  2674. if (result == null)
  2675. {
  2676. NDebug.Assert("error GetLockNTRPlayFlag", false);
  2677. }
  2678. result.SetBool(GameMain.Instance.CharacterMgr.status.lockNTRPlay);
  2679. }
  2680. public void TJSFuncGetLockUserDraftMaid(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2681. {
  2682. if (result == null)
  2683. {
  2684. NDebug.Assert("error GetLockUserDraftMaid", false);
  2685. }
  2686. result.SetBool(GameMain.Instance.CharacterMgr.status.lockUserDraftMaid);
  2687. }
  2688. public void TJSFuncIsComPlayer(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2689. {
  2690. if (result == null)
  2691. {
  2692. NDebug.Assert("error IsComPlayer", false);
  2693. }
  2694. result.SetBool(!GameMain.Instance.CharacterMgr.status.isOldPlayer);
  2695. }
  2696. public void TJSFuncSetPlayerMoney(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2697. {
  2698. NDebug.Assert(1 == tjs_param.Length, "SetPlayerMoney args count error.");
  2699. int num = tjs_param[0].AsInteger();
  2700. GameMain.Instance.CharacterMgr.status.money = (long)num;
  2701. }
  2702. public void TJSFuncGetPlayerMoney(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2703. {
  2704. if (result == null)
  2705. {
  2706. NDebug.Assert("error GetPlayerMoney", false);
  2707. }
  2708. int integer = (2147483647L >= GameMain.Instance.CharacterMgr.status.money) ? ((int)GameMain.Instance.CharacterMgr.status.money) : int.MaxValue;
  2709. result.SetInteger(integer);
  2710. }
  2711. public void TJSFuncSetMaidLeader(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2712. {
  2713. NDebug.Assert(2 == tjs_param.Length, "SetMaidLeader args count error.");
  2714. int nMaidNo = tjs_param[0].AsInteger();
  2715. bool leader = tjs_param[1].AsBool();
  2716. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(nMaidNo);
  2717. if (maid != null)
  2718. {
  2719. maid.status.leader = leader;
  2720. }
  2721. }
  2722. public void TJSFuncSetMaidCostumeFacility(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2723. {
  2724. NDebug.Assert(1 == tjs_param.Length, "UpdateMaidCostumeFacility args count error.");
  2725. int num = tjs_param[0].AsInteger();
  2726. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(num);
  2727. NDebug.Assert(maid != null, string.Format("UpdateMaidCostumeFacility()\nメイド[{0}]番が見つかりませんでした。", num));
  2728. ScheduleMgr.ScheduleTime scheduleTime = (!GameMain.Instance.CharacterMgr.status.isDaytime) ? ScheduleMgr.ScheduleTime.Night : ScheduleMgr.ScheduleTime.DayTime;
  2729. Facility maidAssignedFacility = GameMain.Instance.FacilityMgr.GetMaidAssignedFacility(maid, scheduleTime);
  2730. if (maidAssignedFacility != null)
  2731. {
  2732. Facility.CostumeType typeCostume = maidAssignedFacility.typeCostume;
  2733. if (typeCostume == Facility.CostumeType.Edit)
  2734. {
  2735. maidAssignedFacility.UpdateMaidCostumeToEditCostume(maid, false);
  2736. }
  2737. else if (typeCostume == Facility.CostumeType.Default)
  2738. {
  2739. maidAssignedFacility.UpdateMaidCostumeToDefaultCostume(maid);
  2740. }
  2741. else if (typeCostume == Facility.CostumeType.Heroine)
  2742. {
  2743. MPN[] facilityCostumeEnableMPN = FacilityDataTable.GetFacilityCostumeEnableMPN();
  2744. for (int i = 0; i < facilityCostumeEnableMPN.Length; i++)
  2745. {
  2746. maid.ResetProp(facilityCostumeEnableMPN[i], false);
  2747. }
  2748. }
  2749. }
  2750. else
  2751. {
  2752. NDebug.Warning(string.Format("UpdateMaidCostumeFacility()\nメイド[{0}]番は、現在施設の仕事を持っていません。", num));
  2753. Debug.LogWarningFormat("UpdateMaidCostumeFacility()\nメイド[{0}]番は、現在施設の仕事を持っていません。", new object[]
  2754. {
  2755. num
  2756. });
  2757. }
  2758. }
  2759. public void TJSFuncResetMaidCostumeFacility(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2760. {
  2761. NDebug.Assert(1 == tjs_param.Length, "UpdateMaidCostumeFacility args count error.");
  2762. int num = tjs_param[0].AsInteger();
  2763. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(num);
  2764. NDebug.Assert(maid != null, string.Format("UpdateMaidCostumeFacility()\nメイド[{0}]番が見つかりませんでした。", num));
  2765. MPN[] facilityCostumeEnableMPN = FacilityDataTable.GetFacilityCostumeEnableMPN();
  2766. for (int i = 0; i < facilityCostumeEnableMPN.Length; i++)
  2767. {
  2768. maid.ResetProp(facilityCostumeEnableMPN[i], false);
  2769. }
  2770. }
  2771. public void TJSFuncCallTitleBar(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2772. {
  2773. NDebug.Assert(1 == tjs_param.Length, "CallTitleBar args count error.");
  2774. GameObject gameObject = GameObject.Find("__SceneADV__");
  2775. if (gameObject == null)
  2776. {
  2777. return;
  2778. }
  2779. SceneADV component = gameObject.GetComponent<SceneADV>();
  2780. component.CallTitleBar(tjs_param[0].AsString());
  2781. }
  2782. public void TJSFuncSetCompatibilityMode(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2783. {
  2784. NDebug.Assert(1 == tjs_param.Length, "SetCompatibilityMode args count error.");
  2785. this.compatibilityMode = tjs_param[0].AsBool();
  2786. Debug.Log("スクリプトモード変更 : 互換モード[" + ((!this.compatibilityMode) ? "×]" : "〇]"));
  2787. KagScript kag = this.adv_kag.kag;
  2788. this.compatibilityCallStackDepth = kag.callStackDepth;
  2789. this.compatibilityRCallStackDepth = kag.r_callStackDepth;
  2790. }
  2791. public void TJSFuncIsBuildingFacility(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2792. {
  2793. NDebug.Assert(result != null, "error IsBuildingFacility");
  2794. NDebug.Assert(1 == tjs_param.Length, "IsBuildingFacility args count error.");
  2795. string text = tjs_param[0].AsString();
  2796. FacilityDataTable.FacilityDefaultData facilityDefaultData = FacilityDataTable.GetFacilityDefaultData(text, false);
  2797. NDebug.Assert(facilityDefaultData != null, string.Format("{0} は存在しない情報です", text));
  2798. if (!facilityDefaultData.isEnableData)
  2799. {
  2800. Debug.Log(text + " は有効ではありません");
  2801. result.SetBool(false);
  2802. }
  2803. else
  2804. {
  2805. result.SetBool(GameMain.Instance.FacilityMgr.IsExistTypeFacility(facilityDefaultData.ID));
  2806. }
  2807. }
  2808. public void TJSFuncIsBuildingFacilityUpward(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2809. {
  2810. NDebug.Assert(result != null, "error IsBuildingFacilityUpward");
  2811. NDebug.Assert(1 == tjs_param.Length, "IsBuildingFacilityUpward args count error.");
  2812. string text = tjs_param[0].AsString();
  2813. FacilityDataTable.FacilityDefaultData facilityDefaultData = FacilityDataTable.GetFacilityDefaultData(text, false);
  2814. NDebug.Assert(facilityDefaultData != null, string.Format("{0} は存在しない情報です", text));
  2815. if (!facilityDefaultData.isEnableData)
  2816. {
  2817. Debug.Log(text + " は有効ではありません");
  2818. result.SetBool(false);
  2819. }
  2820. if (facilityDefaultData.isExistUpwardFacility)
  2821. {
  2822. result.SetBool(GameMain.Instance.FacilityMgr.IsExistTypeFacility(facilityDefaultData.upwardFacility.ID));
  2823. }
  2824. else
  2825. {
  2826. result.SetBool(false);
  2827. }
  2828. }
  2829. public void TJSCheckDanceType(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2830. {
  2831. NDebug.Assert(tjs_param.Length != 0, "CheckDanceType:引数が何も指定されてません");
  2832. bool flag = false;
  2833. foreach (TJSVariantRef tjsvariantRef in tjs_param)
  2834. {
  2835. flag |= (RhythmAction_Mgr.NowDance == (RhythmAction_Mgr.DanceType)Enum.Parse(typeof(RhythmAction_Mgr.DanceType), tjsvariantRef.AsString()));
  2836. }
  2837. result.SetBool(flag);
  2838. }
  2839. public void TJSSetMusicRelease(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2840. {
  2841. NDebug.Assert(tjs_param.Length == 1, "SetMusicRelease:指定できる引数は1つまでです");
  2842. VsDanceDataMgr.Instance.MusicRelese(tjs_param[0].AsInteger());
  2843. }
  2844. public void TJSSetVsSetting(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2845. {
  2846. NDebug.Assert(tjs_param.Length == 1, "SetVsSetting:指定できる引数は1つまでです");
  2847. VsDanceDataMgr.Instance.SelectSetting(tjs_param[0].AsInteger());
  2848. }
  2849. public void TJSNeedDanceResult(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2850. {
  2851. bool flag = true;
  2852. flag &= (RhythmAction_Mgr.NowDance != RhythmAction_Mgr.DanceType.VS_Skip);
  2853. flag &= (RhythmAction_Mgr.NowDance != RhythmAction_Mgr.DanceType.Touch);
  2854. flag &= (RhythmAction_Mgr.NowDance != RhythmAction_Mgr.DanceType.View);
  2855. flag &= (RhythmAction_Mgr.NowDance != RhythmAction_Mgr.DanceType.Encore);
  2856. result.SetBool(flag);
  2857. }
  2858. public void TJSGetChallengeRank(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2859. {
  2860. NDebug.Assert(tjs_param.Length > 0, "GetChallengeRank:引数が指定されてません");
  2861. bool flag = false;
  2862. foreach (TJSVariantRef tjsvariantRef in tjs_param)
  2863. {
  2864. flag |= (tjsvariantRef.AsString() == Result_Display.GetData("Rank"));
  2865. }
  2866. result.SetBool(flag);
  2867. }
  2868. public void TJSBjDayFirst(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2869. {
  2870. int days = GameMain.Instance.CharacterMgr.status.days;
  2871. int flag = GameMain.Instance.CharacterMgr.status.GetFlag("BJ最終プレイ日");
  2872. bool @bool = days != flag;
  2873. foreach (TJSVariantRef tjsvariantRef in tjs_param)
  2874. {
  2875. if (tjsvariantRef.AsString() == "ブラックジャック終了")
  2876. {
  2877. GameMain.Instance.CharacterMgr.status.SetFlag("BJ最終プレイ日", days);
  2878. break;
  2879. }
  2880. }
  2881. result.SetBool(@bool);
  2882. }
  2883. public void TJSCasinoShopBuy(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2884. {
  2885. NDebug.Assert(tjs_param.Length != 0, "CasinoShopBuy:引数が指定されてません");
  2886. bool flag = false;
  2887. foreach (TJSVariantRef tjsvariantRef in tjs_param)
  2888. {
  2889. int num = tjsvariantRef.AsInteger();
  2890. flag = false;
  2891. foreach (CasinoShopItem casinoShopItem in CasinoDataMgr.Instance.GetShopItem())
  2892. {
  2893. if (casinoShopItem.ID == num && casinoShopItem.IsSoldOut)
  2894. {
  2895. flag = true;
  2896. break;
  2897. }
  2898. }
  2899. if (!flag)
  2900. {
  2901. break;
  2902. }
  2903. }
  2904. result.SetBool(flag);
  2905. }
  2906. public void TJSSetEventEndFlag(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2907. {
  2908. NDebug.Assert(tjs_param.Length == 3, "SetEventEndFlag:引数が3つ必要です");
  2909. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(tjs_param[0].AsInteger());
  2910. if (!maid)
  2911. {
  2912. maid = GameMain.Instance.CharacterMgr.GetStockMaid(tjs_param[0].AsInteger());
  2913. if (!maid)
  2914. {
  2915. return;
  2916. }
  2917. }
  2918. if (!GameMain.Instance.ScenarioSelectMgr.ExistScenario(tjs_param[1].AsInteger()))
  2919. {
  2920. Debug.LogErrorFormat("選択シナリオ:{0}は存在しません", new object[]
  2921. {
  2922. tjs_param[1].AsInteger()
  2923. });
  2924. return;
  2925. }
  2926. maid.status.SetEventEndFlag(tjs_param[1].AsInteger(), tjs_param[2].AsBool());
  2927. }
  2928. public void TJSFuncIsKasizukiGuest(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2929. {
  2930. if (result == null)
  2931. {
  2932. NDebug.Assert("error IsKasizukiGuest", false);
  2933. }
  2934. ManDataType nowManType = (ManDataType)GameMain.Instance.KasizukiMgr.GetNowManType();
  2935. result.SetBool(nowManType != ManDataType.主人公);
  2936. }
  2937. public void TJSFuncGetKasizukiSelectRoomName(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2938. {
  2939. if (result == null)
  2940. {
  2941. NDebug.Assert("error GetKasizukiSelectRoomName", false);
  2942. }
  2943. RoomData.Data data = RoomData.GetData(GameMain.Instance.KasizukiMgr.GetSystemData<int>(SystemDataType.選択部屋));
  2944. result.SetString(data.uniqueName);
  2945. }
  2946. public void TJSFuncGetKasizukiMaidLikability(TJSVariantRef[] tjs_param, TJSVariantRef result)
  2947. {
  2948. if (result == null)
  2949. {
  2950. NDebug.Assert("error GetKasizukiMaidLikability", false);
  2951. }
  2952. KasizukiManager kasizukiMgr = GameMain.Instance.KasizukiMgr;
  2953. ManDataType nowManType = (ManDataType)kasizukiMgr.GetNowManType();
  2954. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(0);
  2955. int integer = -1;
  2956. if (nowManType == ManDataType.主人公)
  2957. {
  2958. integer = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F本編, true);
  2959. }
  2960. else if (nowManType == ManDataType.傅き男1)
  2961. {
  2962. integer = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男1, true);
  2963. }
  2964. else if (nowManType == ManDataType.傅き男2)
  2965. {
  2966. integer = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男2, true);
  2967. }
  2968. else if (nowManType == ManDataType.傅き男3)
  2969. {
  2970. integer = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男3, true);
  2971. }
  2972. else if (nowManType == ManDataType.傅き男4)
  2973. {
  2974. integer = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男4, true);
  2975. }
  2976. else if (nowManType == ManDataType.傅き男5)
  2977. {
  2978. integer = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男5, true);
  2979. }
  2980. else if (nowManType == ManDataType.傅き男6)
  2981. {
  2982. integer = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男6, true);
  2983. }
  2984. else if (nowManType == ManDataType.傅き男7)
  2985. {
  2986. integer = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男7, true);
  2987. }
  2988. else if (nowManType == ManDataType.傅き男8)
  2989. {
  2990. integer = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男8, true);
  2991. }
  2992. else if (nowManType == ManDataType.傅き男9)
  2993. {
  2994. integer = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男9, true);
  2995. }
  2996. else if (nowManType == ManDataType.傅き男10)
  2997. {
  2998. integer = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男10, true);
  2999. }
  3000. else if (nowManType == ManDataType.傅き男11)
  3001. {
  3002. integer = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男11, true);
  3003. }
  3004. else if (nowManType == ManDataType.傅き男12)
  3005. {
  3006. integer = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男12, true);
  3007. }
  3008. else if (nowManType == ManDataType.傅き男13)
  3009. {
  3010. integer = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男13, true);
  3011. }
  3012. else if (nowManType == ManDataType.傅き男14)
  3013. {
  3014. integer = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男14, true);
  3015. }
  3016. else if (nowManType == ManDataType.傅き男15)
  3017. {
  3018. integer = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男15, true);
  3019. }
  3020. else if (nowManType == ManDataType.傅き男16)
  3021. {
  3022. integer = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男16, true);
  3023. }
  3024. else if (nowManType == ManDataType.傅き男17)
  3025. {
  3026. integer = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男17, true);
  3027. }
  3028. else if (nowManType == ManDataType.傅き男18)
  3029. {
  3030. integer = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男18, true);
  3031. }
  3032. else if (nowManType == ManDataType.傅き男19)
  3033. {
  3034. integer = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男19, true);
  3035. }
  3036. result.SetInteger(integer);
  3037. }
  3038. public void TJSFuncGetKasizukiMaidLikabilityName(TJSVariantRef[] tjs_param, TJSVariantRef result)
  3039. {
  3040. if (result == null)
  3041. {
  3042. NDebug.Assert("error GetKasizukiMaidLikabilityName", false);
  3043. }
  3044. KasizukiManager kasizukiMgr = GameMain.Instance.KasizukiMgr;
  3045. ManDataType nowManType = (ManDataType)kasizukiMgr.GetNowManType();
  3046. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(0);
  3047. int likability = -1;
  3048. if (nowManType == ManDataType.主人公)
  3049. {
  3050. likability = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F本編, true);
  3051. }
  3052. else if (nowManType == ManDataType.傅き男1)
  3053. {
  3054. likability = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男1, true);
  3055. }
  3056. else if (nowManType == ManDataType.傅き男2)
  3057. {
  3058. likability = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男2, true);
  3059. }
  3060. else if (nowManType == ManDataType.傅き男3)
  3061. {
  3062. likability = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男3, true);
  3063. }
  3064. else if (nowManType == ManDataType.傅き男4)
  3065. {
  3066. likability = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男4, true);
  3067. }
  3068. else if (nowManType == ManDataType.傅き男5)
  3069. {
  3070. likability = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男5, true);
  3071. }
  3072. else if (nowManType == ManDataType.傅き男6)
  3073. {
  3074. likability = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男6, true);
  3075. }
  3076. else if (nowManType == ManDataType.傅き男7)
  3077. {
  3078. likability = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男7, true);
  3079. }
  3080. else if (nowManType == ManDataType.傅き男8)
  3081. {
  3082. likability = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男8, true);
  3083. }
  3084. else if (nowManType == ManDataType.傅き男9)
  3085. {
  3086. likability = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男9, true);
  3087. }
  3088. else if (nowManType == ManDataType.傅き男10)
  3089. {
  3090. likability = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男10, true);
  3091. }
  3092. else if (nowManType == ManDataType.傅き男11)
  3093. {
  3094. likability = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男11, true);
  3095. }
  3096. else if (nowManType == ManDataType.傅き男12)
  3097. {
  3098. likability = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男12, true);
  3099. }
  3100. else if (nowManType == ManDataType.傅き男13)
  3101. {
  3102. likability = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男13, true);
  3103. }
  3104. else if (nowManType == ManDataType.傅き男14)
  3105. {
  3106. likability = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男14, true);
  3107. }
  3108. else if (nowManType == ManDataType.傅き男15)
  3109. {
  3110. likability = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男15, true);
  3111. }
  3112. else if (nowManType == ManDataType.傅き男16)
  3113. {
  3114. likability = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男16, true);
  3115. }
  3116. else if (nowManType == ManDataType.傅き男17)
  3117. {
  3118. likability = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男17, true);
  3119. }
  3120. else if (nowManType == ManDataType.傅き男18)
  3121. {
  3122. likability = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男18, true);
  3123. }
  3124. else if (nowManType == ManDataType.傅き男19)
  3125. {
  3126. likability = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男19, true);
  3127. }
  3128. string likabilityName = LikabilityReplace.GetLikabilityName(likability);
  3129. result.SetString(likabilityName);
  3130. }
  3131. public void TJSFuncGetKasizukiMaidWorkCount(TJSVariantRef[] tjs_param, TJSVariantRef result)
  3132. {
  3133. if (result == null)
  3134. {
  3135. NDebug.Assert("error GetKasizukiMaidWorkCount", false);
  3136. }
  3137. KasizukiManager kasizukiMgr = GameMain.Instance.KasizukiMgr;
  3138. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(0);
  3139. int maidData = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.仕事回数, true);
  3140. result.SetInteger(maidData);
  3141. }
  3142. public void TJSFuncGetKasizukiMaidWorkCountName(TJSVariantRef[] tjs_param, TJSVariantRef result)
  3143. {
  3144. if (result == null)
  3145. {
  3146. NDebug.Assert("error GetKasizukiMaidWorkCountName", false);
  3147. }
  3148. KasizukiManager kasizukiMgr = GameMain.Instance.KasizukiMgr;
  3149. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(0);
  3150. int maidData = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.仕事回数, true);
  3151. string workCountName = WorkCountReplace.GetWorkCountName(maidData);
  3152. result.SetString(workCountName);
  3153. }
  3154. public void TJSFuncGetKasizukiSystemFlag(TJSVariantRef[] tjs_param, TJSVariantRef result)
  3155. {
  3156. KasizukiManager kasizukiMgr = GameMain.Instance.KasizukiMgr;
  3157. kasizukiMgr.TJSFuncGetKasizukiSystemFlag(tjs_param, result);
  3158. }
  3159. public void TJSFuncSetKasizukiSystemFlag(TJSVariantRef[] tjs_param, TJSVariantRef result)
  3160. {
  3161. KasizukiManager kasizukiMgr = GameMain.Instance.KasizukiMgr;
  3162. kasizukiMgr.TJSFuncSetKasizukiSystemFlag(tjs_param, result);
  3163. }
  3164. public void TJSFuncAddKasizukiSystemFlag(TJSVariantRef[] tjs_param, TJSVariantRef result)
  3165. {
  3166. KasizukiManager kasizukiMgr = GameMain.Instance.KasizukiMgr;
  3167. kasizukiMgr.TJSFuncAddKasizukiSystemFlag(tjs_param, result);
  3168. }
  3169. public void TJSFuncSetKasizukiPassFlag(TJSVariantRef[] tjs_param, TJSVariantRef result)
  3170. {
  3171. KasizukiManager kasizukiMgr = GameMain.Instance.KasizukiMgr;
  3172. kasizukiMgr.TJSFuncSetKasizukiPassFlag(tjs_param, result);
  3173. }
  3174. public void TJSFuncGetKasizukiMaidFlag(TJSVariantRef[] tjs_param, TJSVariantRef result)
  3175. {
  3176. KasizukiManager kasizukiMgr = GameMain.Instance.KasizukiMgr;
  3177. kasizukiMgr.TJSFuncGetKasizukiMaidFlag(tjs_param, result);
  3178. }
  3179. public void TJSFuncSetKasizukiMaidFlag(TJSVariantRef[] tjs_param, TJSVariantRef result)
  3180. {
  3181. KasizukiManager kasizukiMgr = GameMain.Instance.KasizukiMgr;
  3182. kasizukiMgr.TJSFuncSetKasizukiMaidFlag(tjs_param, result);
  3183. }
  3184. public void TJSFuncIsKasizukiCorrectSenarioFlag(TJSVariantRef[] tjs_param, TJSVariantRef result)
  3185. {
  3186. KasizukiManager kasizukiMgr = GameMain.Instance.KasizukiMgr;
  3187. kasizukiMgr.TJSFuncIsKasizukiCorrectSenarioFlag(tjs_param, result);
  3188. }
  3189. public void TJSFuncGetKasizukiGuestID(TJSVariantRef[] tjs_param, TJSVariantRef result)
  3190. {
  3191. if (result == null)
  3192. {
  3193. NDebug.Assert("error GetKasizukiGuestID", false);
  3194. }
  3195. result.SetInteger(GameMain.Instance.KasizukiMgr.GetNowManType());
  3196. }
  3197. public void TJSFuncIsVRKaraokeMode(TJSVariantRef[] tjs_param, TJSVariantRef result)
  3198. {
  3199. if (result == null)
  3200. {
  3201. NDebug.Assert("error IsVRKaraokeMode", false);
  3202. }
  3203. result.SetInteger((!SceneVRCommunication.Instance.KaraokeMode) ? 0 : 1);
  3204. }
  3205. public void TJSFuncGetGameMode(TJSVariantRef[] tjs_param, TJSVariantRef result)
  3206. {
  3207. result.SetString(GameModeManager.nowGameMode.ToString());
  3208. }
  3209. public void TJSFuncIsLifeMode(TJSVariantRef[] tjs_param, TJSVariantRef result)
  3210. {
  3211. result.SetBool(GameModeManager.nowGameMode == GameModeManager.Type.LifeMode);
  3212. }
  3213. public void TJSFuncIsPrivateModeMaid(TJSVariantRef[] tjs_param, TJSVariantRef result)
  3214. {
  3215. if (result == null)
  3216. {
  3217. return;
  3218. }
  3219. NDebug.Assert(tjs_param.Length == 1, "IsPrivateModeMaid args count error.");
  3220. NDebug.Assert(tjs_param[0].type == TJSVariantRef.Type.tvtInteger, "error.");
  3221. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(tjs_param[0].AsInteger());
  3222. result.SetBool(maid != null && maid == PrivateModeMgr.Instance.PrivateMaid);
  3223. }
  3224. public void TJSFuncIsPrivateModeDayTalkEnabled(TJSVariantRef[] tjs_param, TJSVariantRef result)
  3225. {
  3226. if (result != null)
  3227. {
  3228. result.SetBool(GameMain.Instance.CMSystem.SConfig.PrivateModeSettingDayTalkEnabled);
  3229. }
  3230. }
  3231. public void TJSFuncIsPrivateModeNightTalkEnabled(TJSVariantRef[] tjs_param, TJSVariantRef result)
  3232. {
  3233. if (result != null)
  3234. {
  3235. result.SetBool(GameMain.Instance.CMSystem.SConfig.PrivateModeSettingNightTalkEnabled);
  3236. }
  3237. }
  3238. public void TJSFuncIsPrivateModeHEventEnabled(TJSVariantRef[] tjs_param, TJSVariantRef result)
  3239. {
  3240. if (result != null)
  3241. {
  3242. result.SetBool(GameMain.Instance.CMSystem.SConfig.PrivateModeSettingHEventEnabled);
  3243. }
  3244. }
  3245. public void TJSFuncSetPrivateModeMaid(TJSVariantRef[] tjs_param, TJSVariantRef result)
  3246. {
  3247. Maid privateMaid = PrivateModeMgr.Instance.PrivateMaid;
  3248. if (privateMaid == null)
  3249. {
  3250. if (result != null)
  3251. {
  3252. result.SetBool(false);
  3253. }
  3254. return;
  3255. }
  3256. int f_nActiveSlotNo = 0;
  3257. if (tjs_param.Length > 0)
  3258. {
  3259. f_nActiveSlotNo = tjs_param[0].AsInteger();
  3260. }
  3261. GameMain.Instance.CharacterMgr.SetActiveMaid(privateMaid, f_nActiveSlotNo);
  3262. privateMaid.Visible = true;
  3263. if (result != null)
  3264. {
  3265. result.SetBool(true);
  3266. }
  3267. }
  3268. public void TJSFuncSetLockNTRPlay(TJSVariantRef[] tjs_param, TJSVariantRef result)
  3269. {
  3270. NDebug.Assert(tjs_param.Length == 1, "SetLockNTRPlay:引数が1つ必要です");
  3271. GameMain.Instance.CharacterMgr.status.lockNTRPlay = tjs_param[0].AsBool();
  3272. }
  3273. public void TJSFuncIsEnabeldAdditionalRelation(TJSVariantRef[] tjs_param, TJSVariantRef result)
  3274. {
  3275. if (result == null)
  3276. {
  3277. return;
  3278. }
  3279. result.SetBool(Product.enabeldAdditionalRelation);
  3280. }
  3281. public void TJSFuncHireScoutMaid(TJSVariantRef[] tjs_param, TJSVariantRef result)
  3282. {
  3283. if (GameMain.Instance.CharacterMgr.GetMaid(0) == null)
  3284. {
  3285. return;
  3286. }
  3287. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(0);
  3288. ScoutManager.Instance.HireScoutMaid(maid);
  3289. }
  3290. public void TJSFuncSuspendedScout(TJSVariantRef[] tjs_param, TJSVariantRef result)
  3291. {
  3292. if (GameMain.Instance.CharacterMgr.GetMaid(0) == null)
  3293. {
  3294. return;
  3295. }
  3296. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(0);
  3297. ScoutManager.Instance.SuspendedScout(maid);
  3298. }
  3299. public void TJSFuncCancelScout(TJSVariantRef[] tjs_param, TJSVariantRef result)
  3300. {
  3301. if (GameMain.Instance.CharacterMgr.GetMaid(0) == null)
  3302. {
  3303. return;
  3304. }
  3305. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(0);
  3306. ScoutManager.Instance.CancelScout(maid);
  3307. }
  3308. public void TJSFuncGetRemainingDanceTime(TJSVariantRef[] tjs_param, TJSVariantRef result)
  3309. {
  3310. if (result == null)
  3311. {
  3312. NDebug.Assert("error GetRemainingDanceTime", false);
  3313. }
  3314. float num;
  3315. if (RhythmAction_Mgr.Instance != null)
  3316. {
  3317. num = RhythmAction_Mgr.Instance.RemainingTime;
  3318. }
  3319. else
  3320. {
  3321. string message = "リズムアクションマネージャのインスタンスが見つかりません。-1を返します。";
  3322. Debug.LogWarning(message);
  3323. num = -0.001f;
  3324. }
  3325. result.SetInteger(Mathf.RoundToInt(num * 1000f));
  3326. }
  3327. public void TJSFuncGetYotogiCommandClickCount(TJSVariantRef[] tjs_param, TJSVariantRef result)
  3328. {
  3329. if (result == null)
  3330. {
  3331. NDebug.Assert("error GetYotogiCommandClickCount", false);
  3332. }
  3333. NDebug.Assert(tjs_param.Length == 2, "GetYotogiCommandClickCount:引数が2つ必要です");
  3334. string text = tjs_param[0].AsString();
  3335. bool flag = tjs_param[1].AsBool();
  3336. result.SetInteger(0);
  3337. if (YotogiManager.instans == null || YotogiManager.instans.play_mgr == null || string.IsNullOrEmpty(text))
  3338. {
  3339. return;
  3340. }
  3341. Dictionary<string, int> dictionary = (!flag) ? YotogiManager.instans.play_mgr.commandClickCountSingle : YotogiManager.instans.play_mgr.commandClickCountTotal;
  3342. int integer = 0;
  3343. dictionary.TryGetValue(text, out integer);
  3344. result.SetInteger(integer);
  3345. }
  3346. public void TJSFuncSetYotogiStage(TJSVariantRef[] tjs_param, TJSVariantRef result)
  3347. {
  3348. NDebug.Assert(1 <= tjs_param.Length && tjs_param.Length <= 2, "SetYotogiStage:引数が1つ,もしくは2つである必要があります");
  3349. YotogiStage.Data data = YotogiStage.GetData(tjs_param[0].AsString());
  3350. bool isDayTime = GameMain.Instance.CharacterMgr.status.isDaytime;
  3351. if (tjs_param.Length == 2)
  3352. {
  3353. isDayTime = tjs_param[1].AsBool();
  3354. }
  3355. YotogiStageSelectManager.SelectStage(data, isDayTime);
  3356. }
  3357. public void TJSFuncIsCRCBody(TJSVariantRef[] tjs_param, TJSVariantRef result)
  3358. {
  3359. NDebug.Assert(tjs_param.Length == 2, "IsCRCBody:引数が2つである必要があります");
  3360. string text = tjs_param[0].AsString();
  3361. int num = tjs_param[1].AsInteger();
  3362. if (text != null)
  3363. {
  3364. if (text == "man")
  3365. {
  3366. Maid man = GameMain.Instance.CharacterMgr.GetMan(num);
  3367. result.SetBool(man != null && man.body0.IsCrcBody);
  3368. return;
  3369. }
  3370. if (text == "maid")
  3371. {
  3372. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(num);
  3373. result.SetBool(maid != null && maid.body0.IsCrcBody);
  3374. return;
  3375. }
  3376. }
  3377. NDebug.Assert("IsCRCBody:キャラの指定が不正です:" + text, false);
  3378. result.SetBool(false);
  3379. }
  3380. public void OnReturnEvent(string fileName, int line)
  3381. {
  3382. if (this.compatibilityMode)
  3383. {
  3384. KagScript kag = this.adv_kag.kag;
  3385. int num = kag.callStackDepth - 1;
  3386. int r_callStackDepth = kag.r_callStackDepth;
  3387. if (this.compatibilityCallStackDepth == num && this.compatibilityRCallStackDepth == r_callStackDepth)
  3388. {
  3389. this.compatibilityMode = false;
  3390. }
  3391. }
  3392. }
  3393. public void OnRReturnEvent(string fileName, string labelName)
  3394. {
  3395. if (this.compatibilityMode)
  3396. {
  3397. KagScript kag = this.adv_kag.kag;
  3398. int callStackDepth = kag.callStackDepth;
  3399. int num = kag.r_callStackDepth - 1;
  3400. if (this.compatibilityCallStackDepth == callStackDepth && this.compatibilityRCallStackDepth == num)
  3401. {
  3402. this.compatibilityMode = false;
  3403. }
  3404. }
  3405. }
  3406. public void Dispose()
  3407. {
  3408. this.Dispose(true);
  3409. GC.SuppressFinalize(this);
  3410. }
  3411. protected void Dispose(bool is_release_managed_code)
  3412. {
  3413. if (this.is_disposed_)
  3414. {
  3415. return;
  3416. }
  3417. foreach (KeyValuePair<int, MotionKagManager> keyValuePair in this.kag_mot_dic_)
  3418. {
  3419. keyValuePair.Value.Dispose();
  3420. }
  3421. this.kag_mot_dic_.Clear();
  3422. if (this.adv_kag_ != null)
  3423. {
  3424. this.adv_kag_.Dispose();
  3425. }
  3426. if (this.yotogi_kag_ != null)
  3427. {
  3428. this.yotogi_kag_.Dispose();
  3429. }
  3430. if (this.privatemode_touch_kag != null)
  3431. {
  3432. this.privatemode_touch_kag.Dispose();
  3433. }
  3434. if (this.tmp_kag_ != null)
  3435. {
  3436. this.tmp_kag_.Dispose();
  3437. }
  3438. if (this.tjs_ != null)
  3439. {
  3440. this.tjs_.Dispose();
  3441. }
  3442. this.is_disposed_ = true;
  3443. }
  3444. public void Serialize(BinaryWriter binary)
  3445. {
  3446. binary.Write("CM3D2_SCRIPT");
  3447. binary.Write(1570);
  3448. this.adv_kag_.Serialize(binary);
  3449. }
  3450. public void Deserialize(BinaryReader binary)
  3451. {
  3452. this.compatibilityMode = false;
  3453. string a = binary.ReadString();
  3454. NDebug.Assert(a == "CM3D2_SCRIPT", "SCRIPTのヘッダーが不正です。");
  3455. int num = binary.ReadInt32();
  3456. this.adv_kag_.Deserialize(binary);
  3457. this.yotogi_kag_.Dispose();
  3458. this.yotogi_kag_ = new YotogiKagManager(this.tjs_, this);
  3459. this.yotogi_kag_.Initialize();
  3460. this.privatemode_touch_kag.Dispose();
  3461. this.privatemode_touch_kag = new PrivateMaidTouchKagManager(this.tjs_, this);
  3462. this.privatemode_touch_kag.Initialize();
  3463. foreach (KeyValuePair<int, MotionKagManager> keyValuePair in this.kag_mot_dic_)
  3464. {
  3465. keyValuePair.Value.Dispose();
  3466. }
  3467. this.kag_mot_dic_.Clear();
  3468. MotionKagManager motionKagManager = new MotionKagManager(this.tjs_, this);
  3469. motionKagManager.Initialize();
  3470. motionKagManager.SetSloatNo(0);
  3471. this.kag_mot_dic_.Add(0, motionKagManager);
  3472. this.ExecScript("global.tf = new Dictionary();");
  3473. SubtitleMovieManager.DestroyGlobalInstance();
  3474. }
  3475. public bool compatibilityMode
  3476. {
  3477. get
  3478. {
  3479. return this.compatibilityMode_;
  3480. }
  3481. set
  3482. {
  3483. this.compatibilityMode_ = value;
  3484. if (this.adv_kag_ != null && this.adv_kag_.kag != null)
  3485. {
  3486. this.adv_kag_.kag.SetFileSystem(this.file_system);
  3487. }
  3488. foreach (KeyValuePair<int, MotionKagManager> keyValuePair in this.kag_mot_dic_)
  3489. {
  3490. keyValuePair.Value.kag.SetFileSystem(this.file_system);
  3491. }
  3492. if (this.yotogi_kag_ != null && this.yotogi_kag_.kag != null)
  3493. {
  3494. this.yotogi_kag_.kag.SetFileSystem(this.file_system);
  3495. }
  3496. if (GameMain.Instance.SoundMgr != null)
  3497. {
  3498. GameMain.Instance.SoundMgr.compatibilityMode = value;
  3499. }
  3500. this.StopMotionScript();
  3501. }
  3502. }
  3503. public bool tjsLegacyMode
  3504. {
  3505. get
  3506. {
  3507. return DailyMgr.IsLegacy;
  3508. }
  3509. }
  3510. public bool is_motion_all_prop_seq { get; set; }
  3511. public Maid motion_all_prop_seq_maid { get; set; }
  3512. public bool is_motion_blend { get; set; }
  3513. public TJSScript tjs
  3514. {
  3515. get
  3516. {
  3517. return this.tjs_;
  3518. }
  3519. }
  3520. public ADVKagManager adv_kag
  3521. {
  3522. get
  3523. {
  3524. return this.adv_kag_;
  3525. }
  3526. }
  3527. public YotogiKagManager yotogi_kag
  3528. {
  3529. get
  3530. {
  3531. return this.yotogi_kag_;
  3532. }
  3533. }
  3534. public BaseKagManager tmp_kag
  3535. {
  3536. get
  3537. {
  3538. return this.tmp_kag_;
  3539. }
  3540. }
  3541. public PrivateMaidTouchKagManager privatemode_touch_kag { get; private set; }
  3542. public Dictionary<int, MotionKagManager> kag_mot_dic
  3543. {
  3544. get
  3545. {
  3546. return this.kag_mot_dic_;
  3547. }
  3548. }
  3549. public AFileSystemBase file_system
  3550. {
  3551. get
  3552. {
  3553. return (!this.compatibilityMode) ? GameUty.FileSystem : GameUty.FileSystemOld;
  3554. }
  3555. }
  3556. private int asyncCheckPrevFrame = -1;
  3557. private string asyncCheckPrevFileName;
  3558. private int asyncCheckPrevFileLine;
  3559. private TJSScript tjs_;
  3560. private Dictionary<int, MotionKagManager> kag_mot_dic_ = new Dictionary<int, MotionKagManager>();
  3561. private ADVKagManager adv_kag_;
  3562. private YotogiKagManager yotogi_kag_;
  3563. private BaseKagManager tmp_kag_;
  3564. private MessageWindowMgr message_mgr_;
  3565. private bool is_disposed_;
  3566. private string debug_yotogi_stage_;
  3567. private bool compatibilityMode_;
  3568. private List<Maid> stock_maid_loop_list = new List<Maid>();
  3569. private int compatibilityCallStackDepth;
  3570. private int compatibilityRCallStackDepth;
  3571. [CompilerGenerated]
  3572. private static Comparison<Maid> <>f__mg$cache0;
  3573. }