YotogiManager.cs 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using MaidExtension;
  5. using MaidStatus;
  6. using MaidStatus.CsvData;
  7. using Schedule;
  8. using UnityEngine;
  9. using wf;
  10. using Yotogis;
  11. public class YotogiManager : WfScreenManager
  12. {
  13. public bool uiVisible
  14. {
  15. get
  16. {
  17. return base.gameObject.transform.parent.GetComponent<UIPanel>().alpha != 0f;
  18. }
  19. set
  20. {
  21. base.gameObject.transform.parent.GetComponent<UIPanel>().alpha = (float)((!value) ? 0 : 1);
  22. }
  23. }
  24. public bool messageWindowVisible
  25. {
  26. set
  27. {
  28. GameObject gameObject = GameObject.Find("SystemUI Root/Manager_SystemUI/MessageWindowMgr");
  29. if (gameObject != null)
  30. {
  31. MessageWindowMgr component = gameObject.GetComponent<MessageWindowMgr>();
  32. if (component != null)
  33. {
  34. if (value)
  35. {
  36. component.OpenMessageWindowPanel();
  37. }
  38. else
  39. {
  40. component.CloseMessageWindowPanel();
  41. }
  42. }
  43. }
  44. }
  45. }
  46. public void Awake()
  47. {
  48. YotogiStage.CreateData();
  49. YotogiManager.instans = this;
  50. this.play_mgr_ = UTY.GetChildObject(base.gameObject, "YotogiPlayManager", false).GetComponent<YotogiPlayManager>();
  51. this.skill_select_mgr_ = UTY.GetChildObject(base.gameObject, "SkillSelectManager", false).GetComponent<YotogiSkillSelectManager>();
  52. this.result_mgr_ = UTY.GetChildObject(base.gameObject, "YotogiResultManager", false).GetComponent<YotogiResultManager>();
  53. this.free_skill_select_mgr_ = UTY.GetChildObject(base.gameObject, "YotogiFreeSkillSelectManager", false).GetComponent<YotogiFreeSkillSelectManager>();
  54. this.stage_select_mgr_ = UTY.GetChildObject(base.gameObject, "YotogiStageSelectManager", false).GetComponent<YotogiStageSelectManager>();
  55. this.sub_chara_select_mgr_ = UTY.GetChildObject(base.gameObject, "SubCharacterSelectManager", false).GetComponent<YotogiSubCharacterSelectManager>();
  56. this.null_mgr_ = UTY.GetChildObject(base.gameObject, "YotogiNullManager", false).GetComponent<YotogiNullManager>();
  57. for (int i = 0; i < this.play_skill_array_.Length; i++)
  58. {
  59. this.play_skill_array_[i] = new YotogiManager.PlayingSkillData();
  60. }
  61. this.addTagNames.Clear();
  62. this.adv_kag_ = GameMain.Instance.ScriptMgr.adv_kag;
  63. this.yotogi_kag_ = GameMain.Instance.ScriptMgr.yotogi_kag;
  64. Action<string, KagScript.KagTagCallBack> action = delegate(string tagName, KagScript.KagTagCallBack callback)
  65. {
  66. this.addTagNames.Add(tagName);
  67. this.adv_kag_.kag.AddTagCallBack(tagName, callback);
  68. };
  69. action("yotogicall", new KagScript.KagTagCallBack(this.TagYotogiCall));
  70. action("returnsuspend", new KagScript.KagTagCallBack(this.TagReturnSuspend));
  71. action("restart", new KagScript.KagTagCallBack(this.TagReStart));
  72. action("playend", new KagScript.KagTagCallBack(this.TagPlayEnd));
  73. action("heroinechangeskill", new KagScript.KagTagCallBack(this.TagHeroineChangeSkill));
  74. this.yotogi_kag_.kag.AddTagCallBack("playbgmroom", new KagScript.KagTagCallBack(this.TagPlayBGMRoom));
  75. this.yotogi_kag_.kag.AddTagCallBack("controlmask", new KagScript.KagTagCallBack(this.TagControlMask));
  76. this.yotogi_kag_.enabled = false;
  77. }
  78. public override void Start()
  79. {
  80. base.Start();
  81. this.maid_ = GameMain.Instance.CharacterMgr.GetMaid(0);
  82. this.backup_status_.skill_id_list = new HashSet<int>();
  83. this.backup_status_.yotogi_class_list = new HashSet<int>();
  84. this.CreateBackUpStatus();
  85. this.CreateBackUpSkillID();
  86. this.CreateBackUpYotogiClass();
  87. GameMain.Instance.ScriptMgr.yotogi_kag.SetYotogiManager(this);
  88. string b = "SceneYotogi";
  89. this.is_new_yotogi_ = false;
  90. this.is_free_mode_ = this.adv_kag_.tag_backup.ContainsKey("free_start");
  91. this.is_vr_mode_ = this.adv_kag_.tag_backup.ContainsKey("vr_mode");
  92. if (GameMain.Instance.VRMode)
  93. {
  94. this.command_menu_ = Utility.CreatePrefab(null, "SceneYotogi/Yotogi/Prefab/VRUI CommandMenu", true).GetComponent<YotogiCommandMenuOVR>();
  95. this.command_menu_.transform.SetParent(base.gameObject.transform, true);
  96. this.command_menu_.visible = false;
  97. }
  98. this.is_script_call_ = false;
  99. if (this.adv_kag_.tag_backup != null && 0 < this.adv_kag_.tag_backup.Count && this.adv_kag_.tag_backup["name"] == b)
  100. {
  101. this.is_script_call_ = true;
  102. NDebug.Assert(this.adv_kag_.tag_backup.ContainsKey("start"), "SceneCallにstartの設定がされていませんでした");
  103. NDebug.Assert(this.adv_kag_.tag_backup.ContainsKey("label"), "SceneCallにlabelの設定がされていませんでした");
  104. string text = this.adv_kag_.tag_backup["start"];
  105. YotogiManager.CallScreenType callScreenType = YotogiManager.CallScreenType.Null;
  106. try
  107. {
  108. callScreenType = (YotogiManager.CallScreenType)Enum.Parse(typeof(YotogiManager.CallScreenType), text);
  109. }
  110. catch
  111. {
  112. NDebug.Assert("[" + text + "]を特定できませんでした", false);
  113. }
  114. this.is_new_yotogi_ = (callScreenType == YotogiManager.CallScreenType.Init);
  115. if ((callScreenType == YotogiManager.CallScreenType.SubCharaSelect || callScreenType == YotogiManager.CallScreenType.FreeSkillSelect) && this.adv_kag_.tag_backup.ContainsKey("cancel_label"))
  116. {
  117. YotogiFreeSkillSelectManager yotogiFreeSkillSelectManager = this.free_skill_select_mgr_;
  118. string cancel_label = this.adv_kag_.tag_backup["cancel_label"];
  119. this.sub_chara_select_mgr_.cancel_label = cancel_label;
  120. yotogiFreeSkillSelectManager.cancel_label = cancel_label;
  121. }
  122. string nextLabel = this.adv_kag_.tag_backup["label"];
  123. this.null_mgr_.SetNextLabel(nextLabel);
  124. if (callScreenType == YotogiManager.CallScreenType.SkillSelect && this.adv_kag_.tag_backup.ContainsKey("edit_label"))
  125. {
  126. this.skill_select_mgr_.SetEditNextLabel(this.adv_kag_.tag_backup["edit_label"]);
  127. }
  128. this.CallScreen(text);
  129. }
  130. else if (this.is_free_mode)
  131. {
  132. this.CallScreen(YotogiManager.CallScreenType.FreeSkillSelect.ToString());
  133. }
  134. else
  135. {
  136. this.CallScreen(YotogiManager.CallScreenType.StageSelect.ToString());
  137. }
  138. }
  139. public override void Update()
  140. {
  141. base.Update();
  142. }
  143. public void OnPreFinalize()
  144. {
  145. this.adv_kag_ = null;
  146. this.yotogi_kag_ = null;
  147. }
  148. public void OnDestroy()
  149. {
  150. YotogiManager.instans = null;
  151. if (this.adv_kag_ != null)
  152. {
  153. if (this.adv_kag_.kag != null)
  154. {
  155. foreach (string tag_name in this.addTagNames)
  156. {
  157. this.adv_kag_.kag.RemoveTagCallBack(tag_name);
  158. }
  159. }
  160. this.adv_kag_ = null;
  161. if (this.yotogi_kag_.kag != null)
  162. {
  163. this.yotogi_kag_.kag.RemoveTagCallBack("playbgmroom");
  164. this.yotogi_kag_.kag.RemoveTagCallBack("controlmask");
  165. }
  166. this.yotogi_kag_ = null;
  167. }
  168. }
  169. public bool TagYotogiCall(KagTagSupport tag_data)
  170. {
  171. this.adv_kag_.CheckAbsolutelyNecessaryTag(tag_data, "yotogicall", new string[]
  172. {
  173. "name",
  174. "label"
  175. });
  176. string text = tag_data.GetTagProperty("name").AsString();
  177. YotogiManager.CallScreenType callScreenType = YotogiManager.CallScreenType.Null;
  178. try
  179. {
  180. callScreenType = (YotogiManager.CallScreenType)Enum.Parse(typeof(YotogiManager.CallScreenType), text);
  181. }
  182. catch
  183. {
  184. NDebug.Assert("@yotogicall : [" + text + "]を特定できませんでした", false);
  185. }
  186. if ((callScreenType == YotogiManager.CallScreenType.SubCharaSelect || callScreenType == YotogiManager.CallScreenType.FreeSkillSelect) && tag_data.IsValid("cancel_label"))
  187. {
  188. YotogiFreeSkillSelectManager yotogiFreeSkillSelectManager = this.free_skill_select_mgr_;
  189. string cancel_label = tag_data.GetTagProperty("cancel_label").AsString();
  190. this.sub_chara_select_mgr_.cancel_label = cancel_label;
  191. yotogiFreeSkillSelectManager.cancel_label = cancel_label;
  192. }
  193. this.null_mgr_.SetNextLabel(tag_data.GetTagProperty("label").AsString());
  194. if (callScreenType == YotogiManager.CallScreenType.SkillSelect && tag_data.IsValid("edit_label"))
  195. {
  196. this.skill_select_mgr_.SetEditNextLabel(tag_data.GetTagProperty("edit_label").AsString());
  197. }
  198. if (callScreenType == YotogiManager.CallScreenType.Play && tag_data.IsValid("skillid"))
  199. {
  200. int num = tag_data.GetTagProperty("skillid").AsInteger();
  201. Skill.Data data = Skill.Get(num);
  202. if (data == null)
  203. {
  204. Debug.LogError("TagReStart Error\nnot find yotogiSkill " + num);
  205. return false;
  206. }
  207. for (int i = 0; i < this.play_skill_array.Length; i++)
  208. {
  209. if (this.play_skill_array[i].skill_pair.base_data == null)
  210. {
  211. YotogiManager.PlayingSkillData playingSkillData = new YotogiManager.PlayingSkillData();
  212. playingSkillData.skill_pair = Yotogi.SkillDataPair.Create(this.maid_, data);
  213. playingSkillData.skill_pair.lock_skill_exp = true;
  214. playingSkillData.backup_total_exp = playingSkillData.skill_pair.skill_data.expSystem.GetTotalExp();
  215. this.play_skill_array[i] = playingSkillData;
  216. break;
  217. }
  218. }
  219. }
  220. this.CallScreen(text);
  221. return false;
  222. }
  223. public bool TagReturnSuspend(KagTagSupport tag_data)
  224. {
  225. if (this.play_mgr != null)
  226. {
  227. this.play_mgr.ReturnSuspend();
  228. }
  229. return false;
  230. }
  231. public bool TagReStart(KagTagSupport tag_data)
  232. {
  233. this.adv_kag_.CheckAbsolutelyNecessaryTag(tag_data, "restart", new string[]
  234. {
  235. "skillid"
  236. });
  237. if (tag_data.IsValid("label"))
  238. {
  239. string text = tag_data.GetTagProperty("label").AsString();
  240. if (!string.IsNullOrEmpty(text))
  241. {
  242. this.null_mgr.SetNextLabel(text);
  243. }
  244. }
  245. int num = tag_data.GetTagProperty("skillid").AsInteger();
  246. Skill.Data data = Skill.Get(num);
  247. if (data == null)
  248. {
  249. Debug.LogError("TagReStart Error\nnot find yotogiSkill " + num);
  250. return false;
  251. }
  252. for (int i = 0; i < this.play_skill_array.Length; i++)
  253. {
  254. if (this.play_skill_array[i].skill_pair.base_data == null)
  255. {
  256. YotogiManager.PlayingSkillData playingSkillData = new YotogiManager.PlayingSkillData();
  257. playingSkillData.skill_pair = Yotogi.SkillDataPair.Create(this.maid_, data);
  258. playingSkillData.skill_pair.lock_skill_exp = true;
  259. playingSkillData.backup_total_exp = playingSkillData.skill_pair.skill_data.expSystem.GetTotalExp();
  260. this.play_skill_array[i] = playingSkillData;
  261. break;
  262. }
  263. }
  264. this.play_mgr_.ReStart();
  265. return false;
  266. }
  267. public bool TagPlayEnd(KagTagSupport tag_data)
  268. {
  269. if (tag_data.IsValid("label"))
  270. {
  271. string text = tag_data.GetTagProperty("label").AsString();
  272. if (!string.IsNullOrEmpty(text))
  273. {
  274. this.null_mgr.SetNextLabel(text);
  275. }
  276. }
  277. if (string.IsNullOrEmpty(this.null_mgr.nextLabel))
  278. {
  279. return false;
  280. }
  281. this.play_mgr_.SetFadeTime(0f);
  282. this.play_mgr_.AdvanceSkillMove();
  283. this.maid_.status.currentMind = this.maid_.status.maxMind;
  284. return false;
  285. }
  286. public bool TagHeroineChangeSkill(KagTagSupport tag_data)
  287. {
  288. this.play_mgr_.heroineChangeFlag = true;
  289. return false;
  290. }
  291. public bool TagPlayBGMRoom(KagTagSupport tag_data)
  292. {
  293. List<YotogiStage.Data> allDatas = YotogiStage.GetAllDatas(false);
  294. YotogiStage.Data data = null;
  295. foreach (YotogiStage.Data data2 in allDatas)
  296. {
  297. if (YotogiStageSelectManager.SelectedStage == data2)
  298. {
  299. data = data2;
  300. break;
  301. }
  302. }
  303. if (data == null)
  304. {
  305. Debug.LogError("@playbgmroomエラー prefab名[" + YotogiStageSelectManager.SelectedStage.drawName + "]から背景データを特定できませんでした");
  306. return false;
  307. }
  308. int millisecond = 0;
  309. if (tag_data.IsValid("fade"))
  310. {
  311. millisecond = tag_data.GetTagProperty("fade").AsInteger();
  312. }
  313. GameMain.Instance.SoundMgr.PlayBGM(data.bgmFileName, GameUty.MillisecondToSecond(millisecond), true);
  314. return false;
  315. }
  316. public bool TagControlMask(KagTagSupport tag_data)
  317. {
  318. if (base.cur_call_screen_name == "Play" && this.play_mgr_ != null)
  319. {
  320. this.play_mgr_.SetControlMask(true, false);
  321. }
  322. return false;
  323. }
  324. protected override void SettingChildrenList(Dictionary<string, WfScreenChildren> children_dic)
  325. {
  326. children_dic.Add(YotogiManager.CallScreenType.SkillSelect.ToString(), this.skill_select_mgr_);
  327. children_dic.Add(YotogiManager.CallScreenType.Result.ToString(), this.result_mgr_);
  328. children_dic.Add(YotogiManager.CallScreenType.FreeSkillSelect.ToString(), this.free_skill_select_mgr_);
  329. children_dic.Add(YotogiManager.CallScreenType.StageSelect.ToString(), this.stage_select_mgr_);
  330. children_dic.Add(YotogiManager.CallScreenType.Init.ToString(), this.stage_select_mgr_);
  331. children_dic.Add(YotogiManager.CallScreenType.Play.ToString(), this.play_mgr_);
  332. children_dic.Add(YotogiManager.CallScreenType.SubCharaSelect.ToString(), this.sub_chara_select_mgr_);
  333. children_dic.Add(YotogiManager.CallScreenType.Null.ToString(), this.null_mgr_);
  334. }
  335. public void CreateBackUpStatus()
  336. {
  337. if (this.maid_ == null)
  338. {
  339. return;
  340. }
  341. this.backup_status_.param = YotogiPlay.Param.Create(this.maid_);
  342. this.backup_status_.propensity = new HashSet<int>(this.maid_.status.propensitys.GetKeyArray());
  343. }
  344. public void CreateBackUpSkillID()
  345. {
  346. if (this.maid_ == null)
  347. {
  348. return;
  349. }
  350. this.backup_status_.skill_id_list = new HashSet<int>(this.maid_.status.yotogiSkill.datas.GetKeyArray());
  351. }
  352. public void CreateBackUpYotogiClass()
  353. {
  354. this.backup_status_.yotogi_class_list = new HashSet<int>(this.maid_.status.yotogiClass.datas.GetKeyArray());
  355. }
  356. public void SetPlaySkillArray(KeyValuePair<Skill.Data, bool>[] skill_array)
  357. {
  358. this.play_skill_array_ = new YotogiManager.PlayingSkillData[7];
  359. for (int i = 0; i < this.play_skill_array_.Length; i++)
  360. {
  361. this.play_skill_array_[i] = new YotogiManager.PlayingSkillData();
  362. this.play_skill_array_[i].exp = 0;
  363. this.play_skill_array_[i].backup_total_exp = 0;
  364. this.play_skill_array_[i].is_play = false;
  365. if (i < skill_array.Length)
  366. {
  367. Skill.Data key = skill_array[i].Key;
  368. bool value = skill_array[i].Value;
  369. if (this.is_free_mode || this.is_vr_mode)
  370. {
  371. this.play_skill_array_[i].skill_pair = Yotogi.SkillDataPair.CreateBaseDataOnly(this.maid_, key);
  372. }
  373. else
  374. {
  375. this.play_skill_array_[i].skill_pair = Yotogi.SkillDataPair.Create(this.maid_, key);
  376. this.play_skill_array_[i].skill_pair.lock_skill_exp = value;
  377. this.play_skill_array_[i].backup_total_exp = this.play_skill_array_[i].skill_pair.skill_data.expSystem.GetTotalExp();
  378. }
  379. }
  380. else
  381. {
  382. this.play_skill_array_[i].skill_pair.base_data = null;
  383. }
  384. }
  385. }
  386. public void AddPlaySkill(Skill.Data skillData)
  387. {
  388. YotogiManager.PlayingSkillData[] array = this.play_skill_array_;
  389. this.play_skill_array_ = new YotogiManager.PlayingSkillData[this.play_skill_array_.Length + 1];
  390. for (int i = 0; i < array.Length; i++)
  391. {
  392. this.play_skill_array_[i] = array[i];
  393. }
  394. YotogiManager.PlayingSkillData playingSkillData = new YotogiManager.PlayingSkillData();
  395. playingSkillData.exp = 0;
  396. playingSkillData.backup_total_exp = 0;
  397. playingSkillData.is_play = false;
  398. playingSkillData.skill_pair = Yotogi.SkillDataPair.Create(this.maid_, skillData);
  399. playingSkillData.skill_pair.lock_skill_exp = true;
  400. playingSkillData.backup_total_exp = playingSkillData.skill_pair.skill_data.expSystem.GetTotalExp();
  401. this.play_skill_array_[this.play_skill_array_.Length - 1] = playingSkillData;
  402. }
  403. public bool IsAllCharaBusy()
  404. {
  405. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  406. for (int i = 0; i < characterMgr.GetMaidCount(); i++)
  407. {
  408. Maid maid = characterMgr.GetMaid(i);
  409. if (maid != null && maid.Visible && maid.IsBusy)
  410. {
  411. return true;
  412. }
  413. }
  414. for (int j = 0; j < characterMgr.GetManCount(); j++)
  415. {
  416. Maid man = characterMgr.GetMan(j);
  417. if (man != null && man.Visible && man.IsBusy)
  418. {
  419. return true;
  420. }
  421. }
  422. return false;
  423. }
  424. public void ResetWorld()
  425. {
  426. GameMain.Instance.BgMgr.DelPrefabFromBgAll();
  427. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  428. for (int i = 0; i < characterMgr.GetStockMaidCount(); i++)
  429. {
  430. Maid stockMaid = characterMgr.GetStockMaid(i);
  431. if (stockMaid != null && stockMaid.body0 != null && stockMaid.body0.isLoadedBody)
  432. {
  433. stockMaid.body0.MuneYureL(1f);
  434. stockMaid.body0.MuneYureR(1f);
  435. stockMaid.fullBodyIK.AllIKDetach(0f);
  436. if (stockMaid.body0.IsCrcBody)
  437. {
  438. stockMaid.body0.KupaReset();
  439. }
  440. TBodySkin tbodySkin = stockMaid.body0.goSlot[0];
  441. if (tbodySkin != null && tbodySkin.kupaCtrl != null)
  442. {
  443. tbodySkin.kupaCtrl.ResetAll();
  444. }
  445. }
  446. }
  447. for (int j = 0; j < characterMgr.GetStockManCount(); j++)
  448. {
  449. Maid stockMan = characterMgr.GetStockMan(j);
  450. if (stockMan != null && stockMan.body0 != null && stockMan.body0.isLoadedBody)
  451. {
  452. stockMan.fullBodyIK.AllIKDetach(0f);
  453. TBodySkin tbodySkin2 = stockMan.body0.goSlot[0];
  454. if (tbodySkin2 != null && tbodySkin2.kupaCtrl != null)
  455. {
  456. tbodySkin2.kupaCtrl.ResetAll();
  457. }
  458. Maid pairMan = stockMan.pairMan;
  459. if (pairMan && pairMan.IsCrcBody && pairMan.body0.isLoadedBody && pairMan.Visible)
  460. {
  461. pairMan.fullBodyIK.AllIKDetach(0f);
  462. tbodySkin2 = pairMan.body0.goSlot[0];
  463. if (tbodySkin2 != null && tbodySkin2.kupaCtrl != null)
  464. {
  465. tbodySkin2.kupaCtrl.ResetAll();
  466. }
  467. }
  468. }
  469. }
  470. string[] array = new string[]
  471. {
  472. "handitem",
  473. "kousoku_upper",
  474. "kousoku_lower",
  475. "acchead",
  476. "megane",
  477. "skirt",
  478. "panz",
  479. "mizugi",
  480. "onepiece",
  481. "accanl",
  482. "accvag",
  483. "KubiScl",
  484. "UdeScl",
  485. "DouPer",
  486. "sintyou",
  487. "kata"
  488. };
  489. for (int k = 0; k < characterMgr.GetMaidCount(); k++)
  490. {
  491. Maid maid = characterMgr.GetMaid(k);
  492. if (maid != null && maid.Visible)
  493. {
  494. maid.FaceAnime("通常", 0f, 0);
  495. maid.FaceBlend("無し");
  496. maid.OpenMouth(false);
  497. maid.DelPrefabAll();
  498. for (int l = 0; l < array.Length; l++)
  499. {
  500. maid.ResetProp(array[l], true);
  501. }
  502. MaidCostumeChangeController maidCostumeChangeController = new MaidCostumeChangeController(maid);
  503. IEnumerator enumerator = Enum.GetValues(typeof(MaidCostumeChangeController.CostumeType)).GetEnumerator();
  504. try
  505. {
  506. while (enumerator.MoveNext())
  507. {
  508. object obj = enumerator.Current;
  509. MaidCostumeChangeController.CostumeType costumeType = (MaidCostumeChangeController.CostumeType)obj;
  510. if (costumeType != MaidCostumeChangeController.CostumeType.Hadake)
  511. {
  512. maidCostumeChangeController.SetEnabledCostumeType(costumeType, false, null);
  513. }
  514. }
  515. }
  516. finally
  517. {
  518. IDisposable disposable;
  519. if ((disposable = (enumerator as IDisposable)) != null)
  520. {
  521. disposable.Dispose();
  522. }
  523. }
  524. maid.mekureController.Reset(null);
  525. maid.AllProcPropSeqStart();
  526. }
  527. }
  528. for (int m = 0; m < characterMgr.GetManCount(); m++)
  529. {
  530. Maid man = characterMgr.GetMan(m);
  531. if (man != null && man.Visible)
  532. {
  533. man.DelPrefabAll();
  534. for (int n = 0; n < array.Length; n++)
  535. {
  536. man.ResetProp(array[n], false);
  537. }
  538. man.AllProcPropSeqStart();
  539. }
  540. }
  541. }
  542. public void UnVisibleMaidAndMan(bool maid_unvisible, bool man_unvisible)
  543. {
  544. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  545. if (man_unvisible)
  546. {
  547. for (int i = 0; i < characterMgr.GetManCount(); i++)
  548. {
  549. Maid man = characterMgr.GetMan(i);
  550. if (man != null)
  551. {
  552. man.Visible = false;
  553. }
  554. }
  555. }
  556. if (maid_unvisible)
  557. {
  558. for (int j = 0; j < characterMgr.GetMaidCount(); j++)
  559. {
  560. Maid maid = characterMgr.GetMaid(j);
  561. if (maid != null)
  562. {
  563. maid.Visible = false;
  564. }
  565. }
  566. }
  567. }
  568. public void ApplyStatus()
  569. {
  570. int exp = 0;
  571. for (int i = 0; i < this.play_skill_array.Length; i++)
  572. {
  573. Skill.Data base_data = this.play_skill_array[i].skill_pair.base_data;
  574. if (base_data != null)
  575. {
  576. if (this.play_skill_array[i].is_play && this.maid_.status.yotogiSkill.datas.ContainsKey(base_data.id))
  577. {
  578. YotogiSkillData yotogiSkillData = this.maid_.status.yotogiSkill.Get(base_data.id);
  579. yotogiSkillData.playCount += 1U;
  580. yotogiSkillData.expSystem.AddExp(this.play_skill_array[i].exp);
  581. string flagName = "夜伽_カテゴリー_実行回数_" + base_data.category.ToString();
  582. int flag = this.maid_.status.GetFlag(flagName);
  583. this.maid_.status.SetFlag(flagName, flag + 1);
  584. }
  585. this.play_skill_array[i].exp = 0;
  586. }
  587. }
  588. this.maid_.status.playCountYotogi++;
  589. if (!this.maid_.status.enabledYotogiStatusLock)
  590. {
  591. this.maid_.status.selectedYotogiClass.expSystem.AddExp(exp);
  592. this.maid_.status.studyRate += -50;
  593. }
  594. List<YotogiClass.Data> learnPossibleClassDatas = this.maid.status.yotogiClass.GetLearnPossibleClassDatas(true, AbstractClassData.ClassType.Share | AbstractClassData.ClassType.New);
  595. foreach (YotogiClass.Data data in learnPossibleClassDatas)
  596. {
  597. this.maid.status.yotogiClass.Add(data, true, true);
  598. }
  599. this.maid.status.UpdateClassBonusStatus();
  600. List<Skill.Data> learnPossibleSkills = Skill.GetLearnPossibleSkills(this.maid_.status);
  601. foreach (Skill.Data data2 in learnPossibleSkills)
  602. {
  603. this.maid_.status.yotogiSkill.Add(data2.id);
  604. }
  605. foreach (int id in this.acquired_propensityid_list)
  606. {
  607. Propensity.Data data3 = Propensity.GetData(id);
  608. this.maid_.status.AddPropensity(data3);
  609. }
  610. }
  611. public void SetRepeatVoiceFile(string file_name, int maid_no)
  612. {
  613. this.play_mgr_.SetRepeatVoiceFile(file_name, maid_no);
  614. }
  615. public void AddRepeatVoiceFile(string file_name, int maid_no)
  616. {
  617. this.play_mgr_.AddRepeatVoiceFile(file_name, maid_no);
  618. }
  619. public void OnChangeSeikeiken()
  620. {
  621. }
  622. public void DebugOnClickCallStageSelect()
  623. {
  624. this.null_mgr_.SetNextLabel(string.Empty);
  625. this.CallScreen(YotogiManager.CallScreenType.StageSelect.ToString());
  626. }
  627. public void DebugOnClickCallSkillSelect()
  628. {
  629. this.null_mgr_.SetNextLabel(string.Empty);
  630. this.CreateBackUpStatus();
  631. this.CallScreen(YotogiManager.CallScreenType.SkillSelect.ToString());
  632. }
  633. public void DebugOnClickCallPlay()
  634. {
  635. this.null_mgr_.SetNextLabel(string.Empty);
  636. this.CallScreen(YotogiManager.CallScreenType.Play.ToString());
  637. }
  638. public void DebugOnClickCallResult()
  639. {
  640. this.null_mgr_.SetNextLabel(string.Empty);
  641. this.CallScreen(YotogiManager.CallScreenType.Result.ToString());
  642. }
  643. public void DebugOnClickCallCharaSelect()
  644. {
  645. this.null_mgr_.SetNextLabel(string.Empty);
  646. this.CallScreen(YotogiManager.CallScreenType.SubCharaSelect.ToString());
  647. }
  648. public void DebugOnClickNewScene()
  649. {
  650. this.CallScreen(YotogiManager.CallScreenType.FreeSkillSelect.ToString());
  651. }
  652. public bool IsCallShouldSubCharaSelect()
  653. {
  654. List<int> list = new List<int>();
  655. HashSet<int> hashSet = new HashSet<int>();
  656. if (this.is_free_mode)
  657. {
  658. int[] keyArray = this.maid.status.yotogiSkill.datas.GetKeyArray();
  659. for (int i = 0; i < keyArray.Length; i++)
  660. {
  661. Skill.Data data = Skill.Get(keyArray[i]);
  662. if (data.specialConditionType != Skill.Data.SpecialConditionType.NewType && data.specialConditionType != Skill.Data.SpecialConditionType.GP01Recollect && data.specialConditionType != Skill.Data.SpecialConditionType.GP02Recollect && data.specialConditionType != Skill.Data.SpecialConditionType.OnlyRecollect)
  663. {
  664. if (!hashSet.Contains(data.player_num))
  665. {
  666. hashSet.Add(data.player_num);
  667. list.Add(data.player_num);
  668. }
  669. }
  670. }
  671. }
  672. else
  673. {
  674. if (this.play_skill_array == null)
  675. {
  676. return false;
  677. }
  678. for (int j = 0; j < this.play_skill_array.Length; j++)
  679. {
  680. if (this.play_skill_array[j] != null && this.play_skill_array[j].skill_pair.base_data != null)
  681. {
  682. if (!hashSet.Contains(this.play_skill_array[j].skill_pair.base_data.player_num))
  683. {
  684. hashSet.Add(this.play_skill_array[j].skill_pair.base_data.player_num);
  685. list.Add(this.play_skill_array[j].skill_pair.base_data.player_num);
  686. }
  687. }
  688. }
  689. }
  690. list.Sort();
  691. int playPossibleMaidCount = this.GetPlayPossibleMaidCount();
  692. int num = 0;
  693. for (int k = 0; k < list.Count; k++)
  694. {
  695. if (list[k] <= playPossibleMaidCount)
  696. {
  697. num = list[k];
  698. }
  699. }
  700. return 1 < num;
  701. }
  702. public bool inputCBLUpKey
  703. {
  704. get
  705. {
  706. return false;
  707. }
  708. }
  709. public bool inputCBLDownKey
  710. {
  711. get
  712. {
  713. return false;
  714. }
  715. }
  716. public bool inputCBLRightKey
  717. {
  718. get
  719. {
  720. return false;
  721. }
  722. }
  723. public bool inputCBLLeftKey
  724. {
  725. get
  726. {
  727. return false;
  728. }
  729. }
  730. public bool inputCBLEnterKey
  731. {
  732. get
  733. {
  734. return false;
  735. }
  736. }
  737. public bool inputCBLCancelKey
  738. {
  739. get
  740. {
  741. return false;
  742. }
  743. }
  744. public int GetPlayPossibleMaidCount()
  745. {
  746. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  747. int num = 0;
  748. if (this.is_script_call_ && !this.is_free_mode)
  749. {
  750. List<Maid> list = new List<Maid>();
  751. foreach (Maid maid in ScheduleAPI.GetYotogiMaids(GameMain.Instance.CharacterMgr.status.isDaytime))
  752. {
  753. if (this.maid.IsCrcBody == maid.IsCrcBody)
  754. {
  755. list.Add(maid);
  756. }
  757. }
  758. num = list.Count;
  759. if (num == 0)
  760. {
  761. num = 1;
  762. }
  763. }
  764. else
  765. {
  766. for (int i = 0; i < characterMgr.GetStockMaidCount(); i++)
  767. {
  768. Maid stockMaid = characterMgr.GetStockMaid(i);
  769. if (stockMaid != null && this.maid.status.heroineType != HeroineType.Sub && this.maid.IsCrcBody == stockMaid.IsCrcBody)
  770. {
  771. num++;
  772. }
  773. }
  774. }
  775. return num;
  776. }
  777. public void GetSubMaidList(List<Maid> draw_list)
  778. {
  779. if (draw_list == null)
  780. {
  781. return;
  782. }
  783. List<Maid> list = new List<Maid>();
  784. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  785. if (this.is_script_call_ && !this.is_free_mode)
  786. {
  787. List<Maid> list2 = new List<Maid>();
  788. foreach (Maid maid in ScheduleAPI.GetYotogiMaids(GameMain.Instance.CharacterMgr.status.isDaytime))
  789. {
  790. if (maid != this.maid && this.maid.IsCrcBody == maid.IsCrcBody)
  791. {
  792. list.Add(maid);
  793. }
  794. }
  795. }
  796. else
  797. {
  798. for (int i = 0; i < characterMgr.GetStockMaidCount(); i++)
  799. {
  800. Maid stockMaid = characterMgr.GetStockMaid(i);
  801. if (stockMaid != null && this.maid != stockMaid && stockMaid.status.heroineType != HeroineType.Sub && this.maid.IsCrcBody == stockMaid.IsCrcBody)
  802. {
  803. list.Add(stockMaid);
  804. }
  805. }
  806. }
  807. draw_list.Clear();
  808. draw_list.AddRange(list);
  809. }
  810. public YotogiManager.BackUpStatus GetBackUpStatus()
  811. {
  812. return this.backup_status_;
  813. }
  814. public Maid maid
  815. {
  816. get
  817. {
  818. return this.maid_;
  819. }
  820. }
  821. public int skill_select_max_hp
  822. {
  823. get
  824. {
  825. return this.maid_.status.maxHp;
  826. }
  827. }
  828. public YotogiManager.PlayingSkillData[] play_skill_array
  829. {
  830. get
  831. {
  832. return this.play_skill_array_;
  833. }
  834. }
  835. public YotogiManager.PlayingSkillData playing_skill
  836. {
  837. get
  838. {
  839. return this.play_mgr_.playingSkill;
  840. }
  841. }
  842. public YotogiNullManager null_mgr
  843. {
  844. get
  845. {
  846. return this.null_mgr_;
  847. }
  848. }
  849. public YotogiKagManager yotogi_kag
  850. {
  851. get
  852. {
  853. return this.yotogi_kag_;
  854. }
  855. }
  856. public bool is_free_mode
  857. {
  858. get
  859. {
  860. return this.is_free_mode_;
  861. }
  862. set
  863. {
  864. this.is_free_mode_ = value;
  865. }
  866. }
  867. public bool is_new_yotogi_mode
  868. {
  869. get
  870. {
  871. return this.is_new_yotogi_;
  872. }
  873. }
  874. public int fix_skill_level
  875. {
  876. get
  877. {
  878. return this.fix_skill_level_;
  879. }
  880. set
  881. {
  882. this.fix_skill_level_ = wf.Math.RoundMinMax(value, 0, 3);
  883. }
  884. }
  885. public bool is_vr_mode
  886. {
  887. get
  888. {
  889. return this.is_vr_mode_;
  890. }
  891. }
  892. public YotogiCommandMenuOVR command_menu
  893. {
  894. get
  895. {
  896. return this.command_menu_;
  897. }
  898. }
  899. public GameObject skill_select_prefab_object
  900. {
  901. get
  902. {
  903. return this.free_skill_select_mgr_.skill_select_prefab_object;
  904. }
  905. }
  906. public static YotogiManager instans { get; private set; }
  907. public YotogiPlayManager play_mgr
  908. {
  909. get
  910. {
  911. return this.play_mgr_;
  912. }
  913. }
  914. public static bool isGP001HaremMode
  915. {
  916. get
  917. {
  918. return GameMain.Instance.CMSystem.GetTmpGenericFlag("harem_maidswap") != 0;
  919. }
  920. }
  921. public void AddDebugLog(string text)
  922. {
  923. }
  924. public HashSet<int> acquired_propensityid_list = new HashSet<int>();
  925. private Maid maid_;
  926. private List<Maid> sub_maid_list_ = new List<Maid>();
  927. private ADVKagManager adv_kag_;
  928. private YotogiKagManager yotogi_kag_;
  929. private YotogiNullManager null_mgr_;
  930. private YotogiStageSelectManager stage_select_mgr_;
  931. private YotogiSkillSelectManager skill_select_mgr_;
  932. private YotogiPlayManager play_mgr_;
  933. private YotogiResultManager result_mgr_;
  934. private YotogiSubCharacterSelectManager sub_chara_select_mgr_;
  935. private bool is_script_call_;
  936. private bool is_free_mode_;
  937. private bool is_new_yotogi_;
  938. private int fix_skill_level_;
  939. private YotogiFreeSkillSelectManager free_skill_select_mgr_;
  940. private bool is_vr_mode_;
  941. private YotogiCommandMenuOVR command_menu_;
  942. private YotogiManager.PlayingSkillData[] play_skill_array_ = new YotogiManager.PlayingSkillData[7];
  943. private YotogiManager.BackUpStatus backup_status_ = default(YotogiManager.BackUpStatus);
  944. public HashSet<string> addTagNames = new HashSet<string>();
  945. public enum CallScreenType
  946. {
  947. Null,
  948. Init,
  949. StageSelect,
  950. SkillSelect,
  951. Play,
  952. Result,
  953. SubCharaSelect,
  954. FreeSkillSelect
  955. }
  956. public class PlayingSkillData
  957. {
  958. public Yotogi.SkillDataPair skill_pair = new Yotogi.SkillDataPair();
  959. public int exp;
  960. public int backup_total_exp;
  961. public bool is_play;
  962. }
  963. public struct BackUpStatus
  964. {
  965. public YotogiPlay.Param param;
  966. public HashSet<int> skill_id_list;
  967. public HashSet<int> propensity;
  968. public HashSet<int> yotogi_class_list;
  969. }
  970. }