CompetitiveShowMgr.cs 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. using System;
  2. using System.Collections.Generic;
  3. using MaidStatus;
  4. using MaidStatus.CsvData;
  5. using UnityEngine;
  6. using wf;
  7. public class CompetitiveShowMgr : BasePanelMgr
  8. {
  9. public static bool compatibilityMode
  10. {
  11. get
  12. {
  13. return DailyMgr.IsLegacy;
  14. }
  15. }
  16. public static bool IsCompetitiveShowChara()
  17. {
  18. return 0 < CompetitiveShowMgr.check_maid_list.Count;
  19. }
  20. public override void Init()
  21. {
  22. if (CompetitiveShowMgr.check_maid_list.Count <= 0)
  23. {
  24. for (int i = 0; i < SceneCharacterSelect.select_maid_list.Count; i++)
  25. {
  26. CompetitiveShowMgr.check_maid_list.Add(SceneCharacterSelect.select_maid_list[i]);
  27. }
  28. SceneCharacterSelect.select_maid_list.Clear();
  29. if (1 < CompetitiveShowMgr.check_maid_list.Count)
  30. {
  31. GameMain.Instance.MainCamera.FadeOutNoUI(0f, true);
  32. GameMain.Instance.MainCamera.FadeIn(0f, false, null, true, true, default(Color));
  33. GameMain.Instance.SysDlg.Show("演出を簡略化しますか?", SystemDialog.TYPE.YES_NO, delegate
  34. {
  35. CompetitiveShowMgr.is_effect_ones = true;
  36. GameMain.Instance.CMSystem.SetTmpGenericFlag("品評会_演出省略", 1);
  37. GameMain.Instance.SysDlg.Close();
  38. GameMain.Instance.MainCamera.FadeInNoUI(0f, true);
  39. GameMain.Instance.MainCamera.FadeOut(0f, false, null, true, default(Color));
  40. this.Start2();
  41. }, delegate
  42. {
  43. CompetitiveShowMgr.is_effect_ones = false;
  44. GameMain.Instance.CMSystem.SetTmpGenericFlag("品評会_演出省略", 0);
  45. GameMain.Instance.SysDlg.Close();
  46. GameMain.Instance.MainCamera.FadeInNoUI(0f, true);
  47. GameMain.Instance.MainCamera.FadeOut(0f, false, null, true, default(Color));
  48. this.Start2();
  49. });
  50. }
  51. else
  52. {
  53. CompetitiveShowMgr.is_effect_ones = false;
  54. GameMain.Instance.CMSystem.SetTmpGenericFlag("品評会_演出省略", 0);
  55. this.Start2();
  56. }
  57. }
  58. else
  59. {
  60. this.Start2();
  61. }
  62. }
  63. protected override void Start()
  64. {
  65. NDebug.AssertNull(this.ClassEffect != null);
  66. this.ClassEffect.SetActive(false);
  67. this.is_success = false;
  68. base.Start();
  69. this.Init();
  70. }
  71. private void Start2()
  72. {
  73. Dictionary<int, string> dictionary = new Dictionary<int, string>();
  74. Dictionary<int, string> dictionary2 = new Dictionary<int, string>();
  75. List<JobClass.Data> allDatas = JobClass.GetAllDatas(true);
  76. List<YotogiClass.Data> allDatas2 = YotogiClass.GetAllDatas(true);
  77. bool lockNTRPlay = GameMain.Instance.CharacterMgr.status.lockNTRPlay;
  78. Maid maid = null;
  79. int num = 0;
  80. while (num < CompetitiveShowMgr.check_maid_list.Count && !this.is_success)
  81. {
  82. if (!CompetitiveShowMgr.is_effect_ones && 1 <= num)
  83. {
  84. break;
  85. }
  86. Maid maid2 = CompetitiveShowMgr.check_maid_list[num];
  87. AbstractClassData.ClassType classType = AbstractClassData.ClassType.Share;
  88. classType |= ((!CompetitiveShowMgr.compatibilityMode) ? AbstractClassData.ClassType.New : AbstractClassData.ClassType.Old);
  89. bool flag = maid2.status.jobClass.GetLearnPossibleClassDatas(true, classType).Count != 0;
  90. if (!flag)
  91. {
  92. List<YotogiClass.Data> learnPossibleClassDatas = maid2.status.yotogiClass.GetLearnPossibleClassDatas(true, classType);
  93. if (lockNTRPlay)
  94. {
  95. List<YotogiClass.Data> list = new List<YotogiClass.Data>();
  96. foreach (YotogiClass.Data data in learnPossibleClassDatas)
  97. {
  98. if (YotogiClass.IsNTRClass(data.id, CompetitiveShowMgr.compatibilityMode))
  99. {
  100. list.Add(data);
  101. }
  102. }
  103. foreach (YotogiClass.Data item in list)
  104. {
  105. learnPossibleClassDatas.Remove(item);
  106. }
  107. }
  108. flag = (learnPossibleClassDatas.Count != 0);
  109. }
  110. if (flag)
  111. {
  112. this.is_success = true;
  113. if (maid == null)
  114. {
  115. maid = maid2;
  116. break;
  117. }
  118. }
  119. num++;
  120. }
  121. if (maid == null && 0 < CompetitiveShowMgr.check_maid_list.Count)
  122. {
  123. maid = CompetitiveShowMgr.check_maid_list[0];
  124. }
  125. if (CompetitiveShowMgr.is_effect_ones)
  126. {
  127. this.sceneMgr.GetManager<MaidExaminationMgr>().OpenMaidExaminationPanel(maid, CompetitiveShowMgr.check_maid_list, new CompetitiveShowAPI.dgOnSceneStartCallBack(this.OnFadeInEnd));
  128. }
  129. else
  130. {
  131. this.sceneMgr.GetManager<MaidExaminationMgr>().OpenMaidExaminationPanel(maid, new List<Maid>
  132. {
  133. CompetitiveShowMgr.check_maid_list[0]
  134. }, new CompetitiveShowAPI.dgOnSceneStartCallBack(this.OnFadeInEnd));
  135. }
  136. }
  137. private void OnFadeInEnd()
  138. {
  139. GameMain.Instance.SoundMgr.PlaySe("SE005.ogg", false);
  140. CameraMain mainCamera = GameMain.Instance.MainCamera;
  141. mainCamera.SetControl(false);
  142. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(0);
  143. Transform bone = maid.body0.GetBone("Bip01 Head");
  144. Vector3 position = bone.position;
  145. Vector3 vector = new Vector3(0.03583635f, 0.3097733f, -0.4142513f);
  146. Vector2 vector2 = new Vector2(-18.80226f, 11.24228f);
  147. mainCamera.SetTargetPos(vector, true);
  148. mainCamera.SetAroundAngle(vector2, true);
  149. mainCamera.SetDistance(0.7f, true);
  150. Vector3 f_vCenter = new Vector3(position.x - 0.0343059041f, position.y - 0.3253325f, position.z - 0.48361522f);
  151. Vector2 f_vRotate = new Vector2(-182.2753f, 11.24231f);
  152. float f_fRadius = 2.8f;
  153. float num = 5.5f;
  154. mainCamera.StartAnimationTo(true, vector, 0.7f, vector2, f_vCenter, f_fRadius, f_vRotate, num, "easeOutCubic", false, 0.5f);
  155. this.wait_time = Time.time + num + 1f;
  156. this.phase_status_ = CompetitiveShowMgr.PhaseStatus.CameraAction;
  157. }
  158. protected virtual void Update()
  159. {
  160. if (this.phase_status_ == CompetitiveShowMgr.PhaseStatus.CameraAction && this.wait_time < Time.time)
  161. {
  162. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(0);
  163. if (this.is_success)
  164. {
  165. if (UnityEngine.Random.Range(0, 1) == 0)
  166. {
  167. maid.FaceAnime("にっこり", 0f, 0);
  168. }
  169. else
  170. {
  171. maid.FaceAnime("笑顔", 0f, 0);
  172. }
  173. maid.FaceBlend("頬1涙0");
  174. GameMain.Instance.SoundMgr.PlaySe("SE007.ogg", false);
  175. GameMain.Instance.SoundMgr.PlaySe("SE008.ogg", false);
  176. if (CompetitiveShowMgr.compatibilityMode)
  177. {
  178. GameMain.Instance.SoundMgr.PlayBGMLegacy("BGM021.ogg", 0f, true);
  179. }
  180. else
  181. {
  182. GameMain.Instance.SoundMgr.PlayBGM("BGM007.ogg", 0f, true);
  183. }
  184. GameObject bgObject = GameMain.Instance.BgMgr.BgObject;
  185. if (bgObject != null)
  186. {
  187. GameObject gameObject = Utility.CreatePrefab(bgObject, "Prefab/Particle/PKamihubuki", true);
  188. Vector3 localPosition = new Vector3(-1.08f, 4.06f, 0.2f);
  189. gameObject.transform.localPosition = localPosition;
  190. ParticleSystem[] componentsInChildren = gameObject.GetComponentsInChildren<ParticleSystem>();
  191. foreach (ParticleSystem particleSystem in componentsInChildren)
  192. {
  193. particleSystem.shape.angle = 25f;
  194. }
  195. }
  196. KeyValuePair<string, string> competitiveMotionFileVictory = maid.status.personal.competitiveMotionFileVictory;
  197. this.ClassEffect.SetActive(true);
  198. GameMain.Instance.ScriptMgr.LoadMotionScript(0, false, competitiveMotionFileVictory.Key, competitiveMotionFileVictory.Value, string.Empty, string.Empty, false, true, false);
  199. }
  200. else
  201. {
  202. if (UnityEngine.Random.Range(0, 1) == 0)
  203. {
  204. maid.FaceAnime("泣き", 0f, 0);
  205. }
  206. else
  207. {
  208. maid.FaceAnime("困った", 0f, 0);
  209. }
  210. KeyValuePair<string, string> competitiveMotionFileDefeat = maid.status.personal.competitiveMotionFileDefeat;
  211. GameMain.Instance.SoundMgr.PlaySe("SE021.ogg", false);
  212. GameMain.Instance.ScriptMgr.LoadMotionScript(0, false, competitiveMotionFileDefeat.Key, competitiveMotionFileDefeat.Value, string.Empty, string.Empty, false, true, false);
  213. }
  214. this.wait_time = Time.time + 3f;
  215. this.phase_status_ = CompetitiveShowMgr.PhaseStatus.MotionPlay;
  216. }
  217. else if (this.phase_status_ == CompetitiveShowMgr.PhaseStatus.MotionPlay && this.wait_time < Time.time)
  218. {
  219. this.sceneMgr.GetManager<MaidExaminationMgr>().BaseOpenPanel();
  220. this.phase_status_ = CompetitiveShowMgr.PhaseStatus.ResultDraw;
  221. }
  222. }
  223. public GameObject ClassEffect;
  224. public static List<Maid> check_maid_list = new List<Maid>();
  225. public static bool is_effect_ones = true;
  226. private bool is_success;
  227. private CompetitiveShowMgr.PhaseStatus phase_status_;
  228. private float wait_time;
  229. private enum PhaseStatus
  230. {
  231. Null,
  232. CameraAction,
  233. MotionPlay,
  234. ResultDraw
  235. }
  236. }