From c3f6f528e865155f359ca2ff10b68ace1cc99edb Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 12 Nov 2017 00:16:46 +0100 Subject: come closer maybe --- src/battle_script_commands.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src/battle_script_commands.c') diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 72bef41f1..a619ee778 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -9526,22 +9526,22 @@ static void atkC0_recoverbasedonsunlight(void) #ifdef NONMATCHING static void atkC1_hidden_power_calc(void) { - s32 powerBits; - s32 typeBits; - - powerBits = ((gBattleMons[gBankAttacker].hpIV & 2) >> 1) - | ((gBattleMons[gBankAttacker].attackIV & 2) << 0) - | ((gBattleMons[gBankAttacker].defenseIV & 2) << 1) - | ((gBattleMons[gBankAttacker].speedIV & 2) << 2) - | ((gBattleMons[gBankAttacker].spAttackIV & 2) << 3) - | ((gBattleMons[gBankAttacker].spDefenseIV & 2) << 4); - - typeBits = ((gBattleMons[gBankAttacker].hpIV & 1) << 0) - | ((gBattleMons[gBankAttacker].attackIV & 1) << 1) - | ((gBattleMons[gBankAttacker].defenseIV & 1) << 2) - | ((gBattleMons[gBankAttacker].speedIV & 1) << 3) - | ((gBattleMons[gBankAttacker].spAttackIV & 1) << 4) - | ((gBattleMons[gBankAttacker].spDefenseIV & 1) << 5); + u32 powerBits = 0; + u32 typeBits = 0; + + powerBits |= ((gBattleMons[gBankAttacker].hpIV & 2) >> 1); + powerBits |= ((gBattleMons[gBankAttacker].attackIV & 2) << 0); + powerBits |= ((gBattleMons[gBankAttacker].defenseIV & 2) << 1); + powerBits |= ((gBattleMons[gBankAttacker].speedIV & 2) << 2); + powerBits |= ((gBattleMons[gBankAttacker].spAttackIV & 2) << 3); + powerBits |= ((gBattleMons[gBankAttacker].spDefenseIV & 2) << 4); + + typeBits |= ((gBattleMons[gBankAttacker].hpIV & 1) << 0); + typeBits |= ((gBattleMons[gBankAttacker].attackIV & 1) << 1); + typeBits |= ((gBattleMons[gBankAttacker].defenseIV & 1) << 2); + typeBits |= ((gBattleMons[gBankAttacker].speedIV & 1) << 3); + typeBits |= ((gBattleMons[gBankAttacker].spAttackIV & 1) << 4); + typeBits |= ((gBattleMons[gBankAttacker].spDefenseIV & 1) << 5); gDynamicBasePower = (40 * powerBits) / 63 + 30; -- cgit v1.2.3