src/field/field_pad_movement.c
Script commands that move the leader by the pad, on the map and the world map, and the configured keys checked from a script. More…
Included by field.c.
Macros
| Name | Description | |
|---|---|---|
#define | ANIM_SHIP_FLY_HIGH 6 | The flying ship's animation once it is 4 pixels up: its picture moved 10 pixels (ANIMCMD_OFFSET_Y) and its wings beating, the seventh of winged_ship_flying_small.tsv. |
#define | WORLD_MAP_YAW_SNAP 16 | A world map camera turn of less than this either way is made at once. |
#define | FLYING_YAW_STEP_MAX (TRIG_TURN / 2048) | The flying ship's camera turns toward the pad's yaw by at most this a tick. |
#define | FLYING_SHIP_CEILING 12 | How high the flying ship climbs, in pixels, and the height from which it flies high: wings beating (ANIM_SHIP_FLY_HIGH), its shadow flickering and no ripples left on the water. |
#define | FLYING_SHIP_HIGH 4 | |
#define | SPLASH_RING_ANIMATION_PALE 1 | SPRITE_SPLASH_RING's two rings, each widening over 30 ticks (splash_ring.tsv): a pale one that fades, drawn semi-transparent where the leader wades and under the low-flying ship, and a blue one behind the sailing ship. |
#define | SPLASH_RING_ANIMATION_BLUE 2 | |
#define | SPLASH_RING_INTERVAL 10 | Ticks between two rings left behind. |
#define | SHIP_TURN_STEP (TRIG_TURN / 64) | The ship turns toward the pad by this much a tick, once the turn left is wider than FIELD_BLOCKED_TURN_MAX; a narrower one it makes at once. |
#define | SHIP_PROBE_RADIUS 19 | The ship on a field map tests the way ahead this far from its centre, in pixels; it pushes what lies this far ahead of it, and a pushed actor first tests the way this far beyond it. |
#define | SHIP_PUSH_REACH 15 | |
#define | SHIP_PUSHED_PROBE 21 |
Functions
| Name | Description | |
|---|---|---|
Sint32 | fdActorMoveOnWorldMap (ACTOR *actor) | SC_WORLD: moves the player on the world map by the direction pad, as SC_PLAYER does on the field, and turns the world map camera with the pad. |
Sint32 | fdActorScriptCheckKeys (ACTOR *actor) | SC_CHECK_KEYS: checks the configured keys (fdCheckConfiguredKeys) and steps the script on. |
Sint32 | fdActorSailOnMap (ACTOR *actor) | SC_SAIL (LEADER_MOVEMENT_SHIP_ON_MAP): the ship moved by the direction pad on a field map, as the party's actor (MainRoutineStateWork.ownerOverride), as at Lemuria's entrance; A leaves the ship. |
Sint32 | fdActorSailOnWorldMap (ACTOR *actor) | SC_WORLD_SAIL (LEADER_MOVEMENT_SHIP): the ship sailing the world map. |
Sint32 | fdActorFlyOnWorldMap (ACTOR *actor) | SC_WORLD_FLY (LEADER_MOVEMENT_FLYING_SHIP): the ship with its wings on the world map, flying over the ground the sea alone would stop (fdWorldMapIsFlyable). |
Description
Script commands that move the leader by the pad, on the map and the world
map, and the configured keys checked from a script. Part of field.c.
Macros in detail
ANIM_SHIP_FLY_HIGH
#define ANIM_SHIP_FLY_HIGH 6
The flying ship's animation once it is 4 pixels up: its picture moved 10
pixels (ANIMCMD_OFFSET_Y) and its wings beating, the seventh of
winged_ship_flying_small.tsv.
Referenced by fdActorFlyOnWorldMap().
Definition at line 7 of file field_pad_movement.c.
WORLD_MAP_YAW_SNAP
#define WORLD_MAP_YAW_SNAP 16
A world map camera turn of less than this either way is made at once.
Referenced by fdActorMoveAsSandOnWorldMap(), fdActorMoveOnWorldMap() and fdActorSailOnWorldMap().
Definition at line 10 of file field_pad_movement.c.
FLYING_YAW_STEP_MAX
#define FLYING_YAW_STEP_MAX (TRIG_TURN / 2048)
The flying ship's camera turns toward the pad's yaw by at most this a tick.
Referenced by fdActorFlyOnWorldMap().
Definition at line 12 of file field_pad_movement.c.
FLYING_SHIP_CEILING
#define FLYING_SHIP_CEILING 12
How high the flying ship climbs, in pixels, and the height from which it
flies high: wings beating (ANIM_SHIP_FLY_HIGH), its shadow flickering and no
ripples left on the water.
Referenced by fdActorFlyOnWorldMap().
Definition at line 16 of file field_pad_movement.c.
FLYING_SHIP_HIGH
#define FLYING_SHIP_HIGH 4
Referenced by fdActorFlyOnWorldMap().
Definition at line 17 of file field_pad_movement.c.
SPLASH_RING_ANIMATION_PALE
#define SPLASH_RING_ANIMATION_PALE 1
SPRITE_SPLASH_RING's two rings, each widening over 30 ticks
(splash_ring.tsv): a pale one that fades, drawn semi-transparent where the
leader wades and under the low-flying ship, and a blue one behind the sailing
ship.
Referenced by fdActorFlyOnWorldMap() and fdActorMoveOnWorldMap().
Definition at line 23 of file field_pad_movement.c.
SPLASH_RING_ANIMATION_BLUE
#define SPLASH_RING_ANIMATION_BLUE 2
Referenced by fdActorSailOnWorldMap().
Definition at line 24 of file field_pad_movement.c.
SPLASH_RING_INTERVAL
#define SPLASH_RING_INTERVAL 10
Ticks between two rings left behind.
Referenced by fdActorFlyOnWorldMap(), fdActorMoveOnWorldMap() and fdActorSailOnWorldMap().
Definition at line 26 of file field_pad_movement.c.
SHIP_TURN_STEP
#define SHIP_TURN_STEP (TRIG_TURN / 64)
The ship turns toward the pad by this much a tick, once the turn left is
wider than FIELD_BLOCKED_TURN_MAX; a narrower one it makes at once.
Referenced by fdActorFlyOnWorldMap(), fdActorSailOnMap() and fdActorSailOnWorldMap().
Definition at line 243 of file field_pad_movement.c.
SHIP_PROBE_RADIUS
#define SHIP_PROBE_RADIUS 19
The ship on a field map tests the way ahead this far from its centre, in pixels; it pushes what lies this far ahead of it, and a pushed actor first tests the way this far beyond it.
Referenced by fdActorSailOnMap().
Definition at line 247 of file field_pad_movement.c.
SHIP_PUSH_REACH
#define SHIP_PUSH_REACH 15
Referenced by fdActorSailOnMap().
Definition at line 248 of file field_pad_movement.c.
SHIP_PUSHED_PROBE
#define SHIP_PUSHED_PROBE 21
Referenced by fdActorSailOnMap().
Definition at line 249 of file field_pad_movement.c.
Functions in detail
fdActorMoveOnWorldMap
Sint32 fdActorMoveOnWorldMap(ACTOR *actor)
SC_WORLD: moves the player on the world map by the direction pad, as
SC_PLAYER does on the field, and turns the world map camera with the pad. In
forest the leader shows his second layer and no shadow, wading in shallow
water leaves pale rings, and A raises the cue that boards the ship.
References ActorRippleScript, DebugMode, fdActorCreate(), fdActorSelectAnimation(), fdActorSetMoveTarget(), fdActorStartScript(), fdCheckConfiguredKeys(), fdSpriteStartAnimation(), fdTurnToward(), fdWorldMapGetCollision(), fdWorldMapIsWalkable(), MainRoutineStateWork, PerWork, Sint32, syGameFlagGet(), sySquartFX(), syVectorAddPolarOffset(), WorldMapKeyHeadings and WorldMapKeyYaws.
Referenced by ActorScriptCommandTable.
Definition at line 32 of file field_pad_movement.c.
fdActorScriptCheckKeys
Sint32 fdActorScriptCheckKeys(ACTOR *actor)
SC_CHECK_KEYS: checks the configured keys (fdCheckConfiguredKeys) and steps
the script on. Returns 1.
References fdCheckConfiguredKeys() and Sint32.
Referenced by ActorScriptCommandTable.
Definition at line 234 of file field_pad_movement.c.
fdActorSailOnMap
Sint32 fdActorSailOnMap(ACTOR *actor)
SC_SAIL (LEADER_MOVEMENT_SHIP_ON_MAP): the ship moved by the direction pad on
a field map, as the party's actor (MainRoutineStateWork.ownerOverride), as at
Lemuria's entrance; A leaves the ship.
References DebugMode, fdActorScriptCheckOverlap(), fdActorSelectAnimation(), fdActorSetMoveTarget(), fdCheckConfiguredKeys(), fdCheckSpheresOverlap(), fdMapGridCheckCollision(), fdWorldMapGetCollision(), MainRoutineStateWork, PerWork, Sint32, syAtan(), syGameFlagGet(), sySquartFX(), syVectorAddPolarOffset(), VramCacheBlockOwners, VramCacheEntries and WorldMapKeyHeadings.
Referenced by ActorScriptCommandTable.
Definition at line 254 of file field_pad_movement.c.
fdActorSailOnWorldMap
Sint32 fdActorSailOnWorldMap(ACTOR *actor)
SC_WORLD_SAIL (LEADER_MOVEMENT_SHIP): the ship sailing the world map. It
keeps the kind of water under the ship in FIELD_STATE.terrainKind, sails at a
run and turns a little at a time, leaving ripples; A goes ashore, and a dash
key takes off once the ship has its wings (FIELD_STATE.hoverReady).
References ActorRippleScript, DebugMode, fdActorCreate(), fdActorSelectAnimation(), fdActorSetMoveTarget(), fdActorStartScript(), fdCheckConfiguredKeys(), fdSpriteStartAnimation(), fdWorldMapGetCollision(), fdWorldMapIsSailable(), MainRoutineStateWork, PerWork, Sint32, syGameFlagClear(), sySquartFX(), syVectorAddPolarOffset(), WorldMapKeyHeadings and WorldMapKeyYaws.
Referenced by ActorScriptCommandTable.
Definition at line 547 of file field_pad_movement.c.
fdActorFlyOnWorldMap
Sint32 fdActorFlyOnWorldMap(ACTOR *actor)
SC_WORLD_FLY (LEADER_MOVEMENT_FLYING_SHIP): the ship with its wings on the
world map, flying over the ground the sea alone would stop
(fdWorldMapIsFlyable). A or B climbs, up to 12 pixels, and the ship sinks
otherwise, faster once the party's PP is spent; coming down after a climb
lands it.
References ActorRippleScript, DebugMode, fdActorCreate(), fdActorSelectAnimation(), fdActorSetMoveTarget(), fdActorSetSpriteFlags(), fdActorStartScript(), fdCheckSpheresOverlap(), fdSpriteStartAnimation(), fdWorldMapGetCollision(), fdWorldMapIsFlyable(), gmPartyGetPpRatioStub(), MainRoutineStateWork, PerWork, Sint32, sySquartFX(), syVectorAddPolarOffset(), TickCount, WorldMapKeyHeadings and WorldMapKeyYaws.
Referenced by ActorScriptCommandTable.
Definition at line 755 of file field_pad_movement.c.