ScriptManager.cs 95 KB

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