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 // 200 for lba1 37 #define NUM_BODIES 469 // 131 for lba1 51 int16 getRealAngle(int32 time);
62 uint32 bComputeCollisionWithObj : 1;
63 uint32 bComputeCollisionWithBricks : 1;
64 uint32 bCheckZone : 1;
65 uint32 bSpriteClip : 1;
66 uint32 bCanBePushed : 1;
67 uint32 bComputeLowCollision : 1;
69 uint32 bComputeCollisionWithFloor : 1;
71 uint32 bIsInvisible : 1;
73 uint32 bObjFallable : 1;
75 uint32 bIsBackgrounded : 1;
76 uint32 bIsCarrierActor : 1;
78 uint32 bUseMiniZv : 1;
79 uint32 bHasInvalidPosition : 1;
80 uint32 bNoElectricShock : 1;
81 uint32 bHasSpriteAnim3D : 1;
82 uint32 bNoPreClipping : 1;
83 uint32 bHasZBuffer : 1;
84 uint32 bHasZBufferInWater : 1;
89 uint32 bWaitHitFrame : 1;
90 uint32 bIsHitting : 1;
91 uint32 bAnimEnded : 1;
92 uint32 bAnimNewFrame : 1;
95 uint32 bIsSpriteMoving : 1;
96 uint32 bIsRotationByAnim : 1;
97 uint32 bIsFalling : 1;
98 uint32 bIsTargetable : 1;
99 uint32 bIsBlinking : 1;
100 uint32 bWasWalkingBeforeFalling : 1;
101 uint32 bANIM_MASTER_GRAVITY : 1;
103 uint32 bOK_RENVOIE : 1;
104 uint32 bLEFT_JUMP : 1;
105 uint32 bRIGHT_JUMP : 1;
106 uint32 bWAIT_SUPER_HIT : 1;
107 uint32 bTRACK_MASTER_ROT : 1;
108 uint32 bFLY_JETPACK : 1;
109 uint32 bDONT_PICK_CODE_JEU : 1;
110 uint32 bMANUAL_INTER_FRAME : 1;
111 uint32 bWAIT_COORD : 1;
112 uint32 bCHECK_FALLING : 1;
126 uint16 givenNothing : 1;
131 uint16 lifepoints : 1;
132 uint16 magicpoints : 1;
134 uint16 cloverleaf : 1;
145 ShapeType _col = ShapeType::kNone;
146 bool _brickCausesDamage =
false;
150 ActorStruct(
int maxLife = 0) : _lifePoint(maxLife), _maxLife(maxLife) {}
155 inline ShapeType brickShape()
const {
return _col; }
156 inline void setCollision(ShapeType shapeType) {
158 _brickCausesDamage =
false;
160 inline void setBrickCausesDamage() { _brickCausesDamage =
true; }
161 inline bool brickCausesDamage() {
return _brickCausesDamage; }
163 void addLife(int32 val);
165 void setLife(int32 val);
167 bool isAttackWeaponAnimationActive()
const;
168 bool isAttackAnimationActive()
const;
169 bool isJumpAnimationActive()
const;
171 const IVec3 &posObj()
const;
174 BodyType _genBody = BodyType::btNormal;
175 BodyType _saveGenBody = BodyType::btNormal;
176 AnimationTypes _genAnim = AnimationTypes::kAnimNone;
177 AnimationTypes _nextGenAnim = AnimationTypes::kStanding;
178 AnimationTypes _ptrAnimAction = AnimationTypes::kAnimNone;
192 int32 _strengthOfHit = 0;
197 ControlMode _move = ControlMode::kNoMove;
198 int32 _delayInMillis = 0;
201 int32 _cropRight = 0;
202 int32 _cropBottom = 0;
203 int32 _followedActor = 0;
204 int32 _bonusAmount = 0;
205 int32 _talkColor = COLOR_BLACK;
207 int32 _lifePoint = 0;
213 int32 _offsetTrack = -1;
214 uint8 *_ptrTrack =
nullptr;
215 int32 _moveScriptSize = 0;
217 int32 _offsetLife = 0;
218 int32 _saveOffsetLife = 0;
219 uint8 *_lifeScript =
nullptr;
220 int32 _lifeScriptSize = 0;
222 int32 _labelTrack = 0;
223 int32 _offsetLabelTrack = 0;
224 int32 _memoLabelTrack = 0;
236 int32 _animStepBeta = 0;
239 int32 _doorWidth = 0;
241 AnimType _flagAnim = AnimType::kAnimationTypeRepeat;
242 int32 _spriteActorRotation = 0;
243 uint8 _brickSound = 0U;
244 int32 SampleAlways = 0;
245 uint8 SampleVolume = 0;
257 inline const IVec3 &ActorStruct::posObj()
const {
261 inline void ActorStruct::addLife(int32 val) {
262 setLife(_lifePoint + val);
265 inline void ActorStruct::setLife(int32 val) {
267 if (_lifePoint > _maxLife) {
268 _lifePoint = _maxLife;
294 int32 searchBody(BodyType bodyIdx, int32 actorIdx,
ActorBoundingBox &actorBoundingBox);
296 void loadBehaviourEntity(
ActorStruct *actor,
EntityData &entityData, int16 &bodyAnimIndex, int32 index);
303 HeroBehaviourType _heroBehaviour = HeroBehaviourType::kNormal;
304 HeroBehaviourType _saveHeroBehaviour = HeroBehaviourType::kNormal;
306 bool _combatAuto =
true;
308 HeroBehaviourType _previousHeroBehaviour = HeroBehaviourType::kNormal;
310 int16 _previousHeroAngle = 0;
312 int16 _cropBottomScreen = 0;
315 int16 _heroAnimIdxNORMAL = 0;
317 int16 _heroAnimIdxATHLETIC = 0;
319 int16 _heroAnimIdxAGGRESSIVE = 0;
321 int16 _heroAnimIdxDISCRETE = 0;
323 int16 _heroAnimIdxPROTOPACK = 0;
326 int16 _heroAnimIdx[4];
328 void initSprite(int32 spriteNum, int32 actorIdx);
329 void setFrame(int32 actorIdx, uint32 frame);
335 void loadHeroEntities();
337 TextId getTextIdForBehaviour()
const;
343 void setBehaviour(HeroBehaviourType behaviour);
350 void initBody(BodyType bodyIdx, int16 actorIdx);
356 void startInitObj(int16 actorIdx);
362 void initObject(int16 actorIdx);
371 void hitObj(int32 actorIdx, int32 actorIdxAttacked, int32 strengthOfHit, int32 angle);
374 void checkCarrier(int32 actorIdx);
377 void giveExtraBonus(int32 actorIdx);
380 void posObjectAroundAnother(uint8 numsrc, uint8 numtopos);
int16 getRealValueFromTime(int32 time)
Associate 3d models from body hqr with animations from anim.hqr for the game characters.
Definition: entity.h:83
Definition: achievements_tables.h:27
Axis aligned bounding box.
Definition: shared.h:188
IVec3 _processActor
Definition: actor.h:210