summaryrefslogtreecommitdiff
path: root/include/constants/battle.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/constants/battle.h')
-rw-r--r--include/constants/battle.h112
1 files changed, 56 insertions, 56 deletions
diff --git a/include/constants/battle.h b/include/constants/battle.h
index c33e0abb4..5aa1772d1 100644
--- a/include/constants/battle.h
+++ b/include/constants/battle.h
@@ -1,5 +1,5 @@
-#ifndef GUARD_CONSTANTS_BATTLE_CONSTANTS_H
-#define GUARD_CONSTANTS_BATTLE_CONSTANTS_H
+#ifndef GUARD_CONSTANTS_BATTLE_H
+#define GUARD_CONSTANTS_BATTLE_H
/*
* A battler may be in one of four positions on the field. The first bit determines
@@ -43,6 +43,7 @@
#define BIT_SIDE 1
#define BIT_FLANK 2
+// Battle Type Flags
#define BATTLE_TYPE_DOUBLE 0x0001
#define BATTLE_TYPE_LINK 0x0002
#define BATTLE_TYPE_WILD 0x0004
@@ -63,67 +64,68 @@
#define SECRET_BASE_OPPONENT 0x400
#define LINK_BATTLE_OPPONENT 0x800
-#define BATTLE_WON 0x1
-#define BATTLE_LOST 0x2
-#define BATTLE_DREW 0x3
-#define BATTLE_RAN 0x4
-#define BATTLE_PLAYER_TELEPORTED 0x5
-#define BATTLE_POKE_FLED 0x6
-#define BATTLE_CAUGHT 0x7
-#define BATTLE_OUT_OF_BALLS 0x8
-#define BATTLE_OPPONENT_TELEPORTED 0xA
-
-#define OUTCOME_LINK_BATTLE_RUN 0x80
+// Battle Outcome defines
+#define B_OUTCOME_WON 0x1
+#define B_OUTCOME_LOST 0x2
+#define B_OUTCOME_DREW 0x3
+#define B_OUTCOME_RAN 0x4
+#define B_OUTCOME_PLAYER_TELEPORTED 0x5
+#define B_OUTCOME_MON_FLED 0x6
+#define B_OUTCOME_CAUGHT 0x7
+#define B_OUTCOME_NO_SAFARI_BALLS 0x8
+#define B_OUTCOME_FORFEITED 0x9
+#define B_OUTCOME_MON_TELEPORTED 0xA
+#define B_OUTCOME_LINK_BATTLE_RAN 0x80
// Non-volatile status conditions
// These persist remain outside of battle and after switching out
-#define STATUS1_NONE 0x0
-#define STATUS_SLEEP 0x7
-#define STATUS_POISON 0x8
-#define STATUS_BURN 0x10
-#define STATUS_FREEZE 0x20
-#define STATUS_PARALYSIS 0x40
-#define STATUS_TOXIC_POISON 0x80
-#define STATUS_TOXIC_COUNTER 0xF00
-#define STATUS_PSN_ANY ((STATUS_POISON | STATUS_TOXIC_POISON))
-#define STATUS_ANY ((STATUS_SLEEP | STATUS_POISON | STATUS_BURN | STATUS_FREEZE | STATUS_PARALYSIS | STATUS_TOXIC_POISON))
+#define STATUS1_NONE 0x0
+#define STATUS1_SLEEP 0x7
+#define STATUS1_POISON 0x8
+#define STATUS1_BURN 0x10
+#define STATUS1_FREEZE 0x20
+#define STATUS1_PARALYSIS 0x40
+#define STATUS1_TOXIC_POISON 0x80
+#define STATUS1_TOXIC_COUNTER 0xF00
+#define STATUS1_PSN_ANY (STATUS1_POISON | STATUS1_TOXIC_POISON)
+#define STATUS1_ANY (STATUS1_SLEEP | STATUS1_POISON | STATUS1_BURN | STATUS1_FREEZE | STATUS1_PARALYSIS | STATUS1_TOXIC_POISON)
// Volatile status ailments
// These are removed after exiting the battle or switching out
-#define STATUS2_CONFUSION 0x00000007
-#define STATUS2_FLINCHED 0x00000008
-#define STATUS2_UPROAR 0x00000070
-#define STATUS2_BIDE 0x00000300 //two bits 0x100 0x200
-#define STATUS2_LOCK_CONFUSE 0x00000C00
-#define STATUS2_MULTIPLETURNS 0x00001000
-#define STATUS2_WRAPPED 0x0000E000
-#define STATUS2_INFATUATION 0x000F0000
+#define STATUS2_CONFUSION 0x00000007
+#define STATUS2_FLINCHED 0x00000008
+#define STATUS2_UPROAR 0x00000070
+#define STATUS2_BIDE 0x00000300 // two bits 0x100, 0x200
+#define STATUS2_LOCK_CONFUSE 0x00000C00
+#define STATUS2_MULTIPLETURNS 0x00001000
+#define STATUS2_WRAPPED 0x0000E000
+#define STATUS2_INFATUATION 0x000F0000 // 4 bits, one for every battler
#define STATUS2_INFATUATED_WITH(battler) (gBitTable[battler] << 16)
-#define STATUS2_FOCUS_ENERGY 0x00100000
-#define STATUS2_TRANSFORMED 0x00200000
-#define STATUS2_RECHARGE 0x00400000
-#define STATUS2_RAGE 0x00800000
-#define STATUS2_SUBSTITUTE 0x01000000
-#define STATUS2_DESTINY_BOND 0x02000000
-#define STATUS2_ESCAPE_PREVENTION 0x04000000
-#define STATUS2_NIGHTMARE 0x08000000
-#define STATUS2_CURSED 0x10000000
-#define STATUS2_FORESIGHT 0x20000000
-#define STATUS2_DEFENSE_CURL 0x40000000
-#define STATUS2_TORMENT 0x80000000
+#define STATUS2_FOCUS_ENERGY 0x00100000
+#define STATUS2_TRANSFORMED 0x00200000
+#define STATUS2_RECHARGE 0x00400000
+#define STATUS2_RAGE 0x00800000
+#define STATUS2_SUBSTITUTE 0x01000000
+#define STATUS2_DESTINY_BOND 0x02000000
+#define STATUS2_ESCAPE_PREVENTION 0x04000000
+#define STATUS2_NIGHTMARE 0x08000000
+#define STATUS2_CURSED 0x10000000
+#define STATUS2_FORESIGHT 0x20000000
+#define STATUS2_DEFENSE_CURL 0x40000000
+#define STATUS2_TORMENT 0x80000000
// Seems like per-battler statuses. Not quite sure how to categorize these
-#define STATUS3_LEECHSEED_BANK 0x3
+#define STATUS3_LEECHSEED_BATTLER 0x3
#define STATUS3_LEECHSEED 0x4
-#define STATUS3_ALWAYS_HITS 0x18 //two bits
+#define STATUS3_ALWAYS_HITS 0x18 // two bits
#define STATUS3_PERISH_SONG 0x20
#define STATUS3_ON_AIR 0x40
#define STATUS3_UNDERGROUND 0x80
#define STATUS3_MINIMIZED 0x100
#define STATUS3_ROOTED 0x400
#define STATUS3_CHARGED_UP 0x200
-#define STATUS3_YAWN 0x1800 //two bits
-#define STATUS3_IMPRISIONED 0x2000
+#define STATUS3_YAWN 0x1800 // two bits
+#define STATUS3_IMPRISONED_OTHERS 0x2000
#define STATUS3_GRUDGE 0x4000
#define STATUS3_CANT_SCORE_A_CRIT 0x8000
#define STATUS3_MUDSPORT 0x10000
@@ -131,7 +133,7 @@
#define STATUS3_UNDERWATER 0x40000
#define STATUS3_INTIMIDATE_POKES 0x80000
#define STATUS3_TRACE 0x100000
-#define STATUS3_SEMI_INVULNERABLE ((STATUS3_UNDERGROUND | STATUS3_ON_AIR | STATUS3_UNDERWATER))
+#define STATUS3_SEMI_INVULNERABLE (STATUS3_UNDERGROUND | STATUS3_ON_AIR | STATUS3_UNDERWATER)
// Not really sure what a "hitmarker" is.
#define HITMARKER_x10 0x00000010
@@ -142,7 +144,7 @@
#define HITMARKER_NO_ATTACKSTRING 0x00000200
#define HITMARKER_ATTACKSTRING_PRINTED 0x00000400
#define HITMARKER_NO_PPDEDUCT 0x00000800
-#define HITMARKER_PURSUIT_TRAP 0x00001000
+#define HITMARKER_SWAP_ATTACKER_TARGET 0x00001000
#define HITMARKER_IGNORE_SAFEGUARD 0x00002000
#define HITMARKER_SYNCHRONISE_EFFECT 0x00004000
#define HITMARKER_RUN 0x00008000
@@ -157,9 +159,9 @@
#define HITMARKER_GRUDGE 0x01000000
#define HITMARKER_OBEYS 0x02000000
#define HITMARKER_x4000000 0x04000000
-#define HITMARKER_x8000000 0x08000000
-#define HITMARKER_FAINTED(bank) ((gBitTable[bank] << 0x1C))
-#define HITMARKER_UNK(bank) ((0x10000000 << bank))
+#define HITMARKER_CHARGING 0x08000000
+#define HITMARKER_FAINTED(battler) (gBitTable[battler] << 0x1C)
+#define HITMARKER_UNK(battler) (0x10000000 << battler)
// Per-side statuses that affect an entire party
#define SIDE_STATUS_REFLECT (1 << 0)
@@ -235,7 +237,7 @@
#define MOVE_EFFECT_RAPIDSPIN 0x23
#define MOVE_EFFECT_REMOVE_PARALYSIS 0x24
#define MOVE_EFFECT_ATK_DEF_DOWN 0x25
-#define MOVE_EFFECT_RECOIL_33_PARALYSIS 0x26
+#define MOVE_EFFECT_RECOIL_33 0x26
#define MOVE_EFFECT_ATK_PLUS_2 0x27
#define MOVE_EFFECT_DEF_PLUS_2 0x28
#define MOVE_EFFECT_SPD_PLUS_2 0x29
@@ -322,9 +324,7 @@
#define ABILITYEFFECT_COUNT_ON_FIELD 0x12
#define ABILITYEFFECT_CHECK_ON_FIELD 0x13
-#define WEATHER_HAS_EFFECT ((!AbilityBattleEffects(ABILITYEFFECT_CHECK_ON_FIELD, 0, ABILITY_CLOUD_NINE, 0, 0) && !AbilityBattleEffects(ABILITYEFFECT_CHECK_ON_FIELD, 0, ABILITY_AIR_LOCK, 0, 0)))
-
-#define BS_GET_TARGET 0
+#define BS_TARGET 0
#define BS_GET_ATTACKER 1
#define BS_GET_EFFECT_BANK 2
#define BS_GET_gBank1 3