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 bIsZonable : 1;
65 uint32 bUsesClipping : 1;
66 uint32 bCanBePushed : 1;
67 uint32 bComputeLowCollision : 1;
69 uint32 bComputeCollisionWithFloor : 1;
72 uint32 bIsSpriteActor : 1;
74 uint32 bDoesntCastShadow : 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;
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;
138 #define kActorMaxLife 50 147 ShapeType _col = ShapeType::kNone;
148 bool _brickCausesDamage =
false;
156 inline ShapeType brickShape()
const {
return _col; }
157 inline void setCollision(ShapeType shapeType) {
159 _brickCausesDamage =
false;
161 inline void setBrickCausesDamage() { _brickCausesDamage =
true; }
162 inline bool brickCausesDamage() {
return _brickCausesDamage; }
163 void loadModel(int32 modelIndex,
bool lba1);
165 void addLife(int32 val);
167 void setLife(int32 val);
169 bool isAttackWeaponAnimationActive()
const;
170 bool isAttackAnimationActive()
const;
171 bool isJumpAnimationActive()
const;
173 const IVec3 &posObj()
const;
176 BodyType _genBody = BodyType::btNormal;
177 BodyType _saveGenBody = BodyType::btNormal;
178 AnimationTypes _genAnim = AnimationTypes::kAnimNone;
179 AnimationTypes _nextGenAnim = AnimationTypes::kStanding;
180 AnimationTypes _ptrAnimAction = AnimationTypes::kAnimNone;
186 int32 _strengthOfHit = 0;
191 ControlMode _controlMode = 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 = kActorMaxLife;
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;
244 inline const IVec3 &ActorStruct::posObj()
const {
248 inline void ActorStruct::addLife(int32 val) {
249 setLife(_lifePoint + val);
252 inline void ActorStruct::setLife(int32 val) {
254 if (_lifePoint > kActorMaxLife) {
255 _lifePoint = kActorMaxLife;
281 int32 searchBody(BodyType bodyIdx, int32 actorIdx,
ActorBoundingBox &actorBoundingBox);
283 void loadBehaviourEntity(
ActorStruct *actor,
EntityData &entityData, int16 &bodyAnimIndex, int32 index);
290 HeroBehaviourType _heroBehaviour = HeroBehaviourType::kNormal;
291 HeroBehaviourType _saveHeroBehaviour = HeroBehaviourType::kNormal;
293 bool _combatAuto =
true;
295 HeroBehaviourType _previousHeroBehaviour = HeroBehaviourType::kNormal;
297 int16 _previousHeroAngle = 0;
299 int16 _cropBottomScreen = 0;
302 int16 _heroAnimIdxNORMAL = 0;
304 int16 _heroAnimIdxATHLETIC = 0;
306 int16 _heroAnimIdxAGGRESSIVE = 0;
308 int16 _heroAnimIdxDISCRETE = 0;
310 int16 _heroAnimIdxPROTOPACK = 0;
313 int16 _heroAnimIdx[4];
315 void initSpriteActor(int32 actorIdx);
318 void restartHeroScene();
321 void loadHeroEntities();
323 TextId getTextIdForBehaviour()
const;
329 void setBehaviour(HeroBehaviourType behaviour);
336 void initBody(BodyType bodyIdx, int16 actorIdx);
342 void startInitObj(int16 actorIdx);
348 void initObject(int16 actorIdx);
357 void hitObj(int32 actorIdx, int32 actorIdxAttacked, int32 strengthOfHit, int32 angle);
360 void processActorCarrier(int32 actorIdx);
363 void giveExtraBonus(int32 actorIdx);
int16 getRealValueFromTime(int32 time)
Associate 3d models from body hqr with animations from anim.hqr for the game characters.
Definition: entity.h:69
Definition: achievements_tables.h:27
Axis aligned bounding box.
Definition: shared.h:179
IVec3 _processActor
Definition: actor.h:204