示例#1
0
 public void CompleteWordEffect()
 {
     if (AB)
     {
         AB.PlaySound(completeWordAudio, audioVolume);
     }
 }
 public void PlayerInput()
 {
     if (currentState == state.closed)
     {
         if (!inDelay && SceneManager.GetActiveScene().name != "Battle" && (Input.GetKeyDown(KeyCode.Escape) || Input.GetKeyDown((KeyCode.Backspace))))
         {
             AB.PlaySound(openMenu, 1);
             StartCoroutine(StartDelay());
             OpenTransition();
             FindObjectOfType <SceneTransitioner>().SetMovement(false);
             inMenu = true;
         }
     }
     else if (currentState == state.opend)
     {
         if ((Input.GetKeyDown(KeyCode.Escape) || Input.GetKeyDown((KeyCode.Backspace))))
         {
             FindObjectOfType <StatsInLevel>().UpdateUI();
             AB.PlaySound(closeMenu, 1);
             StartCoroutine(StartDelay());
             CloseTransition();
             FindObjectOfType <SceneTransitioner>().SetMovement(true);
             inMenu = false;
         }
     }
     else if (currentState == state.close_backpack)
     {
         if (transitionTiles[0].tile.GetState() == state.closed)
         {
             currentState = state.closed;
         }
     }
     else if (currentState == state.open_backpack)
     {
         if (transitionTiles[transitionTiles.Length - 1].tile.GetState() == state.opend)
         {
             currentState = state.opend;
         }
     }
     else if (currentState == state.inWeapon)
     {
         InWeapons();
     }
     else if (currentState == state.inMagic)
     {
         InMagic();
     }
     else if (currentState == state.inItem)
     {
         InItems();
     }
     else if (currentState == state.inBody)
     {
         InBody();
     }
     else if (currentState == state.inLevelUp)
     {
         InLevelUP();
     }
 }
示例#3
0
    public void UseItem(SelectedItem item)
    {
        AB.PlaySound(useItemSound, 1);
        var ability = item.headList.abilities[item.index];
        var player  = FindObjectOfType <PlayerStats>();

        if (ability._cost_typ == Cost.mp)
        {
            if (player.mp < ability._cost)
            {
                Debug.Log("not enoght mana");
                return;
            }
            player.mp -= ability._cost;
        }
        switch (ability._typ)
        {
        case ability_typ.heal:
            player.hp = Mathf.Min(player.hp_max, player.hp + ability.power + player.intellect / 2);
            break;

        case ability_typ.item_heal:
            player.hp = Mathf.Min(player.hp_max, player.hp + ability.power);
            break;

        case ability_typ.mp_heal:
            player.mp = Mathf.Min(player.mp_max, player.mp + ability.power);
            break;
        }
        if (ability._cost_typ == Cost.consumable)
        {
            item.headList.displays[item.index].Select(false);
            item.headList.abilities[item.index] = null;
            UpdateUI();
            //SelectedFolder_p.abilities.Remove(ability);
            //UI.GetComponent<TestUI>().EmptyActionUI();
            //UI.GetComponent<TestUI>().EmptyStatUI();
            //GoToAbilitySelector(SelectedFolder_p, SelectedFolder_b);
            selectTyp = currentSelection.selectAbility;
            ASUI.SetVisible(false);
            PBUI.SetVisible(false);
        }
    }
示例#4
0
    public void FM_folder()
    {
        if (Input.GetKeyDown("1") && Ability_typs[0] != null)
        {
            AB.PlaySound(selectSound, soundVolume);
            Show_Abilities(Ability_typs[0]);
            current_folder = Ability_typs[0];
        }
        if (Input.GetKeyDown("2"))
        {
            if (1 == Ability_typs.Count)
            {
                if (player.can_swich_body && player.playerBodies.Count > 1)
                {
                    AB.PlaySound(selectSound, soundVolume);
                    OpenShift();
                }
                else
                {
                    battleSystem.ShowEnemyStats();
                }
            }
            else if (0 == Ability_typs.Count && (player.can_swich_body && player.playerBodies.Count > 1))
            {
                battleSystem.ShowEnemyStats();
            }
            else if (Ability_typs[1] != null)
            {
                AB.PlaySound(selectSound, soundVolume);
                Show_Abilities(Ability_typs[1]);
                current_folder = Ability_typs[1];
            }
        }
        if (Input.GetKeyDown("3"))
        {
            if (2 == Ability_typs.Count)
            {
                if (player.can_swich_body && player.playerBodies.Count > 1)
                {
                    AB.PlaySound(selectSound, soundVolume);
                    OpenShift();
                }
                else
                {
                    battleSystem.ShowEnemyStats();
                }
            }
            else if (1 == Ability_typs.Count && (player.can_swich_body && player.playerBodies.Count > 1))
            {
                battleSystem.ShowEnemyStats();
            }

            else if (Ability_typs[2] != null)
            {
                AB.PlaySound(selectSound, soundVolume);
                Show_Abilities(Ability_typs[2]);
                current_folder = Ability_typs[2];
            }
        }
        if (Input.GetKeyDown("4"))
        {
            if (3 == Ability_typs.Count)
            {
                if (player.can_swich_body && player.playerBodies.Count > 1)
                {
                    AB.PlaySound(selectSound, soundVolume);
                    OpenShift();
                }
                else
                {
                    battleSystem.ShowEnemyStats();
                }
            }
            else if (2 == Ability_typs.Count && (player.can_swich_body && player.playerBodies.Count > 1))
            {
                battleSystem.ShowEnemyStats();
            }
            else if (player.Ability_typs[3] != null)
            {
                AB.PlaySound(selectSound, soundVolume);
                Show_Abilities(Ability_typs[3]);
                current_folder = Ability_typs[3];
            }
        }
        if (Input.GetKeyDown("5"))
        {
            if (4 == Ability_typs.Count)
            {
                if (player.can_swich_body && player.playerBodies.Count > 1)
                {
                    AB.PlaySound(selectSound, soundVolume);
                    OpenShift();
                }
                else
                {
                    battleSystem.ShowEnemyStats();
                }
            }
            else if (3 == Ability_typs.Count && (player.can_swich_body && player.playerBodies.Count > 1))
            {
                battleSystem.ShowEnemyStats();
            }
            else if (Ability_typs[4] != null)
            {
                AB.PlaySound(selectSound, soundVolume);
                Show_Abilities(Ability_typs[4]);
                current_folder = Ability_typs[4];
            }
        }
        if (Input.GetKeyDown("6"))
        {
            if (5 == Ability_typs.Count)
            {
                if (player.can_swich_body && player.playerBodies.Count > 1)
                {
                    AB.PlaySound(selectSound, soundVolume);
                    OpenShift();
                }
                else
                {
                    battleSystem.ShowEnemyStats();
                }
            }
            else if (4 == Ability_typs.Count && (player.can_swich_body && player.playerBodies.Count > 1))
            {
                battleSystem.ShowEnemyStats();
            }
            else if (Ability_typs[5] != null)
            {
                AB.PlaySound(selectSound, soundVolume);
                Show_Abilities(Ability_typs[5]);
                current_folder = Ability_typs[5];
            }
        }
    }