22#ifndef TWINE_SCENE_ACTOR_H
23#define TWINE_SCENE_ACTOR_H
25#include "common/scummsys.h"
26#include "twine/parser/anim.h"
27#include "twine/parser/body.h"
28#include "twine/parser/entity.h"
29#include "twine/shared.h"
34#define NUM_SPRITES 425
51 int16 getRealAngle(int32 time);
56 uint32 bComputeCollisionWithObj : 1;
57 uint32 bComputeCollisionWithBricks : 1;
58 uint32 bCheckZone : 1;
59 uint32 bSpriteClip : 1;
60 uint32 bCanBePushed : 1;
61 uint32 bComputeLowCollision : 1;
63 uint32 bComputeCollisionWithFloor : 1;
65 uint32 bIsInvisible : 1;
67 uint32 bObjFallable : 1;
69 uint32 bIsBackgrounded : 1;
70 uint32 bIsCarrierActor : 1;
72 uint32 bUseMiniZv : 1;
73 uint32 bHasInvalidPosition : 1;
74 uint32 bNoElectricShock : 1;
75 uint32 bHasSpriteAnim3D : 1;
76 uint32 bNoPreClipping : 1;
77 uint32 bHasZBuffer : 1;
78 uint32 bHasZBufferInWater : 1;
83 uint32 bWaitHitFrame : 1;
84 uint32 bIsHitting : 1;
85 uint32 bAnimEnded : 1;
86 uint32 bAnimNewFrame : 1;
89 uint32 bIsSpriteMoving : 1;
90 uint32 bIsRotationByAnim : 1;
91 uint32 bIsFalling : 1;
92 uint32 bIsTargetable : 1;
93 uint32 bIsBlinking : 1;
94 uint32 bWasWalkingBeforeFalling : 1;
95 uint32 bANIM_MASTER_GRAVITY : 1;
97 uint32 bOK_RENVOIE : 1;
98 uint32 bLEFT_JUMP : 1;
99 uint32 bRIGHT_JUMP : 1;
100 uint32 bWAIT_SUPER_HIT : 1;
101 uint32 bTRACK_MASTER_ROT : 1;
102 uint32 bFLY_JETPACK : 1;
103 uint32 bDONT_PICK_CODE_JEU : 1;
104 uint32 bMANUAL_INTER_FRAME : 1;
105 uint32 bWAIT_COORD : 1;
106 uint32 bCHECK_FALLING : 1;
120 uint16 givenNothing : 1;
125 uint16 lifepoints : 1;
126 uint16 magicpoints : 1;
128 uint16 cloverleaf : 1;
139 ShapeType _col = ShapeType::kNone;
140 bool _brickCausesDamage =
false;
144 ActorStruct(
int maxLife = 0) : _lifePoint(maxLife), _maxLife(maxLife) {}
149 inline ShapeType brickShape()
const {
return _col; }
150 inline void setCollision(ShapeType shapeType) {
152 _brickCausesDamage =
false;
154 inline void setBrickCausesDamage() { _brickCausesDamage =
true; }
155 inline bool brickCausesDamage() {
return _brickCausesDamage; }
157 void addLife(int32 val);
159 void setLife(int32 val);
161 bool isAttackWeaponAnimationActive()
const;
162 bool isAttackAnimationActive()
const;
163 bool isJumpAnimationActive()
const;
165 const IVec3 &posObj()
const;
168 BodyType _genBody = BodyType::btNormal;
169 BodyType _saveGenBody = BodyType::btNormal;
170 AnimationTypes _genAnim = AnimationTypes::kAnimNone;
171 AnimationTypes _nextGenAnim = AnimationTypes::kStanding;
172 AnimationTypes _ptrAnimAction = AnimationTypes::kAnimNone;
191 ControlMode _move = ControlMode::kNoMove;
192 int32 _delayInMillis = 0;
195 int32 _cropRight = 0;
196 int32 _cropBottom = 0;
197 int32 _followedActor = 0;
198 int32 _bonusAmount = 0;
199 int32 _talkColor = COLOR_BLACK;
201 int32 _lifePoint = 0;
207 int32 _offsetTrack = -1;
208 uint8 *_ptrTrack =
nullptr;
209 int32 _moveScriptSize = 0;
211 int32 _offsetLife = 0;
212 int32 _saveOffsetLife = 0;
213 uint8 *_lifeScript =
nullptr;
214 int32 _lifeScriptSize = 0;
216 int32 _labelTrack = 0;
217 int32 _offsetLabelTrack = 0;
218 int32 _memoLabelTrack = 0;
230 int32 _animStepBeta = 0;
233 int32 _doorWidth = 0;
235 AnimType _flagAnim = AnimType::kAnimationTypeRepeat;
236 int32 _spriteActorRotation = 0;
237 uint8 _brickSound = 0U;
238 int32 SampleAlways = 0;
239 uint8 SampleVolume = 0;
250inline const IVec3 &ActorStruct::posObj()
const {
254inline void ActorStruct::addLife(int32 val) {
255 setLife(_lifePoint + val);
258inline void ActorStruct::setLife(int32 val) {
260 if (_lifePoint > _maxLife) {
261 _lifePoint = _maxLife;
287 int32 searchBody(BodyType bodyIdx, int32 actorIdx,
ActorBoundingBox &actorBoundingBox);
289 void loadBehaviourEntity(
ActorStruct *actor,
EntityData &entityData, int16 &bodyAnimIndex, int32 index);
296 HeroBehaviourType _heroBehaviour = HeroBehaviourType::kNormal;
297 HeroBehaviourType _saveHeroBehaviour = HeroBehaviourType::kNormal;
305 int16 _cropBottomScreen = 0;
321 void initSprite(int32 spriteNum, int32 actorIdx);
322 void setFrame(int32 actorIdx, uint32 frame);
330 TextId getTextIdForBehaviour()
const;
364 void hitObj(int32 actorIdx, int32 actorIdxAttacked, int32 strengthOfHit, int32 angle);
373 void posObjectAroundAnother(uint8 numsrc, uint8 numtopos);
int16 _heroAnimIdxAGGRESSIVE
Definition: actor.h:312
void hitObj(int32 actorIdx, int32 actorIdxAttacked, int32 strengthOfHit, int32 angle)
bool _combatAuto
Definition: actor.h:299
int16 _heroAnimIdxATHLETIC
Definition: actor.h:310
int16 _heroAnimIdxNORMAL
Definition: actor.h:308
void initBody(BodyType bodyIdx, int16 actorIdx)
void initObject(int16 actorIdx)
void checkCarrier(int32 actorIdx)
void startInitObj(int16 actorIdx)
int16 _previousHeroAngle
Definition: actor.h:303
void giveExtraBonus(int32 actorIdx)
void setBehaviour(HeroBehaviourType behaviour)
HeroBehaviourType _previousHeroBehaviour
Definition: actor.h:301
int16 _heroAnimIdxDISCRETE
Definition: actor.h:314
int16 _heroAnimIdxPROTOPACK
Definition: actor.h:316
int16 _heroAnimIdx[4]
Definition: actor.h:319
int32 _objCol
Definition: actor.h:223
int32 _carryBy
Definition: actor.h:227
IVec3 _processActor
Definition: actor.h:204
Associate 3d models from body hqr with animations from anim.hqr for the game characters.
Definition: entity.h:83
Axis aligned bounding box.
Definition: shared.h:193
int16 getRealValueFromTime(int32 time)