Exemplo n.º 1
0
    static DeterminantValues GetGenes()
    {
        DeterminantValues Genes = new DeterminantValues()
        {
            HP             = Random.Range(0, 32),
            Attack         = Random.Range(0, 32),
            Defense        = Random.Range(0, 32),
            SpecialAttack  = Random.Range(0, 32),
            SpecialDefense = Random.Range(0, 32),
            Speed          = Random.Range(0, 32)
        };

        return(Genes);
    }
Exemplo n.º 2
0
    public static List <int> CalculateStats(BasePokemon Pokemon)
    {
        List <int> CalculatedStats = new List <int>();

        P_BaseStats       BaseStats = PokemonData.GetData(Pokemon.Monster).BaseStats;
        DeterminantValues DValues   = Pokemon.DValues;
        EffortValues      EValues   = Pokemon.EValues;
        P_Nature          Nature    = Pokemon.Nature;
        int Level = Pokemon.Level;

        int Base = 0;
        int DV   = 0;
        int EV   = 0;

        foreach (P_Stats_All Stat in Stats)
        {
            switch (Stat)
            {
            case P_Stats_All.HP:
                Base = BaseStats.HP;
                DV   = DValues.HP;
                EV   = EValues.HP;
                break;

            case P_Stats_All.Attack:
                Base = BaseStats.Attack;
                DV   = DValues.Attack;
                EV   = EValues.Attack;
                break;

            case P_Stats_All.Defense:
                Base = BaseStats.Defense;
                DV   = DValues.Defense;
                EV   = EValues.Defense;
                break;

            case P_Stats_All.SpecialAttack:
                Base = BaseStats.SpecialAttack;
                DV   = DValues.SpecialAttack;
                EV   = EValues.SpecialAttack;
                break;

            case P_Stats_All.SpecialDefense:
                Base = BaseStats.SpecialDefense;
                DV   = DValues.SpecialDefense;
                EV   = EValues.SpecialDefense;
                break;

            case P_Stats_All.Speed:
                Base = BaseStats.Speed;
                DV   = DValues.Speed;
                EV   = EValues.Speed;
                break;

            default:
                Logger.Error(MethodBase.GetCurrentMethod().DeclaringType, "'" + Stat + "' is not a valid Input for Stat Calculation!");
                break;
            }

            CalculatedStats.Add(CalculateStat(Stat, Base, DV, EV, Level, Nature));
        }
        ;

        return(CalculatedStats);
    }