ScriptManager.cs 100 KB

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