ScriptManager.cs 109 KB

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