papermario
Decompilation of Paper Mario
 
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Loading...
Searching...
No Matches
battle.h File Reference

Data Structures

struct  BattleMoveEntry
 
struct  ActorBlueprint
 
struct  FormationRow
 
struct  StaticFormationActor
 
struct  StaticFormationEntry
 
struct  Stage
 
struct  Battle
 Zero-terminated. More...
 
struct  StageListRow
 Zero-terminated. More...
 
struct  BattleArea
 
struct  ActorSounds
 
struct  ActorOffsets
 
struct  PlayerCelebrationAnimOptions
 
union  FormationRow.home
 

Macros

#define STAGE_MODEL_LIST_END   0
 
#define BTL_MOVE(name, script)
 
#define BTL_ITEM(name)
 
#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 }
 
#define EXEC_DEATH_NO_SPINNING   -12345
 
#define ACTOR_API_SKIP_ARG   -12345678
 
#define DANGER_THRESHOLD   5
 
#define PERIL_THRESHOLD   1
 
#define POPUP_MSG_ON   99
 
#define POPUP_MSG_OFF   0
 

Typedefs

typedef FormationRow Formation[]
 
typedef Battle BattleList[]
 
typedef StageListRow StageList[]
 

Enumerations

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
}
 
enum  BattleVars {
  BTL_VAR_DuplighostCopyFlags = 0 , BTL_VAL_Duplighost_HasCopied = 0x4 , BTL_VAR_HyperSync = 1 , BTL_VAL_HyperSync_None = 0 ,
  BTL_VAL_HyperSync_Done = 1 , BTL_VAL_HyperSync_Active = 2 , BTL_VAR_Magikoopa_LastIndexBoosted = 2 , BTL_VAR_LastCopiedPartner = 3 ,
  BTL_VAR_KoopatrolSummonCount_0 = 4 , BTL_VAR_KoopatrolSummonCount_1 = 5 , BTL_VAR_KoopatrolSummonCount_2 = 6 , BTL_VAR_KoopatrolSummonCount_3 = 7
}
 
enum  CommonActorVars { AVAR_DryBones_Collapsed = 8 , AVAR_SpearGuy_Generation = 1 , AVAR_JungleFuzzy_Generation = 0 }
 

Functions

void func_80072BCC (s32 arg0)
 
void load_demo_battle (u32 index)
 
Actorcreate_actor (Formation formation)
 

Variables

s32 bActorNames []
 
BattleArea gBattleAreas [0x30]
 
ActorSounds bActorSoundTable []
 
BattlegCurrentBattlePtr
 
ActorOffsets bActorOffsets []
 

Data Structure Documentation

◆ BattleMoveEntry

struct BattleMoveEntry
Data Fields
EvtScript * mainScript
u8 * romEnd
u8 * romStart
u8 * vramStart

◆ ActorBlueprint

struct ActorBlueprint
Data Fields
u8 airLiftChance
u8 coinReward
u8 escapeChance
s32 flags
Vec2b healthBarOffset
u8 hurricaneChance
EvtScript * initScript
u8 level
u8 maxHP
s16 partCount
struct ActorPartBlueprint * partsData
u8 powerBounceChance
Vec2b size
u8 spinSmashReq
u8 spookChance
Vec2b statusIconOffset
s32 * statusTable
Vec2b statusTextOffset
u8 type
char unk_04
char unk_0A[2]
u8 upAndAwayChance

◆ FormationRow

struct FormationRow
Data Fields
ActorBlueprint * actor
union FormationRow.home home
s32 priority Actors with higher priority values take their turn first.
s32 var0
s32 var1
s32 var2
s32 var3

◆ StaticFormationActor

struct StaticFormationActor
Data Fields
char unk_00[0x4]

◆ StaticFormationEntry

struct StaticFormationEntry
Data Fields
StaticFormationActor * actors
s32 numActors
char * sjisName
char * stageName
char unk_10[0x4]

◆ Stage

struct Stage
Data Fields
char * bg
s32 * foregroundModelList
const char * hit
EvtScript * postBattle
EvtScript * preBattle
const char * shape
s32 stageEnemyChance
s32 stageEnemyCount
Formation * stageFormation
char * texture

◆ Battle

struct Battle
Data Fields
Formation * formation
s32 formationSize
const char * name Debug SJIS name.
EvtScript * onBattleStart
Stage * stage

◆ StageListRow

struct StageListRow
Data Fields
const char * name Map ID.
Stage * stage

◆ BattleArea

struct BattleArea
Data Fields
BattleList * battles
void * dmaDest
void * dmaEnd
void * dmaStart
DmaTable * dmaTable
char * name JP debug name.
StageList * stages
s32 unused_18

◆ ActorSounds

struct ActorSounds
Data Fields
s16 delay[2] Number of frames to wait between walk/fly sounds. Negative values are in distance.
s32 fly[2]
s32 hurt
s32 jump
s32 walk[2]

◆ ActorOffsets

struct ActorOffsets
Data Fields
s8 shadow
Vec3b tattleCam

◆ PlayerCelebrationAnimOptions

struct PlayerCelebrationAnimOptions
Data Fields
s16 hpBasedChance
s32 options[80]
s16 randomChance

◆ FormationRow.home

union FormationRow.home
Data Fields
s32 index
Vec3i * vec

Macro Definition Documentation

◆ ACTOR_API_SKIP_ARG

#define ACTOR_API_SKIP_ARG   -12345678

◆ ACTOR_BY_IDX

#define ACTOR_BY_IDX ( _name,
_idx,
_priority,
args... )   { .actor = &_name, .home = { .index = _idx }, .priority = _priority, args }

Referenced by A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), and A().

◆ ACTOR_BY_POS

#define ACTOR_BY_POS ( _name,
_pos,
_priority,
args... )   { .actor = &_name, .home = { .vec = &_pos }, .priority = _priority, args }

Referenced by A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), and A().

◆ BATTLE

#define BATTLE ( formation,
stage,
name )   { name, ARRAY_COUNT(formation), (Formation*) formation, &stage }

Referenced by A().

◆ BATTLE_WITH_SCRIPT

#define BATTLE_WITH_SCRIPT ( formation,
stage,
script,
name )   { name, ARRAY_COUNT(formation), (Formation*) formation, &stage, &script }

Referenced by A().

◆ BTL_ITEM

#define BTL_ITEM ( name)
Value:
{ \
.romStart = name##_ROM_START, \
.romEnd = name##_ROM_END, \
.vramStart = name##_VRAM, \
.mainScript = &battle_item_##name##_##EVS_UseItem \
}

◆ BTL_MOVE

#define BTL_MOVE ( name,
script )
Value:
{ \
.romStart = battle_move_##name##_ROM_START, \
.romEnd = battle_move_##name##_ROM_END, \
.vramStart = battle_move_##name##_VRAM, \
.mainScript = &battle_move_##name##_##script \
}

◆ DANGER_THRESHOLD

◆ EXEC_DEATH_NO_SPINNING

#define EXEC_DEATH_NO_SPINNING   -12345

◆ PERIL_THRESHOLD

◆ POPUP_MSG_OFF

#define POPUP_MSG_OFF   0

Referenced by action_command_free(), and update().

◆ POPUP_MSG_ON

#define POPUP_MSG_ON   99

Referenced by update().

◆ STAGE

#define STAGE ( _name,
_stage )   { .name = _name, .stage = &_stage }

Referenced by A().

◆ STAGE_MODEL_LIST_END

Typedef Documentation

◆ BattleList

typedef Battle BattleList[]

◆ Formation

typedef FormationRow Formation[]

◆ StageList

typedef StageListRow StageList[]

Enumeration Type Documentation

◆ BattleAreaIDs

Enumerator
BTL_AREA_KMR_1 
BTL_AREA_KMR_2 
BTL_AREA_KMR_3 
BTL_AREA_MAC 
BTL_AREA_HOS 
BTL_AREA_NOK 
BTL_AREA_TRD_1 
BTL_AREA_TRD_2 
BTL_AREA_TRD_3 
BTL_AREA_IWA 
BTL_AREA_SBK 
BTL_AREA_ISK_1 
BTL_AREA_ISK_2 
BTL_AREA_MIM 
BTL_AREA_ARN 
BTL_AREA_DGB 
BTL_AREA_OMO 
BTL_AREA_OMO2 
BTL_AREA_OMO3 
BTL_AREA_KGR 
BTL_AREA_JAN 
BTL_AREA_JAN2 
BTL_AREA_KZN 
BTL_AREA_KZN2 
BTL_AREA_FLO 
BTL_AREA_FLO2 
BTL_AREA_TIK 
BTL_AREA_TIK2 
BTL_AREA_TIK3 
BTL_AREA_SAM 
BTL_AREA_SAM2 
BTL_AREA_PRA 
BTL_AREA_PRA2 
BTL_AREA_PRA3 
BTL_AREA_KPA 
BTL_AREA_KPA2 
BTL_AREA_KPA3 
BTL_AREA_KPA4 
BTL_AREA_KKJ 
BTL_AREA_DIG 
BTL_AREA_UNUSED_28 
BTL_AREA_OMO2_1 
BTL_AREA_OMO2_2 
BTL_AREA_OMO2_3 
BTL_AREA_OMO2_4 
BTL_AREA_OMO2_5 
BTL_AREA_OMO2_6 

◆ BattlePositions

Enumerator
BTL_POS_GROUND_A 
BTL_POS_GROUND_B 
BTL_POS_GROUND_C 
BTL_POS_GROUND_D 
BTL_POS_AIR_A 
BTL_POS_AIR_B 
BTL_POS_AIR_C 
BTL_POS_AIR_D 
BTL_POS_HIGH_A 
BTL_POS_HIGH_B 
BTL_POS_HIGH_C 
BTL_POS_HIGH_D 
BTL_POS_TOP_A 
BTL_POS_TOP_B 
BTL_POS_TOP_C 
BTL_POS_TOP_D 
BTL_POS_CENTER 

◆ BattleVars

enum BattleVars
Enumerator
BTL_VAR_DuplighostCopyFlags 
BTL_VAL_Duplighost_HasCopied 
BTL_VAR_HyperSync 
BTL_VAL_HyperSync_None 
BTL_VAL_HyperSync_Done 
BTL_VAL_HyperSync_Active 
BTL_VAR_Magikoopa_LastIndexBoosted 
BTL_VAR_LastCopiedPartner 
BTL_VAR_KoopatrolSummonCount_0 
BTL_VAR_KoopatrolSummonCount_1 
BTL_VAR_KoopatrolSummonCount_2 
BTL_VAR_KoopatrolSummonCount_3 

◆ CommonActorVars

Enumerator
AVAR_DryBones_Collapsed 
AVAR_SpearGuy_Generation 
AVAR_JungleFuzzy_Generation 

Function Documentation

◆ create_actor()

Actor * create_actor ( Formation formation)

◆ func_80072BCC()

void func_80072BCC ( s32 arg0)

◆ load_demo_battle()

void load_demo_battle ( u32 index)

Referenced by state_step_demo().

Variable Documentation

◆ bActorNames

s32 bActorNames[]
extern

◆ bActorOffsets

ActorOffsets bActorOffsets[]
extern

◆ bActorSoundTable

◆ gBattleAreas

BattleArea gBattleAreas[0x30]
extern

Referenced by load_battle_section().

◆ gCurrentBattlePtr

Battle* gCurrentBattlePtr
extern