Skip to Content
The Alchemy Project

include/field/script_operands.h

The actor script interpreter and the operands its commands read.

Included by field_internal.h, actor_facing.c, kolima_grow.c and actor_script.h.

Structures

NameDescription
structSCRIPT_OPERANDSThe whole 112-byte slot as SC_SET, SC_ADD and SC_CMP see it: each field is one state value (ACTOR_SCRIPT_VALUE in actor_script.h), reached through ActorScriptOperandHandlerTable, and named for what the field keeps there.

Typedefs

NameDescription
typedef Sint32 (*SCRIPT_COMMAND )(struct ACTOR *);An actor script command's handler: it reads its operands at the actor's script cursor, moves the cursor past them and returns 1 to run the next command this tick or 0 to wait.
typedef void (*OPERAND_FUNC )(SCRIPT_OPERANDS *state, Sint32 operation, Sint32 value);A state value's handler: by operation (SCRIPT_OPERAND_OPERATION in field_script_commands.c) it sets the actor field it names to value, adds value to it, or stores whether it equals value in conditionResult.

Variables

NameDescription
extern const OPERAND_FUNCActorScriptOperandHandlerTable [41]The handler for each state value number (actor_script_operands.c).

Description

The actor script interpreter and the operands its commands read.

Typedefs in detail

SCRIPT_COMMAND

typedef Sint32 (*SCRIPT_COMMAND)(struct ACTOR *);

An actor script command's handler: it reads its operands at the actor's script cursor, moves the cursor past them and returns 1 to run the next command this tick or 0 to wait.

Referenced by ActorScriptCommandTable and fdActorScriptInvokeCallback().

Definition at line 15 of file script_operands.h.

OPERAND_FUNC

typedef void (*OPERAND_FUNC)(SCRIPT_OPERANDS *state, Sint32 operation, Sint32 value);

A state value's handler: by operation (SCRIPT_OPERAND_OPERATION in field_script_commands.c) it sets the actor field it names to value, adds value to it, or stores whether it equals value in conditionResult.

Referenced by ActorScriptOperandHandlerTable and fdActorScriptApplyOperandCommand().

Definition at line 87 of file script_operands.h.