22 #ifndef BLADERUNNER_ACTOR_H 23 #define BLADERUNNER_ACTOR_H 25 #include "bladerunner/boundingbox.h" 26 #include "bladerunner/vector.h" 28 #include "common/array.h" 29 #include "common/rect.h" 36 class BladeRunnerEngine;
39 class SaveFileReadStream;
40 class SaveFileWriteStream;
46 static const int kActorTimers = 7;
60 int _combatAggressiveness;
75 uint32 _timer4RemainDefault;
80 bool _isImmuneToObstacles;
81 bool _mustReachWalkDestination;
85 bool _damageAnimIfMoving;
88 bool _movementTrackPaused;
89 int _movementTrackNextWaypointId;
90 int32 _movementTrackNextDelay;
91 int _movementTrackNextAngle;
92 bool _movementTrackNextRunning;
94 int _movementTrackWalkingToWaypointId;
95 int32 _movementTrackDelayOnNextWaypoint;
101 int _animationModeCombatIdle;
102 int _animationModeCombatWalk;
103 int _animationModeCombatRun;
112 int32 _timersLeft[kActorTimers];
113 uint32 _timersLast[kActorTimers];
125 void setup(
int actorId);
127 void setAtXYZ(
const Vector3 &pos,
int facing,
bool setFacing =
true,
bool moving =
false,
bool retired =
false);
128 void setAtWaypoint(
int waypointId,
int angle,
bool moving,
bool retired);
130 int getId()
const {
return _id; };
135 int getFacing()
const;
136 int getAnimationMode()
const;
137 int getAnimationId()
const;
139 Vector3 getPosition()
const {
return _position; }
141 void changeAnimationMode(
int animationMode,
bool force =
false);
142 void changeAnimationState(
int animationState,
int animationFrame,
int animationStateNext,
int animationNext);
143 void queryAnimationState(
int *animationState,
int *animationFrame,
int *animationStateNext,
int *animationNext);
145 void setFPS(
int fps);
148 void timerStart(
int timerId, int32 intervalMillis);
149 void timerReset(
int timerId);
150 int32 timerLeft(
int timerId);
152 void timerUpdate(
int timerId);
154 void movementTrackNext(
bool omitAiScript);
155 void movementTrackPause();
156 void movementTrackUnpause();
157 void movementTrackWaypointReached();
159 bool loopWalk(
const Vector3 &destination,
int proximity,
bool interruptible,
bool runFlag,
const Vector3 &start,
float targetWidth,
float targetSize,
bool mustReach,
bool *isRunningFlag,
bool async);
160 bool walkTo(
bool runFlag,
const Vector3 &destination,
bool mustReach);
161 bool loopWalkToActor(
int otherActorId,
int proximity,
int interruptible,
bool runFlag,
bool mustReach,
bool *isRunningFlag);
162 bool loopWalkToItem(
int itemId,
int proximity,
int interruptible,
bool runFlag,
bool mustReach,
bool *isRunningFlag);
163 bool loopWalkToSceneObject(
const Common::String &objectName,
int proximity,
bool interruptible,
bool runFlag,
bool mustReach,
bool *isRunningFlag);
164 bool loopWalkToWaypoint(
int waypointId,
int proximity,
int interruptible,
bool runFlag,
bool mustReach,
bool *isRunningFlag);
165 bool loopWalkToXYZ(
const Vector3 &destination,
int proximity,
bool interruptible,
bool runFlag,
bool mustReach,
bool *isRunningFlag);
166 bool asyncWalkToWaypoint(
int waypointId,
int proximity,
bool runFlag,
bool mustReach);
167 void asyncWalkToXYZ(
const Vector3 &destination,
int proximity,
bool runFlag,
bool mustReach);
174 void resetScreenRectangleAndBbox();
176 int getSetId()
const;
177 void setSetId(
int setId);
178 const BoundingBox &getBoundingBox()
const {
return _bbox; }
179 const Common::Rect &getScreenRectangle() {
return _screenRectangle; }
180 int getWalkbox()
const {
return _walkboxId; }
182 bool isRetired()
const {
return _isRetired; }
183 bool isTarget()
const {
return _isTarget; }
184 void setTarget(
bool targetable);
185 bool isImmuneToObstacles()
const {
return _isImmuneToObstacles; }
186 bool inCombat()
const {
return _inCombat; }
188 bool isMoving()
const {
return _isMoving; }
189 void setMoving(
bool value) { _isMoving = value; }
191 bool mustReachWalkDestination()
const {
return _mustReachWalkDestination; }
192 bool isWalking()
const;
193 bool isRunning()
const;
194 void stopWalking(
bool value);
196 void faceActor(
int otherActorId,
bool animate);
198 void faceItem(
int itemId,
bool animate);
199 void faceWaypoint(
int waypointId,
bool animate);
200 void faceXYZ(
float x,
float y,
float z,
bool animate);
201 void faceXYZ(
const Vector3 &pos,
bool animate);
202 void faceCurrentCamera(
bool animate);
203 void faceHeading(
int heading,
bool animate);
204 void setFacing(
int facing,
bool halfOrSet =
true);
206 int getCurrentHP()
const {
return _currentHP; }
207 int getMaxHP()
const {
return _maxHP; }
208 void setCurrentHP(
int hp);
209 void setHealth(
int hp,
int maxHp);
210 void modifyCurrentHP(
signed int change);
211 void modifyMaxHP(
signed int change);
213 int getFriendlinessToOther(
int otherActorId)
const {
return _friendlinessToOther[otherActorId]; }
214 void setFriendlinessToOther(
int otherActorId,
int friendliness);
215 void modifyFriendlinessToOther(
int otherActorId,
signed int change);
216 bool checkFriendlinessAndHonesty(
int otherActorId);
218 int getHonesty()
const {
return _honesty; }
219 void setHonesty(
int honesty);
220 void modifyHonesty(
signed int change);
222 int getIntelligence()
const {
return _intelligence; }
223 void setIntelligence(
int intelligence);
224 void modifyIntelligence(
signed int change);
226 int getStability()
const {
return _stability; }
227 void setStability(
int stability);
228 void modifyStability(
signed int change);
230 int getCombatAggressiveness()
const {
return _combatAggressiveness; }
231 void setCombatAggressiveness(
int combatAggressiveness);
232 void modifyCombatAggressiveness(
signed int change);
234 void setInvisible(
bool isInvisible);
235 void setImmunityToObstacles(
bool isImmune);
237 void setFlagDamageAnimIfMoving(
bool value);
238 bool getFlagDamageAnimIfMoving()
const;
240 int getSitcomRatio()
const;
242 void retire(
bool isRetired,
int width,
int height,
int retiredByActorId);
244 void combatModeOn(
int initialState,
bool rangedAttack,
int enemyId,
int waypointType,
int animationModeCombatIdle,
int animationModeCombatWalk,
int animationModeCombatRun,
int fleeRatio,
int coverRatio,
int attackRatio,
int damage,
int range,
bool unstoppable);
245 void combatModeOff();
247 void setGoal(
int goalNumber);
250 float distanceFromActor(
int otherActorId);
251 int angleTo(
const Vector3 &target)
const;
253 void speechPlay(
int sentenceId,
bool voiceOver);
257 void addClueToDatabase(
int clueId,
int unknown,
bool clueAcquired,
bool unknownFlag,
int fromActorId);
258 bool canAcquireClue(
int clueId)
const;
259 void acquireClue(
int clueId,
bool unknownFlag,
int fromActorId);
260 void loseClue(
int clueId);
261 bool hasClue(
int clueId)
const;
262 bool copyClues(
int actorId);
263 void acquireCluesByRelations();
265 int soundVolume()
const;
266 int soundPan(uint8 overrideRange = 35)
const;
268 bool isObstacleBetween(
const Vector3 &target);
276 void setBoundingBox(
const Vector3 &position,
bool retired);
277 float distanceFromView(
View *view)
const;
279 bool findEmptyPositionAround(
const Vector3 &startPosition,
const Vector3 &targetPosition,
float size,
Vector3 *emptyPosition);
280 bool findNearestPosition(
Vector3 *nearestPosition,
float targetWidth,
int proximity,
float targetSize,
const Vector3 &startPosition,
const Vector3 &targetPosition);
281 bool stepAway(
const Vector3 &destination,
float distance);
Definition: savefile.h:88
Definition: actor_clues.h:33
Definition: savefile.h:113
Definition: actor_walk.h:34
Definition: boundingbox.h:31
Definition: movement_track.h:34
Definition: bladerunner.h:113
Definition: actor_combat.h:33