Example #1
0
        public Pokemon(Model.Pokemon basePokemon, string uid, Gender gender, Nature nature, Ability ability, IVSet ivs, EVSet evs, MoveSet <IMove> moves, int friendship, int level)
        {
            Base       = basePokemon;
            Stats      = new Statistics(this);
            Gender     = gender;
            Nature     = nature;
            UID        = uid;
            Ability    = ability;
            IVs        = ivs;
            EVs        = evs;
            Moves      = moves;
            Friendship = friendship;
            Experience = ExpGroup.ExperienceNeededForLevel(level);

            if (friendship < basePokemon.Friendship)
            {
                throw new Exception($"Friendship {friendship} cannot be lower than base friendship {basePokemon.Friendship}");
            }

            if (level < MinLevel || level > MaxLevel)
            {
                throw new Exception($"Level ({level}) must be between {MinLevel} and {MaxLevel} (inclusive)");
            }
            Level = level;
            HP    = Stats[Statistic.HP];
        }
Example #2
0
 public Pokemon(Model.Pokemon basePokemon, Gender gender, Nature nature, Ability ability, IVSet ivs, EVSet evs, MoveSet <IMove> moves, int level) :
     this(basePokemon, Guid.NewGuid().ToString(), gender, nature, ability, ivs, evs, moves, basePokemon.Friendship, level)
 {
 }