示例#1
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);
    }
示例#2
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);
    }
示例#3
0
    public static void Play_SpottedEvilMonster()
    {
        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.ShowLeftText("Wait a second...");
                dialogue.HideRightCharacter();
                dialogue.HideRightText();
            },
            () => {
                dialogue.ShowLeftText("That's him!");
            },
            () => {
                dialogue.Hide();
                UIBlack.Hide();
                OvermapHandler.StartOvermapRunning();
            },
        }, true);
    }
示例#4
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);
    }
示例#5
0
    public static void Play_EvilMonster_2(Character evilMonsterCharacter)
    {
        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.ShowLeftText("You're not getting away this time!");
                dialogue.ShowRightCharacter(GameAssets.i.s_EvilMonsterPortrait, true);
                dialogue.ShowRightCharacterName(GameData.GetCharacterName(Character.Type.EvilMonster));
                dialogue.HideRightText();
            },
            () => {
                dialogue.ShowRightActiveTalkerHideLeft("Mwahahaha let's see!");
            },
            () => {
                GameData.state = GameData.State.FightingEvilMonster_2;
                BattleHandler.LoadEnemyEncounter(evilMonsterCharacter, evilMonsterCharacter.enemyEncounter);
            },
        }, true);
    }
 public static void LoadEnemyEncounter(Character character, GameData.EnemyEncounter enemyEncounter)
 {
     OvermapHandler.SaveAllCharacterPositions();
     BattleHandler.character      = character;
     BattleHandler.enemyEncounter = enemyEncounter;
     Loader.Load(Loader.Scene.BattleScene);
 }
示例#7
0
    public static void Play_EvilMonster_3(Character evilMonsterCharacter)
    {
        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.ShowLeftText("Back again!");
                dialogue.ShowRightCharacter(GameAssets.i.s_EvilMonsterPortrait, true);
                dialogue.ShowRightCharacterName(GameData.GetCharacterName(Character.Type.EvilMonster));
                dialogue.HideRightText();
            },
            () => {
                dialogue.ShowRightActiveTalkerHideLeft("Now you're becoming a nuisance!");
            },
            () => {
                dialogue.ShowRightText("This time I'll end you!");
            },
            () => {
                GameData.state = GameData.State.FightingEvilMonster_3;
                BattleHandler.LoadEnemyEncounter(evilMonsterCharacter, evilMonsterCharacter.enemyEncounter);
            },
        }, true);
    }
示例#8
0
    public static void Play_DefeatedEvilMonster()
    {
        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.ShowLeftText("We did it!");
                dialogue.ShowRightCharacter(GameAssets.i.s_SleezerPortrait, true);
                dialogue.ShowRightCharacterName(GameData.GetCharacterName(Character.Type.Sleezer));
                dialogue.HideRightText();
            },
            () => {
                dialogue.ShowLeftText("Sleezer, you defeated him!");
            },
            () => {
                dialogue.ShowRightActiveTalkerHideLeft("Hihihi that's me!");
            },
            () => {
                dialogue.ShowLeftActiveTalkerHideRight("It's finally over, we defeated the Evil Monster!");
            },
            () => {
                dialogue.ShowLeftText("Thank you all for coming with me on this quest");
            },
            () => {
                dialogue.FadeLeftCharacter();
                dialogue.HideLeftText();
                dialogue.ShowRightCharacter(GameAssets.i.s_TankPortrait, false);
                dialogue.ShowRightText("It was an honor to fight alongside you!");
                dialogue.ShowRightCharacterName(GameData.GetCharacterName(Character.Type.Tank));
            },
            () => {
                dialogue.ShowRightCharacter(GameAssets.i.s_HealerPortrait, false);
                dialogue.ShowRightText("Yes, I'm glad we joined you on this quest");
                dialogue.ShowRightCharacterName(GameData.GetCharacterName(Character.Type.Healer));
            },
            () => {
                dialogue.ShowRightText("If you ever need help we'll be right here");
            },
            () => {
                dialogue.ShowLeftActiveTalkerHideRight("Here's to the savior of the world, Sleezer!");
            },
            () => {
                dialogue.FadeLeftCharacter();
                dialogue.HideLeftText();
                dialogue.ShowRightCharacter(GameAssets.i.s_SleezerPortrait, false);
                dialogue.ShowRightCharacterName(GameData.GetCharacterName(Character.Type.Sleezer));
                dialogue.ShowRightText("Hihihi that's me!");
            },
            () => {
                GameData.state = GameData.State.GameOver;
                Loader.Load(Loader.Scene.GameOver);
            },
        }, true);
    }
示例#9
0
 public OvermapHandler(PlayerOvermap playerOvermap)
 {
     instance           = this;
     this.playerOvermap = playerOvermap;
     followerList       = new List <FollowerOvermap>();
     npcList            = new List <NPCOvermap>();
     enemyList          = new List <EnemyOvermap>();
     overmapRunning     = true;
 }
示例#10
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);
    }
示例#11
0
 private void Buy_FtnDewArmor()
 {
     if (shopContents.hasFtnDewArmor)
     {
         shopContents.hasFtnDewArmor = false;
         GameData.GetCharacter(Character.Type.Player).hasFtnDewArmor = true;
         OvermapHandler.SaveAllCharacterPositions();
         Loader.Load(Loader.Scene.GameScene);
     }
 }
    private void Start()
    {
        //Sound_Manager.Init();

        gridPathfinding = new GridPathfinding(new Vector3(-400, -400), new Vector3(400, 400), 5f);
        gridPathfinding.RaycastWalkable();

        OvermapHandler.GetInstance().Start(transform);

        cameraFollow.Setup(GetCameraPosition, () => 70f, true, true);
    }
示例#13
0
    private void Awake()
    {
        ftnDewText       = transform.Find("ftnDew").Find("text").GetComponent <Text>();
        healthPotionText = transform.Find("healthPotion").Find("text").GetComponent <Text>();
        keyGameObject    = transform.Find("key").gameObject;
        keyGameObject.SetActive(false);

        ftnDewText.text = GameData.ftnDewPoints.ToString();

        if (GameData.ftnDewPoints > 0)
        {
            ShowFtnDew();
        }
        else
        {
            HideFtnDew();
        }

        FunctionTimer.Create(() => {
            if (GameData.healthPotionCount > 0 && OvermapHandler.GetInstance().GetPlayer().GetHealth() < 100)
            {
                keyGameObject.SetActive(true);
                FunctionTimer.Create(() => { keyGameObject.SetActive(false); }, 0.5f);
                FunctionTimer.Create(() => { keyGameObject.SetActive(true); }, 1.0f);
                FunctionTimer.Create(() => { keyGameObject.SetActive(false); }, 1.5f);
                FunctionTimer.Create(() => { keyGameObject.SetActive(true); }, 2.0f);
                FunctionTimer.Create(() => { keyGameObject.SetActive(false); }, 2.5f);
            }
        }, Random.Range(3f, 10f));

        transform.Find("optionsBtn").GetComponent <Button_UI>().ClickFunc = () => {
            Window_Pause.Show_Static();
        };
        transform.Find("optionsBtn").GetComponent <Button_UI>().AddButtonSounds();

        transform.Find("optionsText").gameObject.SetActive(false);
        if (GameData.state == GameData.State.Start)
        {
            FunctionTimer.Create(() => transform.Find("optionsText").gameObject.SetActive(true), 4.0f);

            /*
             * FunctionTimer.Create(() => transform.Find("optionsText").gameObject.SetActive(false), 2.5f);
             * FunctionTimer.Create(() => transform.Find("optionsText").gameObject.SetActive(true),  3.0f);
             * FunctionTimer.Create(() => transform.Find("optionsText").gameObject.SetActive(false), 3.5f);
             * FunctionTimer.Create(() => transform.Find("optionsText").gameObject.SetActive(true),  4.0f);
             */
        }

        timePlayedText = transform.Find("timePlayedText").GetComponent <Text>();
        secondsPlayed  = Random.Range(0f, 60f * 30);
        RefreshTimePlayed();
    }
示例#14
0
    public static void Play_Start()
    {
        OvermapHandler.StopOvermapRunning();
        UIBlack.Show();
        Character playerCharacter = GameData.GetCharacter(Character.Type.Player);
        Dialogue  dialogue        = Dialogue.GetInstance();

        dialogue.SetDialogueActions(new List <Action>()
        {
            () => {
                dialogue.Show();
                dialogue.ShowLeftCharacter(GameAssets.i.s_PlayerDialogueSprite, false);
                dialogue.ShowLeftText("What happened?");
                dialogue.ShowLeftCharacterName("???");
                dialogue.HideRightCharacter();
                dialogue.HideRightText();
                dialogue.HideRightCharacterName();
            },
            () => {
                dialogue.ShowLeftText("What was I doing?");
            },
            () => {
                dialogue.ShowLeftText("Oh right, I was going to defeat the Evil Monster in the Evil Castle");
            },
            () => {
                dialogue.ShowLeftText("What was my name again?");
            },
            () => {
                dialogue.Hide();
                Window_KeyContinue.Hide_Static();
                Window_PickName.ShowAvailableNames((string selectedName) => {
                    playerCharacter.name = selectedName;
                    dialogue.Show();
                    dialogue.PlayNextAction();
                });
            },
            () => {
                dialogue.ShowLeftText("Oh that's right, I'm " + playerCharacter.name);
                dialogue.ShowLeftCharacterName(playerCharacter.name);
            },
            () => {
                dialogue.ShowLeftText("Alright let's go!");
            },
            () => {
                dialogue.Hide();
                UIBlack.Hide();
                OvermapHandler.StartOvermapRunning();
                //GameData.state = GameData.State.GoingToTownCenter;
            },
        }, true);
    }
    private void HandleSleezer()
    {
        sleezerTripUpTimer -= Time.deltaTime;
        if (sleezerTripUpTimer < 0f)
        {
            SetTargetMovePosition(playerOvermap.GetPosition());
            float tripUpDistance = 5f;
            if (Vector3.Distance(GetPosition(), playerOvermap.GetPosition()) < tripUpDistance)
            {
                playerOvermap.SleezerTripUp();
                SoundManager.PlaySound(SoundManager.Sound.CharacterHit);
                string chatText;
                switch (UnityEngine.Random.Range(0, 4))
                {
                default:
                case 0: chatText = "Hihihi, sorry about that!"; break;

                case 1: chatText = "Hihihi, don't mind me!";    break;

                case 2: chatText = "Hihihi, I'm so clumsy!";    break;

                case 3: chatText = "Hihihi, silly me!";         break;
                }
                ChatBubble.Create(transform, new Vector3(3.5f, 4), chatText);
                sleezerTripUpTimer = UnityEngine.Random.Range(20f, 50f);

                // Other Message
                Transform randomCharacterTransform = OvermapHandler.GetInstance().GetRandomCharacterTransform(false);
                string    responseMessage;
                switch (UnityEngine.Random.Range(0, 2))
                {
                default:
                case 0: responseMessage = "Oh Sleezer! You're so silly!"; break;

                case 1: responseMessage = "Oh Sleezer! You're adorable!"; break;
                }
                FunctionTimer.Create(() => {
                    ChatBubble.Create(randomCharacterTransform, new Vector3(3.5f, 5), responseMessage);
                }, 5f);

                OvermapFtnDewHandler.DestroyAllChatBubbles_Static();
                OvermapHandler.GetInstance().sleezerActive = true;
                FunctionTimer.Create(() => { OvermapHandler.GetInstance().sleezerActive = false; }, 7f);
            }
        }
    }
    public void Update()
    {
        if (!OvermapHandler.IsOvermapRunning())
        {
            return;
        }

        if ((int)GameData.state >= (int)GameData.State.DefeatedTank && !OvermapHandler.GetInstance().sleezerActive)
        {
            // Count down timer to next popup
            nextSpawnTimer -= Time.deltaTime;
            if (nextSpawnTimer <= 0f)
            {
                nextSpawnTimer = Random.Range(7f, 15f);
                SpawnChatBubble(GetCharacterTransformToSayChatBubble());
            }
        }
    }
示例#17
0
    public void Setup(Character character)
    {
        this.character     = character;
        transform.position = character.position;
        healthSystem       = new HealthSystem(character.stats.healthMax);
        healthSystem.SetHealthAmount(character.stats.health);
        healthWorldBar = new World_Bar(transform, new Vector3(0, 10), new Vector3(15, 2), Color.grey, Color.red, healthSystem.GetHealthPercent(), UnityEngine.Random.Range(10000, 11000), new World_Bar.Outline {
            color = Color.black, size = .6f
        });
        healthSystem.OnHealthChanged += HealthSystem_OnHealthChanged;
        RefreshHealthBar();

        RefreshTexture();

        playerBase.GetAnimatedWalker().SetAnimations(UnitAnimType.GetUnitAnimType("dSwordTwoHandedBack_Idle"), UnitAnimType.GetUnitAnimType("dSwordTwoHandedBack_Walk"), 1f, .7f);

        OvermapHandler.GetInstance().OnOvermapStopped += NPCOvermap_OnOvermapStopped;
    }
示例#18
0
    public static void Play_Tank_BeforeJoin()
    {
        // First meeting with Tank
        UIBlack.Show();
        OvermapHandler.StopOvermapRunning();
        Dialogue  dialogue      = Dialogue.GetInstance();
        Character tankCharacter = GameData.GetCharacter(Character.Type.Tank);

        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_TankPortrait, true);
                //dialogue.ShowRightCharacterName(GameData.GetCharacterName(Character.Type.Tank));
                dialogue.ShowRightCharacterName("???");
                dialogue.ShowLeftText("Greetings!");
            },
            () => {
                dialogue.ShowRightActiveTalkerHideLeft("Entrance to the town is restricted");
            },
            () => {
                dialogue.ShowLeftActiveTalkerHideRight("But I need to get past to get to the Evil Castle to defeat the Evil Monster!");
            },
            () => {
                dialogue.ShowRightActiveTalkerHideLeft("There are reports of Evil Minions roaming these lands, no one is allowed in until they are taken care of");
            },
            () => {
                dialogue.ShowLeftActiveTalkerHideRight("Some short guys? I took care of them!");
            },
            () => {
                dialogue.ShowRightActiveTalkerHideLeft("I don't believe you!");
            },
            () => {
                dialogue.ShowRightText("Show me your skills!");
            },
            () => {
                GameData.state = GameData.State.FightingTank;
                BattleHandler.LoadEnemyEncounter(tankCharacter, tankCharacter.enemyEncounter);
            },
        }, true);
    }
    private Transform GetCharacterTransformToSayChatBubble()
    {
        List <Transform> list = new List <Transform> {
            OvermapHandler.GetInstance().GetPlayer().transform,
        };

        if (OvermapHandler.GetInstance().GetFollower(GameData.GetCharacter(Character.Type.Sleezer)) != null)
        {
            list.Add(OvermapHandler.GetInstance().GetFollower(GameData.GetCharacter(Character.Type.Sleezer)).transform);
        }
        if (OvermapHandler.GetInstance().GetFollower(GameData.GetCharacter(Character.Type.Tank)) != null)
        {
            list.Add(OvermapHandler.GetInstance().GetFollower(GameData.GetCharacter(Character.Type.Tank)).transform);
        }
        if (OvermapHandler.GetInstance().GetFollower(GameData.GetCharacter(Character.Type.Healer)) != null)
        {
            list.Add(OvermapHandler.GetInstance().GetFollower(GameData.GetCharacter(Character.Type.Healer)).transform);
        }
        return(list[Random.Range(0, list.Count)]);
    }
示例#20
0
    private void Update()
    {
        if (!OvermapHandler.IsOvermapRunning() && !overrideOvermapRunning)
        {
            //playerBase.PlayIdleAnim();
            return; // Overmap not running
        }

        switch (state)
        {
        case State.Normal:
            HandleMovement();
            break;
        }

        if (materialTintColor.a > 0)
        {
            float tintFadeSpeed = 6f;
            materialTintColor.a -= tintFadeSpeed * Time.deltaTime;
            material.SetColor("_Tint", materialTintColor);
        }
    }
    private void Update()
    {
        if (materialTintColor.a > 0)
        {
            float tintFadeSpeed = 6f;
            materialTintColor.a -= tintFadeSpeed * Time.deltaTime;
            material.SetColor("_Tint", materialTintColor);
        }

        if (!OvermapHandler.IsOvermapRunning())
        {
            playerBase.PlayIdleAnim();
            return; // Overmap not running
        }

        switch (character.type)
        {
        default:
            switch (state)
            {
            case State.Normal:
                HandleTargetMovePosition();
                HandleMovement();
                break;
            }
            break;

        case Character.Type.Sleezer:
            switch (state)
            {
            case State.Normal:
                HandleTargetMovePosition();
                HandleSleezer();
                HandleMovement();
                break;
            }
            break;
        }
    }
示例#22
0
    public static void Play_HurtMeDaddy_2(Character character)
    {
        // Second Minion
        OvermapHandler.StopOvermapRunning();
        UIBlack.Show();
        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_EnemyMinionRedPortrait, false);
                dialogue.ShowRightText("Hey you! Have you seen a short guy around here?");
                dialogue.HideRightCharacterName();
            },
            () => {
                dialogue.ShowLeftActiveTalkerHideRight("Hum...");
            },
            () => {
                dialogue.ShowRightActiveTalkerHideLeft("Wait a second!");
            },
            () => {
                dialogue.ShowRightText("Did you do it?!");
            },
            () => {
                dialogue.ShowRightText("You did!");
            },
            () => {
                dialogue.ShowRightText("How dare you hurt him!");
            },
            () => {
                GameData.state = GameData.State.FightingHurtMeDaddy_2;
                BattleHandler.LoadEnemyEncounter(character, character.enemyEncounter);
            },
        }, true);
    }
示例#23
0
    public static void Play_HurtMeDaddy(Character character)
    {
        // First Minion
        OvermapHandler.StopOvermapRunning();
        UIBlack.Show();
        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_EnemyMinionOrangePortrait, false);
                dialogue.ShowRightText("Myah! Hurt me daddy!");
                dialogue.HideRightCharacterName();
            },
            () => {
                dialogue.ShowLeftActiveTalkerHideRight("What?");
            },
            () => {
                dialogue.ShowRightActiveTalkerHideLeft("Hurt me daddy!");
            },
            () => {
                dialogue.ShowLeftActiveTalkerHideRight("That's weird...");
            },
            () => {
                dialogue.ShowRightActiveTalkerHideLeft("Hurt me daddy!");
            },
            () => {
                GameData.state = GameData.State.FightingHurtMeDaddy;
                BattleHandler.LoadEnemyEncounter(character, character.enemyEncounter);
            },
        }, true);
    }
示例#24
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);
    }
示例#25
0
    public void Setup(Character character, PlayerOvermap playerOvermap)
    {
        this.character     = character;
        this.playerOvermap = playerOvermap;

        playerBase.GetAnimatedWalker().SetAnimations(GameAssets.UnitAnimTypeEnum.dBareHands_Idle, GameAssets.UnitAnimTypeEnum.dBareHands_Walk, 1f, 1f);

        switch (character.type)
        {
        case Character.Type.Tank:
            material.mainTexture = GameAssets.i.t_Tank;
            playerBase.GetAnimatedWalker().SetAnimations(GameAssets.UnitAnimTypeEnum.dSwordShield_Idle, GameAssets.UnitAnimTypeEnum.dSwordShield_Walk, 1f, 1f);
            transform.localScale = Vector3.one * 1.2f;
            break;

        case Character.Type.Healer:
            material.mainTexture = GameAssets.i.t_Healer;
            playerBase.GetAnimatedWalker().SetAnimations(GameAssets.UnitAnimTypeEnum.dDualDagger_Idle, GameAssets.UnitAnimTypeEnum.dDualDagger_Walk, 1f, 1f);
            transform.localScale = Vector3.one * 1.0f;
            break;

        case Character.Type.PlayerDoppelganger:
            material.mainTexture = GameAssets.i.t_Player;
            playerBase.GetAnimatedWalker().SetAnimations(GameAssets.UnitAnimTypeEnum.dBareHands_Idle, GameAssets.UnitAnimTypeEnum.dBareHands_Walk, 1f, 1f);
            transform.localScale = Vector3.one * 1.0f;
            break;

        case Character.Type.Shop:
            material.mainTexture = GameAssets.i.t_Vendor;
            break;

        case Character.Type.Villager_1: material.mainTexture = GameAssets.i.t_Villager_1; break;

        case Character.Type.Villager_2: material.mainTexture = GameAssets.i.t_Villager_2; break;

        case Character.Type.Villager_3: material.mainTexture = GameAssets.i.t_Villager_3; break;

        case Character.Type.Villager_4: material.mainTexture = GameAssets.i.t_Villager_4; break;

        case Character.Type.Villager_5: material.mainTexture = GameAssets.i.t_Villager_5; break;

        case Character.Type.Randy:
            material.mainTexture = GameAssets.i.t_Randy;
            playerBase.GetAnimatedWalker().SetAnimations(GameAssets.UnitAnimTypeEnum.dBareHands_Idle, GameAssets.UnitAnimTypeEnum.dBareHands_Walk, 1f, 1f);
            break;

        case Character.Type.TavernAmbush:
            material.mainTexture = GameAssets.i.t_EnemyMinionRed;
            playerBase.GetAnimatedWalker().SetAnimations(GameAssets.UnitAnimTypeEnum.dMinion_Idle, GameAssets.UnitAnimTypeEnum.dMinion_Walk, 1f, 1f);
            break;

        case Character.Type.TavernAmbush_2:
        case Character.Type.TavernAmbush_3:
            material.mainTexture = GameAssets.i.t_EnemyMinionOrange;
            playerBase.GetAnimatedWalker().SetAnimations(GameAssets.UnitAnimTypeEnum.dMinion_Idle, GameAssets.UnitAnimTypeEnum.dMinion_Walk, 1f, 1f);
            break;
        }

        SetTargetMovePosition(GetPosition());

        OvermapHandler.GetInstance().OnOvermapStopped += NPCOvermap_OnOvermapStopped;
    }
示例#26
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);
    }
 private void Start()
 {
     FunctionTimer.Create(() => {
         OvermapHandler.LoadBackToOvermap();
     }, 20f);
 }
示例#28
0
    public static void Play_SurvivedTavernAmbush()
    {
        // Healer after Tavern ambush
        UIBlack.Show();
        OvermapHandler.StopOvermapRunning();
        Dialogue  dialogue        = Dialogue.GetInstance();
        Character healerCharacter = GameData.GetCharacter(Character.Type.Healer);

        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_HealerPortrait, false);
                dialogue.ShowRightCharacterName("???");
                dialogue.ShowRightText("You've saved us all!");
            },
            () => { dialogue.ShowRightText("Oh no, you're hurt, let me help you"); },
            () => {
                UIBlack.Hide();
                dialogue.Hide();
                // Player Heal
                FunctionTimer.Create(() => {
                    OvermapHandler.GetInstance().GetFollower(GameData.GetCharacter(Character.Type.Tank)).Heal(200);
                    OvermapHandler.GetInstance().GetPlayer().Heal(200);
                }, .2f);
                FunctionTimer.Create(() => {
                    /*
                     * Character uniqueCharacter = GameData.GetCharacter(Character.Type.Player);
                     * uniqueCharacter.stats.health = uniqueCharacter.stats.healthMax;
                     * uniqueCharacter = GameData.GetCharacter(Character.Type.Tank);
                     * uniqueCharacter.stats.health = uniqueCharacter.stats.healthMax;
                     */

                    UIBlack.Show();
                    dialogue.Show();
                    dialogue.ShowRightText("You look like a strong warrior on a dangerous quest, need help?");
                }, .5f);
            },
            () => { dialogue.ShowLeftActiveTalkerHideRight("Sure thing, the path will be dangerous so it will be nice to have a healer"); },
            () => { dialogue.ShowLeftText("What to they call you?"); },
            () => { dialogue.ShowRightActiveTalkerHideLeft("My name is..."); },
            () => {
                dialogue.Hide();
                Window_PickName.ShowAvailableNames((string selectedName) => {
                    healerCharacter.name = selectedName;
                    dialogue.Show();
                    dialogue.PlayNextAction();
                });
            },
            () => {
                dialogue.ShowRightText("My name is " + healerCharacter.name);
                dialogue.ShowRightCharacterName(GameData.GetCharacterName(Character.Type.Healer));
            },
            () => { dialogue.ShowLeftActiveTalkerHideRight("Nice to meet you " + healerCharacter.name); },
            () => { dialogue.ShowRightActiveTalkerHideLeft("We should pick up some supplies before we go"); },
            () => { dialogue.ShowLeftActiveTalkerHideRight("Alright, let's go"); },
            () => {
                GameData.state = GameData.State.HealerJoined;
                healerCharacter.isInPlayerTeam = true;
                healerCharacter.subType        = Character.SubType.Healer_Friendly;
                OvermapHandler.SaveAllCharacterPositions();
                Loader.Load(Loader.Scene.GameScene);
            },
        }, true);
    }
示例#29
0
    public static void Play_Tavern()
    {
        Window_QuestPointer.DestroyPointer(GameAssets.i.Map.Find("tavern").position);
        UIBlack.Show();
        OvermapHandler.StopOvermapRunning();
        Dialogue  dialogue = Dialogue.GetInstance();
        Character tavernAmbushCharacter = GameData.GetCharacter(Character.Type.TavernAmbush);

        dialogue.SetDialogueActions(new List <Action>()
        {
            () => {
                dialogue.Show();
                dialogue.ShowLeftCharacter(GameAssets.i.s_PlayerDialogueSprite, false);
                dialogue.ShowLeftCharacterName(GameData.GetCharacterName(Character.Type.Player));
                dialogue.ShowLeftText("Greetings!");
                dialogue.HideRightCharacter();
                dialogue.HideRightText();
                dialogue.HideRightCharacterName();
            },
            () => { dialogue.ShowLeftText("May we have some refreshments?"); },
            () => {
                UIBlack.Hide();
                dialogue.Hide();

                Vector3 playerPosition = OvermapHandler.GetInstance().GetPlayer().GetPosition();
                OvermapHandler.GetInstance().GetPlayer().GetUnitAnimation().PlayAnimForced(UnitAnim.GetUnitAnim("dSwordTwoHandedBack_IdleDown"), 1f, null);

                NPCOvermap enemyOvermap         = OvermapHandler.GetInstance().GetNPC(tavernAmbushCharacter);
                enemyOvermap.transform.position = playerPosition + new Vector3(0, -17f);
                enemyOvermap.GetUnitAnimation().PlayAnimForced(UnitAnim.GetUnitAnim("dMinion_IdleUp"), 1f, null);
                OvermapHandler.GetInstance().SpawnSmoke(enemyOvermap.GetPosition(), .3f, Vector3.one);

                NPCOvermap enemyOvermap_2         = OvermapHandler.GetInstance().GetNPC(GameData.GetCharacter(Character.Type.TavernAmbush_2));
                enemyOvermap_2.transform.position = playerPosition + new Vector3(14f, -12f);
                enemyOvermap_2.GetUnitAnimation().PlayAnimForced(UnitAnim.GetUnitAnim("dMinion_IdleUp"), 1f, null);
                OvermapHandler.GetInstance().SpawnSmoke(enemyOvermap_2.GetPosition(), .3f, Vector3.one);

                NPCOvermap enemyOvermap_3         = OvermapHandler.GetInstance().GetNPC(GameData.GetCharacter(Character.Type.TavernAmbush_3));
                enemyOvermap_3.transform.position = playerPosition + new Vector3(-14, -12f);
                enemyOvermap_3.GetUnitAnimation().PlayAnimForced(UnitAnim.GetUnitAnim("dMinion_IdleUp"), 1f, null);
                OvermapHandler.GetInstance().SpawnSmoke(enemyOvermap_3.GetPosition(), .3f, Vector3.one);

                enemyOvermap.gameObject.SetActive(false);
                enemyOvermap_2.gameObject.SetActive(false);
                enemyOvermap_3.gameObject.SetActive(false);
                FunctionTimer.Create(() => {
                    enemyOvermap.gameObject.SetActive(true);
                    enemyOvermap_2.gameObject.SetActive(true);
                    enemyOvermap_3.gameObject.SetActive(true);
                }, .45f);

                FunctionTimer.Create(() => {
                    UIBlack.Show();
                    dialogue.Show();
                    dialogue.PlayNextAction();
                }, 1.2f);
            },
            () => {
                dialogue.HideLeftText();
                dialogue.FadeLeftCharacter();
                dialogue.ShowRightCharacter(GameAssets.i.s_EnemyMinionRedPortrait, false);
                dialogue.ShowRightText("That's the one! Get him!");
            },
            () => {
                GameData.GetCharacter(Character.Type.TavernAmbush_2).isDead = true;
                GameData.GetCharacter(Character.Type.TavernAmbush_3).isDead = true;
                GameData.state = GameData.State.FightingTavernAmbush;
                BattleHandler.LoadEnemyEncounter(tavernAmbushCharacter, tavernAmbushCharacter.enemyEncounter);
            },
        }, true);
    }
示例#30
0
    private void HandleInteract()
    {
        if (((int)GameData.state) < ((int)GameData.State.DefeatedTank))
        {
            if (!spawnedTankInteractKey)
            {
                Character tankCharacter = GameData.GetCharacter(Character.Type.Tank);
                if (Vector3.Distance(GetPosition(), tankCharacter.position) < 12f)
                {
                    spawnedTankInteractKey = true;
                    Instantiate(GameAssets.i.pfKey, tankCharacter.position + new Vector3(0, 15), Quaternion.identity);
                }
            }
        }

        if (Input.GetKeyDown(KeyCode.Space))
        {
            NPCOvermap npcOvermap = OvermapHandler.GetInstance().GetClosestNPC(GetPosition(), 12f);
            if (npcOvermap != null)
            {
                switch (npcOvermap.GetCharacter().type)
                {
                case Character.Type.Tank:
                    // Tank is only a NPC before he joins
                    Cutscenes.Play_Tank_BeforeJoin();
                    break;

                case Character.Type.Healer:
                    // Healer is only a NPC before he joins
                    //Cutscenes.Play_Healer_BeforeJoin();
                    break;

                case Character.Type.PlayerDoppelganger:
                    if (GameData.state == GameData.State.GoingToAskDoppelGanger)
                    {
                        Cutscenes.Play_DoppelGanger();
                    }
                    break;

                case Character.Type.Shop:
                    Cutscenes.Play_Shop(npcOvermap.GetCharacter());
                    break;
                }
            }
            else
            {
                // No NPC in range
                // Consume Health Potion
                if (GameData.TrySpendHealthPotion())
                {
                    // Heal all Team members
                    int healAmount = 40;
                    Heal(healAmount);
                    FollowerOvermap tankOvermap = OvermapHandler.GetInstance().GetFollower(GameData.GetCharacter(Character.Type.Tank));
                    if (tankOvermap != null)
                    {
                        tankOvermap.Heal(healAmount);
                    }
                    FollowerOvermap healerOvermap = OvermapHandler.GetInstance().GetFollower(GameData.GetCharacter(Character.Type.Healer));
                    if (healerOvermap != null)
                    {
                        healerOvermap.Heal(healAmount);
                    }
                }
            }

            /*
             * if (OvermapHandler.GetInstance().TryPlayerInteract()) {
             *  Dialogue dialogue = Dialogue.GetInstance();
             *  dialogue.SetDialogueActions(new List<Action>() {
             *      () => {
             *          dialogue.Show();
             *          dialogue.ShowLeftCharacter(GameAssets.i.s_PlayerDialogueSprite);
             *          dialogue.ShowLeftText("Hello there General Kenobi");
             *          dialogue.ShowRightCharacter(GameAssets.i.s_PlayerDialogueSprite);
             *          dialogue.FadeRightCharacter();
             *      },
             *      () => {
             *          dialogue.ShowRightActiveTalkerHideLeft("Yes yes hello there...");
             *      },
             *      () => {
             *          dialogue.ShowRightText("What brings you here?");
             *      },
             *      () => {
             *          dialogue.ShowLeftActiveTalkerHideRight("Oh I don't know");
             *      },
             *      () => {
             *          dialogue.ShowLeftText("Lets battle!");
             *      },
             *      () => {
             *          Loader.Load(Loader.Scene.BattleScene);
             *      },
             *  });
             *  dialogue.PlayNextAction();
             *  ///
             *  dialogue.SetDialogueActions(new List<Action>() {
             *      () => {
             *          dialogue.Show();
             *          dialogue.ShowLeftCharacter(GameAssets.i.s_PlayerDialogueSprite, false);
             *          dialogue.ShowRightCharacter(GameAssets.i.s_PlayerDialogueSprite, true);
             *          dialogue.ShowDialogueOptions(new List<Dialogue.DialogueOption> {
             *              new Dialogue.DialogueOption(Dialogue.DialogueOption.Option._1, "Hello there!", () => {
             *                  dialogue.ClearDialogueOptions();
             *                  dialogue.ShowRightActiveTalkerHideLeft("Yes yes hello there...");
             *              }),
             *              new Dialogue.DialogueOption(Dialogue.DialogueOption.Option._2, "General Kenobi!", () => {
             *                  dialogue.ClearDialogueOptions();
             *                  dialogue.ShowRightActiveTalkerHideLeft("Yes yes hello there...");
             *              }),
             *          });
             *      },
             *  }, true);
             * }
             */
        }
    }