Beispiel #1
0
 // Update is called once per frame
 void Update()
 {
     attackTimer -= Time.deltaTime;
     if (Input.GetKeyDown(attackKey) && stamina >= maxStamina && !attackManager.paused)
     {
         ModStamina(-stamina);
         cm.AttackEnemy(damage);
         print(damage);
         if (cm.tuts[2] == 1 && cm.tuts[3] == 0)
         {
             cm.tuts[3] = 1;
             ModHealth(-50);
             string[] d = { "you take damage when you miss arrows", "press e to heal using ice cream", "health persists through battles", "so use them carefully", "but if you run out there's always the store!", "now slay your foe" };
             TextBox.DisplayText(d, 5, true);
             cm.Pause(true);
         }
     }
     if (staminaGauge.fillAmount >= 1 && attackManager.buffer)
     {
         //staminaAnim.SetBool("Flash", true);
     }
     else
     {
         //staminaAnim.SetBool("Flash", false);
     }
     if (healthCount > 0 && Input.GetKeyDown(healKey))
     {
         UsePotion();
     }
 }
    // Update is called once per frame
    void Update()
    {
        //  Check if the user has entered the right combo
        if (Input.GetKeyDown(KeyCode.V))
        {
            if (count == 0)
            {
                count++;
            }
        }
        if (Input.GetKeyDown(KeyCode.I))
        {
            if (count == 1)
            {
                count++;
            }
        }
        if (Input.GetKeyDown(KeyCode.P))
        {
            if (count == 2)
            {
                count++;
            }
        }
        if (Input.GetKeyDown(KeyCode.E))
        {
            if (count == 3)
            {
                count++;
            }
        }
        if (Input.GetKeyDown(KeyCode.R))
        {
            if (count == 4)
            {
                if (activated)
                {
                    Debug.Log("cheat deactivated");
                }
                else
                {
                    Debug.Log("cheat activated");
                }
                activated = !activated;
                count     = 0;
            }
        }
        if (activated)
        {
            //  Skip to Boss
            if (Input.GetKeyDown(KeyCode.F2))
            {
                if (MapNodeList.nodes.Count == 3)
                {
                    MapNodeList.nodes[0].nodeState = NodeState.Complete;
                    MapNodeList.nodes[1].nodeState = NodeState.Current;
                    Debug.Log("Skip to Boss Cheat");
                    CombatInfo.CombatsFinished = 2;
                    //  If we are already on the map, save and then load the scene to have the nodes update visually
                    if (SceneManager.GetActiveScene() == SceneManager.GetSceneByName("Map"))
                    {
                        SaveGameManager.SaveGame(GameState.Player, CombatInfo.CombatsFinished);
                        SaveGameManager.LoadGame();
                        SceneManager.LoadScene("Map");
                    }
                }
                else
                {
                    Debug.LogError("MAP NODES NOT INITIALIZED. THERE ARE NOT 3 MAP NODES IN THE LIST");
                }
            }

            //  Win Current Combat
            if (Input.GetKeyDown(KeyCode.F3))
            {
                if (SceneManager.GetActiveScene() == SceneManager.GetSceneByName("Combat"))
                {
                    CombatManager cm = FindObjectOfType <CombatManager>();
                    cm.AttackEnemy(cm.enemy.maxHealth);
                    Debug.Log("Finished Combat Cheat");
                }
            }

            //  Heal Player to Full
            if (Input.GetKeyDown(KeyCode.F4))
            {
                Debug.Log("Heal Cheat");
                if (SceneManager.GetActiveScene() == SceneManager.GetSceneByName("Combat"))
                {
                    CombatManager cm = FindObjectOfType <CombatManager>();
                    cm.player.ModHealth(GameState.GetInstance().MaxHealth);
                }
                else
                {
                    GameState.curHealth = GameState.GetInstance().MaxHealth;
                }
            }
        }
    }