clean up
This commit is contained in:
@@ -842,7 +842,7 @@ EventScript_1A4EAF:: @ 81A4EAF
|
|||||||
|
|
||||||
gUnknown_81A4EB4:: @ 81A4EB4
|
gUnknown_81A4EB4:: @ 81A4EB4
|
||||||
lock
|
lock
|
||||||
special SetUpTrainerEncounterMusic
|
special PlayTrainerEncounterMusic
|
||||||
special ScrSpecial_EndTrainerApproach
|
special ScrSpecial_EndTrainerApproach
|
||||||
waitstate
|
waitstate
|
||||||
goto EventScript_1A4FC7
|
goto EventScript_1A4FC7
|
||||||
@@ -852,10 +852,10 @@ EventScript_TryDoNormalTrainerBattle:: @ 81A4EC1
|
|||||||
faceplayer
|
faceplayer
|
||||||
applymovement VAR_LAST_TALKED, Movement_1A4FC5
|
applymovement VAR_LAST_TALKED, Movement_1A4FC5
|
||||||
waitmovement 0
|
waitmovement 0
|
||||||
specialvar VAR_RESULT, GetTrainerFlag
|
specialvar VAR_RESULT, ScrSpecial_HasTrainerBeenFought
|
||||||
compare_var_to_value VAR_RESULT, 0
|
compare_var_to_value VAR_RESULT, 0
|
||||||
goto_if ne, EventScript_1A4EE8
|
goto_if ne, EventScript_1A4EE8
|
||||||
special SetUpTrainerEncounterMusic
|
special PlayTrainerEncounterMusic
|
||||||
special SetUpTrainerMovement
|
special SetUpTrainerMovement
|
||||||
goto EventScript_1A4FC7
|
goto EventScript_1A4FC7
|
||||||
|
|
||||||
@@ -866,13 +866,13 @@ EventScript_TryDoDoubleTrainerBattle:: @ 81A4EE9
|
|||||||
lock
|
lock
|
||||||
faceplayer
|
faceplayer
|
||||||
call EventScript_1A4FBA
|
call EventScript_1A4FBA
|
||||||
specialvar VAR_RESULT, GetTrainerFlag
|
specialvar VAR_RESULT, ScrSpecial_HasTrainerBeenFought
|
||||||
compare_var_to_value VAR_RESULT, 0
|
compare_var_to_value VAR_RESULT, 0
|
||||||
goto_if ne, EventScript_1A4F20
|
goto_if ne, EventScript_1A4F20
|
||||||
special CheckForAlivePartyMons
|
special CheckForAlivePartyMons
|
||||||
compare_var_to_value VAR_RESULT, 0
|
compare_var_to_value VAR_RESULT, 0
|
||||||
goto_if ne, EventScript_1A4F19
|
goto_if ne, EventScript_1A4F19
|
||||||
special SetUpTrainerEncounterMusic
|
special PlayTrainerEncounterMusic
|
||||||
special SetUpTrainerMovement
|
special SetUpTrainerMovement
|
||||||
goto EventScript_1A4FC7
|
goto EventScript_1A4FC7
|
||||||
|
|
||||||
@@ -889,7 +889,7 @@ EventScript_1A4F20:: @ 81A4F20
|
|||||||
EventScript_DoTrainerBattle:: @ 81A4F21
|
EventScript_DoTrainerBattle:: @ 81A4F21
|
||||||
applymovement VAR_LAST_TALKED, Movement_1A4FC5
|
applymovement VAR_LAST_TALKED, Movement_1A4FC5
|
||||||
waitmovement 0
|
waitmovement 0
|
||||||
special SetUpTrainerEncounterMusic
|
special PlayTrainerEncounterMusic
|
||||||
special sub_8110AB4
|
special sub_8110AB4
|
||||||
compare_var_to_value VAR_RESULT, 2
|
compare_var_to_value VAR_RESULT, 2
|
||||||
goto_if eq, EventScript_1A501A
|
goto_if eq, EventScript_1A501A
|
||||||
@@ -901,7 +901,7 @@ EventScript_TryDoRematchBattle:: @ 81A4F3E
|
|||||||
specialvar VAR_RESULT, ScrSpecial_GetTrainerEyeRematchFlag
|
specialvar VAR_RESULT, ScrSpecial_GetTrainerEyeRematchFlag
|
||||||
compare_var_to_value VAR_RESULT, 0
|
compare_var_to_value VAR_RESULT, 0
|
||||||
goto_if eq, EventScript_1A4F72
|
goto_if eq, EventScript_1A4F72
|
||||||
special SetUpTrainerEncounterMusic
|
special PlayTrainerEncounterMusic
|
||||||
special SetUpTrainerMovement
|
special SetUpTrainerMovement
|
||||||
special ScrSpecial_ShowTrainerIntroSpeech
|
special ScrSpecial_ShowTrainerIntroSpeech
|
||||||
waitmessage
|
waitmessage
|
||||||
@@ -924,7 +924,7 @@ EventScript_TryDoDoubleRematchBattle:: @ 81A4F73
|
|||||||
special CheckForAlivePartyMons
|
special CheckForAlivePartyMons
|
||||||
compare_var_to_value VAR_RESULT, 0
|
compare_var_to_value VAR_RESULT, 0
|
||||||
goto_if ne, EventScript_1A4FB1
|
goto_if ne, EventScript_1A4FB1
|
||||||
special SetUpTrainerEncounterMusic
|
special PlayTrainerEncounterMusic
|
||||||
special SetUpTrainerMovement
|
special SetUpTrainerMovement
|
||||||
special ScrSpecial_ShowTrainerIntroSpeech
|
special ScrSpecial_ShowTrainerIntroSpeech
|
||||||
waitmessage
|
waitmessage
|
||||||
|
|||||||
+2
-2
@@ -62,9 +62,9 @@ gSpecials:: @ 815FD60
|
|||||||
def_special ScrSpecial_GetTrainerBattleMode
|
def_special ScrSpecial_GetTrainerBattleMode
|
||||||
def_special ScrSpecial_ShowTrainerIntroSpeech
|
def_special ScrSpecial_ShowTrainerIntroSpeech
|
||||||
def_special ScrSpecial_ShowTrainerNonBattlingSpeech
|
def_special ScrSpecial_ShowTrainerNonBattlingSpeech
|
||||||
def_special GetTrainerFlag
|
def_special ScrSpecial_HasTrainerBeenFought
|
||||||
def_special ScrSpecial_EndTrainerApproach
|
def_special ScrSpecial_EndTrainerApproach
|
||||||
def_special SetUpTrainerEncounterMusic
|
def_special PlayTrainerEncounterMusic
|
||||||
def_special ShouldTryRematchBattle
|
def_special ShouldTryRematchBattle
|
||||||
def_special ScrSpecial_GetTrainerEyeRematchFlag
|
def_special ScrSpecial_GetTrainerEyeRematchFlag
|
||||||
def_special ScrSpecial_StartTrainerEyeRematch
|
def_special ScrSpecial_StartTrainerEyeRematch
|
||||||
|
|||||||
+1
-210
@@ -18,14 +18,6 @@
|
|||||||
0x2 bit is responsible for the id of sent out pokemon. 0 means it's the first sent out pokemon, 1 it's the second one. (Triple battle didn't exist at the time yet.)
|
0x2 bit is responsible for the id of sent out pokemon. 0 means it's the first sent out pokemon, 1 it's the second one. (Triple battle didn't exist at the time yet.)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define IDENTITY_PLAYER_MON1 0
|
|
||||||
#define IDENTITY_OPPONENT_MON1 1
|
|
||||||
#define IDENTITY_PLAYER_MON2 2
|
|
||||||
#define IDENTITY_OPPONENT_MON2 3
|
|
||||||
|
|
||||||
#define SIDE_PLAYER 0x0
|
|
||||||
#define SIDE_OPPONENT 0x1
|
|
||||||
|
|
||||||
#define GET_BATTLER_POSITION(battler)((gBattlerPositions[battler]))
|
#define GET_BATTLER_POSITION(battler)((gBattlerPositions[battler]))
|
||||||
#define GET_BATTLER_SIDE(battler)((GetBattlerPosition(battler) & BIT_SIDE))
|
#define GET_BATTLER_SIDE(battler)((GetBattlerPosition(battler) & BIT_SIDE))
|
||||||
#define GET_BATTLER_SIDE2(battler)((GET_BATTLER_POSITION(battler) & BIT_SIDE))
|
#define GET_BATTLER_SIDE2(battler)((GET_BATTLER_POSITION(battler) & BIT_SIDE))
|
||||||
@@ -36,40 +28,6 @@
|
|||||||
#define STEVEN_PARTNER_ID 0xC03
|
#define STEVEN_PARTNER_ID 0xC03
|
||||||
#define SECRET_BASE_OPPONENT 0x400
|
#define SECRET_BASE_OPPONENT 0x400
|
||||||
|
|
||||||
#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_SAFARI_OUT_OF_BALLS 0x8
|
|
||||||
#define BATTLE_FORFEITED 0x9
|
|
||||||
#define BATTLE_OPPONENT_TELEPORTED 0xA
|
|
||||||
|
|
||||||
#define OUTCOME_LINK_BATTLE_RUN 0x80
|
|
||||||
|
|
||||||
#define STATUS_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 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 B_ACTION_USE_MOVE 0
|
#define B_ACTION_USE_MOVE 0
|
||||||
#define B_ACTION_USE_ITEM 1
|
#define B_ACTION_USE_ITEM 1
|
||||||
#define B_ACTION_SWITCH 2
|
#define B_ACTION_SWITCH 2
|
||||||
@@ -87,17 +45,6 @@
|
|||||||
#define B_ACTION_NOTHING_FAINTED 13 // when choosing an action
|
#define B_ACTION_NOTHING_FAINTED 13 // when choosing an action
|
||||||
#define B_ACTION_NONE 0xFF
|
#define B_ACTION_NONE 0xFF
|
||||||
|
|
||||||
#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_TRAINER_ITEMS 4
|
||||||
#define MAX_MON_MOVES 4
|
#define MAX_MON_MOVES 4
|
||||||
|
|
||||||
@@ -122,29 +69,6 @@
|
|||||||
#define MOVE_TARGET_FOES_AND_ALLY 0x20
|
#define MOVE_TARGET_FOES_AND_ALLY 0x20
|
||||||
#define MOVE_TARGET_OPPONENTS_FIELD 0x40
|
#define MOVE_TARGET_OPPONENTS_FIELD 0x40
|
||||||
|
|
||||||
// defines for the u8 array gTypeEffectiveness
|
|
||||||
#define TYPE_EFFECT_ATK_TYPE(i)((gTypeEffectiveness[i + 0]))
|
|
||||||
#define TYPE_EFFECT_DEF_TYPE(i)((gTypeEffectiveness[i + 1]))
|
|
||||||
#define TYPE_EFFECT_MULTIPLIER(i)((gTypeEffectiveness[i + 2]))
|
|
||||||
|
|
||||||
// defines for the gTypeEffectiveness multipliers
|
|
||||||
#define TYPE_MUL_NO_EFFECT 0
|
|
||||||
#define TYPE_MUL_NOT_EFFECTIVE 5
|
|
||||||
#define TYPE_MUL_NORMAL 10
|
|
||||||
#define TYPE_MUL_SUPER_EFFECTIVE 20
|
|
||||||
|
|
||||||
// special type table Ids
|
|
||||||
#define TYPE_FORESIGHT 0xFE
|
|
||||||
#define TYPE_ENDTABLE 0xFF
|
|
||||||
|
|
||||||
// for battle script commands
|
|
||||||
#define CMP_EQUAL 0x0
|
|
||||||
#define CMP_NOT_EQUAL 0x1
|
|
||||||
#define CMP_GREATER_THAN 0x2
|
|
||||||
#define CMP_LESS_THAN 0x3
|
|
||||||
#define CMP_COMMON_BITS 0x4
|
|
||||||
#define CMP_NO_COMMON_BITS 0x5
|
|
||||||
|
|
||||||
struct TrainerMonNoItemDefaultMoves
|
struct TrainerMonNoItemDefaultMoves
|
||||||
{
|
{
|
||||||
u16 iv;
|
u16 iv;
|
||||||
@@ -199,13 +123,8 @@ struct Trainer
|
|||||||
/*0x24*/ const union TrainerMonPtr party;
|
/*0x24*/ const union TrainerMonPtr party;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define PARTY_FLAG_CUSTOM_MOVES 0x1
|
|
||||||
#define PARTY_FLAG_HAS_ITEM 0x2
|
|
||||||
|
|
||||||
extern const struct Trainer gTrainers[];
|
extern const struct Trainer gTrainers[];
|
||||||
|
|
||||||
#define TRAINER_ENCOUNTER_MUSIC(trainer)((gTrainers[trainer].encounterMusic_gender & 0x7F))
|
|
||||||
|
|
||||||
struct ResourceFlags
|
struct ResourceFlags
|
||||||
{
|
{
|
||||||
u32 flags[4];
|
u32 flags[4];
|
||||||
@@ -362,22 +281,6 @@ extern u8 gActiveBattler;
|
|||||||
extern u8 gBattlerTarget;
|
extern u8 gBattlerTarget;
|
||||||
extern u8 gAbsentBattlerFlags;
|
extern u8 gAbsentBattlerFlags;
|
||||||
|
|
||||||
// script's table id to bit
|
|
||||||
#define AI_SCRIPT_CHECK_BAD_MOVE (1 << 0)
|
|
||||||
#define AI_SCRIPT_TRY_TO_FAINT (1 << 1)
|
|
||||||
#define AI_SCRIPT_CHECK_VIABILITY (1 << 2)
|
|
||||||
#define AI_SCRIPT_SETUP_FIRST_TURN (1 << 3)
|
|
||||||
#define AI_SCRIPT_RISKY (1 << 4)
|
|
||||||
#define AI_SCRIPT_PREFER_STRONGEST_MOVE (1 << 5)
|
|
||||||
#define AI_SCRIPT_PREFER_BATON_PASS (1 << 6)
|
|
||||||
#define AI_SCRIPT_DOUBLE_BATTLE (1 << 7)
|
|
||||||
#define AI_SCRIPT_HP_AWARE (1 << 8)
|
|
||||||
#define AI_SCRIPT_UNKNOWN (1 << 9)
|
|
||||||
// 10 - 28 are not used
|
|
||||||
#define AI_SCRIPT_ROAMING (1 << 29)
|
|
||||||
#define AI_SCRIPT_SAFARI (1 << 30)
|
|
||||||
#define AI_SCRIPT_FIRST_BATTLE (1 << 31)
|
|
||||||
|
|
||||||
extern struct BattlePokemon gBattleMons[MAX_BATTLERS_COUNT];
|
extern struct BattlePokemon gBattleMons[MAX_BATTLERS_COUNT];
|
||||||
|
|
||||||
struct UsedMoves
|
struct UsedMoves
|
||||||
@@ -426,10 +329,6 @@ struct BattleResources
|
|||||||
|
|
||||||
extern struct BattleResources *gBattleResources;
|
extern struct BattleResources *gBattleResources;
|
||||||
|
|
||||||
#define BATTLESCRIPTS_STACK (gBattleResources->battleScriptsStack)
|
|
||||||
#define BATTLE_CALLBACKS_STACK (gBattleResources->battleCallbackStack)
|
|
||||||
#define BATTLE_LVLUP_STATS (gBattleResources->statsBeforeLvlUp)
|
|
||||||
|
|
||||||
struct BattleResults
|
struct BattleResults
|
||||||
{
|
{
|
||||||
u8 playerFaintCounter; // 0x0
|
u8 playerFaintCounter; // 0x0
|
||||||
@@ -519,7 +418,7 @@ struct BattleStruct
|
|||||||
u16 hpOnSwitchout[2];
|
u16 hpOnSwitchout[2];
|
||||||
u8 abilityPreventingSwitchout;
|
u8 abilityPreventingSwitchout;
|
||||||
u8 hpScale;
|
u8 hpScale;
|
||||||
u16 savedBattleTypeFlags; // ???
|
u16 savedBattleTypeFlags;
|
||||||
void (*savedCallback)(void);
|
void (*savedCallback)(void);
|
||||||
u8 synchronizeMoveEffect;
|
u8 synchronizeMoveEffect;
|
||||||
u8 multiplayerId;
|
u8 multiplayerId;
|
||||||
@@ -571,72 +470,6 @@ extern struct BattleStruct *gBattleStruct;
|
|||||||
gBattleMons[battlerId].type2 = type; \
|
gBattleMons[battlerId].type2 = type; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MOVE_EFFECT_SLEEP 0x1
|
|
||||||
#define MOVE_EFFECT_POISON 0x2
|
|
||||||
#define MOVE_EFFECT_BURN 0x3
|
|
||||||
#define MOVE_EFFECT_FREEZE 0x4
|
|
||||||
#define MOVE_EFFECT_PARALYSIS 0x5
|
|
||||||
#define MOVE_EFFECT_TOXIC 0x6
|
|
||||||
#define MOVE_EFFECT_CONFUSION 0x7
|
|
||||||
#define MOVE_EFFECT_FLINCH 0x8
|
|
||||||
#define MOVE_EFFECT_TRI_ATTACK 0x9
|
|
||||||
#define MOVE_EFFECT_UPROAR 0xA
|
|
||||||
#define MOVE_EFFECT_PAYDAY 0xB
|
|
||||||
#define MOVE_EFFECT_CHARGING 0xC
|
|
||||||
#define MOVE_EFFECT_WRAP 0xD
|
|
||||||
#define MOVE_EFFECT_RECOIL_25 0xE
|
|
||||||
#define MOVE_EFFECT_ATK_PLUS_1 0xF
|
|
||||||
#define MOVE_EFFECT_DEF_PLUS_1 0x10
|
|
||||||
#define MOVE_EFFECT_SPD_PLUS_1 0x11
|
|
||||||
#define MOVE_EFFECT_SP_ATK_PLUS_1 0x12
|
|
||||||
#define MOVE_EFFECT_SP_DEF_PLUS_1 0x13
|
|
||||||
#define MOVE_EFFECT_ACC_PLUS_1 0x14
|
|
||||||
#define MOVE_EFFECT_EVS_PLUS_1 0x15
|
|
||||||
#define MOVE_EFFECT_ATK_MINUS_1 0x16
|
|
||||||
#define MOVE_EFFECT_DEF_MINUS_1 0x17
|
|
||||||
#define MOVE_EFFECT_SPD_MINUS_1 0x18
|
|
||||||
#define MOVE_EFFECT_SP_ATK_MINUS_1 0x19
|
|
||||||
#define MOVE_EFFECT_SP_DEF_MINUS_1 0x1A
|
|
||||||
#define MOVE_EFFECT_ACC_MINUS_1 0x1B
|
|
||||||
#define MOVE_EFFECT_EVS_MINUS_1 0x1C
|
|
||||||
#define MOVE_EFFECT_RECHARGE 0x1D
|
|
||||||
#define MOVE_EFFECT_RAGE 0x1E
|
|
||||||
#define MOVE_EFFECT_STEAL_ITEM 0x1F
|
|
||||||
#define MOVE_EFFECT_PREVENT_ESCAPE 0x20
|
|
||||||
#define MOVE_EFFECT_NIGHTMARE 0x21
|
|
||||||
#define MOVE_EFFECT_ALL_STATS_UP 0x22
|
|
||||||
#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_ATK_PLUS_2 0x27
|
|
||||||
#define MOVE_EFFECT_DEF_PLUS_2 0x28
|
|
||||||
#define MOVE_EFFECT_SPD_PLUS_2 0x29
|
|
||||||
#define MOVE_EFFECT_SP_ATK_PLUS_2 0x2A
|
|
||||||
#define MOVE_EFFECT_SP_DEF_PLUS_2 0x2B
|
|
||||||
#define MOVE_EFFECT_ACC_PLUS_2 0x2C
|
|
||||||
#define MOVE_EFFECT_EVS_PLUS_2 0x2D
|
|
||||||
#define MOVE_EFFECT_ATK_MINUS_2 0x2E
|
|
||||||
#define MOVE_EFFECT_DEF_MINUS_2 0x2F
|
|
||||||
#define MOVE_EFFECT_SPD_MINUS_2 0x30
|
|
||||||
#define MOVE_EFFECT_SP_ATK_MINUS_2 0x31
|
|
||||||
#define MOVE_EFFECT_SP_DEF_MINUS_2 0x32
|
|
||||||
#define MOVE_EFFECT_ACC_MINUS_2 0x33
|
|
||||||
#define MOVE_EFFECT_EVS_MINUS_2 0x34
|
|
||||||
#define MOVE_EFFECT_THRASH 0x35
|
|
||||||
#define MOVE_EFFECT_KNOCK_OFF 0x36
|
|
||||||
#define MOVE_EFFECT_NOTHING_37 0x37
|
|
||||||
#define MOVE_EFFECT_NOTHING_38 0x38
|
|
||||||
#define MOVE_EFFECT_NOTHING_39 0x39
|
|
||||||
#define MOVE_EFFECT_NOTHING_3A 0x3A
|
|
||||||
#define MOVE_EFFECT_SP_ATK_TWO_DOWN 0x3B
|
|
||||||
#define MOVE_EFFECT_NOTHING_3C 0x3C
|
|
||||||
#define MOVE_EFFECT_NOTHING_3D 0x3D
|
|
||||||
#define MOVE_EFFECT_NOTHING_3E 0x3E
|
|
||||||
#define MOVE_EFFECT_NOTHING_3F 0x3F
|
|
||||||
#define MOVE_EFFECT_AFFECTS_USER 0x40
|
|
||||||
#define MOVE_EFFECT_CERTAIN 0x80
|
|
||||||
|
|
||||||
#define GET_STAT_BUFF_ID(n)((n & 0xF)) // first four bits 0x1, 0x2, 0x4, 0x8
|
#define GET_STAT_BUFF_ID(n)((n & 0xF)) // first four bits 0x1, 0x2, 0x4, 0x8
|
||||||
#define GET_STAT_BUFF_VALUE2(n)((n & 0xF0))
|
#define GET_STAT_BUFF_VALUE2(n)((n & 0xF0))
|
||||||
#define GET_STAT_BUFF_VALUE(n)(((n >> 4) & 7)) // 0x10, 0x20, 0x40
|
#define GET_STAT_BUFF_VALUE(n)(((n >> 4) & 7)) // 0x10, 0x20, 0x40
|
||||||
@@ -646,32 +479,6 @@ extern struct BattleStruct *gBattleStruct;
|
|||||||
|
|
||||||
#define SET_STATCHANGER(statId, stage, goesDown)(gBattleScripting.statChanger = (statId) + (stage << 4) + (goesDown << 7))
|
#define SET_STATCHANGER(statId, stage, goesDown)(gBattleScripting.statChanger = (statId) + (stage << 4) + (goesDown << 7))
|
||||||
|
|
||||||
// used in many battle files, it seems as though Hisashi Sogabe wrote
|
|
||||||
// some sort of macro to replace the use of actually calling memset.
|
|
||||||
// Perhaps it was thought calling memset was much slower?
|
|
||||||
|
|
||||||
// The compiler wont allow us to locally declare ptr in this macro; some
|
|
||||||
// functions that invoke this macro will not match without this egregeous
|
|
||||||
// assumption about the variable names, so in order to avoid this assumption,
|
|
||||||
// we opt to pass the variables themselves, even though it is likely that
|
|
||||||
// Sogabe assumed the variables were named src and dest. Trust me: I tried to
|
|
||||||
// avoid assuming variable names, but the ROM just will not match without the
|
|
||||||
// assumptions. Therefore, these macros are bad practice, but I'm putting them
|
|
||||||
// here anyway.
|
|
||||||
#define MEMSET_ALT(data, c, size, var, dest) \
|
|
||||||
{ \
|
|
||||||
dest = (u8 *)data; \
|
|
||||||
for(var = 0; var < (u32)size; var++) \
|
|
||||||
dest[var] = c; \
|
|
||||||
} \
|
|
||||||
|
|
||||||
#define MEMCPY_ALT(data, dest, size, var, src) \
|
|
||||||
{ \
|
|
||||||
src = (u8 *)data; \
|
|
||||||
for(var = 0; var < (u32)size; var++) \
|
|
||||||
dest[var] = src[var]; \
|
|
||||||
} \
|
|
||||||
|
|
||||||
struct BattleScripting
|
struct BattleScripting
|
||||||
{
|
{
|
||||||
s32 painSplitHp;
|
s32 painSplitHp;
|
||||||
@@ -700,17 +507,6 @@ struct BattleScripting
|
|||||||
u8 field_23;
|
u8 field_23;
|
||||||
};
|
};
|
||||||
|
|
||||||
// functions
|
|
||||||
|
|
||||||
// battle_1
|
|
||||||
void LoadBattleTextboxAndBackground(void);
|
|
||||||
void LoadBattleEntryBackground(void);
|
|
||||||
void ApplyPlayerChosenFrameToBattleMenu(void);
|
|
||||||
bool8 LoadChosenBattleElement(u8 caseId);
|
|
||||||
void DrawMainBattleBackground(void);
|
|
||||||
void task00_0800F6FC(u8 taskId);
|
|
||||||
void sub_800F324(void);
|
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
BACK_PIC_BRENDAN,
|
BACK_PIC_BRENDAN,
|
||||||
@@ -723,11 +519,6 @@ enum
|
|||||||
BACK_PIC_STEVEN
|
BACK_PIC_STEVEN
|
||||||
};
|
};
|
||||||
|
|
||||||
// rom_80A5C6C
|
|
||||||
u8 GetBattlerSide(u8 bank);
|
|
||||||
u8 GetBattlerPosition(u8 bank);
|
|
||||||
u8 GetBattlerAtPosition(u8 bank);
|
|
||||||
|
|
||||||
struct BattleSpriteInfo
|
struct BattleSpriteInfo
|
||||||
{
|
{
|
||||||
u16 invisible : 1; // 0x1
|
u16 invisible : 1; // 0x1
|
||||||
|
|||||||
@@ -9,5 +9,7 @@ void sub_800F34C(void);
|
|||||||
void DrawBattleEntryBackground(void);
|
void DrawBattleEntryBackground(void);
|
||||||
void sub_800F6FC(u8 taskId);
|
void sub_800F6FC(u8 taskId);
|
||||||
void LoadBattleMenuWindowGfx(void);
|
void LoadBattleMenuWindowGfx(void);
|
||||||
|
void LoadBattleTextboxAndBackground(void);
|
||||||
|
void sub_800F324(void);
|
||||||
|
|
||||||
#endif // GUARD_BATTLE_BG_H
|
#endif // GUARD_BATTLE_BG_H
|
||||||
|
|||||||
@@ -7,13 +7,6 @@
|
|||||||
#define NO_ACC_CALC_CHECK_LOCK_ON 0xFFFF
|
#define NO_ACC_CALC_CHECK_LOCK_ON 0xFFFF
|
||||||
#define ACC_CURR_MOVE 0
|
#define ACC_CURR_MOVE 0
|
||||||
|
|
||||||
#define CMP_EQUAL 0x0
|
|
||||||
#define CMP_NOT_EQUAL 0x1
|
|
||||||
#define CMP_GREATER_THAN 0x2
|
|
||||||
#define CMP_LESS_THAN 0x3
|
|
||||||
#define CMP_COMMON_BITS 0x4
|
|
||||||
#define CMP_NO_COMMON_BITS 0x5
|
|
||||||
|
|
||||||
#define ATK48_STAT_NEGATIVE 0x1
|
#define ATK48_STAT_NEGATIVE 0x1
|
||||||
#define ATK48_STAT_BY_TWO 0x2
|
#define ATK48_STAT_BY_TWO 0x2
|
||||||
#define ATK48_BIT_x4 0x4
|
#define ATK48_BIT_x4 0x4
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ bool32 GetTrainerFlagFromScriptPointer(const u8 *data);
|
|||||||
void SetUpTrainerMovement(void);
|
void SetUpTrainerMovement(void);
|
||||||
u8 ScrSpecial_GetTrainerBattleMode(void);
|
u8 ScrSpecial_GetTrainerBattleMode(void);
|
||||||
u16 sub_80803D8(void);
|
u16 sub_80803D8(void);
|
||||||
u16 GetTrainerFlag(void);
|
u16 ScrSpecial_HasTrainerBeenFought(void);
|
||||||
void SetBattledTrainerFlag(void);
|
void SetBattledTrainerFlag(void);
|
||||||
bool8 HasTrainerBeenFought(u16 trainerId);
|
bool8 HasTrainerBeenFought(u16 trainerId);
|
||||||
void SetTrainerFlag(u16 trainerId);
|
void SetTrainerFlag(u16 trainerId);
|
||||||
@@ -31,7 +31,7 @@ void ScrSpecial_ShowTrainerIntroSpeech(void);
|
|||||||
const u8 *BattleSetup_GetScriptAddrAfterBattle(void);
|
const u8 *BattleSetup_GetScriptAddrAfterBattle(void);
|
||||||
const u8 *BattleSetup_GetTrainerPostBattleScript(void);
|
const u8 *BattleSetup_GetTrainerPostBattleScript(void);
|
||||||
void ScrSpecial_ShowTrainerNonBattlingSpeech(void);
|
void ScrSpecial_ShowTrainerNonBattlingSpeech(void);
|
||||||
void SetUpTrainerEncounterMusic(void);
|
void PlayTrainerEncounterMusic(void);
|
||||||
const u8 *GetTrainerALoseText(void);
|
const u8 *GetTrainerALoseText(void);
|
||||||
const u8 *GetTrainerWonSpeech(void);
|
const u8 *GetTrainerWonSpeech(void);
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
#include "constants/species.h"
|
#include "constants/species.h"
|
||||||
|
|
||||||
#define SPECIES_SHINY_TAG 500
|
#define SPECIES_SHINY_TAG 500
|
||||||
|
#define TRAINER_ENCOUNTER_MUSIC(trainer)((gTrainers[trainer].encounterMusic_gender & 0x7F))
|
||||||
|
|
||||||
struct MonCoords
|
struct MonCoords
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-2
@@ -2,6 +2,7 @@
|
|||||||
#define GUARD_QUEST_LOG_H
|
#define GUARD_QUEST_LOG_H
|
||||||
|
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
#include "quest_log_battle.h"
|
||||||
|
|
||||||
struct UnkStruct_3005E90
|
struct UnkStruct_3005E90
|
||||||
{
|
{
|
||||||
@@ -41,8 +42,6 @@ void sub_8112450(void);
|
|||||||
void sub_8112364(void);
|
void sub_8112364(void);
|
||||||
u8 sub_8112CAC(void);
|
u8 sub_8112CAC(void);
|
||||||
void sub_81138F8(void);
|
void sub_81138F8(void);
|
||||||
void sub_812C224(void);
|
|
||||||
void sub_812BFDC(void);
|
|
||||||
void sub_811231C(void);
|
void sub_811231C(void);
|
||||||
void sub_81139BC(void);
|
void sub_81139BC(void);
|
||||||
void *QuestLogGetFlagOrVarPtr(bool8 isFlag, u16 idx);
|
void *QuestLogGetFlagOrVarPtr(bool8 isFlag, u16 idx);
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
#ifndef GUARD_QUEST_LOG_BATTLE_H
|
||||||
|
#define GUARD_QUEST_LOG_BATTLE_H
|
||||||
|
|
||||||
|
#include "global.h"
|
||||||
|
|
||||||
|
void sub_812BFDC(void);
|
||||||
|
void sub_812C224(void);
|
||||||
|
|
||||||
|
#endif // GUARD_QUEST_LOG_BATTLE_H
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "battle.h"
|
#include "battle.h"
|
||||||
#include "battle_main.h"
|
#include "battle_anim.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "item.h"
|
#include "item.h"
|
||||||
#include "random.h"
|
#include "random.h"
|
||||||
|
|||||||
+1
-1
@@ -1107,7 +1107,7 @@ static void CB2_PreInitMultiBattle(void)
|
|||||||
s32 i;
|
s32 i;
|
||||||
u8 playerMultiplierId;
|
u8 playerMultiplierId;
|
||||||
u8 r4 = 0xF;
|
u8 r4 = 0xF;
|
||||||
u16 *savedBattleTypeFlags; // ???
|
u16 *savedBattleTypeFlags;
|
||||||
void (**savedCallback)(void);
|
void (**savedCallback)(void);
|
||||||
|
|
||||||
playerMultiplierId = GetMultiplayerId();
|
playerMultiplierId = GetMultiplayerId();
|
||||||
|
|||||||
+13
-13
@@ -850,7 +850,7 @@ u16 sub_80803D8(void)
|
|||||||
return gUnknown_20386CC;
|
return gUnknown_20386CC;
|
||||||
}
|
}
|
||||||
|
|
||||||
u16 GetTrainerFlag(void)
|
u16 ScrSpecial_HasTrainerBeenFought(void)
|
||||||
{
|
{
|
||||||
return FlagGet(GetTrainerAFlag());
|
return FlagGet(GetTrainerAFlag());
|
||||||
}
|
}
|
||||||
@@ -993,7 +993,7 @@ void ScrSpecial_ShowTrainerNonBattlingSpeech(void)
|
|||||||
ShowFieldMessage(GetTrainerCantBattleSpeech());
|
ShowFieldMessage(GetTrainerCantBattleSpeech());
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetUpTrainerEncounterMusic(void)
|
void PlayTrainerEncounterMusic(void)
|
||||||
{
|
{
|
||||||
u16 music;
|
u16 music;
|
||||||
|
|
||||||
@@ -1003,19 +1003,19 @@ void SetUpTrainerEncounterMusic(void)
|
|||||||
{
|
{
|
||||||
switch (GetTrainerEncounterMusicId(gTrainerBattleOpponent_A))
|
switch (GetTrainerEncounterMusicId(gTrainerBattleOpponent_A))
|
||||||
{
|
{
|
||||||
case 1: // TODO: replace these with enums
|
case TRAINER_ENCOUNTER_MUSIC_FEMALE:
|
||||||
case 2:
|
case TRAINER_ENCOUNTER_MUSIC_GIRL:
|
||||||
case 9:
|
case TRAINER_ENCOUNTER_MUSIC_TWINS:
|
||||||
music = MUS_SHOUJO;
|
music = MUS_SHOUJO;
|
||||||
break;
|
break;
|
||||||
case 0:
|
case TRAINER_ENCOUNTER_MUSIC_MALE:
|
||||||
case 4:
|
case TRAINER_ENCOUNTER_MUSIC_INTENSE:
|
||||||
case 5:
|
case TRAINER_ENCOUNTER_MUSIC_COOL:
|
||||||
case 8:
|
case TRAINER_ENCOUNTER_MUSIC_SWIMMER:
|
||||||
case 10:
|
case TRAINER_ENCOUNTER_MUSIC_ELITE_FOUR:
|
||||||
case 11:
|
case TRAINER_ENCOUNTER_MUSIC_HIKER:
|
||||||
case 12:
|
case TRAINER_ENCOUNTER_MUSIC_INTERVIEWER:
|
||||||
case 13:
|
case TRAINER_ENCOUNTER_MUSIC_RICH:
|
||||||
music = MUS_SHOUNEN;
|
music = MUS_SHOUNEN;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -3175,7 +3175,7 @@ static bool8 BT_Phase2WhiteFadeInStripes_Stop(struct Task *task)
|
|||||||
DmaStop(0);
|
DmaStop(0);
|
||||||
SetVBlankCallback(NULL);
|
SetVBlankCallback(NULL);
|
||||||
SetHBlankCallback(NULL);
|
SetHBlankCallback(NULL);
|
||||||
sTransitionStructPtr->win0H = 240;
|
sTransitionStructPtr->win0H = WIN_RANGE(0, 240);
|
||||||
sTransitionStructPtr->bldY = 0;
|
sTransitionStructPtr->bldY = 0;
|
||||||
sTransitionStructPtr->bldCnt = BLDCNT_TGT1_BG0 | BLDCNT_TGT1_BG1 | BLDCNT_TGT1_BG2 | BLDCNT_TGT1_BG3 | BLDCNT_TGT1_OBJ | BLDCNT_TGT1_BD | BLDCNT_EFFECT_DARKEN;
|
sTransitionStructPtr->bldCnt = BLDCNT_TGT1_BG0 | BLDCNT_TGT1_BG1 | BLDCNT_TGT1_BG2 | BLDCNT_TGT1_BG3 | BLDCNT_TGT1_OBJ | BLDCNT_TGT1_BD | BLDCNT_EFFECT_DARKEN;
|
||||||
sTransitionStructPtr->winIn = WINOUT_WIN01_BG_ALL | WINOUT_WIN01_OBJ | WININ_WIN0_CLR;
|
sTransitionStructPtr->winIn = WINOUT_WIN01_BG_ALL | WINOUT_WIN01_OBJ | WININ_WIN0_CLR;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "bg.h"
|
#include "bg.h"
|
||||||
#include "battle.h"
|
#include "battle.h"
|
||||||
|
#include "battle_anim.h"
|
||||||
#include "pokemon.h"
|
#include "pokemon.h"
|
||||||
#include "malloc.h"
|
#include "malloc.h"
|
||||||
#include "trainer_tower.h"
|
#include "trainer_tower.h"
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@
|
|||||||
#include "data.h"
|
#include "data.h"
|
||||||
#include "string_util.h"
|
#include "string_util.h"
|
||||||
#include "battle.h"
|
#include "battle.h"
|
||||||
#include "battle_main.h"
|
#include "battle_anim.h"
|
||||||
#include "item.h"
|
#include "item.h"
|
||||||
#include "event_data.h"
|
#include "event_data.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|||||||
+15
-14
@@ -2,6 +2,7 @@
|
|||||||
#include "constants/species.h"
|
#include "constants/species.h"
|
||||||
#include "malloc.h"
|
#include "malloc.h"
|
||||||
#include "battle.h"
|
#include "battle.h"
|
||||||
|
#include "battle_anim.h"
|
||||||
#include "link.h"
|
#include "link.h"
|
||||||
#include "overworld.h"
|
#include "overworld.h"
|
||||||
#include "quest_log.h"
|
#include "quest_log.h"
|
||||||
@@ -22,7 +23,7 @@ struct QuestLogStruct_WildBattleRecord
|
|||||||
u8 v4;
|
u8 v4;
|
||||||
};
|
};
|
||||||
|
|
||||||
void sub_812C334(s32 *, s32 *);
|
static void sub_812C334(s32 *, s32 *);
|
||||||
|
|
||||||
void sub_812BFDC(void)
|
void sub_812BFDC(void)
|
||||||
{
|
{
|
||||||
@@ -38,18 +39,18 @@ void sub_812BFDC(void)
|
|||||||
{
|
{
|
||||||
switch (gTrainers[gTrainerBattleOpponent_A].trainerClass)
|
switch (gTrainers[gTrainerBattleOpponent_A].trainerClass)
|
||||||
{
|
{
|
||||||
case 0x54:
|
case 0x54:
|
||||||
questLogMessageType = 30;
|
questLogMessageType = 30;
|
||||||
break;
|
break;
|
||||||
case 0x5a:
|
case 0x5a:
|
||||||
questLogMessageType = 33;
|
questLogMessageType = 33;
|
||||||
break;
|
break;
|
||||||
case 0x57:
|
case 0x57:
|
||||||
questLogMessageType = 32;
|
questLogMessageType = 32;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
questLogMessageType = 34;
|
questLogMessageType = 34;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
questLogTrainerBattleRecord->v0 = gTrainerBattleOpponent_A;
|
questLogTrainerBattleRecord->v0 = gTrainerBattleOpponent_A;
|
||||||
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
|
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
|
||||||
@@ -149,7 +150,7 @@ void sub_812C224(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_812C334(s32 * a0, s32 * a1)
|
static void sub_812C334(s32 * a0, s32 * a1)
|
||||||
{
|
{
|
||||||
s32 r5;
|
s32 r5;
|
||||||
s32 _optimized_out = 0;
|
s32 _optimized_out = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user