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

Adds Rage Fist #3573

Merged
merged 12 commits into from
Dec 10, 2023
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
10 changes: 5 additions & 5 deletions asm/macros/battle_script.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1391,6 +1391,11 @@
.4byte \sidestatus
.endm

.macro trycopycat failInstr:req
callnative BS_TryCopycat
.4byte \failInstr
.endm

.macro setzeffect
callnative BS_SetZEffect
.endm
Expand Down Expand Up @@ -1805,11 +1810,6 @@
.4byte \jumpInstr
.endm

.macro trycopycat failInstr:req
various BS_ATTACKER, VARIOUS_TRY_COPYCAT
.4byte \failInstr
.endm

.macro showabilitypopup battler:req
various \battler, VARIOUS_ABILITY_POPUP
.endm
Expand Down
1 change: 1 addition & 0 deletions data/battle_scripts_1.s
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ gBattleScriptsForMoveEffects::
.4byte BattleScript_EffectMaxMove @ EFFECT_MAX_MOVE
.4byte BattleScript_EffectGlaiveRush @ EFFECT_GLAIVE_RUSH
.4byte BattleScript_EffectBrickBreak @ EFFECT_RAGING_BULL
.4byte BattleScript_EffectHit @ EFFECT_RAGE_FIST

BattleScript_EffectGlaiveRush::
call BattleScript_EffectHit_Ret
Expand Down
4 changes: 3 additions & 1 deletion include/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,8 @@ struct BattleStruct
bool8 transformZeroToHero[PARTY_SIZE][NUM_BATTLE_SIDES];
u8 pledgeMove:1;
bool8 isSkyBattle:1;
u8 timesGotHit[NUM_BATTLE_SIDES][PARTY_SIZE];
u8 enduredDamage;
};

// The palaceFlags member of struct BattleStruct contains 1 flag per move to indicate which moves the AI should consider,
Expand Down Expand Up @@ -764,7 +766,7 @@ STATIC_ASSERT(sizeof(((struct BattleStruct *)0)->palaceFlags) * 8 >= MAX_BATTLER
#define IS_MOVE_RECOIL(move)(IS_EFFECT_RECOIL(gBattleMoves[move].effect))

#define BATTLER_MAX_HP(battlerId)(gBattleMons[battlerId].hp == gBattleMons[battlerId].maxHP)
#define TARGET_TURN_DAMAGED ((gSpecialStatuses[gBattlerTarget].physicalDmg != 0 || gSpecialStatuses[gBattlerTarget].specialDmg != 0))
#define TARGET_TURN_DAMAGED ((gSpecialStatuses[gBattlerTarget].physicalDmg != 0 || gSpecialStatuses[gBattlerTarget].specialDmg != 0) || (gBattleStruct->enduredDamage & gBitTable[gBattlerTarget]))
#define BATTLER_DAMAGED(battlerId) ((gSpecialStatuses[battlerId].physicalDmg != 0 || gSpecialStatuses[battlerId].specialDmg != 0))

#define IS_BATTLER_OF_TYPE(battlerId, type)((GetBattlerType(battlerId, 0) == type || GetBattlerType(battlerId, 1) == type || (GetBattlerType(battlerId, 2) != TYPE_MYSTERY && GetBattlerType(battlerId, 2) == type)))
Expand Down
3 changes: 2 additions & 1 deletion include/constants/battle_move_effects.h
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,8 @@
#define EFFECT_MAX_MOVE 414
#define EFFECT_GLAIVE_RUSH 415
#define EFFECT_RAGING_BULL 416
#define EFFECT_RAGE_FIST 417

#define NUM_BATTLE_MOVE_EFFECTS 417
#define NUM_BATTLE_MOVE_EFFECTS 418

#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H
242 changes: 121 additions & 121 deletions include/constants/battle_script_commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,106 +143,105 @@
#define VARIOUS_ARGUMENT_STATUS_EFFECT 51
#define VARIOUS_TRY_HIT_SWITCH_TARGET 52
#define VARIOUS_TRY_AUTOTOMIZE 53
#define VARIOUS_TRY_COPYCAT 54
#define VARIOUS_ABILITY_POPUP 55
#define VARIOUS_DEFOG 56
#define VARIOUS_JUMP_IF_TARGET_ALLY 57
#define VARIOUS_TRY_SYNCHRONOISE 58
#define VARIOUS_PSYCHO_SHIFT 59
#define VARIOUS_CURE_STATUS 60
#define VARIOUS_POWER_TRICK 61
#define VARIOUS_AFTER_YOU 62
#define VARIOUS_BESTOW 63
#define VARIOUS_ARGUMENT_TO_MOVE_EFFECT 64
#define VARIOUS_JUMP_IF_NOT_GROUNDED 65
#define VARIOUS_HANDLE_TRAINER_SLIDE_MSG 66
#define VARIOUS_TRY_TRAINER_SLIDE_MSG_FIRST_OFF 67
#define VARIOUS_TRY_TRAINER_SLIDE_MSG_LAST_ON 68
#define VARIOUS_SET_AURORA_VEIL 69
#define VARIOUS_TRY_THIRD_TYPE 70
#define VARIOUS_ACUPRESSURE 71
#define VARIOUS_SET_POWDER 72
#define VARIOUS_SPECTRAL_THIEF 73
#define VARIOUS_GRAVITY_ON_AIRBORNE_MONS 74
#define VARIOUS_CHECK_IF_GRASSY_TERRAIN_HEALS 75
#define VARIOUS_JUMP_IF_ROAR_FAILS 76
#define VARIOUS_TRY_INSTRUCT 77
#define VARIOUS_JUMP_IF_NOT_BERRY 78
#define VARIOUS_TRACE_ABILITY 79
#define VARIOUS_UPDATE_NICK 80
#define VARIOUS_TRY_ILLUSION_OFF 81
#define VARIOUS_SET_SPRITEIGNORE0HP 82
#define VARIOUS_HANDLE_FORM_CHANGE 83
#define VARIOUS_GET_STAT_VALUE 84
#define VARIOUS_JUMP_IF_FULL_HP 85
#define VARIOUS_LOSE_TYPE 86
#define VARIOUS_TRY_ACTIVATE_SOULHEART 87
#define VARIOUS_TRY_ACTIVATE_RECEIVER 88
#define VARIOUS_TRY_ACTIVATE_BEAST_BOOST 89
#define VARIOUS_TRY_FRISK 90
#define VARIOUS_JUMP_IF_SHIELDS_DOWN_PROTECTED 91
#define VARIOUS_TRY_FAIRY_LOCK 92
#define VARIOUS_JUMP_IF_NO_ALLY 93
#define VARIOUS_POISON_TYPE_IMMUNITY 94
#define VARIOUS_JUMP_IF_NO_HOLD_EFFECT 95
#define VARIOUS_INFATUATE_WITH_BATTLER 96
#define VARIOUS_SET_LAST_USED_ITEM 97
#define VARIOUS_PARALYZE_TYPE_IMMUNITY 98
#define VARIOUS_JUMP_IF_ABSENT 99
#define VARIOUS_DESTROY_ABILITY_POPUP 100
#define VARIOUS_TOTEM_BOOST 101
#define VARIOUS_TRY_ACTIVATE_GRIM_NEIGH 102
#define VARIOUS_MOVEEND_ITEM_EFFECTS 103
#define VARIOUS_TERRAIN_SEED 104
#define VARIOUS_MAKE_INVISIBLE 105
#define VARIOUS_ROOM_SERVICE 106
#define VARIOUS_EERIE_SPELL_PP_REDUCE 107
#define VARIOUS_JUMP_IF_TEAM_HEALTHY 108
#define VARIOUS_TRY_HEAL_QUARTER_HP 109
#define VARIOUS_REMOVE_TERRAIN 110
#define VARIOUS_JUMP_IF_PRANKSTER_BLOCKED 111
#define VARIOUS_TRY_TO_CLEAR_PRIMAL_WEATHER 112
#define VARIOUS_GET_ROTOTILLER_TARGETS 113
#define VARIOUS_JUMP_IF_NOT_ROTOTILLER_AFFECTED 114
#define VARIOUS_TRY_ACTIVATE_BATTLE_BOND 115
#define VARIOUS_CONSUME_BERRY 116
#define VARIOUS_JUMP_IF_CANT_REVERT_TO_PRIMAL 117
#define VARIOUS_JUMP_IF_SPECIES 118
#define VARIOUS_UPDATE_ABILITY_POPUP 119
#define VARIOUS_JUMP_IF_WEATHER_AFFECTED 120
#define VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED 121
#define VARIOUS_SET_ATTACKER_STICKY_WEB_USER 122
#define VARIOUS_PHOTON_GEYSER_CHECK 123
#define VARIOUS_SHELL_SIDE_ARM_CHECK 124
#define VARIOUS_TRY_NO_RETREAT 125
#define VARIOUS_TRY_TAR_SHOT 126
#define VARIOUS_CAN_TAR_SHOT_WORK 127
#define VARIOUS_CHECK_POLTERGEIST 128
#define VARIOUS_CUT_1_3_HP_RAISE_STATS 129
#define VARIOUS_TRY_END_NEUTRALIZING_GAS 130
#define VARIOUS_JUMP_IF_UNDER_200 131
#define VARIOUS_SET_SKY_DROP 132
#define VARIOUS_CLEAR_SKY_DROP 133
#define VARIOUS_SKY_DROP_YAWN 134
#define VARIOUS_JUMP_IF_HOLD_EFFECT 135
#define VARIOUS_CURE_CERTAIN_STATUSES 136
#define VARIOUS_TRY_RESET_NEGATIVE_STAT_STAGES 137
#define VARIOUS_JUMP_IF_LAST_USED_ITEM_BERRY 138
#define VARIOUS_JUMP_IF_LAST_USED_ITEM_HOLD_EFFECT 139
#define VARIOUS_SAVE_BATTLER_ITEM 140
#define VARIOUS_RESTORE_BATTLER_ITEM 141
#define VARIOUS_BATTLER_ITEM_TO_LAST_USED_ITEM 142
#define VARIOUS_SET_BEAK_BLAST 143
#define VARIOUS_SWAP_SIDE_STATUSES 144
#define VARIOUS_SWAP_STATS 145
#define VARIOUS_TEATIME_INVUL 146
#define VARIOUS_TEATIME_TARGETS 147
#define VARIOUS_TRY_WIND_RIDER_POWER 148
#define VARIOUS_ACTIVATE_WEATHER_CHANGE_ABILITIES 149
#define VARIOUS_ACTIVATE_TERRAIN_CHANGE_ABILITIES 150
#define VARIOUS_STORE_HEALING_WISH 151
#define VARIOUS_HIT_SWITCH_TARGET_FAILED 152
#define VARIOUS_TRY_REVIVAL_BLESSING 153
#define VARIOUS_ABILITY_POPUP 54
#define VARIOUS_DEFOG 55
#define VARIOUS_JUMP_IF_TARGET_ALLY 56
#define VARIOUS_TRY_SYNCHRONOISE 57
#define VARIOUS_PSYCHO_SHIFT 58
#define VARIOUS_CURE_STATUS 59
#define VARIOUS_POWER_TRICK 60
#define VARIOUS_AFTER_YOU 61
#define VARIOUS_BESTOW 62
#define VARIOUS_ARGUMENT_TO_MOVE_EFFECT 63
#define VARIOUS_JUMP_IF_NOT_GROUNDED 64
#define VARIOUS_HANDLE_TRAINER_SLIDE_MSG 65
#define VARIOUS_TRY_TRAINER_SLIDE_MSG_FIRST_OFF 66
#define VARIOUS_TRY_TRAINER_SLIDE_MSG_LAST_ON 67
#define VARIOUS_SET_AURORA_VEIL 68
#define VARIOUS_TRY_THIRD_TYPE 69
#define VARIOUS_ACUPRESSURE 70
#define VARIOUS_SET_POWDER 71
#define VARIOUS_SPECTRAL_THIEF 72
#define VARIOUS_GRAVITY_ON_AIRBORNE_MONS 73
#define VARIOUS_CHECK_IF_GRASSY_TERRAIN_HEALS 74
#define VARIOUS_JUMP_IF_ROAR_FAILS 75
#define VARIOUS_TRY_INSTRUCT 76
#define VARIOUS_JUMP_IF_NOT_BERRY 77
#define VARIOUS_TRACE_ABILITY 78
#define VARIOUS_UPDATE_NICK 79
#define VARIOUS_TRY_ILLUSION_OFF 80
#define VARIOUS_SET_SPRITEIGNORE0HP 81
#define VARIOUS_HANDLE_FORM_CHANGE 82
#define VARIOUS_GET_STAT_VALUE 83
#define VARIOUS_JUMP_IF_FULL_HP 84
#define VARIOUS_LOSE_TYPE 85
#define VARIOUS_TRY_ACTIVATE_SOULHEART 86
#define VARIOUS_TRY_ACTIVATE_RECEIVER 87
#define VARIOUS_TRY_ACTIVATE_BEAST_BOOST 88
#define VARIOUS_TRY_FRISK 89
#define VARIOUS_JUMP_IF_SHIELDS_DOWN_PROTECTED 90
#define VARIOUS_TRY_FAIRY_LOCK 91
#define VARIOUS_JUMP_IF_NO_ALLY 92
#define VARIOUS_POISON_TYPE_IMMUNITY 93
#define VARIOUS_JUMP_IF_NO_HOLD_EFFECT 94
#define VARIOUS_INFATUATE_WITH_BATTLER 95
#define VARIOUS_SET_LAST_USED_ITEM 96
#define VARIOUS_PARALYZE_TYPE_IMMUNITY 97
#define VARIOUS_JUMP_IF_ABSENT 98
#define VARIOUS_DESTROY_ABILITY_POPUP 99
#define VARIOUS_TOTEM_BOOST 100
#define VARIOUS_TRY_ACTIVATE_GRIM_NEIGH 101
#define VARIOUS_MOVEEND_ITEM_EFFECTS 102
#define VARIOUS_TERRAIN_SEED 103
#define VARIOUS_MAKE_INVISIBLE 104
#define VARIOUS_ROOM_SERVICE 105
#define VARIOUS_EERIE_SPELL_PP_REDUCE 106
#define VARIOUS_JUMP_IF_TEAM_HEALTHY 107
#define VARIOUS_TRY_HEAL_QUARTER_HP 108
#define VARIOUS_REMOVE_TERRAIN 109
#define VARIOUS_JUMP_IF_PRANKSTER_BLOCKED 110
#define VARIOUS_TRY_TO_CLEAR_PRIMAL_WEATHER 111
#define VARIOUS_GET_ROTOTILLER_TARGETS 112
#define VARIOUS_JUMP_IF_NOT_ROTOTILLER_AFFECTED 113
#define VARIOUS_TRY_ACTIVATE_BATTLE_BOND 114
#define VARIOUS_CONSUME_BERRY 115
#define VARIOUS_JUMP_IF_CANT_REVERT_TO_PRIMAL 116
#define VARIOUS_JUMP_IF_SPECIES 117
#define VARIOUS_UPDATE_ABILITY_POPUP 118
#define VARIOUS_JUMP_IF_WEATHER_AFFECTED 119
#define VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED 120
#define VARIOUS_SET_ATTACKER_STICKY_WEB_USER 121
#define VARIOUS_PHOTON_GEYSER_CHECK 122
#define VARIOUS_SHELL_SIDE_ARM_CHECK 123
#define VARIOUS_TRY_NO_RETREAT 124
#define VARIOUS_TRY_TAR_SHOT 125
#define VARIOUS_CAN_TAR_SHOT_WORK 126
#define VARIOUS_CHECK_POLTERGEIST 127
#define VARIOUS_CUT_1_3_HP_RAISE_STATS 128
#define VARIOUS_TRY_END_NEUTRALIZING_GAS 129
#define VARIOUS_JUMP_IF_UNDER_200 130
#define VARIOUS_SET_SKY_DROP 131
#define VARIOUS_CLEAR_SKY_DROP 132
#define VARIOUS_SKY_DROP_YAWN 133
#define VARIOUS_JUMP_IF_HOLD_EFFECT 134
#define VARIOUS_CURE_CERTAIN_STATUSES 135
#define VARIOUS_TRY_RESET_NEGATIVE_STAT_STAGES 136
#define VARIOUS_JUMP_IF_LAST_USED_ITEM_BERRY 137
#define VARIOUS_JUMP_IF_LAST_USED_ITEM_HOLD_EFFECT 138
#define VARIOUS_SAVE_BATTLER_ITEM 139
#define VARIOUS_RESTORE_BATTLER_ITEM 140
#define VARIOUS_BATTLER_ITEM_TO_LAST_USED_ITEM 141
#define VARIOUS_SET_BEAK_BLAST 142
#define VARIOUS_SWAP_SIDE_STATUSES 143
#define VARIOUS_SWAP_STATS 144
#define VARIOUS_TEATIME_INVUL 145
#define VARIOUS_TEATIME_TARGETS 146
#define VARIOUS_TRY_WIND_RIDER_POWER 147
#define VARIOUS_ACTIVATE_WEATHER_CHANGE_ABILITIES 148
#define VARIOUS_ACTIVATE_TERRAIN_CHANGE_ABILITIES 149
#define VARIOUS_STORE_HEALING_WISH 150
#define VARIOUS_HIT_SWITCH_TARGET_FAILED 151
#define VARIOUS_TRY_REVIVAL_BLESSING 152

// Cmd_manipulatedamage
#define DMG_CHANGE_SIGN 0
Expand Down Expand Up @@ -299,27 +298,28 @@
#define MOVEEND_MOVE_EFFECTS2 13
#define MOVEEND_ITEM_EFFECTS_ALL 14
#define MOVEEND_KINGSROCK 15 // These item effects will occur each strike of a multi-hit move
#define MOVEEND_SUBSTITUTE 16
#define MOVEEND_SKY_DROP_CONFUSE 17
#define MOVEEND_UPDATE_LAST_MOVES 18
#define MOVEEND_MIRROR_MOVE 19
#define MOVEEND_NEXT_TARGET 20 // Everything up until here is handled for each strike of a multi-hit move
#define MOVEEND_MULTIHIT_MOVE 21
#define MOVEEND_DEFROST 22
#define MOVEEND_RECOIL 23
#define MOVEEND_MAGICIAN 24 // Occurs after final multi-hit strike, and after other items/abilities would activate
#define MOVEEND_EJECT_BUTTON 25
#define MOVEEND_RED_CARD 26
#define MOVEEND_EJECT_PACK 27
#define MOVEEND_LIFEORB_SHELLBELL 28 // Includes shell bell, throat spray, etc
#define MOVEEND_CHANGED_ITEMS 29
#define MOVEEND_PICKPOCKET 30
#define MOVEEND_DANCER 31
#define MOVEEND_EMERGENCY_EXIT 32
#define MOVEEND_SYMBIOSIS 33
#define MOVEEND_OPPORTUNIST 34 // Occurs after other stat change items/abilities to try and copy the boosts
#define MOVEEND_CLEAR_BITS 35
#define MOVEEND_COUNT 36
#define MOVEEND_NUM_HITS 16
#define MOVEEND_SUBSTITUTE 17
#define MOVEEND_SKY_DROP_CONFUSE 18
#define MOVEEND_UPDATE_LAST_MOVES 19
#define MOVEEND_MIRROR_MOVE 20
#define MOVEEND_NEXT_TARGET 21 // Everything up until here is handled for each strike of a multi-hit move
#define MOVEEND_MULTIHIT_MOVE 22
#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_LIFEORB_SHELLBELL 29 // Includes shell bell, throat spray, etc
#define MOVEEND_CHANGED_ITEMS 30
#define MOVEEND_PICKPOCKET 31
#define MOVEEND_DANCER 32
#define MOVEEND_EMERGENCY_EXIT 33
#define MOVEEND_SYMBIOSIS 34
#define MOVEEND_OPPORTUNIST 35 // Occurs after other stat change items/abilities to try and copy the boosts
#define MOVEEND_CLEAR_BITS 36
#define MOVEEND_COUNT 37

// switch cases
#define B_SWITCH_NORMAL 0
Expand Down
Loading
Loading