Skip to content

Commit

Permalink
Merge pull request #99 from lhearachel/battle-dev
Browse files Browse the repository at this point in the history
Document battle script commands 0x90 - 0xBA
  • Loading branch information
lhearachel authored Nov 1, 2023
2 parents 63ae021 + c9f1f16 commit d2df666
Show file tree
Hide file tree
Showing 21 changed files with 2,270 additions and 1,526 deletions.
31 changes: 28 additions & 3 deletions include/battle/btlcmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ enum OpCode {
VALOP_AND,
};

enum CheckAbilityOp {
CHECK_ABILITY_HAVE,
CHECK_ABILITY_NONE,
enum CheckHaveOp {
CHECK_HAVE,
CHECK_NOT_HAVE,
};

enum StatusEffect {
Expand Down Expand Up @@ -161,5 +161,30 @@ enum MessageStatusCondition {
MSGCOND_INFATUATION,
};

enum TurnFlag {
TURN_FLAG_STRUGGLING = 0,
TURN_FLAG_PP_DECREMENTED,
TURN_FLAG_PROTECTING,
TURN_FLAG_HELPING_HAND,
TURN_FLAG_MAGIC_COAT,
TURN_FLAG_SNATCHING,
TURN_FLAG_ROOSTING,
};

enum CheckSideConditionOp {
CHECK_SIDE_COND_VAL_ZERO = 0,
CHECK_SIDE_COND_VAL_NOT_ZERO,
CHECK_SIDE_COND_CLEAR,
};

enum SideCondition {
SIDE_COND_REFLECT_TURNS = 0,
SIDE_COND_LIGHT_SCREEN_TURNS,
SIDE_COND_MIST_TURNS,
SIDE_COND_SAFEGUARD_TURNS,
SIDE_COND_SPIKES_LAYERS,
SIDE_COND_TOXIC_SPIKES_LAYERS,
};

#endif // POKEPLATINUM_BATTLE_BTLCMD_H

1 change: 1 addition & 0 deletions include/battle/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#define ATTACKER_MOVE_SLOT (battleCtx->moveSlot[battleCtx->attacker])
#define ATTACKER_ACTION (battleCtx->battlerActions[battleCtx->attacker])
#define DEFENDER_ACTION (battleCtx->battlerActions[battleCtx->defender])

#define ATTACKER_TURN_FLAGS (battleCtx->turnFlags[battleCtx->attacker])
#define DEFENDER_TURN_FLAGS (battleCtx->turnFlags[battleCtx->defender])
Expand Down
6 changes: 6 additions & 0 deletions include/constants/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@
#define TYPE_MULTI_NOT_VERY_EFF 5
#define TYPE_MULTI_SUPER_EFF 20

#define TYPE_MULTI_QUARTER_DAMAGE 10
#define TYPE_MULTI_HALF_DAMAGE 20
#define TYPE_MULTI_BASE_DAMAGE 40
#define TYPE_MULTI_DOUBLE_DAMAGE 80
#define TYPE_MULTI_QUADRUPLE_DAMAGE 160

#define SOUNDPROOF_SLOT_1 (1 << 0)
#define SOUNDPROOF_SLOT_2 (1 << 1)
#define NO_PARTNER_SLOT_1 (1 << 2)
Expand Down
4 changes: 4 additions & 0 deletions include/constants/battle/side_effects.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#ifndef POKEPLATINUM_CONSTANTS_BATTLE_SIDE_EFFECTS_H
#define POKEPLATINUM_CONSTANTS_BATTLE_SIDE_EFFECTS_H

#define MOVE_SIDE_EFFECT_SLEEP 0x00000001
#define MOVE_SIDE_EFFECT_FREEZE 0x00000004
#define MOVE_SIDE_EFFECT_PARALYZE 0x00000005
#define MOVE_SIDE_EFFECT_FLINCH 0x00000008
#define MOVE_SIDE_EFFECT_ATTACK_UP_1_STAGE 0x0000000F
#define MOVE_SIDE_EFFECT_DEFENSE_UP_1_STAGE 0x00000010
#define MOVE_SIDE_EFFECT_SPEED_UP_1_STAGE 0x00000011
Expand Down
3 changes: 2 additions & 1 deletion include/constants/battle/terrain.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ enum Terrain {
TERRAIN_BUILDING,
TERRAIN_GREAT_MARSH,
TERRAIN_BRIDGE,
TERRAIN_SPECIAL,

TERRAIN_AARON,
TERRAIN_AARON = TERRAIN_SPECIAL,
TERRAIN_BERTHA,
TERRAIN_FLINT,
TERRAIN_LUCIAN,
Expand Down
14 changes: 14 additions & 0 deletions include/constants/flavor.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#ifndef POKEPLATINUM_CONSTANTS_FLAVOR_H
#define POKEPLATINUM_CONSTANTS_FLAVOR_H

enum {
FLAVOR_SPICY = 0,
FLAVOR_DRY,
FLAVOR_SWEET,
FLAVOR_BITTER,
FLAVOR_SOUR,

FLAVOR_MAX,
};

#endif // POKEPLATINUM_CONSTANTS_FLAVOR_H
57 changes: 57 additions & 0 deletions include/constants/items.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,63 @@ enum {
#define HOLD_EFFECT_EVOLVE_PORYGON2 145
#define HOLD_EFFECT_EVOLVE_DUSCLOPS 146

#define FLING_EFFECT_NONE 0
#define FLING_EFFECT_PRZ_RESTORE 1
#define FLING_EFFECT_SLP_RESTORE 2
#define FLING_EFFECT_PSN_RESTORE 3
#define FLING_EFFECT_BRN_RESTORE 4
#define FLING_EFFECT_FRZ_RESTORE 5
#define FLING_EFFECT_PP_RESTORE 6
#define FLING_EFFECT_HP_RESTORE 7
#define FLING_EFFECT_CNF_RESTORE 8
#define FLING_EFFECT_ALL_RESTORE 9
#define FLING_EFFECT_HP_PCT_RESTORE 10
#define FLING_EFFECT_HP_RESTORE_SPICY 11
#define FLING_EFFECT_HP_RESTORE_DRY 12
#define FLING_EFFECT_HP_RESTORE_SWEET 13
#define FLING_EFFECT_HP_RESTORE_BITTER 14
#define FLING_EFFECT_HP_RESTORE_SOUR 15
#define FLING_EFFECT_ATK_UP 16
#define FLING_EFFECT_DEF_UP 17
#define FLING_EFFECT_SPEED_UP 18
#define FLING_EFFECT_SPATK_UP 19
#define FLING_EFFECT_SPDEF_UP 20
#define FLING_EFFECT_CRIT_UP 21
#define FLING_EFFECT_RANDOM_UP2 22
#define FLING_EFFECT_TEMP_ACC_UP 23
#define FLING_EFFECT_STATDOWN_RESTORE 24
#define FLING_EFFECT_HEAL_INFATUATION 25
#define FLING_EFFECT_FLINCH 26
#define FLING_EFFECT_PARALYZE 27
#define FLING_EFFECT_POISON 28
#define FLING_EFFECT_BADLY_POISON 29
#define FLING_EFFECT_BURN 30

#define PLUCK_EFFECT_NONE 0
#define PLUCK_EFFECT_PRZ_RESTORE 1
#define PLUCK_EFFECT_SLP_RESTORE 2
#define PLUCK_EFFECT_PSN_RESTORE 3
#define PLUCK_EFFECT_BRN_RESTORE 4
#define PLUCK_EFFECT_FRZ_RESTORE 5
#define PLUCK_EFFECT_PP_RESTORE 6
#define PLUCK_EFFECT_HP_RESTORE 7
#define PLUCK_EFFECT_CNF_RESTORE 8
#define PLUCK_EFFECT_ALL_RESTORE 9
#define PLUCK_EFFECT_HP_PCT_RESTORE 10
#define PLUCK_EFFECT_HP_RESTORE_SPICY 11
#define PLUCK_EFFECT_HP_RESTORE_DRY 12
#define PLUCK_EFFECT_HP_RESTORE_SWEET 13
#define PLUCK_EFFECT_HP_RESTORE_BITTER 14
#define PLUCK_EFFECT_HP_RESTORE_SOUR 15
#define PLUCK_EFFECT_ATK_UP 16
#define PLUCK_EFFECT_DEF_UP 17
#define PLUCK_EFFECT_SPEED_UP 18
#define PLUCK_EFFECT_SPATK_UP 19
#define PLUCK_EFFECT_SPDEF_UP 20
#define PLUCK_EFFECT_CRIT_UP 21
#define PLUCK_EFFECT_RANDOM_UP2 22
#define PLUCK_EFFECT_TEMP_ACC_UP 23

#define ITEM_NONE 0

// Balls
Expand Down
24 changes: 20 additions & 4 deletions include/constants/narc_files/battle_skill_subseq.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ enum NARCFilesBattleSubSeq {
BATTLE_SUBSEQ_TRAINER_MESSAGE,
BATTLE_SUBSEQ_NO_PP,

BATTLE_SUBSEQ_BADLY_POISON = 47,

BATTLE_SUBSEQ_MOVE_EFFECT_END = 50,
BATTLE_SUBSEQ_THRASH_END,

Expand Down Expand Up @@ -108,9 +110,22 @@ enum NARCFilesBattleSubSeq {

BATTLE_SUBSEQ_AFTERMATH = 193,

BATTLE_SUBSEQ_HELD_ITEM_RESTORE_HP = 198,

BATTLE_SUBSEQ_RESTORE_A_LITTLE_HP = 213,
BATTLE_SUBSEQ_HELD_ITEM_HP_RESTORE = 198,
BATTLE_SUBSEQ_HELD_ITEM_PRZ_RESTORE,
BATTLE_SUBSEQ_HELD_ITEM_SLP_RESTORE,
BATTLE_SUBSEQ_HELD_ITEM_PSN_RESTORE,
BATTLE_SUBSEQ_HELD_ITEM_BRN_RESTORE,
BATTLE_SUBSEQ_HELD_ITEM_FRZ_RESTORE,
BATTLE_SUBSEQ_HELD_ITEM_PP_RESTORE,
BATTLE_SUBSEQ_HELD_ITEM_CNF_RESTORE,
BATTLE_SUBSEQ_HELD_ITEM_MULTI_RESTORE,
BATTLE_SUBSEQ_HELD_ITEM_DISLIKE_FLAVOR,
BATTLE_SUBSEQ_HELD_ITEM_RAISE_STAT,
BATTLE_SUBSEQ_HELD_ITEM_RAISE_CRIT,
BATTLE_SUBSEQ_HELD_ITEM_SHARPLY_RAISE_STAT,
BATTLE_SUBSEQ_HELD_ITEM_STATDOWN_RESTORE,
BATTLE_SUBSEQ_HELD_ITEM_HEAL_INFATUATION,
BATTLE_SUBSEQ_RESTORE_A_LITTLE_HP,
BATTLE_SUBSEQ_LOSE_HP_FROM_ITEM,

BATTLE_SUBSEQ_TRANSFER_STICKY_BARB = 216,
Expand Down Expand Up @@ -149,7 +164,8 @@ enum NARCFilesBattleSubSeq {

BATTLE_SUBSEQ_BAD_DREAMS = 263,

BATTLE_SUBSEQ_HELD_ITEM_RECOIL_WHEN_HIT = 266,
BATTLE_SUBSEQ_HELD_ITEM_TEMP_ACC_UP = 265,
BATTLE_SUBSEQ_HELD_ITEM_RECOIL_WHEN_HIT,
BATTLE_SUBSEQ_USE_POTION,
BATTLE_SUBSEQ_USE_STATUS_RECOVERY,
BATTLE_SUBSEQ_USE_STAT_BOOSTER,
Expand Down
4 changes: 2 additions & 2 deletions include/overlay016/ov16_0223DF00.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ int ov16_0223EDE0(BattleSystem * param0);
u8 BattleSystem_TextSpeed(BattleSystem * param0);
int BattleSystem_Ruleset(BattleSystem * param0);
UnkStruct_02015F84 * ov16_0223EE28(BattleSystem * param0);
UnkStruct_0202CC84 * ov16_0223EE30(BattleSystem * param0, int param1);
UnkStruct_0202CC84 * BattleSystem_ChatotVoice(BattleSystem * param0, int param1);
void ov16_0223EE70(BattleSystem * param0);
void ov16_0223EF2C(BattleSystem * param0, int param1, int param2);
void ov16_0223EF48(BattleSystem * param0, Pokemon * param1);
Expand Down Expand Up @@ -243,7 +243,7 @@ u32 ov16_0223F710(BattleSystem * param0);
void BattleSystem_SetStopRecording(BattleSystem *battleSys, int flag);
BOOL ov16_0223F7A4(BattleSystem * param0);
void BattleSystem_ShowStopPlaybackButton(BattleSystem *battleSys);
u8 ov16_0223F810(BattleSystem * param0, int param1);
u8 BattleSystem_RecordedChatter(BattleSystem * param0, int param1);
void ov16_0223F858(BattleSystem * param0, u8 * param1);
void ov16_0223F87C(BattleSystem * param0, u8 * param1);
void ov16_0223F8AC(BattleSystem * param0, UnkStruct_02007C7C ** param1);
Expand Down
Loading

0 comments on commit d2df666

Please sign in to comment.