YotogiResultManager.cs 12 KB

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