Пример #1
0
 /*
  * Author: Kroy
  *
  * Choose the class and set class specific attributes, for character c.
  *
  * Parameter c Character to set.
  */
 public void ChooseClass(Character c)
 {
     if (c.Classe == Classes.Druid)
     {
         Druid.Start(c);
     }
     else if (c.Classe == Classes.Hunter)
     {
         Hunter.Start(c);
     }
     else if (c.Classe == Classes.Mage)
     {             // Dr Nexus:
         Mage.Start(c);
     }
     else if (c.Classe == Classes.Paladin)
     {             // MaXXiN:
         Paladin.Start(c);
     }
     else if (c.Classe == Classes.Priest)
     {
         Priest.Start(c);
     }
     else if (c.Classe == Classes.Rogue)
     {             // Dr Nexus:
         Rogue.Start(c);
     }
     else if (c.Classe == Classes.Shaman)
     {
         Shaman.Start(c);
     }
     else if (c.Classe == Classes.Warlock)
     {             // MaXXiN:
         Warlock.Start(c);
     }
     else if (c.Classe == Classes.Warrior)
     {             // Dr Nexus:
         Warrior.Start(c);
     }
 }
Пример #2
0
        /*
         * Author: Dr Nexus
         * Modified by: Kroy
         *
         * Call the level up method for the corresponding class.
         *
         * Parameter c Character to level up.
         * Parameter level Current level.
         * Parameter gainHP Hit points to gain on level up.
         * Parameter gainMana Mana to gain on level up.
         * Parameter gainStrength Strength to gain on level up.
         * Parameter gainAgility Agility to gain on level up.
         * Parameter gainStamina Stamina to gain on level up.
         * Parameter gainInt Intellect to gain on level up.
         * Parameter gainSpirit Spirit to gain on level up.
         * Return level up or default code.
         */
        bool OnLevelUp(Character c, int level, ref int gainHp, ref int gainMana,
                       ref float gainStrength, ref float gainAgility,
                       ref float gainStamina, ref float gainInt, ref float gainSpirit)
        {
            /* Class specific level up */
            switch (c.Classe)
            {
            case Classes.Druid:
                Druid.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength,
                              ref gainAgility, ref gainStamina, ref gainInt,
                              ref gainSpirit);
                break;

            case Classes.Hunter:
                Hunter.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength,
                               ref gainAgility, ref gainStamina, ref gainInt,
                               ref gainSpirit);
                break;

            case Classes.Mage:
                Mage.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength,
                             ref gainAgility, ref gainStamina, ref gainInt,
                             ref gainSpirit);
                break;

            case Classes.Priest:
                Priest.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength,
                               ref gainAgility, ref gainStamina, ref gainInt,
                               ref gainSpirit);
                break;

            case Classes.Paladin:
                Paladin.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength,
                                ref gainAgility, ref gainStamina, ref gainInt,
                                ref gainSpirit);
                break;

            case Classes.Rogue:
                Rogue.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength,
                              ref gainAgility, ref gainStamina, ref gainInt,
                              ref gainSpirit);
                break;

            case Classes.Shaman:
                Shaman.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength,
                               ref gainAgility, ref gainStamina, ref gainInt,
                               ref gainSpirit);
                break;

            case Classes.Warrior:
                Warrior.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength,
                                ref gainAgility, ref gainStamina, ref gainInt,
                                ref gainSpirit);
                break;

            case Classes.Warlock:
                Warlock.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength,
                                ref gainAgility, ref gainStamina, ref gainInt,
                                ref gainSpirit);
                break;

            default:
                Console.WriteLine("LevelUP wrong Classe:" + c.Classe);
                break;
            }
            /* If we have racial bonus */
            switch (c.Race)
            {
            case Races.Gnome:
                Gnome.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength,
                              ref gainAgility, ref gainStamina, ref gainInt,
                              ref gainSpirit);
                break;

            case Races.Human:
                Human.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength,
                              ref gainAgility, ref gainStamina, ref gainInt,
                              ref gainSpirit);
                break;

            case Races.Tauren:
                Tauren.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength,
                               ref gainAgility, ref gainStamina, ref gainInt,
                               ref gainSpirit);
                break;

            default:
                break;
            }
            /* Penalty for low stat classes */
            if (((c.Iq + gainInt) <= 20) &&
                (gainInt > 0))
            {
                // Before 20 int point you not gain that much mana
                gainMana -= 14;
                if (gainMana < 0)
                {
                    gainMana = 0;
                }
            }
            if (((c.Stamina + gainStamina) <= 20) &&
                (gainStamina > 0))
            {
                // Before 20 stamina point you not gain that much hp
                gainHp -= 9;
            }
            return(true);            // execute the default code
        }