YotogiManager.cs 26 KB

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