Example #1
0
    public static void useSkill(SkillName sk, CombatEntity user, CombatEntity target)
    {
        if (sk == SkillName.Attack)
        {
            int damage = calculateDamage(user, target);

            List <string> text = new List <string>();
            text.Add(user.combatName + " attacked " + target.combatName);
            text.Add(user.combatName + " did " + damage + " points of damage");

            GameObject.FindObjectOfType <TextManager>().addToQueue(text.ToArray());

            CombatInstance instance = GameObject.FindObjectOfType <CombatInstance>();
            target.processDamage(instance, damage); //actually process the damage to the target
        }
        else if (sk == SkillName.Inspect)
        {
            List <string> text = new List <string>();
            text.Add(user.combatName + " inspected " + target.combatName);
            GameObject.FindObjectOfType <TextManager>().addToQueue(text.ToArray());
            CombatEntity.displayStats(target, GameObject.FindObjectOfType <TextManager>());
        }
    }