ScriptManager.cs 109 KB

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