YotogiResultManager.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. using System;
  2. using System.Collections.Generic;
  3. using MaidStatus;
  4. using UnityEngine;
  5. using wf;
  6. using Yotogis;
  7. public class YotogiResultManager : WfScreenChildren
  8. {
  9. public override void Awake()
  10. {
  11. base.Awake();
  12. this.yotogi_mgr_ = base.GetComponentInParent<YotogiManager>();
  13. this.common_buttons_ = UTY.GetChildObject(base.root_obj, "CommonPanel", false).GetComponent<YotogiCommonButtons>();
  14. this.common_buttons_.viwe_reset_btn.gameObject.SetActive(false);
  15. string path = "SceneYotogi/Common/Prefab/ParameterViewer";
  16. if (Product.SPP)
  17. {
  18. path = "SceneYotogi/Common/Prefab/ParameterViewerWidth";
  19. }
  20. GameObject gameObject = Utility.CreatePrefab(base.root_obj, path, true);
  21. gameObject.transform.SetParent(UTY.GetChildObject(base.root_obj, "ParameterViewer", false).transform, false);
  22. gameObject.transform.localPosition = new Vector3(0f, 360f, 0f);
  23. this.paramenter_viewer_ = gameObject.GetComponent<YotogiParameterViewer>();
  24. this.paramenter_viewer_.SetCostumeButtonVisible(false);
  25. this.paramenter_viewer_.SetAttributeViewer(UTY.GetChildObject(base.root_obj.transform.parent.gameObject, "AttributeViewer", false).GetComponent<AttributeViewer>());
  26. this.fluctuation_status_parent_ = UTY.GetChildObject(base.root_obj, "AcquiredParameterViewer/FluctuationOfParameter/FluctuationOfParameterParent", false).GetComponent<UITable>();
  27. this.acquired_class_parent_ = UTY.GetChildObject(base.root_obj, "AcquiredParameterViewer/YotogiClass/AcquiredSkillParent/Contents/UnitParent", false).GetComponent<UIGrid>();
  28. this.acquired_skill_parent_ = UTY.GetChildObject(base.root_obj, "AcquiredParameterViewer/AcquiredSkill/AcquiredSkillParent/Contents/UnitParent", false).GetComponent<UIGrid>();
  29. this.acquired_attribute_parent_ = UTY.GetChildObject(base.root_obj, "AcquiredParameterViewer/AcquiredAttribute/AcquiredAttributeParent", false).GetComponent<UIGrid>();
  30. this.skill_unit_parent_ = UTY.GetChildObject(base.root_obj, "SkillViewer/SkillUnitParent", false).GetComponent<UIGrid>();
  31. }
  32. protected override void OnCall()
  33. {
  34. this.yotogi_mgr_.uiVisible = true;
  35. this.common_buttons_.next_btn.onClick.Clear();
  36. EventDelegate.Add(this.common_buttons_.next_btn.onClick, new EventDelegate.Callback(this.OnClickNext));
  37. this.maid_ = this.yotogi_mgr_.maid;
  38. this.Clear();
  39. this.paramenter_viewer_.SetMaid(this.maid_);
  40. this.paramenter_viewer_.UpdateTextCommon();
  41. this.paramenter_viewer_.UpdateTextParam();
  42. HashSet<int> hashSet = new HashSet<int>();
  43. YotogiManager.PlayingSkillData[] play_skill_array = this.yotogi_mgr_.play_skill_array;
  44. for (int i = 0; i < play_skill_array.Length; i++)
  45. {
  46. if (play_skill_array[i].skill_pair.base_data != null && !hashSet.Contains(play_skill_array[i].skill_pair.base_data.id) && play_skill_array[i].skill_pair.base_data.specialConditionType != Skill.Data.SpecialConditionType.Faint && play_skill_array[i].skill_pair.base_data.specialConditionType != Skill.Data.SpecialConditionType.NewType)
  47. {
  48. hashSet.Add(play_skill_array[i].skill_pair.base_data.id);
  49. YotogiSkillUnit yotogiSkillUnit = this.AddSkillUnit(play_skill_array[i].skill_pair);
  50. int num = play_skill_array[i].skill_pair.skill_data.expSystem.GetTotalExp() - play_skill_array[i].backup_total_exp;
  51. if (0 < num)
  52. {
  53. yotogiSkillUnit.SetExpAnime(play_skill_array[i].backup_total_exp, num, this.AnimeTime);
  54. }
  55. if (play_skill_array[i].skill_pair.base_data.specialConditionType == Skill.Data.SpecialConditionType.Drunk)
  56. {
  57. GameMain.Instance.CharacterMgr.status.AddHaveTrophy(1130);
  58. }
  59. if (play_skill_array[i].skill_pair.base_data.specialConditionType == Skill.Data.SpecialConditionType.Drug)
  60. {
  61. GameMain.Instance.CharacterMgr.status.AddHaveTrophy(1140);
  62. }
  63. if (play_skill_array[i].skill_pair.base_data.specialConditionType == Skill.Data.SpecialConditionType.Mask)
  64. {
  65. GameMain.Instance.CharacterMgr.status.AddHaveTrophy(1150);
  66. }
  67. }
  68. }
  69. YotogiManager.BackUpStatus backUpStatus = this.yotogi_mgr_.GetBackUpStatus();
  70. YotogiPlay.Param param = YotogiPlay.Param.Create(this.maid_) - backUpStatus.param;
  71. this.AddFluctuationStatus("夜伽クラスレベル", param.yotogi_type_level);
  72. this.AddFluctuationStatus("夜伽クラスEXP", param.yotogi_type_total_exp);
  73. this.AddFluctuationStatus("奉仕", param.housi);
  74. this.AddFluctuationStatus("淫欲", param.inyoku);
  75. this.AddFluctuationStatus("M性", param.m_value);
  76. this.AddFluctuationStatus("変態", param.hentai);
  77. this.AddFluctuationStatus("可憐", param.lovely);
  78. this.AddFluctuationStatus("気品", param.elegance);
  79. this.AddFluctuationStatus("魅惑", param.charm);
  80. this.AddFluctuationStatus("指導", param.teach_rate / 10);
  81. HashSet<int> hashSet2 = new HashSet<int>();
  82. foreach (int item in this.maid_.status.propensitys.GetKeyArray())
  83. {
  84. hashSet2.Add(item);
  85. }
  86. foreach (int item2 in backUpStatus.propensity)
  87. {
  88. hashSet2.Remove(item2);
  89. }
  90. foreach (int id in hashSet2)
  91. {
  92. this.AddAcquiredAttribute(Propensity.GetData(id).drawName, Propensity.GetData(id).termName);
  93. }
  94. HashSet<int> hashSet3 = new HashSet<int>();
  95. int[] keyArray2 = this.maid_.status.yotogiClass.datas.GetKeyArray();
  96. for (int k = 0; k < keyArray2.Length; k++)
  97. {
  98. hashSet3.Add(keyArray2[k]);
  99. }
  100. foreach (int item3 in backUpStatus.yotogi_class_list)
  101. {
  102. hashSet3.Remove(item3);
  103. }
  104. foreach (int id2 in hashSet3)
  105. {
  106. if (!YotogiClass.IsNTRClass(id2, false))
  107. {
  108. this.AddYotogiClass(YotogiClass.GetData(id2).drawName, YotogiClass.GetData(id2).termName);
  109. }
  110. }
  111. HashSet<int> hashSet4 = new HashSet<int>();
  112. keyArray2 = this.maid_.status.yotogiSkill.datas.GetKeyArray();
  113. for (int l = 0; l < keyArray2.Length; l++)
  114. {
  115. hashSet4.Add(keyArray2[l]);
  116. }
  117. foreach (int item4 in backUpStatus.skill_id_list)
  118. {
  119. hashSet4.Remove(item4);
  120. }
  121. bool lockNTRPlay = GameMain.Instance.CharacterMgr.status.lockNTRPlay;
  122. foreach (int id3 in hashSet4)
  123. {
  124. Skill.Data data = Skill.Get(id3);
  125. if (data.IsResultDisplay(lockNTRPlay))
  126. {
  127. if (data.IsExecSeikeiken(this.maid_.status.seikeiken))
  128. {
  129. this.AddAcquiredSkill(data.name, data.termName);
  130. }
  131. }
  132. }
  133. this.fluctuation_status_parent_.Reposition();
  134. this.acquired_skill_parent_.Reposition();
  135. this.acquired_class_parent_.Reposition();
  136. this.acquired_attribute_parent_.Reposition();
  137. this.skill_unit_parent_.Reposition();
  138. this.StartAnime();
  139. if (this.yotogi_mgr_.is_new_yotogi_mode)
  140. {
  141. UTY.GetChildObject(base.root_obj, "SkillViewer", false).SetActive(false);
  142. }
  143. GameMain.Instance.CharacterMgr.status.CheckTrophyMaidStatus(this.maid_);
  144. this.acquired_class_parent_.Reposition();
  145. Utility.ResetNGUI(UTY.GetChildObject(this.acquired_class_parent_.transform.parent.parent.gameObject, "Contents", false).GetComponent<UIScrollView>());
  146. }
  147. public void Clear()
  148. {
  149. Action<GameObject> action = delegate(GameObject game_object)
  150. {
  151. Transform transform = game_object.transform;
  152. for (int i = 0; i < transform.childCount; i++)
  153. {
  154. UnityEngine.Object.Destroy(transform.GetChild(i).gameObject);
  155. }
  156. transform.DetachChildren();
  157. };
  158. action(this.fluctuation_status_parent_.gameObject);
  159. this.fluctuation_status_parent_.Reposition();
  160. action(this.acquired_skill_parent_.gameObject);
  161. this.acquired_skill_parent_.Reposition();
  162. action(this.acquired_class_parent_.gameObject);
  163. this.acquired_class_parent_.Reposition();
  164. Utility.ResetNGUI(UTY.GetChildObject(this.acquired_class_parent_.transform.parent.parent.gameObject, "Contents", false).GetComponent<UIScrollView>());
  165. action(this.acquired_attribute_parent_.gameObject);
  166. this.acquired_attribute_parent_.Reposition();
  167. action(this.skill_unit_parent_.gameObject);
  168. this.skill_unit_parent_.Reposition();
  169. }
  170. public void AddFluctuationStatus(string param_name, int value)
  171. {
  172. if (14 <= this.fluctuation_status_parent_.transform.childCount || value == 0)
  173. {
  174. return;
  175. }
  176. GameObject gameObject = Utility.CreatePrefab(this.fluctuation_status_parent_.gameObject, "SceneYotogi/Result/Prefab/FluctuationOfParameterUnit", true);
  177. FluctuationOfParameterUnit component = gameObject.GetComponent<FluctuationOfParameterUnit>();
  178. component.AnimeTime = this.AnimeTime;
  179. component.SetTextName(param_name);
  180. component.SetTextNameTerm("MaidStatus/" + param_name);
  181. component.SetTextValue(value);
  182. component.SetBGVisible((this.fluctuation_status_parent_.transform.childCount + 1) / 2 % 2 == 0);
  183. this.fluctuation_status_parent_.repositionNow = true;
  184. }
  185. public void AddYotogiClass(string name, string termName)
  186. {
  187. UIGrid uigrid = this.acquired_class_parent_;
  188. GameObject gameObject = Utility.CreatePrefab(uigrid.gameObject, "SceneYotogi/Result/Prefab/AcquiredYotogiClassUnit", true);
  189. AcquiredSkillUnit component = gameObject.GetComponent<AcquiredSkillUnit>();
  190. component.SetText(name);
  191. component.SetTerm(termName);
  192. component.SetBGVisible(uigrid.transform.childCount % 2 != 0);
  193. uigrid.repositionNow = true;
  194. }
  195. public void AddAcquiredSkill(string name, string termName)
  196. {
  197. GameObject gameObject = Utility.CreatePrefab(this.acquired_skill_parent_.gameObject, "SceneYotogi/Result/Prefab/AcquiredSkillUnit", true);
  198. AcquiredSkillUnit component = gameObject.GetComponent<AcquiredSkillUnit>();
  199. component.SetText(name);
  200. component.SetTerm(termName);
  201. component.SetBGVisible(this.acquired_skill_parent_.transform.childCount % 2 != 0);
  202. this.acquired_skill_parent_.repositionNow = true;
  203. }
  204. public void AddAcquiredAttribute(string name, string termName)
  205. {
  206. if (5 <= this.acquired_attribute_parent_.transform.childCount)
  207. {
  208. return;
  209. }
  210. GameObject gameObject = Utility.CreatePrefab(this.acquired_attribute_parent_.gameObject, "SceneYotogi/Result/Prefab/AcquiredAttributeUnit", true);
  211. AcquiredAttributeUnit component = gameObject.GetComponent<AcquiredAttributeUnit>();
  212. component.SetText(name);
  213. component.SetTerm(termName);
  214. this.acquired_attribute_parent_.repositionNow = true;
  215. }
  216. public YotogiSkillUnit AddSkillUnit(Yotogi.SkillDataPair skill_data_pair)
  217. {
  218. if (7 <= this.skill_unit_parent_.transform.childCount)
  219. {
  220. return null;
  221. }
  222. GameObject gameObject = Utility.CreatePrefab(this.skill_unit_parent_.gameObject, "SceneYotogi/SkillSelect/Prefab/YotogiSkillUnit", true);
  223. UTY.GetChildObject(gameObject, "Button", false).SetActive(false);
  224. UTY.GetChildObject(gameObject, "Description/BG", false).GetComponent<UISprite>().alpha = 1f;
  225. YotogiSkillUnit component = gameObject.GetComponent<YotogiSkillUnit>();
  226. component.SetSkillData(this.maid_, skill_data_pair.base_data, skill_data_pair.skill_data, null, null);
  227. this.skill_unit_parent_.repositionNow = true;
  228. return component;
  229. }
  230. public void StartAnime()
  231. {
  232. Transform transform = this.fluctuation_status_parent_.gameObject.transform;
  233. for (int i = 0; i < transform.childCount; i++)
  234. {
  235. transform.GetChild(i).GetComponent<FluctuationOfParameterUnit>().StartAnime();
  236. }
  237. if (!this.yotogi_mgr_.is_new_yotogi_mode)
  238. {
  239. transform = this.skill_unit_parent_.gameObject.transform;
  240. for (int j = 0; j < transform.childCount; j++)
  241. {
  242. transform.GetChild(j).GetComponent<YotogiSkillUnit>().StartAnime();
  243. }
  244. }
  245. }
  246. private void OnClickNext()
  247. {
  248. if (this.yotogi_mgr_.null_mgr.IsExistNextLabel())
  249. {
  250. this.Finish();
  251. }
  252. }
  253. protected override void OnFinish()
  254. {
  255. base.OnFinish();
  256. GameMain.Instance.SoundMgr.VoiceStopAll();
  257. GameMain.Instance.SoundMgr.StopSe();
  258. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  259. GameMain.Instance.ScriptMgr.ClearForcExecWaitEvent();
  260. for (int i = 0; i < characterMgr.GetMaidCount(); i++)
  261. {
  262. Maid maid = characterMgr.GetMaid(i);
  263. if (maid != null)
  264. {
  265. maid.FaceAnime("通常", 0f, 0);
  266. maid.FaceBlend("無し");
  267. maid.body0.SetMaskMode(TBody.MaskMode.None);
  268. for (int j = 10; j <= 20; j++)
  269. {
  270. maid.body0.MulTexRemove("body", 0, "_MainTex", j);
  271. maid.body0.MulTexRemove("body", 0, "_ShadowTex", j);
  272. maid.body0.MulTexRemove("head", 5, "_MainTex", j);
  273. maid.body0.MulTexRemove("head", 5, "_ShadowTex", j);
  274. }
  275. maid.body0.MulTexRemove("body", 0, "_MainTex", 24);
  276. maid.body0.MulTexRemove("body", 0, "_ShadowTex", 24);
  277. maid.body0.MulTexProc("body");
  278. maid.body0.MulTexProc("head");
  279. }
  280. }
  281. this.yotogi_mgr_.ResetWorld();
  282. }
  283. protected override void OnFadeEnd()
  284. {
  285. bool flag = !this.yotogi_mgr_.IsAllCharaBusy();
  286. if (flag)
  287. {
  288. GameMain.Instance.MainLight.Reset();
  289. GameMain.Instance.CharacterMgr.ResetCharaPosAll();
  290. GameMain.Instance.MainCamera.Reset(CameraMain.CameraType.Target, true);
  291. GameMain.Instance.SoundMgr.VoiceStopAll();
  292. this.yotogi_mgr_.UnVisibleMaidAndMan(true, true);
  293. this.maid_.Visible = true;
  294. if (this.yotogi_mgr_.null_mgr.IsExistNextLabel())
  295. {
  296. this.yotogi_mgr_.CallScreen(YotogiManager.CallScreenType.Null.ToString());
  297. }
  298. }
  299. }
  300. public float AnimeTime = 1.5f;
  301. private Maid maid_;
  302. private YotogiManager yotogi_mgr_;
  303. private YotogiCommonButtons common_buttons_;
  304. private YotogiParameterViewer paramenter_viewer_;
  305. private UITable fluctuation_status_parent_;
  306. private UIGrid acquired_skill_parent_;
  307. private UIGrid acquired_class_parent_;
  308. private UIGrid acquired_attribute_parent_;
  309. private UIGrid skill_unit_parent_;
  310. }