22#ifndef FREESCAPE_GAMES_3DCK_H
23#define FREESCAPE_GAMES_3DCK_H
25#include "freescape/freescape.h"
26#include "freescape/language/execution_3dck16.h"
35 void loadAssets()
override;
36 void initGameState()
override;
37 void gotoArea(uint16 areaID,
int entranceID)
override;
38 void checkIfStillInArea()
override;
39 bool checkIfGameEnded()
override;
40 void borderScreen()
override {}
41 void drawBackground()
override;
42 void drawUI()
override;
44 void updatePlayerMovement(
float deltaTime)
override;
45 void updateTimeVariables()
override;
46 void updateScripts()
override;
47 bool executeObjectConditions(
GeometricObject *obj,
bool shot,
bool collided,
bool activated)
override;
48 void executeLocalGlobalConditions(
bool shot,
bool collided,
bool timer)
override {}
55 ObjectData *
object =
nullptr;
60 struct ConditionData {
62 FCLInstructionVector condition;
71 uint16 directions = 0;
79 Math::Vector3d origin, size, initialOrigin;
82 FCLInstructionVector condition;
93 byte palette[16 * 3] = {};
94 byte skyExtraColor = 0;
100 ScriptEntry(ScriptState *s,
bool r) : script(s), resume(r) {}
103 void loadAssetsDOS();
104 void loadAssetsAtari();
106 void updateBorderAtari();
107 void splitColorAtari(
byte &color,
byte &extraColor);
110 void playPendingSound();
115 void startScript(ScriptState &script);
116 void beginScriptFrame();
117 FCLExecutionResult executeCode(ScriptState &script, uint &budget);
118 void executeIfThenElse(
const FCLInstruction &instruction, ScriptState &script);
119 void executeConditional(
const FCLInstruction &instruction, ScriptState &script);
120 void executeSetVariable(
const FCLInstruction &instruction, ScriptState &script);
121 void executeIncrementVariable(
const FCLInstruction &instruction, ScriptState &script);
122 void executeDecrementVariable(
const FCLInstruction &instruction, ScriptState &script);
123 void executeAndVariable(
const FCLInstruction &instruction, ScriptState &script);
124 void executeOrVariable(
const FCLInstruction &instruction, ScriptState &script);
125 void executeNotVariable(
const FCLInstruction &instruction, ScriptState &script);
126 void executeVariableComparison(
const FCLInstruction &instruction, ScriptState &script);
127 void executeObjectStatus(
const FCLInstruction &instruction);
128 bool checkObjectStatus(
const FCLInstruction &instruction);
129 void executeGetPosition(
const FCLInstruction &instruction);
130 bool executeCall(
const FCLInstruction &instruction, ScriptState &script);
131 bool executeGoto(
const FCLInstruction &instruction);
132 void executeMode(
const FCLInstruction &instruction);
133 bool executeDelay(
const FCLInstruction &instruction);
134 void executeLoop(
const FCLInstruction &instruction, ScriptState &script);
135 bool executeAgain(ScriptState &script, uint32 ip);
136 void executeStartAnim(
const FCLInstruction &instruction);
137 void executeStopAnim(
const FCLInstruction &instruction);
138 void executeTriggerAnim(
const FCLInstruction &instruction);
139 void executeInclude(
const FCLInstruction &instruction, ScriptState &script);
140 void executeRemove(
const FCLInstruction &instruction, ScriptState &script);
141 bool executeWaitTrigger(ScriptState &script, uint32 ip);
142 void executeMove(
const FCLInstruction &instruction, ScriptState &script);
143 void executeSound(
const FCLInstruction &instruction);
144 void readSystemVariables();
145 void writeSystemVariables();
146 void setScriptVariable(
byte index, uint32 value);
147 void setVariableResult(
const FCLInstruction &instruction, ScriptState &script, uint32 value);
148 int32 getVariableOrConstant(int32 operand, Token::Type type)
const;
149 void getObjectReference(
const FCLInstruction &instruction, uint16 &area, uint16 &
id)
const;
150 ObjectData *scriptObject(uint16 area, uint16
id);
151 ObjectData *scriptAnimator(
const FCLInstruction &instruction);
153 void setObjectStatus(uint16 area, uint16
id, Token::Type operation);
154 bool moveAnimation(ScriptState &script, Math::Vector3d movement,
bool absolute);
155 void updateInteractions();
156 void interact(
bool shot);
157 void printMessage(uint16 indicator,
const Common::String &message);
158 void updateIndicators();
159 uint32 indicatorColor(
byte color,
int y)
const;
166 byte _palette[256 * 3] = {};
167 uint16 _initialPlayerHeight;
168 uint16 _initialCondition = 0, _timerInterval = 0, _activationRange = 0;
169 uint32 _kitVariables[256] = {};
170 uint32 _changedVariables = 0;
171 uint32 _scriptTicks = 0, _timerTicks = 0, _delayUntil = 0;
172 int _lastScriptTick = 0;
173 bool _timerTriggered =
false, _initialScriptPending =
false;
174 bool _scriptFrameActive =
false, _scriptDelayed =
false;
175 int _pendingSound = -1;
176 byte _pendingInteractions = 0, _shootCooldown = 0, _activateCooldown = 0;
177 uint _scriptQueueIndex = 0;
Definition: freescape.h:191
Definition: geometricobject.h:34
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: 3dck.h:49
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: 3dck.h:50
Definition: managed_surface.h:51
Definition: advancedDetector.h:164
Definition: execution_3dck16.h:36