Alchemy
Loading...
Searching...
No Matches

effect_create.h

Go to the documentation of this file.
1#include "types.h"
2#include "field_obj.h"
3
4// Twenty-three scenes, most of those that spawn effects (effect_spawn.h): two
5// ways to place a still effect object of a given type at a 16.16 position.
6
7/// Sets the actor's sprite priority (0 in front of the backgrounds, 3 behind).
8UNUSED static void SetEffectRecordMode(struct FieldActor *work, s32 mode) {
9 work->sprite->image.priority = mode;
10}
11
12/// A still, translucent effect in palette 14, at sprite priority 0.
13UNUSED static void *OverlayObject_PrepareObject(s32 x, s32 y, s32 z, s32 type) {
14 struct FieldActor *object = Engine_ObjectCreate(type, x, y, z);
15
16 if (object != 0) {
17 object->sprite->image.priority = 0;
18 object->motionFlags = 0;
19 object->collisionFlags = 8;
21 ObjectGroup_SetChildValue(object, 14);
23 return object;
24 }
25 return 0;
26}
27
28/// A still effect in palette 15, at sprite priority 1, drawn under the actors.
30 s32 type) {
31 struct FieldActor *object = Engine_ObjectCreate(type, x, y, z);
32
33 if (object != 0) {
34 object->sprite->image.priority = 1;
35 object->motionFlags = 0;
36 object->collisionFlags = 8;
38 ObjectGroup_SetChildValue(object, 15);
39 object->priorityFlags =
40 (object->priorityFlags & ~ACTOR_PRIORITY_AUTOMATIC) |
42 return object;
43 }
44 return 0;
45}
void ObjectGroup_SetChildValue(struct FieldActor *actor, s32 param)
Sets the param byte of every animated part of an actor's sprite.
void Engine_ActorSetSpriteFlags(struct FieldActor *, s32)
struct FieldActor * Engine_ObjectCreate(s32, s32, s32, s32)
static UNUSED void SetEffectRecordMode(struct FieldActor *work, s32 mode)
Sets the actor's sprite priority (0 in front of the backgrounds, 3 behind).
static UNUSED void * OverlayObject_CreateConfiguredObject(s32 x, s32 y, s32 z, s32 type)
A still effect in palette 15, at sprite priority 1, drawn under the actors.
static UNUSED void * OverlayObject_PrepareObject(s32 x, s32 y, s32 z, s32 type)
A still, translucent effect in palette 14, at sprite priority 0.
@ OBJECT_BLEND_TRANSLUCENT
void Engine_ObjectSetBlendMode(struct FieldActor *object, s32 mode)
Field objects and actors, and the scene transition styles.
@ ACTOR_PRIORITY_UNDERFOOT
The depth sort treats it as 320 pixels higher on the screen.
Definition field_obj.h:155
@ ACTOR_PRIORITY_AUTOMATIC
The sprite takes its priority from the map cell under it.
Definition field_obj.h:153
A field actor: a person or thing on the field with a position, motion toward a target,...
Definition field_obj.h:30
union FieldCoordinate x
16.16 fixed-point pixels
Definition field_obj.h:35
union FieldCoordinate y
16.16 fixed-point pixels
Definition field_obj.h:36
union FieldCoordinate z
16.16 fixed-point pixels
Definition field_obj.h:37
The integer types, TRUE, UNUSED and the fixed-address macros.
signed int s32
Definition types.h:14
#define UNUSED
Definition types.h:22