• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Other] Physical special split in pokeruby

18
Posts
10
Years
    • Seen May 14, 2023
    I was able to implement the physical special split in pokeruby with a very small amount of effort.

    The first change was to add a new field to every move in /src/data/battle_moves.c, I called this 'isPhysical', which meant that if it was a physical I set it to 1 and for a special move set to 0, and for status moves set to 0. This meant I also had to find the definition of the battleMove struct, which was in /include/pokemon.h, in this I added u8 isPhysical; to the struct.

    I also added two new functions to /include/battle.h, which were MOVE_IS_PHYSICAL and MOVE_IS_SPECIAL, these were implemented as follows;

    #define MOVE_IS_PHYSICAL(move) (gBattleMoves[move].isPhysical == 1)
    #define MOVE_IS_SPECIAL(move) (gBattleMoves[move].isPhysical == 0)

    And the last change was to replace every instead of TYPE_IS_(PHYSICAL/SPECIAL) in calculate base damage in to MOVE_IS_(PHYSICAL/SPECIAL), as well as passing in move to these functions instead of type.

    That's it, I'm sure there are some bugs, but I haven't tested it too much yet.
     
    Last edited:
    71
    Posts
    7
    Years
    • Seen Jul 11, 2022
    May I recommend a different method? Instead of adding a field isPhysical to the strutc , just call the field something like moveSplit. If it's set to 0 the move is physical, 1 the move is special, and 2 the move is status. This is how it's handled in binary hacks and it works very well. You can then make an enum like this:
    Code:
    enum MoveSplits
    {
    [INDENT]MOVE_SPLIT_PHYSICAL,[/INDENT]
    [INDENT]MOVE_SPLIT_SPECIAL,[/INDENT]
    [INDENT]MOVE_SPLIT_STATUS[/INDENT]
    };
    Which will allow you to easily compare if a move is physical by simply doing:
    Code:
    gBattleMoves[move].moveSplit == MOVE_SPLIT_PHYSICAL
     
    Last edited:
    Back
    Top