YotogiManager.cs 24 KB

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