Alchemy
Loading...
Searching...
No Matches

battle.h

Go to the documentation of this file.
1#ifndef BATTLE_H
2#define BATTLE_H
3
4/// @file
5/// The battle bank's routines and globals, as the other banks see them.
6
7#include "types.h"
8#include "edition.h"
9#include "vector3.h"
11#include "farcall.h"
12
15struct BattlePlan;
16struct BattleUnit;
17struct DispatchObject;
18struct EffectSlot;
19struct ObjectRuntime;
21
24extern const s8 gBattlePlacement_StepPairs[];
25extern u8 gPlayerObjectId[];
27struct BattleObj;
28
29struct AnimationEntry;
30struct AnimationObject;
31struct ArcEffectObject;
32struct ArcObject;
33struct ArcParticle;
34struct BattleAct;
38struct BattleEventState;
39struct BattleGroupOrder;
41struct BattleObj;
42struct BattlePlan;
45struct BattleUnit;
47struct EffectDescriptor;
48struct EffectSlot;
49struct EnemyDefinition;
50struct FieldActor;
51struct FxObject;
52struct SpriteScale;
53struct ItemBreakFragmentSource;
54struct LinkedCaptureObject;
55struct MotionObject;
56struct ObjectRuntime;
57struct OrbitEffect;
58struct PolarOffsetOutput;
59struct RockWallHeights;
62struct BattleSource;
63struct SparkObject;
64struct TransitionActorList;
65struct WaveFxWork;
66
67/// The battle camera (struct BattleCamera) as the effects that swing it see it.
68struct CameraWork {
69 u8 unk00[0x36]; ///< BattleCamera's eye to pitch; not named in this view
70 u16 scroll; ///< the camera's yaw, in 1/65536 turns
71};
72/// A world position, as Camera_WorldToScreen converts it to the screen.
74 s32 x; ///< 16.16 fixed-point pixels
75 s32 y; ///< 16.16 fixed-point pixels
76 s32 z; ///< 16.16 fixed-point pixels
77};
78/// One of the star field's three rings, moving outward on the effect canvas.
79struct Ring {
80 s32 x; ///< 1/1024 canvas pixels
81 s32 y; ///< 1/1024 canvas pixels
82 s32 velX; ///< 1/1024 canvas pixels per frame
83 s32 velY; ///< 1/1024 canvas pixels per frame
84 s32 age; ///< frames
85};
86/// The position an item-break effect spawns its objects and shards from.
88 s32 x; ///< 16.16 fixed-point pixels
89 s32 y; ///< 16.16 fixed-point pixels
90 s32 z; ///< 16.16 fixed-point pixels
91};
94extern const u8 gBattleFx_ArcSparkTiles[];
100extern const s32 gBattleFx_ParticleScript[];
102extern const s32 gBattleFx_SourceHoldScript[];
113extern const u8 gBattlePres_CurtainTiles[];
114extern const u8 gBattlePres_TileVariants[];
119extern u8 BitDecoder_Size[];
121extern const u8 gBattleFx_SparkTiles[];
122extern const u8 gBattleFx_QuadrantModes[];
123extern const s32 gBattleFx_TargetColors[];
125extern u8 gBattleFx_StarSizes[];
130extern const u8 gFieldFx_GroundParticleTiles[];
131#ifndef OWN_gBattleBgFxWork
132extern struct WaveFxWork *gBattleBgFxWork;
133#endif
134#ifndef OWN_gBattleFxWork
135extern void *gBattleFxWork[];
136#endif
137#ifndef OWN_gBattleOwnerStates
138extern u8 *gBattleOwnerStates;
139#endif
140#ifndef OWN_gRandomSeed
141extern u32 gRandomSeed;
142#endif
143#ifndef OWN_gTransitionWork
145#endif
147extern const s16 gParty_PairResolveRules[];
148extern const s32 gBattleFx_RisingPulseScript[];
152extern const u32 BattleFx_Composite[];
155extern const u8 gWorldMap_MarkerBlendCycle[];
156extern const s32 gWorldMap_PlaceMarkers[];
157u32 __udivsi3(u32 numerator, u32 denominator);
158#ifndef OWN__call_via_r0
159void _call_via_r0(u32 routine);
160#endif
166#ifndef OWN_Object_InitializeMode
168#endif
169
170/// The battle sprites' animations (AnimationObjects_SelectAnimation numbers)
171/// that the battle code picks by name.
173 POSE_ENEMY_HELD = 0, ///< an enemy asleep, stunned or held
175 POSE_PARTY_HELD = 4, ///< asleep, stunned or held; also a downed member
176 POSE_DAMAGE = 5, ///< taking damage
177 POSE_ENEMY_DOWN = 5 ///< a downed enemy stays in its damage pose
178};
179
180#endif
s32 gBattleFx_RingFrameOffsets[]
s8 gBattleParty_CenterOrderOffsets[]
const u8 gBattlePres_TileVariants[]
u16 gBattleUnit_WeaponAnimsClass2[]
s32 Object_InitializeMode(struct AnimationObject *state, s32 flags)
u8 gPlayerObjectId[]
u16 gBattleFormation_LevelMatchedEnemies[]
s32 gBattleFx_StarWorkOffsets[]
u16 gBattleUnit_WeaponAnimsClass3[]
struct WaveFxWork * gBattleBgFxWork
void BitDecoder_DecodeImage(void)
struct AnimationObject * GetBattleEffectObject(s32 kind)
const u32 BattleFx_Composite[]
void ItemIcon_LoadTilesFar(s32 item)
u8 gBattleFx_StarSizes[]
u8 gCamera_FlagTransformWork[]
s32 gBattle_BackdropScenes[]
u16 gResource_SlotAssignments[]
u16 gBattleUnit_WeaponAnimsClass5[]
void FarCall_WindowTable(void)
u8 * gBattleOwnerStates
const s32 gBattlePres_ActorObjectScript[]
s32 gBattleMotion_VariantSpeedLimit[]
void Animation_ApplyChildArgumentFar(void *, s32)
const s8 gBattlePlacement_StepPairs[]
const u8 gBattleFx_SparkTiles[]
const u8 gBattleFx_ArcSparkTiles[]
const u8 gBattlePres_CurtainTiles[]
void * gBattleFxWork[]
BattlePose
The battle sprites' animations (AnimationObjects_SelectAnimation numbers) that the battle code picks ...
Definition battle.h:172
@ POSE_PARTY_HELD
asleep, stunned or held; also a downed member
Definition battle.h:175
@ POSE_ENEMY_DOWN
a downed enemy stays in its damage pose
Definition battle.h:177
@ POSE_STANDING
Definition battle.h:174
@ POSE_DAMAGE
taking damage
Definition battle.h:176
@ POSE_ENEMY_HELD
an enemy asleep, stunned or held
Definition battle.h:173
u16 gBattleUnit_WeaponAnimsClass1[]
s32 gBattleMotion_VariantVelocityY[]
struct BattlePresentationTransition * gTransitionWork
u16 gEncounter_EnemyGroupTable[]
const s32 gBattleFx_UntargetedObjectScript[]
const s16 gParty_PairResolveRules[]
u32 __udivsi3(u32 numerator, u32 denominator)
u16 gBattleUnit_WeaponAnimsClass0[]
const u8 gFieldFx_GroundParticleTiles[]
u8 gBattleCommand_SelectionWeights[3][8]
const s32 gBattleFx_TargetColors[]
const struct BattleGroupOrder gBattleParty_RoundEndGroupOrder
u8 BitDecoder_Size[]
u8 gUi_RenderResultValues[]
u8 gBattlePres_AdvanceArrowTiles[]
const s32 gBattleFx_LinkedObjectScript[]
const s32 gWorldMap_PlaceMarkers[]
s32 gBattleMotion_VariantAcceleration[]
s8 gBattleFx_HighlightBlendRamp[]
s32 gBattleMotion_VariantDistancePercent[]
u32 gRandomSeed
const u8 gObjectMotion_LinkedActionScript[]
void _call_via_r0(u32 routine)
The battle animation state, render objects and effect entries, and the palette buffer work.
The edition's language, for C to compare (LANGUAGE == LANGUAGE_GERMAN).
Public interfaces to the engine's code banks.
const s32 gBattleFx_MarkerParticleScript[]
Definition fxdata.c:114
const u32 gBattleFx_PulseScales[3]
Two scales that alternate ((gFrameTick >> 2) & 1); nothing reads the third word.
Definition fxdata.c:440
const u8 gBattleFx_QuadrantModes[4]
Definition fxdata.c:473
const u16 gWorldMap_CursorDirectionAngles[16]
An angle for each +Control Pad direction (eight of them); 0xffff for none.
Definition fxdata.c:515
const struct BattleEffectEntry gBattleFx_DefinitionTable[131]
Speaker definitions: {sprite, portrait (0xff for none), idle line flags}.
Definition fxdata.c:163
const s32 gBattleFx_BurstParticleObjectScript[]
Word +4 is gBattleFx_HeavyImpactScript.
Definition fxdata.c:476
const u8 gWorldMap_MarkerBlendCycle[32]
The brightness of the world map markers ((gFrameCount >> 1) & 31).
Definition fxdata.c:509
const s8 gBattleFx_RandomChildValues[8]
Definition fxdata.c:506
const s32 gBattleFx_SourceHoldScript[]
Definition fxdata.c:450
const u8 gAnimation_ChildPaletteCycle[8]
The palette cycle of Animation_ChildPaletteCycle ((gFrameCount >> 1) & 7).
Definition fxdata.c:53
const s16 gFieldFx_GroundParticleFrames[80]
{dx, dy, tile, shape, size} for each of 16 frames.
Definition fxdata.c:383
const s32 gBattleFx_RisingPulseScript[]
Pulses twice, then rests, over and over.
Definition fxdata.c:75
const s32 gBattleFx_ParticleScript[]
Rises for 60 frames, then disappears.
Definition fxdata.c:107
const s16 gBattleFx_TargetRangeByMode[25]
{field Psynergy kind, range in pixels}, ended by -1; a kind not listed reaches 16 pixels.
Definition fxdata.c:36
const s32 gBattleFx_ParticleEmitterScript[]
Grows from half size to full size, a step every 2 frames.
Definition fxdata.c:56
const u16 gBattleFx_CyclePatternWords[16]
An angle for each value of the right, left, up and down bits of the +Control Pad; 0xffff for none.
Definition fxdata.c:466
One animation layer of a sprite: its animation id, frames, running script and timer.
Definition animspr.h:37
An animated sprite: its image and shadow, scale, rotation, size and up to four animation layers.
Definition animspr.h:108
u8 flags
bits: 1 outlined in ObjectSystemWork's edge and fill colours | 0 shadow drawn (set when created)
Definition animspr.h:128
A field object as Avoid's caster: its facing, its animation records and the phase and frame count of ...
Definition fx_scene.h:17
An ability's definition, a row of gBattleAction_DefinitionTable: its targeting, kind,...
A unit's chosen action for the turn: its command, the command's parameter, its target and range,...
The command shared by an effect's caller, dispatcher and handlers.
A speaker definition, a row of gBattleFx_DefinitionTable: a sprite, its portrait (0xff for none) and ...
The battle event queue and the state of its playback: the phase, the event playing and the advance ar...
Definition battle_work.h:51
The order the two sides' units take their round-end effects in, as gBattleParty_RoundEndGroupOrder gi...
Definition turn_end.c:286
A field scene's encounter zones (gBattle_LocationRules, location_rules.s), ended by scene -1.
Definition encounter.c:9
A unit's place on the battlefield: its sprite object, resources and animations, its anchor spot and s...
One action, as BattleCommand_BuildPlan lays it out for BattleTargetExec to apply target by target.
Definition battle_type.h:26
The battle background's work slot as the camera reads it: the yaw the camera eases toward and the fra...
The party's Djinn recovery table as summons read it: the mask of summons the party can call,...
A unit in battle: a party member's or an enemy's stats, Psynergy, items, Djinn and ailments.
The battle camera (struct BattleCamera) as the effects that swing it see it.
Definition battle.h:68
u16 scroll
the camera's yaw, in 1/65536 turns
Definition battle.h:70
u8 unk00[0x36]
BattleCamera's eye to pitch; not named in this view.
Definition battle.h:69
A FieldActor seen with the halfword at 0x64 unsigned and the one at 0x66 signed, as the bytes read th...
A field object as the object dispatcher's far calls take it.
One of the scene's events (the same 12 bytes as struct SceneEvent).
Definition object.h:62
A particle a Psynergy effect moves and draws: its sprite, its position and target,...
Definition effect_slot.h:18
A world position, as Camera_WorldToScreen converts it to the screen.
Definition battle.h:73
s32 y
16.16 fixed-point pixels
Definition battle.h:75
s32 z
16.16 fixed-point pixels
Definition battle.h:76
s32 x
16.16 fixed-point pixels
Definition battle.h:74
An enemy's definition: its level and stats, items, element preset, the actions it chooses from and it...
Definition character.h:89
A field actor: a person or thing on the field with a position, motion toward a target,...
Definition field_obj.h:30
An effect object that moves and draws one sprite: its position, scale, velocity and target,...
Definition motobj.h:20
One of the 64 field objects in the object pool (heap slot 5): its script, position,...
One of the star field's three rings, moving outward on the effect canvas.
Definition battle.h:79
s32 velY
1/1024 canvas pixels per frame
Definition battle.h:83
s32 age
frames
Definition battle.h:84
s32 y
1/1024 canvas pixels
Definition battle.h:81
s32 x
1/1024 canvas pixels
Definition battle.h:80
s32 velX
1/1024 canvas pixels per frame
Definition battle.h:82
The heights of Quake's rock pillars.
Definition quake.c:15
The position an item-break effect spawns its objects and shards from.
Definition battle.h:87
s32 y
16.16 fixed-point pixels
Definition battle.h:89
s32 x
16.16 fixed-point pixels
Definition battle.h:88
s32 z
16.16 fixed-point pixels
Definition battle.h:90
A rule naming the place a scene is in (gScene_AreaNameRules, scene_rules.s), ended by id -1.
Definition encounter.c:312
A rule choosing a scene's field music (gScene_InteractionRuleTable, scene_rules.s),...
Definition encounter.c:265
A field object as the script commands' overlap checks see it.
A FieldActor seen with the halfword at 0x5e (its lifetime), which FieldActor does not name.
Horizontal and vertical sprite scale; 0x10000 is the original size.
Work slot 22 of the wave effect, 0x298 bytes (RunSceneTransitionEffect).
Definition mind_read.c:8
The integer types, TRUE, UNUSED and the fixed-address macros.
signed int s32
Definition types.h:14
unsigned int u32
Definition types.h:15
signed char s8
Definition types.h:10
signed short s16
Definition types.h:12
unsigned short u16
Definition types.h:13
unsigned char u8
Definition types.h:11
Vector3, a three-coordinate vector.