22 #ifndef FREESCAPE_GAMES_3DCK_H 23 #define FREESCAPE_GAMES_3DCK_H 25 #include "freescape/freescape.h" 26 #include "freescape/language/execution_3dck16.h" 34 void loadAssets()
override;
35 void initGameState()
override;
36 void gotoArea(uint16 areaID,
int entranceID)
override;
37 void checkIfStillInArea()
override;
38 bool checkIfGameEnded()
override;
39 void borderScreen()
override {}
40 void drawUI()
override;
42 void updatePlayerMovement(
float deltaTime)
override;
43 void updateTimeVariables()
override;
44 void updateScripts()
override;
45 bool executeObjectConditions(
GeometricObject *obj,
bool shot,
bool collided,
bool activated)
override;
46 void executeLocalGlobalConditions(
bool shot,
bool collided,
bool timer)
override {}
53 ObjectData *
object =
nullptr;
58 struct ConditionData {
69 uint16 directions = 0;
77 Math::Vector3d origin, size, initialOrigin;
96 ScriptEntry(ScriptState *s,
bool r) : script(s), resume(r) {}
101 void playPendingSound();
106 void startScript(ScriptState &script);
107 void beginScriptFrame();
108 FCLExecutionResult executeCode(ScriptState &script, uint &budget);
109 void executeIfThenElse(
const FCLInstruction &instruction, ScriptState &script);
110 void executeConditional(
const FCLInstruction &instruction, ScriptState &script);
111 void executeSetVariable(
const FCLInstruction &instruction, ScriptState &script);
112 void executeIncrementVariable(
const FCLInstruction &instruction, ScriptState &script);
113 void executeDecrementVariable(
const FCLInstruction &instruction, ScriptState &script);
114 void executeAndVariable(
const FCLInstruction &instruction, ScriptState &script);
115 void executeOrVariable(
const FCLInstruction &instruction, ScriptState &script);
116 void executeNotVariable(
const FCLInstruction &instruction, ScriptState &script);
117 void executeVariableComparison(
const FCLInstruction &instruction, ScriptState &script);
121 bool executeCall(
const FCLInstruction &instruction, ScriptState &script);
125 void executeLoop(
const FCLInstruction &instruction, ScriptState &script);
126 bool executeAgain(ScriptState &script, uint32 ip);
130 void executeInclude(
const FCLInstruction &instruction, ScriptState &script);
131 void executeRemove(
const FCLInstruction &instruction, ScriptState &script);
132 bool executeWaitTrigger(ScriptState &script, uint32 ip);
133 void executeMove(
const FCLInstruction &instruction, ScriptState &script);
135 void readSystemVariables();
136 void writeSystemVariables();
137 void setScriptVariable(byte index, uint32 value);
138 void setVariableResult(
const FCLInstruction &instruction, ScriptState &script, uint32 value);
139 int32 getVariableOrConstant(int32 operand, Token::Type type)
const;
140 void getObjectReference(
const FCLInstruction &instruction, uint16 &area, uint16 &
id)
const;
141 ObjectData *scriptObject(uint16 area, uint16
id);
144 void setObjectStatus(uint16 area, uint16
id, Token::Type operation);
145 bool moveAnimation(ScriptState &script, Math::Vector3d movement,
bool absolute);
146 void updateInteractions();
147 void interact(
bool shot);
148 void printMessage(uint16 indicator,
const Common::String &message);
149 void updateIndicators();
150 uint32 indicatorColor(byte color)
const;
157 byte _palette[256 * 3];
158 uint16 _initialPlayerHeight;
159 uint16 _initialCondition = 0, _timerInterval = 0, _activationRange = 0;
160 uint32 _kitVariables[256] = {};
161 uint32 _changedVariables = 0;
162 uint32 _scriptTicks = 0, _timerTicks = 0, _delayUntil = 0;
163 int _lastScriptTick = 0;
164 bool _timerTriggered =
false, _initialScriptPending =
false;
165 bool _scriptFrameActive =
false, _scriptDelayed =
false;
166 int _pendingSound = -1;
167 byte _pendingInteractions = 0, _shootCooldown = 0, _activateCooldown = 0;
168 uint _scriptQueueIndex = 0;
Definition: geometricobject.h:34
Definition: managed_surface.h:51
Definition: advancedDetector.h:164
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: 3dck.h:48
Definition: execution_3dck16.h:36
Definition: freescape.h:191
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: 3dck.h:47
Definition: instruction.h:49