예제 #1
0
        public void ActivateAbility(Tile tile, FactionAbility ability)
        {
            ability.Use();
            FactionManager.GetCurrentFaction().abilityInfo.energy -= ability.GetCost();

            //CastAbility(ability, tile);
            ApplyAbilityEffect(tile, ability, (int)ability.type);
        }
예제 #2
0
        public FactionAbility GetAbilityFromCurrentFaction(int index)
        {
            FactionAbilityInfo abilityInfo = FactionManager.GetCurrentFaction().abilityInfo;

            if (index < abilityInfo.abilityList.Count)
            {
                return(abilityInfo.abilityList[index]);
            }
            return(null);
        }
        public void _OnNewTurn(bool flag)
        {
            if (!flag)
            {
                return;
            }

            abilityList = FactionManager.GetCurrentFaction().abilityInfo.abilityList;

            if (abilityList.Count == 0)
            {
                return;
            }

            for (int i = 0; i < buttonList.Count; i++)
            {
                if (i >= abilityList.Count)
                {
                    buttonList[i].SetActive(false);
                }
                else
                {
                    buttonList[i].imgIcon.sprite      = abilityList[i].icon;
                    buttonList[i].label.text          = abilityList[i].GetUseRemain() > 0 ? abilityList[i].GetUseRemain().ToString() : "∞";
                    buttonList[i].button.interactable = (abilityList[i].IsAvailable() == "");
                    buttonList[i].SetActive(true);
                }
            }

            if (abilityList.Count == 0)
            {
                lineRectT.sizeDelta = new Vector2(0, lineRectT.sizeDelta.y);
            }
            else
            {
                lineRectT.sizeDelta = new Vector2(20 + abilityList.Count * 60, lineRectT.sizeDelta.y);
            }

            UpdateEnergyDisplay();

            _Show();
        }