merge
This commit is contained in:
339
include/battle.h
339
include/battle.h
@@ -1,6 +1,11 @@
|
||||
#ifndef GUARD_BATTLE_H
|
||||
#define GUARD_BATTLE_H
|
||||
|
||||
// should they be included here or included individually by every file?
|
||||
#include "battle_util.h"
|
||||
#include "battle_script_commands.h"
|
||||
#include "battle_2.h"
|
||||
|
||||
/*
|
||||
Banks are a name given to what could be called a 'battlerId' or 'monControllerId'.
|
||||
Each bank has a value consisting of two bits.
|
||||
@@ -54,11 +59,16 @@
|
||||
#define BATTLE_TYPE_GROUDON 0x10000000
|
||||
#define BATTLE_TYPE_KYORGE 0x20000000
|
||||
#define BATTLE_TYPE_RAYQUAZA 0x40000000
|
||||
#define BATTLE_TYPE_x80000000 0x80000000
|
||||
|
||||
#define TRAINER_OPPONENT_3FE 0x3FE
|
||||
#define TRAINER_OPPONENT_C00 0xC00
|
||||
#define TRAINER_OPPONENT_800 0x800
|
||||
#define STEVEN_PARTNER_ID 0xC03
|
||||
#define SECRET_BASE_OPPONENT 0x400
|
||||
|
||||
#define BATTLE_TYPE_FRONTIER (BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_DOME | BATTLE_TYPE_PALACE | BATTLE_TYPE_ARENA | BATTLE_TYPE_FACTORY | BATTLE_TYPE_x100000 | BATTLE_TYPE_PYRAMID)
|
||||
#define BATTLE_TYPE_FRONTIER (BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_DOME | BATTLE_TYPE_PALACE | BATTLE_TYPE_ARENA | BATTLE_TYPE_FACTORY | BATTLE_TYPE_x100000 | BATTLE_TYPE_PYRAMID)
|
||||
#define BATTLE_TYPE_FRONTIER_NO_PYRAMID (BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_DOME | BATTLE_TYPE_PALACE | BATTLE_TYPE_ARENA | BATTLE_TYPE_FACTORY | BATTLE_TYPE_x100000)
|
||||
|
||||
#define BATTLE_WON 0x1
|
||||
#define BATTLE_LOST 0x2
|
||||
@@ -67,8 +77,11 @@
|
||||
#define BATTLE_PLAYER_TELEPORTED 0x5
|
||||
#define BATTLE_POKE_FLED 0x6
|
||||
#define BATTLE_CAUGHT 0x7
|
||||
#define BATTLE_FORFEITED 0x9
|
||||
#define BATTLE_OPPONENT_TELEPORTED 0xA
|
||||
|
||||
#define BATTLE_OUTCOME_BIT_x80 0x80
|
||||
|
||||
#define STATUS_SLEEP 0x7
|
||||
#define STATUS_POISON 0x8
|
||||
#define STATUS_BURN 0x10
|
||||
@@ -111,8 +124,8 @@
|
||||
#define STATUS3_MINIMIZED 0x100
|
||||
#define STATUS3_ROOTED 0x400
|
||||
#define STATUS3_CHARGED_UP 0x200
|
||||
#define STATUS3_YAWN 0x1800 //two bits
|
||||
#define STATUS3_IMPRISONED_OTHERS 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
|
||||
@@ -123,6 +136,7 @@
|
||||
|
||||
#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
|
||||
@@ -133,6 +147,7 @@
|
||||
#define HITMARKER_PURSUIT_TRAP 0x00001000
|
||||
#define HITMARKER_IGNORE_SAFEGUARD 0x00002000
|
||||
#define HITMARKER_SYNCHRONISE_EFFECT 0x00004000
|
||||
#define HITMARKER_RUN 0x00008000
|
||||
#define HITMARKER_IGNORE_ON_AIR 0x00010000
|
||||
#define HITMARKER_IGNORE_UNDERGROUND 0x00020000
|
||||
#define HITMARKER_IGNORE_UNDERWATER 0x00040000
|
||||
@@ -143,6 +158,7 @@
|
||||
#define HITMARKER_x800000 0x00800000
|
||||
#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))
|
||||
@@ -156,28 +172,21 @@
|
||||
#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_SIDE 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 ACTION_USE_MOVE 0
|
||||
#define ACTION_USE_ITEM 1
|
||||
#define ACTION_SWITCH 2
|
||||
#define ACTION_RUN 3
|
||||
#define ACTION_WATCHES_CAREFULLY 4
|
||||
#define ACTION_SAFARI_ZONE_BALL 5
|
||||
#define ACTION_POKEBLOCK_CASE 6
|
||||
#define ACTION_GO_NEAR 7
|
||||
#define ACTION_SAFARI_ZONE_RUN 8
|
||||
#define ACTION_9 9
|
||||
#define ACTION_RUN_BATTLESCRIPT 10 // when executing an action
|
||||
#define ACTION_CANCEL_PARTNER 12 // when choosing an action
|
||||
#define ACTION_FINISHED 12 // when executing an action
|
||||
#define ACTION_NOTHING_FAINTED 13 // when choosing an action
|
||||
#define ACTION_INIT_VALUE 0xFF
|
||||
|
||||
#define MOVESTATUS_MISSED (1 << 0)
|
||||
#define MOVESTATUS_SUPEREFFECTIVE (1 << 1)
|
||||
@@ -215,14 +224,19 @@
|
||||
#define BATTLE_TERRAIN_POND 5
|
||||
#define BATTLE_TERRAIN_ROCK 6
|
||||
#define BATTLE_TERRAIN_CAVE 7
|
||||
#define BATTLE_TERRAIN_INSIDE 8
|
||||
|
||||
// array entries for battle communication
|
||||
#define MULTIUSE_STATE 0x0
|
||||
#define CURSOR_POSITION 0x1
|
||||
#define TASK_ID 0x1 // task Id and cursor position share the same field
|
||||
#define MOVE_EFFECT_BYTE 0x3
|
||||
#define MULTISTRING_CHOOSER 0x5
|
||||
#define MSG_DISPLAY 0x7
|
||||
#define MULTIUSE_STATE 0x0
|
||||
#define CURSOR_POSITION 0x1
|
||||
#define TASK_ID 0x1 // task Id and cursor position share the same field
|
||||
#define SPRITES_INIT_STATE1 0x1 // shares the Id as well
|
||||
#define SPRITES_INIT_STATE2 0x2
|
||||
#define MOVE_EFFECT_BYTE 0x3
|
||||
#define ACTIONS_CONFIRMED_COUNT 0x4
|
||||
#define MULTISTRING_CHOOSER 0x5
|
||||
#define MSG_DISPLAY 0x7
|
||||
#define BATTLE_COMMUNICATION_ENTRIES_COUNT 0x8
|
||||
|
||||
#define MOVE_TARGET_SELECTED 0x0
|
||||
#define MOVE_TARGET_DEPENDS 0x1
|
||||
@@ -238,53 +252,34 @@
|
||||
#define TYPE_MUL_NORMAL 10
|
||||
#define TYPE_MUL_SUPER_EFFECTIVE 20
|
||||
|
||||
#define BS_GET_TARGET 0
|
||||
#define BS_GET_ATTACKER 1
|
||||
#define BS_GET_EFFECT_BANK 2
|
||||
#define BS_ATTACKER_WITH_PARTNER 4 // for atk98_status_icon_update
|
||||
#define BS_GET_ATTACKER_SIDE 8 // for atk1E_jumpifability
|
||||
#define BS_GET_NOT_ATTACKER_SIDE 9 // for atk1E_jumpifability
|
||||
#define BS_GET_SCRIPTING_BANK 10
|
||||
#define BS_GET_OPPONENT1 12
|
||||
#define BS_GET_PLAYER2 13
|
||||
#define BS_GET_OPPONENT2 14
|
||||
|
||||
// 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
|
||||
{
|
||||
u16 species;
|
||||
u16 iv;
|
||||
u8 lvl;
|
||||
u16 evsValue;
|
||||
u16 species;
|
||||
};
|
||||
|
||||
struct TrainerMonItemDefaultMoves
|
||||
{
|
||||
u16 species;
|
||||
u16 iv;
|
||||
u8 lvl;
|
||||
u16 evsValue;
|
||||
u16 species;
|
||||
u16 heldItem;
|
||||
};
|
||||
|
||||
struct TrainerMonNoItemCustomMoves
|
||||
{
|
||||
u16 species;
|
||||
u16 iv;
|
||||
u8 lvl;
|
||||
u16 evsValue;
|
||||
u16 species;
|
||||
u16 moves[4];
|
||||
};
|
||||
|
||||
struct TrainerMonItemCustomMoves
|
||||
{
|
||||
u16 species;
|
||||
u16 iv;
|
||||
u8 lvl;
|
||||
u16 evsValue;
|
||||
u16 species;
|
||||
u16 heldItem;
|
||||
u16 moves[4];
|
||||
};
|
||||
@@ -342,8 +337,8 @@ struct DisableStruct
|
||||
/*0x0F*/ u8 perishSong1 : 4;
|
||||
/*0x0F*/ u8 perishSong2 : 4;
|
||||
/*0x10*/ u8 furyCutterCounter;
|
||||
/*0x11*/ u8 rolloutTimer1 : 4;
|
||||
/*0x11*/ u8 rolloutTimer2 : 4;
|
||||
/*0x11*/ u8 rolloutCounter1 : 4;
|
||||
/*0x11*/ u8 rolloutCounter2 : 4;
|
||||
/*0x12*/ u8 chargeTimer1 : 4;
|
||||
/*0x12*/ u8 chargeTimer2 : 4;
|
||||
/*0x13*/ u8 tauntTimer1:4;
|
||||
@@ -375,7 +370,7 @@ struct ProtectStruct
|
||||
u32 prlzImmobility:1;
|
||||
/* field_1 */
|
||||
u32 confusionSelfDmg:1;
|
||||
u32 notEffective:1;
|
||||
u32 targetNotAffected:1;
|
||||
u32 chargingTurn:1;
|
||||
u32 fleeFlag:2; // for RunAway and Smoke Ball
|
||||
u32 usedImprisionedMove:1;
|
||||
@@ -532,26 +527,24 @@ struct BattleResults
|
||||
u8 playerSwitchesCounter; // 0x2
|
||||
u8 unk3; // 0x3
|
||||
u8 unk4; // 0x4
|
||||
u8 unk5_0:1; // 0x5
|
||||
u8 unk5_1:1; // 0x5
|
||||
u8 caughtMonBall:4; // 0x5
|
||||
u8 unk5_6:1; // 0x5
|
||||
u8 unk5_7:1; // 0x5
|
||||
u16 poke1Species; // 0x6
|
||||
u8 pokeString1[10]; // 0x8
|
||||
u8 unk12;
|
||||
u8 unk5_0:1; // 0x5 , 0x1
|
||||
u8 unk5_1:1; // 0x5 , 0x2
|
||||
u8 caughtMonBall:4; // 0x5 , 0x4/0x8/0x10/0x20
|
||||
u8 unk5_6:1; // 0x5 , 0x40
|
||||
u8 unk5_7:1; // 0x5 , 0x80
|
||||
u16 playerMon1Species; // 0x6
|
||||
u8 playerMon1Name[11]; // 0x8
|
||||
u8 battleTurnCounter; // 0x13
|
||||
u8 pokeString2[10]; // 0x14
|
||||
u8 field_1E; // 0x1E
|
||||
u8 playerMon2Name[11]; // 0x14
|
||||
u8 field_1F; // 0x1F
|
||||
u16 lastOpponentSpecies; // 0x20
|
||||
u16 lastUsedMove; // 0x22
|
||||
u16 opponentMove; // 0x24
|
||||
u16 opponentSpecies; // 0x26
|
||||
u16 lastUsedMovePlayer; // 0x22
|
||||
u16 lastUsedMoveOpponent; // 0x24
|
||||
u16 playerMon2Species; // 0x26
|
||||
u16 caughtMonSpecies; // 0x28
|
||||
u8 caughtMonNick[10]; // 0x2A
|
||||
u8 filler34[2];
|
||||
u8 catchAttempts[10]; // 0x36
|
||||
u8 catchAttempts[12]; // 0x36
|
||||
};
|
||||
|
||||
extern struct BattleResults gBattleResults;
|
||||
@@ -578,22 +571,22 @@ struct BattleStruct
|
||||
u8 field_45;
|
||||
u8 field_46;
|
||||
u8 field_47;
|
||||
u8 field_48;
|
||||
u8 focusPunchBank;
|
||||
u8 field_49;
|
||||
u8 moneyMultiplier;
|
||||
u8 field_4B;
|
||||
u8 field_4C;
|
||||
u8 switchInAbilitiesCounter;
|
||||
u8 field_4D;
|
||||
u8 field_4E;
|
||||
u8 field_4F;
|
||||
u16 expValue;
|
||||
u8 field_52;
|
||||
u8 sentInPokes;
|
||||
u8 field_54[4];
|
||||
bool8 selectionScriptFinished[BATTLE_BANKS_COUNT];
|
||||
u8 field_58[4];
|
||||
u8 field_5C[4];
|
||||
u8 field_60[4][3];
|
||||
u8 field_6C;
|
||||
u8 runTries;
|
||||
u8 caughtMonNick[11];
|
||||
u8 field_78;
|
||||
u8 field_79;
|
||||
@@ -603,11 +596,8 @@ struct BattleStruct
|
||||
u8 field_7D;
|
||||
u8 field_7E;
|
||||
u8 formToChangeInto;
|
||||
u8 chosenMovesIds[4];
|
||||
u8 field_84;
|
||||
u8 field_85;
|
||||
u8 field_86;
|
||||
u8 field_87;
|
||||
u8 chosenMovePositions[BATTLE_BANKS_COUNT];
|
||||
u8 stateIdAfterSelScript[BATTLE_BANKS_COUNT];
|
||||
u8 field_88;
|
||||
u8 field_89;
|
||||
u8 field_8A;
|
||||
@@ -633,31 +623,35 @@ struct BattleStruct
|
||||
u8 field_A5;
|
||||
u8 field_A6;
|
||||
u8 field_A7;
|
||||
u16 hpOnSwitchout[4];
|
||||
u16 hpOnSwitchout[2];
|
||||
u32 savedBattleTypeFlags;
|
||||
u8 field_B0;
|
||||
u8 hpScale;
|
||||
u8 synchronizeMoveEffect;
|
||||
u8 field_B3;
|
||||
u8 field_B4;
|
||||
u8 field_B5;
|
||||
u8 field_B6;
|
||||
u8 field_B7;
|
||||
void (*savedCallback)(void);
|
||||
u16 usedHeldItems[BATTLE_BANKS_COUNT];
|
||||
u8 field_C0[8];
|
||||
u8 field_C0[4];
|
||||
u8 field_C4[2];
|
||||
u8 field_C6[2];
|
||||
u16 choicedMove[BATTLE_BANKS_COUNT];
|
||||
u16 changedItems[BATTLE_BANKS_COUNT];
|
||||
u8 intimidateBank;
|
||||
u8 fillerD9[0xDA-0xD9];
|
||||
u8 switchInItemsCounter;
|
||||
u8 field_DA;
|
||||
u8 turnSideTracker;
|
||||
u8 fillerDC[0xDF-0xDC];
|
||||
u8 field_DF;
|
||||
u8 mirrorMoveArrays[32];
|
||||
u16 castformPalette[4][16];
|
||||
u8 field_180[32];
|
||||
u8 field_180;
|
||||
u8 field_181;
|
||||
u8 field_182;
|
||||
u8 field_183;
|
||||
struct BattleEnigmaBerry battleEnigmaBerry;
|
||||
u8 field_1A0;
|
||||
u8 field_1A1;
|
||||
u8 filler1A2;
|
||||
bool8 overworldWeatherDone;
|
||||
u8 atkCancellerTracker;
|
||||
u8 field_1A4[240];
|
||||
u8 field_294[4];
|
||||
@@ -783,38 +777,10 @@ extern struct BattleStruct* gBattleStruct;
|
||||
#define B_ANIM_x1C 0x1C
|
||||
#define B_ANIM_x1D 0x1D
|
||||
|
||||
#define ATK48_STAT_NEGATIVE 0x1
|
||||
#define ATK48_STAT_BY_TWO 0x2
|
||||
#define ATK48_BIT_x4 0x4
|
||||
#define ATK48_LOWER_FAIL_CHECK 0x8
|
||||
|
||||
#define ATK4F_DONT_CHECK_STATUSES 0x80
|
||||
|
||||
#define VARIOUS_CANCEL_MULTI_TURN_MOVES 0
|
||||
#define VARIOUS_SET_MAGIC_COAT_TARGET 1
|
||||
#define VARIOUS_GET_MOVE_TARGET 3
|
||||
#define VARIOUS_RESET_INTIMIDATE_TRACE_BITS 5
|
||||
#define VARIOUS_UPDATE_CHOICE_MOVE_ON_LVL_UP 6
|
||||
#define VARIOUS_WAIT_CRY 18
|
||||
#define VARIOUS_RETURN_OPPONENT_MON1 19
|
||||
#define VARIOUS_RETURN_OPPONENT_MON2 20
|
||||
#define VARIOUS_SET_TELEPORT_OUTCOME 25
|
||||
#define VARIOUS_PLAY_TRAINER_DEFEATED_MUSIC 26
|
||||
|
||||
#define ATK80_DMG_CHANGE_SIGN 0
|
||||
#define ATK80_DMG_HALF_BY_TWO_NOT_MORE_THAN_HALF_MAX_HP 1
|
||||
#define ATK80_DMG_DOUBLED 2
|
||||
|
||||
#define GET_STAT_BUFF_ID(n)((n & 0xF)) // first four bits 0x1, 0x2, 0x4, 0x8
|
||||
#define GET_STAT_BUFF_VALUE(n)(((n >> 4) & 7)) // 0x10, 0x20, 0x40
|
||||
#define STAT_BUFF_NEGATIVE 0x80 // 0x80, the sign bit
|
||||
|
||||
#define STAT_CHANGE_BS_PTR 0x1
|
||||
#define STAT_CHANGE_NOT_PROTECT_AFFECTED 0x20
|
||||
|
||||
#define STAT_CHANGE_WORKED 0
|
||||
#define STAT_CHANGE_DIDNT_WORK 1
|
||||
|
||||
#define SET_STAT_BUFF_ID(n)((n & 0xF))
|
||||
#define SET_STAT_BUFF_VALUE(n)(((s8)(((s8)(n) << 4)) & 0xF0))
|
||||
|
||||
@@ -838,106 +804,103 @@ struct BattleScripting
|
||||
u8 statChanger;
|
||||
u8 field_1B;
|
||||
u8 atk23_state;
|
||||
u8 field_1D;
|
||||
u8 battleStyle;
|
||||
u8 atk6C_state;
|
||||
u8 learnMoveState;
|
||||
u8 field_20;
|
||||
u8 field_21;
|
||||
u8 field_22;
|
||||
u8 field_23;
|
||||
u8 field_24;
|
||||
u8 multiplayerId;
|
||||
};
|
||||
|
||||
extern struct BattleScripting gBattleScripting;
|
||||
|
||||
// functions
|
||||
|
||||
// battle_2
|
||||
void CancelMultiTurnMoves(u8 bank);
|
||||
void PressurePPLose(u8 bankAtk, u8 bankDef, u16 move);
|
||||
void PrepareStringBattle(u16 stringId, u8 bank);
|
||||
u8 GetBattleBank(u8 caseId);
|
||||
void UndoEffectsAfterFainting(void);
|
||||
bool8 HasMoveFailed(u8 bank);
|
||||
void SwitchInClearStructs(void);
|
||||
void sub_803BDA0(u8 bank);
|
||||
void sub_803FA70(u8 bank);
|
||||
void BattleMainCB2(void);
|
||||
void VBlankCB_Battle(void);
|
||||
void ResetSentPokesToOpponentValue(void);
|
||||
bool8 CanRunFromBattle(u8 bank);
|
||||
bool8 IsRunningFromBattleImpossible(void);
|
||||
void PressurePPLoseOnUsingPerishSong(u8 bankAtk);
|
||||
void PressurePPLoseOnUsingImprision(u8 bankAtk);
|
||||
|
||||
// battle_3
|
||||
#define MOVE_LIMITATION_ZEROMOVE (1 << 0)
|
||||
#define MOVE_LIMITATION_PP (1 << 1)
|
||||
#define MOVE_LIMITATION_DISABLED (1 << 2)
|
||||
#define MOVE_LIMITATION_TORMENTED (1 << 3)
|
||||
#define MOVE_LIMITATION_TAUNT (1 << 4)
|
||||
#define MOVE_LIMITATION_IMPRISION (1 << 5)
|
||||
|
||||
void BattleScriptPush(const u8* bsPtr);
|
||||
void BattleScriptPushCursor(void);
|
||||
void BattleScriptPop(void);
|
||||
u8 sub_803FB4C(void); // msg, can't select a move
|
||||
u8 CheckMoveLimitations(u8 bank, u8 unusableMoves, u8 check);
|
||||
bool8 AreAllMovesUnusable(void);
|
||||
u8 GetImprisonedMovesCount(u8 bank, u16 move);
|
||||
u8 UpdateTurnCounters(void);
|
||||
u8 TurnBasedEffects(void);
|
||||
bool8 sub_8041364(void);
|
||||
bool8 sub_8041728(void);
|
||||
void b_clear_atk_up_if_hit_flag_unless_enraged(void);
|
||||
u8 AtkCanceller_UnableToUseMove(void);
|
||||
bool8 sub_80423F4(u8 bank, u8 r1, u8 r2);
|
||||
u8 CastformDataTypeChange(u8 bank);
|
||||
u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg);
|
||||
void BattleScriptExecute(const u8* BS_ptr);
|
||||
void BattleScriptPushCursorAndCallback(const u8* BS_ptr);
|
||||
u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn);
|
||||
void sub_8045868(u8 bank);
|
||||
void sub_80458B4(void);
|
||||
u8 GetMoveTarget(u16 move, u8 useMoveTarget);
|
||||
u8 IsPokeDisobedient(void);
|
||||
|
||||
// battle_script_commands
|
||||
void AI_CalcDmg(u8 bankAtk, u8 bankDef);
|
||||
u8 TypeCalc(u16 move, u8 bankAtk, u8 bankDef);
|
||||
u8 AI_TypeCalc(u16 move, u16 species, u8 ability);
|
||||
u8 BankGetTurnOrder(u8 bank);
|
||||
void SetMoveEffect(bool8 primary, u8 certain);
|
||||
void BattleDestroyCursorAt(u8 cursorPosition);
|
||||
void BattleCreateCursorAt(u8 cursorPosition);
|
||||
void BufferMoveToLearnIntoBattleTextBuff2(void);
|
||||
void sub_8056A3C(u8 xStart, u8 yStart, u8 xEnd, u8 yEnd, u8 flags);
|
||||
bool8 UproarWakeUpCheck(u8 bank);
|
||||
|
||||
extern void (* const gBattleScriptingCommandsTable[])(void);
|
||||
extern const u8 gUnknown_0831C494[];
|
||||
// battle_1
|
||||
void LoadBattleTextboxAndBackground(void);
|
||||
void LoadBattleEntryBackground(void);
|
||||
void ApplyPlayerChosenFrameToBattleMenu(void);
|
||||
bool8 LoadChosenBattleElement(u8 caseId);
|
||||
void task00_0800F6FC(u8 taskId);
|
||||
|
||||
// battle_5
|
||||
void AllocateBattleResrouces(void);
|
||||
void FreeBattleResources(void);
|
||||
void AdjustFriendshipOnBattleFaint(u8 bank);
|
||||
void sub_80571DC(u8 bank, u8 arg1);
|
||||
u32 sub_805725C(u8 bank);
|
||||
|
||||
// battle 7
|
||||
void AllocateBattleSpritesData(void);
|
||||
void FreeBattleSpritesData(void);
|
||||
void AllocateMonSpritesGfx(void);
|
||||
void FreeMonSpritesGfx(void);
|
||||
void BattleMusicStop(void);
|
||||
void sub_805E990(struct Pokemon* mon, u8 bank);
|
||||
void sub_805EF14(void);
|
||||
bool8 BattleInitAllSprites(u8 *state1, u8 *state2);
|
||||
|
||||
// rom_80A5C6C
|
||||
u8 GetBankSide(u8 bank);
|
||||
u8 GetBankIdentity(u8 bank);
|
||||
u8 GetBankByIdentity(u8 bank);
|
||||
|
||||
struct BattleSpriteInfo
|
||||
{
|
||||
u16 invisible : 1; // 0x1
|
||||
u16 flag_x2 : 1; // 0x2
|
||||
u16 behindSubstitute : 1; // 0x4
|
||||
u16 flag_x8 : 1; // 0x8
|
||||
u16 hpNumbersNoBars : 1; // 0x10
|
||||
u16 transformSpecies;
|
||||
};
|
||||
|
||||
struct BattleAnimationInfo
|
||||
{
|
||||
u16 field; // to fill up later
|
||||
};
|
||||
|
||||
struct BattleHealthboxInfo
|
||||
{
|
||||
u8 flag_x1 : 1;
|
||||
u8 flag_x2 : 1;
|
||||
u8 flag_x4 : 1;
|
||||
u8 field_1;
|
||||
u8 field_2;
|
||||
u8 field_3;
|
||||
u8 field_4;
|
||||
u8 field_5;
|
||||
u8 field_6;
|
||||
u8 field_7;
|
||||
u8 field_8;
|
||||
u8 field_9;
|
||||
u8 field_A;
|
||||
u8 field_B;
|
||||
};
|
||||
|
||||
struct BattleSpriteData
|
||||
{
|
||||
struct BattleSpriteInfo *bankData;
|
||||
struct BattleHealthboxInfo *healthBoxesData;
|
||||
struct BattleAnimationInfo *animationData;
|
||||
};
|
||||
|
||||
extern struct BattleSpriteData *gBattleSpritesDataPtr;
|
||||
|
||||
// Move this somewhere else
|
||||
|
||||
#include "sprite.h"
|
||||
|
||||
struct BattleSpritesGfx
|
||||
struct MonSpritesGfx
|
||||
{
|
||||
void* firstDecompressed; // ptr to the decompressed sprite of the first pokemon
|
||||
void* sprites[4];
|
||||
struct SpriteTemplate templates[4];
|
||||
};
|
||||
|
||||
extern struct BattleSpritesGfx* gBattleSpritesGfx;
|
||||
extern struct MonSpritesGfx* gMonSpritesGfxPtr;
|
||||
|
||||
#endif // GUARD_BATTLE_H
|
||||
|
||||
30
include/battle_2.h
Normal file
30
include/battle_2.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#ifndef GUARD_BATTLE_2_H
|
||||
#define GUARD_BATTLE_2_H
|
||||
|
||||
void CB2_InitBattle(void);
|
||||
void CB2_QuitRecordedBattle(void);
|
||||
void FaintClearSetData(void);
|
||||
void SwitchInClearSetData(void);
|
||||
void sub_803BDA0(u8 bank);
|
||||
void BattleMainCB2(void);
|
||||
void VBlankCB_Battle(void);
|
||||
bool8 TryRunFromBattle(u8 bank);
|
||||
u8 IsRunningFromBattleImpossible(void);
|
||||
u8 GetWhoStrikesFirst(u8 bank1, u8 bank2, bool8 ignoreChosenMoves);
|
||||
void SwapTurnOrder(u8 id1, u8 id2);
|
||||
void BattleTurnPassed(void);
|
||||
void RunBattleScriptCommands_PopCallbacksStack(void);
|
||||
void RunBattleScriptCommands(void);
|
||||
void sub_8039E9C(struct Sprite *sprite);
|
||||
|
||||
extern const u8 gStatusConditionString_PoisonJpn[8];
|
||||
extern const u8 gStatusConditionString_SleepJpn[8];
|
||||
extern const u8 gStatusConditionString_ParalysisJpn[8];
|
||||
extern const u8 gStatusConditionString_BurnJpn[8];
|
||||
extern const u8 gStatusConditionString_IceJpn[8];
|
||||
extern const u8 gStatusConditionString_ConfusionJpn[8];
|
||||
extern const u8 gStatusConditionString_LoveJpn[8];
|
||||
|
||||
extern const u8 * const gStatusConditionStringsTable[][2];
|
||||
|
||||
#endif // GUARD_BATTLE_2_H
|
||||
@@ -1,6 +1,28 @@
|
||||
#ifndef GUARD_BATTLE_CONTROLLERS_H
|
||||
#define GUARD_BATTLE_CONTROLLERS_H
|
||||
|
||||
#define REQUEST_ALL_BATTLE 0x0
|
||||
#define REQUEST_SPECIES_BATTLE 0x1
|
||||
#define REQUEST_HELDITEM_BATTLE 0x2
|
||||
#define REQUEST_MOVES_PP_BATTLE 0x3
|
||||
#define REQUEST_PPMOVE1_BATTLE 0x9
|
||||
#define REQUEST_PPMOVE2_BATTLE 0xA
|
||||
#define REQUEST_PPMOVE3_BATTLE 0xB
|
||||
#define REQUEST_PPMOVE4_BATTLE 0xC
|
||||
#define REQUEST_STATUS_BATTLE 0x28
|
||||
#define REQUEST_HP_BATTLE 0x2A
|
||||
|
||||
#define RESET_ACTION_MOVE_SELECTION 0
|
||||
#define RESET_ACTION_SELECTION 1
|
||||
#define RESET_MOVE_SELECTION 2
|
||||
|
||||
#define BALL_NO_SHAKES 0
|
||||
#define BALL_1_SHAKE 1
|
||||
#define BALL_2_SHAKES 2
|
||||
#define BALL_3_SHAKES_FAIL 3
|
||||
#define BALL_3_SHAKES_SUCCESS 4
|
||||
#define BALL_TRAINER_BLOCK 5
|
||||
|
||||
struct HpAndStatus
|
||||
{
|
||||
u16 hp;
|
||||
@@ -14,16 +36,15 @@ struct MovePpInfo
|
||||
u8 ppBonuses;
|
||||
};
|
||||
|
||||
#define REQUEST_ALL_BATTLE 0x0
|
||||
#define REQUEST_SPECIES_BATTLE 0x1
|
||||
#define REQUEST_HELDITEM_BATTLE 0x2
|
||||
#define REQUEST_MOVES_PP_BATTLE 0x3
|
||||
#define REQUEST_PPMOVE1_BATTLE 0x9
|
||||
#define REQUEST_PPMOVE2_BATTLE 0xA
|
||||
#define REQUEST_PPMOVE3_BATTLE 0xB
|
||||
#define REQUEST_PPMOVE4_BATTLE 0xC
|
||||
#define REQUEST_STATUS_BATTLE 0x28
|
||||
#define REQUEST_HP_BATTLE 0x2A
|
||||
struct ChooseMoveStruct
|
||||
{
|
||||
u16 moves[4];
|
||||
u8 ppNumbers[4];
|
||||
u8 ppWithBonusNumbers[4];
|
||||
u16 species;
|
||||
u8 monType1;
|
||||
u8 monType2;
|
||||
};
|
||||
|
||||
// rom3.s, emitters
|
||||
void EmitSetMonData(u8 bufferId, u8 request, u8 c, u8 bytes, void *data);
|
||||
@@ -40,34 +61,28 @@ void EmitSpriteInvisibility(u8 bufferId, bool8 isInvisible);
|
||||
void EmitReturnPokeToBall(u8 bufferId, u8 arg1);
|
||||
void EmitGetMonData(u8 bufferId, u8 arg1, u8 arg2);
|
||||
void EmitSwitchInAnim(u8 bufferId, u8 partyId, bool8 dontClearSubstituteBit);
|
||||
void EmitChoosePokemon(u8 bufferId, u8 caseId, u8 arg2, u8 abilityId, const u8* arg4);
|
||||
void EmitLinkStandbyMsg(u8 bufferId, u8 arg1, u8 arg2);
|
||||
void EmitChoosePokemon(u8 bufferId, u8 caseId, u8 arg2, u8 abilityId, u8* arg4);
|
||||
void EmitLinkStandbyMsg(u8 bufferId, u8 arg1, bool32 arg2);
|
||||
void EmitTrainerSlide(u8 bufferId);
|
||||
void EmitTrainerSlideBack(u8 bufferId);
|
||||
void EmitFaintingCry(u8 bufferId);
|
||||
void Emit_x37(u8 bufferId, u8 arg1);
|
||||
void EmitHitAnimation(u8 bufferId);
|
||||
void EmitCmd48(u8 bufferId, struct HpAndStatus* hpAndStatus, u8 arg2);
|
||||
void EmitDrawPartyStatusSummary(u8 bufferId, struct HpAndStatus* hpAndStatus, u8 arg2);
|
||||
void EmitCmd49(u8 bufferId);
|
||||
void EmitStatusAnimation(u8 bufferId, bool8 status2, u32 status);
|
||||
void EmitCmd13(u8 bufferId);
|
||||
void EmitStatusIconUpdate(u8 bufferId, u32 status1, u32 status2);
|
||||
|
||||
#define RESET_ACTION_MOVE_SELECTION 0
|
||||
#define RESET_ACTION_SELECTION 1
|
||||
#define RESET_MOVE_SELECTION 2
|
||||
|
||||
void EmitIntroSlide(u8 bufferId, u8 terrainId);
|
||||
void EmitDrawTrainerPic(u8 bufferId);
|
||||
void EmitLoadMonSprite(u8 bufferId);
|
||||
void EmitIntroTrainerBallThrow(u8 bufferId);
|
||||
void EmitChooseAction(u8 bufferId, u8 arg1, u16 arg2);
|
||||
void EmitChooseMove(u8 bufferId, bool8 isDoubleBattle, bool8 NoPpNumber, struct ChooseMoveStruct* movePpData);
|
||||
void EmitOpenBag(u8 bufferId, u8* arg1);
|
||||
void Emit_x32(u8 bufferId);
|
||||
void EmitPrintString(u8 bufferId, u16 stringId);
|
||||
void EmitResetActionMoveSelection(u8 bufferId, u8 caseId);
|
||||
|
||||
#define BALL_NO_SHAKES 0
|
||||
#define BALL_1_SHAKE 1
|
||||
#define BALL_2_SHAKES 2
|
||||
#define BALL_3_SHAKES_FAIL 3
|
||||
#define BALL_3_SHAKES_SUCCESS 4
|
||||
#define BALL_TRAINER_BLOCK 5
|
||||
|
||||
void EmitBallThrow(u8 bufferId, u8 caseId);
|
||||
|
||||
void MarkBufferBankForExecution(u8 bank);
|
||||
|
||||
#endif // GUARD_BATTLE_CONTROLLERS_H
|
||||
|
||||
58
include/battle_script_commands.h
Normal file
58
include/battle_script_commands.h
Normal file
@@ -0,0 +1,58 @@
|
||||
#ifndef GUARD_BATTLE_SCRIPT_COMMANDS_H
|
||||
#define GUARD_BATTLE_SCRIPT_COMMANDS_H
|
||||
|
||||
#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 BS_ATTACKER_WITH_PARTNER 4 // for atk98_status_icon_update
|
||||
#define BS_GET_ATTACKER_SIDE 8 // for atk1E_jumpifability
|
||||
#define BS_GET_NOT_ATTACKER_SIDE 9 // for atk1E_jumpifability
|
||||
|
||||
#define ATK48_STAT_NEGATIVE 0x1
|
||||
#define ATK48_STAT_BY_TWO 0x2
|
||||
#define ATK48_BIT_x4 0x4
|
||||
#define ATK48_LOWER_FAIL_CHECK 0x8
|
||||
|
||||
#define ATK4F_DONT_CHECK_STATUSES 0x80
|
||||
|
||||
#define VARIOUS_CANCEL_MULTI_TURN_MOVES 0
|
||||
#define VARIOUS_SET_MAGIC_COAT_TARGET 1
|
||||
#define VARIOUS_CAN_RUN_FROM_BATTLE 2
|
||||
#define VARIOUS_GET_MOVE_TARGET 3
|
||||
#define VARIOUS_RESET_INTIMIDATE_TRACE_BITS 5
|
||||
#define VARIOUS_UPDATE_CHOICE_MOVE_ON_LVL_UP 6
|
||||
#define VARIOUS_WAIT_CRY 18
|
||||
#define VARIOUS_RETURN_OPPONENT_MON1 19
|
||||
#define VARIOUS_RETURN_OPPONENT_MON2 20
|
||||
#define VARIOUS_SET_TELEPORT_OUTCOME 25
|
||||
#define VARIOUS_PLAY_TRAINER_DEFEATED_MUSIC 26
|
||||
|
||||
#define ATK80_DMG_CHANGE_SIGN 0
|
||||
#define ATK80_DMG_HALF_BY_TWO_NOT_MORE_THAN_HALF_MAX_HP 1
|
||||
#define ATK80_DMG_DOUBLED 2
|
||||
|
||||
#define STAT_CHANGE_BS_PTR 0x1
|
||||
#define STAT_CHANGE_NOT_PROTECT_AFFECTED 0x20
|
||||
|
||||
#define STAT_CHANGE_WORKED 0
|
||||
#define STAT_CHANGE_DIDNT_WORK 1
|
||||
|
||||
void AI_CalcDmg(u8 bankAtk, u8 bankDef);
|
||||
u8 TypeCalc(u16 move, u8 bankAtk, u8 bankDef);
|
||||
u8 AI_TypeCalc(u16 move, u16 species, u8 ability);
|
||||
u8 BankGetTurnOrder(u8 bank);
|
||||
void SetMoveEffect(bool8 primary, u8 certain);
|
||||
void BattleDestroyCursorAt(u8 cursorPosition);
|
||||
void BattleCreateCursorAt(u8 cursorPosition);
|
||||
void BufferMoveToLearnIntoBattleTextBuff2(void);
|
||||
void sub_8056A3C(u8 xStart, u8 yStart, u8 xEnd, u8 yEnd, u8 flags);
|
||||
bool8 UproarWakeUpCheck(u8 bank);
|
||||
|
||||
extern void (* const gBattleScriptingCommandsTable[])(void);
|
||||
extern const u8 gUnknown_0831C494[];
|
||||
|
||||
#endif // GUARD_BATTLE_SCRIPT_COMMANDS_H
|
||||
6
include/battle_setup.h
Normal file
6
include/battle_setup.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#ifndef GUARD_BATTLE_SETUP_H
|
||||
#define GUARD_BATTLE_SETUP_H
|
||||
|
||||
u8 BattleSetup_GetTerrainId(void);
|
||||
|
||||
#endif // GUARD_BATTLE_SETUP_H
|
||||
83
include/battle_util.h
Normal file
83
include/battle_util.h
Normal file
@@ -0,0 +1,83 @@
|
||||
#ifndef GUARD_BATTLE_UTIL_H
|
||||
#define GUARD_BATTLE_UTIL_H
|
||||
|
||||
#define MOVE_LIMITATION_ZEROMOVE (1 << 0)
|
||||
#define MOVE_LIMITATION_PP (1 << 1)
|
||||
#define MOVE_LIMITATION_DISABLED (1 << 2)
|
||||
#define MOVE_LIMITATION_TORMENTED (1 << 3)
|
||||
#define MOVE_LIMITATION_TAUNT (1 << 4)
|
||||
#define MOVE_LIMITATION_IMPRISION (1 << 5)
|
||||
|
||||
#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_SIDE 0x10
|
||||
#define ABILITYEFFECT_COUNT_BANK_SIDE 0x11
|
||||
#define ABILITYEFFECT_COUNT_ON_FIELD 0x12
|
||||
#define ABILITYEFFECT_CHECK_ON_FIELD 0x13
|
||||
#define ABILITYEFFECT_SWITCH_IN_WEATHER 0xFF
|
||||
|
||||
#define ITEMEFFECT_ON_SWITCH_IN 0x0
|
||||
|
||||
#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_GET_ATTACKER 1
|
||||
#define BS_GET_EFFECT_BANK 2
|
||||
#define BS_GET_SCRIPTING_BANK 10
|
||||
#define BS_GET_PLAYER1 11
|
||||
#define BS_GET_OPPONENT1 12
|
||||
#define BS_GET_PLAYER2 13
|
||||
#define BS_GET_OPPONENT2 14
|
||||
|
||||
u8 GetBattleBank(u8 caseId);
|
||||
void PressurePPLose(u8 bankDef, u8 bankAtk, u16 move);
|
||||
void PressurePPLoseOnUsingPerishSong(u8 bankAtk);
|
||||
void PressurePPLoseOnUsingImprision(u8 bankAtk);
|
||||
void MarkAllBufferBanksForExecution(void); // unused
|
||||
void MarkBufferBankForExecution(u8 bank);
|
||||
void sub_803F850(u8 arg0);
|
||||
void CancelMultiTurnMoves(u8 bank);
|
||||
bool8 WasUnableToUseMove(u8 bank);
|
||||
void PrepareStringBattle(u16 stringId, u8 bank);
|
||||
void ResetSentPokesToOpponentValue(void);
|
||||
void sub_803F9EC(u8 bank);
|
||||
void sub_803FA70(u8 bank);
|
||||
void BattleScriptPush(const u8* bsPtr);
|
||||
void BattleScriptPushCursor(void);
|
||||
void BattleScriptPop(void);
|
||||
u8 TrySetCantSelectMoveBattleScript(void);
|
||||
u8 CheckMoveLimitations(u8 bank, u8 unusableMoves, u8 check);
|
||||
bool8 AreAllMovesUnusable(void);
|
||||
u8 GetImprisonedMovesCount(u8 bank, u16 move);
|
||||
u8 UpdateTurnCounters(void);
|
||||
u8 TurnBasedEffects(void);
|
||||
bool8 sub_8041364(void);
|
||||
bool8 sub_8041728(void);
|
||||
void TryClearRageStatuses(void);
|
||||
u8 AtkCanceller_UnableToUseMove(void);
|
||||
bool8 sub_80423F4(u8 bank, u8 r1, u8 r2);
|
||||
u8 CastformDataTypeChange(u8 bank);
|
||||
u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg);
|
||||
void BattleScriptExecute(const u8* BS_ptr);
|
||||
void BattleScriptPushCursorAndCallback(const u8* BS_ptr);
|
||||
u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn);
|
||||
void ClearFuryCutterDestinyBondGrudge(u8 bank);
|
||||
void HandleAction_RunBattleScript(void);
|
||||
u8 GetMoveTarget(u16 move, u8 useMoveTarget);
|
||||
u8 IsPokeDisobedient(void);
|
||||
|
||||
#endif // GUARD_BATTLE_UTIL_H
|
||||
10
include/evolution_scene.h
Normal file
10
include/evolution_scene.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef GUARD_EVOLUTION_SCENE_H
|
||||
#define GUARD_EVOLUTION_SCENE_H
|
||||
|
||||
void EvolutionScene(struct Pokemon* mon, u16 speciesToEvolve, bool8 canStopEvo, u8 partyID);
|
||||
void BeginEvolutionScene(struct Pokemon* mon, u16 speciesToEvolve, bool8 canStopEvo, u8 partyID);
|
||||
void TradeEvolutionScene(struct Pokemon* mon, u16 speciesToEvolve, u8 preEvoSpriteID, u8 partyID);
|
||||
|
||||
extern void (*gCB2_AfterEvolution)(void);
|
||||
|
||||
#endif // GUARD_EVOLUTION_SCENE_H
|
||||
@@ -84,6 +84,8 @@
|
||||
#define SYS_CTRL_OBJ_DELETE CODE_FLAGS + 0x61
|
||||
#define SYS_RESET_RTC_ENABLE CODE_FLAGS + 0x62
|
||||
|
||||
#define SYS_FRONTIER_PASS CODE_FLAGS + 0x72
|
||||
|
||||
#define SYS_STORAGE_UNKNOWN_FLAG CODE_FLAGS + 0x77
|
||||
|
||||
#define SYS_MYSTERY_GIFT_ENABLE CODE_FLAGS + 0x7B
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
#ifndef GUARD_GLOBAL_BERRY_H
|
||||
#define GUARD_GLOBAL_BERRY_H
|
||||
|
||||
#define BERRY_NAME_COUNT 7
|
||||
#define BERRY_ITEM_EFFECT_COUNT 18
|
||||
|
||||
struct Berry
|
||||
{
|
||||
const u8 name[7];
|
||||
const u8 name[BERRY_NAME_COUNT];
|
||||
u8 firmness;
|
||||
u16 size;
|
||||
u8 maxYield;
|
||||
@@ -23,7 +26,7 @@ struct Berry
|
||||
|
||||
struct Berry2
|
||||
{
|
||||
u8 name[7];
|
||||
u8 name[BERRY_NAME_COUNT];
|
||||
u8 firmness;
|
||||
u16 size;
|
||||
u8 maxYield;
|
||||
@@ -42,7 +45,7 @@ struct Berry2
|
||||
struct EnigmaBerry
|
||||
{
|
||||
struct Berry2 berry;
|
||||
u8 itemEffect[18];
|
||||
u8 itemEffect[BERRY_ITEM_EFFECT_COUNT];
|
||||
u8 holdEffect;
|
||||
u8 holdEffectParam;
|
||||
u32 checksum;
|
||||
@@ -50,9 +53,9 @@ struct EnigmaBerry
|
||||
|
||||
struct BattleEnigmaBerry
|
||||
{
|
||||
/*0x00*/ u8 name[7];
|
||||
/*0x00*/ u8 name[BERRY_NAME_COUNT];
|
||||
/*0x07*/ u8 holdEffect;
|
||||
/*0x08*/ u8 itemEffect[18];
|
||||
/*0x08*/ u8 itemEffect[BERRY_ITEM_EFFECT_COUNT];
|
||||
/*0x1A*/ u8 holdEffectParam;
|
||||
};
|
||||
|
||||
|
||||
@@ -198,8 +198,13 @@ struct SaveBlock2
|
||||
// All below could be a one giant struct
|
||||
|
||||
/*0x64C*/ u8 field_64C[1629];
|
||||
/*0xCA9*/ u8 frontierChosenLvl : 2;
|
||||
/*0xCA9*/ u8 field_CA9_a : 6;
|
||||
/*0xCA9*/ u8 frontierChosenLvl : 2; // 0x1, 0x2 -> 0x3
|
||||
/*0xCA9*/ u8 field_CA9_a : 1; // 0x4
|
||||
/*0xCA9*/ u8 field_CA9_b : 1; // 0x8
|
||||
/*0xCA9*/ u8 field_CA9_c : 1; // 0x10
|
||||
/*0xCA9*/ u8 field_CA9_d : 1; // 0x20
|
||||
/*0xCA9*/ u8 field_CA9_e : 1; // 0x40
|
||||
/*0xCA9*/ u8 field_CA9_f : 1; // 0x80
|
||||
/*0xCAA*/ u8 field_CAA[368];
|
||||
/*0xE1A*/ u16 battlePyramidFloor; // possibly?
|
||||
/*0xE1C*/ u8 field_E1C[16];
|
||||
|
||||
@@ -143,7 +143,6 @@ extern u16 word_3002910[];
|
||||
extern bool8 gReceivedRemoteLinkPlayers;
|
||||
|
||||
void Task_DestroySelf(u8);
|
||||
void sub_8007270(u8);
|
||||
void OpenLink(void);
|
||||
void CloseLink(void);
|
||||
u16 LinkMain2(u16 *);
|
||||
@@ -162,24 +161,12 @@ void sub_8007E4C(void);
|
||||
u8 GetMultiplayerId(void);
|
||||
u8 bitmask_all_link_players_but_self(void);
|
||||
bool8 SendBlock(u8, void *, u16);
|
||||
bool8 sub_8007E9C(u8);
|
||||
bool8 sub_8007ECC(void);
|
||||
u8 GetBlockReceivedStatus(void);
|
||||
void ResetBlockReceivedFlags(void);
|
||||
void ResetBlockReceivedFlag(u8);
|
||||
void sub_8007F4C(void);
|
||||
void SetLinkDebugValues(u32, u32);
|
||||
u8 sub_8008198(void);
|
||||
void sub_80081C8(u8);
|
||||
u8 sub_800820C(void);
|
||||
u8 sub_8008218(void);
|
||||
void sub_800826C(void);
|
||||
void sub_80082EC(void);
|
||||
u8 GetLinkPlayerCount_2(void);
|
||||
bool8 IsLinkMaster(void);
|
||||
void sub_800832C(void);
|
||||
void sub_8008480(void);
|
||||
void sub_80084A4(void);
|
||||
void CB2_LinkError(void);
|
||||
u8 GetSioMultiSI(void);
|
||||
bool8 IsLinkConnectionEstablished(void);
|
||||
@@ -191,4 +178,11 @@ void LinkVSync(void);
|
||||
void Timer3Intr(void);
|
||||
void SerialCB(void);
|
||||
|
||||
void sub_800E0E8(void);
|
||||
bool8 sub_800A520(void);
|
||||
bool8 sub_8010500(void);
|
||||
void sub_800DFB4(u8, u8);
|
||||
void sub_800ADF8(void);
|
||||
u8 sub_8009FCC(void);
|
||||
|
||||
#endif // GUARD_LINK_H
|
||||
|
||||
@@ -19,5 +19,6 @@ void LoadSerializedGame(void);
|
||||
void LoadPlayerBag(void);
|
||||
void SavePlayerBag(void);
|
||||
void SetSaveBlocksPointers(u16);
|
||||
void MoveSaveBlocks_ResetHeap(void);
|
||||
|
||||
#endif // GUARD_LOAD_SAVE_H
|
||||
|
||||
@@ -39,6 +39,7 @@ struct Main
|
||||
|
||||
/*0x439*/ u8 oamLoadDisabled:1;
|
||||
/*0x439*/ u8 inBattle:1;
|
||||
/*0x439*/ u8 field_439_x4:1;
|
||||
};
|
||||
|
||||
extern u8 gUnknown_3001764;
|
||||
|
||||
@@ -439,7 +439,7 @@ struct BattleMove
|
||||
u8 pp;
|
||||
u8 secondaryEffectChance;
|
||||
u8 target;
|
||||
u8 priority;
|
||||
s8 priority;
|
||||
u8 flags;
|
||||
};
|
||||
|
||||
@@ -632,9 +632,21 @@ void HandleSetPokedexFlag(u16 nationalNum, u8 caseId, u32 personality);
|
||||
s32 sub_806D864(u16 a1);
|
||||
bool16 sub_806D82C(u8 id);
|
||||
u16 MonTryLearningNewMove(struct Pokemon* mon, bool8);
|
||||
void sub_8068AA4(void); // sets stats for deoxys
|
||||
bool8 HasTwoFramesAnimation(u16 species);
|
||||
u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 type, u16 evolutionItem);
|
||||
void RandomlyGivePartyPokerus(struct Pokemon *party);
|
||||
u8 CheckPartyPokerus(struct Pokemon *party, u8 selection);
|
||||
u8 CheckPartyHasHadPokerus(struct Pokemon *party, u8 selection);
|
||||
void UpdatePartyPokerusTime(u16 days);
|
||||
void PartySpreadPokerus(struct Pokemon *party);
|
||||
s8 GetMonFlavourRelation(struct Pokemon *mon, u8 a2);
|
||||
s8 GetFlavourRelationByPersonality(u32 personality, u8 a2);
|
||||
|
||||
#include "sprite.h"
|
||||
|
||||
void DoMonFrontSpriteAnimation(struct Sprite* sprite, u16 species, bool8 noCry, u8 arg3);
|
||||
void BattleAnimateFrontSprite(struct Sprite* sprite, u16 species, bool8 noCry, u8 arg3);
|
||||
void BattleAnimateBackSprite(struct Sprite* sprite, u16 species);
|
||||
|
||||
#endif // GUARD_POKEMON_H
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
#ifndef GUARD_RECORDED_BATTLE_H
|
||||
#define GUARD_RECORDED_BATTLE_H
|
||||
|
||||
extern u32 gRecordedBattleRngSeed;
|
||||
|
||||
void sub_8185F84(void);
|
||||
void sub_8184E58(void);
|
||||
void RecordedBattle_SetBankAction(u8 bank, u8 action);
|
||||
void RecordedBattle_ClearBankAction(u8 bank, u8 bytesToClear);
|
||||
void sub_8185F90(u16 arg0);
|
||||
bool8 sub_8186450(void);
|
||||
u8 sub_8185FAC(void);
|
||||
u8 sub_8185FB8(void);
|
||||
u8 MoveRecordedBattleToSaveData(void);
|
||||
void sub_818603C(u8);
|
||||
void sub_8185FD0(void);
|
||||
void sub_8186444(void);
|
||||
|
||||
#endif // GUARD_RECORDED_BATTLE_H
|
||||
|
||||
@@ -252,23 +252,23 @@ enum
|
||||
SE_W114,
|
||||
SE_W063B,
|
||||
BGM_STOP = 349,
|
||||
BGM_TETSUJI,
|
||||
BGM_FIELD13,
|
||||
BGM_KACHI22,
|
||||
BGM_KACHI2,
|
||||
BGM_KACHI3,
|
||||
BGM_KACHI5,
|
||||
BGM_PCC,
|
||||
BGM_NIBI,
|
||||
BGM_SUIKUN,
|
||||
BGM_DOORO1,
|
||||
BGM_DOORO_X1,
|
||||
BGM_DOORO_X3,
|
||||
BGM_MACHI_S2,
|
||||
BGM_MACHI_S4,
|
||||
BGM_GIM,
|
||||
BGM_NAMINORI,
|
||||
BGM_DAN01,
|
||||
/*0x15E*/ BGM_TETSUJI,
|
||||
/*0x15F*/ BGM_FIELD13,
|
||||
/*0x160*/ BGM_KACHI22,
|
||||
/*0x161*/ BGM_KACHI2,
|
||||
/*0x162*/ BGM_KACHI3,
|
||||
/*0x163*/ BGM_KACHI5,
|
||||
/*0x164*/ BGM_PCC,
|
||||
/*0x165*/ BGM_NIBI,
|
||||
/*0x166*/ BGM_SUIKUN,
|
||||
/*0x167*/ BGM_DOORO1,
|
||||
/*0x168*/ BGM_DOORO_X1,
|
||||
/*0x169*/ BGM_DOORO_X3,
|
||||
/*0x16A*/ BGM_MACHI_S2,
|
||||
/*0x16B*/ BGM_MACHI_S4,
|
||||
/*0x16C*/ BGM_GIM,
|
||||
/*0x16D*/ BGM_NAMINORI,
|
||||
/*0x16E*/ BGM_DAN01,
|
||||
/*0x16F*/ BGM_FANFA1,
|
||||
/*0x170*/ BGM_ME_ASA,
|
||||
/*0x171*/ BGM_ME_BACHI,
|
||||
@@ -306,31 +306,31 @@ enum
|
||||
/*0x191*/ BGM_NEXTROAD,
|
||||
/*0x192*/ BGM_GRANROAD,
|
||||
/*0x193*/ BGM_CYCLING,
|
||||
BGM_FRIENDLY,
|
||||
BGM_MISHIRO,
|
||||
BGM_TOZAN,
|
||||
BGM_GIRLEYE,
|
||||
BGM_MINAMO,
|
||||
BGM_ASHROAD,
|
||||
BGM_EVENT0,
|
||||
BGM_DEEPDEEP,
|
||||
BGM_KACHI1,
|
||||
BGM_TITLE3,
|
||||
BGM_DEMO1,
|
||||
BGM_GIRL_SUP,
|
||||
BGM_HAGESHII,
|
||||
BGM_KAKKOII,
|
||||
BGM_KAZANBAI,
|
||||
BGM_AQA_0,
|
||||
BGM_TSURETEK,
|
||||
BGM_BOY_SUP,
|
||||
BGM_RAINBOW,
|
||||
BGM_AYASII,
|
||||
BGM_KACHI4,
|
||||
BGM_ROPEWAY,
|
||||
BGM_CASINO,
|
||||
BGM_HIGHTOWN,
|
||||
BGM_SAFARI,
|
||||
/*0x194*/ BGM_FRIENDLY,
|
||||
/*0x195*/ BGM_MISHIRO,
|
||||
/*0x196*/ BGM_TOZAN,
|
||||
/*0x197*/ BGM_GIRLEYE,
|
||||
/*0x198*/ BGM_MINAMO,
|
||||
/*0x199*/ BGM_ASHROAD,
|
||||
/*0x19A*/ BGM_EVENT0,
|
||||
/*0x19B*/ BGM_DEEPDEEP,
|
||||
/*0x19C*/ BGM_KACHI1,
|
||||
/*0x19D*/ BGM_TITLE3,
|
||||
/*0x19E*/ BGM_DEMO1,
|
||||
/*0x19F*/ BGM_GIRL_SUP,
|
||||
/*0x1A0*/ BGM_HAGESHII,
|
||||
/*0x1A1*/ BGM_KAKKOII,
|
||||
/*0x1A2*/ BGM_KAZANBAI,
|
||||
/*0x1A3*/ BGM_AQA_0,
|
||||
/*0x1A4*/ BGM_TSURETEK,
|
||||
/*0x1A5*/ BGM_BOY_SUP,
|
||||
/*0x1A6*/ BGM_RAINBOW,
|
||||
/*0x1A7*/ BGM_AYASII,
|
||||
/*0x1A8*/ BGM_KACHI4,
|
||||
/*0x1A9*/ BGM_ROPEWAY,
|
||||
/*0x1AA*/ BGM_CASINO,
|
||||
/*0x1AB*/ BGM_HIGHTOWN,
|
||||
/*0x1AC*/ BGM_SAFARI,
|
||||
BGM_C_ROAD,
|
||||
BGM_AJITO,
|
||||
BGM_M_BOAT,
|
||||
|
||||
@@ -212,14 +212,14 @@ struct Sprite
|
||||
u16 flags_5:1; //0x20
|
||||
u16 flags_6:1; //0x40
|
||||
u16 flags_7:1; //0x80
|
||||
/*0x3F*/ u16 hFlip:1;
|
||||
u16 vFlip:1;
|
||||
u16 animBeginning:1;
|
||||
u16 affineAnimBeginning:1;
|
||||
u16 animEnded:1;
|
||||
u16 affineAnimEnded:1;
|
||||
u16 usingSheet:1;
|
||||
u16 flags_f:1;
|
||||
/*0x3F*/ u16 hFlip:1; //1
|
||||
u16 vFlip:1; //2
|
||||
u16 animBeginning:1; //4
|
||||
u16 affineAnimBeginning:1; //8
|
||||
u16 animEnded:1; //0x10
|
||||
u16 affineAnimEnded:1; //0x20
|
||||
u16 usingSheet:1; //0x40
|
||||
u16 flags_f:1; //0x80
|
||||
|
||||
/*0x40*/ u16 sheetTileStart;
|
||||
|
||||
|
||||
@@ -2,10 +2,21 @@
|
||||
#define GUARD_unknown_task_H
|
||||
|
||||
// Exported type declarations
|
||||
struct UnknownTaskStruct
|
||||
{
|
||||
volatile void *dest;
|
||||
u32 control;
|
||||
u8 unk8;
|
||||
u8 unk9;
|
||||
};
|
||||
|
||||
extern struct UnknownTaskStruct gUnknown_0831AC70;
|
||||
|
||||
// Exported RAM declarations
|
||||
|
||||
// Exported ROM declarations
|
||||
void remove_some_task(void);
|
||||
void sub_80BA038(struct UnknownTaskStruct arg0);
|
||||
void sub_80BA0A8(void);
|
||||
|
||||
#endif //GUARD_unknown_task_H
|
||||
#endif // GUARD_unknown_task_H
|
||||
|
||||
Reference in New Issue
Block a user