Пример #1
0
 public override void EquipUnit(Equipment input)
 {
     if (input is HeroTraits)
     {
         if (input is GenericHero)
         {
             heroTraits.Clear();
             heroTraits.Add(input as HeroTraits);
             while (spellList.Count > spells)
             {
                 spellList.RemoveAt(0);
             }
         }
         else
         {
             if (heroTraits[0] is GenericHero)
             {
                 heroTraits[0] = input as HeroTraits;
             }
             else if (heroTraits.Contains(input as HeroTraits))
             {
                 heroTraits.Remove(input as HeroTraits);
                 if (heroTraits.Count == 0)
                 {
                     heroTraits.Add(new GenericHero());
                 }
             }
             else
             {
                 heroTraits.Add(input as HeroTraits);
             }
             if (input.ModifyStats(0, 11) > 0)
             {
                 while (spellList.Count < spells + input.ModifyStats(0, 11))
                 {
                     spellList.Add(new SpellsClass());
                 }
             }
         }
     }
     else
     {
         base.EquipUnit(input);
     }
 }
Пример #2
0
 public override void RemoveEquipment(Equipment output)
 {
     if (output is HeroTraits)
     {
         heroTraits.Remove(output as HeroTraits);
         if (heroTraits.Count == 0)
         {
             heroTraits.Add(new GenericHero());
         }
         else if (output.ModifyStats(0, 11) > 0)
         {
             while (spellList.Count > spells)
             {
                 spellList.RemoveAt(0);
             }
         }
     }
     else
     {
         base.RemoveEquipment(output);
     }
 }