Alchemy
Loading...
Searching...
No Matches

battle.h File Reference

The battle bank's routines and globals, as the other banks see them. More...

Go to the source code of this file.

Data Structures

struct  CameraWork
 The battle camera (struct BattleCamera) as the effects that swing it see it. More...
struct  EffectVector
 A world position, as Camera_WorldToScreen converts it to the screen. More...
struct  Ring
 One of the star field's three rings, moving outward on the effect canvas. More...
struct  ScatterPosition
 The position an item-break effect spawns its objects and shards from. More...

Enumerations

enum  BattlePose {
  POSE_ENEMY_HELD = 0 , POSE_STANDING = 1 , POSE_PARTY_HELD = 4 , POSE_DAMAGE = 5 ,
  POSE_ENEMY_DOWN = 5
}
 The battle sprites' animations (AnimationObjects_SelectAnimation numbers) that the battle code picks by name. More...

Functions

u32 __udivsi3 (u32 numerator, u32 denominator)
void _call_via_r0 (u32 routine)
void Animation_ApplyChildArgumentFar (void *, s32)
void BitDecoder_DecodeImage (void)
void FarCall_WindowTable (void)
struct AnimationObject * GetBattleEffectObject (s32 kind)
void ItemIcon_LoadTilesFar (s32 item)
s32 Object_InitializeMode (struct AnimationObject *state, s32 flags)

Variables

u16 gBattleFx_CyclePatternWords []
 An angle for each value of the right, left, up and down bits of the +Control Pad; 0xffff for none.
s8 gBattleFx_RandomChildValues []
const s8 gBattlePlacement_StepPairs []
u8 gPlayerObjectId []
u16 gResource_SlotAssignments []
u8 gAnimation_ChildPaletteCycle []
 The palette cycle of Animation_ChildPaletteCycle ((gFrameCount >> 1) & 7).
u8 gBattleCommand_SelectionWeights [3][8]
const u8 gBattleFx_ArcSparkTiles []
const s32 gBattleFx_BurstParticleObjectScript []
 Word +4 is gBattleFx_HeavyImpactScript.
struct BattleEffectEntry gBattleFx_DefinitionTable []
 Speaker definitions: {sprite, portrait (0xff for none), idle line flags}.
const s32 gBattleFx_LinkedObjectScript []
const s32 gBattleFx_MarkerParticleScript []
const s32 gBattleFx_ParticleEmitterScript []
 Grows from half size to full size, a step every 2 frames.
const s32 gBattleFx_ParticleScript []
 Rises for 60 frames, then disappears.
u32 gBattleFx_PulseScales []
 Two scales that alternate ((gFrameTick >> 2) & 1); nothing reads the third word.
const s32 gBattleFx_SourceHoldScript []
s16 gBattleFx_TargetRangeByMode []
 {field Psynergy kind, range in pixels}, ended by -1; a kind not listed reaches 16 pixels.
const s32 gBattleFx_UntargetedObjectScript []
s32 gBattleMotion_VariantAcceleration []
s32 gBattleMotion_VariantDistancePercent []
s32 gBattleMotion_VariantSpeedLimit []
s32 gBattleMotion_VariantVelocityY []
s8 gBattleParty_CenterOrderOffsets []
const struct BattleGroupOrder gBattleParty_RoundEndGroupOrder
const s32 gBattlePres_ActorObjectScript []
u8 gBattlePres_AdvanceArrowTiles []
const u8 gBattlePres_CurtainTiles []
const u8 gBattlePres_TileVariants []
u16 gBattleUnit_WeaponAnimsClass1 []
u16 gBattleUnit_WeaponAnimsClass2 []
u16 gBattleUnit_WeaponAnimsClass3 []
u16 gBattleUnit_WeaponAnimsClass5 []
u8 BitDecoder_Size []
u8 gCamera_FlagTransformWork []
const u8 gBattleFx_SparkTiles []
const u8 gBattleFx_QuadrantModes []
const s32 gBattleFx_TargetColors []
s32 gBattleFx_StarWorkOffsets []
u8 gBattleFx_StarSizes []
s32 gBattleFx_RingFrameOffsets []
s8 gBattleFx_HighlightBlendRamp []
u16 gEncounter_EnemyGroupTable []
s16 gFieldFx_GroundParticleFrames []
 {dx, dy, tile, shape, size} for each of 16 frames.
const u8 gFieldFx_GroundParticleTiles []
struct WaveFxWork * gBattleBgFxWork
void * gBattleFxWork []
u8 * gBattleOwnerStates
u32 gRandomSeed
struct BattlePresentationTransition * gTransitionWork
const u8 gObjectMotion_LinkedActionScript []
const s16 gParty_PairResolveRules []
const s32 gBattleFx_RisingPulseScript []
 Pulses twice, then rests, over and over.
u16 gBattleUnit_WeaponAnimsClass0 []
u16 gBattleFormation_LevelMatchedEnemies []
s32 gBattle_BackdropScenes []
const u32 BattleFx_Composite []
u8 gUi_RenderResultValues []
const u16 gWorldMap_CursorDirectionAngles []
 An angle for each +Control Pad direction (eight of them); 0xffff for none.
const u8 gWorldMap_MarkerBlendCycle []
 The brightness of the world map markers ((gFrameCount >> 1) & 31).
const s32 gWorldMap_PlaceMarkers []

Detailed Description

The battle bank's routines and globals, as the other banks see them.

Definition in file battle.h.

Enumeration Type Documentation

◆ BattlePose

enum BattlePose

The battle sprites' animations (AnimationObjects_SelectAnimation numbers) that the battle code picks by name.

Enumerator
POSE_ENEMY_HELD 

an enemy asleep, stunned or held

POSE_STANDING 
POSE_PARTY_HELD 

asleep, stunned or held; also a downed member

POSE_DAMAGE 

taking damage

POSE_ENEMY_DOWN 

a downed enemy stays in its damage pose

Definition at line 172 of file battle.h.

Function Documentation

◆ __udivsi3()

u32 __udivsi3 ( u32 numerator,
u32 denominator )

Referenced by __udivsi3().

◆ _call_via_r0()

void _call_via_r0 ( u32 routine)

◆ Animation_ApplyChildArgumentFar()

void Animation_ApplyChildArgumentFar ( void * ,
s32  )

◆ BitDecoder_DecodeImage()

void BitDecoder_DecodeImage ( void )

◆ FarCall_WindowTable()

void FarCall_WindowTable ( void )

Referenced by FarCall_WindowTable().

◆ GetBattleEffectObject()

struct AnimationObject * GetBattleEffectObject ( s32 kind)

Referenced by GetBattleEffectObject().

◆ ItemIcon_LoadTilesFar()

void ItemIcon_LoadTilesFar ( s32 item)

◆ Object_InitializeMode()

s32 Object_InitializeMode ( struct AnimationObject * state,
s32 flags )

Variable Documentation

◆ gBattleFx_CyclePatternWords

u16 gBattleFx_CyclePatternWords[]
extern

An angle for each value of the right, left, up and down bits of the +Control Pad; 0xffff for none.

Definition at line 466 of file fxdata.c.

Referenced by Input_GetDpadAngle().

◆ gBattleFx_RandomChildValues

s8 gBattleFx_RandomChildValues[]
extern

Definition at line 506 of file fxdata.c.

Referenced by BattleEffect_SetRandomTableValueOnObject().

◆ gBattlePlacement_StepPairs

const s8 gBattlePlacement_StepPairs[]
extern

◆ gPlayerObjectId

u8 gPlayerObjectId[]
extern

◆ gResource_SlotAssignments

u16 gResource_SlotAssignments[]
extern

◆ gAnimation_ChildPaletteCycle

u8 gAnimation_ChildPaletteCycle[]
extern

The palette cycle of Animation_ChildPaletteCycle ((gFrameCount >> 1) & 7).

Definition at line 53 of file fxdata.c.

Referenced by Animation_ApplyChildPalette().

◆ gBattleCommand_SelectionWeights

u8 gBattleCommand_SelectionWeights[3][8]
extern

◆ gBattleFx_ArcSparkTiles

const u8 gBattleFx_ArcSparkTiles[]
extern

Referenced by FieldFx_RunAvoid().

◆ gBattleFx_BurstParticleObjectScript

const s32 gBattleFx_BurstParticleObjectScript[]
extern

Word +4 is gBattleFx_HeavyImpactScript.

Definition at line 476 of file fxdata.c.

Referenced by FieldFx_RunForce(), and FieldFx_RunGrowth().

◆ gBattleFx_DefinitionTable

struct BattleEffectEntry gBattleFx_DefinitionTable[]
extern

Speaker definitions: {sprite, portrait (0xff for none), idle line flags}.

BattleFx_FindDefinition searches all 131; the last is the default.

Definition at line 163 of file fxdata.c.

Referenced by BattleFx_FindDefinition().

◆ gBattleFx_LinkedObjectScript

const s32 gBattleFx_LinkedObjectScript[]
extern

Referenced by BattleFx_SpawnLinked().

◆ gBattleFx_MarkerParticleScript

const s32 gBattleFx_MarkerParticleScript[]
extern

Definition at line 114 of file fxdata.c.

Referenced by FieldEffect_SpawnNearbyMarkers().

◆ gBattleFx_ParticleEmitterScript

const s32 gBattleFx_ParticleEmitterScript[]
extern

Grows from half size to full size, a step every 2 frames.

Definition at line 56 of file fxdata.c.

Referenced by BattleFx_StartRandomParticleEmitter(), and EffectRuntime_RunRisingObjectSequence().

◆ gBattleFx_ParticleScript

const s32 gBattleFx_ParticleScript[]
extern

Rises for 60 frames, then disappears.

Definition at line 107 of file fxdata.c.

Referenced by BattleFx_StartRandomParticleEmitter(), and Object_InitializeSparkle().

◆ gBattleFx_PulseScales

u32 gBattleFx_PulseScales[]
extern

Two scales that alternate ((gFrameTick >> 2) & 1); nothing reads the third word.

Definition at line 440 of file fxdata.c.

Referenced by BattleFx_SetObjectAlternatingWords().

◆ gBattleFx_SourceHoldScript

const s32 gBattleFx_SourceHoldScript[]
extern

Definition at line 450 of file fxdata.c.

Referenced by BattleFx_SteerLiftedTarget(), and BattleFx_SteerPushedTarget().

◆ gBattleFx_TargetRangeByMode

s16 gBattleFx_TargetRangeByMode[]
extern

{field Psynergy kind, range in pixels}, ended by -1; a kind not listed reaches 16 pixels.

Definition at line 36 of file fxdata.c.

Referenced by Field_GetPsynergyTargetRange().

◆ gBattleFx_UntargetedObjectScript

const s32 gBattleFx_UntargetedObjectScript[]
extern

◆ gBattleMotion_VariantAcceleration

s32 gBattleMotion_VariantAcceleration[]
extern

◆ gBattleMotion_VariantDistancePercent

s32 gBattleMotion_VariantDistancePercent[]
extern

◆ gBattleMotion_VariantSpeedLimit

s32 gBattleMotion_VariantSpeedLimit[]
extern

◆ gBattleMotion_VariantVelocityY

s32 gBattleMotion_VariantVelocityY[]
extern

◆ gBattleParty_CenterOrderOffsets

s8 gBattleParty_CenterOrderOffsets[]
extern

◆ gBattleParty_RoundEndGroupOrder

const struct BattleGroupOrder gBattleParty_RoundEndGroupOrder
extern

Referenced by Battle_ProcessRoundEnd().

◆ gBattlePres_ActorObjectScript

const s32 gBattlePres_ActorObjectScript[]
extern

Referenced by BattleObjMake().

◆ gBattlePres_AdvanceArrowTiles

u8 gBattlePres_AdvanceArrowTiles[]
extern

◆ gBattlePres_CurtainTiles

const u8 gBattlePres_CurtainTiles[]
extern

◆ gBattlePres_TileVariants

const u8 gBattlePres_TileVariants[]
extern

◆ gBattleUnit_WeaponAnimsClass1

u16 gBattleUnit_WeaponAnimsClass1[]
extern

◆ gBattleUnit_WeaponAnimsClass2

u16 gBattleUnit_WeaponAnimsClass2[]
extern

◆ gBattleUnit_WeaponAnimsClass3

u16 gBattleUnit_WeaponAnimsClass3[]
extern

◆ gBattleUnit_WeaponAnimsClass5

u16 gBattleUnit_WeaponAnimsClass5[]
extern

◆ BitDecoder_Size

u8 BitDecoder_Size[]
extern

Referenced by BattleBackground_Load().

◆ gCamera_FlagTransformWork

u8 gCamera_FlagTransformWork[]
extern

◆ gBattleFx_SparkTiles

const u8 gBattleFx_SparkTiles[]
extern

◆ gBattleFx_QuadrantModes

const u8 gBattleFx_QuadrantModes[]
extern

Definition at line 473 of file fxdata.c.

Referenced by BattleFx_SteerPushedTarget().

◆ gBattleFx_TargetColors

const s32 gBattleFx_TargetColors[]
extern

◆ gBattleFx_StarWorkOffsets

s32 gBattleFx_StarWorkOffsets[]
extern

◆ gBattleFx_StarSizes

u8 gBattleFx_StarSizes[]
extern

◆ gBattleFx_RingFrameOffsets

s32 gBattleFx_RingFrameOffsets[]
extern

◆ gBattleFx_HighlightBlendRamp

s8 gBattleFx_HighlightBlendRamp[]
extern

◆ gEncounter_EnemyGroupTable

u16 gEncounter_EnemyGroupTable[]
extern

◆ gFieldFx_GroundParticleFrames

s16 gFieldFx_GroundParticleFrames[]
extern

{dx, dy, tile, shape, size} for each of 16 frames.

Definition at line 383 of file fxdata.c.

Referenced by FieldFx_UpdateGroundParticles().

◆ gFieldFx_GroundParticleTiles

const u8 gFieldFx_GroundParticleTiles[]
extern

◆ gBattleBgFxWork

◆ gBattleFxWork

◆ gBattleOwnerStates

u8* gBattleOwnerStates
extern

Referenced by Battle_RunEncounter(), and UnitGet().

◆ gRandomSeed

◆ gTransitionWork

◆ gObjectMotion_LinkedActionScript

const u8 gObjectMotion_LinkedActionScript[]
extern

◆ gParty_PairResolveRules

const s16 gParty_PairResolveRules[]
extern

◆ gBattleFx_RisingPulseScript

const s32 gBattleFx_RisingPulseScript[]
extern

Pulses twice, then rests, over and over.

Definition at line 75 of file fxdata.c.

Referenced by ItemDisplay_RaiseAboveLeader().

◆ gBattleUnit_WeaponAnimsClass0

u16 gBattleUnit_WeaponAnimsClass0[]
extern

◆ gBattleFormation_LevelMatchedEnemies

u16 gBattleFormation_LevelMatchedEnemies[]
extern

◆ gBattle_BackdropScenes

s32 gBattle_BackdropScenes[]
extern

◆ BattleFx_Composite

const u32 BattleFx_Composite[]
extern

Referenced by BattleFx_BuildBlitter().

◆ gUi_RenderResultValues

u8 gUi_RenderResultValues[]
extern

◆ gWorldMap_CursorDirectionAngles

const u16 gWorldMap_CursorDirectionAngles[]
extern

An angle for each +Control Pad direction (eight of them); 0xffff for none.

Definition at line 515 of file fxdata.c.

Referenced by Map_UpdateWorldMapMarkers().

◆ gWorldMap_MarkerBlendCycle

const u8 gWorldMap_MarkerBlendCycle[]
extern

The brightness of the world map markers ((gFrameCount >> 1) & 31).

Definition at line 509 of file fxdata.c.

Referenced by Map_UpdateWorldMapMarkers().

◆ gWorldMap_PlaceMarkers

const s32 gWorldMap_PlaceMarkers[]
extern