YotogiManager.cs 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014
  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, IKCtrlData.IKExecTiming.Normal);
  434. stockMaid.IKTargetToBone("右手", null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, false, IKCtrlData.IKExecTiming.Normal);
  435. TBodySkin tbodySkin = stockMaid.body0.goSlot[0];
  436. if (tbodySkin != null && tbodySkin.kupaCtrl != null)
  437. {
  438. tbodySkin.kupaCtrl.ResetAll();
  439. }
  440. }
  441. }
  442. for (int j = 0; j < characterMgr.GetStockManCount(); j++)
  443. {
  444. Maid stockMan = characterMgr.GetStockMan(j);
  445. if (stockMan != null && stockMan.body0 != null && stockMan.body0.isLoadedBody)
  446. {
  447. stockMan.IKTargetToBone("左手", null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, false, IKCtrlData.IKExecTiming.Normal);
  448. stockMan.IKTargetToBone("右手", null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, false, IKCtrlData.IKExecTiming.Normal);
  449. TBodySkin tbodySkin2 = this.maid.body0.goSlot[0];
  450. if (tbodySkin2 != null && tbodySkin2.kupaCtrl != null)
  451. {
  452. tbodySkin2.kupaCtrl.ResetAll();
  453. }
  454. }
  455. }
  456. string[] array = new string[]
  457. {
  458. "handitem",
  459. "kousoku_upper",
  460. "kousoku_lower",
  461. "acchead",
  462. "megane",
  463. "skirt",
  464. "panz",
  465. "mizugi",
  466. "onepiece",
  467. "accanl",
  468. "accvag",
  469. "KubiScl",
  470. "UdeScl",
  471. "DouPer",
  472. "sintyou",
  473. "kata"
  474. };
  475. for (int k = 0; k < characterMgr.GetMaidCount(); k++)
  476. {
  477. Maid maid = characterMgr.GetMaid(k);
  478. if (maid != null && maid.Visible)
  479. {
  480. maid.FaceAnime("通常", 0f, 0);
  481. maid.FaceBlend("無し");
  482. maid.OpenMouth(false);
  483. maid.DelPrefabAll();
  484. for (int l = 0; l < array.Length; l++)
  485. {
  486. maid.ResetProp(array[l], true);
  487. }
  488. maid.AllProcPropSeqStart();
  489. }
  490. }
  491. for (int m = 0; m < characterMgr.GetManCount(); m++)
  492. {
  493. Maid man = characterMgr.GetMan(m);
  494. if (man != null && man.Visible)
  495. {
  496. man.DelPrefabAll();
  497. for (int n = 0; n < array.Length; n++)
  498. {
  499. man.ResetProp(array[n], false);
  500. }
  501. man.AllProcPropSeqStart();
  502. }
  503. }
  504. }
  505. public void UnVisibleMaidAndMan(bool maid_unvisible, bool man_unvisible)
  506. {
  507. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  508. if (man_unvisible)
  509. {
  510. for (int i = 0; i < characterMgr.GetManCount(); i++)
  511. {
  512. Maid man = characterMgr.GetMan(i);
  513. if (man != null)
  514. {
  515. man.Visible = false;
  516. }
  517. }
  518. }
  519. if (maid_unvisible)
  520. {
  521. for (int j = 0; j < characterMgr.GetMaidCount(); j++)
  522. {
  523. Maid maid = characterMgr.GetMaid(j);
  524. if (maid != null)
  525. {
  526. maid.Visible = false;
  527. }
  528. }
  529. }
  530. }
  531. public void ApplyStatus()
  532. {
  533. int exp = 0;
  534. for (int i = 0; i < this.play_skill_array.Length; i++)
  535. {
  536. Skill.Data base_data = this.play_skill_array[i].skill_pair.base_data;
  537. if (base_data != null)
  538. {
  539. if (this.play_skill_array[i].is_play && this.maid_.status.yotogiSkill.datas.ContainsKey(base_data.id))
  540. {
  541. YotogiSkillData yotogiSkillData = this.maid_.status.yotogiSkill.Get(base_data.id);
  542. yotogiSkillData.playCount += 1U;
  543. yotogiSkillData.expSystem.AddExp(this.play_skill_array[i].exp);
  544. string flagName = "夜伽_カテゴリー_実行回数_" + base_data.category.ToString();
  545. int flag = this.maid_.status.GetFlag(flagName);
  546. this.maid_.status.SetFlag(flagName, flag + 1);
  547. }
  548. this.play_skill_array[i].exp = 0;
  549. }
  550. }
  551. this.maid_.status.playCountYotogi++;
  552. if (!this.maid_.status.enabledYotogiStatusLock)
  553. {
  554. this.maid_.status.selectedYotogiClass.expSystem.AddExp(exp);
  555. this.maid_.status.studyRate += -50;
  556. }
  557. List<YotogiClass.Data> learnPossibleClassDatas = this.maid.status.yotogiClass.GetLearnPossibleClassDatas(true, AbstractClassData.ClassType.Share | AbstractClassData.ClassType.New);
  558. foreach (YotogiClass.Data data in learnPossibleClassDatas)
  559. {
  560. this.maid.status.yotogiClass.Add(data, true, true);
  561. }
  562. this.maid.status.UpdateClassBonusStatus();
  563. List<Skill.Data> learnPossibleSkills = Skill.GetLearnPossibleSkills(this.maid_.status);
  564. foreach (Skill.Data data2 in learnPossibleSkills)
  565. {
  566. this.maid_.status.yotogiSkill.Add(data2.id);
  567. }
  568. foreach (int id in this.acquired_propensityid_list)
  569. {
  570. Propensity.Data data3 = Propensity.GetData(id);
  571. this.maid_.status.AddPropensity(data3);
  572. }
  573. }
  574. public void SetRepeatVoiceFile(string file_name, int maid_no)
  575. {
  576. this.play_mgr_.SetRepeatVoiceFile(file_name, maid_no);
  577. }
  578. public void AddRepeatVoiceFile(string file_name, int maid_no)
  579. {
  580. this.play_mgr_.AddRepeatVoiceFile(file_name, maid_no);
  581. }
  582. public void OnChangeSeikeiken()
  583. {
  584. }
  585. public void DebugOnClickCallStageSelect()
  586. {
  587. this.null_mgr_.SetNextLabel(string.Empty);
  588. this.CallScreen(YotogiManager.CallScreenType.StageSelect.ToString());
  589. }
  590. public void DebugOnClickCallSkillSelect()
  591. {
  592. this.null_mgr_.SetNextLabel(string.Empty);
  593. this.CreateBackUpStatus();
  594. this.CallScreen(YotogiManager.CallScreenType.SkillSelect.ToString());
  595. }
  596. public void DebugOnClickCallPlay()
  597. {
  598. this.null_mgr_.SetNextLabel(string.Empty);
  599. this.CallScreen(YotogiManager.CallScreenType.Play.ToString());
  600. }
  601. public void DebugOnClickCallResult()
  602. {
  603. this.null_mgr_.SetNextLabel(string.Empty);
  604. this.CallScreen(YotogiManager.CallScreenType.Result.ToString());
  605. }
  606. public void DebugOnClickCallCharaSelect()
  607. {
  608. this.null_mgr_.SetNextLabel(string.Empty);
  609. this.CallScreen(YotogiManager.CallScreenType.SubCharaSelect.ToString());
  610. }
  611. public void DebugOnClickNewScene()
  612. {
  613. this.CallScreen(YotogiManager.CallScreenType.FreeSkillSelect.ToString());
  614. }
  615. public bool IsCallShouldSubCharaSelect()
  616. {
  617. List<int> list = new List<int>();
  618. HashSet<int> hashSet = new HashSet<int>();
  619. if (this.is_free_mode)
  620. {
  621. int[] keyArray = this.maid.status.yotogiSkill.datas.GetKeyArray();
  622. for (int i = 0; i < keyArray.Length; i++)
  623. {
  624. Skill.Data data = Skill.Get(keyArray[i]);
  625. if (data.specialConditionType != Skill.Data.SpecialConditionType.NewType && data.specialConditionType != Skill.Data.SpecialConditionType.GP01Recollect && data.specialConditionType != Skill.Data.SpecialConditionType.GP02Recollect)
  626. {
  627. if (!hashSet.Contains(data.player_num))
  628. {
  629. hashSet.Add(data.player_num);
  630. list.Add(data.player_num);
  631. }
  632. }
  633. }
  634. }
  635. else
  636. {
  637. if (this.play_skill_array == null)
  638. {
  639. return false;
  640. }
  641. for (int j = 0; j < this.play_skill_array.Length; j++)
  642. {
  643. if (this.play_skill_array[j] != null && this.play_skill_array[j].skill_pair.base_data != null)
  644. {
  645. if (!hashSet.Contains(this.play_skill_array[j].skill_pair.base_data.player_num))
  646. {
  647. hashSet.Add(this.play_skill_array[j].skill_pair.base_data.player_num);
  648. list.Add(this.play_skill_array[j].skill_pair.base_data.player_num);
  649. }
  650. }
  651. }
  652. }
  653. list.Sort();
  654. int playPossibleMaidCount = this.GetPlayPossibleMaidCount();
  655. int num = 0;
  656. for (int k = 0; k < list.Count; k++)
  657. {
  658. if (list[k] <= playPossibleMaidCount)
  659. {
  660. num = list[k];
  661. }
  662. }
  663. return 1 < num;
  664. }
  665. public bool inputCBLUpKey
  666. {
  667. get
  668. {
  669. return false;
  670. }
  671. }
  672. public bool inputCBLDownKey
  673. {
  674. get
  675. {
  676. return false;
  677. }
  678. }
  679. public bool inputCBLRightKey
  680. {
  681. get
  682. {
  683. return false;
  684. }
  685. }
  686. public bool inputCBLLeftKey
  687. {
  688. get
  689. {
  690. return false;
  691. }
  692. }
  693. public bool inputCBLEnterKey
  694. {
  695. get
  696. {
  697. return false;
  698. }
  699. }
  700. public bool inputCBLCancelKey
  701. {
  702. get
  703. {
  704. return false;
  705. }
  706. }
  707. public int GetPlayPossibleMaidCount()
  708. {
  709. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  710. int num = 0;
  711. if (this.is_script_call_ && !this.is_free_mode)
  712. {
  713. num = ScheduleAPI.GetYotogiMaids(GameMain.Instance.CharacterMgr.status.isDaytime).Count;
  714. if (num == 0)
  715. {
  716. num = 1;
  717. }
  718. }
  719. else
  720. {
  721. for (int i = 0; i < characterMgr.GetStockMaidCount(); i++)
  722. {
  723. Maid stockMaid = characterMgr.GetStockMaid(i);
  724. if (stockMaid != null && stockMaid.status.heroineType != HeroineType.Sub)
  725. {
  726. num++;
  727. }
  728. }
  729. }
  730. return num;
  731. }
  732. public void GetSubMaidList(List<Maid> draw_list)
  733. {
  734. if (draw_list == null)
  735. {
  736. return;
  737. }
  738. List<Maid> list = new List<Maid>();
  739. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  740. if (this.is_script_call_ && !this.is_free_mode)
  741. {
  742. List<Maid> yotogiMaids = ScheduleAPI.GetYotogiMaids(GameMain.Instance.CharacterMgr.status.isDaytime);
  743. for (int i = 0; i < yotogiMaids.Count; i++)
  744. {
  745. if (yotogiMaids[i] != this.maid_)
  746. {
  747. list.Add(yotogiMaids[i]);
  748. }
  749. }
  750. }
  751. else
  752. {
  753. for (int j = 0; j < characterMgr.GetStockMaidCount(); j++)
  754. {
  755. Maid stockMaid = characterMgr.GetStockMaid(j);
  756. if (stockMaid != null && this.maid_ != stockMaid && stockMaid.status.heroineType != HeroineType.Sub)
  757. {
  758. list.Add(stockMaid);
  759. }
  760. }
  761. }
  762. draw_list.Clear();
  763. draw_list.AddRange(list);
  764. }
  765. public YotogiManager.BackUpStatus GetBackUpStatus()
  766. {
  767. return this.backup_status_;
  768. }
  769. public Maid maid
  770. {
  771. get
  772. {
  773. return this.maid_;
  774. }
  775. }
  776. public int skill_select_max_hp
  777. {
  778. get
  779. {
  780. return this.maid_.status.maxHp;
  781. }
  782. }
  783. public YotogiManager.PlayingSkillData[] play_skill_array
  784. {
  785. get
  786. {
  787. return this.play_skill_array_;
  788. }
  789. }
  790. public YotogiManager.PlayingSkillData playing_skill
  791. {
  792. get
  793. {
  794. return this.play_mgr_.playingSkill;
  795. }
  796. }
  797. public YotogiNullManager null_mgr
  798. {
  799. get
  800. {
  801. return this.null_mgr_;
  802. }
  803. }
  804. public YotogiKagManager yotogi_kag
  805. {
  806. get
  807. {
  808. return this.yotogi_kag_;
  809. }
  810. }
  811. public bool is_free_mode
  812. {
  813. get
  814. {
  815. return this.is_free_mode_;
  816. }
  817. set
  818. {
  819. this.is_free_mode_ = value;
  820. }
  821. }
  822. public bool is_new_yotogi_mode
  823. {
  824. get
  825. {
  826. return this.is_new_yotogi_;
  827. }
  828. }
  829. public int fix_skill_level
  830. {
  831. get
  832. {
  833. return this.fix_skill_level_;
  834. }
  835. set
  836. {
  837. this.fix_skill_level_ = wf.Math.RoundMinMax(value, 0, 3);
  838. }
  839. }
  840. public bool is_vr_mode
  841. {
  842. get
  843. {
  844. return this.is_vr_mode_;
  845. }
  846. }
  847. public YotogiCommandMenuOVR command_menu
  848. {
  849. get
  850. {
  851. return this.command_menu_;
  852. }
  853. }
  854. public GameObject skill_select_prefab_object
  855. {
  856. get
  857. {
  858. return this.free_skill_select_mgr_.skill_select_prefab_object;
  859. }
  860. }
  861. public static YotogiManager instans { get; private set; }
  862. public YotogiPlayManager play_mgr
  863. {
  864. get
  865. {
  866. return this.play_mgr_;
  867. }
  868. }
  869. public static bool isGP001HaremMode
  870. {
  871. get
  872. {
  873. return GameMain.Instance.CMSystem.GetTmpGenericFlag("harem_maidswap") != 0;
  874. }
  875. }
  876. public void AddDebugLog(string text)
  877. {
  878. }
  879. public HashSet<int> acquired_propensityid_list = new HashSet<int>();
  880. private Maid maid_;
  881. private List<Maid> sub_maid_list_ = new List<Maid>();
  882. private ADVKagManager adv_kag_;
  883. private YotogiKagManager yotogi_kag_;
  884. private YotogiNullManager null_mgr_;
  885. private YotogiStageSelectManager stage_select_mgr_;
  886. private YotogiSkillSelectManager skill_select_mgr_;
  887. private YotogiPlayManager play_mgr_;
  888. private YotogiResultManager result_mgr_;
  889. private YotogiSubCharacterSelectManager sub_chara_select_mgr_;
  890. private bool is_script_call_;
  891. private bool is_free_mode_;
  892. private bool is_new_yotogi_;
  893. private int fix_skill_level_;
  894. private YotogiFreeSkillSelectManager free_skill_select_mgr_;
  895. private bool is_vr_mode_;
  896. private YotogiCommandMenuOVR command_menu_;
  897. private YotogiManager.PlayingSkillData[] play_skill_array_ = new YotogiManager.PlayingSkillData[7];
  898. private YotogiManager.BackUpStatus backup_status_ = default(YotogiManager.BackUpStatus);
  899. public HashSet<string> addTagNames = new HashSet<string>();
  900. public enum CallScreenType
  901. {
  902. Null,
  903. Init,
  904. StageSelect,
  905. SkillSelect,
  906. Play,
  907. Result,
  908. SubCharaSelect,
  909. FreeSkillSelect
  910. }
  911. public class PlayingSkillData
  912. {
  913. public Yotogi.SkillDataPair skill_pair = new Yotogi.SkillDataPair();
  914. public int exp;
  915. public int backup_total_exp;
  916. public bool is_play;
  917. }
  918. public struct BackUpStatus
  919. {
  920. public YotogiPlay.Param param;
  921. public HashSet<int> skill_id_list;
  922. public HashSet<int> propensity;
  923. public HashSet<int> yotogi_class_list;
  924. }
  925. }