Example #1
0
        }//End Instance()

        //Calculate -: takes in the name of a pokemon and calculates the type strengths/weaknesses.
        public async void Calculate(string pokemonname)
        {
            Pokemon pokemon;

            //Check Cache: if it's not there, pull data and store in cache.
            if (!Cache_PokemonNameToObj.TryGetValue(pokemonname, out pokemon))
            {
                try { pokemon = await PAC.GetResourceAsync <Pokemon>(pokemonname); }
                catch (Exception) { Console.WriteLine("Invalid Pokemon Name or Command!"); return; }
                Cache_PokemonNameToObj.Add(pokemonname, pokemon);
            }

            Output_PokemonData(pokemon.Name, pokemon.Types);

            //Pokemon can be multiple types i.e.: Flying/Normal
            for (int t_iter = 0; t_iter < pokemon.Types.Count; t_iter++)
            {
                PokemonType     t_type = pokemon.Types[t_iter];
                PokeApiNet.Type type;

                //Check Cache: if it's not there, pull data and store in cache.
                if (!Cache_PokemonTypeToTypeObj.TryGetValue(t_type.Type.Name, out type))
                {
                    type = await PAC.GetResourceAsync <PokeApiNet.Type>(t_type.Type.Name);

                    Cache_PokemonTypeToTypeObj.Add(t_type.Type.Name, type);
                }

                Output_TypeVsTypeData(type, t_iter, (t_iter == (pokemon.Types.Count - 1)));
            } //End foreach
        }     //End Calculate()
Example #2
0
 public MoveData(string name, PokemonType type, Category category, int power, float accuracy, int PP,
                 Target target,
                 int priority, bool contact, bool protectable, bool magicCoatable, bool snatchable,
                 Effect[] moveEffects, float[] moveParameters,
                 Contest contest, int appeal, int jamming, string description, string fieldEffect)
 {
     this.name           = name;
     this.type           = type;
     this.category       = category;
     this.power          = power;
     this.accuracy       = accuracy;
     this.PP             = PP;
     this.target         = target;
     this.priority       = priority;
     this.contact        = contact;
     this.protectable    = protectable;
     this.magicCoatable  = magicCoatable;
     this.snatchable     = snatchable;
     this.moveEffects    = moveEffects;
     this.moveParameters = moveParameters;
     this.contest        = contest;
     this.appeal         = appeal;
     this.jamming        = jamming;
     this.description    = description;
     this.fieldEffect    = fieldEffect;
 }
Example #3
0
        public static float GetTypeAdvantageMultiplikator(PokemonType Attacker, PokemonType Defender)
        {
            if (Attacker == PokemonType.Normal)
            {
                switch (Defender)
                {
                case PokemonType.Rock: return(0.75f);

                case PokemonType.Ghost: return(0.75f);

                default: return(1);
                }
            }

            if (Attacker == PokemonType.Fight)
            {
                switch (Defender)
                {
                case PokemonType.Normal: return(1.25f);

                case PokemonType.Flying: return(0.75f);

                default: return(1);
                }
            }

            return(1);
        }
        public async Task <IActionResult> Edit(int id, [Bind("PokemonTypeID,PokemonTypeName,LastUpdateDate")] PokemonType pokemonType)
        {
            if (id != pokemonType.PokemonTypeID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(pokemonType);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PokemonTypeExists(pokemonType.PokemonTypeID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(pokemonType));
        }
Example #5
0
 public PokemonUiData(BotWindowData ownerBot, ulong id, PokemonId pokemonid, string name, //BitmapSource img,
                      int cp, double iv, PokemonFamilyId family, int candy, ulong stamp, bool fav, bool inGym, double level,
                      PokemonMove move1, PokemonMove move2, PokemonType type1, PokemonType type2, int maxCp, BaseStats baseStats,
                      int stamina, int maxStamina, int possibleCp, int candyToEvolve)
 {
     OwnerBot  = ownerBot;
     Favoured  = fav;
     InGym     = inGym;
     Id        = id;
     PokemonId = pokemonid;
     //Image = img;
     Name          = name;
     Cp            = cp;
     Iv            = iv;
     Candy         = candy;
     Family        = family;
     Timestamp     = stamp;
     Level         = level;
     Move1         = move1;
     Move2         = move2;
     Type1         = type1;
     Type2         = type2;
     MaxCp         = maxCp;
     Stats         = baseStats;
     Stamina       = stamina;
     MaxStamina    = maxStamina;
     CandyToEvolve = candyToEvolve;
     PossibleCp    = possibleCp;
 }
Example #6
0
        private void DisplaySearchPrompt()
        {
            while (true)
            {
                Console.Clear();
                Console.WriteLine("See strengths and weaknesses of which type? (type below)");
                string userInput = Console.ReadLine();

                PokeTypes poke;
                if (Enum.TryParse(userInput, out poke))
                {
                    PokemonType pokeType = _pokeService.GetPokemonTypeAsync(userInput).Result;

                    Console.Clear();
                    Console.WriteLine($"The strengths and weaknesses of Type {pokeType.Name.ToString().ToUpper()}:\n");

                    DisplayAllDamageRelations(pokeType);
                    Console.ReadLine();
                }
                else
                {
                    continue;
                }
            }
        }
Example #7
0
 public double GetMultiplier(PokemonType attacker, PokemonType defender)
 {
     if (attacker == PokemonType.None || defender == PokemonType.None)
     {
         return(1.0);
     }
     return(_typeChart[attacker][defender]);
 }
Example #8
0
 public static List <PokemonType> GetWeaknesses(this PokemonType type)
 {
     if (MasterFile.Instance.PokemonTypes.ContainsKey(type))
     {
         return(MasterFile.Instance.PokemonTypes[type].Weaknesses);
     }
     return(new List <PokemonType>());
 }
Example #9
0
 public Pokemon(Builder builder)
 {
     _name  = builder._name;
     _color = builder._color;
     _age   = builder._age;
     _type  = builder._type;
     _level = builder._level;
 }
 public Pokemon(string name,
                string description,
                int attack,
                int defense,
                int health, PokemonType type) : base(name, description, attack, defense, health)
 {
     SetPokemonType(type);
 }
Example #11
0
 public PokemonAttackStats(PokemonMove move, PokemonType type, int damage, int durationMs, int energy)
 {
     Move       = move;
     Type       = type;
     Energy     = energy;
     Damage     = damage;
     DurationMs = durationMs;
     Dps        = Damage * (1000 / (float)durationMs);
 }
Example #12
0
    public PokedexEntry(DexID id, string speciesName, PokemonStats baseStats, PokemonType typeA, PokemonType typeB = PokemonType.none)
    {
        this.id          = id;
        this.speciesName = speciesName;
        this.baseStats   = baseStats;

        this.typeA = typeA;
        this.typeB = typeB;
    }
Example #13
0
 /// <summary>
 /// Get a double array of a type who is attacking.
 /// Index by <see cref="PokemonType"/>.
 /// </summary>
 /// <param name="type"></param>
 /// <returns></returns>
 public static double[] GetAttacking(PokemonType type)
 {
     double[] attacking = new double[NumberOfTypes];
     for (int i = 0; i < NumberOfTypes; i++)
     {
         attacking[i] = Effectiveness[(int)type, i];
     }
     return(attacking);
 }
        public static double GetMultiplier(PokemonType attack, BattlePokemon target)
        {
            var multiplier = GetMultiplier(attack, target.Pokemon.Type1);

            if (target.Pokemon.Type2 != PokemonType.None)
            {
                multiplier *= GetMultiplier(attack, target.Pokemon.Type2);
            }
            return(multiplier);
        }
Example #15
0
        public AnyPokemonStat(PokemonDataWrapper pokemon)
        {
            Data = pokemon;

            MainType  = GameClient.PokemonSettings.Where(f => f.PokemonId == Data.PokemonId).Select(s => s.Type).FirstOrDefault();
            ExtraType = GameClient.PokemonSettings.Where(f => f.PokemonId == Data.PokemonId).Select(s => s.Type2).FirstOrDefault();

            Attack        = GameClient.MoveSettings.Where(f => f.MovementId == Data.Move1).FirstOrDefault();
            SpecialAttack = GameClient.MoveSettings.Where(f => f.MovementId == Data.Move2).FirstOrDefault();
        }
Example #16
0
        protected PokeBase(int id, string name, GenerationType generationType, PokemonType firstPokemonType, PokemonType secondPokemonType = PokemonType.None)
        {
            ID   = id;
            Name = name;

            GenerationType = generationType;

            FirstPokemonType  = firstPokemonType;
            SecondPokemonType = secondPokemonType;
        }
Example #17
0
    static void Main()
    {
        PokemonType pokemon = new PokemonType();

        pokemon.PokemonTypeInfo();

        ElectricPokemon electricPokemon = new ElectricPokemon();

        electricPokemon.ElectricPokemonInfo();
    }
        public async Task <IActionResult> Create([Bind("PokemonTypeID,PokemonTypeName,LastUpdateDate")] PokemonType pokemonType)
        {
            if (ModelState.IsValid)
            {
                _context.Add(pokemonType);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(pokemonType));
        }
Example #19
0
 //Condition Only
 public AttackInfo(string attackName, PokemonType atype, int app, int aaccuracy, StatusEffects acondition)
 {
     name       = attackName;
     category   = Category.status;
     attackType = atype;
     pp         = app;
     accuracy   = aaccuracy;
     condition  = acondition;
     stat       = Stat.none;
     stage      = 0;
 }
Example #20
0
 public Pokemon(string species, string name, int level, PokemonType typeOne, PokemonType typeTwo, string moveOne, string moveThree, string moveFour)
 {
     this.species = species;
     this.name    = name;
     Level        = level;
     this.typeOne = typeOne;
     this.typeTwo = typeTwo;
     MoveOne      = moveOne;
     MoveThree    = moveThree;
     MoveFour     = moveFour;
 }
Example #21
0
    public static float GetEffectiveness(PokemonType attackType, PokemonType defenseType)
    {
        if (attackType == PokemonType.None || defenseType == PokemonType.None)
        {
            return(1);
        }
        int row = (int)attackType - 1;
        int col = (int)defenseType - 1;

        return(chart[row][col]);
    }
Example #22
0
        public async Task <TypeViewModel> GetTypeInformation(string typeName)
        {
            var apiType = await _pokemonApi.GetPokemonTypeInfo(typeName);

            var pokemonType = new TypeViewModel();

            pokemonType.TypeName = apiType.name;

            foreach (var type in apiType.damage_relations.double_damage_from)
            {
                var thisType = new PokemonType();
                thisType.TypeName = type.name;
                thisType.TypeUrl  = type.url;
                pokemonType.DoubleDamageFrom.Add(thisType);
            }

            foreach (var type in apiType.damage_relations.double_damage_to)
            {
                var thisType = new PokemonType();
                thisType.TypeName = type.name;
                thisType.TypeUrl  = type.url;
                pokemonType.DoubleDamageTo.Add(thisType);
            }
            foreach (var type in apiType.damage_relations.half_damage_from)
            {
                var thisType = new PokemonType();
                thisType.TypeName = type.name;
                thisType.TypeUrl  = type.url;
                pokemonType.HalfDamageFrom.Add(thisType);
            }
            foreach (var type in apiType.damage_relations.half_damage_to)
            {
                var thisType = new PokemonType();
                thisType.TypeName = type.name;
                thisType.TypeUrl  = type.url;
                pokemonType.HalfDamageTo.Add(thisType);
            }
            foreach (var type in apiType.damage_relations.no_damage_from)
            {
                var thisType = new PokemonType();
                thisType.TypeName = type.name;
                thisType.TypeUrl  = type.url;
                pokemonType.NoDamageFrom.Add(thisType);
            }
            foreach (var type in apiType.damage_relations.no_damage_to)
            {
                var thisType = new PokemonType();
                thisType.TypeName = type.name;
                thisType.TypeUrl  = type.url;
                pokemonType.NoDamageTo.Add(thisType);
            }
            return(pokemonType);
        }
Example #23
0
    public static float TypeEffectiveness(Pokemon defensor, PokemonType skillType)
    {
        float effectiveness = 1f;

        foreach (PokemonType pokemonType in defensor.types)
        {
            effectiveness *= TypeChart[(int)skillType, (int)pokemonType];
        }

        Debug.Log("효과: " + effectiveness);
        return(effectiveness);
    }
Example #24
0
    public bool HasType(PokemonType type)
    {
        foreach (PokemonType pokemonType in types)
        {
            if (type == pokemonType)
            {
                return(true);
            }
        }

        return(false);
    }
Example #25
0
 public static string GetLocalisedName(PokemonType type, CultureInfo culture)
 {
     try
     {
         return(LanguageResources.ResourceManager.GetString("Type_" + type.ToString(), culture));
     }
     catch (Exception ex)
     {
         Console.WriteLine(nameof(GetLocalisedName) + ": " + ex.Message);
         return(type.ToString());
     }
 }
Example #26
0
 //Attack with condition
 public AttackInfo(string attackName, Category acategory, PokemonType atype, int app, int apower, int aaccuracy, StatusEffects acondition, Stat astat, int astage)
 {
     name       = attackName;
     category   = acategory;
     attackType = atype;
     pp         = app;
     power      = apower;
     accuracy   = aaccuracy;
     condition  = acondition;
     stat       = astat;
     stage      = astage;
 }
Example #27
0
 public Pokemon(string speciesName, string nickName, int level, PokemonType pokemonType, PokemonType secondaryType, string moveOne, string moveTwo, string moveThree, string moveFour)
 {
     PokemonSpeciesName = speciesName;
     PokemonNickName    = nickName;
     Level         = level;
     PokemonType   = pokemonType;
     SecondaryType = secondaryType;
     MoveOne       = moveOne;
     MoveTwo       = moveTwo;
     MoveThree     = moveThree;
     MoveFour      = moveFour;
 }
Example #28
0
 public static double GetBadgeTypeMultilplier(PokemonType type)
 {
     if (TYPE_BUFF_BADGES.ContainsKey(type))
     {
         var badge = TYPE_BUFF_BADGES[type];
         if (Controller.ActivePlayer.Badges.Contains(badge))
         {
             return(1.125);
         }
     }
     return(1);
 }
Example #29
0
    private static float Stab(Pokemon attacker, PokemonType skillType)
    {
        foreach (PokemonType pokemonType in attacker.types)
        {
            if (pokemonType == skillType)
            {
                return(1.5f);
            }
        }

        return(1f);
    }
Example #30
0
 //Attack only
 public AttackInfo(string attackName, Category acategory, PokemonType atype, int app, int apower, int aaccuracy)
 {
     name       = attackName;
     category   = acategory;
     attackType = atype;
     pp         = app;
     power      = apower;
     accuracy   = aaccuracy;
     condition  = StatusEffects.none;
     stat       = Stat.none;
     stage      = 0;
 }
Example #31
0
 public void AddMember(BasePokemon bp)
 {
     this.PName = bp.PName;
     this.image = bp.image;
     this.biomeFound = bp.biomeFound;
     this.type = bp.type;
     this.rarity = bp.rarity;
     this.HP = bp.HP;
     this.maxHP = bp.maxHP;
     this.AttackStat = bp.AttackStat;
     this.DefenceStat = bp.DefenceStat;
     this.pokemonStats = bp.pokemonStats;
     this.canEvolve = bp.canEvolve;
     this.evolveTo = bp.evolveTo;
     this.level = bp.level;
 }
Example #32
0
 public double GetMultiplier(PokemonType attacker, PokemonType defender)
 {
     if (attacker == PokemonType.None || defender == PokemonType.None)
     {
         return 1.0;
     }
     return _typeChart[attacker][defender];
 }
Example #33
0
 public float GetModifier(PokemonType source, PokemonType target)
 {
     return table[(int)source, (int)target];
 }
Example #34
0
 /// <summary>
 /// Creates an instance of a PokeType with the given PokemonType
 /// </summary>
 /// <param name="type">The type of the PokeType to instantiate</param>
 /// <returns>The created instance of the PokeType</returns>
 public static PokeType GetInstance(PokemonType type)
 {
     return GetInstance(type.ID());
 }
Example #35
0
        /// <summary>
        /// Create a Pokémon.
        /// </summary>
        /// <param name="name">The name of the pokémon.</param>
        /// <param name="gender">The gender of the pokémon.</param>
        /// <param name="type">The type of the pokémon.</param>
        /// <param name="hp">The max HP of the pokémon.</param>
        /// <param name="attackPhysical">The physical attack power of the pokémon.</param>
        /// <param name="defensePhysical">The physical defense power of the pokémon.</param>
        /// <param name="specialAttack">The special attack power of the pokémon.</param>
        /// <param name="specialDefense">The special defense power of the pokémon.</param>
        /// <param name="powerPhysical">The physical power of the move.</param>
        /// <param name="powerSpecial">The special power of the move.</param>
        /// <param name="speed">The speed of the pokémon.</param>
        /// <param name="level">The level of the pokémon.</param>
        /// <param name="moves">The moves that this pokémon knows.</param>
        /// <param name="maxEnergy">The max energy of the pokémon.</param>
        /// <returns>The pokémon created with the given data.</returns>
        public Creature CreatePokemon(string name, Gender gender, PokemonType type, float hp, float attackPhysical, float defensePhysical,
            float specialAttack, float specialDefense, float speed, int level, List<Move> moves, float maxEnergy)
        {
            //Create the list of types.
            List<PokemonType> types = new List<PokemonType>();
            types.Add(type);

            //Return the move.
            return CreatePokemon(name, gender, types, hp, attackPhysical, defensePhysical, specialAttack, specialDefense, speed, level, moves, maxEnergy);
        }
Example #36
0
 //Generate user friendly and hashtag friendly pokemon names
 //Also, this client straight up spells some of the pokemon wrong.
 private static string SpellCheckPokemon(PokemonType pokemon, bool isHashtag = false)
 {
     switch (pokemon)
     {
         case PokemonType.Charmender:
             return "Charmander";
         case PokemonType.Clefary:
             return "Clefairy";
         case PokemonType.Geoduge:
             return "Geodude";
         case PokemonType.Farfetchd:
             return isHashtag ? "Farfetchd" : "Farfetch'd";
         case PokemonType.MrMime:
             return isHashtag ? "MrMime" : "Mr. Mime";
         case PokemonType.NidoranFemale:
             return isHashtag ? "Nidoran" : "Nidoran♀";
         case PokemonType.NidoranMale:
             return isHashtag ? "Nidoran" : "Nidoran♂";
         default:
             return pokemon.ToString();
     }
 }
Example #37
0
        /// <summary>
        /// Create a move.
        /// </summary>
        /// <param name="name">The name of the move.</param>
        /// <param name="description">The description of the move.</param>
        /// <param name="type">The first type of the move.</param>
        /// <param name="powerPhysical">The physical power of the move.</param>
        /// <param name="powerSpecial">The special power of the move.</param>
        /// <param name="accuracy">The accuracy of the move.</param>
        /// <param name="energyConsume">The energy consumed by the move.</param>
        /// <param name="status">The status ailments that the moves afflicts victims with.</param>
        /// <param name="force">The physical force behind the move.</param>
        /// <returns>The move created with the given data.</returns>
        public Move CreateMove(string name, string description, PokemonType type, int powerPhysical, int powerSpecial, int accuracy, int energyConsume,
            Status status, float force)
        {
            //Create the list of types.
            List<PokemonType> types = new List<PokemonType>();
            types.Add(type);

            //Return the move.
            return CreateMove(name, description, types, powerPhysical, powerSpecial, accuracy, energyConsume, status, force);
        }