ScriptManager.cs 105 KB

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