Example #1
0
        public void setTo(Ability a, Hex hex)
        {
            ability     = a;
            this.hex    = hex;
            title.text  = a.getName();
            body.text   = a.getDesc();
            icon.sprite = a.getSprite(hex.map);
            if (a.specialCost() != null)
            {
                cost.text = a.specialCost();
            }
            else
            {
                cost.text = "" + a.getCost();
            }
            usable = a.castable(hex.map, hex);
            if (a.getCooldown() > 0)
            {
                if (hex.map.turn - a.turnLastCast < a.getCooldown())
                {
                    cooldown.text = "On Cooldown (" + (a.getCooldown() - (hex.map.turn - a.turnLastCast)) + ")";
                    usable        = false;
                }
                else
                {
                    cooldown.text = "Cooldown: " + a.getCooldown();
                }
            }
            else
            {
                cooldown.text = "";
            }

            if (!usable)
            {
                background.color = new Color(1, 1, 1, 0.5f);
                icon.color       = new Color(0.5f, 0.5f, 0.5f, 0.5f);
            }
        }
Example #2
0
 public string getTitle()
 {
     //return person.getFullName();
     return(ability.getName());
 }