summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMarco Willems (M17.1) <progreon@gmail.com>2017-12-31 13:16:44 +0100
committerMarco Willems (M17.1) <progreon@gmail.com>2017-12-31 13:16:44 +0100
commitd0ae8995292ce6483dc3fb656090425c4638bd4f (patch)
tree91015855cd1bc71bdf03b2806effae82ded2e0a3 /include
parentba5e6c8a32c617f0d70e62968bf13023d1e1ff5e (diff)
parent153ddde3b90c893b47d5c844b2a58c707038e6b4 (diff)
merged
Diffstat (limited to 'include')
-rw-r--r--include/battle.h241
-rw-r--r--include/battle_anim.h25
-rw-r--r--include/battle_interface.h2
-rw-r--r--include/constants/battle_constants.h239
-rw-r--r--include/contest.h4
-rw-r--r--include/field_fadetransition.h2
-rw-r--r--include/rom_8077ABC.h13
-rw-r--r--include/sprite.h2
8 files changed, 267 insertions, 261 deletions
diff --git a/include/battle.h b/include/battle.h
index dda71e562..0881cf82c 100644
--- a/include/battle.h
+++ b/include/battle.h
@@ -2,240 +2,7 @@
#define GUARD_BATTLE_H
#include "sprite.h"
-
-#define F_TARGET_SELECTED_POKEMON 0
-#define F_TARGET_SPECIAL (1 << 0)
-#define F_TARGET_UNK2 (1 << 1)
-#define F_TARGET_RANDOM (1 << 2)
-#define F_TARGET_BOTH_ENEMIES (1 << 3)
-#define F_TARGET_USER (1 << 4)
-#define F_TARGET_ALL_EXCEPT_USER (1 << 5)
-#define F_TARGET_ENEMY_SIDE (1 << 6)
-
-#define F_MAKES_CONTACT (1 << 0)
-#define F_AFFECTED_BY_PROTECT (1 << 1)
-#define F_AFFECTED_BY_MAGIC_COAT (1 << 2)
-#define F_AFFECTED_BY_SNATCH (1 << 3)
-#define F_MIRROR_MOVE_COMPATIBLE (1 << 4)
-#define F_AFFECTED_BY_KINGS_ROCK (1 << 5)
-
-#define BATTLE_TYPE_DOUBLE 0x0001
-#define BATTLE_TYPE_LINK 0x0002
-#define BATTLE_TYPE_WILD 0x0004
-#define BATTLE_TYPE_TRAINER 0x0008
-#define BATTLE_TYPE_FIRST_BATTLE 0x0010
-#define BATTLE_TYPE_20 0x0020
-#define BATTLE_TYPE_MULTI 0x0040
-#define BATTLE_TYPE_SAFARI 0x0080
-#define BATTLE_TYPE_BATTLE_TOWER 0x0100
-#define BATTLE_TYPE_WALLY_TUTORIAL 0x0200
-#define BATTLE_TYPE_ROAMER 0x0400
-#define BATTLE_TYPE_EREADER_TRAINER 0x0800
-#define BATTLE_TYPE_KYOGRE_GROUDON 0x1000
-#define BATTLE_TYPE_LEGENDARY 0x2000
-#define BATTLE_TYPE_REGI 0x4000
-
-#define BATTLE_TYPE_LINK_DOUBLE (BATTLE_TYPE_MULTI | BATTLE_TYPE_TRAINER | BATTLE_TYPE_LINK | BATTLE_TYPE_DOUBLE)
-
-#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_OPPONENT_TELEPORTED 0xA
-
-#define AI_ACTION_DONE 0x0001
-#define AI_ACTION_FLEE 0x0002
-#define AI_ACTION_WATCH 0x0004
-#define AI_ACTION_DO_NOT_ATTACK 0x0008
-#define AI_ACTION_UNK5 0x0010
-#define AI_ACTION_UNK6 0x0020
-#define AI_ACTION_UNK7 0x0040
-#define AI_ACTION_UNK8 0x0080
-
-#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 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_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 STATUS3_LEECHSEED_BANK 0x3
-#define STATUS3_LEECHSEED 0x4
-#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_GRUDGE 0x4000
-#define STATUS3_CANT_SCORE_A_CRIT 0x8000
-#define STATUS3_MUDSPORT 0x10000
-#define STATUS3_WATERSPORT 0x20000
-#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 HITMARKER_x20 0x00000020
-#define HITMARKER_DESTINYBOND 0x00000040
-#define HITMARKER_NO_ANIMATIONS 0x00000080
-#define HITMARKER_IGNORE_SUBSTITUTE 0x00000100
-#define HITMARKER_NO_ATTACKSTRING 0x00000200
-#define HITMARKER_ATTACKSTRING_PRINTED 0x00000400
-#define HITMARKER_NO_PPDEDUCT 0x00000800
-#define HITMARKER_PURSUIT_TRAP 0x00001000
-#define HITMARKER_IGNORE_SAFEGUARD 0x00002000
-#define HITMARKER_SYNCHRONISE_EFFECT 0x00004000
-#define HITMARKER_IGNORE_ON_AIR 0x00010000
-#define HITMARKER_IGNORE_UNDERGROUND 0x00020000
-#define HITMARKER_IGNORE_UNDERWATER 0x00040000
-#define HITMARKER_UNABLE_TO_USE_MOVE 0x00080000
-#define HITMARKER_x100000 0x00100000
-#define HITMARKER_x200000 0x00200000
-#define HITMARKER_x400000 0x00400000
-#define HITMARKER_x800000 0x00800000
-#define HITMARKER_GRUDGE 0x01000000
-#define HITMARKER_OBEYS 0x02000000
-#define HITMARKER_x8000000 0x08000000
-#define HITMARKER_FAINTED(bank) ((gBitTable[bank] << 0x1C))
-#define HITMARKER_UNK(bank) ((0x10000000 << bank))
-
-#define SIDE_STATUS_REFLECT (1 << 0)
-#define SIDE_STATUS_LIGHTSCREEN (1 << 1)
-#define SIDE_STATUS_X4 (1 << 2)
-#define SIDE_STATUS_SPIKES (1 << 4)
-#define SIDE_STATUS_SAFEGUARD (1 << 5)
-#define SIDE_STATUS_FUTUREATTACK (1 << 6)
-#define SIDE_STATUS_MIST (1 << 8)
-#define SIDE_STATUS_SPIKES_DAMAGED (1 << 9)
-
-#define ABILITYEFFECT_ON_SWITCHIN 0x0
-#define ABILITYEFFECT_ENDTURN 0x1
-#define ABILITYEFFECT_MOVES_BLOCK 0x2
-#define ABILITYEFFECT_ABSORBING 0x3
-#define ABILITYEFFECT_CONTACT 0x4
-#define ABILITYEFFECT_IMMUNITY 0x5
-#define ABILITYEFFECT_FORECAST 0x6
-#define ABILITYEFFECT_SYNCHRONIZE 0x7
-#define ABILITYEFFECT_ATK_SYNCHRONIZE 0x8
-#define ABILITYEFFECT_INTIMIDATE1 0x9
-#define ABILITYEFFECT_INTIMIDATE2 0xA
-#define ABILITYEFFECT_TRACE 0xB
-#define ABILITYEFFECT_CHECK_OTHER_SIDE 0xC
-#define ABILITYEFFECT_CHECK_BANK_SIDE 0xD
-#define ABILITYEFFECT_FIELD_SPORT 0xE
-#define ABILITYEFFECT_CHECK_FIELD_EXCEPT_BANK 0xF
-#define ABILITYEFFECT_COUNT_OTHER_SIZE 0x10
-#define ABILITYEFFECT_COUNT_BANK_SIDE 0x11
-#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 MOVESTATUS_MISSED (1 << 0)
-#define MOVESTATUS_SUPEREFFECTIVE (1 << 1)
-#define MOVESTATUS_NOTVERYEFFECTIVE (1 << 2)
-#define MOVESTATUS_NOTAFFECTED (1 << 3)
-#define MOVESTATUS_ONEHITKO (1 << 4)
-#define MOVESTATUS_FAILED (1 << 5)
-#define MOVESTATUS_ENDURED (1 << 6)
-#define MOVESTATUS_HUNGON (1 << 7)
-
-#define MOVESTATUS_NOEFFECT ((MOVESTATUS_MISSED | MOVESTATUS_NOTAFFECTED | MOVESTATUS_FAILED))
-
-#define MAX_TRAINER_ITEMS 4
-#define MAX_MON_MOVES 4
-#define MAX_BANKS_BATTLE 4
-
-#define WEATHER_RAIN_TEMPORARY (1 << 0)
-#define WEATHER_RAIN_DOWNPOUR (1 << 1)
-#define WEATHER_RAIN_PERMANENT (1 << 2)
-#define WEATHER_RAIN_ANY ((WEATHER_RAIN_TEMPORARY | WEATHER_RAIN_DOWNPOUR | WEATHER_RAIN_PERMANENT))
-#define WEATHER_SANDSTORM_TEMPORARY (1 << 3)
-#define WEATHER_SANDSTORM_PERMANENT (1 << 4)
-#define WEATHER_SANDSTORM_ANY ((WEATHER_SANDSTORM_TEMPORARY | WEATHER_SANDSTORM_PERMANENT))
-#define WEATHER_SUN_TEMPORARY (1 << 5)
-#define WEATHER_SUN_PERMANENT (1 << 6)
-#define WEATHER_SUN_ANY ((WEATHER_SUN_TEMPORARY | WEATHER_SUN_PERMANENT))
-#define WEATHER_HAIL (1 << 7)
-
-// status animation table
-#define B_ANIM_STATUS_PSN 0x0
-#define B_ANIM_STATUS_CONFUSION 0x1
-#define B_ANIM_STATUS_BRN 0x2
-#define B_ANIM_STATUS_INFATUATION 0x3
-#define B_ANIM_STATUS_SLP 0x4
-#define B_ANIM_STATUS_PRZ 0x5
-#define B_ANIM_STATUS_FRZ 0x6
-#define B_ANIM_STATUS_CURSED 0x7
-#define B_ANIM_STATUS_NIGHTMARE 0x8
-#define B_ANIM_STATUS_WRAPPED 0x9
-
-// general animation table
-#define B_ANIM_CASTFORM_CHANGE 0x0
-#define B_ANIM_STATS_CHANGE 0x1
-#define B_ANIM_SUBSTITUTE_FADE 0x2
-#define B_ANIM_SUBSTITUTE_APPEAR 0x3
-#define B_ANIM_POKEBLOCK_THROW 0x4
-#define B_ANIM_ITEM_KNOCKOFF 0x5
-#define B_ANIM_TURN_TRAP 0x6
-#define B_ANIM_ITEM_EFFECT 0x7
-#define B_ANIM_SMOKEBALL_ESCAPE 0x8
-#define B_ANIM_HANGED_ON 0x9
-#define B_ANIM_RAIN_CONTINUES 0xA
-#define B_ANIM_SUN_CONTINUES 0xB
-#define B_ANIM_SANDSTORM_CONTINUES 0xC
-#define B_ANIM_HAIL_CONTINUES 0xD
-#define B_ANIM_LEECH_SEED_DRAIN 0xE
-#define B_ANIM_MON_HIT 0xF
-#define B_ANIM_ITEM_STEAL 0x10
-#define B_ANIM_SNATCH_MOVE 0x11
-#define B_ANIM_FUTURE_SIGHT_HIT 0x12
-#define B_ANIM_DOOM_DESIRE_HIT 0x13
-#define B_ANIM_FOCUS_PUNCH_SET_UP 0x14
-#define B_ANIM_INGRAIN_HEAL 0x15
-#define B_ANIM_WISH_HEAL 0x16
-
-// special animation table
-#define B_ANIM_LVL_UP 0x0
-#define B_ANIM_SWITCH_OUT_PLAYER_MON 0x1
-#define B_ANIM_SWITCH_OUT_OPPONENT_MON 0x2
-#define B_ANIM_BALL_THROW 0x3
-#define B_ANIM_SAFARI_BALL_THROW 0x4
-#define B_ANIM_SUBSTITUTE_TO_MON 0x5
-#define B_ANIM_MON_TO_SUBSTITUTE 0x6
+#include "constants/battle_constants.h"
enum
{
@@ -312,7 +79,7 @@ struct BattleStruct /* 0x2000000 */
/*0x1600C*/ u8 cmd49StateTracker;
/*0x1600D*/ u8 unk1600D;
/*0x1600E*/ u8 turncountersTracker;
- /*0x1600F*/ u8 atk23StateTracker;
+ /*0x1600F*/ u8 getexpStateTracker;
/*0x16010*/ u8 moveTarget[4];
/*0x16014*/ u8 unk16014;
/*0x16015*/ u8 unk16015;
@@ -539,7 +306,7 @@ struct BattleStruct /* 0x2000000 */
struct DisableStruct
{
- /*0x00*/ u32 unk0;
+ /*0x00*/ u32 transformedMonPersonality;
/*0x04*/ u16 disabledMove;
/*0x06*/ u16 encoredMove;
/*0x08*/ u8 protectUses;
@@ -838,7 +605,7 @@ extern u8 gBattleTextBuff1[];
// asm/battle_1.o
void sub_800D6D4();
void sub_800D74C();
-void sub_800D7B8(void);
+void DrawMainBattleBackground(void);
void sub_800DAB8();
void sub_800DE30(u8);
void sub_800E23C();
diff --git a/include/battle_anim.h b/include/battle_anim.h
index 9decb8f95..d456950f6 100644
--- a/include/battle_anim.h
+++ b/include/battle_anim.h
@@ -9,6 +9,14 @@
#define REG_BG2CNT_BITFIELD REG_BGnCNT_BITFIELD(2)
#define REG_BG3CNT_BITFIELD REG_BGnCNT_BITFIELD(3)
+enum
+{
+ ANIM_BANK_ATTACKER,
+ ANIM_BANK_TARGET,
+ ANIM_BANK_ATK_PARTNER,
+ ANIM_BANK_DEF_PARTNER,
+};
+
struct BattleAnimBackground
{
void *image;
@@ -36,20 +44,21 @@ struct UnknownStruct3
extern void (*gAnimScriptCallback)(void);
extern u8 gAnimScriptActive;
-extern u8 gHappinessMoveAnim;
-extern u8 gUnknown_0202F7C4;
+extern u8 gAnimFriendship;
+extern u8 gAnimMoveTurn;
+extern struct DisableStruct *gAnimDisableStructPtr;
-void ExecuteMoveAnim(u16 move);
-void DoMoveAnim(const u8 *const moveAnims[], u16 b, u8 c);
+void DoMoveAnim(u16 move);
+void LaunchBattleAnimation(const u8 *const moveAnims[], u16 b, u8 c);
bool8 IsAnimBankSpriteVisible(u8 a);
void sub_8076034(u8, u8);
-bool8 NotInBattle(void);
-void battle_anim_clear_some_data(void);
-void move_anim_8072740(struct Sprite *sprite);
+bool8 IsContest(void);
+void ClearBattleAnimationVars(void);
+void DestroyAnimSprite(struct Sprite *sprite);
void DestroyAnimVisualTask(u8 task);
void DestroyAnimVisualTask(u8 task);
bool8 IsAnimBankSpriteVisible(u8);
-s8 sub_8076F98(s8 a);
+s8 BattleAnimAdjustPanning(s8 a);
void sub_80763FC(u16 a, u16 *b, u32 c, u8 d);
#endif
diff --git a/include/battle_interface.h b/include/battle_interface.h
index db41ee735..a3e00fd12 100644
--- a/include/battle_interface.h
+++ b/include/battle_interface.h
@@ -22,7 +22,7 @@ void sub_8043D84(u8, u8, u32, u32, u32);
void sub_8043DB0(u8);
void sub_8043DFC(u8);
void nullsub_11();
-void sub_8043EB4(u8);
+void UpdateOamPriorityInAllHealthboxes(u8);
void sub_8043F44(u8);
void sub_804454C(void);
u8 sub_8044804(u8, const struct BattleInterfaceStruct2 *, u8, u8);
diff --git a/include/constants/battle_constants.h b/include/constants/battle_constants.h
new file mode 100644
index 000000000..c61d54f76
--- /dev/null
+++ b/include/constants/battle_constants.h
@@ -0,0 +1,239 @@
+#ifndef GUARD_CONSTANTS_BATTLE_CONSTANTS_H
+#define GUARD_CONSTANTS_BATTLE_CONSTANTS_H
+
+#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 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_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 STATUS3_LEECHSEED_BANK 0x3
+#define STATUS3_LEECHSEED 0x4
+#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_GRUDGE 0x4000
+#define STATUS3_CANT_SCORE_A_CRIT 0x8000
+#define STATUS3_MUDSPORT 0x10000
+#define STATUS3_WATERSPORT 0x20000
+#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 HITMARKER_x10 0x00000010
+#define HITMARKER_x20 0x00000020
+#define HITMARKER_DESTINYBOND 0x00000040
+#define HITMARKER_NO_ANIMATIONS 0x00000080
+#define HITMARKER_IGNORE_SUBSTITUTE 0x00000100
+#define HITMARKER_NO_ATTACKSTRING 0x00000200
+#define HITMARKER_ATTACKSTRING_PRINTED 0x00000400
+#define HITMARKER_NO_PPDEDUCT 0x00000800
+#define HITMARKER_PURSUIT_TRAP 0x00001000
+#define HITMARKER_IGNORE_SAFEGUARD 0x00002000
+#define HITMARKER_SYNCHRONISE_EFFECT 0x00004000
+#define HITMARKER_IGNORE_ON_AIR 0x00010000
+#define HITMARKER_IGNORE_UNDERGROUND 0x00020000
+#define HITMARKER_IGNORE_UNDERWATER 0x00040000
+#define HITMARKER_UNABLE_TO_USE_MOVE 0x00080000
+#define HITMARKER_x100000 0x00100000
+#define HITMARKER_x200000 0x00200000
+#define HITMARKER_x400000 0x00400000
+#define HITMARKER_x800000 0x00800000
+#define HITMARKER_GRUDGE 0x01000000
+#define HITMARKER_OBEYS 0x02000000
+#define HITMARKER_x8000000 0x08000000
+#define HITMARKER_FAINTED(bank) ((gBitTable[bank] << 0x1C))
+#define HITMARKER_UNK(bank) ((0x10000000 << bank))
+
+#define MOVESTATUS_MISSED (1 << 0)
+#define MOVESTATUS_SUPEREFFECTIVE (1 << 1)
+#define MOVESTATUS_NOTVERYEFFECTIVE (1 << 2)
+#define MOVESTATUS_NOTAFFECTED (1 << 3)
+#define MOVESTATUS_ONEHITKO (1 << 4)
+#define MOVESTATUS_FAILED (1 << 5)
+#define MOVESTATUS_ENDURED (1 << 6)
+#define MOVESTATUS_HUNGON (1 << 7)
+
+#define BATTLE_TYPE_DOUBLE 0x0001
+#define BATTLE_TYPE_LINK 0x0002
+#define BATTLE_TYPE_WILD 0x0004
+#define BATTLE_TYPE_TRAINER 0x0008
+#define BATTLE_TYPE_FIRST_BATTLE 0x0010
+#define BATTLE_TYPE_20 0x0020
+#define BATTLE_TYPE_MULTI 0x0040
+#define BATTLE_TYPE_SAFARI 0x0080
+#define BATTLE_TYPE_BATTLE_TOWER 0x0100
+#define BATTLE_TYPE_WALLY_TUTORIAL 0x0200
+#define BATTLE_TYPE_ROAMER 0x0400
+#define BATTLE_TYPE_EREADER_TRAINER 0x0800
+#define BATTLE_TYPE_KYOGRE_GROUDON 0x1000
+#define BATTLE_TYPE_LEGENDARY 0x2000
+#define BATTLE_TYPE_REGI 0x4000
+#define BATTLE_TYPE_LINK_DOUBLE (BATTLE_TYPE_MULTI | BATTLE_TYPE_TRAINER | BATTLE_TYPE_LINK | BATTLE_TYPE_DOUBLE)
+
+#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 SIDE_STATUS_REFLECT (1 << 0)
+#define SIDE_STATUS_LIGHTSCREEN (1 << 1)
+#define SIDE_STATUS_X4 (1 << 2)
+#define SIDE_STATUS_SPIKES (1 << 4)
+#define SIDE_STATUS_SAFEGUARD (1 << 5)
+#define SIDE_STATUS_FUTUREATTACK (1 << 6)
+#define SIDE_STATUS_MIST (1 << 8)
+#define SIDE_STATUS_SPIKES_DAMAGED (1 << 9)
+
+#define TARGET_SELECTED_POKEMON 0
+#define TARGET_SPECIAL (1 << 0)
+#define TARGET_UNK2 (1 << 1)
+#define TARGET_RANDOM (1 << 2)
+#define TARGET_BOTH_ENEMIES (1 << 3)
+#define TARGET_USER (1 << 4)
+#define TARGET_ALL_EXCEPT_USER (1 << 5)
+#define TARGET_ENEMY_SIDE (1 << 6)
+
+#define F_MAKES_CONTACT (1 << 0)
+#define F_AFFECTED_BY_PROTECT (1 << 1)
+#define F_AFFECTED_BY_MAGIC_COAT (1 << 2)
+#define F_AFFECTED_BY_SNATCH (1 << 3)
+#define F_MIRROR_MOVE_COMPATIBLE (1 << 4)
+#define F_AFFECTED_BY_KINGS_ROCK (1 << 5)
+
+#define AI_ACTION_DONE 0x0001
+#define AI_ACTION_FLEE 0x0002
+#define AI_ACTION_WATCH 0x0004
+#define AI_ACTION_DO_NOT_ATTACK 0x0008
+#define AI_ACTION_UNK5 0x0010
+#define AI_ACTION_UNK6 0x0020
+#define AI_ACTION_UNK7 0x0040
+#define AI_ACTION_UNK8 0x0080
+
+#define ABILITYEFFECT_ON_SWITCHIN 0x0
+#define ABILITYEFFECT_ENDTURN 0x1
+#define ABILITYEFFECT_MOVES_BLOCK 0x2
+#define ABILITYEFFECT_ABSORBING 0x3
+#define ABILITYEFFECT_CONTACT 0x4
+#define ABILITYEFFECT_IMMUNITY 0x5
+#define ABILITYEFFECT_FORECAST 0x6
+#define ABILITYEFFECT_SYNCHRONIZE 0x7
+#define ABILITYEFFECT_ATK_SYNCHRONIZE 0x8
+#define ABILITYEFFECT_INTIMIDATE1 0x9
+#define ABILITYEFFECT_INTIMIDATE2 0xA
+#define ABILITYEFFECT_TRACE 0xB
+#define ABILITYEFFECT_CHECK_OTHER_SIDE 0xC
+#define ABILITYEFFECT_CHECK_BANK_SIDE 0xD
+#define ABILITYEFFECT_FIELD_SPORT 0xE
+#define ABILITYEFFECT_CHECK_FIELD_EXCEPT_BANK 0xF
+#define ABILITYEFFECT_COUNT_OTHER_SIZE 0x10
+#define ABILITYEFFECT_COUNT_BANK_SIDE 0x11
+#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 MOVESTATUS_NOEFFECT ((MOVESTATUS_MISSED | MOVESTATUS_NOTAFFECTED | MOVESTATUS_FAILED))
+
+#define MAX_TRAINER_ITEMS 4
+#define MAX_MON_MOVES 4
+#define MAX_BANKS_BATTLE 4
+
+#define WEATHER_RAIN_TEMPORARY (1 << 0)
+#define WEATHER_RAIN_DOWNPOUR (1 << 1)
+#define WEATHER_RAIN_PERMANENT (1 << 2)
+#define WEATHER_RAIN_ANY ((WEATHER_RAIN_TEMPORARY | WEATHER_RAIN_DOWNPOUR | WEATHER_RAIN_PERMANENT))
+#define WEATHER_SANDSTORM_TEMPORARY (1 << 3)
+#define WEATHER_SANDSTORM_PERMANENT (1 << 4)
+#define WEATHER_SANDSTORM_ANY ((WEATHER_SANDSTORM_TEMPORARY | WEATHER_SANDSTORM_PERMANENT))
+#define WEATHER_SUN_TEMPORARY (1 << 5)
+#define WEATHER_SUN_PERMANENT (1 << 6)
+#define WEATHER_SUN_ANY ((WEATHER_SUN_TEMPORARY | WEATHER_SUN_PERMANENT))
+#define WEATHER_HAIL (1 << 7)
+
+// status animation table
+#define B_ANIM_STATUS_PSN 0x0
+#define B_ANIM_STATUS_CONFUSION 0x1
+#define B_ANIM_STATUS_BRN 0x2
+#define B_ANIM_STATUS_INFATUATION 0x3
+#define B_ANIM_STATUS_SLP 0x4
+#define B_ANIM_STATUS_PRZ 0x5
+#define B_ANIM_STATUS_FRZ 0x6
+#define B_ANIM_STATUS_CURSED 0x7
+#define B_ANIM_STATUS_NIGHTMARE 0x8
+#define B_ANIM_STATUS_WRAPPED 0x9
+
+// general animation table
+#define B_ANIM_CASTFORM_CHANGE 0x0
+#define B_ANIM_STATS_CHANGE 0x1
+#define B_ANIM_SUBSTITUTE_FADE 0x2
+#define B_ANIM_SUBSTITUTE_APPEAR 0x3
+#define B_ANIM_POKEBLOCK_THROW 0x4
+#define B_ANIM_ITEM_KNOCKOFF 0x5
+#define B_ANIM_TURN_TRAP 0x6
+#define B_ANIM_ITEM_EFFECT 0x7
+#define B_ANIM_SMOKEBALL_ESCAPE 0x8
+#define B_ANIM_HANGED_ON 0x9
+#define B_ANIM_RAIN_CONTINUES 0xA
+#define B_ANIM_SUN_CONTINUES 0xB
+#define B_ANIM_SANDSTORM_CONTINUES 0xC
+#define B_ANIM_HAIL_CONTINUES 0xD
+#define B_ANIM_LEECH_SEED_DRAIN 0xE
+#define B_ANIM_MON_HIT 0xF
+#define B_ANIM_ITEM_STEAL 0x10
+#define B_ANIM_SNATCH_MOVE 0x11
+#define B_ANIM_FUTURE_SIGHT_HIT 0x12
+#define B_ANIM_DOOM_DESIRE_HIT 0x13
+#define B_ANIM_FOCUS_PUNCH_SET_UP 0x14
+#define B_ANIM_INGRAIN_HEAL 0x15
+#define B_ANIM_WISH_HEAL 0x16
+
+// special animation table
+#define B_ANIM_LVL_UP 0x0
+#define B_ANIM_SWITCH_OUT_PLAYER_MON 0x1
+#define B_ANIM_SWITCH_OUT_OPPONENT_MON 0x2
+#define B_ANIM_BALL_THROW 0x3
+#define B_ANIM_SAFARI_BALL_THROW 0x4
+#define B_ANIM_SUBSTITUTE_TO_MON 0x5
+#define B_ANIM_MON_TO_SUBSTITUTE 0x6
+
+#endif // GUARD_CONSTANTS_BATTLE_CONSTANTS_H
diff --git a/include/contest.h b/include/contest.h
index ae2767aef..10392c00e 100644
--- a/include/contest.h
+++ b/include/contest.h
@@ -73,14 +73,14 @@ extern const struct ContestEffect gContestEffects[];
extern const u8 *const gContestEffectStrings[];
void ResetLinkContestBoolean(void);
-void sub_80AB2AC(void);
+void LoadContestBgAfterMoveAnim(void);
void CB2_StartContest(void);
void Contest_CreatePlayerMon(u8);
void Contest_InitAllPokemon(u8, u8);
u8 sub_80AE47C(struct Pokemon *party);
u16 sub_80AE770(u8, u8);
void sub_80AE82C(u8);
-u8 sub_80AEB1C(u16);
+u8 IsSpeciesNotUnown(u16);
void sub_80AF668(void);
void sub_80B0F28(u8);
bool8 Contest_SaveWinner(u8);
diff --git a/include/field_fadetransition.h b/include/field_fadetransition.h
index 111dc92a6..4377367f7 100644
--- a/include/field_fadetransition.h
+++ b/include/field_fadetransition.h
@@ -13,7 +13,7 @@ void sub_8080A3C(void);
void sub_8080AC4(void);
void mapldr_default();
void sub_8080B60(void);
-void atk17_seteffectuser(void);
+void atk17_seteffectsecondary(void);
void sub_8080E28(void);
void sub_8080E44(void);
bool32 sub_8080E70(void);
diff --git a/include/rom_8077ABC.h b/include/rom_8077ABC.h
index 70fd15e93..02023a215 100644
--- a/include/rom_8077ABC.h
+++ b/include/rom_8077ABC.h
@@ -4,21 +4,13 @@
#include "sprite.h"
#include "task.h"
-enum
-{
- ANIM_BANK_ATK,
- ANIM_BANK_DEF,
- ANIM_BANK_ATK_PARTNER,
- ANIM_BANK_DEF_PARTNER
-};
-
struct Struct_sub_8078914 {
u8 *field_0;
u8 *field_4;
u8 field_8;
};
-u8 sub_8077ABC(u8, u8);
+u8 GetBankPosition(u8, u8);
u8 sub_8077E44(u8 slot, u16 species, u8 a3);
u8 GetAnimBankSpriteId(u8 side);
void StoreSpriteCallbackInData(struct Sprite *sprite, void(*callback)(struct Sprite *));
@@ -36,8 +28,7 @@ u8 GetBankIdentity(u8 slot);
u8 GetBankByPlayerAI(u8);
u8 GetBankByPlayerAI(u8);
u8 GetBankByPlayerAI(u8 state);
-u8 AnimBankSpriteExists(u8);
-bool8 AnimBankSpriteExists(u8);
+bool8 IsBankSpritePresent(u8);
bool8 IsDoubleBattle();
u8 IsDoubleBattle(void);
bool8 IsDoubleBattle(void);
diff --git a/include/sprite.h b/include/sprite.h
index 9937a0797..13c76c84b 100644
--- a/include/sprite.h
+++ b/include/sprite.h
@@ -246,7 +246,7 @@ void BuildOamBuffer(void);
u8 CreateSprite(const struct SpriteTemplate *template, s16 x, s16 y, u8 subpriority);
u8 CreateSpriteAtEnd(const struct SpriteTemplate *template, s16 x, s16 y, u8 subpriority);
u8 CreateInvisibleSprite(void (*callback)(struct Sprite *));
-u8 CreateSpriteAndAnimate(struct SpriteTemplate *template, s16 x, s16 y, u8 subpriority);
+u8 CreateSpriteAndAnimate(const struct SpriteTemplate *template, s16 x, s16 y, u8 subpriority);
void DestroySprite(struct Sprite *sprite);
void ResetOamRange(u8 a, u8 b);
void LoadOam(void);