26 #ifndef SAGA2_PLAYER_H 27 #define SAGA2_PLAYER_H 29 #include "saga2/actor.h" 33 #define FTA_JULIAN (PlayerActorID)0 34 #define FTA_PHILIP (PlayerActorID)1 35 #define FTA_KEVIN (PlayerActorID)2 46 friend void initPlayerActors();
47 friend void cleanupPlayerActors();
57 enum PlayerActorFlags {
58 kPlayerAggressive = (1 << 0),
59 kPlayerBanded = (1 << 1),
60 kPlayerHasCartography = (1 << 2)
66 kAttribPointsPerUpdate = 1,
67 kAttribPointsPerValue = 10
71 kVitalityLevelBump = 50
78 int16 _manaMemory[kNumManas];
81 uint8 _attribRecPools[kNumSkills];
84 uint8 _attribMemPools[kNumSkills];
87 uint8 _vitalityMemory;
91 bool _notifiedOfAttack;
94 PlayerActor(ObjectID a) : _actorID(a), _portraitType(0), _flags(0), _readyNode(NULL),
95 _vitalityMemory(0), _notifiedOfAttack(
false) {
97 assert(ActorAttributes::kSkillFracPointsPerLevel > 0);
99 memset(&_baseStats, 0,
sizeof(_baseStats));
101 for (
int i = 0; i < kNumManas; i++)
104 for (
int i = 0; i < kNumSkills; i++) {
105 _attribRecPools[i] = 0;
106 _attribMemPools[i] = 0;
111 int8 getSkillLevel(
SkillProto *,
bool base =
false);
120 void skillAdvance(uint8 stat,
129 void skillAdvance(ActorSkillID stat,
133 void vitalityAdvance(uint8 points);
137 return (
Actor *)GameObject::objectAddress(_actorID);
141 ObjectID getActorID() {
146 void setAggression() {
147 _flags |= kPlayerAggressive;
151 void clearAggression() {
152 _flags &= ~kPlayerAggressive;
156 bool isAggressive() {
157 return (_flags & kPlayerAggressive) != 0;
162 _flags |= kPlayerBanded;
167 _flags &= ~kPlayerBanded;
172 return (_flags & kPlayerBanded) != 0;
176 void resolveBanding();
179 void recalcPortraitType();
183 int16 getPortraitType() {
184 return _portraitType;
189 void recoveryUpdate();
192 void stdAttribUpdate(uint8 &stat, uint8 baseStat, int16 index);
200 void handleAttacked();
203 void resetAttackNotification() {
204 _notifiedOfAttack =
false;
209 PlayerActor *getPlayerActorAddress(PlayerActorID
id);
215 Actor *getCenterActor();
217 ObjectID getCenterActorID();
219 PlayerActorID getCenterActorPlayerID();
222 void setCenterActor(PlayerActorID newCenter);
225 void setCenterActor(
Actor *newCenter);
235 void setAggression(PlayerActorID player,
bool aggression);
238 inline void setCenterActorAggression(
bool aggression) {
239 setAggression(getCenterActorPlayerID(), aggression);
243 bool isAggressive(PlayerActorID player);
246 inline bool isCenterActorAggressive() {
247 return isAggressive(getCenterActorPlayerID());
251 void setBanded(PlayerActorID player,
bool banded);
254 bool isBanded(PlayerActorID player);
257 void setBrotherBanding(
bool enabled);
261 void autoAdjustAggression();
264 void recalcPortraitType(PlayerActorID
id);
268 int16 getPortraitType(PlayerActorID
id);
270 bool actorToPlayerID(
Actor *a, PlayerActorID &result);
271 bool actorIDToPlayerID(ObjectID
id, PlayerActorID &result);
273 void handlePlayerActorDeath(PlayerActorID
id);
277 void transportCenterBand(
const Location &loc);
279 void handlePlayerActorAttacked(PlayerActorID
id);
281 void handleEndOfCombat();
289 void initPlayerActors();
295 void cleanupPlayerActors();
302 void initCenterActor();
308 inline void cleanupCenterActor() {}
Definition: objproto.h:105
Definition: savefile.h:54
Definition: contain.h:354
Definition: tcoords.h:127
Definition: objproto.h:1493