- 4
- Posts
- 3
- Years
- Seen Feb 4, 2023
Hi, I'm completely new to hacking and I'm trying to do some simple changes to practice.
I want move effects to last a fixed duration instead of a random amount of turns.
I think I found the lines that I have to change for each effect (src/battle_script_commands.c in FireRed), but I don't understand what's going on there with all that bit-shifting.
Can someone explain to me, what this code does and how to make it so that Thrash always lasts two turns?
I want move effects to last a fixed duration instead of a random amount of turns.
I think I found the lines that I have to change for each effect (src/battle_script_commands.c in FireRed), but I don't understand what's going on there with all that bit-shifting.
Can someone explain to me, what this code does and how to make it so that Thrash always lasts two turns?
Code:
case MOVE_EFFECT_THRASH:
if (gBattleMons[gEffectBattler].status2 & STATUS2_LOCK_CONFUSE)
{
++gBattlescriptCurrInstr;
}
else
{
gBattleMons[gEffectBattler].status2 |= STATUS2_MULTIPLETURNS;
gLockedMoves[gEffectBattler] = gCurrentMove;
gBattleMons[gEffectBattler].status2 |= (((Random() & 1) + 2) << 0xA);
}
break;
Last edited: