18 position.
x = liftedObject->
x.
fixed;
20 position.
z = liftedObject->
z.
fixed;
26 0x11d, position.
x, position.
y, position.
z);
27 BattleFx_InitializeFallingFragment(fragment);
30#define CARRY_SHARD_MAX 20
88 if (hands[0] ==
NULL || right ==
NULL) {
101 obj->
x.
fixed = p->
x + (16 << 16);
103 right->
x.
fixed = p->
x - (16 << 16);
112 if (hands[0] !=
NULL && hands[1] !=
NULL) {
116 target->
y.
fixed += 0x6000;
120 hands[0]->
speed = 4 << 16;
122 hands[1]->
speed = 4 << 16;
124 target->
speed = 0x6666;
139 if (angle == 0xffff) {
141 pos.
y = target->
y.
fixed + (16 << 16);
144 pos.
x + (16 << 16), pos.
y, pos.
z);
146 pos.
x - (16 << 16), pos.
y, pos.
z);
154 pos.
y = target->
y.
fixed + (16 << 16);
158 pos.
x + (16 << 16), pos.
y, pos.
z);
160 pos.
x - (16 << 16), pos.
y, pos.
z);
195 target->speed = 0x3333;
196 target->acceleration = 0x3333;
198 hands[0]->speed = 0x3333;
201 second->
speed = 0x3333;
204 p->
x + (16 << 16), p->
y, p->
z);
240 obj->speed =
Random16() + (2 << 16);
241 obj->acceleration = 2 << 16;
242 obj->motionFlags = 0;
266 if (
work->childOption != 0) {
268 for (i = 0; i < 90 && target->
velocityY >= 0; i++)
271 for (i = 0; i < 90 && target->
velocityY < 0; i++)
297 if (fragment !=
NULL) {
298 fragment->
scaleY = 0x4000;
299 fragment->
scaleX = 0x4000;
305 if (scale < 0x10000) {
310 fragment->
angle += 0x2000;
313 }
while (scale <= 0xffff);
320#undef CARRY_SHARD_MAX
#define CARRY_SHARD_MAX
shards
static __inline__ s32 BattleFx_CheckRaisedTargetCollision(struct FieldActor *target, struct EffectVector *position)
Tests the target's move with its terrain reference raised 16 pixels.
void BattleFx_SteerLiftedTarget(s32 targetId)
Two hands lift it to 24 pixels above the ground; the d-pad moves it 16 pixels at a time and A,...
struct MotionObject * BattleFx_SpawnItemBreakMode1(s32 x, s32 y, s32 z, s32 angle)
Spawns object 215 with the item break sound, in animation 1, and grows it, spinning,...
void FieldFx_RunCarry(void)
Carry cast with no target: objects appear above the caster and to either side, move apart and scatter...
void BattleFx_SpawnFallingParticles(void)
Per-frame update: drops one particle round the lifted object, 8 to 24 pixels above it and 0 to 48 pix...
void ObjectDispatch_ReleaseFar(struct DispatchObject *obj)
void ObjectDispatch_SetSingleChildFlagsFar(struct DispatchObject *obj, u32 flags)
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)
s32 ScriptObject_CheckOverlapFar(struct ScriptObjectEntry *object, s32 *values)
s32 Map_CheckObjectStepFar(struct ObjectRuntime *object, struct FieldPosition *position)
void FieldObject_WaitForMoveFar(void *fieldObject)
void AudioCommand_PlayFar(s32 id)
void WaitFrames(s32 frames)
The game's frame loop: runs frames frames and returns.
volatile u32 gFrameCount
Frames WaitFrames has finished.
const s32 gBattleFx_FragmentScript[]
const s32 gBattleFx_SourceHoldScript[]
void * gEffectWork
Slot 56: points to a scene-specific structure.
volatile u32 gKeysHeld
Keys down now.
volatile u32 gKeysPressed
Keys that went down this frame.
#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,...
u32 Random16(void)
Advances the game's random number generator (the C library's classic linear congruential one),...
s32 Input_GetDpadAngle(u32 unused)
Returns the direction of the d-pad (0x10000 a full turn): right 0, down 0x4000, left 0x8000,...
void Motion_SetTargetPositionFromMagnitudeAngle(struct ObjectRuntime *object, s32 magnitude, s32 angle)
Sends an object toward the point magnitude (16.16 pixels) away from it in direction angle: sets its m...
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 ObjectGroup_ApplyRandomChildValues(union FieldObject *fieldObject)
Per-frame update: sets every part of an object's sprite to param frame % 6, which cycles its colours.
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...
What every part of psynergy_effects.c shares: its includes and the macros and types more than one par...
#define DEFINE_ITEM_BREAK_EFFECT(name, spawn)
Defines an effect cast with no target: spawn makes an object 16 pixels above the effect's position an...
s32 Scheduler_AddOrUpdateCallback(SchedulerCallback callback, s32 order)
Schedules callback with order, or gives a task already running it the new order, and re-sorts the tab...
s32 Scheduler_RemoveCallback(SchedulerCallback callback)
Unschedules the task running callback: clears its routine and gives it order 0x7fff,...
#define STATIC_ASSERT(condition)
C89 permits repeated extern declarations of the same array.
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
void * mainObject
the caster's object
void * child
the target's object, or NULL
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 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
struct FieldActor * linkedObject
The object its action script follows or faces.
u8 steeringFlags
ActorSteeringFlag bits.
u8 motionFlags
ActorMotionFlag bits; zero is free flight in 3D, and 3 is set on creation.
union FieldCoordinate x
16.16 fixed-point pixels
s32 velocityX
16.16 fixed-point pixels per frame
s32 bounce
The share of its falling speed kept as it bounces on landing, 16.16 fixed point (0x4000 when created)...
union FieldCoordinate y
16.16 fixed-point pixels
s32 terrainHeight
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....
void(*) update(union FieldObject *object)
Called each frame before the object's script, while the object is live.
u16 work
The side of the player's next footprint (2 after a stop), or scene scratch.
u8 terrainId
The map layer (0 to 3) its ground height is read from, which the scrolling camera updates from the ce...
A FieldActor seen with the halfword at 0x5e (its lifetime), which FieldActor does not name.
An effect object that moves and draws one sprite: its position, scale, velocity and target,...
s32 scaleX
16.16 fixed point, 0x10000 full size
s32 speedLimit
16.16 fixed-point pixels per frame
s32 z
16.16 fixed-point pixels
s32 y
16.16 fixed-point pixels
s32 acceleration
Horizontal speed gained each frame towards the target, or lost braking without one,...
s32 scaleY
16.16 fixed point, 0x10000 full size
s32 x
16.16 fixed-point pixels
u8 autoFaceMotion
bit 0 turns the object to face where it moves
One of the 64 field objects in the object pool (heap slot 5): its script, position,...
s32 velocityZ
16.16 fixed-point pixels per frame
s32 velocityX
16.16 fixed-point pixels per frame
s32 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 x
16.16 fixed-point pixels
A field object as the script commands' overlap checks see it.
s32 fixed
16.16 fixed-point pixels
void BattleFx_SpawnRadialParticleRing(struct MotionObject *origin)
Spawns 17 particles that spread from origin in a flat ring, their x velocity 1.5 times their z veloci...