Alchemy
Loading...
Searching...
No Matches

event_work.h

Go to the documentation of this file.
1#ifndef ALCHEMY_EVENT_WORK_H
2#define ALCHEMY_EVENT_WORK_H
3
4/// @file
5/// EventWork, the running scene's event work.
6
7#include "types.h"
8#include "edition.h"
9#include "static_assert.h"
10
11struct ScenePlacement;
12struct SceneEvent;
13struct FieldActor;
14struct ObjectRuntime;
15
16/// The running scene's event work: its placement and event tables, its
17/// actors, the triggers and exit it has hit, encounters, transitions and the
18/// message on show. It is struct FieldWork (heap slot 27) as the scenes see
19/// it, through gEventWork; each field is the FieldWork field at its offset.
20struct EventWork {
21 struct ScenePlacement *tables[4]; ///< the placement tables placed so far
22 struct SceneEvent *events; ///< the scene's event table
23 struct FieldActor *actors[8]; ///< the party's characters, ids 0 to 7
24 struct FieldActor *placedActors[58]; ///< the placed actors, from id 8
25 u8 unk11c[0x50]; ///< FieldWork's markers; not named by TBS code
26 s16 touchedTrigger; ///< the step event a touch or exit event answers
27 u8 unk16e[2]; ///< FieldWork's input request; not named by TBS code
28 u16 requestedExit; ///< the exit kind taken, which ends the scene
29 u16 unk172; ///< FieldWork's menu request; scenes set it to 1
30 u8 unk174[6]; ///< FieldWork's examine, start and descriptor
31 s16 facingTrigger; ///< the collision code ahead, which a search answers
32 u16 encounterEnemyGroup; ///< the next battle's enemy group, 0 for none
33 s16 psynergyRequest; ///< a field Psynergy to use, as owner << 10 | Psynergy
34 u8 unk180[2]; ///< FieldWork's item request; not named by TBS code
35 s16 raisedTrigger; ///< a raised event for Scene_RunRaisedEvent
36 u8 unk184[0x18]; ///< FieldWork's fallen characters and item slot
37 s16 blockedSteps; ///< frames the leader has pushed against something
38 s16 mode; ///< MODE_WORLD_MAP (3) on the world map
39 u8 encounterGroups[8]; ///< encounter zone for each kind of ground
40 s32 encounterBias; ///< randomized distance adjustment between battles
41 s32 encounterThreshold; ///< encounter steps before a battle
42 u8 unk1b0[0x10]; ///< FieldWork's walking distance and tiles
43 s32 startTransition; ///< SCENE_TRANSITION(style, variant)
44 u8 unk1c4[4]; ///< FieldWork's unk1c4 and transitionActive
45 s32 transitionFrames; ///< frames
46 u8 unk1cc[0x0c]; ///< FieldWork's fastForward and unk1d0
47 u16 message; ///< the next message, advanced as each window opens
48 u8 unk1da[6]; ///< FieldWork's unk1da to unk1de
49 struct FieldActor *viewCenter; ///< the object the map view follows
50 u8 unk1e4[0xade]; ///< not named by TBS code through this view
51 u16 choiceMessage; ///< Message containing the choices.
52 u16 unkcc4; ///< FieldWork's nameWidth; Colosso sets it to 4
53};
54
55STATIC_ASSERT(offsetof(struct EventWork, placedActors) == 0x34);
56STATIC_ASSERT(offsetof(struct EventWork, touchedTrigger) == 0x16c);
57STATIC_ASSERT(offsetof(struct EventWork, requestedExit) == 0x170);
58STATIC_ASSERT(offsetof(struct EventWork, facingTrigger) == 0x17a);
59STATIC_ASSERT(offsetof(struct EventWork, encounterEnemyGroup) == 0x17c);
60STATIC_ASSERT(offsetof(struct EventWork, psynergyRequest) == 0x17e);
61STATIC_ASSERT(offsetof(struct EventWork, raisedTrigger) == 0x182);
62STATIC_ASSERT(offsetof(struct EventWork, blockedSteps) == 0x19c);
63STATIC_ASSERT(offsetof(struct EventWork, mode) == 0x19e);
64STATIC_ASSERT(offsetof(struct EventWork, encounterGroups) == 0x1a0);
65STATIC_ASSERT(offsetof(struct EventWork, encounterBias) == 0x1a8);
66STATIC_ASSERT(offsetof(struct EventWork, encounterThreshold) == 0x1ac);
67STATIC_ASSERT(offsetof(struct EventWork, startTransition) == 0x1c0);
68STATIC_ASSERT(offsetof(struct EventWork, transitionFrames) == 0x1c8);
69STATIC_ASSERT(offsetof(struct EventWork, message) == 0x1d8);
70STATIC_ASSERT(offsetof(struct EventWork, viewCenter) == 0x1e0);
71STATIC_ASSERT(offsetof(struct EventWork, choiceMessage) == 0xcc2);
72
73#endif
The edition's language, for C to compare (LANGUAGE == LANGUAGE_GERMAN).
STATIC_ASSERT, a compile-time check that emits nothing.
#define STATIC_ASSERT(condition)
C89 permits repeated extern declarations of the same array.
#define offsetof(type, member)
Definition stddef.h:19
The running scene's event work: its placement and event tables, its actors, the triggers and exit it ...
Definition event_work.h:20
u8 unk1e4[0xade]
not named by TBS code through this view
Definition event_work.h:50
s32 encounterThreshold
encounter steps before a battle
Definition event_work.h:41
u16 encounterEnemyGroup
the next battle's enemy group, 0 for none
Definition event_work.h:32
struct FieldActor * viewCenter
the object the map view follows
Definition event_work.h:49
struct SceneEvent * events
the scene's event table
Definition event_work.h:22
s16 facingTrigger
the collision code ahead, which a search answers
Definition event_work.h:31
u8 unk174[6]
FieldWork's examine, start and descriptor.
Definition event_work.h:30
u8 unk1c4[4]
FieldWork's unk1c4 and transitionActive.
Definition event_work.h:44
s16 raisedTrigger
a raised event for Scene_RunRaisedEvent
Definition event_work.h:35
s32 startTransition
SCENE_TRANSITION(style, variant).
Definition event_work.h:43
u16 unkcc4
FieldWork's nameWidth; Colosso sets it to 4.
Definition event_work.h:52
struct FieldActor * actors[8]
the party's characters, ids 0 to 7
Definition event_work.h:23
s16 blockedSteps
frames the leader has pushed against something
Definition event_work.h:37
s16 touchedTrigger
the step event a touch or exit event answers
Definition event_work.h:26
u16 unk172
FieldWork's menu request; scenes set it to 1.
Definition event_work.h:29
u8 unk180[2]
FieldWork's item request; not named by TBS code.
Definition event_work.h:34
u16 requestedExit
the exit kind taken, which ends the scene
Definition event_work.h:28
s32 encounterBias
randomized distance adjustment between battles
Definition event_work.h:40
u8 unk1cc[0x0c]
FieldWork's fastForward and unk1d0.
Definition event_work.h:46
s16 mode
MODE_WORLD_MAP (3) on the world map.
Definition event_work.h:38
u8 unk16e[2]
FieldWork's input request; not named by TBS code.
Definition event_work.h:27
struct FieldActor * placedActors[58]
the placed actors, from id 8
Definition event_work.h:24
u8 unk1b0[0x10]
FieldWork's walking distance and tiles.
Definition event_work.h:42
u16 choiceMessage
Message containing the choices.
Definition event_work.h:51
s16 psynergyRequest
a field Psynergy to use, as owner << 10 | Psynergy
Definition event_work.h:33
u8 encounterGroups[8]
encounter zone for each kind of ground
Definition event_work.h:39
s32 transitionFrames
frames
Definition event_work.h:45
struct ScenePlacement * tables[4]
the placement tables placed so far
Definition event_work.h:21
u16 message
the next message, advanced as each window opens
Definition event_work.h:47
u8 unk184[0x18]
FieldWork's fallen characters and item slot.
Definition event_work.h:36
u8 unk11c[0x50]
FieldWork's markers; not named by TBS code.
Definition event_work.h:25
u8 unk1da[6]
FieldWork's unk1da to unk1de.
Definition event_work.h:48
A field actor: a person or thing on the field with a position, motion toward a target,...
Definition field_obj.h:30
One of the 64 field objects in the object pool (heap slot 5): its script, position,...
A scene event: its kind and detail, the trigger it answers, its condition and its value (a message or...
An actor a scene places: its sprite, the condition for placing it, how it behaves,...
Definition field_scene.h:81
The integer types, TRUE, UNUSED and the fixed-address macros.
signed int s32
Definition types.h:14
signed short s16
Definition types.h:12
unsigned short u16
Definition types.h:13
unsigned char u8
Definition types.h:11