[Scummvm-git-logs] scummvm master -> c2252339495f6d48dcfdd33c026bde60ed223396
a-yyg
76591232+a-yyg at users.noreply.github.com
Wed Aug 18 21:17:07 UTC 2021
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
c225233949 SAGA2: Rename Actor class variables
Commit: c2252339495f6d48dcfdd33c026bde60ed223396
https://github.com/scummvm/scummvm/commit/c2252339495f6d48dcfdd33c026bde60ed223396
Author: a/ (yuri.kgpps at gmail.com)
Date: 2021-08-19T06:15:39+09:00
Commit Message:
SAGA2: Rename Actor class variables
Changed paths:
engines/saga2/actor.cpp
engines/saga2/actor.h
engines/saga2/assign.cpp
engines/saga2/band.cpp
engines/saga2/beegee.cpp
engines/saga2/dispnode.cpp
engines/saga2/effects.cpp
engines/saga2/enchant.cpp
engines/saga2/intrface.cpp
engines/saga2/motion.cpp
engines/saga2/motion.h
engines/saga2/objects.cpp
engines/saga2/objproto.cpp
engines/saga2/path.cpp
engines/saga2/player.cpp
engines/saga2/sagafunc.cpp
engines/saga2/sensor.cpp
engines/saga2/speech.cpp
engines/saga2/task.cpp
engines/saga2/task.h
engines/saga2/tilemode.cpp
diff --git a/engines/saga2/actor.cpp b/engines/saga2/actor.cpp
index e006dfe686..193c5d2585 100644
--- a/engines/saga2/actor.cpp
+++ b/engines/saga2/actor.cpp
@@ -373,7 +373,7 @@ bool ActorProto::acceptDamageAction(
int16 damageScore = 0;
Actor *a = (Actor *)GameObject::objectAddress(dObj);
Actor *enactorPtr;
- int16 &vitality = a->effectiveStats.vitality;
+ int16 &vitality = a->_effectiveStats.vitality;
bool resistant = a->resists((effectResistTypes) dType);
PlayerActorID pID;
@@ -436,7 +436,7 @@ bool ActorProto::acceptDamageAction(
// morale check
if (damageScore >= vitality) {
MotionTask::die(*a);
- AddFactionTally(a->faction, factionNumKills, 1);
+ AddFactionTally(a->_faction, factionNumKills, 1);
if (enactorPtr != NULL)
enactorPtr->handleSuccessfulKill(a);
} else
@@ -480,7 +480,7 @@ bool ActorProto::acceptHealingAction(
assert(isActor(dObj));
Actor *a = (Actor *)GameObject::objectAddress(dObj);
- int16 &vitality = a->effectiveStats.vitality;
+ int16 &vitality = a->_effectiveStats.vitality;
int16 maxVitality = (a->getBaseStats())->vitality;
PlayerActorID pID;
@@ -551,7 +551,7 @@ bool ActorProto::acceptStrikeAction(
hitChance -= armorAttribs.defenseBonus;
// Factor in dodging bonus if any
- if (a->moveTask != NULL && a->moveTask->isDodging(enactorPtr))
+ if (a->_moveTask != NULL && a->_moveTask->isDodging(enactorPtr))
hitChance -= dodgingBonus;
hitChance = MAX<uint8>(hitChance, 5);
@@ -661,9 +661,9 @@ bool ActorProto::acceptInsertionAtAction(
// Determine if this object is simply being moved within this actor
if (oldLoc.context == dObj) {
// Determine if and where the object is in use by this actor
- if (a->leftHandObject == item)
+ if (a->_leftHandObject == item)
inUseType = heldInLeftHand;
- else if (a->rightHandObject == item)
+ else if (a->_rightHandObject == item)
inUseType = heldInRightHand;
else {
int i;
@@ -671,7 +671,7 @@ bool ActorProto::acceptInsertionAtAction(
inUseType = notInUse;
for (i = 0; i < ARMOR_COUNT; i++) {
- if (a->armorObjects[i] == item) {
+ if (a->_armorObjects[i] == item) {
inUseType = worn;
wornWhere = i;
break;
@@ -728,7 +728,7 @@ void ActorProto::initiateAttack(ObjectID attacker, ObjectID target) {
GameObject *targetPtr = GameObject::objectAddress(target);
// Start the attack motion
- if (attackerPtr->appearance != NULL) {
+ if (attackerPtr->_appearance != NULL) {
if (attackerPtr->isActionAvailable(actionSwingHigh))
MotionTask::oneHandedSwing(*attackerPtr, *targetPtr);
else if (attackerPtr->isActionAvailable(actionTwoHandSwingHigh))
@@ -766,16 +766,16 @@ void ActorProto::doBackgroundUpdate(GameObject *obj) {
// If this is a temporary actor waiting for expiration,
// then decrement the expiration counter and possibly
// delete the actor
- if ((a->flags & Actor::temporary) || a->isDead()) {
- if (a->deactivationCounter <= 0) {
+ if ((a->_flags & Actor::temporary) || a->isDead()) {
+ if (a->_deactivationCounter <= 0) {
a->deleteObjectRecursive();
return;
- } else a->deactivationCounter--;
+ } else a->_deactivationCounter--;
} else {
// If the actor has failed morale there is a random
// chance of him regaining his courage
- if ((a->flags & Actor::afraid) && g_vm->_rnd->getRandomNumber(127) == 0)
- a->flags &= ~Actor::afraid;
+ if ((a->_flags & Actor::afraid) && g_vm->_rnd->getRandomNumber(127) == 0)
+ a->_flags &= ~Actor::afraid;
}
}
@@ -940,7 +940,7 @@ struct ActorArchive {
int16 currentRecoveryPoints;
ObjectID leaderID;
BandID followersID;
- ObjectID armorObjects[ARMOR_COUNT];
+ ObjectID _armorObjects[ARMOR_COUNT];
ObjectID currentTargetID;
int16 scriptVar[actorScriptVars];
};
@@ -960,8 +960,6 @@ void Actor::init(
uint8 colorSchemeIndex,
uint8 factionNum,
uint8 initFlags) {
- int i;
-
debugC(1, kDebugActors, "Actor init flags: %d, permanent: %d", initFlags, initFlags & actorPermanent);
// Fixup the prototype pointer to point to an actor prototype
@@ -978,67 +976,71 @@ void Actor::init(
_data.hitPoints = 0;
// Initialize actor field
- faction = factionNum;
- colorScheme = colorSchemeIndex;
- appearanceID = appearanceNum;
- attitude = 0;
- mood = 0;
- disposition = 0;
- currentFacing = dirDown;
- tetherLocU = 0;
- tetherLocV = 0;
- tetherDist = 0;
- leftHandObject = Nothing;
- rightHandObject = Nothing;
- schedule = 0;
- memset(&knowledge, 0, sizeof(knowledge));
+ _faction = factionNum;
+ _colorScheme = colorSchemeIndex;
+ _appearanceID = appearanceNum;
+ _attitude = 0;
+ _mood = 0;
+ _disposition = 0;
+ _currentFacing = dirDown;
+ _tetherLocU = 0;
+ _tetherLocV = 0;
+ _tetherDist = 0;
+ _leftHandObject = Nothing;
+ _rightHandObject = Nothing;
+ _schedule = 0;
+
+ for (uint i = 0; i < ARRAYSIZE(_knowledge); ++i)
+ _knowledge[i] = 0;
// Initialize the rest of the data members
- *((uint32 *)conversationMemory) = 0L;
- currentAnimation = actionStand;
- currentPose = 0;
- animationFlags = 0;
- flags = 0;
+ for (uint i = 0; i < ARRAYSIZE(_conversationMemory); ++i)
+ _conversationMemory[i] = 0;
+
+ _currentAnimation = actionStand;
+ _currentPose = 0;
+ _animationFlags = 0;
+ _flags = 0;
if (!(initFlags & actorPermanent))
- flags |= temporary;
-
- poseInfo.flags = 0;
- poseInfo.actorFrameIndex = 0;
- poseInfo.actorFrameBank = 0;
- poseInfo.leftObjectIndex = 0;
- poseInfo.rightObjectIndex = 0;
- poseInfo.leftObjectOffset.x = poseInfo.leftObjectOffset.y = 0;
- poseInfo.rightObjectOffset.x = poseInfo.rightObjectOffset.y = 0;
-
- appearance = NULL;
- cycleCount = 0;
- kludgeCount = 0;
- moveTask = NULL;
- enchantmentFlags = 0L;
- curTask = NULL;
- currentGoal = actorGoalFollowAssignment;
- deactivationCounter = 0;
+ _flags |= temporary;
+
+ _poseInfo.flags = 0;
+ _poseInfo.actorFrameIndex = 0;
+ _poseInfo.actorFrameBank = 0;
+ _poseInfo.leftObjectIndex = 0;
+ _poseInfo.rightObjectIndex = 0;
+ _poseInfo.leftObjectOffset.x = _poseInfo.leftObjectOffset.y = 0;
+ _poseInfo.rightObjectOffset.x = _poseInfo.rightObjectOffset.y = 0;
+
+ _appearance = NULL;
+ _cycleCount = 0;
+ _kludgeCount = 0;
+ _moveTask = NULL;
+ _enchantmentFlags = 0L;
+ _curTask = NULL;
+ _currentGoal = actorGoalFollowAssignment;
+ _deactivationCounter = 0;
_assignment = nullptr;
memcpy(
- &effectiveStats,
+ &_effectiveStats,
&((ActorProto *)prototype)->baseStats,
- sizeof(effectiveStats));
- effectiveStats.vitality = MAX<int16>(effectiveStats.vitality, 1);
-
- actionCounter = 0;
- effectiveResistance = 0;
- effectiveImmunity = 0;
- recPointsPerUpdate = BASE_REC_RATE;
- currentRecoveryPoints = 0;
- leader = NULL;
- followers = NULL;
+ sizeof(_effectiveStats));
+ _effectiveStats.vitality = MAX<int16>(_effectiveStats.vitality, 1);
+
+ _actionCounter = 0;
+ _effectiveResistance = 0;
+ _effectiveImmunity = 0;
+ _recPointsPerUpdate = BASE_REC_RATE;
+ _currentRecoveryPoints = 0;
+ _leader = NULL;
+ _followers = NULL;
_followersID = NoBand;
- for (i = 0; i < ARMOR_COUNT; i++)
- armorObjects[i] = Nothing;
- currentTarget = NULL;
- for (i = 0; i < actorScriptVars; i++)
- scriptVar[i] = 0;
+ for (int i = 0; i < ARMOR_COUNT; i++)
+ _armorObjects[i] = Nothing;
+ _currentTarget = NULL;
+ for (int i = 0; i < actorScriptVars; i++)
+ _scriptVar[i] = 0;
evalActorEnchantments(this);
}
@@ -1048,138 +1050,139 @@ void Actor::init(
// of the rest of the data members
Actor::Actor(void) {
prototype = nullptr;
- faction = 0;
- colorScheme = 0;
- appearanceID = 0;
- attitude = 0;
- mood = 0;
- disposition = 0;
- currentFacing = 0;
- tetherLocU = 0;
- tetherLocV = 0;
- tetherDist = 0;
- leftHandObject = 0;
- rightHandObject = 0;
- schedule = 0;
- for (int i = 0; i < 16; ++i)
- knowledge[i] = 0;
+ _faction = 0;
+ _colorScheme = 0;
+ _appearanceID = 0;
+ _attitude = 0;
+ _mood = 0;
+ _disposition = 0;
+ _currentFacing = 0;
+ _tetherLocU = 0;
+ _tetherLocV = 0;
+ _tetherDist = 0;
+ _leftHandObject = 0;
+ _rightHandObject = 0;
+ _schedule = 0;
+
+ for (uint i = 0; i < ARRAYSIZE(_knowledge); ++i)
+ _knowledge[i] = 0;
// Initialize the rest of the data members
- for (int i = 0; i < 4; ++i)
- conversationMemory[i] = 0;
-
- currentAnimation = actionStand;
- currentPose = 0;
- animationFlags = 0;
- flags = 0;
-
- poseInfo.flags = 0;
- poseInfo.actorFrameIndex = 0;
- poseInfo.actorFrameBank = 0;
- poseInfo.leftObjectIndex = 0;
- poseInfo.rightObjectIndex = 0;
- poseInfo.leftObjectOffset.x = poseInfo.leftObjectOffset.y = 0;
- poseInfo.rightObjectOffset.x = poseInfo.rightObjectOffset.y = 0;
-
- appearance = nullptr;
- cycleCount = 0;
- kludgeCount = 0;
- moveTask = nullptr;
- enchantmentFlags = 0L;
- curTask = nullptr;
- currentGoal = actorGoalFollowAssignment;
- deactivationCounter = 0;
+ for (uint i = 0; i < ARRAYSIZE(_conversationMemory); ++i)
+ _conversationMemory[i] = 0;
+
+ _currentAnimation = actionStand;
+ _currentPose = 0;
+ _animationFlags = 0;
+ _flags = 0;
+
+ _poseInfo.flags = 0;
+ _poseInfo.actorFrameIndex = 0;
+ _poseInfo.actorFrameBank = 0;
+ _poseInfo.leftObjectIndex = 0;
+ _poseInfo.rightObjectIndex = 0;
+ _poseInfo.leftObjectOffset.x = _poseInfo.leftObjectOffset.y = 0;
+ _poseInfo.rightObjectOffset.x = _poseInfo.rightObjectOffset.y = 0;
+
+ _appearance = nullptr;
+ _cycleCount = 0;
+ _kludgeCount = 0;
+ _moveTask = nullptr;
+ _enchantmentFlags = 0L;
+ _curTask = nullptr;
+ _currentGoal = actorGoalFollowAssignment;
+ _deactivationCounter = 0;
_assignment = nullptr;
- memset(&effectiveStats, 0, sizeof(effectiveStats));
- effectiveStats.vitality = MAX<uint16>(effectiveStats.vitality, 1);
+ memset(&_effectiveStats, 0, sizeof(_effectiveStats));
+ _effectiveStats.vitality = MAX<uint16>(_effectiveStats.vitality, 1);
- actionCounter = 0;
- effectiveResistance = 0;
- effectiveImmunity = 0;
- recPointsPerUpdate = BASE_REC_RATE;
- currentRecoveryPoints = 0;
- leader = nullptr;
+ _actionCounter = 0;
+ _effectiveResistance = 0;
+ _effectiveImmunity = 0;
+ _recPointsPerUpdate = BASE_REC_RATE;
+ _currentRecoveryPoints = 0;
+ _leader = nullptr;
_leaderID = Nothing;
- followers = nullptr;
+ _followers = nullptr;
_followersID = NoBand;
for (int i = 0; i < ARMOR_COUNT; i++)
- armorObjects[i] = Nothing;
- currentTarget = nullptr;
+ _armorObjects[i] = Nothing;
+ _currentTarget = nullptr;
_currentTargetID = Nothing;
for (int i = 0; i < actorScriptVars; i++)
- scriptVar[i] = 0;
+ _scriptVar[i] = 0;
}
Actor::Actor(const ResourceActor &res) : GameObject(res) {
- int i;
-
// Fixup the prototype pointer to point to an actor prototype
prototype = prototype != NULL
? (ProtoObj *)g_vm->_actorProtos[getProtoNum()]
: NULL;
// Copy the resource fields
- faction = res.faction;
- colorScheme = res.colorScheme;
- appearanceID = res.appearanceID;
- attitude = res.attitude;
- mood = res.mood;
- disposition = res.disposition;
- currentFacing = res.currentFacing;
- tetherLocU = res.tetherLocU;
- tetherLocV = res.tetherLocV;
- tetherDist = res.tetherDist;
- leftHandObject = res.leftHandObject;
- rightHandObject = res.rightHandObject;
- schedule = res.schedule;
- memcpy(&knowledge, &res.knowledge, sizeof(knowledge));
+ _faction = res.faction;
+ _colorScheme = res.colorScheme;
+ _appearanceID = res.appearanceID;
+ _attitude = res.attitude;
+ _mood = res.mood;
+ _disposition = res.disposition;
+ _currentFacing = res.currentFacing;
+ _tetherLocU = res.tetherLocU;
+ _tetherLocV = res.tetherLocV;
+ _tetherDist = res.tetherDist;
+ _leftHandObject = res.leftHandObject;
+ _rightHandObject = res.rightHandObject;
+ _schedule = res.schedule;
+ memcpy(&_knowledge, &res.knowledge, sizeof(_knowledge));
// Initialize the rest of the data members
- *((uint32 *)conversationMemory) = 0L;
- currentAnimation = actionStand;
- currentPose = 0;
- animationFlags = 0;
- flags = 0;
-
- poseInfo.flags = 0;
- poseInfo.actorFrameIndex = 0;
- poseInfo.actorFrameBank = 0;
- poseInfo.leftObjectIndex = 0;
- poseInfo.rightObjectIndex = 0;
- poseInfo.leftObjectOffset.x = poseInfo.leftObjectOffset.y = 0;
- poseInfo.rightObjectOffset.x = poseInfo.rightObjectOffset.y = 0;
-
- appearance = NULL;
- cycleCount = 0;
- kludgeCount = 0;
- moveTask = NULL;
- enchantmentFlags = 0L;
- curTask = NULL;
- currentGoal = actorGoalFollowAssignment;
- deactivationCounter = 0;
+ for (uint i = 0; i < ARRAYSIZE(_conversationMemory); ++i)
+ _conversationMemory[i] = 0;
+
+ _currentAnimation = actionStand;
+ _currentPose = 0;
+ _animationFlags = 0;
+ _flags = 0;
+
+ _poseInfo.flags = 0;
+ _poseInfo.actorFrameIndex = 0;
+ _poseInfo.actorFrameBank = 0;
+ _poseInfo.leftObjectIndex = 0;
+ _poseInfo.rightObjectIndex = 0;
+ _poseInfo.leftObjectOffset.x = _poseInfo.leftObjectOffset.y = 0;
+ _poseInfo.rightObjectOffset.x = _poseInfo.rightObjectOffset.y = 0;
+
+ _appearance = NULL;
+ _cycleCount = 0;
+ _kludgeCount = 0;
+ _moveTask = NULL;
+ _enchantmentFlags = 0L;
+ _curTask = NULL;
+ _currentGoal = actorGoalFollowAssignment;
+ _deactivationCounter = 0;
_assignment = nullptr;
if (prototype)
- memcpy(&effectiveStats, &((ActorProto *)prototype)->baseStats, sizeof(effectiveStats));
+ memcpy(&_effectiveStats, &((ActorProto *)prototype)->baseStats, sizeof(_effectiveStats));
- effectiveStats.vitality = MAX<uint16>(effectiveStats.vitality, 1);
+ _effectiveStats.vitality = MAX<uint16>(_effectiveStats.vitality, 1);
- actionCounter = 0;
- effectiveResistance = 0;
- effectiveImmunity = 0;
- recPointsPerUpdate = BASE_REC_RATE;
- currentRecoveryPoints = 0;
- leader = NULL;
+ _actionCounter = 0;
+ _effectiveResistance = 0;
+ _effectiveImmunity = 0;
+ _recPointsPerUpdate = BASE_REC_RATE;
+ _currentRecoveryPoints = 0;
+ _leader = NULL;
_leaderID = Nothing;
- followers = NULL;
+ _followers = NULL;
_followersID = NoBand;
- for (i = 0; i < ARMOR_COUNT; i++)
- armorObjects[i] = Nothing;
- currentTarget = NULL;
+ for (int i = 0; i < ARMOR_COUNT; i++)
+ _armorObjects[i] = Nothing;
+ _currentTarget = NULL;
_currentTargetID = Nothing;
- for (i = 0; i < actorScriptVars; i++)
- scriptVar[i] = 0;
+ for (int i = 0; i < actorScriptVars; i++)
+ _scriptVar[i] = 0;
evalActorEnchantments(this);
}
@@ -1190,106 +1193,106 @@ Actor::Actor(Common::InSaveFile *in) : GameObject(in) {
? (ProtoObj *)g_vm->_actorProtos[getProtoNum()]
: nullptr;
- faction = in->readByte();
- colorScheme = in->readByte();
- appearanceID = in->readSint32BE();
- attitude = in->readSByte();
- mood = in->readSByte();
-
- disposition = in->readByte();
- currentFacing = in->readByte();
- tetherLocU = in->readSint16LE();
- tetherLocV = in->readSint16LE();
- tetherDist = in->readSint16LE();
- leftHandObject = in->readUint16LE();
- rightHandObject = in->readUint16LE();
-
- for (int i = 0; i < ARRAYSIZE(knowledge); ++i)
- knowledge[i] = in->readUint16LE();
-
- schedule = in->readUint16LE();
-
- for (int i = 0; i < ARRAYSIZE(conversationMemory); ++i)
- conversationMemory[i] = in->readByte();
-
- currentAnimation = in->readByte();
- currentPose = in->readByte();
- animationFlags = in->readByte();
-
- flags = in->readByte();
- poseInfo.load(in);
- cycleCount = in->readSint16LE();
- kludgeCount = in->readSint16LE();
- enchantmentFlags = in->readUint32LE();
- currentGoal = in->readByte();
- deactivationCounter = in->readByte();
- effectiveStats.read(in);
- actionCounter = in->readByte();
- effectiveResistance = in->readUint16LE();
- effectiveImmunity = in->readUint16LE();
- recPointsPerUpdate = in->readSint16LE();
- currentRecoveryPoints = in->readUint16LE();
+ _faction = in->readByte();
+ _colorScheme = in->readByte();
+ _appearanceID = in->readSint32BE();
+ _attitude = in->readSByte();
+ _mood = in->readSByte();
+
+ _disposition = in->readByte();
+ _currentFacing = in->readByte();
+ _tetherLocU = in->readSint16LE();
+ _tetherLocV = in->readSint16LE();
+ _tetherDist = in->readSint16LE();
+ _leftHandObject = in->readUint16LE();
+ _rightHandObject = in->readUint16LE();
+
+ for (int i = 0; i < ARRAYSIZE(_knowledge); ++i)
+ _knowledge[i] = in->readUint16LE();
+
+ _schedule = in->readUint16LE();
+
+ for (int i = 0; i < ARRAYSIZE(_conversationMemory); ++i)
+ _conversationMemory[i] = in->readByte();
+
+ _currentAnimation = in->readByte();
+ _currentPose = in->readByte();
+ _animationFlags = in->readByte();
+
+ _flags = in->readByte();
+ _poseInfo.load(in);
+ _cycleCount = in->readSint16LE();
+ _kludgeCount = in->readSint16LE();
+ _enchantmentFlags = in->readUint32LE();
+ _currentGoal = in->readByte();
+ _deactivationCounter = in->readByte();
+ _effectiveStats.read(in);
+ _actionCounter = in->readByte();
+ _effectiveResistance = in->readUint16LE();
+ _effectiveImmunity = in->readUint16LE();
+ _recPointsPerUpdate = in->readSint16LE();
+ _currentRecoveryPoints = in->readUint16LE();
_leaderID = in->readUint16LE();
- leader = nullptr;
+ _leader = nullptr;
_followersID = in->readSint16LE();
- followers = nullptr;
+ _followers = nullptr;
- for (int i = 0; i < ARRAYSIZE(armorObjects); ++i)
- armorObjects[i] = in->readUint16LE();
+ for (int i = 0; i < ARRAYSIZE(_armorObjects); ++i)
+ _armorObjects[i] = in->readUint16LE();
_currentTargetID = in->readUint16LE();
- currentTarget = nullptr;
+ _currentTarget = nullptr;
- for (int i = 0; i < ARRAYSIZE(scriptVar); ++i)
- scriptVar[i] = in->readSint16LE();
+ for (int i = 0; i < ARRAYSIZE(_scriptVar); ++i)
+ _scriptVar[i] = in->readSint16LE();
- if (flags & hasAssignment) {
+ if (_flags & hasAssignment) {
readAssignment(this, in);
} else {
_assignment = nullptr;
}
- appearance = nullptr;
- moveTask = nullptr;
- curTask = nullptr;
-
- debugC(4, kDebugSaveload, "... faction = %d", faction);
- debugC(4, kDebugSaveload, "... colorScheme = %d", colorScheme);
- debugC(4, kDebugSaveload, "... appearanceID = %d", appearanceID);
- debugC(4, kDebugSaveload, "... attitude = %d", attitude);
- debugC(4, kDebugSaveload, "... mood = %d", mood);
- debugC(4, kDebugSaveload, "... disposition = %d", disposition);
- debugC(4, kDebugSaveload, "... currentFacing = %d", currentFacing);
- debugC(4, kDebugSaveload, "... tetherLocU = %d", tetherLocU);
- debugC(4, kDebugSaveload, "... tetherLocV = %d", tetherLocV);
- debugC(4, kDebugSaveload, "... tetherDist = %d", tetherDist);
- debugC(4, kDebugSaveload, "... leftHandObject = %d", leftHandObject);
- debugC(4, kDebugSaveload, "... rightHandObject = %d", rightHandObject);
+ _appearance = nullptr;
+ _moveTask = nullptr;
+ _curTask = nullptr;
+
+ debugC(4, kDebugSaveload, "... _faction = %d", _faction);
+ debugC(4, kDebugSaveload, "... _colorScheme = %d", _colorScheme);
+ debugC(4, kDebugSaveload, "... _appearanceID = %d", _appearanceID);
+ debugC(4, kDebugSaveload, "... _attitude = %d", _attitude);
+ debugC(4, kDebugSaveload, "... _mood = %d", _mood);
+ debugC(4, kDebugSaveload, "... _disposition = %d", _disposition);
+ debugC(4, kDebugSaveload, "... _currentFacing = %d", _currentFacing);
+ debugC(4, kDebugSaveload, "... _tetherLocU = %d", _tetherLocU);
+ debugC(4, kDebugSaveload, "... _tetherLocV = %d", _tetherLocV);
+ debugC(4, kDebugSaveload, "... _tetherDist = %d", _tetherDist);
+ debugC(4, kDebugSaveload, "... _leftHandObject = %d", _leftHandObject);
+ debugC(4, kDebugSaveload, "... _rightHandObject = %d", _rightHandObject);
// debugC(4, kDebugSaveload, "... knowledge = %d", knowledge);
- debugC(4, kDebugSaveload, "... schedule = %d", schedule);
+ debugC(4, kDebugSaveload, "... _schedule = %d", _schedule);
// debugC(4, kDebugSaveload, "... conversationMemory = %d", conversationMemory);
- debugC(4, kDebugSaveload, "... currentAnimation = %d", currentAnimation);
- debugC(4, kDebugSaveload, "... currentPose = %d", currentPose);
- debugC(4, kDebugSaveload, "... animationFlags = %d", animationFlags);
- debugC(4, kDebugSaveload, "... flags = %d", flags);
+ debugC(4, kDebugSaveload, "... _currentAnimation = %d", _currentAnimation);
+ debugC(4, kDebugSaveload, "... _currentPose = %d", _currentPose);
+ debugC(4, kDebugSaveload, "... _animationFlags = %d", _animationFlags);
+ debugC(4, kDebugSaveload, "... _flags = %d", _flags);
// debugC(4, kDebugSaveload, "... out = %d", out);
- debugC(4, kDebugSaveload, "... cycleCount = %d", cycleCount);
- debugC(4, kDebugSaveload, "... kludgeCount = %d", kludgeCount);
- debugC(4, kDebugSaveload, "... enchantmentFlags = %d", enchantmentFlags);
- debugC(4, kDebugSaveload, "... currentGoal = %d", currentGoal);
- debugC(4, kDebugSaveload, "... deactivationCounter = %d", deactivationCounter);
+ debugC(4, kDebugSaveload, "... _cycleCount = %d", _cycleCount);
+ debugC(4, kDebugSaveload, "... _kludgeCount = %d", _kludgeCount);
+ debugC(4, kDebugSaveload, "... _enchantmentFlags = %d", _enchantmentFlags);
+ debugC(4, kDebugSaveload, "... _currentGoal = %d", _currentGoal);
+ debugC(4, kDebugSaveload, "... _deactivationCounter = %d", _deactivationCounter);
// debugC(4, kDebugSaveload, "... out = %d", out);
- debugC(4, kDebugSaveload, "... actionCounter = %d", actionCounter);
- debugC(4, kDebugSaveload, "... effectiveResistance = %d", effectiveResistance);
- debugC(4, kDebugSaveload, "... effectiveImmunity = %d", effectiveImmunity);
- debugC(4, kDebugSaveload, "... recPointsPerUpdate = %d", recPointsPerUpdate);
- debugC(4, kDebugSaveload, "... currentRecoveryPoints = %d", currentRecoveryPoints);
- debugC(4, kDebugSaveload, "... leaderID = %d", _leaderID);
- debugC(4, kDebugSaveload, "... followersID = %d", _followersID);
+ debugC(4, kDebugSaveload, "... _actionCounter = %d", _actionCounter);
+ debugC(4, kDebugSaveload, "... _effectiveResistance = %d", _effectiveResistance);
+ debugC(4, kDebugSaveload, "... _effectiveImmunity = %d", _effectiveImmunity);
+ debugC(4, kDebugSaveload, "... _recPointsPerUpdate = %d", _recPointsPerUpdate);
+ debugC(4, kDebugSaveload, "... _currentRecoveryPoints = %d", _currentRecoveryPoints);
+ debugC(4, kDebugSaveload, "... _leaderID = %d", _leaderID);
+ debugC(4, kDebugSaveload, "... _followersID = %d", _followersID);
// debugC(4, kDebugSaveload, "... armorObjects = %d", armorObjects);
- debugC(4, kDebugSaveload, "... currentTargetID = %d", _currentTargetID);
+ debugC(4, kDebugSaveload, "... _currentTargetID = %d", _currentTargetID);
// debugC(4, kDebugSaveload, "... scriptVar = %d", scriptVar);
}
@@ -1297,7 +1300,7 @@ Actor::Actor(Common::InSaveFile *in) : GameObject(in) {
// Destructor
Actor::~Actor(void) {
- if (appearance != NULL) ReleaseActorAppearance(appearance);
+ if (_appearance != NULL) ReleaseActorAppearance(_appearance);
if (getAssignment())
delete getAssignment();
@@ -1310,7 +1313,7 @@ int32 Actor::archiveSize(void) {
int32 size = GameObject::archiveSize();
size += sizeof(ActorArchive);
- if (flags & hasAssignment)
+ if (_flags & hasAssignment)
size += assignmentArchiveSize(this);
return size;
@@ -1331,94 +1334,94 @@ void Actor::write(Common::MemoryWriteStreamDynamic *out) {
// Restore the prototype pointer
prototype = holdProto;
- out->writeByte(faction);
- out->writeByte(colorScheme);
- out->writeSint32BE(appearanceID);
- out->writeSByte(attitude);
- out->writeSByte(mood);
-
- out->writeByte(disposition);
- out->writeByte(currentFacing);
- out->writeSint16LE(tetherLocU);
- out->writeSint16LE(tetherLocV);
- out->writeSint16LE(tetherDist);
- out->writeUint16LE(leftHandObject);
- out->writeUint16LE(rightHandObject);
-
- out->write(knowledge, sizeof(knowledge));
- out->writeUint16LE(schedule);
- out->write(conversationMemory, sizeof(conversationMemory));
-
- out->writeByte(currentAnimation);
- out->writeByte(currentPose);
- out->writeByte(animationFlags);
-
- out->writeByte(flags);
- poseInfo.write(out);
- out->writeSint16LE(cycleCount);
- out->writeSint16LE(kludgeCount);
- out->writeUint32LE(enchantmentFlags);
- out->writeByte(currentGoal);
- out->writeByte(deactivationCounter);
- effectiveStats.write(out);
- out->writeByte(actionCounter);
- out->writeUint16LE(effectiveResistance);
- out->writeUint16LE(effectiveImmunity);
- out->writeSint16LE(recPointsPerUpdate);
- out->writeUint16LE(currentRecoveryPoints);
-
- int leaderID = (leader != NULL) ? leader->thisID() : Nothing;
-
- out->writeUint16LE(leaderID);
-
- int followersID = (followers != NULL) ? getBandID(followers) : NoBand;
-
- out->writeSint16LE(followersID);
- out->write(armorObjects, ARMOR_COUNT * 2);
-
- int currentTargetID = currentTarget != NULL ? currentTarget->thisID() : Nothing;
-
- out->writeUint16LE(currentTargetID);
- out->write(scriptVar, sizeof(scriptVar));
-
- if (flags & hasAssignment)
+ out->writeByte(_faction);
+ out->writeByte(_colorScheme);
+ out->writeSint32BE(_appearanceID);
+ out->writeSByte(_attitude);
+ out->writeSByte(_mood);
+
+ out->writeByte(_disposition);
+ out->writeByte(_currentFacing);
+ out->writeSint16LE(_tetherLocU);
+ out->writeSint16LE(_tetherLocV);
+ out->writeSint16LE(_tetherDist);
+ out->writeUint16LE(_leftHandObject);
+ out->writeUint16LE(_rightHandObject);
+
+ out->write(_knowledge, sizeof(_knowledge));
+ out->writeUint16LE(_schedule);
+ out->write(_conversationMemory, sizeof(_conversationMemory));
+
+ out->writeByte(_currentAnimation);
+ out->writeByte(_currentPose);
+ out->writeByte(_animationFlags);
+
+ out->writeByte(_flags);
+ _poseInfo.write(out);
+ out->writeSint16LE(_cycleCount);
+ out->writeSint16LE(_kludgeCount);
+ out->writeUint32LE(_enchantmentFlags);
+ out->writeByte(_currentGoal);
+ out->writeByte(_deactivationCounter);
+ _effectiveStats.write(out);
+ out->writeByte(_actionCounter);
+ out->writeUint16LE(_effectiveResistance);
+ out->writeUint16LE(_effectiveImmunity);
+ out->writeSint16LE(_recPointsPerUpdate);
+ out->writeUint16LE(_currentRecoveryPoints);
+
+ _leaderID = (_leader != NULL) ? _leader->thisID() : Nothing;
+
+ out->writeUint16LE(_leaderID);
+
+ _followersID = (_followers != NULL) ? getBandID(_followers) : NoBand;
+
+ out->writeSint16LE(_followersID);
+ out->write(_armorObjects, ARMOR_COUNT * 2);
+
+ _currentTargetID = _currentTarget != NULL ? _currentTarget->thisID() : Nothing;
+
+ out->writeUint16LE(_currentTargetID);
+ out->write(_scriptVar, sizeof(_scriptVar));
+
+ if (_flags & hasAssignment)
writeAssignment(this, out);
- debugC(4, kDebugSaveload, "... faction = %d", faction);
- debugC(4, kDebugSaveload, "... colorScheme = %d", colorScheme);
- debugC(4, kDebugSaveload, "... appearanceID = %d", appearanceID);
- debugC(4, kDebugSaveload, "... attitude = %d", attitude);
- debugC(4, kDebugSaveload, "... mood = %d", mood);
- debugC(4, kDebugSaveload, "... disposition = %d", disposition);
- debugC(4, kDebugSaveload, "... currentFacing = %d", currentFacing);
- debugC(4, kDebugSaveload, "... tetherLocU = %d", tetherLocU);
- debugC(4, kDebugSaveload, "... tetherLocV = %d", tetherLocV);
- debugC(4, kDebugSaveload, "... tetherDist = %d", tetherDist);
- debugC(4, kDebugSaveload, "... leftHandObject = %d", leftHandObject);
- debugC(4, kDebugSaveload, "... rightHandObject = %d", rightHandObject);
+ debugC(4, kDebugSaveload, "... _faction = %d", _faction);
+ debugC(4, kDebugSaveload, "... _colorScheme = %d", _colorScheme);
+ debugC(4, kDebugSaveload, "... _appearanceID = %d", _appearanceID);
+ debugC(4, kDebugSaveload, "... _attitude = %d", _attitude);
+ debugC(4, kDebugSaveload, "... _mood = %d", _mood);
+ debugC(4, kDebugSaveload, "... _disposition = %d", _disposition);
+ debugC(4, kDebugSaveload, "... _currentFacing = %d", _currentFacing);
+ debugC(4, kDebugSaveload, "... _tetherLocU = %d", _tetherLocU);
+ debugC(4, kDebugSaveload, "... _tetherLocV = %d", _tetherLocV);
+ debugC(4, kDebugSaveload, "... _tetherDist = %d", _tetherDist);
+ debugC(4, kDebugSaveload, "... _leftHandObject = %d", _leftHandObject);
+ debugC(4, kDebugSaveload, "... _rightHandObject = %d", _rightHandObject);
// debugC(4, kDebugSaveload, "... knowledge = %d", knowledge);
- debugC(4, kDebugSaveload, "... schedule = %d", schedule);
+ debugC(4, kDebugSaveload, "... _schedule = %d", _schedule);
// debugC(4, kDebugSaveload, "... conversationMemory = %d", conversationMemory);
- debugC(4, kDebugSaveload, "... currentAnimation = %d", currentAnimation);
- debugC(4, kDebugSaveload, "... currentPose = %d", currentPose);
- debugC(4, kDebugSaveload, "... animationFlags = %d", animationFlags);
- debugC(4, kDebugSaveload, "... flags = %d", flags);
+ debugC(4, kDebugSaveload, "... _currentAnimation = %d", _currentAnimation);
+ debugC(4, kDebugSaveload, "... _currentPose = %d", _currentPose);
+ debugC(4, kDebugSaveload, "... _animationFlags = %d", _animationFlags);
+ debugC(4, kDebugSaveload, "... _flags = %d", _flags);
// debugC(4, kDebugSaveload, "... out = %d", out);
- debugC(4, kDebugSaveload, "... cycleCount = %d", cycleCount);
- debugC(4, kDebugSaveload, "... kludgeCount = %d", kludgeCount);
- debugC(4, kDebugSaveload, "... enchantmentFlags = %d", enchantmentFlags);
- debugC(4, kDebugSaveload, "... currentGoal = %d", currentGoal);
- debugC(4, kDebugSaveload, "... deactivationCounter = %d", deactivationCounter);
+ debugC(4, kDebugSaveload, "... _cycleCount = %d", _cycleCount);
+ debugC(4, kDebugSaveload, "... _kludgeCount = %d", _kludgeCount);
+ debugC(4, kDebugSaveload, "... _enchantmentFlags = %d", _enchantmentFlags);
+ debugC(4, kDebugSaveload, "... _currentGoal = %d", _currentGoal);
+ debugC(4, kDebugSaveload, "... _deactivationCounter = %d", _deactivationCounter);
// debugC(4, kDebugSaveload, "... out = %d", out);
- debugC(4, kDebugSaveload, "... actionCounter = %d", actionCounter);
- debugC(4, kDebugSaveload, "... effectiveResistance = %d", effectiveResistance);
- debugC(4, kDebugSaveload, "... effectiveImmunity = %d", effectiveImmunity);
- debugC(4, kDebugSaveload, "... recPointsPerUpdate = %d", recPointsPerUpdate);
- debugC(4, kDebugSaveload, "... currentRecoveryPoints = %d", currentRecoveryPoints);
- debugC(4, kDebugSaveload, "... leaderID = %d", leader != NULL ? leader->thisID() : Nothing);
- debugC(4, kDebugSaveload, "... followersID = %d", followers != NULL ? getBandID(followers) : NoBand);
+ debugC(4, kDebugSaveload, "... _actionCounter = %d", _actionCounter);
+ debugC(4, kDebugSaveload, "... _effectiveResistance = %d", _effectiveResistance);
+ debugC(4, kDebugSaveload, "... _effectiveImmunity = %d", _effectiveImmunity);
+ debugC(4, kDebugSaveload, "... _recPointsPerUpdate = %d", _recPointsPerUpdate);
+ debugC(4, kDebugSaveload, "... _currentRecoveryPoints = %d", _currentRecoveryPoints);
+ debugC(4, kDebugSaveload, "... _leaderID = %d", _leader != NULL ? _leader->thisID() : Nothing);
+ debugC(4, kDebugSaveload, "... _followersID = %d", _followers != NULL ? getBandID(_followers) : NoBand);
// debugC(4, kDebugSaveload, "... armorObjects = %d", armorObjects);
- debugC(4, kDebugSaveload, "... currentTargetID = %d", currentTarget != NULL ? currentTarget->thisID() : Nothing);
+ debugC(4, kDebugSaveload, "... _currentTargetID = %d", _currentTarget != NULL ? _currentTarget->thisID() : Nothing);
// debugC(4, kDebugSaveload, "... scriptVar = %d", scriptVar);
}
@@ -1446,7 +1449,7 @@ Actor *Actor::newActor(
for (i = kPlayerActors; i < kActorCount; i++) {
a = g_vm->_actorList[i];
- if ((a->flags & temporary)
+ if ((a->_flags & temporary)
&& !a->isActivated()
&& isWorld(a->IDParent()))
break;
@@ -1475,7 +1478,7 @@ Actor *Actor::newActor(
factionNum,
initFlags);
- if (a->flags & temporary) {
+ if (a->_flags & temporary) {
incTempActorCount(protoNum);
debugC(1, kDebugActors, "Actors: Created temp actor %d (%s) new count:%d", a->thisID() - 32768, a->objName(), getTempActorCount(protoNum));
}
@@ -1487,7 +1490,7 @@ Actor *Actor::newActor(
// Delete this actor
void Actor::deleteActor(void) {
- if (flags & temporary) {
+ if (_flags & temporary) {
uint16 protoNum = getProtoNum();
decTempActorCount(protoNum);
@@ -1495,33 +1498,34 @@ void Actor::deleteActor(void) {
}
// Kill task
- if (curTask != NULL) {
- curTask->abortTask();
- delete curTask;
- curTask = NULL;
+ if (_curTask != NULL) {
+ _curTask->abortTask();
+ delete _curTask;
+ _curTask = NULL;
}
// Kill motion task
- if (moveTask != NULL) moveTask->remove();
+ if (_moveTask != NULL)
+ _moveTask->remove();
// If banded, remove from band
- if (leader != NULL) {
- assert(isActor(leader));
+ if (_leader != NULL) {
+ assert(isActor(_leader));
- leader->removeFollower(this);
- leader = NULL;
- } else if (followers != NULL) {
+ _leader->removeFollower(this);
+ _leader = NULL;
+ } else if (_followers != NULL) {
int16 i;
- for (i = 0; i < followers->size(); i++) {
- Actor *follower = (*followers)[i];
+ for (i = 0; i < _followers->size(); i++) {
+ Actor *follower = (*_followers)[i];
- follower->leader = NULL;
+ follower->_leader = NULL;
follower->evaluateNeeds();
}
- delete followers;
- followers = NULL;
+ delete _followers;
+ _followers = NULL;
}
// Place in limbo
@@ -1536,8 +1540,8 @@ void Actor::deleteActor(void) {
// Cause the actor to stop his current motion task is he is interruptable
void Actor::stopMoving(void) {
- if (moveTask != NULL && isInterruptable())
- moveTask->remove();
+ if (_moveTask != NULL && isInterruptable())
+ _moveTask->remove();
}
//-----------------------------------------------------------------------
@@ -1559,21 +1563,22 @@ void Actor::die(void) {
runObjectMethod(dObj, Method_Actor_onDie, scf);
// Kill task
- if (curTask != NULL) {
- curTask->abortTask();
- delete curTask;
- curTask = NULL;
+ if (_curTask != NULL) {
+ _curTask->abortTask();
+ delete _curTask;
+ _curTask = NULL;
}
// Kill motion task
- if (moveTask != NULL) moveTask->remove();
+ if (_moveTask != NULL)
+ _moveTask->remove();
// If banded, remove from band
- if (leader != NULL) {
- assert(isActor(leader));
+ if (_leader != NULL) {
+ assert(isActor(_leader));
- leader->removeFollower(this);
- leader = NULL;
+ _leader->removeFollower(this);
+ _leader = NULL;
}
if (actorToPlayerID(this, playerID))
@@ -1587,7 +1592,7 @@ void Actor::imNotQuiteDead(void) {
if (isDead()) {
PlayerActorID pID;
- effectiveStats.vitality = 1;
+ _effectiveStats.vitality = 1;
if (actorToPlayerID(this, pID))
updateBrotherControls(pID);
@@ -1606,32 +1611,32 @@ void Actor::vitalityUpdate(void) {
ActorAttributes *baseStats = getBaseStats();
// first find out if this actor is wounded
- if (effectiveStats.vitality < baseStats->vitality) {
+ if (_effectiveStats.vitality < baseStats->vitality) {
// whole vitality number goes here
int16 recover;
int16 fractionRecover;
// get the whole number first
- recover = recPointsPerUpdate / recPointsPerVitality;
+ recover = _recPointsPerUpdate / recPointsPerVitality;
// get the fraction
- fractionRecover = recPointsPerUpdate % recPointsPerVitality;
+ fractionRecover = _recPointsPerUpdate % recPointsPerVitality;
// if there is an overrun
- if (currentRecoveryPoints + fractionRecover > recPointsPerVitality) {
+ if (_currentRecoveryPoints + fractionRecover > recPointsPerVitality) {
// add the overrun to the whole number
recover++;
- currentRecoveryPoints = (currentRecoveryPoints + fractionRecover) - recPointsPerVitality;
+ _currentRecoveryPoints = (_currentRecoveryPoints + fractionRecover) - recPointsPerVitality;
} else {
- currentRecoveryPoints += fractionRecover;
+ _currentRecoveryPoints += fractionRecover;
}
- if (effectiveStats.vitality + recover >=
+ if (_effectiveStats.vitality + recover >=
baseStats->vitality) {
- effectiveStats.vitality = baseStats->vitality;
+ _effectiveStats.vitality = baseStats->vitality;
} else {
- effectiveStats.vitality += recover;
+ _effectiveStats.vitality += recover;
//WriteStatusF( 5, " Healed: %d, rec: %d, part: %d ", effectiveStats.vitality,
// recover, currentRecoveryPoints );
@@ -1656,26 +1661,27 @@ void Actor::deactivateActor(void) {
debugC(1, kDebugActors, "Actors: De-activated %d (%s)", thisID() - 32768, objName());
// Kill task
- if (curTask != NULL) {
- curTask->abortTask();
- delete curTask;
- curTask = NULL;
+ if (_curTask != NULL) {
+ _curTask->abortTask();
+ delete _curTask;
+ _curTask = NULL;
}
// Kill motion task
- if (moveTask != NULL) moveTask->remove();
+ if (_moveTask != NULL)
+ _moveTask->remove();
// If banded, remove from band
- if (leader != NULL) {
- assert(isActor(leader));
+ if (_leader != NULL) {
+ assert(isActor(_leader));
- leader->removeFollower(this);
- leader = NULL;
+ _leader->removeFollower(this);
+ _leader = NULL;
}
// Temporary actors get deleted upon deactivation
- if ((flags & temporary) || isDead()) {
- deactivationCounter = 10; // actor lasts for 50 seconds
+ if ((_flags & temporary) || isDead()) {
+ _deactivationCounter = 10; // actor lasts for 50 seconds
}
}
@@ -1683,12 +1689,12 @@ void Actor::deactivateActor(void) {
// Delobotomize this actor
void Actor::delobotomize(void) {
- if (!(flags & lobotomized)) return;
+ if (!(_flags & lobotomized)) return;
ObjectID dObj = thisID();
scriptCallFrame scf;
- flags &= ~lobotomized;
+ _flags &= ~lobotomized;
scf.invokedObject = dObj;
scf.enactor = dObj;
@@ -1705,22 +1711,23 @@ void Actor::delobotomize(void) {
// Lobotomize this actor
void Actor::lobotomize(void) {
- if (flags & lobotomized) return;
+ if (_flags & lobotomized) return;
ObjectID dObj = thisID();
scriptCallFrame scf;
// Kill task
- if (curTask != NULL) {
- curTask->abortTask();
- delete curTask;
- curTask = NULL;
+ if (_curTask != NULL) {
+ _curTask->abortTask();
+ delete _curTask;
+ _curTask = NULL;
}
// Kill motion task
- if (moveTask != NULL) moveTask->remove();
+ if (_moveTask != NULL)
+ _moveTask->remove();
- flags |= lobotomized;
+ _flags |= lobotomized;
scf.invokedObject = dObj;
scf.enactor = dObj;
@@ -1738,10 +1745,10 @@ void Actor::lobotomize(void) {
// structure.
ActorAttributes *Actor::getBaseStats(void) {
- if (disposition < dispositionPlayer)
+ if (_disposition < dispositionPlayer)
return &((ActorProto *)prototype)->baseStats;
else
- return &g_vm->_playerList[disposition - dispositionPlayer]->baseStats;
+ return &g_vm->_playerList[_disposition - dispositionPlayer]->baseStats;
}
//-----------------------------------------------------------------------
@@ -1808,10 +1815,10 @@ bool Actor::isImmobile(void) {
// Return a pointer to this actor's currently readied offensive object
GameObject *Actor::offensiveObject(void) {
- if (rightHandObject != Nothing) {
- assert(isObject(rightHandObject));
+ if (_rightHandObject != Nothing) {
+ assert(isObject(_rightHandObject));
- GameObject *obj = GameObject::objectAddress(rightHandObject);
+ GameObject *obj = GameObject::objectAddress(_rightHandObject);
// Any object in an actor's right hand should be a weapon
assert(obj->containmentSet() & ProtoObj::isWeapon);
@@ -1819,10 +1826,10 @@ GameObject *Actor::offensiveObject(void) {
return obj;
}
- if (leftHandObject != Nothing) {
- assert(isObject(leftHandObject));
+ if (_leftHandObject != Nothing) {
+ assert(isObject(_leftHandObject));
- GameObject *obj = GameObject::objectAddress(leftHandObject);
+ GameObject *obj = GameObject::objectAddress(_leftHandObject);
if (obj->containmentSet() & ProtoObj::isWeapon)
return obj;
@@ -1845,15 +1852,15 @@ void Actor::defensiveObject(GameObject **priPtr, GameObject **secPtr) {
*secondary = NULL;
// Get a pointer to the left hand object
- leftHandObjPtr = leftHandObject != Nothing
- ? (assert(isObject(leftHandObject))
- , GameObject::objectAddress(leftHandObject))
+ leftHandObjPtr = _leftHandObject != Nothing
+ ? (assert(isObject(_leftHandObject))
+ , GameObject::objectAddress(_leftHandObject))
: NULL;
// Get a pointer to the right hand object
- rightHandObjPtr = rightHandObject != Nothing
- ? (assert(isObject(rightHandObject))
- , GameObject::objectAddress(rightHandObject))
+ rightHandObjPtr = _rightHandObject != Nothing
+ ? (assert(isObject(_rightHandObject))
+ , GameObject::objectAddress(_rightHandObject))
: NULL;
if (leftHandObjPtr != NULL) {
@@ -1888,8 +1895,8 @@ void Actor::defensiveObject(GameObject **priPtr, GameObject **secPtr) {
// blocking, if any
GameObject *Actor::blockingObject(Actor *attacker) {
- return moveTask != NULL
- ? moveTask->blockingObject(attacker)
+ return _moveTask != NULL
+ ? _moveTask->blockingObject(attacker)
: NULL;
}
@@ -1907,8 +1914,8 @@ void Actor::totalArmorAttributes(ArmorAttributes &armorAttribs) {
// Accumulate values for all armor objects
for (i = 0; i < ARMOR_COUNT; i++) {
- if (armorObjects[i] != Nothing) {
- ProtoObj *armorProto = GameObject::protoAddress(armorObjects[i]);
+ if (_armorObjects[i] != Nothing) {
+ ProtoObj *armorProto = GameObject::protoAddress(_armorObjects[i]);
assert(armorProto != NULL);
@@ -1944,8 +1951,8 @@ void Actor::attack(GameObject *target) {
// Stop all attacks on a specified target
void Actor::stopAttack(GameObject *target) {
- if (moveTask && moveTask->isAttack() && moveTask->targetObj == target)
- moveTask->finishAttack();
+ if (_moveTask && _moveTask->isAttack() && _moveTask->targetObj == target)
+ _moveTask->finishAttack();
}
//-----------------------------------------------------------------------
@@ -1955,15 +1962,15 @@ bool Actor::canDefend(void) {
if (isDead()) return false;
// Look at left hand object, generally the defensive object
- if (leftHandObject != Nothing) {
- GameObject *obj = GameObject::objectAddress(leftHandObject);
+ if (_leftHandObject != Nothing) {
+ GameObject *obj = GameObject::objectAddress(_leftHandObject);
if (obj->proto()->canBlock()) return true;
}
// Look at right hand object, generally the offensive object
- if (rightHandObject != Nothing) {
- GameObject *obj = GameObject::objectAddress(rightHandObject);
+ if (_rightHandObject != Nothing) {
+ GameObject *obj = GameObject::objectAddress(_rightHandObject);
if (obj->proto()->canBlock()) return true;
}
@@ -1988,15 +1995,15 @@ int16 Actor::offenseScore(void) {
}
// Add average mana
- score += (effectiveStats.redMana
- + effectiveStats.orangeMana
- + effectiveStats.yellowMana
- + effectiveStats.greenMana
- + effectiveStats.blueMana
- + effectiveStats.violetMana)
+ score += (_effectiveStats.redMana
+ + _effectiveStats.orangeMana
+ + _effectiveStats.yellowMana
+ + _effectiveStats.greenMana
+ + _effectiveStats.blueMana
+ + _effectiveStats.violetMana)
/ 6;
- score += effectiveStats.spellcraft + effectiveStats.brawn;
+ score += _effectiveStats.spellcraft + _effectiveStats.brawn;
return score;
}
@@ -2025,7 +2032,7 @@ int16 Actor::defenseScore(void) {
score += (armorAttribs.defenseBonus + armorAttribs.damageAbsorbtion)
* armorAttribs.damageDivider;
- score += effectiveStats.agility + effectiveStats.vitality;
+ score += _effectiveStats.agility + _effectiveStats.vitality;
return score;
}
@@ -2037,10 +2044,10 @@ int16 Actor::defenseScore(void) {
void Actor::getColorTranslation(ColorTable map) {
// If actor has color table loaded, then calculate the
// translation table.
- if (appearance
- && appearance->schemeList) {
+ if (_appearance
+ && _appearance->schemeList) {
buildColorTable(map,
- appearance->schemeList->_schemes[colorScheme]->bank,
+ _appearance->schemeList->_schemes[_colorScheme]->bank,
11);
} else memcpy(map, identityColors, 256);
}
@@ -2051,7 +2058,7 @@ void Actor::getColorTranslation(ColorTable map) {
// Each time the nextAnimationFrame() is called, it will increment
// to the next frame in the sequence.
-int16 Actor::setAction(int16 newState, int16 flags_) {
+int16 Actor::setAction(int16 newState, int16 flags) {
ActorAnimation *anim;
int16 numPoses = 0;
@@ -2059,24 +2066,24 @@ int16 Actor::setAction(int16 newState, int16 flags_) {
// RLockHandle( appearance->animations );
// RUnlockHandle( appearance->animations );
- if (appearance == NULL) return 0;
+ if (_appearance == NULL) return 0;
// If this animation has no frames, then return false
- anim = appearance->animation(newState);
+ anim = _appearance->animation(newState);
if (anim)
- numPoses = anim->count[currentFacing];
+ numPoses = anim->count[_currentFacing];
if (numPoses <= 0) return 0;
// Set up the animation
- currentAnimation = newState;
- animationFlags = flags_;
+ _currentAnimation = newState;
+ _animationFlags = flags;
// If they haven't set the "no reset" flag, then
- if (!(flags_ & animateNoRestart)) {
- if (flags_ & animateReverse) currentPose = numPoses - 1;
- else currentPose = 0;
+ if (!(flags & animateNoRestart)) {
+ if (flags & animateReverse) _currentPose = numPoses - 1;
+ else _currentPose = 0;
} else {
- currentPose = clamp(0, currentPose, numPoses - 1);
+ _currentPose = clamp(0, _currentPose, numPoses - 1);
}
return numPoses;
@@ -2093,11 +2100,11 @@ bool Actor::isActionAvailable(int16 newState, bool anyDir) {
// RLockHandle( appearance->animations );
// RUnlockHandle( appearance->animations );
- if (appearance == nullptr)
+ if (_appearance == nullptr)
return false;
// If this animation has no frames, then return false
- anim = appearance->animation(newState);
+ anim = _appearance->animation(newState);
if (anim == nullptr)
return false;
@@ -2106,7 +2113,7 @@ bool Actor::isActionAvailable(int16 newState, bool anyDir) {
if (anim->count[i] > 0) return true;
}
} else {
- if (anim->count[currentFacing] > 0) return true;
+ if (anim->count[_currentFacing] > 0) return true;
}
return false;
@@ -2117,12 +2124,12 @@ bool Actor::isActionAvailable(int16 newState, bool anyDir) {
// specified direction
int16 Actor::animationFrames(int16 actionType, Direction dir) {
- if (appearance == nullptr)
+ if (_appearance == nullptr)
return 0;
ActorAnimation *anim;
- anim = appearance->animation(actionType);
+ anim = _appearance->animation(actionType);
if (!anim)
return 0;
@@ -2142,23 +2149,23 @@ bool Actor::nextAnimationFrame(void) {
// RLockHandle( appearance->animations );
// RUnlockHandle( appearance->animations );
- if (appearance == NULL) {
- if (animationFlags & animateOnHold) {
+ if (_appearance == NULL) {
+ if (_animationFlags & animateOnHold) {
return false;
- } else if (animationFlags & animateRepeat) {
- animationFlags |= animateOnHold;
+ } else if (_animationFlags & animateRepeat) {
+ _animationFlags |= animateOnHold;
return false;
} else {
- animationFlags |= animateFinished;
+ _animationFlags |= animateFinished;
return true;
}
- } else animationFlags &= ~animateOnHold;
+ } else _animationFlags &= ~animateOnHold;
// Get the number of frames in the animation
- anim = appearance->animation(currentAnimation);
- numPoses = anim->count[currentFacing];
+ anim = _appearance->animation(_currentAnimation);
+ numPoses = anim->count[_currentFacing];
if (numPoses <= 0) {
- animationFlags |= animateFinished;
+ _animationFlags |= animateFinished;
return true; // no poses, return DONE
}
@@ -2166,15 +2173,15 @@ bool Actor::nextAnimationFrame(void) {
// been loaded, then don't update the animation state --
// wait until the sprite gets loaded, and then continue
// with the action.
- if (animationFlags & animateNotLoaded) return false;
+ if (_animationFlags & animateNotLoaded) return false;
// If the animation has reached the last frame, then exit.
- if (animationFlags & animateFinished) return true;
+ if (_animationFlags & animateFinished) return true;
- if (animationFlags & animateRandom) {
+ if (_animationFlags & animateRandom) {
// Select a random frame from the series.
- currentPose = g_vm->_rnd->getRandomNumber(numPoses - 1);
- } else if (animationFlags & animateReverse) {
+ _currentPose = g_vm->_rnd->getRandomNumber(numPoses - 1);
+ } else if (_animationFlags & animateReverse) {
// Note that the logic for forward repeats is slightly
// different for reverse repeats. Specifically, the
// "alternate" flag is always checked when going forward,
@@ -2182,43 +2189,43 @@ bool Actor::nextAnimationFrame(void) {
// flag is also set. This means that an "alternate" with
// no "repeat" will ping-pong exactly once.
- if (currentPose > 0) {
- currentPose--;
+ if (_currentPose > 0) {
+ _currentPose--;
// Check if this is the last frame
- if (currentPose <= 0 && !(animationFlags & animateRepeat)) {
- animationFlags |= animateFinished;
+ if (_currentPose <= 0 && !(_animationFlags & animateRepeat)) {
+ _animationFlags |= animateFinished;
}
- } else if (animationFlags & animateRepeat) {
+ } else if (_animationFlags & animateRepeat) {
// If we're repeating, check for a back & forth,
// or for a wraparound. Also checks for case of
// a degenerate series (1 frame only)
- if (animationFlags & animateAlternate) {
- animationFlags &= ~animateReverse;
- currentPose = MIN(1, numPoses - 1);
+ if (_animationFlags & animateAlternate) {
+ _animationFlags &= ~animateReverse;
+ _currentPose = MIN(1, numPoses - 1);
} else {
- currentPose = numPoses - 1;
+ _currentPose = numPoses - 1;
}
}
} else {
- if (currentPose < numPoses - 1) {
+ if (_currentPose < numPoses - 1) {
// Increment the pose number
- currentPose++;
+ _currentPose++;
// Check if this is the last frame
- if (currentPose >= numPoses - 1 &&
- !(animationFlags & (animateAlternate | animateRepeat)))
- animationFlags |= animateFinished;
- } else if (animationFlags & animateAlternate) {
+ if (_currentPose >= numPoses - 1 &&
+ !(_animationFlags & (animateAlternate | animateRepeat)))
+ _animationFlags |= animateFinished;
+ } else if (_animationFlags & animateAlternate) {
// At the end of the sequence, reverse direction
- animationFlags |= animateReverse;
- currentPose = MAX(currentPose - 1, 0);
- } else if (animationFlags & animateRepeat) {
+ _animationFlags |= animateReverse;
+ _currentPose = MAX(_currentPose - 1, 0);
+ } else if (_animationFlags & animateRepeat) {
// Wrap back to beginning
- currentPose = 0;
+ _currentPose = 0;
} else //If Last Frame And Not Animate Repeat or Alternate
- animationFlags |= animateFinished;
+ _animationFlags |= animateFinished;
}
return false;
}
@@ -2252,7 +2259,7 @@ void Actor::dropInventory(void) {
void Actor::holdInRightHand(ObjectID objID) {
assert(isObject(objID));
- rightHandObject = objID;
+ _rightHandObject = objID;
if (isPlayerActor(this))
g_vm->_containerList->setUpdate(thisID());
@@ -2262,7 +2269,7 @@ void Actor::holdInRightHand(ObjectID objID) {
void Actor::holdInLeftHand(ObjectID objID) {
assert(isObject(objID));
- leftHandObject = objID;
+ _leftHandObject = objID;
if (isPlayerActor(this))
g_vm->_containerList->setUpdate(thisID());
@@ -2288,7 +2295,7 @@ void Actor::wear(ObjectID objID, uint8 where) {
}
#endif
- armorObjects[where] = objID;
+ _armorObjects[where] = objID;
if (isPlayerActor(this))
g_vm->_containerList->setUpdate(thisID());
@@ -2307,7 +2314,7 @@ void Actor::updateAppearance(int32) {
// static uint16 count;
// count++;
- if (isDead() || !isActivated() || (flags & lobotomized)) return;
+ if (isDead() || !isActivated() || (_flags & lobotomized)) return;
#if DEBUG*0
WriteStatusF(4, "Wait Count %d Attitude %d", cycleCount, attitude);
@@ -2320,9 +2327,9 @@ void Actor::updateAppearance(int32) {
ShowObjectSection(this);
#endif
- if (appearance) {
- if (animationFrames(actionStand, currentFacing) == 1) {
- if (flags & fightStance) {
+ if (_appearance) {
+ if (animationFrames(actionStand, _currentFacing) == 1) {
+ if (_flags & fightStance) {
GameObject *weapon = offensiveObject();
if (weapon == this) weapon = NULL;
@@ -2338,16 +2345,16 @@ void Actor::updateAppearance(int32) {
setAction(actionTwoHandSwingHigh, 0);
}
- cycleCount = 0;
+ _cycleCount = 0;
} else {
- if (cycleCount > 0) { //If In Wait State Between Wait Animation
- cycleCount--;
+ if (_cycleCount > 0) { //If In Wait State Between Wait Animation
+ _cycleCount--;
setAction(actionStand, 0); //Just stand still
} else { // Wait Animation
- if (cycleCount == 0) { //If Just Starting Wait Animation
- cycleCount--;
- switch (attitude) { //Emotion And Character Type
+ if (_cycleCount == 0) { //If Just Starting Wait Animation
+ _cycleCount--;
+ switch (_attitude) { //Emotion And Character Type
//Currently Attitude Not Set So Always Hits Zero
case 0:
//Returns True If Successful No Checking Yet
@@ -2373,12 +2380,12 @@ void Actor::updateAppearance(int32) {
}
} else //Assume -1
if (nextAnimationFrame())//If Last Frame In Wait Animation
- cycleCount = g_vm->_rnd->getRandomNumber(19);
+ _cycleCount = g_vm->_rnd->getRandomNumber(19);
}
}
} else {
- if (currentAnimation != actionStand
- || (animationFlags & animateRepeat) == 0)
+ if (_currentAnimation != actionStand
+ || (_animationFlags & animateRepeat) == 0)
setAction(actionStand, animateRepeat);
else
nextAnimationFrame();
@@ -2406,14 +2413,14 @@ bool Actor::setAvailableAction(int16 action1, int16 action2, int16 action3, int1
// Set a new goal for this actor
void Actor::setGoal(uint8 newGoal) {
- if (currentGoal != newGoal) {
- if (curTask != NULL) {
- curTask->abortTask();
- delete curTask;
- curTask = NULL;
+ if (_currentGoal != newGoal) {
+ if (_curTask != NULL) {
+ _curTask->abortTask();
+ delete _curTask;
+ _curTask = NULL;
}
- currentGoal = newGoal;
+ _currentGoal = newGoal;
}
}
@@ -2423,8 +2430,8 @@ void Actor::setGoal(uint8 newGoal) {
void Actor::evaluateNeeds(void) {
if (!isDead()
&& isActivated()
- && !(flags & lobotomized)) {
- if (disposition >= dispositionPlayer) {
+ && !(_flags & lobotomized)) {
+ if (_disposition >= dispositionPlayer) {
if (combatBehaviorEnabled) {
SenseInfo info;
@@ -2436,29 +2443,29 @@ void Actor::evaluateNeeds(void) {
info,
maxSenseRange,
actorPropIDEnemy)) {
- PlayerActorID playerID = disposition - dispositionPlayer;
+ PlayerActorID playerID = _disposition - dispositionPlayer;
if (isAggressive(playerID))
setGoal(actorGoalAttackEnemy);
else {
- if (leader != NULL && inBandingRange())
+ if (_leader != NULL && inBandingRange())
setGoal(actorGoalAvoidEnemies);
else
setGoal(actorGoalPreserveSelf);
}
- } else if (leader != NULL && inBandingRange()) {
+ } else if (_leader != NULL && inBandingRange()) {
setGoal(actorGoalFollowLeader);
} else {
setGoal(actorGoalFollowAssignment);
}
- } else if (leader != NULL && inBandingRange()) {
+ } else if (_leader != NULL && inBandingRange()) {
setGoal(actorGoalFollowLeader);
} else {
setGoal(actorGoalFollowAssignment);
}
} else {
- if (disposition == dispositionEnemy
- && appearance != NULL
+ if (_disposition == dispositionEnemy
+ && _appearance != NULL
&& !hasEffect(actorNotDefenseless)) {
GameObject *obj;
bool foundWeapon = false;
@@ -2480,17 +2487,17 @@ void Actor::evaluateNeeds(void) {
foundWeapon = true;
if (!foundWeapon)
- flags |= afraid;
+ _flags |= afraid;
}
- if (flags & afraid || hasEffect(actorFear) || hasEffect(actorRepelUndead)) {
+ if (_flags & afraid || hasEffect(actorFear) || hasEffect(actorRepelUndead)) {
setGoal(actorGoalPreserveSelf);
- } else if (leader != NULL && inBandingRange()) {
- setGoal(leader->evaluateFollowerNeeds(this));
+ } else if (_leader != NULL && inBandingRange()) {
+ setGoal(_leader->evaluateFollowerNeeds(this));
} else {
SenseInfo info;
- if (disposition == dispositionEnemy
+ if (_disposition == dispositionEnemy
&& (getAssignment() == NULL
|| canSenseProtaganist(
info,
@@ -2515,29 +2522,29 @@ static int32 updatesViaScript = 0;
void Actor::updateState(void) {
// The actor should not be set permanently uninterruptable when
// the actor does not have a motion task
- assert(isMoving() || actionCounter != maxuint8);
+ assert(isMoving() || _actionCounter != maxuint8);
GameObject::updateState();
- if (flags & lobotomized)
+ if (_flags & lobotomized)
return;
// Update the action counter
- if (actionCounter != 0 && actionCounter != maxuint8)
- actionCounter--;
+ if (_actionCounter != 0 && _actionCounter != maxuint8)
+ _actionCounter--;
- if (appearance != NULL
+ if (_appearance != NULL
&& isDead()
&& isInterruptable()
- && (moveTask == NULL
- || moveTask->motionType != MotionTask::motionTypeDie)) {
+ && (_moveTask == NULL
+ || _moveTask->motionType != MotionTask::motionTypeDie)) {
int16 deadState = isActionAvailable(actionDead)
? actionDead
: isActionAvailable(actionDie)
? actionDie
: actionStand;
- if (currentAnimation != deadState)
+ if (_currentAnimation != deadState)
MotionTask::die(*this);
return;
}
@@ -2545,29 +2552,29 @@ void Actor::updateState(void) {
if (!isDead()) {
if (this == getCenterActor()) return;
- if (flags & specialAttack) {
- flags &= ~specialAttack;
+ if (_flags & specialAttack) {
+ _flags &= ~specialAttack;
- if (currentTarget != NULL) {
+ if (_currentTarget != NULL) {
scriptCallFrame scf;
ObjectID dObj = thisID();
scf.invokedObject = dObj;
scf.enactor = dObj;
scf.directObject = dObj;
- scf.indirectObject = currentTarget->thisID();
+ scf.indirectObject = _currentTarget->thisID();
scf.value = 0;
runObjectMethod(dObj, Method_Actor_onSpecialAttack, scf);
// If this actor is now deactivated or lobotomized
// return immediately
- if (isDead() || !isActivated() || (flags & lobotomized))
+ if (isDead() || !isActivated() || (_flags & lobotomized))
return;
}
}
- switch (currentGoal) {
+ switch (_currentGoal) {
case actorGoalFollowAssignment: {
ActorAssignment *assign = getAssignment();
@@ -2591,7 +2598,7 @@ void Actor::updateState(void) {
// If this actor is now deactivated or lobotomized
// return immediately
- if (isDead() || !isActivated() || (flags & lobotomized))
+ if (isDead() || !isActivated() || (_flags & lobotomized))
return;
// Re-get the assignment
@@ -2600,9 +2607,9 @@ void Actor::updateState(void) {
// If there is no assignment at this point, call the
// schedule to setup a new assignment.
- if (assign == NULL && schedule != 0) {
+ if (assign == NULL && _schedule != 0) {
updatesViaScript++;
- assert(curTask == NULL);
+ assert(_curTask == NULL);
scriptCallFrame scf;
@@ -2612,38 +2619,38 @@ void Actor::updateState(void) {
scf.indirectObject = Nothing;
scf.value = 0;
- runScript(schedule, scf);
+ runScript(_schedule, scf);
// Re-get the assignment
assign = getAssignment();
}
// Have the assignment create a new task
- if (assign != NULL && curTask == NULL)
- curTask = assign->createTask();
+ if (assign != NULL && _curTask == NULL)
+ _curTask = assign->createTask();
}
break;
case actorGoalPreserveSelf:
- if (leader != NULL || followers != NULL)
+ if (_leader != NULL || _followers != NULL)
disband();
- if (curTask == NULL) {
- if ((curTask = newTaskStack(this)) != NULL) {
+ if (_curTask == NULL) {
+ if ((_curTask = newTaskStack(this)) != NULL) {
Task *task = new GoAwayFromActorTask(
- curTask,
+ _curTask,
ActorPropertyTarget(
- disposition == dispositionEnemy
+ _disposition == dispositionEnemy
? actorPropIDPlayerActor
: actorPropIDEnemy),
true);
if (task != NULL)
- curTask->setTask(task);
+ _curTask->setTask(task);
else {
- delete curTask;
- curTask = NULL;
+ delete _curTask;
+ _curTask = NULL;
}
}
}
@@ -2651,24 +2658,24 @@ void Actor::updateState(void) {
case actorGoalAttackEnemy:
- if (curTask == NULL) {
- if ((curTask = newTaskStack(this)) != NULL) {
- uint8 disp = leader != NULL
- ? leader->disposition
- : disposition;
+ if (_curTask == NULL) {
+ if ((_curTask = newTaskStack(this)) != NULL) {
+ uint8 disp = _leader != NULL
+ ? _leader->_disposition
+ : _disposition;
Task *task = new HuntToKillTask(
- curTask,
+ _curTask,
ActorPropertyTarget(
disp == dispositionEnemy
? actorPropIDPlayerActor
: actorPropIDEnemy));
if (task != NULL)
- curTask->setTask(task);
+ _curTask->setTask(task);
else {
- delete curTask;
- curTask = NULL;
+ delete _curTask;
+ _curTask = NULL;
}
}
}
@@ -2676,28 +2683,28 @@ void Actor::updateState(void) {
case actorGoalFollowLeader:
- assert(isActor(leader));
- assert(followers == NULL);
+ assert(isActor(_leader));
+ assert(_followers == NULL);
- if (curTask == NULL)
- curTask = leader->createFollowerTask(this);
+ if (_curTask == NULL)
+ _curTask = _leader->createFollowerTask(this);
break;
case actorGoalAvoidEnemies:
- assert(isActor(leader));
- assert(followers == NULL);
+ assert(isActor(_leader));
+ assert(_followers == NULL);
- if (curTask == NULL) {
- if ((curTask = newTaskStack(this)) != NULL) {
- Task *task = new BandAndAvoidEnemiesTask(curTask);
+ if (_curTask == NULL) {
+ if ((_curTask = newTaskStack(this)) != NULL) {
+ Task *task = new BandAndAvoidEnemiesTask(_curTask);
if (task != NULL)
- curTask->setTask(task);
+ _curTask->setTask(task);
else {
- delete curTask;
- curTask = NULL;
+ delete _curTask;
+ _curTask = NULL;
}
}
}
@@ -2711,10 +2718,10 @@ void Actor::updateState(void) {
void Actor::handleTaskCompletion(TaskResult result) {
// The task is done, get rid of it
- delete curTask;
- curTask = NULL;
+ delete _curTask;
+ _curTask = NULL;
- switch (currentGoal) {
+ switch (_currentGoal) {
case actorGoalFollowAssignment: {
ActorAssignment *assign = getAssignment();
@@ -2744,9 +2751,9 @@ void Actor::handleOffensiveAct(Actor *attacker) {
runObjectMethod(dObj, Method_Actor_onAttacked, scf);
- if (disposition == dispositionFriendly) {
- if (attacker->disposition >= dispositionPlayer) {
- disposition = dispositionEnemy;
+ if (_disposition == dispositionFriendly) {
+ if (attacker->_disposition >= dispositionPlayer) {
+ _disposition = dispositionEnemy;
evaluateNeeds();
}
}
@@ -2765,22 +2772,22 @@ void Actor::handleDamageTaken(uint8 damage) {
&& !isActionAvailable(actionSwingHigh)
&& !isActionAvailable(actionTwoHandSwingHigh)
&& !hasEffect(actorNotDefenseless)) {
- flags |= afraid;
+ _flags |= afraid;
return;
}
if (combatBehavior != behaviorHungry
- && (flags & temporary)
+ && (_flags & temporary)
&& !hasEffect(actorFear)
&& !hasEffect(actorRepelUndead)) {
- if (flags & afraid) {
+ if (_flags & afraid) {
// Let's give monsters a small chance of regaining their courage
if ((uint16)g_vm->_rnd->getRandomNumber(0xffff) <= 0x3fff)
- flags &= ~afraid;
+ _flags &= ~afraid;
} else {
int16 i,
fellowBandMembers,
- vitality = effectiveStats.vitality;
+ vitality = _effectiveStats.vitality;
uint32 moraleBase = ((int32)damage << 16) / vitality,
bonus = 0;
@@ -2795,10 +2802,10 @@ void Actor::handleDamageTaken(uint8 damage) {
moraleBase -= moraleBase / 2;
// Determine how many fellow band members this actor has.
- if (leader != NULL)
- fellowBandMembers = leader->followers->size();
- else if (followers != NULL)
- fellowBandMembers = followers->size();
+ if (_leader != NULL)
+ fellowBandMembers = _leader->_followers->size();
+ else if (_followers != NULL)
+ fellowBandMembers = _followers->size();
else
fellowBandMembers = 0;
@@ -2812,7 +2819,7 @@ void Actor::handleDamageTaken(uint8 damage) {
// Test this actor's morale
if ((uint16)g_vm->_rnd->getRandomNumber(0xffff) <= moraleBase)
- flags |= afraid;
+ _flags |= afraid;
}
}
}
@@ -2910,7 +2917,7 @@ void Actor::evaluateMeleeAttack(Actor *attacker) {
// Compute the attacker's direction relative to this actor's
// facing
relativeDir = ((attacker->_data.location - _data.location).quickDir()
- - currentFacing) & 0x7;
+ - _currentFacing) & 0x7;
// Get pointers to this actors primary and secondary defensive
// objects
@@ -2957,42 +2964,42 @@ void Actor::evaluateMeleeAttack(Actor *attacker) {
// well.
void Actor::bandWith(Actor *newLeader) {
- assert(leader == NULL);
+ assert(_leader == NULL);
// If the actor we're banding with is not the leader, then band
// with his leader
- if (newLeader->leader != NULL) {
- newLeader = newLeader->leader;
- assert(newLeader->leader == NULL);
+ if (newLeader->_leader != NULL) {
+ newLeader = newLeader->_leader;
+ assert(newLeader->_leader == NULL);
}
// If this actor himself does not have followers then its really
// simple, otherwise we need to band all of this actor's followers
// with the new leader.
- if (followers == NULL) {
- if (newLeader->addFollower(this)) leader = newLeader;
+ if (_followers == NULL) {
+ if (newLeader->addFollower(this)) _leader = newLeader;
} else {
int16 i,
- oldFollowerCount = followers->size();
+ oldFollowerCount = _followers->size();
Actor **oldFollowers = new Actor * [oldFollowerCount];
if (oldFollowers != NULL) {
// Copy the list followers
for (i = 0; i < oldFollowerCount; i++) {
- oldFollowers[i] = (*followers)[i];
- assert(oldFollowers[i]->leader == this);
+ oldFollowers[i] = (*_followers)[i];
+ assert(oldFollowers[i]->_leader == this);
}
// Disband all of the old followers
for (i = 0; i < oldFollowerCount; i++)
oldFollowers[i]->disband();
- assert(followers == NULL);
+ assert(_followers == NULL);
// Add this actor and all of the old followers to the new
// leader's followers.
if (newLeader->addFollower(this)) {
- leader = newLeader;
+ _leader = newLeader;
for (i = 0; i < oldFollowerCount; i++)
oldFollowers[i]->bandWith(newLeader);
@@ -3009,23 +3016,23 @@ void Actor::bandWith(Actor *newLeader) {
// Simply causes this actor to be removed from his current band.
void Actor::disband(void) {
- if (leader != NULL) {
- leader->removeFollower(this);
- leader = NULL;
+ if (_leader != NULL) {
+ _leader->removeFollower(this);
+ _leader = NULL;
evaluateNeeds();
- } else if (followers != NULL) {
+ } else if (_followers != NULL) {
int16 i;
- for (i = 0; i < followers->size(); i++) {
- Actor *follower = (*followers)[i];
+ for (i = 0; i < _followers->size(); i++) {
+ Actor *follower = (*_followers)[i];
- follower->leader = NULL;
+ follower->_leader = NULL;
follower->evaluateNeeds();
}
- delete followers;
- followers = NULL;
+ delete _followers;
+ _followers = NULL;
}
}
@@ -3035,41 +3042,41 @@ void Actor::disband(void) {
bool Actor::addFollower(Actor *newBandMember) {
// The new band member should not be a leader of another band or
// a follower of another leader
- assert(newBandMember->leader == NULL);
- assert(newBandMember->followers == NULL);
+ assert(newBandMember->_leader == NULL);
+ assert(newBandMember->_followers == NULL);
// Allocate a new band, if needed
- if (followers == NULL && (followers = new Band(this)) == NULL)
+ if (_followers == NULL && (_followers = new Band(this)) == NULL)
return false;
- return followers->add(newBandMember);
+ return _followers->add(newBandMember);
}
//-----------------------------------------------------------------------
// Remove the specified actor from this actor's list of followers.
void Actor::removeFollower(Actor *bandMember) {
- assert(bandMember->leader == this);
- assert(followers != NULL);
+ assert(bandMember->_leader == this);
+ assert(_followers != NULL);
int16 i;
- followers->remove(bandMember);
- if (followers->size() == 0) {
- delete followers;
- followers = NULL;
+ _followers->remove(bandMember);
+ if (_followers->size() == 0) {
+ delete _followers;
+ _followers = NULL;
} else {
uint16 moraleBonus = 0;
- for (i = 0; i < followers->size(); i++)
+ for (i = 0; i < _followers->size(); i++)
moraleBonus += ((1 << 16) - moraleBonus) >> 4;
- for (i = 0; i < followers->size(); i++) {
- Actor *follower = (*followers)[i];
+ for (i = 0; i < _followers->size(); i++) {
+ Actor *follower = (*_followers)[i];
ActorProto *proto = (ActorProto *)follower->prototype;
uint8 combatBehavior = proto->combatBehavior;
- if (follower->currentGoal == actorGoalAttackEnemy
+ if (follower->_currentGoal == actorGoalAttackEnemy
&& combatBehavior != behaviorHungry) {
uint32 moraleBase;
@@ -3082,7 +3089,7 @@ void Actor::removeFollower(Actor *bandMember) {
moraleBase -= moraleBase * moraleBonus >> 16;
if ((uint16)g_vm->_rnd->getRandomNumber(0xffff) <= moraleBase)
- follower->flags |= afraid;
+ follower->_flags |= afraid;
}
}
}
@@ -3093,7 +3100,7 @@ void Actor::removeFollower(Actor *bandMember) {
// follower has no task.
TaskStack *Actor::createFollowerTask(Actor *bandMember) {
- assert(bandMember->leader == this);
+ assert(bandMember->_leader == this);
TaskStack *ts = NULL;
@@ -3115,13 +3122,13 @@ TaskStack *Actor::createFollowerTask(Actor *bandMember) {
// Evaluate a follower's needs and give him an approriate goal.
uint8 Actor::evaluateFollowerNeeds(Actor *follower) {
- assert(follower->leader == this);
+ assert(follower->_leader == this);
SenseInfo info;
- if ((disposition == dispositionEnemy
+ if ((_disposition == dispositionEnemy
&& follower->canSenseProtaganist(info, maxSenseRange))
- || (disposition >= dispositionPlayer
+ || (_disposition >= dispositionPlayer
&& follower->canSenseActorProperty(
info,
maxSenseRange,
@@ -3134,8 +3141,10 @@ uint8 Actor::evaluateFollowerNeeds(Actor *follower) {
// Returns 0 if not moving, 1 if path being calculated,
// 2 if path being followed.
bool Actor::pathFindState(void) {
- if (moveTask == NULL) return 0;
- if (moveTask->pathFindTask) return 1;
+ if (_moveTask == NULL)
+ return 0;
+ if (_moveTask->pathFindTask)
+ return 1;
return 2;
}
@@ -3143,9 +3152,9 @@ bool Actor::pathFindState(void) {
// Add knowledge package to actor
bool Actor::addKnowledge(uint16 kID) {
- for (int i = 0; i < ARRAYSIZE(knowledge); i++) {
- if (knowledge[i] == 0) {
- knowledge[i] = kID;
+ for (int i = 0; i < ARRAYSIZE(_knowledge); i++) {
+ if (_knowledge[i] == 0) {
+ _knowledge[i] = kID;
return true;
}
}
@@ -3156,9 +3165,9 @@ bool Actor::addKnowledge(uint16 kID) {
// Remove knowledge package from actor
bool Actor::removeKnowledge(uint16 kID) {
- for (int i = 0; i < ARRAYSIZE(knowledge); i++) {
- if (knowledge[i] == kID) {
- knowledge[i] = 0;
+ for (int i = 0; i < ARRAYSIZE(_knowledge); i++) {
+ if (_knowledge[i] == kID) {
+ _knowledge[i] = 0;
return true;
}
}
@@ -3169,8 +3178,8 @@ bool Actor::removeKnowledge(uint16 kID) {
// Remove all knowledge package from actor
void Actor::clearKnowledge(void) {
- for (int i = 0; i < ARRAYSIZE(knowledge); i++) {
- knowledge[i] = 0;
+ for (int i = 0; i < ARRAYSIZE(_knowledge); i++) {
+ _knowledge[i] = 0;
}
}
@@ -3184,14 +3193,14 @@ void Actor::useKnowledge(scriptCallFrame &scf) {
// First, search for the class with the best response
- for (int i = 0; i < ARRAYSIZE(knowledge); i++) {
- if (knowledge[i]) {
+ for (int i = 0; i < ARRAYSIZE(_knowledge); i++) {
+ if (_knowledge[i]) {
scriptResult res;
// Run the script to eval the response of this
// knowledge package
- res = runMethod(knowledge[i],
+ res = runMethod(_knowledge[i],
builtinAbstract,
0,
Method_KnowledgePackage_evalResponse,
@@ -3213,7 +3222,7 @@ void Actor::useKnowledge(scriptCallFrame &scf) {
if (pri > bestResponsePri) {
bestResponsePri = pri;
- bestResponseClass = knowledge[i];
+ bestResponseClass = _knowledge[i];
bestResponseCode = response;
}
}
@@ -3244,11 +3253,11 @@ void Actor::useKnowledge(scriptCallFrame &scf) {
// sense a protaganist within a specified range
bool Actor::canSenseProtaganistIndirectly(SenseInfo &info, int16 range) {
- if (followers != NULL) {
+ if (_followers != NULL) {
int i;
- for (i = 0; i < followers->size(); i++) {
- if ((*followers)[i]->canSenseProtaganist(info, range))
+ for (i = 0; i < _followers->size(); i++) {
+ if ((*_followers)[i]->canSenseProtaganist(info, range))
return true;
}
}
@@ -3264,11 +3273,11 @@ bool Actor::canSenseSpecificActorIndirectly(
SenseInfo &info,
int16 range,
Actor *a) {
- if (followers != NULL) {
+ if (_followers != NULL) {
int i;
- for (i = 0; i < followers->size(); i++) {
- if ((*followers)[i]->canSenseSpecificActor(info, range, a))
+ for (i = 0; i < _followers->size(); i++) {
+ if ((*_followers)[i]->canSenseSpecificActor(info, range, a))
return true;
}
}
@@ -3284,11 +3293,11 @@ bool Actor::canSenseSpecificObjectIndirectly(
SenseInfo &info,
int16 range,
ObjectID obj) {
- if (followers != NULL) {
+ if (_followers != NULL) {
int i;
- for (i = 0; i < followers->size(); i++) {
- if ((*followers)[i]->canSenseSpecificObject(info, range, obj))
+ for (i = 0; i < _followers->size(); i++) {
+ if ((*_followers)[i]->canSenseSpecificObject(info, range, obj))
return true;
}
}
@@ -3304,11 +3313,11 @@ bool Actor::canSenseActorPropertyIndirectly(
SenseInfo &info,
int16 range,
ActorPropertyID prop) {
- if (followers != NULL) {
+ if (_followers != NULL) {
int i;
- for (i = 0; i < followers->size(); i++) {
- if ((*followers)[i]->canSenseActorProperty(info, range, prop))
+ for (i = 0; i < _followers->size(); i++) {
+ if ((*_followers)[i]->canSenseActorProperty(info, range, prop))
return true;
}
}
@@ -3324,11 +3333,11 @@ bool Actor::canSenseObjectPropertyIndirectly(
SenseInfo &info,
int16 range,
ObjectPropertyID prop) {
- if (followers != NULL) {
+ if (_followers != NULL) {
int i;
- for (i = 0; i < followers->size(); i++) {
- if ((*followers)[i]->canSenseObjectProperty(info, range, prop))
+ for (i = 0; i < _followers->size(); i++) {
+ if ((*_followers)[i]->canSenseObjectProperty(info, range, prop))
return true;
}
}
@@ -3350,9 +3359,9 @@ bool Actor::takeMana(ActorManaID i, int8 dMana) {
return true;
#endif
assert(i >= manaIDRed && i <= manaIDViolet);
- if ((&effectiveStats.redMana)[i] < dMana)
+ if ((&_effectiveStats.redMana)[i] < dMana)
return false;
- (&effectiveStats.redMana)[i] -= dMana;
+ (&_effectiveStats.redMana)[i] -= dMana;
updateIndicators();
return true;
}
@@ -3363,7 +3372,7 @@ bool Actor::hasMana(ActorManaID i, int8 dMana) {
return true;
#endif
assert(i >= manaIDRed && i <= manaIDViolet);
- if ((&effectiveStats.redMana)[i] < dMana)
+ if ((&_effectiveStats.redMana)[i] < dMana)
return false;
return true;
}
@@ -3510,9 +3519,9 @@ void initActors(void) {
g_vm->_actorList.push_back(a);
}
- g_vm->_actorList[0]->disposition = dispositionPlayer + 0;
- g_vm->_actorList[1]->disposition = dispositionPlayer + 1;
- g_vm->_actorList[2]->disposition = dispositionPlayer + 2;
+ g_vm->_actorList[0]->_disposition = dispositionPlayer + 0;
+ g_vm->_actorList[1]->_disposition = dispositionPlayer + 1;
+ g_vm->_actorList[2]->_disposition = dispositionPlayer + 2;
}
void saveActors(Common::OutSaveFile *outS) {
@@ -3551,15 +3560,15 @@ void loadActors(Common::InSaveFile *in) {
for (int i = 0; i < kActorCount; ++i) {
Actor *a = g_vm->_actorList[i];
- a->leader = a->_leaderID != Nothing
+ a->_leader = a->_leaderID != Nothing
? (Actor *)GameObject::objectAddress(a->_leaderID)
: nullptr;
- a->followers = a->_followersID != NoBand
+ a->_followers = a->_followersID != NoBand
? getBandAddress(a->_followersID)
: nullptr;
- a->currentTarget = a->_currentTargetID != Nothing
+ a->_currentTarget = a->_currentTargetID != Nothing
? GameObject::objectAddress(a->_currentTargetID)
: nullptr;
}
diff --git a/engines/saga2/actor.h b/engines/saga2/actor.h
index 31a423885e..a9524a37d5 100644
--- a/engines/saga2/actor.h
+++ b/engines/saga2/actor.h
@@ -598,47 +598,47 @@ public:
// Resource fields
// Social loyalty
- uint8 faction; // actor's faction
+ uint8 _faction; // actor's faction
// Appearance attribute
- uint8 colorScheme; // indirect color map
+ uint8 _colorScheme; // indirect color map
- int32 appearanceID; // appearnce of this actor
+ int32 _appearanceID; // appearnce of this actor
// Personality attributes
- int8 attitude, // cooperativeness
- mood; // happiness
- uint8 disposition; // actor disposition
+ int8 _attitude, // cooperativeness
+ _mood; // happiness
+ uint8 _disposition; // actor disposition
// 0 = friendly, 1 = enemy,
// 2 = Julian, 3 = Philip,
// 4 = Kevin
// Character orientation
- Direction currentFacing; // current facing direction
+ Direction _currentFacing; // current facing direction
// Tether info
- int16 tetherLocU; // tether U coordinate
- int16 tetherLocV; // tether V coordinate
- int16 tetherDist; // length of tether
+ int16 _tetherLocU; // tether U coordinate
+ int16 _tetherLocV; // tether V coordinate
+ int16 _tetherDist; // length of tether
// Held objects
- ObjectID leftHandObject, // object held in left hand.
- rightHandObject; // object held in right hand.
+ ObjectID _leftHandObject, // object held in left hand.
+ _rightHandObject; // object held in right hand.
// Knowledge packets
- uint16 knowledge[16];
+ uint16 _knowledge[16];
// Schedule script ID
- uint16 schedule;
+ uint16 _schedule;
// Run-time fields
- uint8 conversationMemory[4];// last things talked about
+ uint8 _conversationMemory[4];// last things talked about
// Sprite animation variables
- uint8 currentAnimation, // current action sequence
- currentPose, // current pose in sequence
- animationFlags; // current posing flags
+ uint8 _currentAnimation, // current action sequence
+ _currentPose, // current pose in sequence
+ _animationFlags; // current posing flags
// Various actor flags
enum {
@@ -650,65 +650,65 @@ public:
fightStance = (1 << 5)
};
- uint8 flags;
+ uint8 _flags;
// Contains sprite index and positioning info for the current
// actor state.
- ActorPose poseInfo; // current animation state
+ ActorPose _poseInfo; // current animation state
// Pointer to the appearance record (sprite array) for this actor.
- ActorAppearance *appearance; // appearance structs
+ ActorAppearance *_appearance; // appearance structs
- int16 cycleCount; // misc counter for actions
- int16 kludgeCount; // another misc counter
+ int16 _cycleCount; // misc counter for actions
+ int16 _kludgeCount; // another misc counter
- uint32 enchantmentFlags; // flags indicating racial
+ uint32 _enchantmentFlags; // flags indicating racial
// abilities and enchantments
// Movement attributes
- MotionTask *moveTask;
+ MotionTask *_moveTask;
// Current task
- TaskStack *curTask;
+ TaskStack *_curTask;
// Current goal type
- uint8 currentGoal;
+ uint8 _currentGoal;
// Used for deltayed deactivation (and also to word-align struct)
- uint8 deactivationCounter;
+ uint8 _deactivationCounter;
// Assignment
ActorAssignment *_assignment;
// assignments
// Current effective stats
- ActorAttributes effectiveStats;
+ ActorAttributes _effectiveStats;
- uint8 actionCounter; // coordinate moves in combat
+ uint8 _actionCounter; // coordinate moves in combat
- uint16 effectiveResistance; // resistances (see EFFECTS.H)
- uint16 effectiveImmunity; // immunities (see EFFECTS.H)
+ uint16 _effectiveResistance; // resistances (see EFFECTS.H)
+ uint16 _effectiveImmunity; // immunities (see EFFECTS.H)
- int16 recPointsPerUpdate; // fractional vitality recovery
+ int16 _recPointsPerUpdate; // fractional vitality recovery
- int16 currentRecoveryPoints; // fraction left from last recovery
+ int16 _currentRecoveryPoints; // fraction left from last recovery
enum vitalityRecovery {
recPointsPerVitality = 10
};
- Actor *leader; // This actor's leader
+ Actor *_leader; // This actor's leader
ObjectID _leaderID;
- Band *followers; // This actor's band of followers
+ Band *_followers; // This actor's band of followers
BandID _followersID;
- ObjectID armorObjects[ARMOR_COUNT]; // armor objects being worn
+ ObjectID _armorObjects[ARMOR_COUNT]; // armor objects being worn
- GameObject *currentTarget;
+ GameObject *_currentTarget;
ObjectID _currentTargetID;
- int16 scriptVar[actorScriptVars]; // scratch variables for scripter use
+ int16 _scriptVar[actorScriptVars]; // scratch variables for scripter use
// Member functions
@@ -755,12 +755,12 @@ public:
private:
// Turn incrementally
void turn(Direction targetDir) {
- Direction relativeDir = (targetDir - currentFacing) & 0x7;
+ Direction relativeDir = (targetDir - _currentFacing) & 0x7;
- currentFacing =
+ _currentFacing =
(relativeDir < 4
- ? currentFacing + 1
- : currentFacing - 1)
+ ? _currentFacing + 1
+ : _currentFacing - 1)
& 0x7;
}
public:
@@ -792,7 +792,7 @@ public:
// Return a pointer to the actor's current assignment
ActorAssignment *getAssignment(void) {
- return flags & hasAssignment
+ return _flags & hasAssignment
? _assignment
: nullptr;
}
@@ -812,7 +812,7 @@ public:
// Determine if actor is dead
bool isDead(void) {
- return effectiveStats.vitality <= 0;
+ return _effectiveStats.vitality <= 0;
}
// Determine if actor is immobile (i.e. can't walk)
@@ -861,19 +861,20 @@ public:
// Return the value of this actor's disposition
int16 getDisposition(void) {
- return disposition;
+ return _disposition;
}
// Give the actor a new disposition
int16 setDisposition(int16 newDisp) {
- int16 oldDisp = disposition;
- if (newDisp < dispositionPlayer) disposition = newDisp;
+ int16 oldDisp = _disposition;
+ if (newDisp < dispositionPlayer)
+ _disposition = newDisp;
return oldDisp;
}
// Return a pointer to the effective stats
ActorAttributes *getStats(void) {
- return &effectiveStats;
+ return &_effectiveStats;
}
// Return a pointer to this actor's base stats
@@ -884,24 +885,24 @@ public:
// Determine if this actor is interruptable
bool isInterruptable(void) {
- return actionCounter == 0;
+ return _actionCounter == 0;
}
// Determine if this actor is permanently uninterruptable
bool isPermanentlyUninterruptable(void) {
- return actionCounter == maxuint8;
+ return _actionCounter == maxuint8;
}
// Set the inturruptability for this actor
void setInterruptablity(bool val) {
- actionCounter = val ? 0 : maxuint8;
+ _actionCounter = val ? 0 : maxuint8;
}
// Set action time counter for this actor
// REM: the action points will eventually need to be scaled based
// upon enchantments and abilities
void setActionPoints(uint8 points) {
- actionCounter = points;
+ _actionCounter = points;
}
// Drop the all of the actor's inventory
@@ -974,10 +975,10 @@ public:
void disband(void);
bool inBandingRange(void) {
- assert(leader != NULL);
+ assert(_leader != NULL);
- return leader->IDParent() == IDParent()
- && (leader->getLocation() - getLocation()).quickHDistance()
+ return _leader->IDParent() == IDParent()
+ && (_leader->getLocation() - getLocation()).quickHDistance()
<= bandingDist;
}
@@ -1024,45 +1025,45 @@ public:
uint16 getBaseRecovery(void);
bool resists(effectResistTypes r) {
- return effectiveResistance & (1 << r);
+ return _effectiveResistance & (1 << r);
}
bool isImmuneTo(effectImmuneTypes r) {
- return effectiveImmunity & (1 << r);
+ return _effectiveImmunity & (1 << r);
}
bool hasEffect(effectOthersTypes e) {
- return (enchantmentFlags & (1 << e)) != 0;
+ return (_enchantmentFlags & (1 << e)) != 0;
}
void setResist(effectResistTypes r, bool on) {
- effectiveResistance = on ?
- effectiveResistance | (1 << r) :
- effectiveResistance & ~(1 << r);
+ _effectiveResistance = on ?
+ _effectiveResistance | (1 << r) :
+ _effectiveResistance & ~(1 << r);
}
void setImmune(effectImmuneTypes r, bool on) {
- effectiveImmunity = on ?
- effectiveImmunity | (1 << r) :
- effectiveImmunity & ~(1 << r);
+ _effectiveImmunity = on ?
+ _effectiveImmunity | (1 << r) :
+ _effectiveImmunity & ~(1 << r);
}
void setEffect(effectOthersTypes e, bool on) {
- enchantmentFlags = on ?
- enchantmentFlags | (1 << e) :
- enchantmentFlags & ~(1 << e);
+ _enchantmentFlags = on ?
+ _enchantmentFlags | (1 << e) :
+ _enchantmentFlags & ~(1 << e);
}
bool makeSavingThrow(void);
void setFightStance(bool val) {
if (val)
- flags |= fightStance;
+ _flags |= fightStance;
else
- flags &= ~fightStance;
+ _flags &= ~fightStance;
}
};
inline bool isPlayerActor(Actor *a) {
- return a->disposition >= dispositionPlayer;
+ return a->_disposition >= dispositionPlayer;
}
inline bool isPlayerActor(ObjectID obj) {
@@ -1071,7 +1072,7 @@ inline bool isPlayerActor(ObjectID obj) {
}
inline bool isEnemy(Actor *a) {
- return !a->isDead() && a->disposition == dispositionEnemy;
+ return !a->isDead() && a->_disposition == dispositionEnemy;
}
inline bool isEnemy(ObjectID obj) {
diff --git a/engines/saga2/assign.cpp b/engines/saga2/assign.cpp
index 6c608ba5dc..828d4c7748 100644
--- a/engines/saga2/assign.cpp
+++ b/engines/saga2/assign.cpp
@@ -47,7 +47,7 @@ ActorAssignment::ActorAssignment(Actor *a, uint16 until) :
debugC(2, kDebugActors, "New assignment for %p (%s) from %d until %d: %p",
(void *)a, a->objName(), startFrame, endFrame, (void *)this);
a->_assignment = this;
- a->flags |= hasAssignment;
+ a->_flags |= hasAssignment;
}
ActorAssignment::ActorAssignment(Actor *ac, Common::SeekableReadStream *stream) {
@@ -56,7 +56,7 @@ ActorAssignment::ActorAssignment(Actor *ac, Common::SeekableReadStream *stream)
_actor = ac;
ac->_assignment = this;
- ac->flags |= hasAssignment;
+ ac->_flags |= hasAssignment;
}
//----------------------------------------------------------------------
@@ -68,15 +68,15 @@ ActorAssignment::~ActorAssignment(void) {
(void *)a, a->objName(), (void *)this);
// Determine if the actor has a task initiated by this assignment
- if (a->currentGoal == actorGoalFollowAssignment
- && a->curTask != NULL) {
+ if (a->_currentGoal == actorGoalFollowAssignment
+ && a->_curTask != NULL) {
// If so, abort it
- a->curTask->abortTask();
- delete a->curTask;
- a->curTask = NULL;
+ a->_curTask->abortTask();
+ delete a->_curTask;
+ a->_curTask = NULL;
}
- a->flags &= ~hasAssignment;
+ a->_flags &= ~hasAssignment;
}
//----------------------------------------------------------------------
@@ -145,8 +145,8 @@ void ActorAssignment::handleTaskCompletion(TaskResult) {
void ActorAssignment::startTask(void) {
Actor *a = getActor();
- if (a->currentGoal == actorGoalFollowAssignment)
- a->curTask = createTask();
+ if (a->_currentGoal == actorGoalFollowAssignment)
+ a->_curTask = createTask();
}
//----------------------------------------------------------------------
diff --git a/engines/saga2/band.cpp b/engines/saga2/band.cpp
index 366148330d..e9cce0eecf 100644
--- a/engines/saga2/band.cpp
+++ b/engines/saga2/band.cpp
@@ -233,7 +233,7 @@ void loadBands(Common::InSaveFile *in, int32 chunkSize) {
// Reconstruct followers for actors
for (int i = 0; i < kActorCount; ++i) {
BandID id = g_vm->_actorList[i]->_followersID;
- g_vm->_actorList[i]->followers = id != NoBand
+ g_vm->_actorList[i]->_followers = id != NoBand
? getBandAddress(id)
: nullptr;
}
diff --git a/engines/saga2/beegee.cpp b/engines/saga2/beegee.cpp
index d6bc222c89..0c9bc9e118 100644
--- a/engines/saga2/beegee.cpp
+++ b/engines/saga2/beegee.cpp
@@ -447,7 +447,7 @@ void clearActiveFactions(void) {
}
void incrementActiveFaction(Actor *a) {
- activeFactions[a->faction]++;
+ activeFactions[a->_faction]++;
}
void useActiveFactions(void) {
diff --git a/engines/saga2/dispnode.cpp b/engines/saga2/dispnode.cpp
index 4749bb5737..01028bd78a 100644
--- a/engines/saga2/dispnode.cpp
+++ b/engines/saga2/dispnode.cpp
@@ -216,9 +216,9 @@ void DisplayNodeList::buildObjects(bool fromScratch) {
Actor *a = (Actor *)obj;
// Release the actor appearance if loaded
- if (a->appearance != NULL) {
- ReleaseActorAppearance(a->appearance);
- a->appearance = NULL;
+ if (a->_appearance != NULL) {
+ ReleaseActorAppearance(a->_appearance);
+ a->_appearance = NULL;
}
}
}
@@ -253,9 +253,9 @@ void DisplayNodeList::buildObjects(bool fromScratch) {
// If actor is newly entered to the arena
// (appearance == NULL), then load the
// actor's appearance.
- if (a->appearance == NULL) {
- a->appearance =
- LoadActorAppearance(a->appearanceID, sprStandBank);
+ if (a->_appearance == NULL) {
+ a->_appearance =
+ LoadActorAppearance(a->_appearanceID, sprStandBank);
}
}
@@ -497,12 +497,12 @@ void DisplayNode::drawObject(void) {
bubbleColorTable,
ARRAYSIZE(bubbleColorTable));
- if (a->kludgeCount < 0 || ++a->kludgeCount >= kBubbleSpriteCount)
- a->kludgeCount = 0;
+ if (a->_kludgeCount < 0 || ++a->_kludgeCount >= kBubbleSpriteCount)
+ a->_kludgeCount = 0;
sc = &scList[0];
sc->sp = spellSprites->sprite(
- kBaseBubbleSpriteIndex + a->kludgeCount);
+ kBaseBubbleSpriteIndex + a->_kludgeCount);
sc->offset.x = scList->offset.y = 0;
sc->colorTable = mainColors;
sc->flipped = false;
@@ -563,15 +563,15 @@ void DisplayNode::drawObject(void) {
}
}
- aa = a->appearance;
+ aa = a->_appearance;
if (aa == nullptr)
return;
// Fetch the animation series, and determine which
// pose in the series is the current one.
- anim = aa->animation(a->currentAnimation);
- pose = aa->pose(anim, a->currentFacing, a->currentPose);
+ anim = aa->animation(a->_currentAnimation);
+ pose = aa->pose(anim, a->_currentFacing, a->_currentPose);
if (anim == nullptr)
return;
@@ -600,7 +600,7 @@ void DisplayNode::drawObject(void) {
// the new frame to finish loaded (handled by
// lockResource())
if (aa->isBankLoaded(pose->actorFrameBank)
- || !aa->isBankLoaded(a->poseInfo.actorFrameBank)) {
+ || !aa->isBankLoaded(a->_poseInfo.actorFrameBank)) {
ActorPose pTemp = *pose;
// Initiate a load of the sprite bank needed.
@@ -613,13 +613,13 @@ void DisplayNode::drawObject(void) {
aa->requestBank(pose->actorFrameBank);
// Indicate that animation is OK.
- a->animationFlags &= ~animateNotLoaded;
+ a->_animationFlags &= ~animateNotLoaded;
// Set up which bank and frame to use.
- a->poseInfo = pTemp;
+ a->_poseInfo = pTemp;
} else {
// Indicate that animation isn't loaded
- a->animationFlags |= animateNotLoaded;
+ a->_animationFlags |= animateNotLoaded;
// Initiate a load of the sprite bank needed.
/* if (!RHandleLoading(
@@ -637,7 +637,7 @@ void DisplayNode::drawObject(void) {
bodyIndex = 0;
rightIndex = leftIndex = -2;
partCount = 1;
- poseFlags = a->poseInfo.flags;
+ poseFlags = a->_poseInfo.flags;
a->getColorTranslation(mainColors);
@@ -645,7 +645,7 @@ void DisplayNode::drawObject(void) {
// carrying in each hand, and what drawing
// order should be used for these objects.
- if (a->leftHandObject != Nothing) {
+ if (a->_leftHandObject != Nothing) {
partCount++;
if (poseFlags & ActorPose::leftObjectInFront) {
@@ -656,7 +656,7 @@ void DisplayNode::drawObject(void) {
}
}
- if (a->rightHandObject != Nothing) {
+ if (a->_rightHandObject != Nothing) {
partCount++;
if (poseFlags & ActorPose::rightObjectInFront) {
@@ -685,15 +685,15 @@ void DisplayNode::drawObject(void) {
// REM: Locking bug...
// ss = (SpriteSet *)RLockHandle( aa->sprites );
- sprPtr = aa->spriteBanks[a->poseInfo.actorFrameBank];
+ sprPtr = aa->spriteBanks[a->_poseInfo.actorFrameBank];
ss = sprPtr;
if (ss == nullptr)
return;
// Fill in the SpriteComponent structure for body
sc = &scList[bodyIndex];
- assert(a->poseInfo.actorFrameIndex < ss->count);
- sc->sp = ss->sprite(a->poseInfo.actorFrameIndex);
+ assert(a->_poseInfo.actorFrameIndex < ss->count);
+ sc->sp = ss->sprite(a->_poseInfo.actorFrameIndex);
sc->offset.x = sc->offset.y = 0;
// Color remapping info
sc->colorTable = mainColors;
@@ -709,7 +709,7 @@ void DisplayNode::drawObject(void) {
// If we were carrying something in the left hand,
// then fill in the component structure for it.
if (leftIndex >= 0) {
- GameObject *ob = GameObject::objectAddress(a->leftHandObject);
+ GameObject *ob = GameObject::objectAddress(a->_leftHandObject);
ProtoObj *prot = ob->proto();
ob->getColorTranslation(leftColors);
@@ -717,9 +717,9 @@ void DisplayNode::drawObject(void) {
sc = &scList[leftIndex];
sc->sp = prot->getOrientedSprite(
ob,
- a->poseInfo.leftObjectIndex);
+ a->_poseInfo.leftObjectIndex);
assert(sc->sp != NULL);
- sc->offset = a->poseInfo.leftObjectOffset;
+ sc->offset = a->_poseInfo.leftObjectOffset;
assert(sc->offset.x < 1000);
assert(sc->offset.x > -1000);
assert(sc->offset.y < 1000);
@@ -731,7 +731,7 @@ void DisplayNode::drawObject(void) {
// If we were carrying something in the right hand,
// then fill in the component structure for it.
if (rightIndex >= 0) {
- GameObject *ob = GameObject::objectAddress(a->rightHandObject);
+ GameObject *ob = GameObject::objectAddress(a->_rightHandObject);
ProtoObj *prot = ob->proto();
ob->getColorTranslation(rightColors);
@@ -739,13 +739,13 @@ void DisplayNode::drawObject(void) {
sc = &scList[rightIndex];
sc->sp = prot->getOrientedSprite(
ob,
- a->poseInfo.rightObjectIndex);
+ a->_poseInfo.rightObjectIndex);
assert(sc->sp != NULL);
assert(sc->sp->size.x > 0);
assert(sc->sp->size.y > 0);
assert(sc->sp->size.x < 255);
assert(sc->sp->size.y < 255);
- sc->offset = a->poseInfo.rightObjectOffset;
+ sc->offset = a->_poseInfo.rightObjectOffset;
assert(sc->offset.x < 1000);
assert(sc->offset.x > -1000);
assert(sc->offset.y < 1000);
@@ -848,18 +848,18 @@ ObjectID pickObject(const StaticPoint32 &mouse, StaticTilePoint &objPos) {
} else {
Actor *a = (Actor *)obj;
- aa = a->appearance;
+ aa = a->_appearance;
if (aa == NULL) continue;
- sprPtr = aa->spriteBanks[a->poseInfo.actorFrameBank];
+ sprPtr = aa->spriteBanks[a->_poseInfo.actorFrameBank];
ss = sprPtr;
if (ss == nullptr)
continue;
- spr = ss->sprite(a->poseInfo.actorFrameIndex);
+ spr = ss->sprite(a->_poseInfo.actorFrameIndex);
flipped =
- (a->poseInfo.flags & ActorPose::actorFlipped) ? 1 : 0;
+ (a->_poseInfo.flags & ActorPose::actorFlipped) ? 1 : 0;
}
if (GetSpritePixel(spr, flipped, testPoint)) {
diff --git a/engines/saga2/effects.cpp b/engines/saga2/effects.cpp
index f3ecba5516..b52d211cbd 100644
--- a/engines/saga2/effects.cpp
+++ b/engines/saga2/effects.cpp
@@ -116,12 +116,12 @@ int16 ProtoDrainage::currentLevel(Actor *a, effectDrainsTypes edt) {
case drainsManaGreen:
case drainsManaBlue:
case drainsManaViolet:
- return (&a->effectiveStats.redMana)[edt - drainsManaRed];
+ return (&a->_effectiveStats.redMana)[edt - drainsManaRed];
case drainsLifeLevel:
return (a->getBaseStats())->vitality;
case drainsVitality:
- return a->effectiveStats.vitality;
+ return a->_effectiveStats.vitality;
default:
return 0;
}
@@ -137,10 +137,10 @@ void ProtoDrainage::drainLevel(GameObject *cst, Actor *a, effectDrainsTypes edt,
case drainsManaViolet:
{
ActorManaID aType = (ActorManaID)(edt + (manaIDRed - drainsManaRed));
- (&a->effectiveStats.redMana)[aType] =
+ (&a->_effectiveStats.redMana)[aType] =
clamp(
0,
- (&a->effectiveStats.redMana)[aType] - amt,
+ (&a->_effectiveStats.redMana)[aType] - amt,
(&(a->getBaseStats())->redMana)[aType]);
}
break;
@@ -436,7 +436,7 @@ SPECIALSPELL(DeathSpell) {
Actor *a = (Actor *) trg->getObject();
if (!a->makeSavingThrow()) {
a->acceptDamage(cst->thisID(),
- a->effectiveStats.vitality,
+ a->_effectiveStats.vitality,
kDamageEnergy, 1, 2, 0);
a->die();
}
diff --git a/engines/saga2/enchant.cpp b/engines/saga2/enchant.cpp
index 73b0afa872..0b1ff162da 100644
--- a/engines/saga2/enchant.cpp
+++ b/engines/saga2/enchant.cpp
@@ -149,10 +149,10 @@ void clearEnchantments(Actor *a) {
ea->firstAid = ba->firstAid;
ea->spotHidden = ba->spotHidden;
- a->enchantmentFlags = a->getBaseEnchantmentEffects();
- a->effectiveResistance = a->getBaseResistance();
- a->effectiveImmunity = a->getBaseImmunity();
- a->recPointsPerUpdate = a->getBaseRecovery();
+ a->_enchantmentFlags = a->getBaseEnchantmentEffects();
+ a->_effectiveResistance = a->getBaseResistance();
+ a->_effectiveImmunity = a->getBaseImmunity();
+ a->_recPointsPerUpdate = a->getBaseRecovery();
}
void addEnchantment(Actor *a, uint16 enchantmentID) {
@@ -211,8 +211,8 @@ void evalActorEnchantments(Actor *a) {
if ((cSet & (ProtoObj::isArmor | ProtoObj::isWeapon | ProtoObj::isWearable))
&& proto->isObjectBeingUsed(obj)) {
- a->effectiveResistance |= proto->resistance;
- a->effectiveImmunity |= proto->immunity;
+ a->_effectiveResistance |= proto->resistance;
+ a->_effectiveImmunity |= proto->immunity;
}
}
diff --git a/engines/saga2/intrface.cpp b/engines/saga2/intrface.cpp
index 19a3c886d5..fde4bb7824 100644
--- a/engines/saga2/intrface.cpp
+++ b/engines/saga2/intrface.cpp
@@ -578,36 +578,36 @@ void CPortrait::getStateString(char buf[], int8 size, uint16 brotherID) {
buf[0] = '\0';
- if (a->enchantmentFlags & (1 << actorAsleep)) {
+ if (a->_enchantmentFlags & (1 << actorAsleep)) {
Common::strlcat(buf, asleepStr, size);
- } else if (a->enchantmentFlags & (1 << actorParalyzed)) {
+ } else if (a->_enchantmentFlags & (1 << actorParalyzed)) {
Common::strlcat(buf, paralysedStr, size);
- } else if (a->enchantmentFlags & (1 << actorBlind)) {
+ } else if (a->_enchantmentFlags & (1 << actorBlind)) {
Common::strlcat(buf, blindStr, size);
- } else if (a->enchantmentFlags & (1 << actorFear)) {
+ } else if (a->_enchantmentFlags & (1 << actorFear)) {
Common::strlcat(buf, afraidStr, size);
} else if (pa->isAggressive()) {
Common::strlcat(buf, angryStr, size);
}
- if (stats.vitality >= a->effectiveStats.vitality * 3) {
+ if (stats.vitality >= a->_effectiveStats.vitality * 3) {
if (buf[0] != '\0') // strlen(buf) > 0
Common::strlcat(buf, commaStr, size);
Common::strlcat(buf, badlyWoundedStr, size);
- } else if (stats.vitality * 2 > a->effectiveStats.vitality * 3) {
+ } else if (stats.vitality * 2 > a->_effectiveStats.vitality * 3) {
if (buf[0] != '\0') // strlen(buf) > 0
Common::strlcat(buf, commaStr, size);
Common::strlcat(buf, hurtStr, size);
}
- if (a->enchantmentFlags & (1 << actorPoisoned)) {
+ if (a->_enchantmentFlags & (1 << actorPoisoned)) {
if (buf[0] != '\0') // strlen(buf) > 0
Common::strlcat(buf, commaStr, size);
Common::strlcat(buf, poisonedStr, size);
- } else if (a->enchantmentFlags & (1 << actorDiseased)) {
+ } else if (a->_enchantmentFlags & (1 << actorDiseased)) {
if (buf[0] != '\0') // strlen(buf) > 0
Common::strlcat(buf, commaStr, size);
diff --git a/engines/saga2/motion.cpp b/engines/saga2/motion.cpp
index e60a903372..7dba743fe8 100644
--- a/engines/saga2/motion.cpp
+++ b/engines/saga2/motion.cpp
@@ -154,7 +154,7 @@ int32 getPathFindIQ(GameObject *obj) {
else {
if (objRoofRipped(obj))
pfIQ = 75;
- else if (a->disposition == 1)
+ else if (a->_disposition == 1)
pfIQ = 250;
else
pfIQ = 100;
@@ -448,7 +448,7 @@ MotionTask *MotionTaskList::newTask(GameObject *obj) {
_list.push_back(mt);
if (isActor(obj))
- ((Actor *)obj)->moveTask = mt;
+ ((Actor *)obj)->_moveTask = mt;
}
obj->_data.objectFlags |= objectMoving;
@@ -483,7 +483,7 @@ void MotionTask::read(Common::InSaveFile *in) {
// If the object is an actor, plug this motion task into the actor
if (object && isActor(object))
- ((Actor *)object)->moveTask = this;
+ ((Actor *)object)->_moveTask = this;
if (motionType == motionTypeWalk
|| prevMotionType == motionTypeWalk) {
@@ -1081,8 +1081,8 @@ void MotionTask::remove(int16 returnVal) {
if (isActor(object)) {
Actor *a = (Actor *)object;
- a->moveTask = NULL;
- a->cycleCount = g_vm->_rnd->getRandomNumber(19);
+ a->_moveTask = NULL;
+ a->_cycleCount = g_vm->_rnd->getRandomNumber(19);
// Make sure the actor is not left in a permanently
// uninterruptable state with no motion task to reset it
@@ -1113,7 +1113,7 @@ TilePoint MotionTask::getImmediateTarget(void) {
if (flags & agitated)
dir = direction;
else
- dir = ((Actor *)object)->currentFacing;
+ dir = ((Actor *)object)->_currentFacing;
return object->_data.location
+ incDirTable[dir] * kTileUVSize;
@@ -1245,8 +1245,8 @@ void MotionTask::shootObject(
if (isActor(&target)) {
Actor *targetActor = (Actor *)⌖
- if (targetActor->moveTask != NULL) {
- MotionTask *targetMotion = targetActor->moveTask;
+ if (targetActor->_moveTask != NULL) {
+ MotionTask *targetMotion = targetActor->_moveTask;
if (targetMotion->motionType == motionTypeWalk)
vector += targetMotion->velocity * turns;
@@ -2022,7 +2022,7 @@ void MotionTask::finishTalking(void) {
if (motionType == motionTypeTalk) {
if (isActor(object)) {
Actor *a = (Actor *)object;
- if (a->currentAnimation != actionStand)
+ if (a->_currentAnimation != actionStand)
a->setAction(actionStand, 0);
}
remove();
@@ -2401,7 +2401,7 @@ void MotionTask::walkAction(void) {
assert(isActor(object));
a = (Actor *)object;
- aa = a->appearance;
+ aa = a->_appearance;
if (a->isImmobile()) {
remove(motionWalkBlocked);
@@ -2539,13 +2539,13 @@ void MotionTask::walkAction(void) {
moveBlocked = false;
if (moveTaskDone || moveTaskWaiting) {
- movementDirection = a->currentFacing;
+ movementDirection = a->_currentFacing;
} else if (targetDist == 0 && ABS(targetVector.z) > kMaxStepHeight) {
if (pathFindTask) {
- movementDirection = a->currentFacing;
+ movementDirection = a->_currentFacing;
moveTaskWaiting = true;
} else {
- movementDirection = a->currentFacing;
+ movementDirection = a->_currentFacing;
moveBlocked = true;
}
} else if (targetDist <= speed) {
@@ -2564,7 +2564,7 @@ void MotionTask::walkAction(void) {
// Determine the direction the character must spin
// to be at the correct movement angle.
directionAngle =
- (((movementDirection - a->currentFacing) + 4) & 7) - 4;
+ (((movementDirection - a->_currentFacing) + 4) & 7) - 4;
// Test terrain. Note that if the character is spinning more than 1
// octant this frame, then they cannot move so a terrain test is unneeded.
@@ -2579,7 +2579,7 @@ void MotionTask::walkAction(void) {
if (pathFindTask)
moveTaskWaiting = true;
else {
- movementDirection = a->currentFacing;
+ movementDirection = a->_currentFacing;
moveBlocked = true;
}
/* if (!(flags & pathFind) || nextWayPoint() == false)
@@ -2679,7 +2679,7 @@ void MotionTask::walkAction(void) {
if (pathFindTask)
moveTaskWaiting = true;
else {
- movementDirection = a->currentFacing;
+ movementDirection = a->_currentFacing;
moveBlocked = true;
}
}
@@ -2687,19 +2687,19 @@ void MotionTask::walkAction(void) {
// REM: Test the terrain at the new spot.
- if (movementDirection != a->currentFacing) {
+ if (movementDirection != a->_currentFacing) {
// Determine the direction the character must spin
// to be at the correct movement angle.
directionAngle =
- (((movementDirection - a->currentFacing) + 4) & 7) - 4;
+ (((movementDirection - a->_currentFacing) + 4) & 7) - 4;
// If the direction is at a right angle or behind
// the character, then they cannot move.
if (directionAngle < 0) {
- a->currentFacing = spinRight(a->currentFacing);
+ a->_currentFacing = spinRight(a->_currentFacing);
} else {
- a->currentFacing = spinLeft(a->currentFacing);
+ a->_currentFacing = spinLeft(a->_currentFacing);
}
}
@@ -2728,7 +2728,7 @@ void MotionTask::walkAction(void) {
} else
remove(motionWalkBlocked);
} else if (moveTaskWaiting
- || movementDirection != a->currentFacing) {
+ || movementDirection != a->_currentFacing) {
// When he starts running again, then have him walk only.
runCount = MAX<int16>(runCount, 8);
@@ -2775,11 +2775,11 @@ void MotionTask::walkAction(void) {
else
stairsDir = 7;
- if (a->currentFacing == stairsDir) {
+ if (a->_currentFacing == stairsDir) {
// walk up stairs
newAction = actionSpecial7;
flags |= onStairs;
- } else if (a->currentFacing == ((stairsDir - 4) & 0x7)) {
+ } else if (a->_currentFacing == ((stairsDir - 4) & 0x7)) {
// walk down stairs
newAction = actionSpecial8;
flags |= onStairs;
@@ -2800,7 +2800,7 @@ void MotionTask::walkAction(void) {
// Determine if the new action is running
// or walking.
- if (a->currentAnimation == newAction) {
+ if (a->_currentAnimation == newAction) {
// If we are already doing that action, then
// just continue doing it.
if (walkType != walkSlow)
@@ -2810,10 +2810,10 @@ void MotionTask::walkAction(void) {
a->nextAnimationFrame();
flags ^= nextAnim;
}
- } else if (a->currentAnimation == actionWalk
- || a->currentAnimation == actionRun
- || a->currentAnimation == actionSpecial7
- || a->currentAnimation == actionSpecial8) {
+ } else if (a->_currentAnimation == actionWalk
+ || a->_currentAnimation == actionRun
+ || a->_currentAnimation == actionSpecial7
+ || a->_currentAnimation == actionSpecial8) {
// If we are running instead of walking or
// vice versa, then change to the new action
// but don't break stride
@@ -2929,14 +2929,14 @@ void MotionTask::upLadderAction(void) {
TilePoint newLoc;
- newLoc = loc + incDirTable[a->currentFacing] * crossSection * 2;
+ newLoc = loc + incDirTable[a->_currentFacing] * crossSection * 2;
newLoc.z = tileSlopeHeight(newLoc, a);
if (!checkBlocked(a, newLoc))
a->move(newLoc);
else {
newLoc = loc
- + incDirTable[(a->currentFacing - 2) & 7]
+ + incDirTable[(a->_currentFacing - 2) & 7]
* crossSection * 2;
newLoc.z = tileSlopeHeight(newLoc, a);
@@ -2944,7 +2944,7 @@ void MotionTask::upLadderAction(void) {
a->move(newLoc);
else {
newLoc = loc
- + incDirTable[(a->currentFacing + 2) & 7]
+ + incDirTable[(a->_currentFacing + 2) & 7]
* crossSection * 2;
newLoc.z = tileSlopeHeight(newLoc, a);
@@ -2952,7 +2952,7 @@ void MotionTask::upLadderAction(void) {
a->move(newLoc);
else {
newLoc = loc
- + incDirTable[a->currentFacing]
+ + incDirTable[a->_currentFacing]
* crossSection * 2;
newLoc.z = tileSlopeHeight(newLoc, a);
a->move(newLoc);
@@ -3050,14 +3050,14 @@ void MotionTask::downLadderAction(void) {
TilePoint newLoc;
- newLoc = loc - incDirTable[a->currentFacing] * kTileUVSize;
+ newLoc = loc - incDirTable[a->_currentFacing] * kTileUVSize;
newLoc.z = tileSlopeHeight(newLoc, a);
if (!checkBlocked(a, newLoc))
a->move(newLoc);
else {
newLoc = loc
- - incDirTable[(a->currentFacing - 2) & 7]
+ - incDirTable[(a->_currentFacing - 2) & 7]
* kTileUVSize;
newLoc.z = tileSlopeHeight(newLoc, a);
@@ -3065,7 +3065,7 @@ void MotionTask::downLadderAction(void) {
a->move(newLoc);
else {
newLoc = loc
- - incDirTable[(a->currentFacing + 2) & 7]
+ - incDirTable[(a->_currentFacing + 2) & 7]
* kTileUVSize;
newLoc.z = tileSlopeHeight(newLoc, a);
@@ -3073,7 +3073,7 @@ void MotionTask::downLadderAction(void) {
a->move(newLoc);
else {
newLoc = loc
- - incDirTable[a->currentFacing]
+ - incDirTable[a->_currentFacing]
* kTileUVSize;
newLoc.z = tileSlopeHeight(newLoc, a);
a->move(newLoc);
@@ -3099,7 +3099,7 @@ void MotionTask::giveAction(void) {
flags &= ~reset;
}
- if (a->currentFacing != targetDir)
+ if (a->_currentFacing != targetDir)
a->turn(targetDir);
else if (a->nextAnimationFrame())
remove(motionCompleted);
@@ -3224,7 +3224,7 @@ void MotionTask::twoHandedSwingAction(void) {
combatMotionType = availableSet->selectRandom();
actorAnimation = animationTypeArray[combatMotionType];
- if (a->appearance != NULL
+ if (a->_appearance != NULL
&& a->isActionAvailable(actorAnimation)) {
// Compute the number of frames in the animation before the
// actual strike
@@ -3244,7 +3244,7 @@ void MotionTask::twoHandedSwingAction(void) {
}
a->setActionPoints(
- computeTurnFrames(a->currentFacing, direction) + 10);
+ computeTurnFrames(a->_currentFacing, direction) + 10);
flags &= ~reset;
} else
@@ -3340,7 +3340,7 @@ void MotionTask::oneHandedSwingAction(void) {
else*/
{
actorAnimation = animationTypeArray[combatMotionType];
- if (a->appearance != NULL
+ if (a->_appearance != NULL
&& a->isActionAvailable(actorAnimation)) {
// Compute the number of frames in the animation before the
// actual strike
@@ -3364,7 +3364,7 @@ void MotionTask::oneHandedSwingAction(void) {
a->setActionPoints(actionCounter * 2);
a->setActionPoints(
- computeTurnFrames(a->currentFacing, direction) + 10);
+ computeTurnFrames(a->_currentFacing, direction) + 10);
flags &= ~reset;
} else
@@ -3382,7 +3382,7 @@ uint16 MotionTask::framesUntilStrike(void) {
uint16 turnFrames;
- turnFrames = (direction - ((Actor *)object)->currentFacing) & 0x7;
+ turnFrames = (direction - ((Actor *)object)->_currentFacing) & 0x7;
if (turnFrames > 4) turnFrames = 8 - turnFrames;
return turnFrames + actionCounter;
@@ -3406,7 +3406,7 @@ GameObject *MotionTask::blockingObject(Actor *thisAttacker) {
void MotionTask::fireBowAction(void) {
Actor *a = (Actor *)object;
- assert(a->leftHandObject != Nothing);
+ assert(a->_leftHandObject != Nothing);
// Initialize the bow firing motion
if (flags & reset) {
@@ -3416,7 +3416,7 @@ void MotionTask::fireBowAction(void) {
// Compute the direction to the target
direction = (targetObj->getLocation() - a->getLocation()).quickDir();
- if (a->appearance != NULL
+ if (a->_appearance != NULL
&& a->isActionAvailable(actionFireBow)) {
// Calculate the number of frames in the animation before the
// projectile is actually fired
@@ -3435,18 +3435,18 @@ void MotionTask::fireBowAction(void) {
}
a->setActionPoints(
- computeTurnFrames(a->currentFacing, direction) + 10);
+ computeTurnFrames(a->_currentFacing, direction) + 10);
- if (a->currentFacing != direction)
+ if (a->_currentFacing != direction)
a->turn(direction);
flags &= ~reset;
- } else if (a->currentFacing != direction)
+ } else if (a->_currentFacing != direction)
a->turn(direction);
else {
// If the actors appearance becomes NULL, make sure this action
// no longer depends upon the animation
- if ((flags & nextAnim) && a->appearance == NULL)
+ if ((flags & nextAnim) && a->_appearance == NULL)
flags &= ~nextAnim;
// If the action counter has reached zero, get a projectile and
@@ -3454,13 +3454,13 @@ void MotionTask::fireBowAction(void) {
if (actionCounter == 0) {
GameObject *missileWeapon;
- missileWeapon = GameObject::objectAddress(a->leftHandObject);
+ missileWeapon = GameObject::objectAddress(a->_leftHandObject);
if (missileWeapon != NULL) {
GameObject *proj;
// Ask the missile weapon's prototype to get a projectile
proj = missileWeapon->proto()->getProjectile(
- a->leftHandObject,
+ a->_leftHandObject,
a->thisID());
// Shoot the projectile
@@ -3470,9 +3470,9 @@ void MotionTask::fireBowAction(void) {
projCrossSection = proj->proto()->crossSection;
ObjectID projID;
- actorLoc.u += incDirTable[a->currentFacing].u
+ actorLoc.u += incDirTable[a->_currentFacing].u
* (actorCrossSection + projCrossSection);
- actorLoc.v += incDirTable[a->currentFacing].v
+ actorLoc.v += incDirTable[a->_currentFacing].v
* (actorCrossSection + projCrossSection);
actorLoc.z += a->proto()->height * 7 / 8;
@@ -3507,11 +3507,11 @@ void MotionTask::castSpellAction(void) {
Actor *a = (Actor *)object;
// Turn until facing the target
- if (a->currentFacing != direction)
+ if (a->_currentFacing != direction)
a->turn(direction);
else {
if (flags & reset) {
- if (a->appearance != NULL
+ if (a->_appearance != NULL
&& a->isActionAvailable(actionCastSpell)) {
// Calculate the number of frames in the animation before the
// spell is case
@@ -3534,7 +3534,7 @@ void MotionTask::castSpellAction(void) {
// If the actors appearance becomes NULL, make sure this action
// no longer depends upon the animation
- if ((flags & nextAnim) && a->appearance == NULL)
+ if ((flags & nextAnim) && a->_appearance == NULL)
flags &= ~nextAnim;
if (actionCounter == 0) {
@@ -3578,7 +3578,7 @@ void MotionTask::useWandAction(void) {
direction = (targetObj->getLocation() - a->getLocation()).quickDir();
- if (a->appearance != NULL
+ if (a->_appearance != NULL
&& a->isActionAvailable(actionUseWand)) {
actionCounter = a->animationFrames(actionUseWand, direction) - 1;
a->setAction(actionUseWand, 0);
@@ -3595,7 +3595,7 @@ void MotionTask::useWandAction(void) {
}
a->setActionPoints(
- computeTurnFrames(a->currentFacing, direction) + 10);
+ computeTurnFrames(a->_currentFacing, direction) + 10);
flags &= ~reset;
}
@@ -3613,7 +3613,7 @@ void MotionTask::twoHandedParryAction(void) {
direction = (d.attacker->getLocation() - a->getLocation()).quickDir();
- if (a->appearance != NULL
+ if (a->_appearance != NULL
&& a->isActionAvailable(actionTwoHandParry)) {
a->setAction(actionTwoHandParry, 0);
animationFrames = a->animationFrames(actionTwoHandParry, direction);
@@ -3630,7 +3630,7 @@ void MotionTask::twoHandedParryAction(void) {
}
a->setActionPoints(
- computeTurnFrames(a->currentFacing, direction)
+ computeTurnFrames(a->_currentFacing, direction)
+ animationFrames + 1);
flags &= ~reset;
@@ -3649,7 +3649,7 @@ void MotionTask::oneHandedParryAction(void) {
direction = (d.attacker->getLocation() - a->getLocation()).quickDir();
combatMotionType = oneHandedParryHigh;
- if (a->appearance != NULL
+ if (a->_appearance != NULL
&& a->isActionAvailable(actionParryHigh)) {
a->setAction(actionParryHigh, 0);
animationFrames = a->animationFrames(actionParryHigh, direction);
@@ -3666,7 +3666,7 @@ void MotionTask::oneHandedParryAction(void) {
}
a->setActionPoints(
- computeTurnFrames(a->currentFacing, direction)
+ computeTurnFrames(a->_currentFacing, direction)
+ animationFrames + 1);
flags &= ~reset;
@@ -3684,7 +3684,7 @@ void MotionTask::shieldParryAction(void) {
direction = (d.attacker->getLocation() - a->getLocation()).quickDir();
- if (a->appearance != NULL
+ if (a->_appearance != NULL
&& a->isActionAvailable(actionShieldParry)) {
a->setAction(actionShieldParry, 0);
animationFrames = a->animationFrames(actionShieldParry, direction);
@@ -3701,7 +3701,7 @@ void MotionTask::shieldParryAction(void) {
}
a->setActionPoints(
- computeTurnFrames(a->currentFacing, direction)
+ computeTurnFrames(a->_currentFacing, direction)
+ animationFrames + 1);
flags &= ~reset;
@@ -3714,7 +3714,7 @@ void MotionTask::shieldParryAction(void) {
void MotionTask::dodgeAction(void) {
Actor *a = (Actor *)object;
- MotionTask *attackerMotion = d.attacker->moveTask;
+ MotionTask *attackerMotion = d.attacker->_moveTask;
if (flags & reset) {
// If the attacker is not attacking, we're done
@@ -3729,10 +3729,10 @@ void MotionTask::dodgeAction(void) {
if (attackerMotion->framesUntilStrike() <= 2) {
int16 animationFrames;
- if (a->appearance != NULL
- && a->isActionAvailable(actionJumpUp, a->currentFacing)) {
+ if (a->_appearance != NULL
+ && a->isActionAvailable(actionJumpUp, a->_currentFacing)) {
a->setAction(actionJumpUp, 0);
- animationFrames = a->animationFrames(actionJumpUp, a->currentFacing);
+ animationFrames = a->animationFrames(actionJumpUp, a->_currentFacing);
// Set this flag to indicate that the animation is actually
// being played
@@ -3753,7 +3753,7 @@ void MotionTask::dodgeAction(void) {
} else {
// If the actors appearance becomes NULL, make sure this action
// no longer depends upon the animation
- if ((flags & nextAnim) && a->appearance == NULL)
+ if ((flags & nextAnim) && a->_appearance == NULL)
flags &= ~nextAnim;
if (flags & nextAnim) {
@@ -3782,13 +3782,13 @@ void MotionTask::acceptHitAction(void) {
StandingTileInfo sti;
int16 animationFrames;
- a->currentFacing =
+ a->_currentFacing =
(d.attacker->getWorldLocation() - a->getLocation()).quickDir();
- if (a->appearance != NULL
- && a->isActionAvailable(actionHit, a->currentFacing)) {
+ if (a->_appearance != NULL
+ && a->isActionAvailable(actionHit, a->_currentFacing)) {
a->setAction(actionHit, 0);
- animationFrames = a->animationFrames(actionHit, a->currentFacing);
+ animationFrames = a->animationFrames(actionHit, a->_currentFacing);
// Set this flag to indicate that the animation is actually
// being played
@@ -3805,7 +3805,7 @@ void MotionTask::acceptHitAction(void) {
if (g_vm->_rnd->getRandomNumber(1)) {
// Calculate the new position to knock the actor back to
- newLoc += dirTable[(a->currentFacing - 4) & 0x7];
+ newLoc += dirTable[(a->_currentFacing - 4) & 0x7];
// If the actor is not blocked, move him back
if (!checkBlocked(a, newLoc)) {
@@ -3819,7 +3819,7 @@ void MotionTask::acceptHitAction(void) {
} else {
// If the actors appearance becomes NULL, make sure this action
// no longer depends upon the animation
- if ((flags & nextAnim) && a->appearance == NULL)
+ if ((flags & nextAnim) && a->_appearance == NULL)
flags &= ~nextAnim;
if (flags & nextAnim) {
@@ -3840,15 +3840,15 @@ void MotionTask::fallDownAction(void) {
StandingTileInfo sti;
int16 animationFrames;
- a->currentFacing =
+ a->_currentFacing =
(d.attacker->getWorldLocation() - a->getLocation()).quickDir();
- if (a->appearance != NULL
- && a->isActionAvailable(actionKnockedDown, a->currentFacing)) {
+ if (a->_appearance != NULL
+ && a->isActionAvailable(actionKnockedDown, a->_currentFacing)) {
a->setAction(actionKnockedDown, 0);
animationFrames = a->animationFrames(
actionKnockedDown,
- a->currentFacing);
+ a->_currentFacing);
// Set this flag to indicate that the animation is actually
// being played
@@ -3865,7 +3865,7 @@ void MotionTask::fallDownAction(void) {
if (g_vm->_rnd->getRandomNumber(1)) {
// Calculate the new position to knock the actor back to
- newLoc += dirTable[(a->currentFacing - 4) & 0x7];
+ newLoc += dirTable[(a->_currentFacing - 4) & 0x7];
newLoc.z = tileSlopeHeight(newLoc, a, &sti);
// If the actor is not blocked, move him back
@@ -3879,7 +3879,7 @@ void MotionTask::fallDownAction(void) {
} else {
// If the actors appearance becomes NULL, make sure this action
// no longer depends upon the animation
- if ((flags & nextAnim) && a->appearance == NULL)
+ if ((flags & nextAnim) && a->_appearance == NULL)
flags &= ~nextAnim;
if (flags & nextAnim) {
@@ -3897,12 +3897,12 @@ void MotionTask::offensiveMeleeAction(void) {
Actor *a = (Actor *)object;
// Turn until facing the target
- if (a->currentFacing != direction)
+ if (a->_currentFacing != direction)
a->turn(direction);
else {
// If the actors appearance becomes NULL, make sure this action
// no longer depends upon the animation
- if ((flags & nextAnim) && a->appearance == NULL)
+ if ((flags & nextAnim) && a->_appearance == NULL)
flags &= ~nextAnim;
// If the action counter has reached zero, use the weapon on
@@ -3936,12 +3936,12 @@ void MotionTask::useMagicWeaponAction(void) {
Actor *a = (Actor *)object;
// Turn until facing the target
- if (a->currentFacing != direction)
+ if (a->_currentFacing != direction)
a->turn(direction);
else {
// If the actors appearance becomes NULL, make sure this action
// no longer depends upon the animation
- if ((flags & nextAnim) && a->appearance == NULL)
+ if ((flags & nextAnim) && a->_appearance == NULL)
flags &= ~nextAnim;
// If the action counter has reached zero, get a spell and
@@ -3989,7 +3989,7 @@ void MotionTask::useMagicWeaponAction(void) {
void MotionTask::defensiveMeleeAction(void) {
Actor *a = (Actor *)object;
- MotionTask *attackerMotion = d.attacker->moveTask;
+ MotionTask *attackerMotion = d.attacker->_moveTask;
// Determine if the blocking action has been initiated
if (!(d.defenseFlags & blocking)) {
@@ -4002,7 +4002,7 @@ void MotionTask::defensiveMeleeAction(void) {
}
// turn towards attacker
- if (a->currentFacing != direction)
+ if (a->_currentFacing != direction)
a->turn(direction);
// If the strike is about to land start the blocking motion
@@ -4011,7 +4011,7 @@ void MotionTask::defensiveMeleeAction(void) {
} else {
// If the actors appearance becomes NULL, make sure this action
// no longer depends upon the animation
- if ((flags & nextAnim) && a->appearance == NULL)
+ if ((flags & nextAnim) && a->_appearance == NULL)
flags &= ~nextAnim;
// Run through the animation frames
@@ -4084,21 +4084,21 @@ void MotionTask::updatePositions(void) {
if (mt->flags & reset) {
a->setAction(actionStand, 0);
- a->cycleCount = g_vm->_rnd->getRandomNumber(3);
+ a->_cycleCount = g_vm->_rnd->getRandomNumber(3);
mt->flags &= ~(reset | nextAnim);
}
- if (a->cycleCount == 0) {
+ if (a->_cycleCount == 0) {
a->setAction(actionTalk, 0);
mt->flags |= nextAnim;
- a->cycleCount = -1;
+ a->_cycleCount = -1;
} else if (mt->flags & nextAnim) {
if (a->nextAnimationFrame()) {
a->setAction(actionStand, 0);
- a->cycleCount = g_vm->_rnd->getRandomNumber(3);
+ a->_cycleCount = g_vm->_rnd->getRandomNumber(3);
mt->flags &= ~nextAnim;
}
} else
- a->cycleCount--;
+ a->_cycleCount--;
break;
case motionTypeLand:
@@ -4239,7 +4239,7 @@ void MotionTask::updatePositions(void) {
) {
mt->direction = (mt->o.indirectObject->getLocation()
- a->getLocation()).quickDir();
- if (a->currentFacing != mt->direction)
+ if (a->_currentFacing != mt->direction)
a->turn(mt->direction);
else {
// The actor will now be uniterruptable
@@ -4294,7 +4294,7 @@ void MotionTask::updatePositions(void) {
mt->flags &= ~reset;
}
- if (a->currentFacing != mt->direction)
+ if (a->_currentFacing != mt->direction)
a->turn(mt->direction);
else {
// The actor will now be uniterruptable
@@ -4314,7 +4314,7 @@ void MotionTask::updatePositions(void) {
mt->flags &= ~reset;
}
- if (a->currentFacing != mt->direction)
+ if (a->_currentFacing != mt->direction)
a->turn(mt->direction);
else {
// The actor will now be uniterruptable
@@ -4354,7 +4354,7 @@ void MotionTask::updatePositions(void) {
mt->flags &= ~reset;
}
- if (a->currentFacing != mt->direction)
+ if (a->_currentFacing != mt->direction)
a->turn(mt->direction);
else {
// The actor will now be uniterruptable
@@ -4372,7 +4372,7 @@ void MotionTask::updatePositions(void) {
mt->flags &= ~reset;
}
- if (a->currentFacing != mt->direction)
+ if (a->_currentFacing != mt->direction)
a->turn(mt->direction);
else {
// The actor will now be uniterruptable
@@ -4406,7 +4406,7 @@ void MotionTask::updatePositions(void) {
if (isWorld(mt->o.indirectObject->IDParent())) {
mt->direction = (mt->o.indirectObject->getLocation()
- a->getLocation()).quickDir();
- if (a->currentFacing != mt->direction)
+ if (a->_currentFacing != mt->direction)
a->turn(mt->direction);
else {
// The actor will now be uniterruptable
@@ -4444,7 +4444,7 @@ void MotionTask::updatePositions(void) {
mt->flags &= ~reset;
}
- if (a->currentFacing != mt->direction)
+ if (a->_currentFacing != mt->direction)
a->turn(mt->direction);
else {
// The actor will now be uniterruptable
@@ -4752,7 +4752,7 @@ bool checkLadder(Actor *a, const TilePoint &loc) {
if (footPrintMask & ladderMask) {
if (!(~ladderMask & 0xF000)) {
- a->currentFacing = 7;
+ a->_currentFacing = 7;
a->move(
TilePoint(
(tileLoc.u << kTileUVShift)
@@ -4761,14 +4761,14 @@ bool checkLadder(Actor *a, const TilePoint &loc) {
(tileLoc.v << kTileUVShift) + kTileUVSize / 2,
loc.z));
} else if (!(~ladderMask & 0x000F)) {
- a->currentFacing = 3;
+ a->_currentFacing = 3;
a->move(
TilePoint(
(tileLoc.u << kTileUVShift) + crossSection,
(tileLoc.v << kTileUVShift) + kTileUVSize / 2,
loc.z));
} else if (!(~ladderMask & 0x8888)) {
- a->currentFacing = 1;
+ a->_currentFacing = 1;
a->move(
TilePoint(
(tileLoc.u << kTileUVShift) + kTileUVSize / 2,
@@ -4777,7 +4777,7 @@ bool checkLadder(Actor *a, const TilePoint &loc) {
- crossSection,
loc.z));
} else {
- a->currentFacing = 3;
+ a->_currentFacing = 3;
a->move(
TilePoint(
(tileLoc.u << kTileUVShift) + kTileUVSize / 2,
diff --git a/engines/saga2/motion.h b/engines/saga2/motion.h
index 0b8aa87db0..a38ecc8172 100644
--- a/engines/saga2/motion.h
+++ b/engines/saga2/motion.h
@@ -280,7 +280,7 @@ private:
flags &= ~reset;
}
- if (a->currentFacing != direction)
+ if (a->_currentFacing != direction)
a->turn(direction);
else
remove(motionCompleted);
@@ -571,7 +571,8 @@ inline void MotionTask::walkTo(
bool run,
bool canAgitate) {
walkTo(actor, target, run, canAgitate);
- if (actor.moveTask != NULL) actor.moveTask->thread = th;
+ if (actor._moveTask != NULL)
+ actor._moveTask->thread = th;
}
inline void MotionTask::walkToDirect(
@@ -581,12 +582,14 @@ inline void MotionTask::walkToDirect(
bool run,
bool canAgitate) {
walkToDirect(actor, target, run, canAgitate);
- if (actor.moveTask != NULL) actor.moveTask->thread = th;
+ if (actor._moveTask != NULL)
+ actor._moveTask->thread = th;
}
inline void MotionTask::turn(ThreadID th, Actor &actor, Direction dir) {
turn(actor, dir);
- if (actor.moveTask != NULL) actor.moveTask->thread = th;
+ if (actor._moveTask != NULL)
+ actor._moveTask->thread = th;
}
inline void MotionTask::turnTowards(
@@ -594,12 +597,14 @@ inline void MotionTask::turnTowards(
Actor &actor,
const TilePoint &where) {
turnTowards(actor, where);
- if (actor.moveTask != NULL) actor.moveTask->thread = th;
+ if (actor._moveTask != NULL)
+ actor._moveTask->thread = th;
}
inline void MotionTask::give(ThreadID th, Actor &actor, Actor &givee) {
give(actor, givee);
- if (actor.moveTask != NULL) actor.moveTask->thread = th;
+ if (actor._moveTask != NULL)
+ actor._moveTask->thread = th;
}
/* ===================================================================== *
diff --git a/engines/saga2/objects.cpp b/engines/saga2/objects.cpp
index 9247d623f7..ad31eacb24 100644
--- a/engines/saga2/objects.cpp
+++ b/engines/saga2/objects.cpp
@@ -1028,13 +1028,13 @@ void GameObject::updateImage(ObjectID oldParentID) {
Actor *a = (Actor *)oldParent;
int i;
- if (a->leftHandObject == id)
- a->leftHandObject = Nothing;
- else if (a->rightHandObject == id)
- a->rightHandObject = Nothing;
+ if (a->_leftHandObject == id)
+ a->_leftHandObject = Nothing;
+ else if (a->_rightHandObject == id)
+ a->_rightHandObject = Nothing;
for (i = 0; i < ARMOR_COUNT; i++) {
- if (a->armorObjects[i] == id) {
+ if (a->_armorObjects[i] == id) {
a->wear(Nothing, i);
break;
}
@@ -1318,11 +1318,11 @@ void GameObject::deleteObject(void) {
Actor *a = (Actor *)objectAddress(_data.parentID);
int i;
- if (a->leftHandObject == id) a->leftHandObject = Nothing;
- if (a->rightHandObject == id) a->rightHandObject = Nothing;
+ if (a->_leftHandObject == id) a->_leftHandObject = Nothing;
+ if (a->_rightHandObject == id) a->_rightHandObject = Nothing;
- for (i = 0; i < ARRAYSIZE(a->armorObjects); i++)
- if (a->armorObjects[i] == id)
+ for (i = 0; i < ARRAYSIZE(a->_armorObjects); i++)
+ if (a->_armorObjects[i] == id)
a->wear(Nothing, i);
}
@@ -2126,7 +2126,7 @@ bool GameObject::canSenseProtaganist(SenseInfo &info, int16 range) {
if (isActor(this)) {
Actor *a = (Actor *) this;
- return sensor.check(info, a->enchantmentFlags);
+ return sensor.check(info, a->_enchantmentFlags);
}
return sensor.check(info, nonActorSenseFlags);
}
@@ -2143,7 +2143,7 @@ bool GameObject::canSenseSpecificActor(
if (isActor(this)) {
Actor *ac = (Actor *)this;
- return sensor.check(info, ac->enchantmentFlags);
+ return sensor.check(info, ac->_enchantmentFlags);
}
return sensor.check(info, nonActorSenseFlags);
}
@@ -2160,7 +2160,7 @@ bool GameObject::canSenseSpecificObject(
if (isActor(this)) {
Actor *a = (Actor *) this;
- return sensor.check(info, a->enchantmentFlags);
+ return sensor.check(info, a->_enchantmentFlags);
}
return sensor.check(info, nonActorSenseFlags);
}
@@ -2177,7 +2177,7 @@ bool GameObject::canSenseActorProperty(
if (isActor(this)) {
Actor *a = (Actor *) this;
- return sensor.check(info, a->enchantmentFlags);
+ return sensor.check(info, a->_enchantmentFlags);
}
return sensor.check(info, nonActorSenseFlags);
}
@@ -2194,7 +2194,7 @@ bool GameObject::canSenseObjectProperty(
if (isActor(this)) {
Actor *a = (Actor *) this;
- return sensor.check(info, a->enchantmentFlags);
+ return sensor.check(info, a->_enchantmentFlags);
}
return sensor.check(info, nonActorSenseFlags);
}
diff --git a/engines/saga2/objproto.cpp b/engines/saga2/objproto.cpp
index d29167a620..b98365c4ca 100644
--- a/engines/saga2/objproto.cpp
+++ b/engines/saga2/objproto.cpp
@@ -1521,8 +1521,8 @@ bool WeaponProto::isObjectBeingUsed(GameObject *obj) {
if (wielder != Nothing) {
Actor *a = (Actor *)GameObject::objectAddress(wielder);
- if (a->rightHandObject == obj->thisID()
- || a->leftHandObject == obj->thisID())
+ if (a->_rightHandObject == obj->thisID()
+ || a->_leftHandObject == obj->thisID())
return true;
}
return false;
@@ -1542,13 +1542,13 @@ bool MeleeWeaponProto::useAction(ObjectID dObj, ObjectID enactor) {
if (enactor != dObjPtr->IDParent()) return false;
- if (dObj == a->rightHandObject)
+ if (dObj == a->_rightHandObject)
a->holdInRightHand(Nothing);
else {
GameObject *leftHandObjectPtr;
- leftHandObjectPtr = a->leftHandObject != Nothing
- ? GameObject::objectAddress(a->leftHandObject)
+ leftHandObjectPtr = a->_leftHandObject != Nothing
+ ? GameObject::objectAddress(a->_leftHandObject)
: NULL;
if (dObjPtr->proto()->isTwoHanded(enactor)
@@ -1710,7 +1710,7 @@ uint8 MeleeWeaponProto::weaponRating(
// If the wielder is on screen yet does not have the attack frames
// for this weapon then this weapon is useless
- if (wielder->appearance != NULL
+ if (wielder->_appearance != NULL
&& !wielder->isActionAvailable(fightStanceAction(wielderID)))
return 0;
@@ -1748,19 +1748,19 @@ bool MeleeWeaponProto::useSlotAvailable(GameObject *obj, Actor *a) {
assert(isObject(obj) && obj->proto() == this);
assert(isActor(a));
- if (a->rightHandObject == Nothing) {
- if (a->leftHandObject != Nothing) {
- assert(isObject(a->leftHandObject));
+ if (a->_rightHandObject == Nothing) {
+ if (a->_leftHandObject != Nothing) {
+ assert(isObject(a->_leftHandObject));
GameObject *leftHandObjectPtr;
- leftHandObjectPtr = GameObject::objectAddress(a->leftHandObject);
+ leftHandObjectPtr = GameObject::objectAddress(a->_leftHandObject);
return !isTwoHanded(a->thisID())
&& !leftHandObjectPtr->proto()->isTwoHanded(a->thisID());
}
return true;
}
- assert(isObject(a->rightHandObject));
+ assert(isObject(a->_rightHandObject));
return false;
}
@@ -1854,7 +1854,7 @@ bool BowProto::useAction(ObjectID dObj, ObjectID enactor) {
// If this object is in the enactor's left hand remove it else
// place it into his left hand
- if (a->leftHandObject == dObj)
+ if (a->_leftHandObject == dObj)
a->holdInLeftHand(Nothing);
else {
a->holdInRightHand(Nothing);
@@ -1916,7 +1916,7 @@ bool BowProto::useSlotAvailable(GameObject *obj, Actor *a) {
assert(isObject(obj) && obj->proto() == this);
assert(isActor(a));
- return a->leftHandObject == Nothing && a->rightHandObject == Nothing;
+ return a->_leftHandObject == Nothing && a->_rightHandObject == Nothing;
}
//-----------------------------------------------------------------------
@@ -1935,7 +1935,7 @@ uint8 BowProto::weaponRating(
// If the wielder is on screen yet does not have the attack frames
// for this weapon then this weapon is useless
- if (wielder->appearance != NULL
+ if (wielder->_appearance != NULL
&& !wielder->isActionAvailable(fightStanceAction(wielderID)))
return 0;
@@ -1972,7 +1972,7 @@ bool WeaponWandProto::useAction(ObjectID dObj, ObjectID enactor) {
// If this object is in the enactor's left hand remove it else
// place it into his left hand
- if (a->leftHandObject == dObj)
+ if (a->_leftHandObject == dObj)
a->holdInLeftHand(Nothing);
else {
a->holdInRightHand(Nothing);
@@ -2006,7 +2006,7 @@ bool WeaponWandProto::useSlotAvailable(GameObject *obj, Actor *a) {
assert(isObject(obj) && obj->proto() == this);
assert(isActor(a));
- return a->leftHandObject == Nothing && a->rightHandObject == Nothing;
+ return a->_leftHandObject == Nothing && a->_rightHandObject == Nothing;
}
//-----------------------------------------------------------------------
@@ -2024,7 +2024,7 @@ uint8 WeaponWandProto::weaponRating(
// If the wielder is on screen yet does not have the attack frames
// for this weapon then this weapon is useless
- if (wielder->appearance != NULL
+ if (wielder->_appearance != NULL
&& !wielder->isActionAvailable(fightStanceAction(wielderID)))
return 0;
@@ -2199,7 +2199,7 @@ bool ArmorProto::isObjectBeingUsed(GameObject *obj) {
ObjectID id = obj->thisID();
for (int i = 0; i < ARMOR_COUNT; i++) {
- if (a->armorObjects[i] == id) return true;
+ if (a->_armorObjects[i] == id) return true;
}
}
return false;
@@ -2213,7 +2213,7 @@ bool ArmorProto::useSlotAvailable(GameObject *obj, Actor *a) {
assert(isObject(obj) || obj->proto() == this);
assert(isActor(a));
- return a->armorObjects[whereWearable] == Nothing;
+ return a->_armorObjects[whereWearable] == Nothing;
}
//-----------------------------------------------------------------------
@@ -2232,7 +2232,7 @@ bool ArmorProto::useAction(ObjectID dObj, ObjectID enactor) {
int16 slot = whereWearable;
- if (a->armorObjects[slot] == dObj)
+ if (a->_armorObjects[slot] == dObj)
a->wear(Nothing, slot);
else
a->wear(dObj, slot);
@@ -2260,16 +2260,16 @@ bool ShieldProto::useAction(ObjectID dObj, ObjectID enactor) {
if (enactor != dObjPtr->IDParent()) return false;
- if (a->rightHandObject != Nothing) {
- assert(isObject(a->rightHandObject));
+ if (a->_rightHandObject != Nothing) {
+ assert(isObject(a->_rightHandObject));
GameObject *rightHandObjectPtr =
- GameObject::objectAddress(a->rightHandObject);
+ GameObject::objectAddress(a->_rightHandObject);
if (rightHandObjectPtr->proto()->isTwoHanded(enactor))
return false;
}
- a->holdInLeftHand(dObj != a->leftHandObject ? dObj : Nothing);
+ a->holdInLeftHand(dObj != a->_leftHandObject ? dObj : Nothing);
return true;
}
@@ -2326,8 +2326,8 @@ bool ShieldProto::isObjectBeingUsed(GameObject *obj) {
if (wielder != Nothing) {
Actor *a = (Actor *)GameObject::objectAddress(wielder);
- if (a->rightHandObject == obj->thisID()
- || a->leftHandObject == obj->thisID())
+ if (a->_rightHandObject == obj->thisID()
+ || a->_leftHandObject == obj->thisID())
return true;
}
return false;
@@ -2341,13 +2341,13 @@ bool ShieldProto::useSlotAvailable(GameObject *obj, Actor *a) {
assert(isObject(obj) || obj->proto() == this);
assert(isActor(a));
- if (a->leftHandObject == Nothing) {
- if (a->rightHandObject != Nothing) {
- assert(isObject(a->rightHandObject));
+ if (a->_leftHandObject == Nothing) {
+ if (a->_rightHandObject != Nothing) {
+ assert(isObject(a->_rightHandObject));
GameObject *rightHandObjectPtr;
- rightHandObjectPtr = GameObject::objectAddress(a->rightHandObject);
+ rightHandObjectPtr = GameObject::objectAddress(a->_rightHandObject);
return !rightHandObjectPtr->proto()->isTwoHanded(a->thisID());
}
diff --git a/engines/saga2/path.cpp b/engines/saga2/path.cpp
index 2772511547..abc22933dc 100644
--- a/engines/saga2/path.cpp
+++ b/engines/saga2/path.cpp
@@ -1389,7 +1389,7 @@ static void push(
PathRequest::PathRequest(Actor *a, int16 howSmart) {
actor = a;
smartness = howSmart;
- mTask = actor->moveTask;
+ mTask = actor->_moveTask;
flags = mTask->flags & MotionTask::requestRun ? run : 0;
if (path == nullptr)
@@ -1994,7 +1994,7 @@ PathResult PathRequest::findPath(void) {
+ dir
- (qi.direction != dirInvalid
? qi.direction
- : actor->currentFacing)];
+ : actor->_currentFacing)];
#if VISUAL1
TPLine(centerPt, testPt);
diff --git a/engines/saga2/player.cpp b/engines/saga2/player.cpp
index c9efe4dbba..7f0357572b 100644
--- a/engines/saga2/player.cpp
+++ b/engines/saga2/player.cpp
@@ -79,7 +79,7 @@ void PlayerActor::resolveBanding(void) {
Actor *centerActor_ = getCenterActor();
// if already following, tell the actor to cease and desist
- if (follower->leader) {
+ if (follower->_leader) {
follower->disband();
}
@@ -103,15 +103,15 @@ void PlayerActor::recalcPortraitType(void) {
if (a->isDead())
pType = kPortraitDead;
- else if (a->enchantmentFlags & (1 << actorAsleep))
+ else if (a->_enchantmentFlags & (1 << actorAsleep))
pType = kPortraitAsleep;
- else if (stats.vitality >= a->effectiveStats.vitality * 3)
+ else if (stats.vitality >= a->_effectiveStats.vitality * 3)
pType = kPortraitWounded;
- else if (a->enchantmentFlags & ((1 << actorDiseased) | (1 << actorPoisoned)))
+ else if (a->_enchantmentFlags & ((1 << actorDiseased) | (1 << actorPoisoned)))
pType = kPortraitSick;
- else if (stats.vitality * 2 > a->effectiveStats.vitality * 3)
+ else if (stats.vitality * 2 > a->_effectiveStats.vitality * 3)
pType = kPortraitOuch;
- else if (a->enchantmentFlags & ((1 << actorParalyzed) | (1 << actorFear) | (1 << actorBlind)))
+ else if (a->_enchantmentFlags & ((1 << actorParalyzed) | (1 << actorFear) | (1 << actorBlind)))
pType = kPortraitConfused;
else if (isAggressive())
pType = kPortraitAngry;
@@ -135,7 +135,7 @@ void PlayerActor::AttribUpdate(void) {
Actor *actor = getActor();
// get the effective stats for this player actor
- ActorAttributes *effStats = &actor->effectiveStats;
+ ActorAttributes *effStats = &actor->_effectiveStats;
for (int16 i = 0; i < numSkills; i++) {
// go through each skill and update as needed
@@ -185,12 +185,12 @@ void PlayerActor::manaUpdate(void) {
Actor *actor = getActor();
// get indirections for each of the effective mana types
- int16 *effectiveMana[numManas] = { &actor->effectiveStats.redMana,
- &actor->effectiveStats.orangeMana,
- &actor->effectiveStats.yellowMana,
- &actor->effectiveStats.greenMana,
- &actor->effectiveStats.blueMana,
- &actor->effectiveStats.violetMana
+ int16 *effectiveMana[numManas] = { &actor->_effectiveStats.redMana,
+ &actor->_effectiveStats.orangeMana,
+ &actor->_effectiveStats.yellowMana,
+ &actor->_effectiveStats.greenMana,
+ &actor->_effectiveStats.blueMana,
+ &actor->_effectiveStats.violetMana
};
// get indirections for each of the base mana types
@@ -472,7 +472,7 @@ ActorAttributes *PlayerActor::getEffStats(void) {
Actor *actor = getActor();
// get the effective stats for this player actor
- ActorAttributes *effStats = &actor->effectiveStats;
+ ActorAttributes *effStats = &actor->_effectiveStats;
// valid?
assert(effStats);
@@ -556,7 +556,7 @@ void setCenterActor(PlayerActorID newCenter) {
getCenterActor()->setFightStance(false);
// get rid of any following assignments the center actor might have
- if (a->leader) {
+ if (a->_leader) {
a->disband();
}
@@ -567,10 +567,10 @@ void setCenterActor(PlayerActorID newCenter) {
g_vm->_containerList->setPlayerNum(newCenter);
setEnchantmentDisplay();
- if (a->curTask != NULL) {
- a->curTask->abortTask();
- delete a->curTask;
- a->curTask = NULL;
+ if (a->_curTask != NULL) {
+ a->_curTask->abortTask();
+ delete a->_curTask;
+ a->_curTask = NULL;
}
// Set the new centers fight stance based upon his aggression state
@@ -589,8 +589,8 @@ void setCenterActor(PlayerActorID newCenter) {
// Set a new center actor based upon an Actor address
void setCenterActor(Actor *newCenter) {
- assert(newCenter->disposition >= dispositionPlayer);
- setCenterActor(newCenter->disposition - dispositionPlayer);
+ assert(newCenter->_disposition >= dispositionPlayer);
+ setCenterActor(newCenter->_disposition - dispositionPlayer);
}
//-----------------------------------------------------------------------
@@ -674,7 +674,7 @@ void autoAdjustAggression(void) {
a = (Actor *)obj;
- if (a->disposition == dispositionEnemy) {
+ if (a->_disposition == dispositionEnemy) {
enemiesPresent = true;
break;
}
@@ -757,8 +757,8 @@ int16 getPortraitType(PlayerActorID id) {
// Given an actor, returns the corresponding player Actor ID
bool actorToPlayerID(Actor *a, PlayerActorID &result) {
- if (a->disposition >= dispositionPlayer) {
- result = a->disposition - dispositionPlayer;
+ if (a->_disposition >= dispositionPlayer) {
+ result = a->_disposition - dispositionPlayer;
return true;
}
@@ -770,8 +770,8 @@ bool actorIDToPlayerID(ObjectID id, PlayerActorID &result) {
Actor *a = (Actor *)GameObject::objectAddress(id);
- if (a->disposition >= dispositionPlayer) {
- result = a->disposition - dispositionPlayer;
+ if (a->_disposition >= dispositionPlayer) {
+ result = a->_disposition - dispositionPlayer;
return true;
}
@@ -817,7 +817,8 @@ void transportCenterBand(const Location &loc) {
LivingPlayerActorIterator iter;
center->move(loc);
- if (center->moveTask != NULL) center->moveTask->finishWalk();
+ if (center->_moveTask != NULL)
+ center->_moveTask->finishWalk();
for (player = iter.first();
player != NULL;
@@ -843,7 +844,8 @@ void transportCenterBand(const Location &loc) {
if (dest != Nowhere) {
a->move(Location(dest, loc.context));
- if (a->moveTask != NULL) a->moveTask->finishWalk();
+ if (a->_moveTask != NULL)
+ a->_moveTask->finishWalk();
player->resolveBanding();
}
}
@@ -925,7 +927,7 @@ void initPlayerActors(void) {
// Set the actor's disposition field to reflect that that
// actor is a player actor
- a->disposition = dispositionPlayer + i;
+ a->_disposition = dispositionPlayer + i;
// Turn on banding for player actors
setBanded(i, true);
diff --git a/engines/saga2/sagafunc.cpp b/engines/saga2/sagafunc.cpp
index 4265d0081d..4a9ef680ff 100644
--- a/engines/saga2/sagafunc.cpp
+++ b/engines/saga2/sagafunc.cpp
@@ -182,7 +182,7 @@ int16 scriptActorMove(int16 *args) {
if (thisThread->argCount > 3 && isActor(obj)) {
Actor *a = (Actor *)obj;
- a->currentFacing = args[3];
+ a->_currentFacing = args[3];
}
return 0;
@@ -216,7 +216,7 @@ int16 scriptActorMoveRel(int16 *args) {
if (thisThread->argCount > 3 && isActor(obj)) {
Actor *a = (Actor *)obj;
- a->currentFacing = args[3];
+ a->_currentFacing = args[3];
}
return 0;
@@ -258,7 +258,7 @@ int16 scriptActorTransfer(int16 *args) {
if (thisThread->argCount > 4 && isActor(obj)) {
Actor *a = (Actor *)obj;
- a->currentFacing = args[4];
+ a->_currentFacing = args[4];
}
return 0;
@@ -331,7 +331,7 @@ int16 scriptActorSetProto(int16 *args) {
GameObject *obj = ((ObjectData *)thisThread->thisObject)->obj;
int16 oldProto = obj->getProtoNum();
- if (isActor(obj) && (((Actor *)obj)->flags & Actor::temporary)) {
+ if (isActor(obj) && (((Actor *)obj)->_flags & Actor::temporary)) {
decTempActorCount(oldProto);
incTempActorCount(args[0]);
}
@@ -1123,7 +1123,7 @@ int16 scriptActorGetScratchVar(int16 *args) {
if (isActor(((ObjectData *)thisThread->thisObject)->obj)) {
Actor *a = (Actor *)((ObjectData *)thisThread->thisObject)->obj;
- return a->scriptVar[args[0]];
+ return a->_scriptVar[args[0]];
}
return 0;
@@ -1137,9 +1137,9 @@ int16 scriptActorSetScratchVar(int16 *args) {
OBJLOG(SetScratchVar);
if (isActor(((ObjectData *)thisThread->thisObject)->obj)) {
Actor *a = (Actor *)((ObjectData *)thisThread->thisObject)->obj;
- int16 oldVal = a->scriptVar[args[0]];
+ int16 oldVal = a->_scriptVar[args[0]];
- a->scriptVar[args[0]] = args[1];
+ a->_scriptVar[args[0]] = args[1];
return oldVal;
}
@@ -1410,7 +1410,7 @@ int16 scriptActorGetSchedule(int16 *args) {
if (isActor(((ObjectData *)thisThread->thisObject)->obj)) {
Actor *a = (Actor *)((ObjectData *)thisThread->thisObject)->obj;
- return a->schedule;
+ return a->_schedule;
}
return 0;
@@ -1424,9 +1424,9 @@ int16 scriptActorSetSchedule(int16 *args) {
OBJLOG(SetSchedule);
if (isActor(((ObjectData *)thisThread->thisObject)->obj)) {
Actor *a = (Actor *)((ObjectData *)thisThread->thisObject)->obj;
- uint16 oldSchedule = a->schedule;
+ uint16 oldSchedule = a->_schedule;
- a->schedule = (uint16)args[0];
+ a->_schedule = (uint16)args[0];
if (a->getAssignment() != NULL)
delete a->getAssignment();
@@ -1543,9 +1543,9 @@ int16 scriptActorFace(int16 *args) {
if (isActor(((ObjectData *)thisThread->thisObject)->obj)) {
Actor *a = (Actor *)((ObjectData *)thisThread->thisObject)->obj;
- oldFacing = a->currentFacing;
+ oldFacing = a->_currentFacing;
- a->currentFacing = args[0] & 7;
+ a->_currentFacing = args[0] & 7;
}
return oldFacing;
@@ -1565,9 +1565,9 @@ int16 scriptActorFaceTowards(int16 *args) {
Actor *a = (Actor *)((ObjectData *)thisThread->thisObject)->obj;
- oldFacing = a->currentFacing;
+ oldFacing = a->_currentFacing;
- a->currentFacing =
+ a->_currentFacing =
(GameObject::objectAddress(args[0])->getLocation()
- a->getLocation()).quickDir();
}
@@ -1941,7 +1941,7 @@ int16 scriptActorGetLeader(int16 *) {
if (isActor(((ObjectData *)thisThread->thisObject)->obj)) {
Actor *a = (Actor *)((ObjectData *)thisThread->thisObject)->obj;
- return a->leader != NULL ? a->leader->thisID() : Nothing;
+ return a->_leader != NULL ? a->_leader->thisID() : Nothing;
}
return 0;
@@ -1956,7 +1956,7 @@ int16 scriptActorNumFollowers(int16 *) {
if (isActor(((ObjectData *)thisThread->thisObject)->obj)) {
Actor *a = (Actor *)((ObjectData *)thisThread->thisObject)->obj;
- return a->followers != NULL ? a->followers->size() : 0;
+ return a->_followers != NULL ? a->_followers->size() : 0;
}
return 0;
@@ -1971,10 +1971,10 @@ int16 scriptActorGetFollower(int16 *args) {
if (isActor(((ObjectData *)thisThread->thisObject)->obj)) {
Actor *a = (Actor *)((ObjectData *)thisThread->thisObject)->obj;
- assert(a->followers != NULL);
- assert(args[0] < a->followers->size());
+ assert(a->_followers != NULL);
+ assert(args[0] < a->_followers->size());
- return (*a->followers)[args[0]]->thisID();
+ return (*a->_followers)[args[0]]->thisID();
}
return 0;
diff --git a/engines/saga2/sensor.cpp b/engines/saga2/sensor.cpp
index 7a2a996aef..5e71d47c7f 100644
--- a/engines/saga2/sensor.cpp
+++ b/engines/saga2/sensor.cpp
@@ -157,7 +157,7 @@ void checkSensors(void) {
uint32 sFlags = nonActorSenseFlags;
if (isActor(senseobj)) {
Actor *a = (Actor *)senseobj;
- sFlags = a->enchantmentFlags;
+ sFlags = a->_enchantmentFlags;
}
if (sensor->check(info, sFlags)) {
diff --git a/engines/saga2/speech.cpp b/engines/saga2/speech.cpp
index 1429abca67..1458493fd8 100644
--- a/engines/saga2/speech.cpp
+++ b/engines/saga2/speech.cpp
@@ -531,7 +531,8 @@ void Speech::dispose(void) {
if (!(speechFlags & spNoAnimate) && isActor(objID)) {
Actor *a = (Actor *)GameObject::objectAddress(objID);
- if (a->moveTask) a->moveTask->finishTalking();
+ if (a->_moveTask)
+ a->_moveTask->finishTalking();
}
} else wakeUpThread(thread, 0);
@@ -1004,10 +1005,10 @@ Speech *SpeechTaskList::newTask(ObjectID id, uint16 flags) {
// color for this particular color scheme; else use a
// default color.
if (a == getCenterActor()) sp->penColor = 3 + 9 /* 1 */;
- else if (a->appearance
- && a->appearance->schemeList) {
+ else if (a->_appearance
+ && a->_appearance->schemeList) {
sp->penColor =
- a->appearance->schemeList->_schemes[a->colorScheme]->speechColor + 9;
+ a->_appearance->schemeList->_schemes[a->_colorScheme]->speechColor + 9;
} else sp->penColor = 4 + 9;
} else {
sp->penColor = 4 + 9;
diff --git a/engines/saga2/task.cpp b/engines/saga2/task.cpp
index 25f5acd26c..553faf38c0 100644
--- a/engines/saga2/task.cpp
+++ b/engines/saga2/task.cpp
@@ -193,7 +193,7 @@ void TaskStackList::read(Common::InSaveFile *in) {
ts->read(in);
// Plug this TaskStack into the Actor
- ts->getActor()->curTask = ts;
+ ts->getActor()->_curTask = ts;
}
}
@@ -824,7 +824,7 @@ int16 WanderTask::getType(void) const {
void WanderTask::abortTask(void) {
// if the actor has a wander motion, abort it
- MotionTask *actorMotion = stack->getActor()->moveTask;
+ MotionTask *actorMotion = stack->getActor()->_moveTask;
if (actorMotion && actorMotion->isWander()) actorMotion->finishWalk();
}
@@ -861,7 +861,7 @@ bool WanderTask::operator == (const Task &t) const {
// Update function used when task is not paused
TaskResult WanderTask::handleWander(void) {
- MotionTask *actorMotion = stack->getActor()->moveTask;
+ MotionTask *actorMotion = stack->getActor()->_moveTask;
// If the actor is not already wandering, start a wander motion
// task
@@ -980,7 +980,7 @@ void TetheredWanderTask::abortTask(void) {
delete gotoTether;
gotoTether = NULL;
} else {
- MotionTask *actorMotion = stack->getActor()->moveTask;
+ MotionTask *actorMotion = stack->getActor()->_moveTask;
// if the actor has a tethered wander motion, abort it
if (actorMotion && actorMotion->isTethered())
@@ -1025,7 +1025,7 @@ TaskResult TetheredWanderTask::handleWander(void) {
bool startWander = false;
TileRegion motionTether;
- MotionTask *actorMotion = a->moveTask;
+ MotionTask *actorMotion = a->_moveTask;
if (actorMotion) {
TileRegion motionTeth = actorMotion->getTether();
@@ -1134,7 +1134,7 @@ void GotoTask::abortTask(void) {
delete wander;
wander = NULL;
} else {
- MotionTask *actorMotion = stack->getActor()->moveTask;
+ MotionTask *actorMotion = stack->getActor()->_moveTask;
if (actorMotion && actorMotion->isWalk()) actorMotion->finishWalk();
}
@@ -1178,7 +1178,7 @@ TaskResult GotoTask::update(void) {
// Determine if there is aready a motion task, and if so,
// wether or not it needs to be modified.
- MotionTask *actorMotion = a->moveTask;
+ MotionTask *actorMotion = a->_moveTask;
TilePoint actorLoc = a->getLocation();
if (actorMotion != NULL && actorMotion->isWalkToDest()) {
@@ -1782,7 +1782,7 @@ TaskResult GoAwayFromTask::update(void) {
dest.v = actorLoc.v + ((int32)repulsionVector.v * 64 / repulsionDist);
dest.z = actorLoc.z;
} else
- dest = actorLoc + dirTable_[a->currentFacing];
+ dest = actorLoc + dirTable_[a->_currentFacing];
if (goTask != NULL) {
if (goTask->getTarget() != dest)
@@ -2063,7 +2063,7 @@ TaskResult HuntTask::evaluate(void) {
TaskResult HuntTask::update(void) {
Actor *a = stack->getActor();
- if (a->moveTask && a->moveTask->isPrivledged()) return taskNotDone;
+ if (a->_moveTask && a->_moveTask->isPrivledged()) return taskNotDone;
// Reevaluate the target
evaluateTarget();
@@ -2975,8 +2975,8 @@ HuntToKillTask::HuntToKillTask(
debugC(2, kDebugTasks, " - HuntToKillTask");
Actor *a = stack->getActor();
- if (isActor(a->currentTarget))
- currentTarget = (Actor *)a->currentTarget;
+ if (isActor(a->_currentTarget))
+ currentTarget = (Actor *)a->_currentTarget;
a->setFightStance(true);
}
@@ -3039,7 +3039,7 @@ void HuntToKillTask::abortTask(void) {
Actor *a = stack->getActor();
- a->flags &= ~Actor::specialAttack;
+ a->_flags &= ~Actor::specialAttack;
a->setFightStance(false);
}
@@ -3048,7 +3048,7 @@ void HuntToKillTask::abortTask(void) {
TaskResult HuntToKillTask::update(void) {
if (specialAttackCtr == 0) {
- stack->getActor()->flags |= Actor::specialAttack;
+ stack->getActor()->_flags |= Actor::specialAttack;
// A little hack to make monsters with 99 spellcraft cast spells more often
if (stack->getActor()->getStats()->spellcraft >= 99)
specialAttackCtr = 3;
@@ -3204,7 +3204,7 @@ void HuntToKillTask::evaluateTarget(void) {
// action currently taking place
if (atTarget()) atTargetabortTask();
currentTarget = bestTarget;
- a->currentTarget = currentTarget;
+ a->_currentTarget = currentTarget;
}
flags |= evalWeapon;
@@ -3434,9 +3434,9 @@ TaskResult HuntToGiveTask::atTargetUpdate(void) {
bool BandTask::BandingRepulsorIterator::first(
TilePoint &repulsorVector,
int16 &repulsorStrength) {
- assert(a->leader != NULL && a->leader->followers != NULL);
+ assert(a->_leader != NULL && a->_leader->_followers != NULL);
- band = a->leader->followers;
+ band = a->_leader->_followers;
bandIndex = 0;
while (bandIndex < band->size()) {
@@ -3460,8 +3460,8 @@ bool BandTask::BandingRepulsorIterator::first(
bool BandTask::BandingRepulsorIterator::next(
TilePoint &repulsorVector,
int16 &repulsorStrength) {
- assert(a->leader != NULL && a->leader->followers != NULL);
- assert(band == a->leader->followers);
+ assert(a->_leader != NULL && a->_leader->_followers != NULL);
+ assert(band == a->_leader->_followers);
assert(bandIndex < band->size());
bandIndex++;
@@ -3567,7 +3567,7 @@ bool BandTask::operator == (const Task &t) const {
void BandTask::evaluateTarget(void) {
if (targetEvaluateCtr == 0) {
- Actor *leader = stack->getActor()->leader;
+ Actor *leader = stack->getActor()->_leader;
TilePoint actorLoc = stack->getActor()->getLocation(),
movementVector;
TilePoint repulsorVector;
@@ -3719,7 +3719,7 @@ TaskResult BandTask::atTargetUpdate(void) {
if (attend != NULL)
attend->update();
else {
- attend = new AttendTask(stack, a->leader);
+ attend = new AttendTask(stack, a->_leader);
if (attend != NULL)
attend->update();
}
@@ -4107,7 +4107,7 @@ int16 AttendTask::getType(void) const {
//----------------------------------------------------------------------
void AttendTask::abortTask(void) {
- MotionTask *actorMotion = stack->getActor()->moveTask;
+ MotionTask *actorMotion = stack->getActor()->_moveTask;
// Determine if we need to abort the actor motion
if (actorMotion != NULL && actorMotion->isTurn())
@@ -4128,9 +4128,9 @@ TaskResult AttendTask::update(void) {
TilePoint attendLoc = obj->getWorldLocation();
// Determine if we are facing the object
- if (a->currentFacing != (attendLoc - a->getLocation()).quickDir()) {
+ if (a->_currentFacing != (attendLoc - a->getLocation()).quickDir()) {
// If not, turn
- if (!a->moveTask || !a->moveTask->isTurn())
+ if (!a->_moveTask || !a->_moveTask->isTurn())
MotionTask::turnTowards(*a, attendLoc);
}
diff --git a/engines/saga2/task.h b/engines/saga2/task.h
index a47499c398..c6d862fb89 100644
--- a/engines/saga2/task.h
+++ b/engines/saga2/task.h
@@ -1643,7 +1643,7 @@ public:
// Destructor
~TaskStack(void) {
if (actor)
- actor->curTask = nullptr;
+ actor->_curTask = nullptr;
deleteTaskStack(this);
}
diff --git a/engines/saga2/tilemode.cpp b/engines/saga2/tilemode.cpp
index 7a9bfb108a..dc8a4c7e1f 100644
--- a/engines/saga2/tilemode.cpp
+++ b/engines/saga2/tilemode.cpp
@@ -365,7 +365,7 @@ bool areThereActiveEnemies(void) {
for (iter.first(&obj); obj != NULL; iter.next(&obj)) {
if (isActor(obj)
&& !((Actor *)obj)->isDead()
- && ((Actor *)obj)->disposition == dispositionEnemy)
+ && ((Actor *)obj)->_disposition == dispositionEnemy)
return true;
}
@@ -401,8 +401,8 @@ void CheckCombatMood(void) {
for (iter8.first(&obj); obj != NULL; iter8.next(&obj)) {
if (isActor(obj)
&& !((Actor *)obj)->isDead()
- && ((Actor *)obj)->disposition == dispositionEnemy) {
- if (agress || !(((Actor *)obj)->flags & Actor::afraid)) {
+ && ((Actor *)obj)->_disposition == dispositionEnemy) {
+ if (agress || !(((Actor *)obj)->_flags & Actor::afraid)) {
incrementActiveFaction((Actor *) obj);
wasHostile = true;
}
@@ -578,7 +578,7 @@ static void evalMouseState(void) {
if (g_vm->_mouseInfo->getIntent() == GrabInfo::WalkTo) {
if (g_vm->_mouseInfo->getDoable()
&& !navigationDelayed) {
- MotionTask *mt = a->moveTask;
+ MotionTask *mt = a->_moveTask;
if (mt == NULL || !mt->isWalk()) {
navigateDirect(walkToPos, runFlag);
@@ -1262,8 +1262,8 @@ static APPFUNC(cmdClickTileMap) {
if (g_vm->_mouseInfo->getIntent() == GrabInfo::WalkTo) {
Actor *a = getCenterActor();
- if (a->moveTask && a->moveTask->isWalk())
- a->moveTask->finishWalk();
+ if (a->_moveTask && a->_moveTask->isWalk())
+ a->_moveTask->finishWalk();
}
navigationDelayed = false;
} else {
@@ -1359,7 +1359,7 @@ void navigatePath(TilePoint pick) {
if (a) {
if (a->isMoving())
// if motion task already exists, change the target
- a->moveTask->changeTarget(pick);
+ a->_moveTask->changeTarget(pick);
else
// else create a new motion task
MotionTask::walkTo(*a, pick, false, false);
More information about the Scummvm-git-logs
mailing list