Skip to content

Commit

Permalink
Added config for Weak Armor's Gen 5-6 effect (#3498)
Browse files Browse the repository at this point in the history
  • Loading branch information
AsparagusEduardo authored Oct 30, 2023
1 parent e28d0c6 commit 2dfae91
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions data/battle_scripts_1.s
Original file line number Diff line number Diff line change
Expand Up @@ -9113,7 +9113,11 @@ BattleScript_WeakArmorDefAnim:
printstring STRINGID_TARGETABILITYSTATLOWER
waitmessage B_WAIT_TIME_LONG
BattleScript_WeakArmorActivatesSpeed:
.if B_WEAK_ARMOR_SPEED >= GEN_7
setstatchanger STAT_SPEED, 2, FALSE
.else
setstatchanger STAT_SPEED, 1, FALSE
.endif
statbuffchange STAT_CHANGE_ALLOW_PTR, BattleScript_WeakArmorActivatesEnd
jumpifbyte CMP_LESS_THAN, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_WeakArmorSpeedAnim
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_ROSE_EMPTY, BattleScript_WeakArmorActivatesEnd
Expand Down
1 change: 1 addition & 0 deletions include/config/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
#define B_SNOW_WARNING GEN_LATEST // In Gen9+, Snow Warning will summon snow instead of hail.
#define B_TRANSISTOR_BOOST GEN_LATEST // In Gen9+, Transistor will only boost Electric-type moves by 1.3x as opposed to 1.5x.
#define B_ILLUMINATE_EFFECT GEN_LATEST // In Gen9+, Illuminate prevents accuracy reductions and ignores the target's evasion.
#define B_WEAK_ARMOR_SPEED GEN_LATEST // In Gen7+, Weak Armor raises Speed by 2 stages instead of 1 when hit by a physical move.

// Item settings
#define B_HP_BERRIES GEN_LATEST // In Gen4+, berries which restore HP activate immediately after HP drops to half. In Gen3, the effect occurs at the end of the turn.
Expand Down
1 change: 1 addition & 0 deletions test/battle/ability/weak_armor.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ASSUMPTIONS
ASSUME(gBattleMoves[MOVE_GUST].power != 0);
ASSUME(gBattleMoves[MOVE_GUST].split == SPLIT_SPECIAL);
ASSUME(gBattleMoves[MOVE_TACKLE].split == SPLIT_PHYSICAL);
ASSUME(B_WEAK_ARMOR_SPEED >= GEN_7);
}

SINGLE_BATTLE_TEST("Weak Armor lowers Defense by 1 and boosts Speed by 2 when hit by a physical attack")
Expand Down

0 comments on commit 2dfae91

Please sign in to comment.