papermario/src/battle/battle.h

469 lines
18 KiB
C

#ifndef _BATTLE_BATTLE_H_
#define _BATTLE_BATTLE_H_
#include "common.h"
#include "message_ids.h"
// Terminates foreground model lists
#define STAGE_MODEL_LIST_END 0
enum BattleAreaIDs {
BTL_AREA_KMR_1 = 0x00,
BTL_AREA_KMR_2 = 0x01,
BTL_AREA_KMR_3 = 0x02,
BTL_AREA_MAC = 0x03,
BTL_AREA_HOS = 0x04,
BTL_AREA_NOK = 0x05,
BTL_AREA_TRD_1 = 0x06,
BTL_AREA_TRD_2 = 0x07,
BTL_AREA_TRD_3 = 0x08,
BTL_AREA_IWA = 0x09,
BTL_AREA_SBK = 0x0A,
BTL_AREA_ISK_1 = 0x0B,
BTL_AREA_ISK_2 = 0x0C,
BTL_AREA_MIM = 0x0D,
BTL_AREA_ARN = 0x0E,
BTL_AREA_DGB = 0x0F,
BTL_AREA_OMO = 0x10,
BTL_AREA_OMO2 = 0x11,
BTL_AREA_OMO3 = 0x12,
BTL_AREA_KGR = 0x13,
BTL_AREA_JAN = 0x14,
BTL_AREA_JAN2 = 0x15,
BTL_AREA_KZN = 0x16,
BTL_AREA_KZN2 = 0x17,
BTL_AREA_FLO = 0x18,
BTL_AREA_FLO2 = 0x19,
BTL_AREA_TIK = 0x1A,
BTL_AREA_TIK2 = 0x1B,
BTL_AREA_TIK3 = 0x1C,
BTL_AREA_SAM = 0x1D,
BTL_AREA_SAM2 = 0x1E,
BTL_AREA_PRA = 0x1F,
BTL_AREA_PRA2 = 0x20,
BTL_AREA_PRA3 = 0x21,
BTL_AREA_KPA = 0x22,
BTL_AREA_KPA2 = 0x23,
BTL_AREA_KPA3 = 0x24,
BTL_AREA_KPA4 = 0x25,
BTL_AREA_KKJ = 0x26,
BTL_AREA_DIG = 0x27,
BTL_AREA_UNUSED_28 = 0x28,
BTL_AREA_OMO2_1 = 0x29,
BTL_AREA_OMO2_2 = 0x2A,
BTL_AREA_OMO2_3 = 0x2B,
BTL_AREA_OMO2_4 = 0x2C,
BTL_AREA_OMO2_5 = 0x2D,
BTL_AREA_OMO2_6 = 0x2E,
};
enum BattlePositions {
BTL_POS_GROUND_A = 0,
BTL_POS_GROUND_B = 1,
BTL_POS_GROUND_C = 2,
BTL_POS_GROUND_D = 3,
BTL_POS_AIR_A = 4,
BTL_POS_AIR_B = 5,
BTL_POS_AIR_C = 6,
BTL_POS_AIR_D = 7,
BTL_POS_HIGH_A = 8,
BTL_POS_HIGH_B = 9,
BTL_POS_HIGH_C = 10,
BTL_POS_HIGH_D = 11,
BTL_POS_TOP_A = 12,
BTL_POS_TOP_B = 13,
BTL_POS_TOP_C = 14,
BTL_POS_TOP_D = 15,
BTL_POS_CENTER = 16,
};
typedef enum ActorType {
ACTOR_TYPE_RED_GOOMBA = 0x00,
ACTOR_TYPE_RED_PARAGOOMBA = 0x01,
ACTOR_TYPE_GLOOMBA = 0x02,
ACTOR_TYPE_PARAGLOOMBA = 0x03,
ACTOR_TYPE_SPIKED_GLOOMBA = 0x04,
ACTOR_TYPE_DARK_KOOPA = 0x05,
ACTOR_TYPE_DARK_PARATROOPA = 0x06,
ACTOR_TYPE_GOOMBA = 0x07,
ACTOR_TYPE_PARAGOOMBA = 0x08,
ACTOR_TYPE_SPIKED_GOOMBA = 0x09,
ACTOR_TYPE_FUZZY = 0x0A,
ACTOR_TYPE_KOOPA_TROOPA = 0x0B,
ACTOR_TYPE_PARATROOPA = 0x0C,
ACTOR_TYPE_BOB_OMB = 0x0D,
ACTOR_TYPE_BOB_OMB_DUP = 0x0E,
ACTOR_TYPE_BULLET_BILL = 0x0F,
ACTOR_TYPE_BILL_BLASTER = 0x10,
ACTOR_TYPE_CLEFT = 0x11,
ACTOR_TYPE_MONTY_MOLE = 0x12,
ACTOR_TYPE_BANDIT = 0x13,
ACTOR_TYPE_POKEY = 0x14,
ACTOR_TYPE_POKEY_MUMMY = 0x15,
ACTOR_TYPE_SWOOPER = 0x16,
ACTOR_TYPE_BUZZY_BEETLE = 0x17,
ACTOR_TYPE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OOPER = 0x3D,
ACTOR_TYPE_GHOST_BOMBETTE = 0x3E,
ACTOR_TYPE_GHOST_PARAKARRY = 0x3F,
ACTOR_TYPE_GHOST_BOW = 0x40,
ACTOR_TYPE_GHOST_WATT = 0x41,
ACTOR_TYPE_GHOST_SUSHIE = 0x42,
ACTOR_TYPE_GHOST_LAKILESTER = 0x43,
ACTOR_TYPE_ALBINO_DINO = 0x44,
ACTOR_TYPE_EMBER = 0x45,
ACTOR_TYPE_BONY_BEETLE = 0x46,
ACTOR_TYPE_DRY_BONES = 0x47,
ACTOR_TYPE_DRY_BONES2 = 0x48,
ACTOR_TYPE_BOMBSHELL_BLASTER = 0x49,
ACTOR_TYPE_BOMBSHELL_BILL = 0x4A,
ACTOR_TYPE_HAMMER_BROS = 0x4B,
ACTOR_TYPE_KOOPATROL = 0x4C,
ACTOR_TYPE_MAGIKOOPA = 0x4D,
ACTOR_TYPE_FLYING_MAGIKOOPA = 0x4E,
ACTOR_TYPE_MAGICLONE = 0x4F,
ACTOR_TYPE_FLYING_MAGICLONE = 0x50,
ACTOR_TYPE_RED_MAGIKOOPA = 0x51,
ACTOR_TYPE_FLYING_RED_MAGIKOOPA = 0x52,
ACTOR_TYPE_GREEN_MAGIKOOPA = 0x53,
ACTOR_TYPE_FLYING_GREEN_MAGIKOOPA = 0x54,
ACTOR_TYPE_YELLOW_MAGIKOOPA = 0x55,
ACTOR_TYPE_FLYING_YELLOW_MAGIKOOPA = 0x56,
ACTOR_TYPE_GRAY_MAGIKOOPA = 0x57,
ACTOR_TYPE_FLYING_GRAY_MAGIKOOPA = 0x58,
ACTOR_TYPE_WHITE_MAGIKOOPA = 0x59,
ACTOR_TYPE_FLYING_WHITE_MAGIKOOPA = 0x5A,
ACTOR_TYPE_UNUSED_5B = 0x5B,
ACTOR_TYPE_UNUSED_5C = 0x5C,
ACTOR_TYPE_UNUSED_5D = 0x5D,
ACTOR_TYPE_UNUSED_5E = 0x5E,
ACTOR_TYPE_UNUSED_5F = 0x5F,
ACTOR_TYPE_UNUSED_60 = 0x60,
ACTOR_TYPE_UNUSED_61 = 0x61,
ACTOR_TYPE_UNUSED_62 = 0x62,
ACTOR_TYPE_UNUSED_63 = 0x63,
ACTOR_TYPE_UNUSED_64 = 0x64,
ACTOR_TYPE_UNUSED_65 = 0x65,
ACTOR_TYPE_UNUSED_66 = 0x66,
ACTOR_TYPE_UNUSED_67 = 0x67,
ACTOR_TYPE_UNUSED_68 = 0x68,
ACTOR_TYPE_UNUSED_69 = 0x69,
ACTOR_TYPE_UNUSED_6A = 0x6A,
ACTOR_TYPE_MONTY_HOLE = 0x6B,
ACTOR_TYPE_UNUSED_6C = 0x6C,
ACTOR_TYPE_UNUSED_6D = 0x6D,
ACTOR_TYPE_PLAYER = 0x6E,
ACTOR_TYPE_GOOMBARIO = 0x6F,
ACTOR_TYPE_KOOPER = 0x70,
ACTOR_TYPE_BOMBETTE = 0x71,
ACTOR_TYPE_PARAKARRY = 0x72,
ACTOR_TYPE_BOW = 0x73,
ACTOR_TYPE_WATT = 0x74,
ACTOR_TYPE_SUSHIE = 0x75,
ACTOR_TYPE_LAKILESTER = 0x76,
ACTOR_TYPE_TWINK = 0x77,
ACTOR_TYPE_UNUSED_78 = 0x78,
ACTOR_TYPE_UNUSED_79 = 0x79,
ACTOR_TYPE_THE_MASTER_1 = 0x7A,
ACTOR_TYPE_THE_MASTER_2 = 0x7B,
ACTOR_TYPE_THE_MASTER_3 = 0x7C,
ACTOR_TYPE_CHAN = 0x7D,
ACTOR_TYPE_LEE = 0x7E,
ACTOR_TYPE_LEE_GOOMBARIO = 0x7F,
ACTOR_TYPE_LEE_KOOPER = 0x80,
ACTOR_TYPE_LEE_BOMBETTE = 0x81,
ACTOR_TYPE_LEE_PARAKARRY = 0x82,
ACTOR_TYPE_LEE_BOW = 0x83,
ACTOR_TYPE_LEE_WATT = 0x84,
ACTOR_TYPE_LEE_SUSHIE = 0x85,
ACTOR_TYPE_LEE_LAKILESTER = 0x86,
ACTOR_TYP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PE_SUPER_BLOOPER1 = 0xCA,
ACTOR_TYPE_SUPER_BLOOPER2 = 0xCB,
ACTOR_TYPE_BLOOPER_BABY = 0xCC,
ACTOR_TYPE_LAKILESTER_DUP = 0xCD,
ACTOR_TYPE_SLOT_MACHINE_START = 0xCE,
ACTOR_TYPE_SLOT_MACHINE_STOP = 0xCF,
ACTOR_TYPE_WHACKA = 0xD0,
ACTOR_TYPE_SLOT_MACHINE_START_DUP1 = 0xD1,
ACTOR_TYPE_SLOT_MACHINE_START_DUP2 = 0xD2,
ACTOR_TYPE_SLOT_MACHINE_START_DUP3 = 0xD3,
ACTOR_TYPE_COUNT = 0xD4,
} ActorType;
extern s32 bActorNames[];
typedef struct BattleMoveEntry {
/* 0x00 */ u8* romStart;
/* 0x04 */ u8* romEnd;
/* 0x08 */ u8* vramStart;
/* 0x0C */ EvtScript* mainScript;
} BattleMoveEntry; // size = 0x10
#define BTL_MOVE(name, script) \
{ \
.romStart = battle_move_##name##_ROM_START, \
.romEnd = battle_move_##name##_ROM_END, \
.vramStart = battle_move_##name##_VRAM, \
.mainScript = &battle_move_##name##_##script \
}
#define BTL_ITEM(name) \
{ \
.romStart = name##_ROM_START, \
.romEnd = name##_ROM_END, \
.vramStart = name##_VRAM, \
.mainScript = &battle_item_##name##_##EVS_UseItem \
}
typedef struct ActorBlueprint {
/* 0x00 */ s32 flags;
/* 0x04 */ char unk_04;
/* 0x05 */ u8 type;
/* 0x06 */ u8 level;
/* 0x07 */ u8 maxHP;
/* 0x08 */ s16 partCount;
/* 0x0A */ char unk_0A[2];
/* 0x0C */ struct ActorPartBlueprint* partsData;
/* 0x10 */ EvtScript* initScript;
/* 0x14 */ s32* statusTable;
/* 0x18 */ u8 escapeChance;
/* 0x19 */ u8 airLiftChance;
/* 0x1A */ u8 hurricaneChance;
/* 0x1B */ u8 spookChance;
/* 0x1C */ u8 upAndAwayChance;
/* 0x1D */ u8 spinSmashReq;
/* 0x1E */ u8 powerBounceChance;
/* 0x1F */ u8 coinReward;
/* 0x20 */ Vec2b size;
/* 0x22 */ Vec2b healthBarOffset;
/* 0x24 */ Vec2b statusIconOffset;
/* 0x26 */ Vec2b statusTextOffset;
} ActorBlueprint; // size = 0x28
typedef struct FormationRow {
/* 0x00 */ ActorBlueprint* actor;
/* 0x04 */ union {
s32 index;
Vec3i* vec;
} home;
/* 0x08 */ s32 priority; ///< Actors with higher priority values take their turn first.
/* 0x0C */ s32 var0;
/* 0x10 */ s32 var1;
/* 0x14 */ s32 var2;
/* 0x18 */ s32 var3;
} FormationRow; // size = 0x1C * n
typedef FormationRow Formation[];
typedef struct StaticFormationActor {
/* 0x00 */ char unk_00[0x4];
} StaticFormationActor; // size = ??
typedef struct StaticFormationEntry {
/* 0x00 */ char* sjisName;
/* 0x04 */ s32 numActors;
/* 0x08 */ StaticFormationActor* actors;
/* 0x0C */ char* stageName;
/* 0x10 */ char unk_10[0x4];
} StaticFormationEntry; // size = 0x20
typedef struct Stage {
/* 0x00 */ char* texture;
/* 0x04 */ const char* shape;
/* 0x08 */ const char* hit;
/* 0x0C */ EvtScript* preBattle; // sets BattleStatus::controlScript on battle start
/* 0x10 */ EvtScript* postBattle; // sets BattleStatus::controlScript on battle end
/* 0x14 */ char* bg;
/* 0x18 */ s32* foregroundModelList;
/* 0x1C */ s32 stageEnemyCount; // number of enemies in the stageFormation
/* 0x20 */ Formation* stageFormation; // extra enemies native to this stage
/* 0x24 */ s32 stageEnemyChance; // 1/(N+1) chance for stageFormation enemies to spawn
} Stage; // size = 0x28
/// Zero-terminated.
typedef struct Battle {
/* 0x00 */ const char* name; ///< Debug SJIS name.
/* 0x04 */ s32 formationSize;
/* 0x08 */ Formation* formation;
/* 0x0C */ Stage* stage;
/* 0x10 */ EvtScript* onBattleStart; // sets BattleStatus::controlScript on battle start, overrides Stage::preBattle
} Battle; // size = 0x14
typedef Battle BattleList[];
/// Zero-terminated.
typedef struct StageListRow {
/* 0x00 */ const char* name; ///< Map ID.
/* 0x04 */ Stage* stage;
} StageListRow; // size = 0x08
typedef StageListRow StageList[];
typedef struct BattleArea {
/* 0x00 */ char* name; ///< JP debug name.
/* 0x04 */ void* dmaStart;
/* 0x08 */ void* dmaEnd;
/* 0x0C */ void* dmaDest;
/* 0x10 */ BattleList* battles;
/* 0x14 */ StageList* stages;
/* 0x18 */ s32 unused_18;
/* 0x1C */ DmaTable* dmaTable;
} BattleArea; // size = 0x20
extern BattleArea gBattleAreas[0x30];
#define BATTLE(formation, stage, name) { name, ARRAY_COUNT(formation), (Formation*) formation, &stage }
#define BATTLE_WITH_SCRIPT(formation, stage, script, name) { name, ARRAY_COUNT(formation), (Formation*) formation, &stage, &script }
#define ACTOR_BY_IDX(_name, _idx, _priority, args...) { .actor = &_name, .home = { .index = _idx }, .priority = _priority, args }
#define ACTOR_BY_POS(_name, _pos, _priority, args...) { .actor = &_name, .home = { .vec = &_pos }, .priority = _priority, args }
#define STAGE(_name, _stage) { .name = _name, .stage = &_stage }
typedef struct ActorSounds {
/* 0x00 */ s32 walk[2];
/* 0x08 */ s32 fly[2];
/* 0x10 */ s32 jump;
/* 0x14 */ s32 hurt;
/* 0x18 */ s16 delay[2]; ///< Number of frames to wait between walk/fly sounds. Negative values are in distance.
} ActorSounds; // size = 0x1C
extern ActorSounds bActorSoundTable[ACTOR_TYPE_COUNT];
typedef struct ActorOffsets {
/* 0x00 */ Vec3b tattleCam;
/* 0x03 */ s8 shadow;
} ActorOffsets; // size = 0x04
// TODO look into making options here better. it's really an array of 5 substructs, each having an [8][2] array
typedef struct PlayerCelebrationAnimOptions {
/* 0x00 */ s16 randomChance;
/* 0x02 */ s16 hpBasedChance;
/* 0x04 */ s32 options[80];
} PlayerCelebrationAnimOptions; // size = 0x8
extern Battle* gCurrentBattlePtr;
extern ActorOffsets bActorOffsets[ACTOR_TYPE_COUNT];
void func_80072BCC(s32 arg0);
void load_demo_battle(u32 index);
Actor* create_actor(Formation formation);
#define EXEC_DEATH_NO_SPINNING -12345
#define ACTOR_API_SKIP_ARG -12345678
#define DANGER_THRESHOLD 5
#define PERIL_THRESHOLD 1
#endif