40 target = scene->
child;
46 for (i = 0; i <= 11; i++) {
54 slot->scaleY = 0xb333;
55 slot->scaleX = 0xb333;
68 if (projectile ==
NULL) {
72 projectile->
scaleY = 0x4000;
73 projectile->
scaleX = 0x4000;
75 projectile->
speed = 4 << 16;
80 scale = projectile->
scaleX;
81 if (scale < 0x10000) {
84 projectile->
scaleY = scale;
85 projectile->
scaleX = scale;
87 scale = projectile->
scaleX;
88 }
while (scale <= 0xffff);
93 sharedAnimation =
NULL;
94 for (i = 2; i >= 0; i--) {
101 copy->
speed = 4 << 16;
110 resourceSlot = sharedAnimation->
slot;
129 for (i = 0; i < 3; i++) {
160 target->speed = 1 << 16;
173 if (resourceSlot != 96)
void EffectSlot_Initialize(struct EffectSlot *effect, s32 kind, s32 x, s32 z)
Fills an effect slot with a new sprite of kind at (x, z): stopping at its target, top speed 2,...
void EffectSlot_SetCallback(struct EffectSlot *effect, EffectCallback callback)
Gives an effect slot its per-frame callback, starting at state 0.
void EffectSlot_SetObjectMode(struct EffectSlot *effect, s32 mode)
Sets the animation of an effect slot's sprite.
void ObjectDispatch_SelectAnimationFar(void *raw, s32 no)
void ObjectDispatch_InitializeFar(struct DispatchObject *obj, const s32 *script)
void Object_SetMoveTargetFar(struct ObjectRuntime *object, s32 x, s32 y, s32 z)
void Animation_ApplyChildValuesFar(struct DispatchObject *obj, u32 val)
void ObjectGroup_SetChildValueUnlessFifteenFar(void *raw_parent, u32 value)
s32 ScriptObject_CheckOverlapFar(struct ScriptObjectEntry *object, s32 *values)
s32 Map_CheckObjectStepFar(struct ObjectRuntime *object, struct FieldPosition *position)
void AudioCommand_PlayFar(s32 id)
void FieldFx_RunForce(void)
A shot appears in front of the caster, grows and flies forward with three afterimages; what it hits (...
static __inline__ void BattleFx_GetPositionAboveActor(struct FieldActor *obj, struct EffectVector *pos)
Writes the position 16 pixels above the actor.
void FieldFx_RunForceOnTarget(s32 unused)
Runs Force cast on a target, through FieldFx_RunForce.
void WaitFrames(s32 frames)
The game's frame loop: runs frames frames and returns.
const s32 gBattleFx_BurstParticleObjectScript[]
Word +4 is gBattleFx_HeavyImpactScript.
const s32 gBattleFx_CommonParticleScript[]
[0] only frees the actor, +1 waits for it to arrive and frees it; +3 is gBattleFx_SourceHoldScript,...
struct GameState gGameState
void * gEffectWork
Slot 56: points to a scene-specific structure.
void * BattleFx_FindMatchingEvent(s32 eventFlags, s32 group, void *target)
Returns the scene's Psynergy event (kind 5) for Psynergy of the given group that applies to what the ...
void BattleFx_UpdateRadialBurst(struct EffectSlot *slot)
Effect slot callback of a particle that scatters 25 pixels from its origin in a random direction,...
#define SET_POSITION(p, px, py, pz)
Sets the position or the velocity of a particle, a piece of debris or an object in one statement.
void Vector_AddPolarOffset(s32 radius, s32 angle, void *position)
Moves the point position by radius in direction angle on the ground plane: x by the cosine,...
s32 Field_RunEventAction(const void *event, s32 param, s32 target)
Runs the event tied to an effect: a result below 0x10000 is a message, shown at target; a larger one ...
struct AnimationObject * Sprite_ShareVramCache(struct AnimationObject *sourceSprite, struct AnimationObject *sharedSprite)
Makes sourceSprite share sharedSprite's VRAM block, releasing its own; with no sharedSprite it keeps ...
struct ObjectRuntime * Object_Spawn(s32 kind, s32 x, s32 y, s32 z)
Creates an object for an effect, at the caster's ground height, with sprite priority 0 and animation ...
void BattleEffect_InitializeSharedScene(void)
Saves the palettes for the effect (once, unless an effect is already shown) and fades them toward one...
void BattleFx_PrepareBufferInterpolation(void)
Fades the palettes back from an effect's colours to the saved ones (or to palette 0x10001 while an ef...
void Camera_WorldToScreen(struct EffectVector *position)
Converts a world position (16.16 pixels) to the screen: x and z receive the screen's x and y and y be...
What every part of psynergy_effects.c shares: its includes and the macros and types more than one par...
#define ABOVE
16 pixels up
An animated sprite: its image and shadow, scale, rotation, size and up to four animation layers.
u8 slot
VRAM cache entry holding its tiles.
s32 scale
16.16 fixed point, 0x10000 full size
The work of a Psynergy effect scene: its caster and target, where it takes place, the map state it re...
s32 y
16.16 fixed-point pixels
s8 childOption
Set by some scenes before an effect; Carry, Frost, Force and Reveal treat the target differently with...
struct EffectSlot slots[24]
s8 childMode
set by some scenes: Frost and Force leave the target be
void * mainObject
the caster's object
void * child
the target's object, or NULL
s8 enabled
Set at the start: Force then aims in front of the caster; cleared once the target has been dispatched...
s32 x
16.16 fixed-point pixels
s32 z
16.16 fixed-point pixels
A field object as the object dispatcher's far calls take it.
A particle a Psynergy effect moves and draws: its sprite, its position and target,...
A world position, as Camera_WorldToScreen converts it to the screen.
s32 y
16.16 fixed-point pixels
s32 z
16.16 fixed-point pixels
s32 x
16.16 fixed-point pixels
A field actor: a person or thing on the field with a position, motion toward a target,...
s32 speed
speed limit, 16.16 fixed-point pixels per frame
u8 motionFlags
ActorMotionFlag bits; zero is free flight in 3D, and 3 is set on creation.
union FieldCoordinate x
16.16 fixed-point pixels
union FieldCoordinate y
16.16 fixed-point pixels
s32 velocityY
16.16 fixed-point pixels per frame
union FieldCoordinate z
16.16 fixed-point pixels
s32 acceleration
Added toward the target each frame, or taken off the speed when there is none, in 16....
s32 scaleX
16.16 fixed point, 0x10000 full size
s32 scaleY
16.16 fixed point, 0x10000 full size
s32 z
16.16 fixed-point pixels
s32 selectedActor
the leader: its unit and its actor
One of the 64 field objects in the object pool (heap slot 5): its script, position,...
s32 acceleration
Added toward the target each frame, or taken off the speed when there is none, in 16....
A field object as the motion code sees it: its script, position, motion toward a target,...
A field object as the script commands' overlap checks see it.
s32 fixed
16.16 fixed-point pixels
s32 Resource_ResetEntry(u32 no)
Frees cache entry no: its blocks go back and the entry is marked free (offset 0xffff).