Exemplo n.º 1
0
 public static float GetMatchup(Pokemon.Type typeAtk, Pokemon.Type typeDef)
 {
     if (typeDef == Pokemon.Type.None)
     {
         return(1);
     }
     return(float.Parse(dbo.Select("matchups", new Where("type_atk", (int)typeAtk).And("type_def", (int)typeDef), "coef")[0]["coef"]));
 }
Exemplo n.º 2
0
 internal static string ToString(Pokemon.Type type)
 {
     if (type == Pokemon.Type.None)
     {
         return("");
     }
     else
     {
         return(type.ToString());
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// The weakness of a Pokemon to a damage type.
        /// </summary>
        /// <param name="p">Pokemon to make the comparison to</param>
        /// <param name="damageType">The type of the move used against the selected pokemon</param>
        /// <returns>The damage multiplier of the attack. The value will be 0x, 0.5x, 1x, 2x, or 4x</returns>
        public static double getWeaknessVal(Pokemon p, Pokemon.Type damageType)
        {
            double toReturn = 1;

            toReturn *= weaknessesAndResistances[(int)damageType][(int)p.PrimaryType];

            if (p.SecondaryType != Pokemon.Type.None)
            {
                toReturn *= weaknessesAndResistances[(int)damageType][(int)p.SecondaryType];
            }

            return(toReturn);
        }
Exemplo n.º 4
0
 public static float GetMatchup(Pokemon.Type typeAtk, Pokemon.Type typeDef1, Pokemon.Type typeDef2)
 {
     return(Program.GetMatchup(typeAtk, typeDef1) * (typeDef2 == Pokemon.Type.None ? 1 : Program.GetMatchup(typeAtk, typeDef2)));
 }