YotogiOldResultManager.cs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. using System;
  2. using System.Collections.Generic;
  3. using MaidStatus;
  4. using MaidStatus.Old;
  5. using UnityEngine;
  6. using wf;
  7. using Yotogis;
  8. public class YotogiOldResultManager : WfScreenChildren
  9. {
  10. public override void Awake()
  11. {
  12. base.Awake();
  13. this.yotogi_mgr_ = base.GetComponentInParent<YotogiOldManager>();
  14. this.common_buttons_ = UTY.GetChildObject(base.root_obj, "CommonPanel", false).GetComponent<YotogiCommonButtons>();
  15. this.common_buttons_.viwe_reset_btn.gameObject.SetActive(false);
  16. GameObject gameObject = Utility.CreatePrefab(base.root_obj, "SceneYotogi/Common/Prefab/Old/ParameterViewer", true);
  17. gameObject.transform.SetParent(UTY.GetChildObject(base.root_obj, "ParameterViewer", false).transform, false);
  18. gameObject.transform.localPosition = new Vector3(0f, 360f, 0f);
  19. this.paramenter_viewer_ = gameObject.GetComponent<YotogiOldParameterViewer>();
  20. this.paramenter_viewer_.SetCostumeButtonVisible(false);
  21. this.paramenter_viewer_.SetAttributeViewer(UTY.GetChildObject(base.root_obj.transform.parent.gameObject, "AttributeViewer", false));
  22. this.fluctuation_status_parent_ = UTY.GetChildObject(base.root_obj, "AcquiredParameterViewer/FluctuationOfParameter/FluctuationOfParameterParent", false).GetComponent<UITable>();
  23. this.acquired_skill_parent_ = UTY.GetChildObject(base.root_obj, "AcquiredParameterViewer/AcquiredSkill/AcquiredSkillParent", 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. YotogiOldManager.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))
  41. {
  42. hashSet.Add(play_skill_array[i].skill_pair.base_data.id);
  43. YotogiOldSkillUnit yotogiOldSkillUnit = this.AddSkillUnit(play_skill_array[i].skill_pair);
  44. int num = play_skill_array[i].skill_pair.param.expSystem.GetTotalExp() - play_skill_array[i].backup_total_exp;
  45. if (0 < num)
  46. {
  47. yotogiOldSkillUnit.SetExpAnime(play_skill_array[i].backup_total_exp, num, this.AnimeTime);
  48. }
  49. }
  50. }
  51. YotogiOldManager.BackUpStatus backUpStatus = this.yotogi_mgr_.GetBackUpStatus();
  52. YotogiOldPlay.Param param = YotogiOldPlay.Param.Create(this.maid_) - backUpStatus.param;
  53. this.AddFluctuationStatus("夜伽クラスレベル", param.yotogi_type_level);
  54. this.AddFluctuationStatus("夜伽クラスEXP", param.yotogi_type_total_exp);
  55. this.AddFluctuationStatus("奉仕", param.housi);
  56. this.AddFluctuationStatus("淫欲", param.inyoku);
  57. this.AddFluctuationStatus("M性", param.m_value);
  58. this.AddFluctuationStatus("変態", param.hentai);
  59. this.AddFluctuationStatus("可憐", param.lovely);
  60. this.AddFluctuationStatus("気品", param.elegance);
  61. this.AddFluctuationStatus("魅惑", param.charm);
  62. this.AddFluctuationStatus("指導", param.teach_rate / 10);
  63. HashSet<int> hashSet2 = new HashSet<int>();
  64. foreach (int item in this.maid_.status.propensitys.GetKeyArray())
  65. {
  66. hashSet2.Add(item);
  67. }
  68. foreach (int item2 in backUpStatus.propensity)
  69. {
  70. hashSet2.Remove(item2);
  71. }
  72. foreach (int id in hashSet2)
  73. {
  74. this.AddAcquiredAttribute(Propensity.GetData(id).drawName);
  75. }
  76. HashSet<int> hashSet3 = new HashSet<int>();
  77. int[] keyArray2 = this.maid_.status.yotogiSkill.oldDatas.GetKeyArray();
  78. for (int k = 0; k < keyArray2.Length; k++)
  79. {
  80. hashSet3.Add(keyArray2[k]);
  81. }
  82. foreach (int item3 in backUpStatus.skill_id_list)
  83. {
  84. hashSet3.Remove(item3);
  85. }
  86. bool lockNTRPlay = GameMain.Instance.CharacterMgr.status.lockNTRPlay;
  87. foreach (int skill_id in hashSet3)
  88. {
  89. Skill.Old.Data skillData = YotogiOld.GetSkillData(skill_id);
  90. if (!lockNTRPlay || (skillData.category != YotogiOld.Category.交換 && skillData.category != YotogiOld.Category.乱交))
  91. {
  92. if (!skillData.drunk_skill && !skillData.osioki_skill)
  93. {
  94. this.AddAcquiredSkill(skillData.name);
  95. }
  96. }
  97. }
  98. this.fluctuation_status_parent_.Reposition();
  99. this.acquired_skill_parent_.Reposition();
  100. this.acquired_attribute_parent_.Reposition();
  101. this.skill_unit_parent_.Reposition();
  102. if (0 < this.maid_.status.currentMind && this.maid_.status.OldStatus.condition != Condition.Osioki)
  103. {
  104. string text = "?_GIG_0001.ks";
  105. string text2 = "?_GIG_0002.ks";
  106. string text3 = string.Empty;
  107. if (this.maid_.status.OldStatus.frustration < 50)
  108. {
  109. int num2 = param.inyoku + param.housi + param.hentai + param.m_value;
  110. if (400 <= num2)
  111. {
  112. text3 = text;
  113. }
  114. }
  115. else
  116. {
  117. int num3 = param.inyoku + param.housi + param.hentai + param.m_value;
  118. if (num3 < 400)
  119. {
  120. text3 = text2;
  121. }
  122. }
  123. if (!string.IsNullOrEmpty(text3))
  124. {
  125. GameMain.Instance.ScriptMgr.EvalScript("global.__skill_first_file = '" + text3 + "';");
  126. GameMain.Instance.ScriptMgr.EvalScript("global.__skill_first_file_label = '';");
  127. GameMain.Instance.ScriptMgr.LoadYotogiScript("yotogi_skill_call_main.ks", string.Empty);
  128. }
  129. }
  130. this.StartAnime();
  131. }
  132. public void Clear()
  133. {
  134. Action<GameObject> action = delegate(GameObject game_object)
  135. {
  136. Transform transform = game_object.transform;
  137. for (int i = 0; i < transform.childCount; i++)
  138. {
  139. UnityEngine.Object.Destroy(transform.GetChild(i).gameObject);
  140. }
  141. transform.DetachChildren();
  142. };
  143. action(this.fluctuation_status_parent_.gameObject);
  144. this.fluctuation_status_parent_.Reposition();
  145. action(this.acquired_skill_parent_.gameObject);
  146. this.acquired_skill_parent_.Reposition();
  147. action(this.acquired_attribute_parent_.gameObject);
  148. this.acquired_attribute_parent_.Reposition();
  149. action(this.skill_unit_parent_.gameObject);
  150. this.skill_unit_parent_.Reposition();
  151. }
  152. public void AddFluctuationStatus(string param_name, int value)
  153. {
  154. if (14 <= this.fluctuation_status_parent_.transform.childCount || value == 0)
  155. {
  156. return;
  157. }
  158. GameObject gameObject = Utility.CreatePrefab(this.fluctuation_status_parent_.gameObject, "SceneYotogi/Result/Prefab/FluctuationOfParameterUnit", true);
  159. FluctuationOfParameterUnit component = gameObject.GetComponent<FluctuationOfParameterUnit>();
  160. component.AnimeTime = this.AnimeTime;
  161. component.SetTextName(param_name);
  162. component.SetTextValue(value);
  163. component.SetBGVisible((this.fluctuation_status_parent_.transform.childCount + 1) / 2 % 2 == 0);
  164. this.fluctuation_status_parent_.repositionNow = true;
  165. }
  166. public void AddAcquiredSkill(string name)
  167. {
  168. if (8 <= this.acquired_skill_parent_.transform.childCount)
  169. {
  170. return;
  171. }
  172. GameObject gameObject = Utility.CreatePrefab(this.acquired_skill_parent_.gameObject, "SceneYotogi/Result/Prefab/AcquiredSkillUnit", true);
  173. AcquiredSkillUnit component = gameObject.GetComponent<AcquiredSkillUnit>();
  174. component.SetText(name);
  175. component.SetBGVisible(this.acquired_skill_parent_.transform.childCount % 2 != 0);
  176. this.acquired_skill_parent_.repositionNow = true;
  177. }
  178. public void AddAcquiredAttribute(string name)
  179. {
  180. if (5 <= this.acquired_attribute_parent_.transform.childCount)
  181. {
  182. return;
  183. }
  184. GameObject gameObject = Utility.CreatePrefab(this.acquired_attribute_parent_.gameObject, "SceneYotogi/Result/Prefab/AcquiredAttributeUnit", true);
  185. AcquiredAttributeUnit component = gameObject.GetComponent<AcquiredAttributeUnit>();
  186. component.SetText(name);
  187. this.acquired_attribute_parent_.repositionNow = true;
  188. }
  189. public YotogiOldSkillUnit AddSkillUnit(YotogiOld.SkillDataPair skill_data_pair)
  190. {
  191. if (7 <= this.skill_unit_parent_.transform.childCount)
  192. {
  193. return null;
  194. }
  195. GameObject gameObject = Utility.CreatePrefab(this.skill_unit_parent_.gameObject, "SceneYotogi/SkillSelect/Prefab/Old/SkillUnit", true);
  196. UTY.GetChildObject(gameObject, "Button", false).SetActive(false);
  197. UTY.GetChildObject(gameObject, "Description/BG", false).GetComponent<UISprite>().alpha = 1f;
  198. YotogiOldSkillUnit component = gameObject.GetComponent<YotogiOldSkillUnit>();
  199. component.SetSkillData(this.maid_, skill_data_pair.base_data, skill_data_pair.param);
  200. this.skill_unit_parent_.repositionNow = true;
  201. return component;
  202. }
  203. public void StartAnime()
  204. {
  205. Transform transform = this.fluctuation_status_parent_.gameObject.transform;
  206. for (int i = 0; i < transform.childCount; i++)
  207. {
  208. transform.GetChild(i).GetComponent<FluctuationOfParameterUnit>().StartAnime();
  209. }
  210. transform = this.skill_unit_parent_.gameObject.transform;
  211. for (int j = 0; j < transform.childCount; j++)
  212. {
  213. transform.GetChild(j).GetComponent<YotogiOldSkillUnit>().StartAnime();
  214. }
  215. }
  216. private void OnClickNext()
  217. {
  218. if (this.yotogi_mgr_.null_mgr.IsExistNextLabel())
  219. {
  220. this.Finish();
  221. }
  222. }
  223. protected override void OnFinish()
  224. {
  225. base.OnFinish();
  226. GameMain.Instance.SoundMgr.VoiceStopAll();
  227. GameMain.Instance.SoundMgr.StopSe();
  228. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  229. GameMain.Instance.ScriptMgr.ClearForcExecWaitEvent();
  230. for (int i = 0; i < characterMgr.GetMaidCount(); i++)
  231. {
  232. Maid maid = characterMgr.GetMaid(i);
  233. if (maid != null)
  234. {
  235. maid.FaceAnime("通常", 0f, 0);
  236. maid.FaceBlend("無し");
  237. maid.body0.SetMaskMode(TBody.MaskMode.None);
  238. for (int j = 10; j <= 20; j++)
  239. {
  240. maid.body0.MulTexRemove("body", 0, "_MainTex", j);
  241. maid.body0.MulTexRemove("body", 0, "_ShadowTex", j);
  242. maid.body0.MulTexRemove("head", 5, "_MainTex", j);
  243. maid.body0.MulTexRemove("head", 5, "_ShadowTex", j);
  244. }
  245. maid.body0.MulTexProc("body");
  246. maid.body0.MulTexProc("head");
  247. }
  248. }
  249. this.yotogi_mgr_.ResetWorld();
  250. }
  251. protected override void OnFadeEnd()
  252. {
  253. bool flag = !this.yotogi_mgr_.IsAllCharaBusy();
  254. if (flag)
  255. {
  256. GameMain.Instance.MainLight.Reset();
  257. GameMain.Instance.CharacterMgr.ResetCharaPosAll();
  258. GameMain.Instance.MainCamera.Reset(CameraMain.CameraType.Target, true);
  259. GameMain.Instance.SoundMgr.VoiceStopAll();
  260. this.yotogi_mgr_.UnVisibleMaidAndMan(true, true);
  261. this.maid_.Visible = true;
  262. if (this.yotogi_mgr_.null_mgr.IsExistNextLabel())
  263. {
  264. this.yotogi_mgr_.CallScreen(YotogiOldManager.CallScreenType.Null.ToString());
  265. }
  266. }
  267. }
  268. public float AnimeTime = 1.5f;
  269. private Maid maid_;
  270. private YotogiOldManager yotogi_mgr_;
  271. private YotogiCommonButtons common_buttons_;
  272. private YotogiOldParameterViewer paramenter_viewer_;
  273. private UITable fluctuation_status_parent_;
  274. private UIGrid acquired_skill_parent_;
  275. private UIGrid acquired_attribute_parent_;
  276. private UIGrid skill_unit_parent_;
  277. }