Beispiel #1
0
    public static void Play_Shop(Character shopCharacter)
    {
        if (GameData.state == GameData.State.HealerJoined)
        {
            Window_QuestPointer.DestroyPointer(GameAssets.i.Map.Find("shop").position);
            GameData.state = GameData.State.LeavingTown;
            Window_QuestPointer.Create(GameAssets.i.Map.Find("letsLeaveTown").position, Color.white, Color.white);
        }


        UIBlack.Show();
        OvermapHandler.StopOvermapRunning();
        Dialogue dialogue = Dialogue.GetInstance();

        dialogue.SetDialogueActions(new List <Action>()
        {
            () => {
                dialogue.Show();
                dialogue.ShowLeftCharacter(GameAssets.i.s_PlayerDialogueSprite, true);
                dialogue.ShowLeftCharacterName(GameData.GetCharacterName(Character.Type.Player));
                dialogue.HideLeftText();
                dialogue.ShowRightCharacter(GameAssets.i.s_VendorPortrait, false);
                dialogue.ShowRightCharacterName(GameData.GetCharacterName(Character.Type.Shop));
                dialogue.ShowRightText("Greetings! Care to browse my wares?");
            },
            () => {
                dialogue.Hide();

                Window_Shop.Show_Static(shopCharacter.shopContents, () => {
                    UIBlack.Hide();
                    OvermapHandler.StartOvermapRunning();
                });
            },
        }, true);
    }
Beispiel #2
0
    public static void Play_DoppelGanger()
    {
        Window_QuestPointer.DestroyPointer(OvermapHandler.GetInstance().GetNPC(GameData.GetCharacter(Character.Type.PlayerDoppelganger)).GetPosition() + new Vector3(0, 10));
        UIBlack.Show();
        OvermapHandler.StopOvermapRunning();
        Dialogue dialogue = Dialogue.GetInstance();

        dialogue.SetDialogueActions(new List <Action>()
        {
            () => {
                dialogue.Show();
                dialogue.ShowLeftCharacter(GameAssets.i.s_PlayerDialogueSprite, false);
                dialogue.ShowLeftCharacterName(GameData.GetCharacterName(Character.Type.Player));
                dialogue.ShowRightCharacter(GameAssets.i.s_PlayerDialogueSprite, true);
                dialogue.ShowLeftText("Greetings, can you tell me where the Tavern is?");
                dialogue.HideRightText();
                dialogue.HideRightCharacterName();
            },
            () => { dialogue.ShowRightActiveTalkerHideLeft("It's just over there"); },
            () => { dialogue.ShowLeftActiveTalkerHideRight("Ok thank you!"); },
            () => {
                dialogue.Hide();
                UIBlack.Hide();
                OvermapHandler.StartOvermapRunning();
                Window_QuestPointer.Create(GameAssets.i.Map.Find("tavern").position, Color.white, Color.white);
                GameData.state = GameData.State.GoingToTavern;
            },
        }, true);
    }
Beispiel #3
0
    public static void Play_ArrivedAtTownCenter()
    {
        Window_QuestPointer.DestroyPointer(GameAssets.i.Map.Find("townCenter").position);
        GameData.state = GameData.State.GoingToAskDoppelGanger;
        UIBlack.Show();
        OvermapHandler.StopOvermapRunning();
        Dialogue dialogue = Dialogue.GetInstance();

        dialogue.SetDialogueActions(new List <Action>()
        {
            () => {
                dialogue.Show();
                dialogue.ShowLeftCharacter(GameAssets.i.s_PlayerDialogueSprite, true);
                dialogue.ShowLeftCharacterName(GameData.GetCharacterName(Character.Type.Player));
                dialogue.ShowRightCharacter(GameAssets.i.s_TankPortrait, false);
                dialogue.ShowRightCharacterName(GameData.GetCharacterName(Character.Type.Tank));
                dialogue.HideLeftText();
                dialogue.ShowRightText("We should get some refreshments before going on our Quest");
            },
            () => { dialogue.ShowLeftActiveTalkerHideRight("Good idea, let's find the tavern"); },
            () => {
                dialogue.Hide();
                UIBlack.Hide();
                OvermapHandler.StartOvermapRunning();
                Window_QuestPointer.Create(OvermapHandler.GetInstance().GetNPC(GameData.GetCharacter(Character.Type.PlayerDoppelganger)).GetPosition() + new Vector3(0, 10), Color.yellow, Color.yellow, crossSprite: GameAssets.i.s_ExclamationPoint);
            },
        }, true);
    }
Beispiel #4
0
    public static void Play_Tank_AfterJoin()
    {
        // After Defeating the Tank, Tank Joins team
        UIBlack.Show();
        OvermapHandler.StopOvermapRunning();
        Character playerCharacter = GameData.GetCharacter(Character.Type.Player);
        Character tankCharacter   = GameData.GetCharacter(Character.Type.Tank);

        Dialogue dialogue = Dialogue.GetInstance();

        dialogue.SetDialogueActions(new List <Action>()
        {
            () => {
                dialogue.Show();
                dialogue.ShowLeftCharacter(GameAssets.i.s_PlayerDialogueSprite, true);
                dialogue.ShowLeftCharacterName(GameData.GetCharacterName(Character.Type.Player));
                dialogue.ShowRightCharacter(GameAssets.i.s_TankPortrait, false);
                dialogue.ShowRightCharacterName("???");
                dialogue.ShowRightText("Ok ok you win!");
            },
            () => { dialogue.ShowRightText("You are such a strong Warrior, my apologies for doubting you"); },
            () => { dialogue.ShowLeftActiveTalkerHideRight("That's okay, you're quite strong yourself!"); },
            () => { dialogue.ShowRightActiveTalkerHideLeft("Please allow me to redeem myself by joining you on your quest to defeat the Evil Monster!"); },
            () => { dialogue.ShowLeftActiveTalkerHideRight("Sure, help is always needed, my name is " + playerCharacter.name); },
            () => { dialogue.ShowRightActiveTalkerHideLeft("And I'm..."); },
            () => {
                dialogue.Hide();
                Window_PickName.ShowAvailableNames((string selectedName) => {
                    tankCharacter.name = selectedName;
                    dialogue.Show();
                    dialogue.PlayNextAction();
                });
            },
            () => {
                dialogue.ShowRightActiveTalkerHideLeft("I'm " + tankCharacter.name);
                dialogue.ShowRightCharacterName(GameData.GetCharacterName(Character.Type.Tank));
            },
            () => { dialogue.ShowRightText("Oh hey and this is my buddy Sleezer!"); },
            () => { dialogue.ShowRightText("He goes everywhere with me"); },
            () => { dialogue.ShowRightText("He's a bit of a goofball but he's good company"); },
            () => {
                dialogue.ShowRightCharacter(GameAssets.i.s_SleezerPortrait, false);
                dialogue.ShowRightCharacterName(GameData.GetCharacterName(Character.Type.Sleezer));
                //dialogue.ShowRightCharacterName("???");
                dialogue.ShowRightText("Hihihi that's me!");
            },
            () => { dialogue.ShowLeftActiveTalkerHideRight("Oh Sleezer! You're adorable!"); },
            () => { dialogue.ShowLeftText("Alright, onwards on our Quest!"); },
            () => {
                dialogue.Hide();
                UIBlack.Hide();
                OvermapHandler.StartOvermapRunning();
                GameData.state = GameData.State.GoingToTownCenter;
                Window_QuestPointer.Create(GameAssets.i.Map.Find("townCenter").position, Color.white, Color.white);
            },
        }, true);
    }
Beispiel #5
0
    public static void Play_LostToEvilMonster_2()
    {
        UIBlack.Show();
        OvermapHandler.StopOvermapRunning();

        List <World_Sprite> ropeWorldSpriteList = new List <World_Sprite>();

        ropeWorldSpriteList.Add(World_Sprite.Create(OvermapHandler.GetInstance().GetPlayer().GetPosition(), Vector3.one * 1f, GameAssets.i.s_Rope, Color.white, 100));
        ropeWorldSpriteList.Add(World_Sprite.Create(OvermapHandler.GetInstance().GetFollower(GameData.GetCharacter(Character.Type.Healer)).GetPosition(), Vector3.one * 1f, GameAssets.i.s_Rope, Color.white, 100));
        ropeWorldSpriteList.Add(World_Sprite.Create(OvermapHandler.GetInstance().GetFollower(GameData.GetCharacter(Character.Type.Tank)).GetPosition(), Vector3.one * 1.2f, GameAssets.i.s_Rope, Color.white, 100));
        ropeWorldSpriteList.Add(World_Sprite.Create(OvermapHandler.GetInstance().GetFollower(GameData.GetCharacter(Character.Type.Sleezer)).GetPosition(), Vector3.one * 0.7f, GameAssets.i.s_Rope, Color.white, 100));

        NPCOvermap randyOvermap = OvermapHandler.GetInstance().GetNPC(GameData.GetCharacter(Character.Type.Randy));

        randyOvermap.GetUnitAnimation().PlayAnimForced(UnitAnim.GetUnitAnim("dBareHands_IdleUp"), 1f, null);
        Vector3 randyStartingPosition = randyOvermap.GetPosition();

        randyOvermap.overrideOvermapRunning = true;

        Dialogue dialogue = Dialogue.GetInstance();

        dialogue.SetDialogueActions(new List <Action>()
        {
            () => {
                dialogue.Show();
                dialogue.ShowLeftCharacter(GameAssets.i.s_PlayerDialogueSprite, true);
                dialogue.ShowLeftCharacterName(GameData.GetCharacterName(Character.Type.Player));
                dialogue.HideLeftText();
                dialogue.ShowRightCharacter(GameAssets.i.s_RandyPortrait, false);
                dialogue.ShowRightCharacterName(GameData.GetCharacterName(Character.Type.Randy));
                dialogue.ShowRightText("Oh my, this is my lucky day");
            },
            () => {
                dialogue.ShowLeftActiveTalkerHideRight("Oh no, you again");
            },
            () => {
                dialogue.ShowRightActiveTalkerHideLeft("What's wrong, not happy to see me?");
            },
            () => { dialogue.ShowLeftActiveTalkerHideRight("It seems we miraculously lost again"); },
            () => { dialogue.ShowLeftText("It's very annoying to get the Evil Monster almost near death and suddenly he wins"); },
            () => { dialogue.ShowRightActiveTalkerHideLeft("Oh dear that is a real bother"); },
            () => { dialogue.ShowLeftActiveTalkerHideRight("Yes it is, are you going to let us go?"); },
            () => { dialogue.ShowRightActiveTalkerHideLeft("Huhuhu maybe"); },
            () => { dialogue.ShowRightText("My oh my, you are truly precious"); },
            () => { dialogue.ShowRightText("If you really want to defeat him you need the Sword of Thousand Truths"); },
            () => { dialogue.ShowRightText("And would you look at that, I have it right here!"); },
            () => { dialogue.ShowRightText("Have fun! Huhuhu!"); },
            () => {
                // Randy Disappears in Smoke
                // Drop Sword

                /*
                 * NPCOvermap npcOvermap = OvermapHandler.GetInstance().GetNPC(GameData.GetCharacter(Character.Type.Randy));
                 * Transform objectTractorTransform = UnityEngine.Object.Instantiate(GameAssets.i.pfObjectTractor, npcOvermap.GetPosition(), Quaternion.identity);
                 * objectTractorTransform.GetComponent<TractorBehaviour>().Setup(OvermapHandler.GetInstance().GetPlayer(), 20f, 8f, () => {
                 *  GameData.GetCharacter(Character.Type.Player).hasSwordThousandTruths = true;
                 *  OvermapHandler.GetInstance().GetPlayer().RefreshTexture();
                 * });
                 *
                 * npcOvermap.Hide();
                 * UIBlack.Hide();
                 * dialogue.Hide();
                 * FunctionTimer.Create(() => {
                 *  UIBlack.Show();
                 *  dialogue.Show();
                 *  dialogue.PlayNextAction();
                 * }, 1f);
                 */


                Transform objectTractorTransform        = UnityEngine.Object.Instantiate(GameAssets.i.pfObjectTractor, randyOvermap.GetPosition(), Quaternion.identity);
                objectTractorTransform.localEulerAngles = new Vector3(0, 0, -45);
                objectTractorTransform.GetComponent <TractorBehaviour>().Setup(OvermapHandler.GetInstance().GetPlayer(), 20f, 8f, () => {
                    GameData.GetCharacter(Character.Type.Player).hasSwordThousandTruths = true;
                    OvermapHandler.GetInstance().GetPlayer().RefreshTexture();
                    SoundManager.PlaySound(SoundManager.Sound.Coin);
                });

                // Randy Disappears in Smoke
                UIBlack.Hide();
                dialogue.Hide();

                // Untie Player
                randyOvermap.SetTargetMovePosition(OvermapHandler.GetInstance().GetPlayer().GetPosition() + new Vector3(0, -5));
                FunctionTimer.Create(() => {
                    ropeWorldSpriteList[0].DestroySelf();
                }, 1f);

                // Untie Healer
                FunctionTimer.Create(() => {
                    randyOvermap.SetTargetMovePosition(OvermapHandler.GetInstance().GetFollower(GameData.GetCharacter(Character.Type.Healer)).GetPosition() + new Vector3(+5, 0));
                }, 1f);
                FunctionTimer.Create(() => {
                    ropeWorldSpriteList[1].DestroySelf();
                }, 2f);

                // Untie Tank
                FunctionTimer.Create(() => {
                    randyOvermap.SetTargetMovePosition(OvermapHandler.GetInstance().GetFollower(GameData.GetCharacter(Character.Type.Tank)).GetPosition() + new Vector3(-5, 0));
                }, 2f);
                FunctionTimer.Create(() => {
                    ropeWorldSpriteList[2].DestroySelf();
                }, 3f);

                // Untie Sleezer
                FunctionTimer.Create(() => {
                    randyOvermap.SetTargetMovePosition(OvermapHandler.GetInstance().GetFollower(GameData.GetCharacter(Character.Type.Sleezer)).GetPosition() + new Vector3(-5, 0));
                }, 3f);
                FunctionTimer.Create(() => {
                    ropeWorldSpriteList[3].DestroySelf();
                }, 4f);

                // Go to disappear
                FunctionTimer.Create(() => {
                    randyOvermap.SetTargetMovePosition(randyStartingPosition);
                }, 4f);
                FunctionTimer.Create(() => {
                    OvermapHandler.GetInstance().SpawnSmoke(randyOvermap.GetPosition(), .0f, Vector3.one);
                }, 5f);
                FunctionTimer.Create(() => {
                    randyOvermap.Hide();
                }, 5.5f);

                FunctionTimer.Create(() => {
                    UIBlack.Show();
                    dialogue.Show();
                    dialogue.PlayNextAction();
                }, 6.5f);
            },
            () => {
                dialogue.ShowLeftActiveTalkerHideRight("He's very odd but somehow very helpful");
                dialogue.HideRightCharacter();
                dialogue.HideRightCharacterName();
            },
            () => { dialogue.ShowLeftText("Why would the Evil Monster keep him around?"); },
            () => { dialogue.ShowLeftText("Anyways who cares we have the Sword of a Thousand Truths!"); },
            () => {
                dialogue.ShowLeftText("Let's get him once and for all!");
            },
            () => {
                dialogue.Hide();
                UIBlack.Hide();
                OvermapHandler.StartOvermapRunning();
                GameData.state = GameData.State.MovingToEvilMonster_3;
                Window_QuestPointer.Create(GameAssets.i.Map.Find("evilMonster_3").position, Color.white, Color.white);
            },
        }, true);
    }
Beispiel #6
0
    public static void Play_LostToEvilMonster_1()
    {
        UIBlack.Show();
        OvermapHandler.StopOvermapRunning();

        List <World_Sprite> ropeWorldSpriteList = new List <World_Sprite>();

        ropeWorldSpriteList.Add(World_Sprite.Create(OvermapHandler.GetInstance().GetPlayer().GetPosition(), Vector3.one * 1f, GameAssets.i.s_Rope, Color.white, 100));
        ropeWorldSpriteList.Add(World_Sprite.Create(OvermapHandler.GetInstance().GetFollower(GameData.GetCharacter(Character.Type.Healer)).GetPosition(), Vector3.one * 1f, GameAssets.i.s_Rope, Color.white, 100));
        ropeWorldSpriteList.Add(World_Sprite.Create(OvermapHandler.GetInstance().GetFollower(GameData.GetCharacter(Character.Type.Tank)).GetPosition(), Vector3.one * 1.2f, GameAssets.i.s_Rope, Color.white, 100));
        ropeWorldSpriteList.Add(World_Sprite.Create(OvermapHandler.GetInstance().GetFollower(GameData.GetCharacter(Character.Type.Sleezer)).GetPosition(), Vector3.one * 0.7f, GameAssets.i.s_Rope, Color.white, 100));

        NPCOvermap randyOvermap = OvermapHandler.GetInstance().GetNPC(GameData.GetCharacter(Character.Type.Randy));

        randyOvermap.GetUnitAnimation().PlayAnimForced(UnitAnim.GetUnitAnim("dBareHands_IdleUp"), 1f, null);
        Vector3 randyStartingPosition = randyOvermap.GetPosition();

        randyOvermap.overrideOvermapRunning = true;

        Dialogue dialogue = Dialogue.GetInstance();

        dialogue.SetDialogueActions(new List <Action>()
        {
            () => {
                dialogue.Show();
                dialogue.ShowLeftCharacter(GameAssets.i.s_PlayerDialogueSprite, false);
                dialogue.ShowLeftCharacterName(GameData.GetCharacterName(Character.Type.Player));
                dialogue.ShowLeftText("Oh come on, we had him! What happened?");
                dialogue.ShowRightCharacter(GameAssets.i.s_TankPortrait, true);
                dialogue.ShowRightCharacterName(GameData.GetCharacterName(Character.Type.Tank));
                dialogue.HideRightText();
            },
            () => {
                dialogue.ShowRightActiveTalkerHideLeft("Seems he overpowered us somehow...");
            },
            () => {
                dialogue.ShowRightCharacter(GameAssets.i.s_RandyPortrait, false);
                dialogue.ShowRightCharacterName(GameData.GetCharacterName(Character.Type.Randy));
                dialogue.ShowRightActiveTalkerHideLeft("Oh my, aren't you precious");
            },
            () => { dialogue.ShowRightText("You boys are quite fancy huhuhu"); },
            () => { dialogue.ShowLeftActiveTalkerHideRight("Who are you? Are you here to torture us?"); },
            () => { dialogue.ShowRightActiveTalkerHideLeft("Oh my, I could never torture such delicate specimens"); },
            () => { dialogue.ShowRightText("You are too pretty to be tied up"); },
            () => { dialogue.ShowRightText("Allow me to help you huhuhu"); },
            () => {
                // Randy Disappears in Smoke
                UIBlack.Hide();
                dialogue.Hide();

                // Untie Player
                randyOvermap.SetTargetMovePosition(OvermapHandler.GetInstance().GetPlayer().GetPosition() + new Vector3(0, -5));
                FunctionTimer.Create(() => {
                    ropeWorldSpriteList[0].DestroySelf();
                }, 1f);

                // Untie Healer
                FunctionTimer.Create(() => {
                    randyOvermap.SetTargetMovePosition(OvermapHandler.GetInstance().GetFollower(GameData.GetCharacter(Character.Type.Healer)).GetPosition() + new Vector3(+5, 0));
                }, 1f);
                FunctionTimer.Create(() => {
                    ropeWorldSpriteList[1].DestroySelf();
                }, 2f);

                // Untie Tank
                FunctionTimer.Create(() => {
                    randyOvermap.SetTargetMovePosition(OvermapHandler.GetInstance().GetFollower(GameData.GetCharacter(Character.Type.Tank)).GetPosition() + new Vector3(-5, 0));
                }, 2f);
                FunctionTimer.Create(() => {
                    ropeWorldSpriteList[2].DestroySelf();
                }, 3f);

                // Untie Sleezer
                FunctionTimer.Create(() => {
                    randyOvermap.SetTargetMovePosition(OvermapHandler.GetInstance().GetFollower(GameData.GetCharacter(Character.Type.Sleezer)).GetPosition() + new Vector3(-5, 0));
                }, 3f);
                FunctionTimer.Create(() => {
                    ropeWorldSpriteList[3].DestroySelf();
                }, 4f);

                // Go to disappear
                FunctionTimer.Create(() => {
                    randyOvermap.SetTargetMovePosition(randyStartingPosition);
                }, 4f);
                FunctionTimer.Create(() => {
                    OvermapHandler.GetInstance().SpawnSmoke(randyOvermap.GetPosition(), .0f, Vector3.one);
                }, 5f);
                FunctionTimer.Create(() => {
                    randyOvermap.Hide();
                }, 5.5f);

                FunctionTimer.Create(() => {
                    UIBlack.Show();
                    dialogue.Show();
                    dialogue.PlayNextAction();
                }, 7.5f);
            },
            () => {
                dialogue.ShowLeftActiveTalkerHideRight("Well that was weird...");
                dialogue.HideRightCharacterName();
                dialogue.HideRightCharacter();
            },
            () => {
                dialogue.ShowLeftText("But hey lets keep going! He's not getting away this time");
            },

            /*
             * () => {
             *  NPCOvermap npcOvermap = OvermapHandler.GetInstance().GetNPC(GameData.GetCharacter(Character.Type.Randy));
             *  npcOvermap.SetTargetMovePosition();
             *  dialogue.Hide();
             *  UIBlack.Hide();
             *  OvermapHandler.StartOvermapRunning();
             * },*/
            () => {
                dialogue.Hide();
                UIBlack.Hide();
                OvermapHandler.StartOvermapRunning();
                GameData.state = GameData.State.MovingToEvilMonster_2;
                Window_QuestPointer.Create(GameAssets.i.Map.Find("evilMonster_2").position, Color.white, Color.white);
            },
        }, true);
    }
Beispiel #7
0
    public void Start(Transform transform)
    {
        overmapFtnDewHandler = new OvermapFtnDewHandler();
        UIBlack.Show();
        StopOvermapRunning();
        Window_PickName.Show_Static();
        Window_PickName.AddOption_Static("Custom Name (Length 4)", () => { });
        foreach (string badName in GameData.badNamesArray)
        {
            Window_PickName.AddOption_Static(badName, () => { Debug.Log(badName); });
        }
        Window_PickName.Hide_Static();
        StartOvermapRunning();
        UIBlack.Hide();


        foreach (Character character in GameData.characterList)
        {
            if (character.isDead)
            {
                continue;
            }
            if (character.IsEnemy())
            {
                SpawnEnemy(character);
                continue;
            }

            switch (character.type)
            {
            case Character.Type.Player:
                playerOvermap.Setup(character);
                break;

            case Character.Type.Tank:
                if (character.subType == Character.SubType.Tank_BeforeJoin)
                {
                    // Before Tank joined, make him an NPC
                    SpawnNPC(character);
                }
                else
                {
                    // After Tank joined, make him a Follower
                    SpawnFollower(character, new Vector3(10, 0));
                }
                break;

            case Character.Type.Sleezer:
                if (character.subType == Character.SubType.Sleezer_Friendly)
                {
                    // After Tank joined, make him a Follower
                    SpawnFollower(character, new Vector3(10, -5));
                }
                break;

            case Character.Type.Healer:
                if (character.subType == Character.SubType.Healer_BeforeJoin)
                {
                    // Before Healer joined, make him an NPC
                    SpawnNPC(character);
                }
                else
                {
                    // After Healer joined, make him a Follower
                    SpawnFollower(character, new Vector3(10, 0));
                }
                break;

            case Character.Type.PlayerDoppelganger:
            case Character.Type.Shop:
            case Character.Type.Randy:
            case Character.Type.TavernAmbush:
            case Character.Type.TavernAmbush_2:
            case Character.Type.TavernAmbush_3:
                SpawnNPC(character);
                break;

            case Character.Type.Villager_1:
            case Character.Type.Villager_2:
            case Character.Type.Villager_3:
            case Character.Type.Villager_4:
            case Character.Type.Villager_5:
                NPCOvermap npcOvermap = SpawnNPC(character);
                foreach (Transform child in transform.Find("Map"))
                {
                    if (Vector3.Distance(npcOvermap.GetPosition(), child.position) < 1f)
                    {
                        CharacterSetLastMoveDirData characterSetLastMoveDirData = child.GetComponent <CharacterSetLastMoveDirData>();
                        npcOvermap.SetLastMoveDir(characterSetLastMoveDirData.lastMoveDir);
                    }
                }
                break;
            }
        }


        foreach (Item item in GameData.itemList)
        {
            if (item.IsDestroyed())
            {
                continue;
            }
            SpawnItem(item);
        }

        //OvermapHandler.SpawnNPC(new Vector3(0, 70));

        // Starting state
        switch (GameData.state)
        {
        case GameData.State.Start:
            Cutscenes.Play_Start();
            break;

        case GameData.State.DefeatedHurtMeDaddy:
        case GameData.State.DefeatedHurtMeDaddy_2:
            Window_QuestPointer.Create(GetNPC(GameData.GetCharacter(Character.Type.Tank)).GetPosition() + new Vector3(0, 10), Color.yellow, Color.yellow, crossSprite: GameAssets.i.s_ExclamationPoint);
            break;

        case GameData.State.DefeatedTank:
            Cutscenes.Play_Tank_AfterJoin();
            break;

        case GameData.State.SurvivedTavernAmbush:
            Cutscenes.Play_SurvivedTavernAmbush();
            break;

        case GameData.State.HealerJoined:
            Window_QuestPointer.Create(GameAssets.i.Map.Find("shop").position, Color.white, Color.white);
            break;

        case GameData.State.LostToEvilMonster_1:
            playerOvermap.SetPosition(GameAssets.i.Map.Find("dungeonPlayer").position);
            GetFollower(GameData.GetCharacter(Character.Type.Tank)).SetPosition(GameAssets.i.Map.Find("dungeonTank").position);
            GetFollower(GameData.GetCharacter(Character.Type.Sleezer)).SetPosition(GameAssets.i.Map.Find("dungeonSleezer").position);
            GetFollower(GameData.GetCharacter(Character.Type.Healer)).SetPosition(GameAssets.i.Map.Find("dungeonHealer").position);

            Cutscenes.Play_LostToEvilMonster_1();
            break;

        case GameData.State.MovingToEvilMonster_2:
            Window_QuestPointer.Create(GameAssets.i.Map.Find("evilMonster_2").position, Color.white, Color.white);
            break;

        case GameData.State.LostToEvilMonster_2:
            playerOvermap.SetPosition(GameAssets.i.Map.Find("dungeonPlayer").position);
            GetFollower(GameData.GetCharacter(Character.Type.Tank)).SetPosition(GameAssets.i.Map.Find("dungeonTank").position);
            GetFollower(GameData.GetCharacter(Character.Type.Sleezer)).SetPosition(GameAssets.i.Map.Find("dungeonSleezer").position);
            GetFollower(GameData.GetCharacter(Character.Type.Healer)).SetPosition(GameAssets.i.Map.Find("dungeonHealer").position);

            Cutscenes.Play_LostToEvilMonster_2();
            break;

        case GameData.State.MovingToEvilMonster_3:
            Window_QuestPointer.Create(GameAssets.i.Map.Find("evilMonster_3").position, Color.white, Color.white);
            break;

        case GameData.State.DefeatedEvilMonster:
            Cutscenes.Play_DefeatedEvilMonster();
            break;
        }

        transform.Find("Map").Find("Hitboxes").Find("TavernEntryHitbox").gameObject.SetActive(((int)GameData.state) < ((int)GameData.State.DefeatedTank));
        transform.Find("Map").Find("Hitboxes").Find("HurtMeDaddyHitbox").gameObject.SetActive(((int)GameData.state) < ((int)GameData.State.DefeatedHurtMeDaddy));
        transform.Find("Map").Find("Hitboxes").Find("HurtMeDaddy2Hitbox").gameObject.SetActive(((int)GameData.state) < ((int)GameData.State.DefeatedHurtMeDaddy_2));
        transform.Find("Map").Find("Hitboxes").Find("CastleBlockageHitbox").gameObject.SetActive(((int)GameData.state) < ((int)GameData.State.LostToEvilMonster_2));

        transform.Find("Map").Find("VillagerBlocker").gameObject.SetActive(((int)GameData.state) < ((int)GameData.State.DefeatedTank));

        transform.Find("Map").Find("Blockage").gameObject.SetActive(((int)GameData.state) < ((int)GameData.State.LostToEvilMonster_2));

        //transform.Find("Map").Find("Hitboxes").Find("HurtMeDaddyHitbox").GetComponent<SpriteRenderer>().color = new Color(0, 0, 0, 0);
        //transform.Find("Map").Find("Hitboxes").Find("HurtMeDaddy2Hitbox").GetComponent<SpriteRenderer>().color = new Color(0, 0, 0, 0);

        foreach (Transform hitboxTransform in transform.Find("Map").Find("Hitboxes"))
        {
            hitboxTransform.GetComponent <SpriteRenderer>().color = new Color(0, 0, 0, 0);
        }

        //transform.Find("Map").Find("Hitboxes").Find("CastleBlockageHitbox").GetComponent<SpriteRenderer>().color = new Color(0, 0, 0, .5f);

        //Window_QuestPointer.Create(new Vector3(150, 0), Color.white, Color.white);
        //ChatBubble.Create(playerOvermap.transform, new Vector3(3.5f, 5), "Oh Sleezer! You're so silly!");
        //ChatBubble.Create(playerOvermap.transform, new Vector3(3.5f, 5), "Hihihi");
    }
Beispiel #8
0
    public void Update()
    {
        overmapFtnDewHandler.Update();

        switch (GameData.state)
        {
        case GameData.State.GoingToTownCenter:
            //Vector3 townCenterPosition = GameAssets.i.Map.Find("townCenter").position;
            List <Vector3> positionList = new List <Vector3> {
                GameAssets.i.Map.Find("townCenter").position,
                GameAssets.i.Map.Find("townCenter_2").position,
                GameAssets.i.Map.Find("townCenter_3").position,
            };
            bool reachedPosition = false;
            foreach (Vector3 position in positionList)
            {
                if (Vector3.Distance(playerOvermap.GetPosition(), position) < 30f)
                {
                    reachedPosition = true;
                }
            }
            if (reachedPosition)
            {
                GameData.state = GameData.State.ArrivedAtTownCenter;
                Cutscenes.Play_ArrivedAtTownCenter();
            }
            break;

        case GameData.State.GoingToTavern:
            Vector3 tavernPosition = GameAssets.i.Map.Find("tavern").position;
            if (Vector3.Distance(playerOvermap.GetPosition(), tavernPosition) < 20f)
            {
                GameData.state = GameData.State.InTavern;
                Cutscenes.Play_Tavern();
            }
            break;

        case GameData.State.LeavingTown:
            //Vector3 leaveTownPosition = GameAssets.i.Map.Find("letsLeaveTown").position;
            positionList = new List <Vector3> {
                GameAssets.i.Map.Find("letsLeaveTown").position,
                GameAssets.i.Map.Find("letsLeaveTown_2").position,
                GameAssets.i.Map.Find("letsLeaveTown_3").position,
            };
            reachedPosition = false;
            foreach (Vector3 position in positionList)
            {
                if (Vector3.Distance(playerOvermap.GetPosition(), position) < 30f)
                {
                    reachedPosition = true;
                }
            }
            if (reachedPosition)
            {
                GameData.state = GameData.State.GoingToFirstEvilMonsterEncounter;
                Window_QuestPointer.DestroyPointer(GameAssets.i.Map.Find("letsLeaveTown").position);

                Window_QuestPointer.Create(GameAssets.i.Map.Find("evilMonster").position, Color.white, Color.white);
            }
            break;

        case GameData.State.GoingToFirstEvilMonsterEncounter:
            Vector3 evilMonsterPosition = GetEnemy(Character.Type.EvilMonster).GetPosition();
            if (Vector3.Distance(playerOvermap.GetPosition(), evilMonsterPosition) < 90f)
            {
                GameData.state = GameData.State.GoingToFightEvilMonster;
                Window_QuestPointer.DestroyPointer(GameAssets.i.Map.Find("evilMonster").position);

                Cutscenes.Play_SpottedEvilMonster();
            }
            break;

        case GameData.State.MovingToEvilMonster_2:
            evilMonsterPosition = GetEnemy(Character.Type.EvilMonster_2).GetPosition();
            if (Vector3.Distance(playerOvermap.GetPosition(), evilMonsterPosition) < 80f)
            {
                GameData.state = GameData.State.GoingToFightEvilMonster_2;
                Window_QuestPointer.DestroyPointer(GameAssets.i.Map.Find("evilMonster_2").position);
            }
            break;

        case GameData.State.MovingToEvilMonster_3:
            evilMonsterPosition = GetEnemy(Character.Type.EvilMonster_3).GetPosition();
            if (Vector3.Distance(playerOvermap.GetPosition(), evilMonsterPosition) < 80f)
            {
                GameData.state = GameData.State.GoingToFightEvilMonster_3;
                Window_QuestPointer.DestroyPointer(GameAssets.i.Map.Find("evilMonster_3").position);
            }
            break;
        }
    }