123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782 |
- //================================================================================
- //
- //================================================================================
- using UnityEngine;
- using System.Collections;
- //================================================================================
- //
- //================================================================================
- namespace ReaderRabbit
- {
- //================================================================================
- //
- //================================================================================
- public class SceneCloudNineArtGallery : SceneCommon
- {
- //================================================================================
- //
- //================================================================================
- private enum Characters
- {
- Reader = CharactersCommon.Reader,
- Sam = CharactersCommon.Sam,
- Paige = CharactersCommon.Paige,
- Chester = CharactersCommon.Chester,
- MissCirrus = CharactersCommon.StartSceneSpecific,
- MissCirrus_NoHat,
- }
- //================================================================================
- //
- //================================================================================
- private enum Items
- {
- HatTakenOff = 0,
- }
- //================================================================================
- //
- //================================================================================
- private const int NUMBER_OF_ANIMATION_FRAMES_TO_GIVE_PRIZE = 4;
- [SerializeField] private CloudNinePaintingFrame m_GreenPainting;
- [SerializeField] private CloudNinePaintingFrame m_RedPainting;
- [SerializeField] private CloudNinePaintingFrame m_PinkPainting;
- [SerializeField] private CloudNinePaintingFrame m_BluePainting;
- [SerializeField] private CloudNinePaintingFrame m_CyanPainting;
- private CloudNinePaintingFrame m_CurrentAnimatedFrame;
- private int m_IdleHelpIndex;
- private const int MAX_IDLE_INDEX = 2;
- private Characters m_CurrentMissCirrus;
- private const int MISS_CIRRUS_TAKING_OFF_HAT_INDEX = 3;
- private int m_HatClickCount;
- //================================================================================
- //
- //================================================================================
- protected override void Start()
- {
- base.Start();
- // ******************** TODO: REMOVE ME, I'M DEBUG CODE ********************
- //m_IsFirstTime = true;
- //PlayerData.Instance().CNAG_DidSayAct4Speech = false;
- // ******************** TODO: REMOVE ME, I'M DEBUG CODE ********************
- //============================================================================
- //
- //============================================================================
- int lang = PlayerPrefs.GetInt("language");
- if (lang == 0)
- m_SpeechFolder = "Resources_DA/Audio/CloudNineArtGallery_Speech";
- else if (lang == 1)
- m_SpeechFolder = "Resources_EN/Audio/CloudNineArtGallery_Speech";
- else if (lang == 2)
- m_SpeechFolder = "Resources_NO/Audio/CloudNineArtGallery_Speech";
- else if (lang == 3)
- m_SpeechFolder = "Resources_SP/Audio/CloudNineArtGallery_Speech";
- else if (lang == 4)
- m_SpeechFolder = "Resources_SW/Audio/CloudNineArtGallery_Speech";
- //============================================================================
- //
- //============================================================================
- PlayerData.Instance().SetVisitedCloudNineArtGallery(true);
- PlayerData.Instance().SetCurrentLocation(Location.CloudNineArtGallery);
- AudioManager.Instance().PlayBGM("BGM_CloudNineArtGallery");
- m_CurrentAnimatedFrame = m_GreenPainting;
- PlayNextFrame();
- m_IdleHelpIndex = 0;
-
- m_HatClickCount = 0;
- ++PlayerData.Instance().CNAG_VisitCount;
- if (PlayerData.Instance().CNAG_VisitCount > 100)
- PlayerData.Instance().CNAG_VisitCount = 1;
- }
- //================================================================================
- //
- //================================================================================
- public override void UpdateOnce()
- {
- UpdateMissCirrus();
- if (m_IsFirstTime)
- PlayerData.Instance().CNAG_GameState = 1;
- if ((PlayerData.Instance().CNAG_GameState == 2 && PlayerData.Instance().DidVisitAmazingArtGallery())
- || PlayerData.Instance().CNAG_GameState == 3)
- {
- if (IsEditedPagesHigherThanMinimum())
- {
- // Finished moving picture, not taken hat.
- PlayerData.Instance().CNAG_GameState = 4;
- }
- else
- {
- // Entered activity but didn't finish one moving picture.
- PlayerData.Instance().CNAG_GameState = 3;
- }
- }
- }
- //================================================================================
- //
- //================================================================================
- private bool IsEditedPagesHigherThanMinimum()
- {
- return m_BluePainting.TotalNumberOfFrames >= NUMBER_OF_ANIMATION_FRAMES_TO_GIVE_PRIZE || m_CyanPainting.TotalNumberOfFrames >= NUMBER_OF_ANIMATION_FRAMES_TO_GIVE_PRIZE;
- }
- //================================================================================
- //
- //================================================================================
- private int GetEditedPagesCount()
- {
- return m_BluePainting.TotalNumberOfFrames + m_CyanPainting.TotalNumberOfFrames;
- }
- //================================================================================
- //
- //================================================================================
- public void PlayNextFrame()
- {
- m_CurrentAnimatedFrame.Play();
-
- if (m_CurrentAnimatedFrame == m_GreenPainting)
- {
- m_CurrentAnimatedFrame = m_RedPainting;
- }
- else if (m_CurrentAnimatedFrame == m_RedPainting)
- {
- m_CurrentAnimatedFrame = m_PinkPainting;
- }
- else if (m_CurrentAnimatedFrame == m_PinkPainting)
- {
- m_CurrentAnimatedFrame = m_BluePainting;
- }
- else if (m_CurrentAnimatedFrame == m_BluePainting)
- {
- m_CurrentAnimatedFrame = m_CyanPainting;
- }
- else if (m_CurrentAnimatedFrame == m_CyanPainting)
- {
- m_CurrentAnimatedFrame = m_GreenPainting;
- }
- }
- //================================================================================
- //
- //================================================================================
- private void UpdateMissCirrus()
- {
- if (PlayerData.Instance().CNAG_GameState < 5 && !PlayerData.Instance().CNAG_DidSayAct4Speech)
- {
- m_CharacterAnimations[(int)Characters.MissCirrus].gameObject.SetActive(true);
- m_CharacterAnimations[(int)Characters.MissCirrus_NoHat].gameObject.SetActive(false);
- m_CurrentMissCirrus = Characters.MissCirrus;
- m_Items[(int)Items.HatTakenOff].gameObject.SetActive(false);
- m_OtherCharacterRectangles[0].Enable();
- m_OtherCharacterRectangles[1].Enable();
- }
- else
- {
- m_CharacterAnimations[(int)Characters.MissCirrus].gameObject.SetActive(false);
- m_CharacterAnimations[(int)Characters.MissCirrus_NoHat].gameObject.SetActive(true);
- m_CurrentMissCirrus = Characters.MissCirrus_NoHat;
- m_Items[(int)Items.HatTakenOff].gameObject.SetActive(PlayerData.Instance().GetHat() == ItemState.None);
- m_OtherCharacterRectangles[0].Enable();
- m_OtherCharacterRectangles[1].Disable();
- }
- }
- //================================================================================
- //
- //================================================================================
- protected override void StartedFadeOut()
- {
- base.StartedFadeIn();
- if (m_CurrentInteractiveRectangle != null)
- {
- SceneAmazingArtGallery.SelectedPaintingFrame = m_CurrentInteractiveRectangle.GetActionParameter(1);
- }
- }
- //================================================================================
- //
- //================================================================================
- protected override void PlayFirstEvent()
- {
- UpdateOnce();
- if (m_IsFirstTime)
- {
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "16300");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "16315");
- SetSequence(2, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16330");
- SetSequence(3, EventSequenceItem.EventSequenceType.Callback, DoneFirstTime);
- StartSequence(4);
- }
- else
- {
- if (PlayerData.Instance().GetPreviousLocation() == Location.DowntownCloudNine)
- {
- switch (PlayerData.Instance().CNAG_GameState)
- {
- case 1:
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "16300");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "16315");
- SetSequence(2, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16330");
- SetSequence(3, EventSequenceItem.EventSequenceType.Callback, DoneFirstTime);
- StartSequence(4);
- break;
- case 2:
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16415");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "16416");
- SetSequence(2, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16417");
- SetSequence(3, EventSequenceItem.EventSequenceType.Callback, DoneFirstTime);
- StartSequence(4);
- break;
- case 3:
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16420");
- int randomValue = Random.Range(0, 100);
- if (randomValue < 50)
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16421");
- else
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16422");
- SetSequence(2, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16424");
- SetSequence(3, EventSequenceItem.EventSequenceType.Callback, DoneFirstTime);
- StartSequence(4);
- break;
- case 4:
- case 5:
- if (!PlayerData.Instance().CNAG_DidSaySS4Speech)
- {
- PlayerData.Instance().CNAG_DidSaySS4Speech = true;
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16430");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16431");
- SetSequence(2, EventSequenceItem.EventSequenceType.Callback, DoneFirstTime);
- StartSequence(3);
- }
- break;
- }
- }
- else
- {
- // From the flipbook activity.
- if (PlayerData.Instance().CNAG_GameState == 3)
- {
- MissCirrusClick3(true);
- }
- else if (PlayerData.Instance().CNAG_GameState == 4 || PlayerData.Instance().CNAG_GameState == 5)
- {
- if (!PlayerData.Instance().CNAG_DidSayAct4Speech)
- {
- PlayerData.Instance().CNAG_DidSayAct4Speech = true;
- int sequence = 0;
- NewSequence();
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.MissCirrus, "16355");
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.MissCirrus, "16356");
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16357");
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.MissCirrus, "16358");
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Animation,
- Characters.MissCirrus,
- MISS_CIRRUS_TAKING_OFF_HAT_INDEX,
- m_CharacterAnimations[(int)Characters.MissCirrus].AnimationCyclesString[MISS_CIRRUS_TAKING_OFF_HAT_INDEX]);
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Callback, UpdateMissCirrus);
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "16875");
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.MissCirrus_NoHat, "16882");
- if (PlayerData.Instance().DidVisitRockHead())
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16790");
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Callback, DoneFirstTime);
- StartSequence(sequence);
- }
- else
- {
- int index = PlayerData.Instance().CNAG_VisitCount % 5;
- string[] possibleNumbers = { "16380", "16381", "16382", "16383", "16384" };
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, possibleNumbers[index]);
- StartSequence(1);
- }
- }
- }
- }
- }
- //================================================================================
- //
- //================================================================================
- protected override void OnIdle()
- {
- ++m_IdleHelpIndex;
- if (m_IdleHelpIndex > MAX_IDLE_INDEX)
- m_IdleHelpIndex = 0;
- switch (m_IdleHelpIndex)
- {
- case 0:
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16600");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "16601");
- StartSequence(2);
- break;
- case 1:
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "16605");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16606");
- StartSequence(2);
- break;
- case 2:
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "16610");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16611");
- StartSequence(2);
- break;
- }
- }
- //================================================================================
- //
- //================================================================================
- public override void SpeechReader()
- {
- switch (PlayerData.Instance().CNAG_GameState)
- {
- case 1:
- ReaderClick1();
- break;
- case 2:
- case 3:
- ReaderClick2();
- break;
- case 4:
- ReaderClick4();
- break;
- case 5:
- ReaderClick5();
- break;
- }
- }
- //================================================================================
- //
- //================================================================================
- private void ReaderClick1()
- {
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16650");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16651");
- SetSequence(2, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16654");
- SetSequence(3, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16671");
- SetSequence(4, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16684");
- SetSequence(5, EventSequenceItem.EventSequenceType.Callback, MissCirrusSpeechDone);
- StartSequence(6);
- }
- //================================================================================
- //
- //================================================================================
- private void ReaderClick2()
- {
- int randomValue = Random.Range(0, 100);
- if (randomValue < 50)
- {
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16680");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16775");
- SetSequence(2, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16682");
- SetSequence(3, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16683");
- SetSequence(4, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16684");
- StartSequence(5);
- }
- else
- {
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "16780");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16785");
- StartSequence(2);
- }
- }
- //================================================================================
- //
- //================================================================================
- private void ReaderClick4()
- {
- if (PlayerData.Instance().DidVisitRockHead())
- {
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16790");
- StartSequence(1);
- }
- else
- {
- ReaderClick5();
- }
- }
- //================================================================================
- //
- //================================================================================
- private void ReaderClick5()
- {
- int randomValue = Random.Range(0, 100);
- if (randomValue < 50)
- {
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "16795");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16800");
- StartSequence(2);
- }
- else
- {
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "16780");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16785");
- StartSequence(2);
- }
- }
- //================================================================================
- //
- //================================================================================
- private void MissCirrusSpeechDone()
- {
- if (PlayerData.Instance().CNAG_GameState == 1)
- PlayerData.Instance().CNAG_GameState = 2;
- }
- //================================================================================
- //
- //================================================================================
- public override void SpeechPaige()
- {
- switch (PlayerData.Instance().CNAG_GameState)
- {
- case 1:
- case 2:
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Paige, "16750");
- StartSequence(1);
- break;
- case 3:
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Paige, "16751");
- StartSequence(1);
- break;
- case 4:
- case 5:
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Paige, "16752");
- StartSequence(1);
- break;
- }
- }
- //================================================================================
- //
- //================================================================================
- protected override void OnOtherCharacterInteraction()
- {
- if (m_CurrentInteractiveRectangle.GetActionParameter(0) == "MissCirrus")
- {
- switch (PlayerData.Instance().CNAG_GameState)
- {
- case 1:
- MissCirrusClick1();
- break;
- case 2:
- MissCirrusClick2();
- break;
- case 3:
- MissCirrusClick3(false);
- break;
- case 4:
- case 5:
- MissCirrusClick4();
- break;
- }
- }
- else if (m_CurrentInteractiveRectangle.GetActionParameter(0) == "MissCirrusHat")
- {
- HatClick();
- }
- }
- //================================================================================
- //
- //================================================================================
- private void MissCirrusClick1()
- {
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16650");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16651");
- SetSequence(2, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16654");
- SetSequence(3, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16671");
- SetSequence(4, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16684");
- SetSequence(5, EventSequenceItem.EventSequenceType.Callback, MissCirrusSpeechDone);
- StartSequence(6);
- }
- //================================================================================
- //
- //================================================================================
- private void MissCirrusClick2()
- {
- //NewSequence();
- //SetSequence(0, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16670");
- //SetSequence(1, EventSequenceItem.EventSequenceType.Video, VideoType.ArtGallery);
- //SetSequence(2, EventSequenceItem.EventSequenceType.Callback, GotoBluePainting);
- //StartSequence(3);
-
- GotoBluePainting();
- }
- //================================================================================
- //
- //================================================================================
- private void GotoBluePainting()
- {
- // HACK: Goto blue painting.
- SetCurrentToNavigation("AmazingArtGallery");
- m_CurrentInteractiveRectangle.SetActionType(ActionType.Navigation);
- m_CurrentInteractiveRectangle.SetActionParameter(0, "AmazingArtGallery");
- m_CurrentInteractiveRectangle.SetActionParameter(1, "Blue");
- OnNavigation();
- }
- //================================================================================
- //
- //================================================================================
- private void MissCirrusClick3(bool fromPlayFirstEvent)
- {
- int sequence = 0;
- NewSequence();
- if (fromPlayFirstEvent)
- {
- if (PlayerData.Instance().CNAG_IsFirstEditSpeech && GetEditedPagesCount() > 0)
- {
- PlayerData.Instance().CNAG_IsFirstEditSpeech = false;
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16350");
- }
- }
- if (GetEditedPagesCount() == 0)
- {
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16710");
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16690");
- }
- else
- {
- int randomValue = Random.Range(0, 100);
- if (randomValue < 50)
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16650");
- else
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16651");
- if (PlayerData.Instance().CNAG_IsFromSample)
- {
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16730");
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16731");
- }
- else
- {
- if (GetEditedPagesCount() == 1)
- {
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16705");
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16706");
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16424");
- }
- else if (GetEditedPagesCount() > 1 && GetEditedPagesCount() < 6)
- {
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16421");
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16424");
- }
- }
- }
- StartSequence(sequence);
- }
- //================================================================================
- //
- //================================================================================
- private void MissCirrusClick4()
- {
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16730");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16731");
- StartSequence(2);
- }
- //================================================================================
- //
- //================================================================================
- public void HatClick()
- {
- ++m_HatClickCount;
- // TODO: kCOMSoftClickSfxID.
- switch (PlayerData.Instance().CNAG_GameState)
- {
- case 1:
- m_HatClickCount = 0;
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "16875");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16650");
- SetSequence(2, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16651");
- SetSequence(3, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16654");
- SetSequence(4, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16671");
- SetSequence(5, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16684");
- SetSequence(6, EventSequenceItem.EventSequenceType.Callback, MissCirrusSpeechDone);
- StartSequence(7);
- break;
- case 2:
- case 3:
- if (PlayerData.Instance().DidVisitRockHead())
- {
- if (m_HatClickCount == 1)
- {
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16880");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16881");
- SetSequence(2, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16882");
- SetSequence(3, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16883");
- StartSequence(4);
- }
- else
- {
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16900");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16901");
- SetSequence(2, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16691");
- StartSequence(3);
- }
- }
- else
- {
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16910");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16911");
- SetSequence(2, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16912");
- SetSequence(3, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16913");
- SetSequence(4, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "16920");
- SetSequence(5, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16921");
- SetSequence(6, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16922");
- StartSequence(7);
- }
- break;
- case 4:
- PlayerData.Instance().CNAG_GameState = 5;
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "16930");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16931");
- SetSequence(2, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16932");
- SetSequence(3, EventSequenceItem.EventSequenceType.Callback, GetHat);
- StartSequence(4);
- break;
- }
- }
- //================================================================================
- //
- //================================================================================
- private void GetHat()
- {
- m_Items[(int)Items.HatTakenOff].DoAction();
- m_OtherCharacterRectangles[0].Enable();
- m_OtherCharacterRectangles[1].Disable();
- }
- //================================================================================
- //
- //================================================================================
- protected override void OnNavigation()
- {
- if (m_CurrentInteractiveRectangle.GetActionParameter(0) == "DowntownCloudNine")
- {
- int randomValue = Random.Range(0, 100);
- if (randomValue < 50)
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16104");
- else
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16105");
- SetSequence(1, EventSequenceItem.EventSequenceType.Callback, base.OnNavigation);
- StartSequence(2, false);
- }
- else
- {
- NewSequence();
- if (PlayerData.Instance().CNAG_GameState == 1 || PlayerData.Instance().CNAG_GameState == 2)
- {
- int sequence = 0;
- NewSequence();
-
- if (PlayerData.Instance().CNAG_GameState == 1 && m_CurrentInteractiveRectangle.GetActionParameter(2) == "Side")
- {
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16650");
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "16651");
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16654");
- }
- PlayerData.Instance().CNAG_GameState = 2;
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, m_CurrentMissCirrus, "16670");
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Video, VideoType.ArtGallery);
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Callback, base.OnNavigation);
- StartSequence(sequence);
- }
- else
- {
- base.OnNavigation();
- }
- }
- }
- } // public class SceneCloudNineArtGallery : SceneCommon
- } // namespace ReaderRabbit
|