SceneCloudNineArtGallery.cs 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782
  1. //================================================================================
  2. //
  3. //================================================================================
  4. using UnityEngine;
  5. using System.Collections;
  6. //================================================================================
  7. //
  8. //================================================================================
  9. namespace ReaderRabbit
  10. {
  11. //================================================================================
  12. //
  13. //================================================================================
  14. public class SceneCloudNineArtGallery : SceneCommon
  15. {
  16. //================================================================================
  17. //
  18. //================================================================================
  19. private enum Characters
  20. {
  21. Reader = CharactersCommon.Reader,
  22. Sam = CharactersCommon.Sam,
  23. Paige = CharactersCommon.Paige,
  24. Chester = CharactersCommon.Chester,
  25. MissCirrus = CharactersCommon.StartSceneSpecific,
  26. MissCirrus_NoHat,
  27. }
  28. //================================================================================
  29. //
  30. //================================================================================
  31. private enum Items
  32. {
  33. HatTakenOff = 0,
  34. }
  35. //================================================================================
  36. //
  37. //================================================================================
  38. private const int NUMBER_OF_ANIMATION_FRAMES_TO_GIVE_PRIZE = 4;
  39. [SerializeField] private CloudNinePaintingFrame m_GreenPainting;
  40. [SerializeField] private CloudNinePaintingFrame m_RedPainting;
  41. [SerializeField] private CloudNinePaintingFrame m_PinkPainting;
  42. [SerializeField] private CloudNinePaintingFrame m_BluePainting;
  43. [SerializeField] private CloudNinePaintingFrame m_CyanPainting;
  44. private CloudNinePaintingFrame m_CurrentAnimatedFrame;
  45. private int m_IdleHelpIndex;
  46. private const int MAX_IDLE_INDEX = 2;
  47. private Characters m_CurrentMissCirrus;
  48. private const int MISS_CIRRUS_TAKING_OFF_HAT_INDEX = 3;
  49. private int m_HatClickCount;
  50. //================================================================================
  51. //
  52. //================================================================================
  53. protected override void Start()
  54. {
  55. base.Start();
  56. // ******************** TODO: REMOVE ME, I'M DEBUG CODE ********************
  57. //m_IsFirstTime = true;
  58. //PlayerData.Instance().CNAG_DidSayAct4Speech = false;
  59. // ******************** TODO: REMOVE ME, I'M DEBUG CODE ********************
  60. //============================================================================
  61. //
  62. //============================================================================
  63. int lang = PlayerPrefs.GetInt("language");
  64. if (lang == 0)
  65. m_SpeechFolder = "Resources_DA/Audio/CloudNineArtGallery_Speech";
  66. else if (lang == 1)
  67. m_SpeechFolder = "Resources_EN/Audio/CloudNineArtGallery_Speech";
  68. else if (lang == 2)
  69. m_SpeechFolder = "Resources_NO/Audio/CloudNineArtGallery_Speech";
  70. else if (lang == 3)
  71. m_SpeechFolder = "Resources_SP/Audio/CloudNineArtGallery_Speech";
  72. else if (lang == 4)
  73. m_SpeechFolder = "Resources_SW/Audio/CloudNineArtGallery_Speech";
  74. //============================================================================
  75. //
  76. //============================================================================
  77. PlayerData.Instance().SetVisitedCloudNineArtGallery(true);
  78. PlayerData.Instance().SetCurrentLocation(Location.CloudNineArtGallery);
  79. AudioManager.Instance().PlayBGM("BGM_CloudNineArtGallery");
  80. m_CurrentAnimatedFrame = m_GreenPainting;
  81. PlayNextFrame();
  82. m_IdleHelpIndex = 0;
  83. m_HatClickCount = 0;
  84. ++PlayerData.Instance().CNAG_VisitCount;
  85. if (PlayerData.Instance().CNAG_VisitCount > 100)
  86. PlayerData.Instance().CNAG_VisitCount = 1;
  87. }
  88. //================================================================================
  89. //
  90. //================================================================================
  91. public override void UpdateOnce()
  92. {
  93. UpdateMissCirrus();
  94. if (m_IsFirstTime)
  95. PlayerData.Instance().CNAG_GameState = 1;
  96. if ((PlayerData.Instance().CNAG_GameState == 2 && PlayerData.Instance().DidVisitAmazingArtGallery())
  97. || PlayerData.Instance().CNAG_GameState == 3)
  98. {
  99. if (IsEditedPagesHigherThanMinimum())
  100. {
  101. // Finished moving picture, not taken hat.
  102. PlayerData.Instance().CNAG_GameState = 4;
  103. }
  104. else
  105. {
  106. // Entered activity but didn't finish one moving picture.
  107. PlayerData.Instance().CNAG_GameState = 3;
  108. }
  109. }
  110. }
  111. //================================================================================
  112. //
  113. //================================================================================
  114. private bool IsEditedPagesHigherThanMinimum()
  115. {
  116. return m_BluePainting.TotalNumberOfFrames >= NUMBER_OF_ANIMATION_FRAMES_TO_GIVE_PRIZE || m_CyanPainting.TotalNumberOfFrames >= NUMBER_OF_ANIMATION_FRAMES_TO_GIVE_PRIZE;
  117. }
  118. //================================================================================
  119. //
  120. //================================================================================
  121. private int GetEditedPagesCount()
  122. {
  123. return m_BluePainting.TotalNumberOfFrames + m_CyanPainting.TotalNumberOfFrames;
  124. }
  125. //================================================================================
  126. //
  127. //================================================================================
  128. public void PlayNextFrame()
  129. {
  130. m_CurrentAnimatedFrame.Play();
  131. if (m_CurrentAnimatedFrame == m_GreenPainting)
  132. {
  133. m_CurrentAnimatedFrame = m_RedPainting;
  134. }
  135. else if (m_CurrentAnimatedFrame == m_RedPainting)
  136. {
  137. m_CurrentAnimatedFrame = m_PinkPainting;
  138. }
  139. else if (m_CurrentAnimatedFrame == m_PinkPainting)
  140. {
  141. m_CurrentAnimatedFrame = m_BluePainting;
  142. }
  143. else if (m_CurrentAnimatedFrame == m_BluePainting)
  144. {
  145. m_CurrentAnimatedFrame = m_CyanPainting;
  146. }
  147. else if (m_CurrentAnimatedFrame == m_CyanPainting)
  148. {
  149. m_CurrentAnimatedFrame = m_GreenPainting;
  150. }
  151. }
  152. //================================================================================
  153. //
  154. //================================================================================
  155. private void UpdateMissCirrus()
  156. {
  157. if (PlayerData.Instance().CNAG_GameState < 5 && !PlayerData.Instance().CNAG_DidSayAct4Speech)
  158. {
  159. m_CharacterAnimations[(int)Characters.MissCirrus].gameObject.SetActive(true);
  160. m_CharacterAnimations[(int)Characters.MissCirrus_NoHat].gameObject.SetActive(false);
  161. m_CurrentMissCirrus = Characters.MissCirrus;
  162. m_Items[(int)Items.HatTakenOff].gameObject.SetActive(false);
  163. m_OtherCharacterRectangles[0].Enable();
  164. m_OtherCharacterRectangles[1].Enable();
  165. }
  166. else
  167. {
  168. m_CharacterAnimations[(int)Characters.MissCirrus].gameObject.SetActive(false);
  169. m_CharacterAnimations[(int)Characters.MissCirrus_NoHat].gameObject.SetActive(true);
  170. m_CurrentMissCirrus = Characters.MissCirrus_NoHat;
  171. m_Items[(int)Items.HatTakenOff].gameObject.SetActive(PlayerData.Instance().GetHat() == ItemState.None);
  172. m_OtherCharacterRectangles[0].Enable();
  173. m_OtherCharacterRectangles[1].Disable();
  174. }
  175. }
  176. //================================================================================
  177. //
  178. //================================================================================
  179. protected override void StartedFadeOut()
  180. {
  181. base.StartedFadeIn();
  182. if (m_CurrentInteractiveRectangle != null)
  183. {
  184. SceneAmazingArtGallery.SelectedPaintingFrame = m_CurrentInteractiveRectangle.GetActionParameter(1);
  185. }
  186. }
  187. //================================================================================
  188. //
  189. //================================================================================
  190. protected override void PlayFirstEvent()
  191. {
  192. UpdateOnce();
  193. if (m_IsFirstTime)
  194. {
  195. NewSequence();
  196. SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "16300");
  197. SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "16315");
  198. SetSequence(2, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16330");
  199. SetSequence(3, EventSequenceItem.EventSequenceType.Callback, DoneFirstTime);
  200. StartSequence(4);
  201. }
  202. else
  203. {
  204. if (PlayerData.Instance().GetPreviousLocation() == Location.DowntownCloudNine)
  205. {
  206. switch (PlayerData.Instance().CNAG_GameState)
  207. {
  208. case 1:
  209. NewSequence();
  210. SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "16300");
  211. SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "16315");
  212. SetSequence(2, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16330");
  213. SetSequence(3, EventSequenceItem.EventSequenceType.Callback, DoneFirstTime);
  214. StartSequence(4);
  215. break;
  216. case 2:
  217. NewSequence();
  218. SetSequence(0, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16415");
  219. SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "16416");
  220. SetSequence(2, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16417");
  221. SetSequence(3, EventSequenceItem.EventSequenceType.Callback, DoneFirstTime);
  222. StartSequence(4);
  223. break;
  224. case 3:
  225. NewSequence();
  226. SetSequence(0, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16420");
  227. int randomValue = Random.Range(0, 100);
  228. if (randomValue < 50)
  229. SetSequence(1, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16421");
  230. else
  231. SetSequence(1, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16422");
  232. SetSequence(2, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16424");
  233. SetSequence(3, EventSequenceItem.EventSequenceType.Callback, DoneFirstTime);
  234. StartSequence(4);
  235. break;
  236. case 4:
  237. case 5:
  238. if (!PlayerData.Instance().CNAG_DidSaySS4Speech)
  239. {
  240. PlayerData.Instance().CNAG_DidSaySS4Speech = true;
  241. NewSequence();
  242. SetSequence(0, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16430");
  243. SetSequence(1, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16431");
  244. SetSequence(2, EventSequenceItem.EventSequenceType.Callback, DoneFirstTime);
  245. StartSequence(3);
  246. }
  247. break;
  248. }
  249. }
  250. else
  251. {
  252. // From the flipbook activity.
  253. if (PlayerData.Instance().CNAG_GameState == 3)
  254. {
  255. MissCirrusClick3(true);
  256. }
  257. else if (PlayerData.Instance().CNAG_GameState == 4 || PlayerData.Instance().CNAG_GameState == 5)
  258. {
  259. if (!PlayerData.Instance().CNAG_DidSayAct4Speech)
  260. {
  261. PlayerData.Instance().CNAG_DidSayAct4Speech = true;
  262. int sequence = 0;
  263. NewSequence();
  264. SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.MissCirrus, "16355");
  265. SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.MissCirrus, "16356");
  266. SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16357");
  267. SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.MissCirrus, "16358");
  268. SetSequence(sequence++, EventSequenceItem.EventSequenceType.Animation,
  269. Characters.MissCirrus,
  270. MISS_CIRRUS_TAKING_OFF_HAT_INDEX,
  271. m_CharacterAnimations[(int)Characters.MissCirrus].AnimationCyclesString[MISS_CIRRUS_TAKING_OFF_HAT_INDEX]);
  272. SetSequence(sequence++, EventSequenceItem.EventSequenceType.Callback, UpdateMissCirrus);
  273. SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "16875");
  274. SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.MissCirrus_NoHat, "16882");
  275. if (PlayerData.Instance().DidVisitRockHead())
  276. SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16790");
  277. SetSequence(sequence++, EventSequenceItem.EventSequenceType.Callback, DoneFirstTime);
  278. StartSequence(sequence);
  279. }
  280. else
  281. {
  282. int index = PlayerData.Instance().CNAG_VisitCount % 5;
  283. string[] possibleNumbers = { "16380", "16381", "16382", "16383", "16384" };
  284. NewSequence();
  285. SetSequence(0, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, possibleNumbers[index]);
  286. StartSequence(1);
  287. }
  288. }
  289. }
  290. }
  291. }
  292. //================================================================================
  293. //
  294. //================================================================================
  295. protected override void OnIdle()
  296. {
  297. ++m_IdleHelpIndex;
  298. if (m_IdleHelpIndex > MAX_IDLE_INDEX)
  299. m_IdleHelpIndex = 0;
  300. switch (m_IdleHelpIndex)
  301. {
  302. case 0:
  303. NewSequence();
  304. SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16600");
  305. SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "16601");
  306. StartSequence(2);
  307. break;
  308. case 1:
  309. NewSequence();
  310. SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "16605");
  311. SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16606");
  312. StartSequence(2);
  313. break;
  314. case 2:
  315. NewSequence();
  316. SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "16610");
  317. SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16611");
  318. StartSequence(2);
  319. break;
  320. }
  321. }
  322. //================================================================================
  323. //
  324. //================================================================================
  325. public override void SpeechReader()
  326. {
  327. switch (PlayerData.Instance().CNAG_GameState)
  328. {
  329. case 1:
  330. ReaderClick1();
  331. break;
  332. case 2:
  333. case 3:
  334. ReaderClick2();
  335. break;
  336. case 4:
  337. ReaderClick4();
  338. break;
  339. case 5:
  340. ReaderClick5();
  341. break;
  342. }
  343. }
  344. //================================================================================
  345. //
  346. //================================================================================
  347. private void ReaderClick1()
  348. {
  349. NewSequence();
  350. SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16650");
  351. SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16651");
  352. SetSequence(2, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16654");
  353. SetSequence(3, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16671");
  354. SetSequence(4, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16684");
  355. SetSequence(5, EventSequenceItem.EventSequenceType.Callback, MissCirrusSpeechDone);
  356. StartSequence(6);
  357. }
  358. //================================================================================
  359. //
  360. //================================================================================
  361. private void ReaderClick2()
  362. {
  363. int randomValue = Random.Range(0, 100);
  364. if (randomValue < 50)
  365. {
  366. NewSequence();
  367. SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16680");
  368. SetSequence(1, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16775");
  369. SetSequence(2, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16682");
  370. SetSequence(3, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16683");
  371. SetSequence(4, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16684");
  372. StartSequence(5);
  373. }
  374. else
  375. {
  376. NewSequence();
  377. SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "16780");
  378. SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16785");
  379. StartSequence(2);
  380. }
  381. }
  382. //================================================================================
  383. //
  384. //================================================================================
  385. private void ReaderClick4()
  386. {
  387. if (PlayerData.Instance().DidVisitRockHead())
  388. {
  389. NewSequence();
  390. SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16790");
  391. StartSequence(1);
  392. }
  393. else
  394. {
  395. ReaderClick5();
  396. }
  397. }
  398. //================================================================================
  399. //
  400. //================================================================================
  401. private void ReaderClick5()
  402. {
  403. int randomValue = Random.Range(0, 100);
  404. if (randomValue < 50)
  405. {
  406. NewSequence();
  407. SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "16795");
  408. SetSequence(1, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16800");
  409. StartSequence(2);
  410. }
  411. else
  412. {
  413. NewSequence();
  414. SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "16780");
  415. SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16785");
  416. StartSequence(2);
  417. }
  418. }
  419. //================================================================================
  420. //
  421. //================================================================================
  422. private void MissCirrusSpeechDone()
  423. {
  424. if (PlayerData.Instance().CNAG_GameState == 1)
  425. PlayerData.Instance().CNAG_GameState = 2;
  426. }
  427. //================================================================================
  428. //
  429. //================================================================================
  430. public override void SpeechPaige()
  431. {
  432. switch (PlayerData.Instance().CNAG_GameState)
  433. {
  434. case 1:
  435. case 2:
  436. NewSequence();
  437. SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Paige, "16750");
  438. StartSequence(1);
  439. break;
  440. case 3:
  441. NewSequence();
  442. SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Paige, "16751");
  443. StartSequence(1);
  444. break;
  445. case 4:
  446. case 5:
  447. NewSequence();
  448. SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Paige, "16752");
  449. StartSequence(1);
  450. break;
  451. }
  452. }
  453. //================================================================================
  454. //
  455. //================================================================================
  456. protected override void OnOtherCharacterInteraction()
  457. {
  458. if (m_CurrentInteractiveRectangle.GetActionParameter(0) == "MissCirrus")
  459. {
  460. switch (PlayerData.Instance().CNAG_GameState)
  461. {
  462. case 1:
  463. MissCirrusClick1();
  464. break;
  465. case 2:
  466. MissCirrusClick2();
  467. break;
  468. case 3:
  469. MissCirrusClick3(false);
  470. break;
  471. case 4:
  472. case 5:
  473. MissCirrusClick4();
  474. break;
  475. }
  476. }
  477. else if (m_CurrentInteractiveRectangle.GetActionParameter(0) == "MissCirrusHat")
  478. {
  479. HatClick();
  480. }
  481. }
  482. //================================================================================
  483. //
  484. //================================================================================
  485. private void MissCirrusClick1()
  486. {
  487. NewSequence();
  488. SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16650");
  489. SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16651");
  490. SetSequence(2, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16654");
  491. SetSequence(3, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16671");
  492. SetSequence(4, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16684");
  493. SetSequence(5, EventSequenceItem.EventSequenceType.Callback, MissCirrusSpeechDone);
  494. StartSequence(6);
  495. }
  496. //================================================================================
  497. //
  498. //================================================================================
  499. private void MissCirrusClick2()
  500. {
  501. //NewSequence();
  502. //SetSequence(0, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16670");
  503. //SetSequence(1, EventSequenceItem.EventSequenceType.Video, VideoType.ArtGallery);
  504. //SetSequence(2, EventSequenceItem.EventSequenceType.Callback, GotoBluePainting);
  505. //StartSequence(3);
  506. GotoBluePainting();
  507. }
  508. //================================================================================
  509. //
  510. //================================================================================
  511. private void GotoBluePainting()
  512. {
  513. // HACK: Goto blue painting.
  514. SetCurrentToNavigation("AmazingArtGallery");
  515. m_CurrentInteractiveRectangle.SetActionType(ActionType.Navigation);
  516. m_CurrentInteractiveRectangle.SetActionParameter(0, "AmazingArtGallery");
  517. m_CurrentInteractiveRectangle.SetActionParameter(1, "Blue");
  518. OnNavigation();
  519. }
  520. //================================================================================
  521. //
  522. //================================================================================
  523. private void MissCirrusClick3(bool fromPlayFirstEvent)
  524. {
  525. int sequence = 0;
  526. NewSequence();
  527. if (fromPlayFirstEvent)
  528. {
  529. if (PlayerData.Instance().CNAG_IsFirstEditSpeech && GetEditedPagesCount() > 0)
  530. {
  531. PlayerData.Instance().CNAG_IsFirstEditSpeech = false;
  532. SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16350");
  533. }
  534. }
  535. if (GetEditedPagesCount() == 0)
  536. {
  537. SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16710");
  538. SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16690");
  539. }
  540. else
  541. {
  542. int randomValue = Random.Range(0, 100);
  543. if (randomValue < 50)
  544. SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16650");
  545. else
  546. SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16651");
  547. if (PlayerData.Instance().CNAG_IsFromSample)
  548. {
  549. SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16730");
  550. SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16731");
  551. }
  552. else
  553. {
  554. if (GetEditedPagesCount() == 1)
  555. {
  556. SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16705");
  557. SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16706");
  558. SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16424");
  559. }
  560. else if (GetEditedPagesCount() > 1 && GetEditedPagesCount() < 6)
  561. {
  562. SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16421");
  563. SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16424");
  564. }
  565. }
  566. }
  567. StartSequence(sequence);
  568. }
  569. //================================================================================
  570. //
  571. //================================================================================
  572. private void MissCirrusClick4()
  573. {
  574. NewSequence();
  575. SetSequence(0, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16730");
  576. SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16731");
  577. StartSequence(2);
  578. }
  579. //================================================================================
  580. //
  581. //================================================================================
  582. public void HatClick()
  583. {
  584. ++m_HatClickCount;
  585. // TODO: kCOMSoftClickSfxID.
  586. switch (PlayerData.Instance().CNAG_GameState)
  587. {
  588. case 1:
  589. m_HatClickCount = 0;
  590. NewSequence();
  591. SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "16875");
  592. SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16650");
  593. SetSequence(2, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16651");
  594. SetSequence(3, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16654");
  595. SetSequence(4, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16671");
  596. SetSequence(5, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16684");
  597. SetSequence(6, EventSequenceItem.EventSequenceType.Callback, MissCirrusSpeechDone);
  598. StartSequence(7);
  599. break;
  600. case 2:
  601. case 3:
  602. if (PlayerData.Instance().DidVisitRockHead())
  603. {
  604. if (m_HatClickCount == 1)
  605. {
  606. NewSequence();
  607. SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16880");
  608. SetSequence(1, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16881");
  609. SetSequence(2, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16882");
  610. SetSequence(3, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16883");
  611. StartSequence(4);
  612. }
  613. else
  614. {
  615. NewSequence();
  616. SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16900");
  617. SetSequence(1, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16901");
  618. SetSequence(2, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16691");
  619. StartSequence(3);
  620. }
  621. }
  622. else
  623. {
  624. NewSequence();
  625. SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16910");
  626. SetSequence(1, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16911");
  627. SetSequence(2, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16912");
  628. SetSequence(3, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16913");
  629. SetSequence(4, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "16920");
  630. SetSequence(5, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16921");
  631. SetSequence(6, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16922");
  632. StartSequence(7);
  633. }
  634. break;
  635. case 4:
  636. PlayerData.Instance().CNAG_GameState = 5;
  637. NewSequence();
  638. SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "16930");
  639. SetSequence(1, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16931");
  640. SetSequence(2, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16932");
  641. SetSequence(3, EventSequenceItem.EventSequenceType.Callback, GetHat);
  642. StartSequence(4);
  643. break;
  644. }
  645. }
  646. //================================================================================
  647. //
  648. //================================================================================
  649. private void GetHat()
  650. {
  651. m_Items[(int)Items.HatTakenOff].DoAction();
  652. m_OtherCharacterRectangles[0].Enable();
  653. m_OtherCharacterRectangles[1].Disable();
  654. }
  655. //================================================================================
  656. //
  657. //================================================================================
  658. protected override void OnNavigation()
  659. {
  660. if (m_CurrentInteractiveRectangle.GetActionParameter(0) == "DowntownCloudNine")
  661. {
  662. int randomValue = Random.Range(0, 100);
  663. if (randomValue < 50)
  664. SetSequence(0, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16104");
  665. else
  666. SetSequence(0, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16105");
  667. SetSequence(1, EventSequenceItem.EventSequenceType.Callback, base.OnNavigation);
  668. StartSequence(2, false);
  669. }
  670. else
  671. {
  672. NewSequence();
  673. if (PlayerData.Instance().CNAG_GameState == 1 || PlayerData.Instance().CNAG_GameState == 2)
  674. {
  675. int sequence = 0;
  676. NewSequence();
  677. if (PlayerData.Instance().CNAG_GameState == 1 && m_CurrentInteractiveRectangle.GetActionParameter(2) == "Side")
  678. {
  679. SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16650");
  680. SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16651");
  681. SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16654");
  682. }
  683. PlayerData.Instance().CNAG_GameState = 2;
  684. SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16670");
  685. SetSequence(sequence++, EventSequenceItem.EventSequenceType.Video, VideoType.ArtGallery);
  686. SetSequence(sequence++, EventSequenceItem.EventSequenceType.Callback, base.OnNavigation);
  687. StartSequence(sequence);
  688. }
  689. else
  690. {
  691. base.OnNavigation();
  692. }
  693. }
  694. }
  695. } // public class SceneCloudNineArtGallery : SceneCommon
  696. } // namespace ReaderRabbit