YotogiManager.cs 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791
  1. using System;
  2. using System.Collections.Generic;
  3. using MaidStatus;
  4. using MaidStatus.CsvData;
  5. using Schedule;
  6. using UnityEngine;
  7. using wf;
  8. using Yotogis;
  9. public class YotogiManager : WfScreenManager
  10. {
  11. public void Awake()
  12. {
  13. YotogiStage.CreateData();
  14. YotogiManager.instans = this;
  15. this.play_mgr_ = UTY.GetChildObject(base.gameObject, "YotogiPlayManager", false).GetComponent<YotogiPlayManager>();
  16. this.skill_select_mgr_ = UTY.GetChildObject(base.gameObject, "SkillSelectManager", false).GetComponent<YotogiSkillSelectManager>();
  17. this.result_mgr_ = UTY.GetChildObject(base.gameObject, "YotogiResultManager", false).GetComponent<YotogiResultManager>();
  18. this.free_skill_select_mgr_ = UTY.GetChildObject(base.gameObject, "YotogiFreeSkillSelectManager", false).GetComponent<YotogiFreeSkillSelectManager>();
  19. this.stage_select_mgr_ = UTY.GetChildObject(base.gameObject, "YotogiStageSelectManager", false).GetComponent<YotogiStageSelectManager>();
  20. this.sub_chara_select_mgr_ = UTY.GetChildObject(base.gameObject, "SubCharacterSelectManager", false).GetComponent<YotogiSubCharacterSelectManager>();
  21. this.null_mgr_ = UTY.GetChildObject(base.gameObject, "YotogiNullManager", false).GetComponent<YotogiNullManager>();
  22. for (int i = 0; i < this.play_skill_array_.Length; i++)
  23. {
  24. this.play_skill_array_[i] = new YotogiManager.PlayingSkillData();
  25. }
  26. this.adv_kag_ = GameMain.Instance.ScriptMgr.adv_kag;
  27. this.yotogi_kag_ = GameMain.Instance.ScriptMgr.yotogi_kag;
  28. this.adv_kag_.kag.AddTagCallBack("yotogicall", new KagScript.KagTagCallBack(this.TagYotogiCall));
  29. this.yotogi_kag_.kag.AddTagCallBack("playbgmroom", new KagScript.KagTagCallBack(this.TagPlayBGMRoom));
  30. this.yotogi_kag_.kag.AddTagCallBack("controlmask", new KagScript.KagTagCallBack(this.TagControlMask));
  31. this.yotogi_kag_.enabled = false;
  32. }
  33. public override void Start()
  34. {
  35. base.Start();
  36. this.maid_ = GameMain.Instance.CharacterMgr.GetMaid(0);
  37. this.backup_status_.skill_id_list = new HashSet<int>();
  38. this.backup_status_.yotogi_class_list = new HashSet<int>();
  39. this.CreateBackUpStatus();
  40. GameMain.Instance.ScriptMgr.yotogi_kag.SetYotogiManager(this);
  41. string b = "SceneYotogi";
  42. if (this.adv_kag_.tag_backup.ContainsKey("free_start"))
  43. {
  44. this.is_free_mode_ = true;
  45. }
  46. else
  47. {
  48. this.is_free_mode_ = false;
  49. }
  50. this.is_vr_mode_ = this.adv_kag_.tag_backup.ContainsKey("vr_mode");
  51. if (GameMain.Instance.VRMode)
  52. {
  53. this.command_menu_ = Utility.CreatePrefab(null, "SceneYotogi/Yotogi/Prefab/VRUI CommandMenu", true).GetComponent<YotogiCommandMenuOVR>();
  54. this.command_menu_.transform.SetParent(base.gameObject.transform, true);
  55. this.command_menu_.visible = false;
  56. }
  57. this.is_script_call_ = false;
  58. if (this.adv_kag_.tag_backup != null && 0 < this.adv_kag_.tag_backup.Count && this.adv_kag_.tag_backup["name"] == b)
  59. {
  60. this.is_script_call_ = true;
  61. NDebug.Assert(this.adv_kag_.tag_backup.ContainsKey("start"), "SceneCallにstartの設定がされていませんでした");
  62. NDebug.Assert(this.adv_kag_.tag_backup.ContainsKey("label"), "SceneCallにlabelの設定がされていませんでした");
  63. string text = this.adv_kag_.tag_backup["start"];
  64. YotogiManager.CallScreenType callScreenType = YotogiManager.CallScreenType.Null;
  65. try
  66. {
  67. callScreenType = (YotogiManager.CallScreenType)Enum.Parse(typeof(YotogiManager.CallScreenType), text);
  68. }
  69. catch
  70. {
  71. NDebug.Assert("[" + text + "]を特定できませんでした", false);
  72. }
  73. if ((callScreenType == YotogiManager.CallScreenType.SubCharaSelect || callScreenType == YotogiManager.CallScreenType.FreeSkillSelect) && this.adv_kag_.tag_backup.ContainsKey("cancel_label"))
  74. {
  75. YotogiFreeSkillSelectManager yotogiFreeSkillSelectManager = this.free_skill_select_mgr_;
  76. string cancel_label = this.adv_kag_.tag_backup["cancel_label"];
  77. this.sub_chara_select_mgr_.cancel_label = cancel_label;
  78. yotogiFreeSkillSelectManager.cancel_label = cancel_label;
  79. }
  80. string nextLabel = this.adv_kag_.tag_backup["label"];
  81. this.null_mgr_.SetNextLabel(nextLabel);
  82. if (callScreenType == YotogiManager.CallScreenType.SkillSelect && this.adv_kag_.tag_backup.ContainsKey("edit_label"))
  83. {
  84. this.skill_select_mgr_.SetEditNextLabel(this.adv_kag_.tag_backup["edit_label"]);
  85. }
  86. this.CallScreen(text);
  87. }
  88. else if (this.is_free_mode)
  89. {
  90. this.CallScreen(YotogiManager.CallScreenType.FreeSkillSelect.ToString());
  91. }
  92. else
  93. {
  94. this.CallScreen(YotogiManager.CallScreenType.StageSelect.ToString());
  95. }
  96. }
  97. public override void Update()
  98. {
  99. base.Update();
  100. }
  101. public void OnPreFinalize()
  102. {
  103. this.adv_kag_ = null;
  104. this.yotogi_kag_ = null;
  105. }
  106. public void OnDestroy()
  107. {
  108. YotogiManager.instans = null;
  109. if (this.adv_kag_ != null)
  110. {
  111. if (this.adv_kag_.kag != null)
  112. {
  113. this.adv_kag_.kag.RemoveTagCallBack("yotogicall");
  114. }
  115. this.adv_kag_ = null;
  116. if (this.yotogi_kag_.kag != null)
  117. {
  118. this.yotogi_kag_.kag.RemoveTagCallBack("playbgmroom");
  119. this.yotogi_kag_.kag.RemoveTagCallBack("controlmask");
  120. }
  121. this.yotogi_kag_ = null;
  122. }
  123. }
  124. public bool TagYotogiCall(KagTagSupport tag_data)
  125. {
  126. this.adv_kag_.CheckAbsolutelyNecessaryTag(tag_data, "yotogicall", new string[]
  127. {
  128. "name",
  129. "label"
  130. });
  131. string text = tag_data.GetTagProperty("name").AsString();
  132. YotogiManager.CallScreenType callScreenType = YotogiManager.CallScreenType.Null;
  133. try
  134. {
  135. callScreenType = (YotogiManager.CallScreenType)Enum.Parse(typeof(YotogiManager.CallScreenType), text);
  136. }
  137. catch
  138. {
  139. NDebug.Assert("@yotogicall : [" + text + "]を特定できませんでした", false);
  140. }
  141. if ((callScreenType == YotogiManager.CallScreenType.SubCharaSelect || callScreenType == YotogiManager.CallScreenType.FreeSkillSelect) && tag_data.IsValid("cancel_label"))
  142. {
  143. YotogiFreeSkillSelectManager yotogiFreeSkillSelectManager = this.free_skill_select_mgr_;
  144. string cancel_label = tag_data.GetTagProperty("cancel_label").AsString();
  145. this.sub_chara_select_mgr_.cancel_label = cancel_label;
  146. yotogiFreeSkillSelectManager.cancel_label = cancel_label;
  147. }
  148. this.null_mgr_.SetNextLabel(tag_data.GetTagProperty("label").AsString());
  149. if (callScreenType == YotogiManager.CallScreenType.SkillSelect && tag_data.IsValid("edit_label"))
  150. {
  151. this.skill_select_mgr_.SetEditNextLabel(tag_data.GetTagProperty("edit_label").AsString());
  152. }
  153. this.CallScreen(text);
  154. return false;
  155. }
  156. public bool TagPlayBGMRoom(KagTagSupport tag_data)
  157. {
  158. List<YotogiStage.Data> allDatas = YotogiStage.GetAllDatas(false);
  159. YotogiStage.Data data = null;
  160. foreach (YotogiStage.Data data2 in allDatas)
  161. {
  162. if (YotogiStageSelectManager.SelectedStage == data2)
  163. {
  164. data = data2;
  165. break;
  166. }
  167. }
  168. if (data == null)
  169. {
  170. Debug.LogError("@playbgmroomエラー prefab名[" + YotogiStageSelectManager.SelectedStage.drawName + "]から背景データを特定できませんでした");
  171. return false;
  172. }
  173. int millisecond = 0;
  174. if (tag_data.IsValid("fade"))
  175. {
  176. millisecond = tag_data.GetTagProperty("fade").AsInteger();
  177. }
  178. GameMain.Instance.SoundMgr.PlayBGM(data.bgmFileName, GameUty.MillisecondToSecond(millisecond), true);
  179. return false;
  180. }
  181. public bool TagControlMask(KagTagSupport tag_data)
  182. {
  183. if (base.cur_call_screen_name == "Play" && this.play_mgr_ != null)
  184. {
  185. this.play_mgr_.SetControlMask(true, false);
  186. }
  187. return false;
  188. }
  189. protected override void SettingChildrenList(Dictionary<string, WfScreenChildren> children_dic)
  190. {
  191. children_dic.Add(YotogiManager.CallScreenType.SkillSelect.ToString(), this.skill_select_mgr_);
  192. children_dic.Add(YotogiManager.CallScreenType.Result.ToString(), this.result_mgr_);
  193. children_dic.Add(YotogiManager.CallScreenType.FreeSkillSelect.ToString(), this.free_skill_select_mgr_);
  194. children_dic.Add(YotogiManager.CallScreenType.StageSelect.ToString(), this.stage_select_mgr_);
  195. children_dic.Add(YotogiManager.CallScreenType.Play.ToString(), this.play_mgr_);
  196. children_dic.Add(YotogiManager.CallScreenType.SubCharaSelect.ToString(), this.sub_chara_select_mgr_);
  197. children_dic.Add(YotogiManager.CallScreenType.Null.ToString(), this.null_mgr_);
  198. }
  199. public void CreateBackUpStatus()
  200. {
  201. if (this.maid_ == null)
  202. {
  203. return;
  204. }
  205. this.backup_status_.param = YotogiPlay.Param.Create(this.maid_);
  206. this.backup_status_.propensity = new HashSet<int>(this.maid_.status.propensitys.GetKeyArray());
  207. }
  208. public void CreateBackUpSkillID()
  209. {
  210. if (this.maid_ == null)
  211. {
  212. return;
  213. }
  214. this.backup_status_.skill_id_list = new HashSet<int>(this.maid_.status.yotogiSkill.datas.GetKeyArray());
  215. }
  216. public void CreateBackUpYotogiClass()
  217. {
  218. this.backup_status_.yotogi_class_list = new HashSet<int>(this.maid_.status.yotogiClass.datas.GetKeyArray());
  219. }
  220. public void SetPlaySkillArray(KeyValuePair<Skill.Data, bool>[] skill_array)
  221. {
  222. this.play_skill_array_ = new YotogiManager.PlayingSkillData[7];
  223. for (int i = 0; i < this.play_skill_array_.Length; i++)
  224. {
  225. this.play_skill_array_[i] = new YotogiManager.PlayingSkillData();
  226. this.play_skill_array_[i].exp = 0;
  227. this.play_skill_array_[i].backup_total_exp = 0;
  228. this.play_skill_array_[i].is_play = false;
  229. if (i < skill_array.Length)
  230. {
  231. Skill.Data key = skill_array[i].Key;
  232. bool value = skill_array[i].Value;
  233. if (this.is_free_mode || this.is_vr_mode)
  234. {
  235. this.play_skill_array_[i].skill_pair = Yotogi.SkillDataPair.CreateBaseDataOnly(this.maid_, key);
  236. }
  237. else
  238. {
  239. this.play_skill_array_[i].skill_pair = Yotogi.SkillDataPair.Create(this.maid_, key);
  240. this.play_skill_array_[i].skill_pair.lock_skill_exp = value;
  241. this.play_skill_array_[i].backup_total_exp = this.play_skill_array_[i].skill_pair.skill_data.expSystem.GetTotalExp();
  242. }
  243. }
  244. else
  245. {
  246. this.play_skill_array_[i].skill_pair.base_data = null;
  247. }
  248. }
  249. }
  250. public void AddPlaySkill(Skill.Data skillData)
  251. {
  252. YotogiManager.PlayingSkillData[] array = this.play_skill_array_;
  253. this.play_skill_array_ = new YotogiManager.PlayingSkillData[this.play_skill_array_.Length + 1];
  254. for (int i = 0; i < array.Length; i++)
  255. {
  256. this.play_skill_array_[i] = array[i];
  257. }
  258. YotogiManager.PlayingSkillData playingSkillData = new YotogiManager.PlayingSkillData();
  259. playingSkillData.exp = 0;
  260. playingSkillData.backup_total_exp = 0;
  261. playingSkillData.is_play = false;
  262. playingSkillData.skill_pair = Yotogi.SkillDataPair.Create(this.maid_, skillData);
  263. playingSkillData.skill_pair.lock_skill_exp = true;
  264. playingSkillData.backup_total_exp = playingSkillData.skill_pair.skill_data.expSystem.GetTotalExp();
  265. this.play_skill_array_[this.play_skill_array_.Length - 1] = playingSkillData;
  266. }
  267. public bool IsAllCharaBusy()
  268. {
  269. bool flag = false;
  270. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  271. for (int i = 0; i < characterMgr.GetMaidCount(); i++)
  272. {
  273. Maid maid = characterMgr.GetMaid(i);
  274. if (maid != null && maid.Visible && maid.IsBusy)
  275. {
  276. flag = true;
  277. break;
  278. }
  279. }
  280. if (flag)
  281. {
  282. return flag;
  283. }
  284. for (int j = 0; j < characterMgr.GetManCount(); j++)
  285. {
  286. Maid man = characterMgr.GetMan(j);
  287. if (man != null && man.Visible && man.IsBusy)
  288. {
  289. flag = true;
  290. break;
  291. }
  292. }
  293. return flag;
  294. }
  295. public void ResetWorld()
  296. {
  297. GameMain.Instance.BgMgr.DelPrefabFromBgAll();
  298. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  299. for (int i = 0; i < characterMgr.GetStockMaidCount(); i++)
  300. {
  301. Maid stockMaid = characterMgr.GetStockMaid(i);
  302. if (stockMaid != null && stockMaid.body0 != null && stockMaid.body0.isLoadedBody)
  303. {
  304. stockMaid.body0.MuneYureL(1f);
  305. stockMaid.body0.MuneYureR(1f);
  306. stockMaid.IKTargetToBone("左手", null, "無し", Vector3.zero, IKMgrData.IKAttachType.Point, false);
  307. stockMaid.IKTargetToBone("右手", null, "無し", Vector3.zero, IKMgrData.IKAttachType.Point, false);
  308. }
  309. }
  310. for (int j = 0; j < characterMgr.GetStockManCount(); j++)
  311. {
  312. Maid stockMan = characterMgr.GetStockMan(j);
  313. if (stockMan != null && stockMan.body0 != null && stockMan.body0.isLoadedBody)
  314. {
  315. stockMan.IKTargetToBone("左手", null, "無し", Vector3.zero, IKMgrData.IKAttachType.Point, false);
  316. stockMan.IKTargetToBone("右手", null, "無し", Vector3.zero, IKMgrData.IKAttachType.Point, false);
  317. }
  318. }
  319. string[] array = new string[]
  320. {
  321. "handitem",
  322. "kousoku_upper",
  323. "kousoku_lower",
  324. "acchead",
  325. "megane",
  326. "skirt",
  327. "panz",
  328. "mizugi",
  329. "onepiece",
  330. "accanl",
  331. "accvag",
  332. "KubiScl",
  333. "UdeScl",
  334. "DouPer",
  335. "sintyou",
  336. "kata"
  337. };
  338. for (int k = 0; k < characterMgr.GetMaidCount(); k++)
  339. {
  340. Maid maid = characterMgr.GetMaid(k);
  341. if (maid != null && maid.Visible)
  342. {
  343. maid.FaceAnime("通常", 0f, 0);
  344. maid.FaceBlend("無し");
  345. maid.OpenMouth(false);
  346. maid.DelPrefabAll();
  347. for (int l = 0; l < array.Length; l++)
  348. {
  349. maid.ResetProp(array[l], true);
  350. }
  351. maid.AllProcPropSeqStart();
  352. }
  353. }
  354. for (int m = 0; m < characterMgr.GetManCount(); m++)
  355. {
  356. Maid man = characterMgr.GetMan(m);
  357. if (man != null && man.Visible)
  358. {
  359. man.DelPrefabAll();
  360. for (int n = 0; n < array.Length; n++)
  361. {
  362. man.ResetProp(array[n], false);
  363. }
  364. man.AllProcPropSeqStart();
  365. }
  366. }
  367. }
  368. public void UnVisibleMaidAndMan(bool maid_unvisible, bool man_unvisible)
  369. {
  370. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  371. if (man_unvisible)
  372. {
  373. for (int i = 0; i < characterMgr.GetManCount(); i++)
  374. {
  375. Maid man = characterMgr.GetMan(i);
  376. if (man != null)
  377. {
  378. man.Visible = false;
  379. }
  380. }
  381. }
  382. if (maid_unvisible)
  383. {
  384. for (int j = 0; j < characterMgr.GetMaidCount(); j++)
  385. {
  386. Maid maid = characterMgr.GetMaid(j);
  387. if (maid != null)
  388. {
  389. maid.Visible = false;
  390. }
  391. }
  392. }
  393. }
  394. public void ApplyStatus()
  395. {
  396. int exp = 0;
  397. for (int i = 0; i < this.play_skill_array.Length; i++)
  398. {
  399. Skill.Data base_data = this.play_skill_array[i].skill_pair.base_data;
  400. if (base_data != null)
  401. {
  402. if (this.play_skill_array[i].is_play && this.maid_.status.yotogiSkill.datas.ContainsKey(base_data.id))
  403. {
  404. YotogiSkillData yotogiSkillData = this.maid_.status.yotogiSkill.Get(base_data.id);
  405. yotogiSkillData.playCount += 1u;
  406. yotogiSkillData.expSystem.AddExp(this.play_skill_array[i].exp);
  407. string flagName = "夜伽_カテゴリー_実行回数_" + base_data.category.ToString();
  408. int flag = this.maid_.status.GetFlag(flagName);
  409. this.maid_.status.SetFlag(flagName, flag + 1);
  410. }
  411. this.play_skill_array[i].exp = 0;
  412. }
  413. }
  414. this.maid_.status.playCountYotogi++;
  415. if (!this.maid_.status.enabledYotogiStatusLock)
  416. {
  417. this.maid_.status.selectedYotogiClass.expSystem.AddExp(exp);
  418. this.maid_.status.studyRate += -50;
  419. }
  420. List<YotogiClass.Data> learnPossibleClassDatas = this.maid.status.yotogiClass.GetLearnPossibleClassDatas(true, AbstractClassData.ClassType.Share | AbstractClassData.ClassType.New);
  421. foreach (YotogiClass.Data data in learnPossibleClassDatas)
  422. {
  423. this.maid.status.yotogiClass.Add(data, true, true);
  424. }
  425. this.maid.status.UpdateClassBonusStatus();
  426. List<Skill.Data> learnPossibleSkills = Skill.GetLearnPossibleSkills(this.maid_.status);
  427. foreach (Skill.Data data2 in learnPossibleSkills)
  428. {
  429. this.maid_.status.yotogiSkill.Add(data2.id);
  430. }
  431. foreach (int id in this.acquired_propensityid_list)
  432. {
  433. Propensity.Data data3 = Propensity.GetData(id);
  434. this.maid_.status.AddPropensity(data3);
  435. }
  436. }
  437. public void SetRepeatVoiceFile(string file_name, int maid_no)
  438. {
  439. this.play_mgr_.SetRepeatVoiceFile(file_name, maid_no);
  440. }
  441. public void AddRepeatVoiceFile(string file_name, int maid_no)
  442. {
  443. this.play_mgr_.AddRepeatVoiceFile(file_name, maid_no);
  444. }
  445. public void OnChangeSeikeiken()
  446. {
  447. }
  448. public void DebugOnClickCallStageSelect()
  449. {
  450. this.null_mgr_.SetNextLabel(string.Empty);
  451. this.CallScreen(YotogiManager.CallScreenType.StageSelect.ToString());
  452. }
  453. public void DebugOnClickCallSkillSelect()
  454. {
  455. this.null_mgr_.SetNextLabel(string.Empty);
  456. this.CreateBackUpStatus();
  457. this.CallScreen(YotogiManager.CallScreenType.SkillSelect.ToString());
  458. }
  459. public void DebugOnClickCallPlay()
  460. {
  461. this.null_mgr_.SetNextLabel(string.Empty);
  462. this.CallScreen(YotogiManager.CallScreenType.Play.ToString());
  463. }
  464. public void DebugOnClickCallResult()
  465. {
  466. this.null_mgr_.SetNextLabel(string.Empty);
  467. this.CallScreen(YotogiManager.CallScreenType.Result.ToString());
  468. }
  469. public void DebugOnClickCallCharaSelect()
  470. {
  471. this.null_mgr_.SetNextLabel(string.Empty);
  472. this.CallScreen(YotogiManager.CallScreenType.SubCharaSelect.ToString());
  473. }
  474. public void DebugOnClickNewScene()
  475. {
  476. this.CallScreen(YotogiManager.CallScreenType.FreeSkillSelect.ToString());
  477. }
  478. public bool IsCallShouldSubCharaSelect()
  479. {
  480. List<int> list = new List<int>();
  481. HashSet<int> hashSet = new HashSet<int>();
  482. if (this.is_free_mode)
  483. {
  484. int[] keyArray = this.maid.status.yotogiSkill.datas.GetKeyArray();
  485. for (int i = 0; i < keyArray.Length; i++)
  486. {
  487. Skill.Data data = Skill.Get(keyArray[i]);
  488. if (!hashSet.Contains(data.player_num))
  489. {
  490. hashSet.Add(data.player_num);
  491. list.Add(data.player_num);
  492. }
  493. }
  494. }
  495. else
  496. {
  497. if (this.play_skill_array == null)
  498. {
  499. return false;
  500. }
  501. for (int j = 0; j < this.play_skill_array.Length; j++)
  502. {
  503. if (this.play_skill_array[j] != null && this.play_skill_array[j].skill_pair.base_data != null)
  504. {
  505. if (!hashSet.Contains(this.play_skill_array[j].skill_pair.base_data.player_num))
  506. {
  507. hashSet.Add(this.play_skill_array[j].skill_pair.base_data.player_num);
  508. list.Add(this.play_skill_array[j].skill_pair.base_data.player_num);
  509. }
  510. }
  511. }
  512. }
  513. list.Sort();
  514. int playPossibleMaidCount = this.GetPlayPossibleMaidCount();
  515. int num = 0;
  516. for (int k = 0; k < list.Count; k++)
  517. {
  518. if (list[k] <= playPossibleMaidCount)
  519. {
  520. num = list[k];
  521. }
  522. }
  523. return 1 < num;
  524. }
  525. public int GetPlayPossibleMaidCount()
  526. {
  527. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  528. int num = 0;
  529. if (this.is_script_call_ && !this.is_free_mode)
  530. {
  531. num = ScheduleAPI.GetYotogiMaids(GameMain.Instance.CharacterMgr.status.isDaytime).Count;
  532. if (num == 0)
  533. {
  534. num = 1;
  535. }
  536. }
  537. else
  538. {
  539. for (int i = 0; i < characterMgr.GetStockMaidCount(); i++)
  540. {
  541. Maid stockMaid = characterMgr.GetStockMaid(i);
  542. if (stockMaid != null && stockMaid.status.heroineType != HeroineType.Sub)
  543. {
  544. num++;
  545. }
  546. }
  547. }
  548. return num;
  549. }
  550. public void GetSubMaidList(List<Maid> draw_list)
  551. {
  552. if (draw_list == null)
  553. {
  554. return;
  555. }
  556. List<Maid> list = new List<Maid>();
  557. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  558. if (this.is_script_call_ && !this.is_free_mode)
  559. {
  560. List<Maid> yotogiMaids = ScheduleAPI.GetYotogiMaids(GameMain.Instance.CharacterMgr.status.isDaytime);
  561. for (int i = 0; i < yotogiMaids.Count; i++)
  562. {
  563. if (yotogiMaids[i] != this.maid_)
  564. {
  565. list.Add(yotogiMaids[i]);
  566. }
  567. }
  568. }
  569. else
  570. {
  571. for (int j = 0; j < characterMgr.GetStockMaidCount(); j++)
  572. {
  573. Maid stockMaid = characterMgr.GetStockMaid(j);
  574. if (stockMaid != null && this.maid_ != stockMaid && stockMaid.status.heroineType != HeroineType.Sub)
  575. {
  576. list.Add(stockMaid);
  577. }
  578. }
  579. }
  580. draw_list.Clear();
  581. draw_list.AddRange(list);
  582. }
  583. public YotogiManager.BackUpStatus GetBackUpStatus()
  584. {
  585. return this.backup_status_;
  586. }
  587. public Maid maid
  588. {
  589. get
  590. {
  591. return this.maid_;
  592. }
  593. }
  594. public int skill_select_max_hp
  595. {
  596. get
  597. {
  598. return this.maid_.status.maxHp;
  599. }
  600. }
  601. public YotogiManager.PlayingSkillData[] play_skill_array
  602. {
  603. get
  604. {
  605. return this.play_skill_array_;
  606. }
  607. }
  608. public YotogiNullManager null_mgr
  609. {
  610. get
  611. {
  612. return this.null_mgr_;
  613. }
  614. }
  615. public YotogiKagManager yotogi_kag
  616. {
  617. get
  618. {
  619. return this.yotogi_kag_;
  620. }
  621. }
  622. public bool is_free_mode
  623. {
  624. get
  625. {
  626. return this.is_free_mode_;
  627. }
  628. set
  629. {
  630. this.is_free_mode_ = value;
  631. }
  632. }
  633. public int fix_skill_level
  634. {
  635. get
  636. {
  637. return this.fix_skill_level_;
  638. }
  639. set
  640. {
  641. this.fix_skill_level_ = wf.Math.RoundMinMax(value, 0, 3);
  642. }
  643. }
  644. public bool is_vr_mode
  645. {
  646. get
  647. {
  648. return this.is_vr_mode_;
  649. }
  650. }
  651. public YotogiCommandMenuOVR command_menu
  652. {
  653. get
  654. {
  655. return this.command_menu_;
  656. }
  657. }
  658. public GameObject skill_select_prefab_object
  659. {
  660. get
  661. {
  662. return this.free_skill_select_mgr_.skill_select_prefab_object;
  663. }
  664. }
  665. public static YotogiManager instans { get; private set; }
  666. public YotogiPlayManager play_mgr
  667. {
  668. get
  669. {
  670. return this.play_mgr_;
  671. }
  672. }
  673. public void AddDebugLog(string text)
  674. {
  675. }
  676. public HashSet<int> acquired_propensityid_list = new HashSet<int>();
  677. private Maid maid_;
  678. private List<Maid> sub_maid_list_ = new List<Maid>();
  679. private ADVKagManager adv_kag_;
  680. private YotogiKagManager yotogi_kag_;
  681. private YotogiNullManager null_mgr_;
  682. private YotogiStageSelectManager stage_select_mgr_;
  683. private YotogiSkillSelectManager skill_select_mgr_;
  684. private YotogiPlayManager play_mgr_;
  685. private YotogiResultManager result_mgr_;
  686. private YotogiSubCharacterSelectManager sub_chara_select_mgr_;
  687. private bool is_script_call_;
  688. private bool is_free_mode_;
  689. private int fix_skill_level_;
  690. private YotogiFreeSkillSelectManager free_skill_select_mgr_;
  691. private bool is_vr_mode_;
  692. private YotogiCommandMenuOVR command_menu_;
  693. private YotogiManager.PlayingSkillData[] play_skill_array_ = new YotogiManager.PlayingSkillData[7];
  694. private YotogiManager.BackUpStatus backup_status_ = default(YotogiManager.BackUpStatus);
  695. public enum CallScreenType
  696. {
  697. Null,
  698. StageSelect,
  699. SkillSelect,
  700. Play,
  701. Result,
  702. SubCharaSelect,
  703. FreeSkillSelect
  704. }
  705. public class PlayingSkillData
  706. {
  707. public Yotogi.SkillDataPair skill_pair = new Yotogi.SkillDataPair();
  708. public int exp;
  709. public int backup_total_exp;
  710. public bool is_play;
  711. }
  712. public struct BackUpStatus
  713. {
  714. public YotogiPlay.Param param;
  715. public HashSet<int> skill_id_list;
  716. public HashSet<int> propensity;
  717. public HashSet<int> yotogi_class_list;
  718. }
  719. }