YotogiManager.cs 26 KB

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