ScriptManager.cs 95 KB

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