Bugfixes for Knock Off, Cover, Thief, Ceaseless Edge and Stone Axe (#7326)

This commit is contained in:
Alex
2025-07-14 21:34:21 +02:00
committed by GitHub
parent 939e168c04
commit 73a2e5104e
24 changed files with 601 additions and 458 deletions

View File

@@ -588,7 +588,8 @@ struct BattlerState
u32 pursuitTarget:1;
u32 stompingTantrumTimer:2;
u32 canPickupItem:1;
u32 padding:16;
u32 itemCanBeKnockedOff:1;
u32 padding:15;
// End of Word
};

View File

@@ -363,7 +363,6 @@ enum MoveEffects
MOVE_EFFECT_REMOVE_ARG_TYPE,
MOVE_EFFECT_RECHARGE,
MOVE_EFFECT_RAGE,
MOVE_EFFECT_STEAL_ITEM,
MOVE_EFFECT_PREVENT_ESCAPE,
MOVE_EFFECT_NIGHTMARE,
MOVE_EFFECT_ALL_STATS_UP,
@@ -399,8 +398,6 @@ enum MoveEffects
MOVE_EFFECT_TRAP_BOTH,
MOVE_EFFECT_ROUND,
MOVE_EFFECT_DIRE_CLAW,
MOVE_EFFECT_STEALTH_ROCK,
MOVE_EFFECT_SPIKES,
MOVE_EFFECT_SYRUP_BOMB,
MOVE_EFFECT_FLORAL_HEALING,
MOVE_EFFECT_SECRET_POWER,
@@ -414,6 +411,11 @@ enum MoveEffects
MOVE_EFFECT_LIGHT_SCREEN,
MOVE_EFFECT_SALT_CURE,
MOVE_EFFECT_EERIE_SPELL,
// Max move effects happen earlier in the execution chain.
// For example stealth rock from G-Max Stonesurge is set up before abilities but from Stone Axe after.
// Stone Axe can also fail to set up rocks if user faints where as Stonesurge will always go up.
// This means we need to be careful if we want to re-use those effects for (new) vanilla moves
MOVE_EFFECT_RAISE_TEAM_ATTACK,
MOVE_EFFECT_RAISE_TEAM_DEFENSE,
MOVE_EFFECT_RAISE_TEAM_SPEED,
@@ -455,11 +457,14 @@ enum MoveEffects
MOVE_EFFECT_LOWER_EVASIVENESS_SIDE,
MOVE_EFFECT_AROMATHERAPY,
MOVE_EFFECT_CONFUSE_SIDE,
MOVE_EFFECT_STEELSURGE,
MOVE_EFFECT_STEELSURGE, // Steel type rocks
MOVE_EFFECT_STEALTH_ROCK, // Max Move rocks, not to be confused for rocks set up from Ceasless Edge (same but differ in execution order)
MOVE_EFFECT_TORMENT_SIDE,
MOVE_EFFECT_LOWER_SPEED_2_SIDE,
MOVE_EFFECT_FIRE_SPIN_SIDE,
MOVE_EFFECT_FIXED_POWER,
// Max move effects end. They can be used for (custom) normal moves.
NUM_MOVE_EFFECTS
};

View File

@@ -155,6 +155,7 @@ enum BattleMoveEffects
EFFECT_BRICK_BREAK,
EFFECT_YAWN,
EFFECT_KNOCK_OFF,
EFFECT_STEAL_ITEM,
EFFECT_ENDEAVOR,
EFFECT_POWER_BASED_ON_USER_HP,
EFFECT_SKILL_SWAP,
@@ -351,6 +352,8 @@ enum BattleMoveEffects
EFFECT_SMACK_DOWN,
EFFECT_ICE_SPINNER, // Removes terrain unless attacker is removed from field either by fainting or ejected out
EFFECT_STEEL_ROLLER, // Will fail if there is no terrain up but removes it regardless if attacker is removed from field or not
EFFECT_STONE_AXE, // Not to be confused with MOVE_EFFECT_STEALTH_ROCK. They have two different activation timings.
EFFECT_CEASELESS_EDGE, // Same applies to spikes
NUM_BATTLE_MOVE_EFFECTS,
};

View File

@@ -260,7 +260,6 @@ enum MoveEndEffects
MOVEEND_ATTACKER_VISIBLE,
MOVEEND_TARGET_VISIBLE,
MOVEEND_ITEM_EFFECTS_TARGET,
MOVEEND_FIRST_MOVE_BLOCK,
MOVEEND_ITEM_EFFECTS_ALL,
MOVEEND_SYMBIOSIS,
MOVEEND_KINGSROCK, // These item effects will occur each strike of a multi-hit move
@@ -271,7 +270,7 @@ enum MoveEndEffects
MOVEEND_DEFROST,
MOVEEND_NEXT_TARGET, // Everything up until here is handled for each strike of a spread move
MOVEEND_MULTIHIT_MOVE,
MOVEEND_SECOND_MOVE_BLOCK,
MOVEEND_MOVE_BLOCK,
MOVEEND_ITEM_EFFECTS_ATTACKER,
MOVEEND_ABILITY_BLOCK,
MOVEEND_SHEER_FORCE, // If move is Sheer Force affected, skip until Opportunist