Exemple #1
0
        public PokemonData(DataRow row)
        {
            this.id           = (ushort)(long)row["ID"];
            this.dexID        = (ushort)(long)row["DexID"];
            this.name         = row["Name"] as string;
            this.pokedexEntry = row["PokedexEntry"] as string ?? "";

            this.type1 = GetPokemonTypeFromString(row["Type1"] as string);
            this.type2 = (row["Type2"] as string == null ? this.type1 : GetPokemonTypeFromString(row["Type2"] as string));

            this.ability1ID = PokemonDatabase.GetAbilityIDFromString(row["Ability1"] as string);
            this.ability2ID = (row["Ability2"] as string == null ? (byte)0 : PokemonDatabase.GetAbilityIDFromString(row["Ability2"] as string));
            //this.ability2ID		= (row["Ability2"] as string == null ? this.ability1ID : PokemonDatabase.GetAbilityIDFromString(row["Ability2"] as string));

            this.eggGroup1 = GetEggGroupFromString(row["EggGroup1"] as string);
            this.eggGroup2 = GetEggGroupFromString(row["EggGroup2"] as string);

            this.experienceGroup = GetExperienceGroupFromString(row["ExperienceGroup"] as string);

            this.hp          = (byte)(long)row["HP"];
            this.attack      = (byte)(long)row["Attack"];
            this.defense     = (byte)(long)row["Defense"];
            this.spAttack    = (byte)(long)row["SpAttack"];
            this.spDefense   = (byte)(long)row["SpDefense"];
            this.speed       = (byte)(long)row["Speed"];
            this.genderRatio = (byte)(long)row["GenderRatio"];

            this.forms      = null;
            this.evolutions = null;

            this.learnableMoves = new List <LearnableMove>();

            this.familyDexID = this.dexID;
        }
 public static byte GetLevelFromExperience(ExperienceGroups group, uint experience)
 {
     for (int i = 0; i < 100; i++) {
         if (experienceTable[group][i] > experience)
             return (byte)i;
     }
     return 100;
 }
 public static uint GetExperienceFromLevel(ExperienceGroups group, byte level)
 {
     if (level == 0)
         return 1;
     if (level > 100)
         level = 100;
     return experienceTable[group][level - 1];
 }