22 #ifndef ASYLUM_RESOURCES_ACTOR_H 23 #define ASYLUM_RESOURCES_ACTOR_H 25 #include "common/array.h" 26 #include "common/rect.h" 27 #include "common/serializer.h" 28 #include "common/stream.h" 30 #include "asylum/shared.h" 32 #include "asylum/resources/inventory.h" 37 class GraphicResource;
47 ActorDirection directions[120];
52 memset(&directions, 0,
sizeof(directions));
62 for (int32 i = 0; i < 120; i++) {
67 for (int32 i = 0; i < 120; i++)
73 s.syncAsUint32LE(count);
74 s.syncAsSint32LE(current);
76 for (int32 i = 0; i <
ARRAYSIZE(points); i++) {
77 s.syncAsSint32LE(points[i].x);
78 s.syncAsSint32LE(points[i].y);
81 for (int32 i = 0; i <
ARRAYSIZE(directions); i++)
82 s.syncAsSint32LE(directions[i]);
98 void setActionIndex2(int32 index) { _actionIdx2 = index; }
99 void setObjectIndex(int32 index) { _objectIndex = index; }
100 void setDirection(ActorDirection dir) { _direction = dir; }
101 void setFrameCount(int32 count) { _frameCount = count; }
102 void setFrameIndex(int32 number) { _frameIndex = number; }
103 void setLastScreenUpdate(int32 tick) { _lastScreenUpdate = tick; }
104 void setNumberFlag01(int32 number) { _numberFlag01 = number; }
105 void setPriority(int32 priority) { _priority = priority; }
106 void setResourceId(ResourceId
id) { _resourceId = id; }
107 void setSoundResourceId(ResourceId
id) { _soundResourceId = id; }
108 void setStatus(ActorStatus status) { _status = status; }
109 void setTransparency(int32 val) { _transparency = val; }
110 void setTickCount(int32 tickCount) { _tickCount = tickCount; }
112 void setField934(int32 val) { _field_934 = val; }
113 void setField938(int32 val) { _field_938 = val; }
114 void setField944(int32 val) { _field_944 = val; }
116 int32 getActionIndex3() {
return _actionIdx3; }
117 Common::Rect *getBoundingRect() {
return &_boundingRect; }
118 ActorDirection getDirection() {
return _direction; }
119 uint32 getFrameCount() {
return _frameCount; }
120 uint32 getFrameIndex() {
return _frameIndex; }
121 char *getName() {
return (
char *)&_name; }
122 ActorIndex getNextActorIndex() {
return _nextActorIndex; }
123 int32 getNumberValue01() {
return _numberValue01; }
127 int32 getPriority() {
return _priority; }
128 ResourceId getResourceId() {
return _resourceId; }
129 ResourceId getResourcesId(uint32 index) {
return _graphicResourceIds[index]; }
130 int32 getScriptIndex() {
return _scriptIndex; }
131 bool shouldInvertPriority() {
return _invertPriority; }
132 ResourceId getSoundResourceId() {
return _soundResourceId; }
133 ActorStatus getStatus() {
return _status; }
134 int32 getTickCount() {
return _tickCount; }
136 int32 getField934() {
return _field_934; }
137 int32 getField944() {
return _field_944; }
138 int32 getField948() {
return _field_948; }
139 int32 getField94C() {
return _field_94C; }
176 void show() { setVisible(
true); }
181 void hide() { setVisible(
false); }
205 void enable() { changeStatus(kActorStatusEnabled); }
212 void changeStatus(ActorStatus status);
221 void updateReflectionData();
228 void changeDirection(ActorDirection direction);
236 void faceTarget(uint32 target, DirectionFrom from);
246 void setPosition(int16 newX, int16 newY, ActorDirection newDirection, uint32 frame);
255 bool canChangeStatus(
int index)
const;
285 void clearReflectionData();
288 void forceTo(int16 actorX, int16 actorY,
bool doSpeech);
289 void setupReflectionData(ActorIndex nextActor, int32 actionAreaId, ActorDirection nextDirection,
const Common::Point &nextPosition,
bool invertPriority,
const Common::Point &nextPositionOffset);
291 bool canMove(
Common::Point *point, ActorDirection direction, uint32 count,
bool hasDelta);
292 void move(ActorDirection dir, uint32 distance);
293 bool testActorCollision(
Common::Point *point, ActorDirection direction);
294 void drawInventory();
302 bool checkBoredStatus()
const;
315 static void morphInto(
AsylumEngine *engine,
int nextPlayer);
350 ResourceId _resourceId;
357 ActorDirection _direction;
370 ResourceId _walkingSound1;
371 ResourceId _walkingSound2;
372 ResourceId _walkingSound3;
373 ResourceId _walkingSound4;
376 ResourceId _graphicResourceIds[55];
378 int32 _distancesEO[20];
379 int32 _distancesNS[20];
380 int32 _distancesNSEO[20];
383 uint32 _lastScreenUpdate;
388 ResourceId _soundResourceId;
389 int32 _numberValue01;
394 int16 _numberStringWidth;
396 char _numberString01[8];
399 bool _processNewDirection;
400 bool _invertPriority;
401 ActorDirection _nextDirection;
402 int32 _nextActionIndex;
403 ActorIndex _nextActorIndex;
418 uint32 _updateCounter;
423 void updateStatusInteracting();
424 void checkPumpkinDeath();
425 void updatePumpkin(GameFlag flagToCheck, GameFlag flagToSet, ObjectId objectToUpdate, ObjectId objectToDisable);
427 void updateStatusEnabled();
428 void updateStatusEnabledProcessStatus(int16 testX, int16 testY, uint32 counter, int16 setX, int16 setY);
430 void updateStatusBored();
433 void ScareCrowClosesIn();
434 void TentacleRises();
436 void updateStatusEnabled2();
437 void CrowHoveringBeforeKill();
438 void CrowStatusQuo();
439 void TentacleWigglesForSarah();
444 void checkScareCrowDeath();
445 bool checkCrowDeath();
446 void ScareCrowAttacks();
447 bool actorsIntersect(ActorIndex actorIndex1, ActorIndex actorIndex2);
448 void TentacleWhips();
452 void SarahGetsSome();
457 void ScareCrowRetreats();
459 void updateStatusMorphing();
461 void actionAreaCheck();
484 void setVisible(
bool value);
521 void updateGraphicData(uint32 offset);
528 DrawFlags getGraphicsFlags();
538 int32 getStride(ActorDirection direction, uint32 frameIndex)
const;
548 int32 getWalkIncrement(ActorDirection direction, uint32 frameIndex)
const;
557 static void incPosition(ActorDirection direction, int16 delta,
Common::Point *point);
612 #endif // ASYLUM_RESOURCES_ACTOR_H #define ARRAYSIZE(x)
Definition: util.h:91
Definition: inventory.h:32
void enable()
Definition: actor.h:205
FORCEINLINE int32 readSint32LE()
Definition: stream.h:555
uint32 readUint32LE()
Definition: stream.h:473
Definition: atari-screen.h:60
Definition: serializer.h:79
void show()
Definition: actor.h:176
Definition: serializer.h:308
Out move(In first, In last, Out dst)
Definition: algorithm.h:109
int16 x
Definition: rect.h:46
bool isVisible()
Definition: actor.h:164
void hide()
Definition: actor.h:181
int16 y
Definition: rect.h:47