예제 #1
0
        public void ApplyPower(PowerType powerType)
        {
            Power power = GetPower(powerType);

            if (power == null)
            {
                Console.WriteLine("You don't have this power");
            }
            else
            {
                if (Xp >= power.MinXp)
                {
                    if (power.PowerType == PowerType.Healing)
                    {
                        Heal();
                    }
                    else if (power.PowerType == PowerType.Invisible)
                    {
                        Hide();
                    }
                    else if (power.PowerType == PowerType.Protect)
                    {
                        Protect = true;
                    }
                    else if (power.PowerType == PowerType.Sleepy)
                    {
                        Sprinkle();
                    }

                    MyPowers.Remove(power);
                }
            }
        }
예제 #2
0
 public void AddPower(Power newPower)
 {
     MyPowers.Add(newPower);
 }