Skip to content

Commit

Permalink
Document battle script commands 0xA7 - 0xBA
Browse files Browse the repository at this point in the history
  • Loading branch information
lhearachel committed Nov 1, 2023
1 parent 4926316 commit c9f1f16
Show file tree
Hide file tree
Showing 15 changed files with 650 additions and 452 deletions.
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
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
41 changes: 38 additions & 3 deletions include/overlay016/ov16_0225177C.h
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,26 @@ BOOL BattleMove_IsMultiTurn(BattleContext * param0, int param1);
* entry falls outside the bounds of the table.
*/
BOOL BattleSystem_TypeMatchup(BattleSystem *battleSys, int idx, u8 *moveType, u8 *vsType, u8 *multi);
int ov16_022558CC(u8 param0, u8 param1, u8 param2);

/**
* @brief Determine the total multiplier classification to use for an attacking
* type against a pair of defending types.
*
* This routine centers 1x damage as a return value of 40. From there, the
* multiplier varies by powers of 2:
* - 1/4x -> 10
* - 1/2x -> 20
* - 1x -> 40
* - 2x -> 80
* - 4x -> 160
*
* @param attackingType
* @param defendingType1
* @param defendingType2
* @return The total multiplier of the attacking type against a defender with
* the pair of types.
*/
int BattleSystem_TypeMatchupMultiplier(u8 attackingType, u8 defendingType1, u8 defendingType2);

/**
* @brief Determines if a move is an invoker-class move.
Expand Down Expand Up @@ -556,8 +575,24 @@ enum HeldItemPowerOp {
* @return The power of the battler's held item.
*/
s32 Battler_HeldItemPower(BattleContext *battleCtx, int battler, enum HeldItemPowerOp opcode);
s32 ov16_02258B18(BattleContext * param0, int param1);
s32 ov16_02258B2C(BattleContext * param0, int param1);

/**
* @brief Get the Natural Gift base power for a battler's held item.
*
* @param battleCtx
* @param battler
* @return Base power for Natural Gift.
*/
s32 Battler_NaturalGiftPower(BattleContext *battleCtx, int battler);

/**
* @brief Get the Natural Gift type for a battler's held item.
*
* @param battleCtx
* @param battler
* @return Type for Natural Gift.
*/
s32 Battler_NaturalGiftType(BattleContext *battleCtx, int battler);

/**
* @brief Get the Pluck effect of the battler's held item.
Expand Down
8 changes: 4 additions & 4 deletions include/overlay016/ov16_0226485C.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ void ov16_02266460(BattleSystem * param0, int param1);
void BattleIO_StopGaugeAnimation(BattleSystem *battleSys, int battler);
void BattleIO_RefreshPartyStatus(BattleSystem * param0, BattleContext * param1, int param2, int param3);
void BattleIO_ForgetMove(BattleSystem * param0, int param1, int param2, int param3);
void ov16_022664F8(BattleSystem * param0, int param1, int param2, int param3);
void ov16_0226651C(BattleSystem * param0, int param1);
void ov16_022665AC(BattleSystem * param0, int param1);
void BattleIO_SetMosaic(BattleSystem * param0, int param1, int param2, int param3);
void BattleIO_ChangeWeatherForm(BattleSystem * param0, int param1);
void BattleIO_UpdateBG(BattleSystem * param0, int param1);
void BattleIO_ClearTouchScreen(BattleSystem * param0, int param1);
void ov16_022665E4(BattleSystem * param0, int param1);
void ov16_0226660C(BattleSystem * param0, int param1);
Expand All @@ -81,7 +81,7 @@ void ov16_022668D0(BattleSystem * param0);
void ov16_0226692C(BattleSystem * param0, BattleContext * param1, int param2);
void ov16_022669D8(BattleSystem * param0, BattleContext * param1, int param2);
void ov16_02266A18(BattleSystem * param0, int param1, int param2);
void ov16_02266A38(BattleSystem * param0);
void BattleIO_SubmitResult(BattleSystem * param0);
void BattleIO_ClearMessageBox(BattleSystem * param0);
void ov16_02266ABC(BattleSystem * param0, int param1, int param2);
BOOL ov16_02266AE4(BattleSystem * param0, void * param1);
Expand Down
2 changes: 1 addition & 1 deletion include/unk_02006224.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ void sub_020063C0(UnkStruct_0202CC84 * param0);
void sub_020063D4(u8 param0);
BOOL sub_020063E4(UnkStruct_0202CC84 * param0, u32 param1, int param2, int param3);
BOOL sub_02006438(UnkStruct_0202CC84 * param0, u32 param1, int param2, int param3, u8 param4);
int sub_02006494(UnkStruct_0202CC84 * param0);
int Sound_Chatter(UnkStruct_0202CC84 * param0);
BOOL sub_020064C8(int param0);

#endif // POKEPLATINUM_UNK_02006224_H
2 changes: 1 addition & 1 deletion src/overlay014/ov14_0221FC20.c
Original file line number Diff line number Diff line change
Expand Up @@ -3290,7 +3290,7 @@ static int ov14_0222327C (BattleSystem * param0, BattleContext * param1, int par

switch (param3) {
case 363:
v0 = ov16_02258B2C(param1, param2);
v0 = Battler_NaturalGiftType(param1, param2);
break;
case 449:
switch (Battler_HeldItemEffect(param1, param2)) {
Expand Down
Loading

0 comments on commit c9f1f16

Please sign in to comment.