Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix White Herb Known Failing tests #4258

Merged
merged 4 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions asm/macros/battle_script.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1360,6 +1360,11 @@
.byte \battler
.4byte \jumpInstr
.endm

.macro itemstatchangeeffects battler:req
callnative BS_RunStatChangeItems
.byte \battler
.endm

.macro allyswitchswapbattlers
callnative BS_AllySwitchSwapBattler
Expand Down
17 changes: 9 additions & 8 deletions data/battle_scripts_1.s
Original file line number Diff line number Diff line change
Expand Up @@ -7742,11 +7742,12 @@ BattleScript_ActivateWeatherAbilities_Increment:
restoretarget
return

BattleScript_TryAdrenalineOrb:
jumpifnoholdeffect BS_TARGET, HOLD_EFFECT_ADRENALINE_ORB, BattleScript_TryAdrenalineOrbRet
jumpifstat BS_TARGET, CMP_EQUAL, STAT_SPEED, 12, BattleScript_TryAdrenalineOrbRet
BattleScript_TryIntimidateHoldEffects:
itemstatchangeeffects BS_TARGET
jumpifnoholdeffect BS_TARGET, HOLD_EFFECT_ADRENALINE_ORB, BattleScript_TryIntimidateHoldEffectsRet
jumpifstat BS_TARGET, CMP_EQUAL, STAT_SPEED, 12, BattleScript_TryIntimidateHoldEffectsRet
setstatchanger STAT_SPEED, 1, FALSE
statbuffchange STAT_CHANGE_NOT_PROTECT_AFFECTED | MOVE_EFFECT_CERTAIN | STAT_CHANGE_ALLOW_PTR, BattleScript_TryAdrenalineOrbRet
statbuffchange STAT_CHANGE_NOT_PROTECT_AFFECTED | MOVE_EFFECT_CERTAIN | STAT_CHANGE_ALLOW_PTR, BattleScript_TryIntimidateHoldEffectsRet
playanimation BS_TARGET, B_ANIM_HELD_ITEM_EFFECT
setgraphicalstatchangevalues
playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1
Expand All @@ -7755,7 +7756,7 @@ BattleScript_TryAdrenalineOrb:
printstring STRINGID_USINGITEMSTATOFPKMNROSE
waitmessage B_WAIT_TIME_LONG
removeitem BS_TARGET
BattleScript_TryAdrenalineOrbRet:
BattleScript_TryIntimidateHoldEffectsRet:
return

BattleScript_IntimidateActivates::
Expand All @@ -7781,7 +7782,7 @@ BattleScript_IntimidateEffect:
BattleScript_IntimidateEffect_WaitString:
waitmessage B_WAIT_TIME_LONG
copybyte sBATTLER, gBattlerTarget
call BattleScript_TryAdrenalineOrb
call BattleScript_TryIntimidateHoldEffects
BattleScript_IntimidateLoopIncrement:
addbyte gBattlerTarget, 1
jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_IntimidateLoop
Expand All @@ -7807,7 +7808,7 @@ BattleScript_IntimidateInReverse:
call BattleScript_AbilityPopUpTarget
pause B_WAIT_TIME_SHORT
modifybattlerstatstage BS_TARGET, STAT_ATK, INCREASE, 1, BattleScript_IntimidateLoopIncrement, ANIM_ON
call BattleScript_TryAdrenalineOrb
call BattleScript_TryIntimidateHoldEffects
goto BattleScript_IntimidateLoopIncrement

BattleScript_SupersweetSyrupActivates::
Expand All @@ -7834,7 +7835,7 @@ BattleScript_SupersweetSyrupEffect:
BattleScript_SupersweetSyrupEffect_WaitString:
waitmessage B_WAIT_TIME_LONG
copybyte sBATTLER, gBattlerTarget
call BattleScript_TryAdrenalineOrb
call BattleScript_TryIntimidateHoldEffects
BattleScript_SupersweetSyrupLoopIncrement:
addbyte gBattlerTarget, 1
jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_SupersweetSyrupLoop
Expand Down
1 change: 1 addition & 0 deletions include/battle_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#define ITEMEFFECT_ORBS 6
#define ITEMEFFECT_LIFEORB_SHELLBELL 7
#define ITEMEFFECT_USE_LAST_ITEM 8 // move end effects for just the battler, not whole field
#define ITEMEFFECT_STATS_CHANGED 9 // For White Herb and Eject Pack

#define WEATHER_HAS_EFFECT ((!IsAbilityOnField(ABILITY_CLOUD_NINE) && !IsAbilityOnField(ABILITY_AIR_LOCK)))

Expand Down
6 changes: 3 additions & 3 deletions include/constants/battle_script_commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,9 @@
#define MOVEEND_DEFROST 23
#define MOVEEND_RECOIL 24
#define MOVEEND_MAGICIAN 25 // Occurs after final multi-hit strike, and after other items/abilities would activate
#define MOVEEND_EJECT_BUTTON 26
#define MOVEEND_RED_CARD 27
#define MOVEEND_EJECT_PACK 28
#define MOVEEND_EJECT_ITEMS 26
#define MOVEEND_WHITE_HERB 27
#define MOVEEND_RED_CARD 28
#define MOVEEND_LIFEORB_SHELLBELL 29 // Includes shell bell, throat spray, etc
#define MOVEEND_CHANGED_ITEMS 30
#define MOVEEND_PICKPOCKET 31
Expand Down
Loading
Loading