• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Dawn, Gloria, Juliana, or Summer - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

Make Player Only do 50% damage

  • 2
    Posts
    5
    Years
    • Seen Jul 19, 2022
    Is this as easy as I hope it is? Looking through the decompiled files and searching for the dmg formula, maybe adding a little /2 to it will do the trick, but I dont really want it to affect enemy dmg. Does someone know where there formulas are stored, or maybe a workaround to achieve what i want? I will learn as much as I can, but I feel that someone who actually knows what they are doing could tell me how to do it in a few minutes which may take me 20+ hours just to learn how to use this

    Edit: Found something in line 2323 in /src/pokemon.c
    s32 CalculateBaseDamage
    maybe i can add something that here to change my dmg?
     
    Last edited:
    Find somewhere that computes damage and use GET_BATTLER_SIDE to decide if the attacker is the player?

    EDIT: The process to find this was pretty simple. I browsed the battle code looking for something related to damage, I found gBattleMoveDamage and then searched the repository for that, looking for anything that was setting it. Not sure if I found the right place, but it's a start.
     
    If i understand this correctly the upper one is used for my dmg calculation and the lower one for enemies, so maybe adding a *0.5 to the gBattleMoveDamage will do the trick, will learn how to actually compile the code and try it tomorrow



    Spoiler:
     
    Last edited:
    I wanna say that AI_CalcDmg is used when the AI is deciding which move to use, and atk05_damagecalc is used for all actual attacks, but that's just my intuition.

    Also, you probably want /2 rather than *0.5. The latter might have to use expensive floating point operations, whereas the former is an integer division.
     
    Back
    Top