コード例 #1
0
ファイル: Pokemon.cs プロジェクト: filialpails/Syllogomania
        public Pokemon(BaseStats bs, int l = 1, Move[] ms = null, string n = null)
        {
            baseStats = bs;
            personality = (uint)((PRNG.Instance.Next() << 16) + PRNG.Instance.Next());
            nature = (Nature)(personality % 25);
            happiness = baseStats.baseHappiness;
            if (baseStats.abilities.Length == 1) ability = baseStats.abilities[0];
            else ability = baseStats.abilities[personality % 2];

            int iv1 = PRNG.Instance.Next();
            int iv2 = PRNG.Instance.Next();
            hpIV = (byte)(iv1 & 0x1F);
            attackIV = (byte)(iv1 & 0x3E0);
            defenseIV = (byte)(iv1 & 0x7C00);
            specialDefenseIV = (byte)(iv2 & 0x1F);
            specialAttackIV = (byte)(iv2 & 0x3E0);
            speedIV = (byte)(iv2 & 0x7C00);
            nickname = n;

            shiny = ((OTid ^ OTsecretid) ^ ((personality >> 16) ^ (personality & 65535))) < 8 ? true : false;

            for (int i = 0; i < l; i++) LevelUp();
            hp = maxHP;

            metLocation = Player.Instance.currentMap;
            metLevel = Level;

            if (ms == null)
            {
                int i = 0;
                foreach (LearnableMove m in baseStats.learnset)
                {
                    if (Level >= m.level)
                    {
                        moveSet[i] = m.move;
                        PP[i] = m.move.basePP;
                        i = (i == 3) ? 0 : i + 1;
                    }
                    else break;
                }
            }
            else moveSet = ms;
        }
コード例 #2
0
ファイル: BaseStats.cs プロジェクト: filialpails/Syllogomania
        public BaseStats(ushort i, string n, byte h, byte atk, byte def, byte satk, byte sdef, byte spd, Types t, byte ctch, byte exp, ushort ev, GenderRatio gender, GrowthRate growth, EggGroups eg, Ability[] ab, LearnableMove[] ls, PokedexEntry pe, IEvolution[] evo = null)
        {
            id = i;
            name = n;

            baseHP = h;
            baseAttack = atk;
            baseDefense = def;
            baseSpeed = sdef;
            baseSpecialAttack = satk;
            baseSpecialDefense = spd;
            types = t;
            catchRate = ctch;
            expYield = exp;
            evYield = ev;
            genderRatio = gender;
            /* 0	Arceus, Buneary, Darkrai, Deoxys, Deoxys (Attack), Deoxys (Defense), Deoxys (Speed), Dialga, Genosekuto, Giratina (Altered), Giratina (Origin), Groudon, Ho-oh, Kyogre, Kyuremu, Lugia, Mewtwo, Palkia, Rayquaza, Regigigas, Reshiram, Zekrom
             * 35	Absol, Aggron, Aron, Articuno, Axew, Bagon, Banette, Baruchai, Barujiina, Beldum, Birijion, Cacnea, Cacturne, Carvanha, Chatot, Dragonair, Dragonite, Dratini, Dusclops, Dusknoir, Duskull, Entei, Fraxure, Gallade, Gardevoir, Glaceon, Haxorus, Honchkrow, Houndoom, Houndour, Jiheddo, Kerudio, Kirikizan, Kirlia, Kobaruon, Komatana, Lairon, Larvitar, Leafeon, Metagross, Metang, Misdreavus, Mismagius, Moltres, Monozu, Murkrow, Pupitar, Raikou, Ralts, Regice, Regirock, Registeel, Sableye, Salamence, Sazandora, Sharpedo, Shelgon, Shuppet, Sneasel, Suicune, Terakion, Tyranitar, Umbreon, Weavile, Zapdos, Zuruggu
             * 70	All other Pokemon
             * 90	Borutorosu, Latias, Latios, Randorosu, Torunerosu
             * 100	Ambipom, Celebi, Cresselia, Croagunk, Heatran, Jirachi, Luxio, Meroetta, Meroetta, Mew, Pachirisu, Shaymin, Shaymin (Sky), Victini
             * 140	Azelf, Blissey, Chansey, Clefable, Clefairy, Cleffa, Happiny, Lopunny, Mesprit, Uxie
             */
            if (i == 150) baseHappiness = 0;
            else if (i >= 144 && i <= 149) baseHappiness = 35;
            else if (i == 151) baseHappiness = 100;
            else baseHappiness = 70;
            growthRate = growth;
            eggGroups = eg;
            abilities = ab;
            learnset = ls;
            entry = pe;
            evolutions = evo;
        }