StoryE7P3.cs 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. using System;
  2. using System.Collections;
  3. using I2.Loc;
  4. using UnityEngine;
  5. public class StoryE7P3 : BaseBehaviour
  6. {
  7. private bool _e7p6
  8. {
  9. get
  10. {
  11. return RoundStorage.Get("E7_P6", false);
  12. }
  13. set
  14. {
  15. RoundStorage.Set("E7_P6", value);
  16. }
  17. }
  18. private bool _e7p7
  19. {
  20. get
  21. {
  22. return RoundStorage.Get("E7_P7", false);
  23. }
  24. set
  25. {
  26. RoundStorage.Set("E7_P7", value);
  27. }
  28. }
  29. private bool _e7p8
  30. {
  31. get
  32. {
  33. return RoundStorage.Get("E7_P8", false);
  34. }
  35. set
  36. {
  37. RoundStorage.Set("E7_P8", value);
  38. }
  39. }
  40. private bool e7Finish
  41. {
  42. set
  43. {
  44. SaveStorage.Set("E7_Finish", value);
  45. }
  46. }
  47. private void Start()
  48. {
  49. if (!this._e7p6)
  50. {
  51. this._e7p6 = true;
  52. R.Audio.PlayVoiceOver("e7t7", delegate
  53. {
  54. this._e7p6Finished = true;
  55. }, false);
  56. }
  57. if (this._e7p7)
  58. {
  59. this._e7p8 = true;
  60. R.Audio.StopBGM(true);
  61. R.Audio.PlayVoiceOver("e7t9", delegate
  62. {
  63. this._e7p8Finished = true;
  64. }, false);
  65. }
  66. }
  67. private void Update()
  68. {
  69. if (!this._e7p10 && this._e7p6Finished && !this._e7p7)
  70. {
  71. this._e7p10 = true;
  72. base.StartCoroutine(this.P3Coroutine());
  73. }
  74. if (!this._e7p11 && this._e7p7 && this._e7p8Finished)
  75. {
  76. this._e7p11 = true;
  77. base.StartCoroutine(this.P4Coroutine());
  78. }
  79. }
  80. private void OnDestroy()
  81. {
  82. if (this._audioSource != null)
  83. {
  84. this._audioSource.Stop();
  85. this._audioSource.clip = null;
  86. }
  87. R.Ui.Volume.Hide();
  88. }
  89. private IEnumerator P3Coroutine()
  90. {
  91. yield return new WaitForSeconds(3f);
  92. R.Audio.StopBGM(true);
  93. yield return R.Audio.PlayVoiceOver("e7t11", null, false);
  94. yield return R.Ui.Volume.Show(0.5f);
  95. yield return R.Ui.Volume.BarAnim(1f, 0.5f);
  96. yield return R.Ui.Volume.Hide();
  97. yield return R.Audio.PlayVoiceOver("e7t12", null, false);
  98. yield return R.Audio.PlayVoiceOver("e7t13", null, false);
  99. YieldInstruction coroutine = R.Audio.PlayVoiceOver("e7t14", null, false);
  100. yield return R.Ui.Volume.Show(1f);
  101. yield return R.Ui.Volume.BarAnim(0.5f, 0.5f);
  102. yield return R.Ui.Volume.Hide();
  103. yield return coroutine;
  104. this.guide.SetActive(true);
  105. yield return new WaitForSeconds(1f);
  106. yield return R.Audio.PlayVoiceOver("e7t15", null, false);
  107. this.guide.SetActive(false);
  108. yield return new WaitForSeconds(1f);
  109. yield return base.StartCoroutine(this.P4Coroutine());
  110. yield break;
  111. }
  112. private IEnumerator P4Coroutine()
  113. {
  114. yield return R.Audio.PlayVoiceOver("e7t16", null, false);
  115. yield return new WaitForSeconds(5f);
  116. if (UIAudioLanguage.IsChinese)
  117. {
  118. this._audioSource = R.Audio.PlayEffect(473, null);
  119. yield return new WaitForSeconds(this._audioSource.clip.length);
  120. yield return new WaitForSeconds(5f);
  121. this._audioSource = R.Audio.PlayEffect(475, null);
  122. yield return new WaitForSeconds(this._audioSource.clip.length);
  123. }
  124. else
  125. {
  126. this._audioSource = R.Audio.PlayEffect(481, null);
  127. yield return new WaitForSeconds(this._audioSource.clip.length);
  128. yield return new WaitForSeconds(5f);
  129. this._audioSource = R.Audio.PlayEffect(483, null);
  130. yield return new WaitForSeconds(this._audioSource.clip.length);
  131. }
  132. yield return new WaitForSeconds(30f);
  133. R.Trophy.AwardTrophy(7);
  134. this.gate.openType = SceneGate.OpenType.None;
  135. yield return R.Audio.PlayVoiceOver("e7t19", null, false);
  136. yield return R.Audio.PlayVoiceOver("e7t20", null, false);
  137. yield return R.Ui.Terminal.OpenWithAnim(null);
  138. yield return R.Ui.Terminal.PrintShellPrompt();
  139. yield return R.Ui.Terminal.Println(ScriptLocalization.Story.e7s1, 0.1f);
  140. yield return R.Ui.Terminal.CloseWithAnim();
  141. this.copperCup.SetActive(true);
  142. while (this.copperCup != null)
  143. {
  144. yield return null;
  145. }
  146. R.Trophy.AwardTrophy(8);
  147. yield return R.Audio.PlayVoiceOver("e7t21", null, false);
  148. this.silverCup.SetActive(true);
  149. while (this.silverCup != null)
  150. {
  151. yield return null;
  152. }
  153. R.Trophy.AwardTrophy(9);
  154. yield return R.Audio.PlayVoiceOver("e7t22", null, false);
  155. CameraFilterUtils.Create<CameraFilterPack_VHS_Tracking>(null);
  156. yield return R.Ui.Terminal.OpenWithAnim(null);
  157. yield return R.Ui.Terminal.PrintShellPrompt();
  158. yield return R.Ui.Terminal.Println(ScriptLocalization.Story.e7s2, 0.1f);
  159. yield return R.Ui.Terminal.ShowProgressBar(0f);
  160. YieldInstruction voiceOver = R.Audio.PlayVoiceOver("e7t23", null, false);
  161. R.Ui.Terminal.SetProgressBarValueWithAnim(0.99f, 40f);
  162. yield return voiceOver;
  163. R.Ui.Terminal.HideProgressBar();
  164. R.Ui.Terminal.CloseWithoutAnim();
  165. SingletonMono<WorldTime>.Instance.TimeFrozenByFixedFrame(10, WorldTime.FrozenArgs.FrozenType.Player, false);
  166. R.Audio.StopBGM(true);
  167. yield return new WaitForSeconds(5f);
  168. yield return R.Ui.Terminal.OpenWithAnim(new Color?(Color.green));
  169. yield return R.Ui.Terminal.Println(ScriptLocalization.Story.e7s3.Split(new char[]
  170. {
  171. '\n'
  172. })[0], 0.1f);
  173. yield return R.Ui.Terminal.PrintShellPrompt();
  174. yield return R.Ui.Terminal.Println(ScriptLocalization.Story.e7s3.Split(new char[]
  175. {
  176. '\n'
  177. })[1], 0.1f);
  178. yield return R.Ui.Terminal.SetProgressBarValueWithAnim(1f, 3f);
  179. yield return R.Ui.Terminal.PrintShellPrompt();
  180. yield return R.Ui.Terminal.Println(ScriptLocalization.Story.e7s4, 0.1f);
  181. this.e7Finish = true;
  182. R.Trophy.AwardTrophy(6);
  183. yield return SaveManager.ModifySaveData(delegate(GameData gameData)
  184. {
  185. if (gameData.ThisSaveValidStorage.ContainsKey("E7_Finish"))
  186. {
  187. gameData.ThisSaveValidStorage["E7_Finish"] = 1;
  188. }
  189. else
  190. {
  191. gameData.ThisSaveValidStorage.Add("E7_Finish", 1);
  192. }
  193. });
  194. yield return R.Ui.Terminal.HideProgressBar();
  195. yield return R.Ui.Terminal.Clear();
  196. yield return R.Ui.Terminal.Println(ScriptLocalization.Story.e7s5, 0.1f);
  197. yield return new WaitForSeconds(3f);
  198. R.Ui.BlackScene.Alpha = 1f;
  199. yield return R.Ui.Terminal.CloseWithAnim();
  200. yield return new WaitForSeconds(3f);
  201. R.Ui.BlackScene.FadeTransparent(0.3f, false);
  202. yield return R.Ui.Terminal.OpenWithAnim(new Color?(Color.green));
  203. yield return R.Ui.Terminal.PrintShellPrompt();
  204. yield return R.Ui.Terminal.Println(ScriptLocalization.Story.e7s6, 0.1f);
  205. yield return new WaitForSeconds(1f);
  206. R.Ui.BlackScene.FadeBlack(0.3f, false);
  207. yield return R.Ui.Terminal.CloseWithAnim();
  208. yield return new WaitForSeconds(5f);
  209. CameraFilterUtils.Remove<CameraFilterPack_VHS_Tracking>(null);
  210. SingletonMono<WorldTime>.Instance.FrozenResume();
  211. R.Ui.BlackScene.FadeTransparent(0.3f, false);
  212. R.Ui.LevelSelect.OpenWithAnim(true, true);
  213. yield break;
  214. }
  215. [SerializeField]
  216. private GameObject copperCup;
  217. [SerializeField]
  218. private GameObject silverCup;
  219. private bool _e7p6Finished;
  220. private bool _e7p8Finished;
  221. private bool _e7p10;
  222. private bool _e7p11;
  223. [SerializeField]
  224. private SceneGate gate;
  225. [SerializeField]
  226. private GameObject guide;
  227. private AudioSource _audioSource;
  228. }