ScriptManager.cs 100 KB

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