Exemplo n.º 1
0
    private GscPokemon ReadPartyStruct(RAMStream data)
    {
        GscPokemon mon = ReadBoxStruct(data);

        mon.Status = data.u8();
        data.Seek(1); // unused
        mon.HP             = data.u16be();
        mon.MaxHP          = data.u16be();
        mon.Attack         = data.u16be();
        mon.Defense        = data.u16be();
        mon.Speed          = data.u16be();
        mon.SpecialAttack  = data.u16be();
        mon.SpecialDefense = data.u16be();
        return(mon);
    }
Exemplo n.º 2
0
    private GscPokemon ReadBoxStruct(RAMStream data)
    {
        GscPokemon mon = new GscPokemon();

        mon.Species  = Species[data.u8()];
        mon.HeldItem = Items[data.u8()];
        mon.Moves    = Array.ConvertAll(data.Read(4), m => Moves[m]);
        data.Seek(2); // ID
        mon.Experience = data.u24be();
        mon.HPExp      = data.u16be();
        mon.AttackExp  = data.u16be();
        mon.DefenseExp = data.u16be();
        mon.SpeedExp   = data.u16be();
        mon.SpecialExp = data.u16be();
        mon.DVs        = data.u16be();
        mon.PP         = data.Read(4);
        mon.Happiness  = data.u8();
        mon.Pokerus    = data.u8() > 0;
        data.Seek(2); // unused
        mon.Level = data.u8();
        mon.CalculateUnmodifiedStats();
        return(mon);
    }
Exemplo n.º 3
0
    private GscPokemon ReadBattleStruct(RAMStream data, RAMStream modifiers, RAMStream battleStatus, int screensAddr)
    {
        GscPokemon mon = new GscPokemon();

        mon.Species   = Species[data.u8()];
        mon.HeldItem  = Items[data.u8()];
        mon.Moves     = Array.ConvertAll(data.Read(4), m => Moves[m]);
        mon.DVs       = data.u16be();
        mon.PP        = data.Read(4);
        mon.Happiness = data.u8();
        mon.Level     = data.u8();
        mon.Status    = data.u8();
        data.Seek(1); // unused
        mon.HP                      = data.u16be();
        mon.MaxHP                   = data.u16be();
        mon.Attack                  = data.u16be();
        mon.Defense                 = data.u16be();
        mon.Speed                   = data.u16be();
        mon.SpecialAttack           = data.u16be();
        mon.SpecialDefense          = data.u16be();
        mon.AttackModifider         = modifiers.u8();
        mon.DefenseModifider        = modifiers.u8();
        mon.SpeedModifider          = modifiers.u8();
        mon.SpecialAttackModifider  = modifiers.u8();
        mon.SpecialDefenseModifider = modifiers.u8();
        mon.AccuracyModifider       = modifiers.u8();
        mon.EvasionModifider        = modifiers.u8();
        mon.BattleStatus1           = battleStatus.u8();
        mon.BattleStatus2           = battleStatus.u8();
        mon.BattleStatus3           = battleStatus.u8();
        mon.BattleStatus4           = battleStatus.u8();
        mon.BattleStatus5           = battleStatus.u8();
        mon.Screens                 = CpuRead(screensAddr);
        mon.CalculateUnmodifiedStats();
        return(mon);
    }
Exemplo n.º 4
0
    public static void EvaluateTototdile(Gold gb, DFState <GscMap, GscTile> state)
    {
        GscPokemon toto = Textboxes(gb);
        int        atk  = toto.DVs.Attack;
        int        def  = toto.DVs.Defense;
        int        spd  = toto.DVs.Speed;
        int        spc  = toto.DVs.Special;

        int stars = 0;

        if (atk == 15)
        {
            stars += 2;
        }
        else if (atk >= 12)
        {
            stars++;
        }
        else if (atk <= 7)
        {
            stars -= 3;
        }
        else if (atk <= 8)
        {
            stars -= 2;
        }
        else if (atk <= 9)
        {
            stars--;
        }

        if (def >= 13)
        {
            stars += 2;
        }
        else if (def >= 10)
        {
            stars++;
        }
        else if (def <= 5)
        {
            stars -= 3;
        }
        else
        {
            stars--;
        }

        if (spd == 15)
        {
            stars += 2;
        }
        else if (spd >= 11)
        {
            stars++;
        }
        else if (spd <= 3)
        {
            stars -= 3;
        }
        else if (spd <= 7)
        {
            stars -= 2;
        }
        else if (spd <= 9)
        {
            stars--;
        }

        if (spc == 15)
        {
            stars += 2;
        }
        else if (spc >= 14)
        {
            stars++;
        }
        else if (spc <= 7)
        {
            stars -= 3;
        }
        else if (spc <= 9)
        {
            stars -= 2;
        }
        else if (spc <= 11)
        {
            stars--;
        }

        string starsStr;

        if (stars == 8)
        {
            starsStr = "[***]";
        }
        else if (stars >= 6)
        {
            starsStr = "[ **]";
        }
        else if (stars >= 4)
        {
            starsStr = "[  *]";
        }
        else
        {
            starsStr = "[   ]";
        }

        //if(stars >= 8) {
        lock (Writer) {
            Writer.WriteLine("{0} [{1} cost] {2}- {3:x4}", starsStr, state.WastedFrames, state.Log, toto.DVs);
            Writer.Flush();
        }
        //  }
    }