Ejemplo n.º 1
0
 public void LearnSpell(AbstractSpell spell)
 {
     if (!KnownSpells.Contains(spell))
     {
         KnownSpells.Add(spell);
     }
 }
Ejemplo n.º 2
0
 public void ForgetSpell(AbstractSpell spell)
 {
     if (KnownSpells.Contains(spell))
     {
         KnownSpells.Remove(spell);
     }
     else
     {
         Console.WriteLine("Character doesn't know this spell!");
     }
 }
Ejemplo n.º 3
0
        public void CastSpell(ReceivedSpell receivedSpell, Player player = null, int power = 0)
        {
            if (!KnownSpells.Contains((AbstractSpell)receivedSpell.Target))
            {
                Console.WriteLine("Character doesn't know this spell!");
                return;
            }

            if (power < 0)
            {
                power = 0;
            }

            if (player == null)
            {
                player = this;
            }

            receivedSpell(this, player, power);
        }