123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973 |
- //================================================================================
- //
- //================================================================================
- using UnityEngine;
- using System.Collections;
- //================================================================================
- //
- //================================================================================
- namespace ReaderRabbit
- {
- //================================================================================
- //
- //================================================================================
- public class SceneDowntownCloudNine : SceneCommon
- {
- //================================================================================
- //
- //================================================================================
- private enum Characters
- {
- Reader = CharactersCommon.Reader,
- Sam = CharactersCommon.Sam,
- Paige = CharactersCommon.Paige,
- Chester = CharactersCommon.Chester,
- QueenCumulus = CharactersCommon.StartSceneSpecific,
- }
- //================================================================================
- //
- //================================================================================
- private const int READER_FROM_RAINGEAR_THROWING_MACHINE = (int)ReaderAnimation.AnimationCycles.Misc1 + 1;
- private const int SAM_FROM_RAINGEAR_THROWING_MACHINE = (int)SamAnimation.AnimationCycles.Misc1 + 1;
- private const int QUEEN_CUMULUS_MAX_CLICK_COUNT = 3;
- private int m_QueenCumulusClickCount;
- private const int PAIGE_MAX_CLICK_COUNT = 3;
- private int m_PaigeClickCount;
- private bool m_IsReaderFirstClick;
- private int m_ItemsCollected;
- private const int GAME_STATE_DID_NOT_VISIT_ISLAND = 2;
- private const int GAME_STATE_AFTER_VISITING_ISLAND = 3;
- private const int GAME_STATE_AFTER_VISITING_IRVINS_HOUSE = 4;
- private const int GAME_STATE_ONE_ITEM = 5;
- private const int GAME_STATE_TWO_ITEMS = 6;
- private const int GAME_STATE_THREE_ITEMS = 7;
- private int m_GameState;
- [SerializeField] private GameObject[] m_LitterFrames;
- public GameObject cloundNineArtGallerySign;
- public bool reactivateInteractions = false; //mycode --rafael
- //================================================================================
- //
- //================================================================================
- protected override void Start()
- {
- base.Start();
- //============================================================================
- //
- //============================================================================
- int lang = PlayerPrefs.GetInt("language");
- if (lang == 0)
- m_SpeechFolder = "Resources_DA/Audio/DowntownCloudNine_Speech";
- else if (lang == 1)
- m_SpeechFolder = "Resources_EN/Audio/DowntownCloudNine_Speech";
- else if (lang == 2)
- m_SpeechFolder = "Resources_NO/Audio/DowntownCloudNine_Speech";
- else if (lang == 3)
- m_SpeechFolder = "Resources_SP/Audio/DowntownCloudNine_Speech";
- else if (lang == 4)
- m_SpeechFolder = "Resources_SW/Audio/DowntownCloudNine_Speech";
- //============================================================================
- //
- //============================================================================
- PlayerData.Instance().SetVisitedDowntownCloudNine(true);
- PlayerData.Instance().SetCurrentLocation(Location.DowntownCloudNine);
- AudioManager.Instance().PlayBGM("BGM_DowntownCloudNine_15000");
- m_QueenCumulusClickCount = 0;
- m_PaigeClickCount = 0;
- m_IsReaderFirstClick = true;
- m_ItemsCollected = 0;
- if (PlayerData.Instance().GetRubberBand() != ItemState.None)
- ++m_ItemsCollected;
- if (PlayerData.Instance().GetHoop() != ItemState.None)
- ++m_ItemsCollected;
- if (PlayerData.Instance().GetPillow() != ItemState.None)
- ++m_ItemsCollected;
- m_GameState = 0;
- if (m_ItemsCollected == 0)
- {
- switch (PlayerData.Instance().DCN_BackType)
- {
- case DCN_BackTypeEnum.DidNotVisitIsland:
- case DCN_BackTypeEnum.DidNotVisitIslandFirstTimeOnly:
- m_GameState = GAME_STATE_DID_NOT_VISIT_ISLAND;
- break;
- case DCN_BackTypeEnum.AfterVisitingIsland:
- case DCN_BackTypeEnum.AfterVisitingIslandFirstTimeOnly:
- m_GameState = GAME_STATE_AFTER_VISITING_ISLAND;
- break;
- case DCN_BackTypeEnum.AfterVisitingIrvinsHouseFirstTimeOnly:
- case DCN_BackTypeEnum.AfterVisitingIrvinsHouse:
- m_GameState = GAME_STATE_AFTER_VISITING_IRVINS_HOUSE;
- break;
- }
- }
- else if (m_ItemsCollected == 1)
- {
- m_GameState = GAME_STATE_ONE_ITEM;
- }
- else if (m_ItemsCollected == 2)
- {
- m_GameState = GAME_STATE_TWO_ITEMS;
- }
- else if (m_ItemsCollected == 3)
- {
- m_GameState = GAME_STATE_THREE_ITEMS;
- }
- if (PlayerData.Instance().GetPreviousLocation() == Location.RaingearThrowingMachine)
- ++PlayerData.Instance().DCN_EnteredFromCatapult;
- UpdateOnce();
- }
- void ReactivateSceneInteractions(){ //mycode --rafael
- foreach (RRInteractiveRectangle intRetangle in m_NavigationRectangles){ //mycode --rafael
- intRetangle.canInteracte = true;
- }
-
- foreach (RRInteractiveRectangle intCharacterRetangle in m_CharacterRectangles){ //mycode --rafael
- intCharacterRetangle.canInteracte = true;
- }
-
- foreach (RRInteractiveRectangle intOtherCharacterRetangle in m_OtherCharacterRectangles){ //mycode --rafael
- intOtherCharacterRetangle.canInteracte = true;
- }
- }
- void CheckSceneStage(){ //mycode --rafael
- if (reactivateInteractions == false){
- if (!m_IsFirstTime){
- ReactivateSceneInteractions();
- }
-
- reactivateInteractions = true;
- }
- }
- protected override void Update(){ //mycode --rafael
- base.Update();
- CheckSceneStage();
- }
- //================================================================================
- //
- //================================================================================
- public override void UpdateOnce()
- {
- // Hide/show litter frames according to visited places/items.
- if (m_GameState == GAME_STATE_AFTER_VISITING_ISLAND || m_GameState == GAME_STATE_AFTER_VISITING_IRVINS_HOUSE)
- {
- m_LitterFrames[0].gameObject.SetActive(true);
- m_LitterFrames[1].gameObject.SetActive(false);
- m_LitterFrames[2].gameObject.SetActive(false);
- }
- else if (m_GameState == GAME_STATE_ONE_ITEM || m_GameState == GAME_STATE_TWO_ITEMS)
- {
- m_LitterFrames[0].gameObject.SetActive(true);
- m_LitterFrames[1].gameObject.SetActive(true);
- m_LitterFrames[2].gameObject.SetActive(false);
- }
- else if (m_GameState == GAME_STATE_THREE_ITEMS)
- {
- m_LitterFrames[0].gameObject.SetActive(true);
- m_LitterFrames[1].gameObject.SetActive(true);
- m_LitterFrames[2].gameObject.SetActive(true);
- }
- else
- {
- // Hide.
- m_LitterFrames[0].gameObject.SetActive(false);
- m_LitterFrames[1].gameObject.SetActive(false);
- m_LitterFrames[2].gameObject.SetActive(false);
- }
- }
- //================================================================================
- //
- //================================================================================
- protected override void OnNavigation()
- {
- if (m_CurrentInteractiveRectangle.GetActionParameter(0) == "CloudNineArtGallery"
- && PlayerData.Instance().DCN_IsFirstClickCloudNineArtGallery)
- {
- PlayerData.Instance().DCN_IsFirstClickCloudNineArtGallery = false;
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15500");
- SetSequence(1, EventSequenceItem.EventSequenceType.Callback, GotoCloudNineArtGallery);
- StartSequence(2, false);
- }
- else
- {
- base.OnNavigation();
- }
- }
- //================================================================================
- //
- //================================================================================
- void GotoCloudNineArtGallery()
- {
- KishiTechUnity.Loading.Loading.Instance().Show();
- SetCurrentToNavigation("CloudNineArtGallery");
- base.OnNavigation();
- }
- //================================================================================
- //
- //================================================================================
- protected override void PlayFirstEvent()
- {
- UpdateOnce();
- if (m_IsFirstTime)
- {
- SceneFirstSequencePart1();
- }
- else
- {
- if (PlayerData.Instance().GetPreviousLocation() == Location.RaingearThrowingMachine)
- {
- int sequence = 0;
- NewSequence();
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.AnimationNoWait,
- Characters.Reader,
- READER_FROM_RAINGEAR_THROWING_MACHINE,
- m_CharacterAnimations[(int)Characters.Reader].AnimationCyclesString[READER_FROM_RAINGEAR_THROWING_MACHINE]);
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Animation,
- Characters.Sam,
- SAM_FROM_RAINGEAR_THROWING_MACHINE,
- m_CharacterAnimations[(int)Characters.Sam].AnimationCyclesString[SAM_FROM_RAINGEAR_THROWING_MACHINE]);
- if (PlayerData.Instance().DCN_EnteredFromCatapult > 4)
- PlayerData.Instance().DCN_EnteredFromCatapult = 1;
- if (PlayerData.Instance().DCN_EnteredFromCatapult == 1)
- {
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15150");
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "15151");
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15152");
- }
- else if (PlayerData.Instance().DCN_EnteredFromCatapult == 2)
- {
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "15155");
- }
- else if (PlayerData.Instance().DCN_EnteredFromCatapult == 3)
- {
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15156");
- }
- else if (PlayerData.Instance().DCN_EnteredFromCatapult == 4)
- {
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "15157");
- }
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Callback, ReentrySpeechDelayed);
- StartSequence(sequence);
- }
- else
- {
- ReentrySpeech();
- }
- }
- }
- //================================================================================
- //
- //================================================================================
- void ReentrySpeechDelayed()
- {
- Invoke("ReentrySpeech", 0.1f);
- }
- //================================================================================
- //
- //================================================================================
- void ReentrySpeech()
- {
- if (m_ItemsCollected == 0)
- {
- switch (PlayerData.Instance().DCN_BackType)
- {
- case DCN_BackTypeEnum.DidNotVisitIslandFirstTimeOnly:
- SpeechBackDidNotVisitIslandFirstTimeOnly();
- break;
- case DCN_BackTypeEnum.AfterVisitingIslandFirstTimeOnly:
- SpeechBackAfterVisitingIslandFirstTimeOnly();
- break;
- case DCN_BackTypeEnum.AfterVisitingIrvinsHouseFirstTimeOnly:
- SpeechBackAfterVisitingIrvinsHouseFirstTimeOnly();
- break;
- case DCN_BackTypeEnum.AfterVisitingIrvinsHouse:
- SpeechBackAfterVisitingIrvinsHouse();
- break;
- }
- }
- else
- {
- if (m_GameState == GAME_STATE_ONE_ITEM)
- {
- SpeechBackOneItem();
- }
- else if (m_GameState == GAME_STATE_TWO_ITEMS)
- {
- SpeechBackTwoItems();
- }
- else if (m_GameState == GAME_STATE_THREE_ITEMS)
- {
- SpeechBackThreeItems();
- }
- }
- }
- //================================================================================
- //
- //================================================================================
- void SceneFirstSequencePart1()
- {
- UpdateIdleDelay();
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "15100");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15300");
- SetSequence(2, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15301");
- SetSequence(3, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15302");
- SetSequence(4, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15303");
- SetSequence(5, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "15304");
- SetSequence(6, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15305");
- SetSequence(7, EventSequenceItem.EventSequenceType.Callback, SceneFirstSequencePart2);
- StartSequence(8);
- }
- //================================================================================
- //
- //================================================================================
- void SceneFirstSequencePart2()
- {
- UpdateIdleDelay();
- AudioManager.Instance().PlayBGM("BGM_DowntownCloudNine_15390");
- Invoke("StartSceneFirstSequencePart2", 0.1f);
- }
- //================================================================================
- //
- //================================================================================
- void StartSceneFirstSequencePart2()
- {
- UpdateIdleDelay();
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "15306");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15307");
- SetSequence(2, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15308");
- SetSequence(3, EventSequenceItem.EventSequenceType.Callback, SceneFirstSequencePart3);
- StartSequence(4);
- }
- //================================================================================
- //
- //================================================================================
- void SceneFirstSequencePart3()
- {
- UpdateIdleDelay();
- Invoke("StartSceneFirstSequencePart3", 0.1f);
- }
- //================================================================================
- //
- //================================================================================
- void StartSceneFirstSequencePart3()
- {
- UpdateIdleDelay();
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Video, VideoType.QueenCumulus);
- SetSequence(1, EventSequenceItem.EventSequenceType.Callback, SceneFirstSequencePart4);
- StartSequence(2);
- }
- //================================================================================
- //
- //================================================================================
- void SceneFirstSequencePart4()
- {
- UpdateIdleDelay();
- AudioManager.Instance().PlayBGM("BGM_DowntownCloudNine_15391");
- Invoke("StartSceneFirstSequencePart4", 0.1f);
- }
- //================================================================================
- //
- //================================================================================
- void StartSceneFirstSequencePart4()
- {
- UpdateIdleDelay();
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15310");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15312");
- SetSequence(2, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15314");
- SetSequence(3, EventSequenceItem.EventSequenceType.Callback, SceneFirstSequencePart5);
- StartSequence(4);
- }
- //================================================================================
- //
- //================================================================================
- void SceneFirstSequencePart5()
- {
- UpdateIdleDelay();
- Invoke("StartSceneFirstSequencePart5", 0.1f);
- }
- //================================================================================
- //
- //================================================================================
- void StartSceneFirstSequencePart5()
- {
- UpdateIdleDelay();
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15316");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15318");
- SetSequence(2, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "15319");
- SetSequence(3, EventSequenceItem.EventSequenceType.Callback, DoneFirstTime);
- SetSequence(4, EventSequenceItem.EventSequenceType.Callback, UpdateIdleDelay);
- StartSequence(5);
- ReactivateSceneInteractions(); //mycode --rafael
- }
- //================================================================================
- //
- //================================================================================
- void SpeechBackDidNotVisitIslandFirstTimeOnly()
- {
- PlayerData.Instance().DCN_BackType = DCN_BackTypeEnum.DidNotVisitIsland;
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15166");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15167");
- SetSequence(2, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15168");
- SetSequence(3, EventSequenceItem.EventSequenceType.Callback, DoneFirstTime);
- SetSequence(4, EventSequenceItem.EventSequenceType.Callback, UpdateIdleDelay);
- StartSequence(5);
- }
- //================================================================================
- //
- //================================================================================
- void SpeechBackAfterVisitingIslandFirstTimeOnly()
- {
- PlayerData.Instance().DCN_BackType = DCN_BackTypeEnum.AfterVisitingIsland;
-
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15170");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15171");
- SetSequence(2, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15172");
- SetSequence(3, EventSequenceItem.EventSequenceType.Callback, DoneFirstTime);
- SetSequence(4, EventSequenceItem.EventSequenceType.Callback, UpdateIdleDelay);
- StartSequence(5);
- }
- //================================================================================
- //
- //================================================================================
- void SpeechBackAfterVisitingIrvinsHouseFirstTimeOnly()
- {
- PlayerData.Instance().DCN_BackType = DCN_BackTypeEnum.AfterVisitingIrvinsHouse;
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15175");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "15176");
- SetSequence(2, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15177");
- SetSequence(3, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "15178");
- SetSequence(4, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15179");
- SetSequence(5, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "15180");
- SetSequence(6, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15181");
- SetSequence(7, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "15182");
- SetSequence(8, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15183");
- SetSequence(9, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "15184");
- SetSequence(10, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15185");
- SetSequence(11, EventSequenceItem.EventSequenceType.Callback, DoneFirstTime);
- SetSequence(12, EventSequenceItem.EventSequenceType.Callback, UpdateIdleDelay);
- StartSequence(13);
- }
- //================================================================================
- //
- //================================================================================
- void SpeechBackAfterVisitingIrvinsHouse()
- {
- NewSequence();
- if (PlayerData.Instance().DCN_BackAfterIrvinsHouseQueenSpeech == 0)
- {
- PlayerData.Instance().DCN_BackAfterIrvinsHouseQueenSpeech = 1;
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15190");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15191");
- StartSequence(2);
- }
- else
- {
- PlayerData.Instance().DCN_BackAfterIrvinsHouseQueenSpeech = 0;
-
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15192");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15193");
- StartSequence(2);
- }
- }
- //================================================================================
- //
- //================================================================================
- void SpeechBackOneItem()
- {
- if (PlayerData.Instance().DCN_BackAfterOneItem)
- {
- PlayerData.Instance().DCN_BackAfterOneItem = false;
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15195");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15196");
- SetSequence(2, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "15197");
- StartSequence(3);
- }
- }
- //================================================================================
- //
- //================================================================================
- void SpeechBackTwoItems()
- {
- if (PlayerData.Instance().DCN_BackAfterTwoItems)
- {
- PlayerData.Instance().DCN_BackAfterTwoItems = false;
- NewSequence();
- int sequence = 0;
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15200");
- if (PlayerData.Instance().GetHoop() == ItemState.None)
- {
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15201");
- }
- else if (PlayerData.Instance().GetRubberBand() == ItemState.None)
- {
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "15202");
- }
- else if (PlayerData.Instance().GetPillow() == ItemState.None)
- {
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15203");
- }
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15204");
- StartSequence(sequence);
- }
- else
- {
- NewSequence();
- int sequence = 0;
- if (PlayerData.Instance().GetHoop() == ItemState.None)
- {
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15210");
- }
- else if (PlayerData.Instance().GetRubberBand() == ItemState.None)
- {
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15211");
- }
- else if (PlayerData.Instance().GetPillow() == ItemState.None)
- {
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15212");
- }
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15191");
- StartSequence(sequence);
- }
- }
- //================================================================================
- //
- //================================================================================
- void SpeechBackThreeItems()
- {
- if (PlayerData.Instance().DCN_BackAfterThreeItems)
- {
- PlayerData.Instance().DCN_BackAfterThreeItems = false;
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15220");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15221");
- SetSequence(2, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "15222");
- SetSequence(3, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15223");
- SetSequence(4, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15224");
- StartSequence(5);
- }
- else
- {
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15230");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15231");
- SetSequence(2, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15232");
- StartSequence(3);
- }
- }
- //================================================================================
- //
- //================================================================================
- protected override void OnOtherCharacterInteraction()
- {
- if (m_CurrentInteractiveRectangle.GetActionParameter(0) == "QueenCumulus")
- {
- switch (m_QueenCumulusClickCount)
- {
- case 0:
- QueenCumulusClick0();
- break;
- case 1:
- QueenCumulusClick1();
- break;
- case 2:
- QueenCumulusClick2();
- break;
- case 3:
- QueenCumulusClick3();
- break;
- }
- ++m_QueenCumulusClickCount;
- if (m_QueenCumulusClickCount > QUEEN_CUMULUS_MAX_CLICK_COUNT)
- m_QueenCumulusClickCount = 1;
- }
- }
- //================================================================================
- //
- //================================================================================
- void QueenCumulusClick0()
- {
- switch (m_GameState)
- {
- case GAME_STATE_DID_NOT_VISIT_ISLAND:
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15325");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15326");
- SetSequence(2, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15327");
- SetSequence(3, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "15328");
- StartSequence(4);
- break;
- case GAME_STATE_AFTER_VISITING_ISLAND:
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15335");
- StartSequence(1);
- break;
- case GAME_STATE_THREE_ITEMS:
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15231");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15232");
- StartSequence(2);
- break;
- case GAME_STATE_AFTER_VISITING_IRVINS_HOUSE:
- case GAME_STATE_ONE_ITEM:
- case GAME_STATE_TWO_ITEMS:
- if (PlayerData.Instance().GetHoop() == ItemState.None)
- {
- NewSequence();
-
- int sequence = 0;
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "15340");
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15341");
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15342");
- bool didTalkToRockHead = true;
- if (didTalkToRockHead)
- {
- if (PlayerData.Instance().GetLadder() == ItemState.None)
- {
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15345");
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15346");
- }
- }
- StartSequence(sequence);
- }
- else if (PlayerData.Instance().GetRubberBand() == ItemState.None)
- {
- NewSequence();
-
- int sequence = 0;
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15355");
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15356");
- if (PlayerData.Instance().DidVisitNewspaperCarrierScene() && PlayerData.Instance().GetWagon() == ItemState.None)
- {
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15357");
- SetSequence(sequence++, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15358");
- }
- StartSequence(sequence);
- }
- else if (PlayerData.Instance().GetPillow() == ItemState.None)
- {
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "15360");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15361");
- StartSequence(2);
- }
- else if (PlayerData.Instance().GetWhistle() == ItemState.None)
- {
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15350");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15351");
- StartSequence(2);
- }
- break;
- }
- }
- //================================================================================
- //
- //================================================================================
- void QueenCumulusClick1()
- {
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "15370");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15371");
- SetSequence(2, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15372");
- StartSequence(3);
- }
- //================================================================================
- //
- //================================================================================
- void QueenCumulusClick2()
- {
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15375");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15376");
- SetSequence(2, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15377");
- StartSequence(3);
- }
- //================================================================================
- //
- //================================================================================
- void QueenCumulusClick3()
- {
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "15380");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.QueenCumulus, "15381");
- StartSequence(2);
- }
- //================================================================================
- //
- //================================================================================
- public override void SpeechReader()
- {
- if (m_IsReaderFirstClick)
- {
- m_IsReaderFirstClick = false;
- switch (m_GameState)
- {
- case GAME_STATE_DID_NOT_VISIT_ISLAND:
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15451");
- StartSequence(1);
- break;
- case GAME_STATE_AFTER_VISITING_ISLAND:
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "15452");
- StartSequence(1);
- break;
- case GAME_STATE_AFTER_VISITING_IRVINS_HOUSE:
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15453");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "15454");
- StartSequence(2);
- break;
- case GAME_STATE_ONE_ITEM:
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "15455");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15456");
- StartSequence(2);
- break;
- case GAME_STATE_TWO_ITEMS:
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "15457");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15456");
- StartSequence(2);
- break;
- case GAME_STATE_THREE_ITEMS:
- NewSequence();
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15470");
- StartSequence(1);
- break;
- }
- }
- else
- {
- ReaderRandomSpeech(true);
- }
- }
- //================================================================================
- //
- //================================================================================
- public override void ReaderRandomSpeech(bool ignoreSomebodySpeaking)
- {
- if (ignoreSomebodySpeaking || !IsSomebodySpeaking())
- {
- int maxRandom = 200;
- if (m_GameState == GAME_STATE_DID_NOT_VISIT_ISLAND || m_GameState == GAME_STATE_AFTER_VISITING_ISLAND)
- maxRandom = 100;
- else if (m_GameState == GAME_STATE_THREE_ITEMS)
- maxRandom = 0;
- if (maxRandom > 0)
- {
- NewSequence();
- int randomValue = Random.Range(0, maxRandom);
- if (randomValue < 50)
- {
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15250");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "15251");
- StartSequence(2);
- }
- else if (randomValue < 100)
- {
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "15260");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15261");
- StartSequence(2);
- }
- else if (randomValue < 150)
- {
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15453");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "15454");
- StartSequence(2);
- }
- else
- {
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "15455");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15456");
- StartSequence(2);
- }
- }
- }
- }
- //================================================================================
- //
- //================================================================================
- public override void SpeechPaige()
- {
- NewSequence();
- if (m_GameState == GAME_STATE_DID_NOT_VISIT_ISLAND)
- {
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Paige, "15405");
- StartSequence(1);
- m_PaigeClickCount = 1;
- }
- else if (m_GameState == GAME_STATE_THREE_ITEMS)
- {
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Paige, "15420");
- StartSequence(1);
- }
- else
- {
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Paige, "1541" + (m_PaigeClickCount - 1).ToString());
- StartSequence(1);
- ++m_PaigeClickCount;
- if (m_PaigeClickCount > PAIGE_MAX_CLICK_COUNT)
- m_PaigeClickCount = 1;
- }
- }
- //================================================================================
- //
- //================================================================================
- protected override void OnIdle()
- {
- NewSequence();
- int maxRandom = (m_GameState > 0) ? 150 : 100;
- int randomValue = Random.Range(0, maxRandom);
- if (randomValue < 50)
- {
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15250");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "15251");
- SetSequence(2, EventSequenceItem.EventSequenceType.Callback, UpdateIdleDelay);
- StartSequence(3);
- }
- else if (randomValue < 100)
- {
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "15270");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15271");
- SetSequence(2, EventSequenceItem.EventSequenceType.Callback, UpdateIdleDelay);
- StartSequence(3);
- }
- else
- {
- SetSequence(0, EventSequenceItem.EventSequenceType.Speech, Characters.Sam, "15260");
- SetSequence(1, EventSequenceItem.EventSequenceType.Speech, Characters.Reader, "15261");
- SetSequence(2, EventSequenceItem.EventSequenceType.Callback, UpdateIdleDelay);
- StartSequence(3);
- }
- }
- } // public class SceneDowntownCloudNine : SceneCommon
- } // namespace ReaderRabbit
|