ScriptManager.cs 111 KB

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