YotogiManager.cs 27 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006
  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. 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, false);
  448. stockMan.IKTargetToBone("右手", null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, false, false);
  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)
  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 YotogiNullManager null_mgr
  791. {
  792. get
  793. {
  794. return this.null_mgr_;
  795. }
  796. }
  797. public YotogiKagManager yotogi_kag
  798. {
  799. get
  800. {
  801. return this.yotogi_kag_;
  802. }
  803. }
  804. public bool is_free_mode
  805. {
  806. get
  807. {
  808. return this.is_free_mode_;
  809. }
  810. set
  811. {
  812. this.is_free_mode_ = value;
  813. }
  814. }
  815. public bool is_new_yotogi_mode
  816. {
  817. get
  818. {
  819. return this.is_new_yotogi_;
  820. }
  821. }
  822. public int fix_skill_level
  823. {
  824. get
  825. {
  826. return this.fix_skill_level_;
  827. }
  828. set
  829. {
  830. this.fix_skill_level_ = wf.Math.RoundMinMax(value, 0, 3);
  831. }
  832. }
  833. public bool is_vr_mode
  834. {
  835. get
  836. {
  837. return this.is_vr_mode_;
  838. }
  839. }
  840. public YotogiCommandMenuOVR command_menu
  841. {
  842. get
  843. {
  844. return this.command_menu_;
  845. }
  846. }
  847. public GameObject skill_select_prefab_object
  848. {
  849. get
  850. {
  851. return this.free_skill_select_mgr_.skill_select_prefab_object;
  852. }
  853. }
  854. public static YotogiManager instans { get; private set; }
  855. public YotogiPlayManager play_mgr
  856. {
  857. get
  858. {
  859. return this.play_mgr_;
  860. }
  861. }
  862. public static bool isGP001HaremMode
  863. {
  864. get
  865. {
  866. return GameMain.Instance.CMSystem.GetTmpGenericFlag("harem_maidswap") != 0;
  867. }
  868. }
  869. public void AddDebugLog(string text)
  870. {
  871. }
  872. public HashSet<int> acquired_propensityid_list = new HashSet<int>();
  873. private Maid maid_;
  874. private List<Maid> sub_maid_list_ = new List<Maid>();
  875. private ADVKagManager adv_kag_;
  876. private YotogiKagManager yotogi_kag_;
  877. private YotogiNullManager null_mgr_;
  878. private YotogiStageSelectManager stage_select_mgr_;
  879. private YotogiSkillSelectManager skill_select_mgr_;
  880. private YotogiPlayManager play_mgr_;
  881. private YotogiResultManager result_mgr_;
  882. private YotogiSubCharacterSelectManager sub_chara_select_mgr_;
  883. private bool is_script_call_;
  884. private bool is_free_mode_;
  885. private bool is_new_yotogi_;
  886. private int fix_skill_level_;
  887. private YotogiFreeSkillSelectManager free_skill_select_mgr_;
  888. private bool is_vr_mode_;
  889. private YotogiCommandMenuOVR command_menu_;
  890. private YotogiManager.PlayingSkillData[] play_skill_array_ = new YotogiManager.PlayingSkillData[7];
  891. private YotogiManager.BackUpStatus backup_status_ = default(YotogiManager.BackUpStatus);
  892. public HashSet<string> addTagNames = new HashSet<string>();
  893. public enum CallScreenType
  894. {
  895. Null,
  896. Init,
  897. StageSelect,
  898. SkillSelect,
  899. Play,
  900. Result,
  901. SubCharaSelect,
  902. FreeSkillSelect
  903. }
  904. public class PlayingSkillData
  905. {
  906. public Yotogi.SkillDataPair skill_pair = new Yotogi.SkillDataPair();
  907. public int exp;
  908. public int backup_total_exp;
  909. public bool is_play;
  910. }
  911. public struct BackUpStatus
  912. {
  913. public YotogiPlay.Param param;
  914. public HashSet<int> skill_id_list;
  915. public HashSet<int> propensity;
  916. public HashSet<int> yotogi_class_list;
  917. }
  918. }