Merge branch 'battle_engine' of https://github.com/rh-hideout/pokeemerald-expansion into gen8_abilities

This commit is contained in:
Evan 2021-02-02 09:00:12 -07:00
commit 00cbe61e13
5 changed files with 106 additions and 31 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 2 KiB

View file

@ -11261,15 +11261,20 @@ static void Cmd_setgastroacid(void)
{
switch (gBattleMons[gBattlerTarget].ability)
{
case ABILITY_MULTITYPE:
case ABILITY_STANCE_CHANGE:
case ABILITY_SCHOOLING:
case ABILITY_COMATOSE:
case ABILITY_SHIELDS_DOWN:
case ABILITY_DISGUISE:
case ABILITY_RKS_SYSTEM:
case ABILITY_AS_ONE_ICE_RIDER:
case ABILITY_AS_ONE_SHADOW_RIDER:
case ABILITY_BATTLE_BOND:
case ABILITY_COMATOSE:
case ABILITY_DISGUISE:
case ABILITY_GULP_MISSILE:
case ABILITY_ICE_FACE:
case ABILITY_MULTITYPE:
case ABILITY_POWER_CONSTRUCT:
case ABILITY_RKS_SYSTEM:
case ABILITY_SCHOOLING:
case ABILITY_SHIELDS_DOWN:
case ABILITY_STANCE_CHANGE:
case ABILITY_ZEN_MODE:
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
break;
default:

View file

@ -775,14 +775,20 @@ static const u8 sAbilitiesAffectedByMoldBreaker[] =
static const u8 sAbilitiesNotTraced[ABILITIES_COUNT] =
{
[ABILITY_AS_ONE_ICE_RIDER] = 1,
[ABILITY_AS_ONE_SHADOW_RIDER] = 1,
[ABILITY_BATTLE_BOND] = 1,
[ABILITY_COMATOSE] = 1,
[ABILITY_DISGUISE] = 1,
[ABILITY_FLOWER_GIFT] = 1,
[ABILITY_FORECAST] = 1,
[ABILITY_GULP_MISSILE] = 1,
[ABILITY_HUNGER_SWITCH] = 1,
[ABILITY_ICE_FACE] = 1,
[ABILITY_ILLUSION] = 1,
[ABILITY_IMPOSTER] = 1,
[ABILITY_MULTITYPE] = 1,
[ABILITY_NEUTRALIZING_GAS] = 1,
[ABILITY_NONE] = 1,
[ABILITY_POWER_CONSTRUCT] = 1,
[ABILITY_POWER_OF_ALCHEMY] = 1,
@ -2344,9 +2350,9 @@ u8 DoBattlerEndTurnEffects(void)
PREPARE_MOVE_BUFFER(gBattleTextBuff1, gBattleStruct->wrappedMove[gActiveBattler]);
gBattlescriptCurrInstr = BattleScript_WrapTurnDmg;
if (GetBattlerHoldEffect(gBattleStruct->wrappedBy[gActiveBattler], TRUE) == HOLD_EFFECT_BINDING_BAND)
gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / (B_BINDING_DAMAGE >= GEN_6) ? 6 : 8;
gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / ((B_BINDING_DAMAGE >= GEN_6) ? 6 : 8);
else
gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / (B_BINDING_DAMAGE >= GEN_6) ? 8 : 16;
gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / ((B_BINDING_DAMAGE >= GEN_6) ? 8 : 16);
if (gBattleMoveDamage == 0)
gBattleMoveDamage = 1;
@ -2831,6 +2837,29 @@ void TryClearRageAndFuryCutter(void)
}
}
static bool32 IsThawingMove(u8 battlerId, u16 move)
{
switch (move)
{
case MOVE_BURN_UP:
if (!IS_BATTLER_OF_TYPE(battlerId, TYPE_FIRE))
return FALSE;
//fallthrough
case MOVE_FLAME_WHEEL:
case MOVE_FLARE_BLITZ:
case MOVE_FUSION_FLARE:
case MOVE_PYRO_BALL:
case MOVE_SACRED_FIRE:
case MOVE_SCALD:
case MOVE_SCORCHING_SANDS:
case MOVE_SIZZLY_SLIDE:
case MOVE_STEAM_ERUPTION:
return TRUE;
default:
return FALSE;
}
}
enum
{
CANCELLER_FLAGS,
@ -3130,8 +3159,7 @@ u8 AtkCanceller_UnableToUseMove(void)
case CANCELLER_THAW: // move thawing
if (gBattleMons[gBattlerAttacker].status1 & STATUS1_FREEZE)
{
if (gBattleMoves[gCurrentMove].effect == EFFECT_THAW_HIT
|| (gBattleMoves[gCurrentMove].effect == EFFECT_BURN_UP && IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_FIRE)))
if (IsThawingMove(gBattlerAttacker, gCurrentMove))
{
gBattleMons[gBattlerAttacker].status1 &= ~(STATUS1_FREEZE);
BattleScriptPushCursor();
@ -6748,7 +6776,8 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe
MulModifier(&modifier, UQ_4_12(1.3));
break;
case ABILITY_SAND_FORCE:
if (moveType == TYPE_STEEL || moveType == TYPE_ROCK || moveType == TYPE_GROUND)
if ((moveType == TYPE_STEEL || moveType == TYPE_ROCK || moveType == TYPE_GROUND)
&& WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SANDSTORM_ANY)
MulModifier(&modifier, UQ_4_12(1.3));
break;
case ABILITY_RIVALRY:

View file

@ -356,7 +356,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
[MOVE_STOMP] =
{
.effect = EFFECT_FLINCH_MINIMIZE_HIT,
.effect = EFFECT_FLINCH_HIT,
.power = 65,
.type = TYPE_NORMAL,
.accuracy = 100,
@ -526,6 +526,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
[MOVE_BODY_SLAM] =
{
#if B_UPDATED_MOVE_DATA >= GEN_6
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_DMG_MINIMIZE,
#else
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST,
#endif
.effect = EFFECT_PARALYZE_HIT,
.power = 85,
.type = TYPE_NORMAL,
@ -534,7 +539,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.secondaryEffectChance = 30,
.target = MOVE_TARGET_SELECTED,
.priority = 0,
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_DMG_MINIMIZE,
.split = SPLIT_PHYSICAL,
},
@ -1951,9 +1955,9 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
[MOVE_FIRE_BLAST] =
{
#if B_UPDATED_MOVE_DATA >= GEN_6
.power = 120,
#else
.power = 110,
#else
.power = 120,
#endif
.effect = EFFECT_BURN_HIT,
.type = TYPE_FIRE,
@ -4728,7 +4732,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
[MOVE_NEEDLE_ARM] =
{
.effect = EFFECT_FLINCH_MINIMIZE_HIT,
#if B_UPDATED_MOVE_DATA >= GEN_4
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST,
#else
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_DMG_MINIMIZE,
#endif
.effect = EFFECT_FLINCH_HIT,
.power = 60,
.type = TYPE_GRASS,
.accuracy = 100,
@ -4736,7 +4745,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.secondaryEffectChance = 30,
.target = MOVE_TARGET_SELECTED,
.priority = 0,
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST,
.split = SPLIT_PHYSICAL,
},
@ -4849,7 +4857,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
[MOVE_ASTONISH] =
{
.effect = EFFECT_FLINCH_MINIMIZE_HIT,
#if B_UPDATED_MOVE_DATA >= GEN_4
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST,
#else
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_DMG_MINIMIZE,
#endif
.effect = EFFECT_FLINCH_HIT,
.power = 30,
.type = TYPE_GHOST,
.accuracy = 100,
@ -4857,7 +4870,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.secondaryEffectChance = 30,
.target = MOVE_TARGET_SELECTED,
.priority = 0,
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST,
.split = SPLIT_PHYSICAL,
},
@ -5098,17 +5110,21 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
{
#if B_UPDATED_MOVE_DATA >= GEN_6
.pp = 20,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST,
#elif B_UPDATED_MOVE_DATA == GEN_4 || B_UPDATED_MOVE_DATA == GEN_5
.pp = 30,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST,
#else
.pp = 30,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_DMG_MINIMIZE,
#endif
.effect = EFFECT_FLINCH_MINIMIZE_HIT,
.effect = EFFECT_FLINCH_HIT,
.power = 80,
.type = TYPE_PSYCHIC,
.accuracy = 100,
.secondaryEffectChance = 10,
.target = MOVE_TARGET_SELECTED,
.priority = 0,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST,
.split = SPLIT_SPECIAL,
},
@ -6378,6 +6394,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
[MOVE_DRAGON_RUSH] =
{
#if B_UPDATED_MOVE_DATA >= GEN_6
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_DMG_MINIMIZE,
#else
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST,
#endif
.effect = EFFECT_FLINCH_HIT,
.power = 100,
.type = TYPE_DRAGON,
@ -6386,7 +6407,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.secondaryEffectChance = 20,
.target = MOVE_TARGET_SELECTED,
.priority = 0,
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_DMG_MINIMIZE,
.split = SPLIT_PHYSICAL,
},
@ -7275,6 +7295,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
[MOVE_SHADOW_FORCE] =
{
#if B_UPDATED_MOVE_DATA == GEN_6
.flags = FLAG_MAKES_CONTACT | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_DMG_MINIMIZE,
#else
.flags = FLAG_MAKES_CONTACT | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED,
#endif
.effect = EFFECT_SEMI_INVULNERABLE,
.power = 120,
.type = TYPE_GHOST,
@ -7283,7 +7308,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.secondaryEffectChance = 0,
.target = MOVE_TARGET_SELECTED,
.priority = 0,
.flags = FLAG_MAKES_CONTACT | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED,
.split = SPLIT_PHYSICAL,
},
@ -7530,6 +7554,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
[MOVE_HEAVY_SLAM] =
{
#if B_UPDATED_MOVE_DATA >= GEN_7
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_DMG_MINIMIZE,
#else
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED,
#endif
.effect = EFFECT_HEAT_CRASH,
.power = 1,
.type = TYPE_STEEL,
@ -7538,7 +7567,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.secondaryEffectChance = 0,
.target = MOVE_TARGET_SELECTED,
.priority = 0,
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_DMG_MINIMIZE,
.split = SPLIT_PHYSICAL,
},
@ -8294,6 +8322,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
[MOVE_HEAT_CRASH] =
{
#if B_UPDATED_MOVE_DATA >= GEN_6
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_DMG_MINIMIZE,
#else
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED,
#endif
.effect = EFFECT_HEAT_CRASH,
.power = 1,
.type = TYPE_FIRE,
@ -8302,7 +8335,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.secondaryEffectChance = 0,
.target = MOVE_TARGET_SELECTED,
.priority = 0,
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_DMG_MINIMIZE,
.split = SPLIT_PHYSICAL,
},
@ -8322,7 +8354,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
[MOVE_STEAMROLLER] =
{
.effect = EFFECT_FLINCH_MINIMIZE_HIT,
.effect = EFFECT_FLINCH_HIT,
.power = 65,
.type = TYPE_BUG,
.accuracy = 100,
@ -8330,8 +8362,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.secondaryEffectChance = 30,
.target = MOVE_TARGET_SELECTED,
.priority = 0,
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_DMG_MINIMIZE | FLAG_SHEER_FORCE_BOOST,
.split = SPLIT_PHYSICAL,
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_DMG_MINIMIZE,
},
[MOVE_COTTON_GUARD] =
@ -8749,6 +8781,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
[MOVE_PHANTOM_FORCE] =
{
#if B_UPDATED_MOVE_DATA == GEN_6
.flags = FLAG_MAKES_CONTACT | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_DMG_MINIMIZE,
#else
.flags = FLAG_MAKES_CONTACT | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED,
#endif
.effect = EFFECT_SEMI_INVULNERABLE,
.power = 90,
.type = TYPE_GHOST,
@ -8757,7 +8794,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.secondaryEffectChance = 100,
.target = MOVE_TARGET_SELECTED,
.priority = 0,
.flags = FLAG_MAKES_CONTACT | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED,
.split = SPLIT_PHYSICAL,
.argument = MOVE_EFFECT_FEINT,
},
@ -10288,7 +10324,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.target = MOVE_TARGET_FOES_AND_ALLY,
.priority = 0,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED,
.split = SPLIT_PHYSICAL,
.split = SPLIT_SPECIAL,
},
[MOVE_PLASMA_FISTS] =
@ -10577,6 +10613,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
[MOVE_DOUBLE_IRON_BASH] =
{
#if B_UPDATED_MOVE_DATA >= GEN_8
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_IRON_FIST_BOOST,
#else
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_DMG_MINIMIZE | FLAG_IRON_FIST_BOOST,
#endif
.effect = EFFECT_PLACEHOLDER, //TODO (EFFECT_FLINCH_HIT + EFFECT_DOUBLE_HIT)
.power = 60,
.type = TYPE_STEEL,
@ -10585,7 +10626,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.secondaryEffectChance = 30,
.target = MOVE_TARGET_SELECTED,
.priority = 0,
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_DMG_MINIMIZE | FLAG_IRON_FIST_BOOST,
.split = SPLIT_PHYSICAL,
},

View file

@ -119,6 +119,7 @@ static const struct MenuInfoIcon sMenuInfoIcons[] =
[TYPE_ICE + 1] = { 32, 12, 0x4C },
[TYPE_DRAGON + 1] = { 32, 12, 0xA0 },
[TYPE_DARK + 1] = { 32, 12, 0x8C },
[TYPE_FAIRY + 1] = { 32, 12, 0x4 },
[MENU_INFO_ICON_TYPE] = { 42, 12, 0xA8 },
[MENU_INFO_ICON_POWER] = { 42, 12, 0xC0 },
[MENU_INFO_ICON_ACCURACY] = { 42, 12, 0xC8 },