ScriptManager.cs 106 KB

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