ℹ️
Read only at call time Do not store ctx across frames or between instructions. It is valid only during the coroutine it was passed to.

Player

MemberTypeDescription
ctx.playerPlayerControllerThe player character instance for this run.
ctx.player.positionVector2Current world position. Assign directly to move the player instantly (no animation).
ctx.player.SetDirection(Direction)voidFlips the player sprite to face a direction.
ctx.player.PlayAnimation(string)voidPlays a named Animator state on the player.
ctx.player.ValidatePosition(Vector3)boolReturns true if the position is on a valid PathTile with no obstacle. Always check before moving.
ctx.player.PlaySound(AudioResource)voidPlays a sound through the player's AudioSource. Stops any currently playing clip first.
ctx.player.UseItem(Item)voidConsumes an item, applies its effects, and shows the use VFX.

Player Stats

MemberTypeDescription
ctx.player.staminaPlayerStaminaAccess .currentValue to check available stamina. Call .Substract(n) to spend it.
ctx.player.healthHealthCheck .isDead. Call .ApplyDamage(n) to deal damage.
ctx.player.damageintPlayer's current damage value (derived from equipped weapon stat).
ctx.player.defenseintPlayer's current defense value (derived from equipped armor stat).

State

MemberTypeDescription
ctx.carryingObjectboolTrue if the player is currently carrying an ICarryObject. Many instructions are blocked while carrying.
ctx.inventoryPlayerInventoryThe inventory snapshot for this run. Read items and equipment slots.
ctx.currentPlayerInstructionPlayerInstructionThe instruction currently executing (set to this by the runner).

Events

MemberTypeDescription
ctx.OnTurnStartActionFired at the beginning of each turn within this run.
ctx.OnTurnEndActionFired at the end of each turn. Subscribe here to collect items or tick effects.
ℹ️
Need to react to each instruction step from an enemy or interactable? See IExecutionSuscriber — a lightweight notification interface that is auto-registered from the enemy's hierarchy.