コード例 #1
0
 public void OpenBattleUI()
 {
     GameState.State.tournament.gameObject.SetActive(false);
     SwapPopup.Close();
     Inventory.Close();
     Shop.Close();
     playerAnimation.gameObject.SetActive(true);
     enemyAnimation.gameObject.SetActive(true);
     StartCoroutine(BattleStart());
 }
コード例 #2
0
    IEnumerator BattleStart()
    {
        yield return(new WaitForSeconds(0.1f));

        RefreshStatus(true);
        FlashText.Flash("Fight!", Color.red);
        AudioPlayer.PlayFight();
        yield return(new WaitForSeconds(0.1f));

        battleUI.SetActive(true);
        GameState.State.tournament.gameObject.SetActive(false);
        SwapPopup.Close();
        Inventory.Close();
        Shop.Close();
    }
コード例 #3
0
ファイル: Character.cs プロジェクト: Aggrathon/LudumDare40
    public void RemoveEquipment(EquipmentWrapper e)
    {
        if (equipment.Remove(e))
        {
            strength     -= e.equipment.strength;
            agility      -= e.equipment.agility;
            constitution -= e.equipment.constitution;
            intelligence -= e.equipment.intelligence;

            if (e.durability > 0 && this == GameState.State.player)
            {
                SwapPopup.Popup(e.ToString(), (b) => {
                    if (b)
                    {
                        AddInventory(e);
                    }
                    else
                    {
                        GameState.State.battleManager.ThrowEquipment(e);
                    }
                });
            }

            if (e.equipment.type == Equipment.Type.weapon && character.baseWeapon != null)
            {
                bool hasWeapon = false;
                for (int i = 0; i < equipment.Count; i++)
                {
                    if (equipment[i].equipment.type == Equipment.Type.weapon)
                    {
                        hasWeapon = true;
                        break;
                    }
                }
                if (!hasWeapon)
                {
                    AddEquipment(character.baseWeapon);
                }
            }
        }
    }
コード例 #4
0
ファイル: SwapPopup.cs プロジェクト: Aggrathon/LudumDare40
 void Awake()
 {
     instance = this;
     gameObject.SetActive(false);
 }