Replace IsTwoStrikesMove with FLAG_TWO_STRIKES
Note that this flag does nothing until the Parental Bond PR is merged - it's just for the AI until then.
This commit is contained in:
parent
a2574b55cc
commit
7d10097684
5 changed files with 12 additions and 40 deletions
|
@ -175,7 +175,4 @@ bool32 CanBeFrozen(u8 battlerId);
|
||||||
bool32 CanBeConfused(u8 battlerId);
|
bool32 CanBeConfused(u8 battlerId);
|
||||||
bool32 IsBattlerTerrainAffected(u8 battlerId, u32 terrainFlag);
|
bool32 IsBattlerTerrainAffected(u8 battlerId, u32 terrainFlag);
|
||||||
|
|
||||||
// Move checks
|
|
||||||
bool8 IsTwoStrikesMove(u16 move);
|
|
||||||
|
|
||||||
#endif // GUARD_BATTLE_UTIL_H
|
#endif // GUARD_BATTLE_UTIL_H
|
||||||
|
|
|
@ -308,6 +308,7 @@
|
||||||
#define FLAG_DMG_UNGROUNDED_IGNORE_TYPE_IF_FLYING (1 << 24) // Makes a Ground type move do 1x damage to flying and levitating targets
|
#define FLAG_DMG_UNGROUNDED_IGNORE_TYPE_IF_FLYING (1 << 24) // Makes a Ground type move do 1x damage to flying and levitating targets
|
||||||
#define FLAG_THAW_USER (1 << 25)
|
#define FLAG_THAW_USER (1 << 25)
|
||||||
#define FLAG_HIT_IN_SUBSTITUTE (1 << 26) // Hyperspace Fury
|
#define FLAG_HIT_IN_SUBSTITUTE (1 << 26) // Hyperspace Fury
|
||||||
|
#define FLAG_TWO_STRIKES (1 << 27) // A move with this flag will strike twice, and may apply its effect on each hit
|
||||||
|
|
||||||
// Split defines.
|
// Split defines.
|
||||||
#define SPLIT_PHYSICAL 0x0
|
#define SPLIT_PHYSICAL 0x0
|
||||||
|
|
|
@ -767,7 +767,7 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle other multi-strike moves
|
// Handle other multi-strike moves
|
||||||
if (IsTwoStrikesMove(move))
|
if (gBattleMoves[move].flags & FLAG_TWO_STRIKES)
|
||||||
dmg *= 2;
|
dmg *= 2;
|
||||||
else if (move == MOVE_SURGING_STRIKES || (move == MOVE_WATER_SHURIKEN && gBattleMons[battlerAtk].species == SPECIES_GRENINJA_ASH))
|
else if (move == MOVE_SURGING_STRIKES || (move == MOVE_WATER_SHURIKEN && gBattleMons[battlerAtk].species == SPECIES_GRENINJA_ASH))
|
||||||
dmg *= 3;
|
dmg *= 3;
|
||||||
|
|
|
@ -217,20 +217,6 @@ static const u16 sEntrainmentTargetSimpleBeamBannedAbilities[] =
|
||||||
ABILITY_GULP_MISSILE,
|
ABILITY_GULP_MISSILE,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const u16 sTwoStrikeMoves[] =
|
|
||||||
{
|
|
||||||
MOVE_BONEMERANG,
|
|
||||||
MOVE_DOUBLE_HIT,
|
|
||||||
MOVE_DOUBLE_IRON_BASH,
|
|
||||||
MOVE_DOUBLE_KICK,
|
|
||||||
MOVE_DRAGON_DARTS,
|
|
||||||
MOVE_DUAL_CHOP,
|
|
||||||
MOVE_DUAL_WINGBEAT,
|
|
||||||
MOVE_GEAR_GRIND,
|
|
||||||
MOVE_TWINEEDLE,
|
|
||||||
0xFFFF
|
|
||||||
};
|
|
||||||
|
|
||||||
bool32 IsAffectedByFollowMe(u32 battlerAtk, u32 defSide, u32 move)
|
bool32 IsAffectedByFollowMe(u32 battlerAtk, u32 defSide, u32 move)
|
||||||
{
|
{
|
||||||
u32 ability = GetBattlerAbility(battlerAtk);
|
u32 ability = GetBattlerAbility(battlerAtk);
|
||||||
|
@ -9620,15 +9606,3 @@ bool32 IsBattlerWeatherAffected(u8 battlerId, u32 weatherFlags)
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool8 IsTwoStrikesMove(u16 move)
|
|
||||||
{
|
|
||||||
u32 i;
|
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_COUNT(sTwoStrikeMoves); i++)
|
|
||||||
{
|
|
||||||
if (move == sTwoStrikeMoves[i])
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
|
@ -378,7 +378,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
|
||||||
.secondaryEffectChance = 0,
|
.secondaryEffectChance = 0,
|
||||||
.target = MOVE_TARGET_SELECTED,
|
.target = MOVE_TARGET_SELECTED,
|
||||||
.priority = 0,
|
.priority = 0,
|
||||||
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED,
|
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES,
|
||||||
.split = SPLIT_PHYSICAL,
|
.split = SPLIT_PHYSICAL,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -649,7 +649,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
|
||||||
.secondaryEffectChance = 20,
|
.secondaryEffectChance = 20,
|
||||||
.target = MOVE_TARGET_SELECTED,
|
.target = MOVE_TARGET_SELECTED,
|
||||||
.priority = 0,
|
.priority = 0,
|
||||||
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST,
|
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_TWO_STRIKES,
|
||||||
.split = SPLIT_PHYSICAL,
|
.split = SPLIT_PHYSICAL,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -2460,7 +2460,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
|
||||||
.secondaryEffectChance = 0,
|
.secondaryEffectChance = 0,
|
||||||
.target = MOVE_TARGET_SELECTED,
|
.target = MOVE_TARGET_SELECTED,
|
||||||
.priority = 0,
|
.priority = 0,
|
||||||
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED,
|
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES,
|
||||||
.split = SPLIT_PHYSICAL,
|
.split = SPLIT_PHYSICAL,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -7267,7 +7267,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
|
||||||
.secondaryEffectChance = 0,
|
.secondaryEffectChance = 0,
|
||||||
.target = MOVE_TARGET_SELECTED,
|
.target = MOVE_TARGET_SELECTED,
|
||||||
.priority = 0,
|
.priority = 0,
|
||||||
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED,
|
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES,
|
||||||
.split = SPLIT_PHYSICAL,
|
.split = SPLIT_PHYSICAL,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -8367,7 +8367,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
|
||||||
.secondaryEffectChance = 0,
|
.secondaryEffectChance = 0,
|
||||||
.target = MOVE_TARGET_SELECTED,
|
.target = MOVE_TARGET_SELECTED,
|
||||||
.priority = 0,
|
.priority = 0,
|
||||||
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED,
|
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES,
|
||||||
.split = SPLIT_PHYSICAL,
|
.split = SPLIT_PHYSICAL,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -8575,7 +8575,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
|
||||||
.secondaryEffectChance = 0,
|
.secondaryEffectChance = 0,
|
||||||
.target = MOVE_TARGET_SELECTED,
|
.target = MOVE_TARGET_SELECTED,
|
||||||
.priority = 0,
|
.priority = 0,
|
||||||
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED,
|
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES,
|
||||||
.split = SPLIT_PHYSICAL,
|
.split = SPLIT_PHYSICAL,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -10726,9 +10726,9 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
|
||||||
[MOVE_DOUBLE_IRON_BASH] =
|
[MOVE_DOUBLE_IRON_BASH] =
|
||||||
{
|
{
|
||||||
#if B_UPDATED_MOVE_DATA >= GEN_8
|
#if B_UPDATED_MOVE_DATA >= GEN_8
|
||||||
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST,
|
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST | FLAG_TWO_STRIKES,
|
||||||
#else
|
#else
|
||||||
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_DMG_MINIMIZE | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST,
|
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_DMG_MINIMIZE | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST | FLAG_TWO_STRIKES,
|
||||||
#endif
|
#endif
|
||||||
.effect = EFFECT_DOUBLE_IRON_BASH,
|
.effect = EFFECT_DOUBLE_IRON_BASH,
|
||||||
.power = 60,
|
.power = 60,
|
||||||
|
@ -10850,7 +10850,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
|
||||||
.secondaryEffectChance = 0,
|
.secondaryEffectChance = 0,
|
||||||
.target = MOVE_TARGET_SELECTED,
|
.target = MOVE_TARGET_SELECTED,
|
||||||
.priority = 0,
|
.priority = 0,
|
||||||
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED,
|
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES,
|
||||||
.split = SPLIT_PHYSICAL,
|
.split = SPLIT_PHYSICAL,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -11480,7 +11480,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
|
||||||
.secondaryEffectChance = 0,
|
.secondaryEffectChance = 0,
|
||||||
.target = MOVE_TARGET_SELECTED,
|
.target = MOVE_TARGET_SELECTED,
|
||||||
.priority = 0,
|
.priority = 0,
|
||||||
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED,
|
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES,
|
||||||
.split = SPLIT_PHYSICAL,
|
.split = SPLIT_PHYSICAL,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue