//================================================================================ // //================================================================================ 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