SAGA2: Rename enums in effects.h

This commit is contained in:
Eugene Sandulenko 2022-10-27 14:35:54 +02:00
parent 32b75a6524
commit 39032c3743
No known key found for this signature in database
GPG Key ID: 014D387312D34F08
21 changed files with 365 additions and 365 deletions

View File

@ -157,7 +157,7 @@ bool ActorProto::openAction(ObjectID dObj, ObjectID) {
cn = CreateContainerNode(dObj, false, openMindType);
cn->markForShow(); // Deferred open
dObjPtr->_data.objectFlags |= objectOpen; // Set open bit;
dObjPtr->_data.objectFlags |= kObjectOpen; // Set open bit;
return true;
}
@ -177,7 +177,7 @@ bool ActorProto::closeAction(ObjectID dObj, ObjectID) {
cn->markForDelete();
// Clear open bit
dObjPtr->_data.objectFlags &= ~objectOpen;
dObjPtr->_data.objectFlags &= ~kObjectOpen;
return true;
}
@ -463,7 +463,7 @@ bool ActorProto::acceptHealingAction(
int16 maxVitality = (a->getBaseStats())->vitality;
PlayerActorID pID;
if (vitality > 0 && !a->hasEffect(actorDiseased)) {
if (vitality > 0 && !a->hasEffect(kActorDiseased)) {
// If we've just lost all vitality, we're dead, else make a
// morale check
@ -1506,7 +1506,7 @@ void Actor::deleteActor() {
}
// Place in limbo
if (!(_data.objectFlags & objectNoRecycle)) {
if (!(_data.objectFlags & kObjectNoRecycle)) {
append(ActorLimbo);
actorLimboCount++;
}
@ -1783,9 +1783,9 @@ bool Actor::inUseRange(const TilePoint &tp, GameObject *obj) {
bool Actor::isImmobile() {
return isDead()
|| hasEffect(actorImmobile)
|| hasEffect(actorAsleep)
|| hasEffect(actorParalyzed);
|| hasEffect(kActorImmobile)
|| hasEffect(kActorAsleep)
|| hasEffect(kActorParalyzed);
}
//-----------------------------------------------------------------------
@ -2443,7 +2443,7 @@ void Actor::evaluateNeeds() {
} else {
if (_disposition == kDispositionEnemy
&& _appearance != nullptr
&& !hasEffect(actorNotDefenseless)) {
&& !hasEffect(kActorNotDefenseless)) {
GameObject *obj;
bool foundWeapon = false;
ContainerIterator iter(this);
@ -2467,7 +2467,7 @@ void Actor::evaluateNeeds() {
_flags |= kAFAfraid;
}
if (_flags & kAFAfraid || hasEffect(actorFear) || hasEffect(actorRepelUndead)) {
if (_flags & kAFAfraid || hasEffect(kActorFear) || hasEffect(kActorRepelUndead)) {
setGoal(kActorGoalPreserveSelf);
} else if (_leader != nullptr && inBandingRange()) {
setGoal(_leader->evaluateFollowerNeeds(this));
@ -2743,15 +2743,15 @@ void Actor::handleDamageTaken(uint8 damage) {
if (offensiveObject() == this
&& !isActionAvailable(kActionSwingHigh)
&& !isActionAvailable(kActionTwoHandSwingHigh)
&& !hasEffect(actorNotDefenseless)) {
&& !hasEffect(kActorNotDefenseless)) {
_flags |= kAFAfraid;
return;
}
if (combatBehavior != kBehaviorHungry
&& (_flags & kAFTemporary)
&& !hasEffect(actorFear)
&& !hasEffect(actorRepelUndead)) {
&& !hasEffect(kActorFear)
&& !hasEffect(kActorRepelUndead)) {
if (_flags & kAFAfraid) {
// Let's give monsters a small chance of regaining their courage
if ((uint16)g_vm->_rnd->getRandomNumber(0xffff) <= 0x3fff)

View File

@ -463,9 +463,9 @@ bool Console::cmdInvisibility(int argc, const char **argv) {
for (ObjectID id = ActorBaseID; id < ActorBaseID + kPlayerActors; ++id) {
Actor *p = (Actor *)GameObject::objectAddress(id);
if (inv)
p->setEffect(actorInvisible, true);
p->setEffect(kActorInvisible, true);
else
p->setEffect(actorInvisible, false);
p->setEffect(kActorInvisible, false);
}
}

View File

@ -1533,7 +1533,7 @@ void ContainerManager::doDeferredActions() {
if (obj->world() != world
|| (obj->getWorldLocation() - tp).quickHDistance() > kMaxOpenDistance) {
// Close object image and window (silently)
obj->setFlags(0, objectOpen);
obj->setFlags(0, kObjectOpen);
delete n;
continue;
}

View File

@ -520,9 +520,9 @@ void DisplayNode::drawObject() {
return;
}
if (a->hasEffect(actorInvisible)) {
if (a->hasEffect(kActorInvisible)) {
if (!isPlayerActor(a)
&& !(getCenterActor()->hasEffect(actorSeeInvis))) {
&& !(getCenterActor()->hasEffect(kActorSeeInvis))) {
_hitBox.width = -1;
_hitBox.height = -1;
return;
@ -998,7 +998,7 @@ void Effectron::drawEffect() {
1,
drawPos,
objCoords,
((obscured) && //objectFlags & GameObject::objectObscured ) &&
((obscured) && //objectFlags & GameObject::kObjectObscured ) &&
0
? sprFXGhosted : sprFXTerrainMask));

View File

@ -109,17 +109,17 @@ void ProtoDamage::implement(GameObject *cst, SpellTarget *trg, int8 deltaDamage)
int16 ProtoDrainage::currentLevel(Actor *a, effectDrainsTypes edt) {
switch (edt) {
case drainsManaRed:
case drainsManaOrange:
case drainsManaYellow:
case drainsManaGreen:
case drainsManaBlue:
case drainsManaViolet:
return (&a->_effectiveStats.redMana)[edt - drainsManaRed];
case kDrainsManaRed:
case kDrainsManaOrange:
case kDrainsManaYellow:
case kDrainsManaGreen:
case kDrainsManaBlue:
case kDrainsManaViolet:
return (&a->_effectiveStats.redMana)[edt - kDrainsManaRed];
case drainsLifeLevel:
case kDrainsLifeLevel:
return (a->getBaseStats())->vitality;
case drainsVitality:
case kDrainsVitality:
return a->_effectiveStats.vitality;
default:
return 0;
@ -128,14 +128,14 @@ int16 ProtoDrainage::currentLevel(Actor *a, effectDrainsTypes edt) {
void ProtoDrainage::drainLevel(GameObject *cst, Actor *a, effectDrainsTypes edt, int16 amt) {
switch (edt) {
case drainsManaRed:
case drainsManaOrange:
case drainsManaYellow:
case drainsManaGreen:
case drainsManaBlue:
case drainsManaViolet:
case kDrainsManaRed:
case kDrainsManaOrange:
case kDrainsManaYellow:
case kDrainsManaGreen:
case kDrainsManaBlue:
case kDrainsManaViolet:
{
ActorManaID aType = (ActorManaID)(edt + (manaIDRed - drainsManaRed));
ActorManaID aType = (ActorManaID)(edt + (manaIDRed - kDrainsManaRed));
(&a->_effectiveStats.redMana)[aType] =
clamp(
0,
@ -143,14 +143,14 @@ void ProtoDrainage::drainLevel(GameObject *cst, Actor *a, effectDrainsTypes edt,
(&(a->getBaseStats())->redMana)[aType]);
}
break;
case drainsLifeLevel:
case kDrainsLifeLevel:
{
int16 &maxVit = (a->getBaseStats())->vitality;
maxVit = clamp(0, maxVit - amt, absoluteMaximumVitality);
a->acceptDamage(cst->thisID(), amt > 0 ? 1 : -1, kDamageOther);
}
break;
case drainsVitality:
case kDrainsVitality:
a->acceptDamage(cst->thisID(), amt, kDamageOther);
break;
default:
@ -188,7 +188,7 @@ void ProtoDrainage::implement(GameObject *cst, SpellTarget *trg, int8) {
if (!isActor(target))
return;
a = (Actor *) target;
if (a->hasEffect(actorNoDrain))
if (a->hasEffect(kActorNoDrain))
return;
if (totalDamage > 0 && target->makeSavingThrow())
@ -229,7 +229,7 @@ void ProtoEnchantment::implement(GameObject *cst, SpellTarget *trg, int8) {
}
if (((Actor *)(trg->getObject()))->hasEffect(actorNoEnchant) &&
if (((Actor *)(trg->getObject()))->hasEffect(kActorNoEnchant) &&
isHarmful(_enchID))
return;
if (canFail() && realSavingThrow((Actor *)(trg->getObject())))
@ -247,11 +247,11 @@ void ProtoEnchantment::implement(GameObject *cst, SpellTarget *trg, int8) {
void ProtoTAGEffect::implement(GameObject *cst, SpellTarget *trg, int8) {
ActiveItem *tag = trg->getTAG();
assert(tag);
if (_affectBit == settagLocked) {
if (_affectBit == kSettagLocked) {
//if ( tag->builtInBehavior()==ActiveItem::builtInDoor )
if (tag->isLocked() != _onOff)
tag->acceptLockToggle(cst->thisID(), tag->lockType());
} else if (_affectBit == settagOpen) {
} else if (_affectBit == kSettagOpen) {
tag->trigger(cst->thisID(), _onOff);
}
}
@ -301,7 +301,7 @@ bool ProtoEnchantment::applicable(SpellTarget &trg) {
return (trg.getType() == SpellTarget::spellTargetObject ||
trg.getType() == SpellTarget::spellTargetObjectPoint) &&
(isActor(trg.getObject()) ||
getEnchantmentSubType(_enchID) == actorInvisible);
getEnchantmentSubType(_enchID) == kActorInvisible);
}
bool ProtoTAGEffect::applicable(SpellTarget &trg) {
@ -458,7 +458,7 @@ SPECIALSPELL(Resurrect) {
SPECIALSPELL(DispellPoison) {
if (isActor(trg->getObject())) {
Actor *a = (Actor *) trg->getObject();
DispelObjectEnchantment(a->thisID(), makeEnchantmentID(actorPoisoned, true));
DispelObjectEnchantment(a->thisID(), makeEnchantmentID(kActorPoisoned, true));
}
}

View File

@ -58,20 +58,20 @@ class GameObject;
//
enum effectTypes {
effectNone = 0, // no functional effect
effectAttrib, // (enchant) affects attributes of actors
effectResist, // (enchant) Enable resistance to various things
effectImmune, // (enchant) Enable immunity to various things
effectOthers, // (enchant) Enable immunity to various things
effectNonActor, // (enchant) change an object
effectPoison, // (enchant) change an object
kEffectNone = 0, // no functional effect
kEffectAttrib, // (enchant) affects attributes of actors
kEffectResist, // (enchant) Enable resistance to various things
kEffectImmune, // (enchant) Enable immunity to various things
kEffectOthers, // (enchant) Enable immunity to various things
kEffectNonActor, // (enchant) change an object
kEffectPoison, // (enchant) change an object
// Effect types greater than 8 cannot be enchantments
effectDamage = 8, // does damage of various types
effectDrains, // mana drain, money drain
effectTAG, // mana drain, money drain
effectLocation, // mana drain, money drain
effectSpecial,
effectStrike // weapon strike effect
kEffectDamage = 8, // does damage of various types
kEffectDrains, // mana drain, money drain
kEffectTAG, // mana drain, money drain
kEffectLocation, // mana drain, money drain
kEffectSpecial,
kEffectStrike // weapon strike effect
};
@ -82,26 +82,26 @@ enum effectTypes {
//
enum effectResistTypes {
resistOther = kDamageOther,
kResistOther = kDamageOther,
// Combat resist
resistImpact = kDamageImpact,
resistSlash = kDamageSlash,
resistProjectile = kDamageProjectile,
kResistImpact = kDamageImpact,
kResistSlash = kDamageSlash,
kResistProjectile = kDamageProjectile,
// Magic resist
resistFire = kDamageFire,
resistAcid = kDamageAcid,
resistHeat = kDamageHeat,
resistCold = kDamageCold,
resistLightning = kDamageLightning,
resistPoison = kDamagePoison,
kResistFire = kDamageFire,
kResistAcid = kDamageAcid,
kResistHeat = kDamageHeat,
kResistCold = kDamageCold,
kResistLightning = kDamageLightning,
kResistPoison = kDamagePoison,
// Other magic resist
resistMental = kDamageMental,
resistToUndead = kDamageToUndead,
resistDirMagic = kDamageDirMagic,
kResistMental = kDamageMental,
kResistToUndead = kDamageToUndead,
kResistDirMagic = kDamageDirMagic,
// Physiological Damage
resistStarve = kDamageStarve,
kResistStarve = kDamageStarve,
// other
resistEnergy = kDamageEnergy
kResistEnergy = kDamageEnergy
};
//
@ -110,26 +110,26 @@ enum effectResistTypes {
// Types of damage an effect can give immunity to
enum effectImmuneTypes {
immuneOther = resistOther,
kImmuneOther = kResistOther,
// Combat imm
immuneImpact = resistImpact,
immuneSlash = resistSlash,
immuneProjectile = resistProjectile,
kImmuneImpact = kResistImpact,
kImmuneSlash = kResistSlash,
kImmuneProjectile = kResistProjectile,
// Magic immu
immuneFire = resistFire,
immuneAcid = resistAcid,
immuneHeat = resistHeat,
immuneCold = resistCold,
immuneLightning = resistLightning,
immunePoison = resistPoison,
kImmuneFire = kResistFire,
kImmuneAcid = kResistAcid,
kImmuneHeat = kResistHeat,
kImmuneCold = kResistCold,
kImmuneLightning = kResistLightning,
kImmunePoison = kResistPoison,
// Other magimune
immuneMental = resistMental,
immuneToUndead = resistToUndead,
immuneDirMagic = resistDirMagic,
kImmuneMental = kResistMental,
kImmuneToUndead = kResistToUndead,
kImmuneDirMagic = kResistDirMagic,
// PhysiologiDamage
immuneStarve = resistStarve,
kImmuneStarve = kResistStarve,
// other
immuneEnergy = resistEnergy
kImmuneEnergy = kResistEnergy
};
//
@ -139,42 +139,42 @@ enum effectImmuneTypes {
enum effectOthersTypes {
// Movement flags
actorNoncorporeal = 1, // The creature can walk through things
actorWaterBreathe = 2, // death spell
actorSlowFall = 3, // the creature is not harmed by falling (but falls none the less)
actorLevitate = 4, // flying with no height control ?
actorFlying = 5, // the creature flys
kActorNoncorporeal = 1, // The creature can walk through things
kActorWaterBreathe = 2, // death spell
kActorSlowFall = 3, // the creature is not harmed by falling (but falls none the less)
kActorLevitate = 4, // flying with no height control ?
kActorFlying = 5, // the creature flys
// speed flags
actorFastMove = 6, //
actorFastAttack = 7, //
actorSlowAttack = 8, // come... back... here... lit... tle... bun... ny...
kActorFastMove = 6, //
kActorFastAttack = 7, //
kActorSlowAttack = 8, // come... back... here... lit... tle... bun... ny...
actorImmobile = 9, // I thought I told you to leave the piano at home
kActorImmobile = 9, // I thought I told you to leave the piano at home
// ill effects
actorAsleep = 10, // Zzzzzzzzzzz
actorParalyzed = 11, // the creature can't move an inch
actorFear = 12, // run away! run away
actorDiseased = 13, // cannot heal
actorPoisoned = 14, // death spell
kActorAsleep = 10, // Zzzzzzzzzzz
kActorParalyzed = 11, // the creature can't move an inch
kActorFear = 12, // run away! run away
kActorDiseased = 13, // cannot heal
kActorPoisoned = 14, // death spell
// perception & perceivability flags
actorBlind = 15, // can't see
actorSeeInvis = 16, // can see invisible
actorClairvoyant = 17, // unknown effects
actorInvisible = 18, // is invisible
actorUndetectable = 19, // can't be seen, smelled
actorDetPoison = 20, // poison things glow green
kActorBlind = 15, // can't see
kActorSeeInvis = 16, // can see invisible
kActorClairvoyant = 17, // unknown effects
kActorInvisible = 18, // is invisible
kActorUndetectable = 19, // can't be seen, smelled
kActorDetPoison = 20, // poison things glow green
// flags preventing changes to other flags
actorNoEnchant = 21, // no bad enchantments
actorNoDrain = 22, // no mana / food drains
kActorNoEnchant = 21, // no bad enchantments
kActorNoDrain = 22, // no mana / food drains
// flags that make things run away
actorRepelEvil = 23, // death spell
actorRepelGood = 24, // death spell
actorRepelUndead = 25, // death spell
kActorRepelEvil = 23, // death spell
kActorRepelGood = 24, // death spell
kActorRepelUndead = 25, // death spell
// miscellaneous
actorNotDefenseless = 26, // forgo defenselessness check
actorDisappearOnDeath = 27, // gets deleted on death and spews inventory
kActorNotDefenseless = 26, // forgo defenselessness check
kActorDisappearOnDeath = 27, // gets deleted on death and spews inventory
// dead or moved flags
actorWaterWalk // can walk on water (same as float ?)
kActorWaterWalk // can walk on water (same as float ?)
};
//
@ -184,15 +184,15 @@ enum effectOthersTypes {
enum effectDrainsTypes {
// mana pools
drainsManaRed = 1,
drainsManaOrange,
drainsManaYellow,
drainsManaGreen,
drainsManaBlue,
drainsManaViolet,
drainsLifeLevel,
drainsVitality,
drainsMoney
kDrainsManaRed = 1,
kDrainsManaOrange,
kDrainsManaYellow,
kDrainsManaGreen,
kDrainsManaBlue,
kDrainsManaViolet,
kDrainsLifeLevel,
kDrainsVitality,
kDrainsMoney
};
@ -201,8 +201,8 @@ enum effectDrainsTypes {
//
enum effectTAGTypes {
settagLocked = 1,
settagOpen = 2
kSettagLocked = 1,
kSettagOpen = 2
};
@ -210,26 +210,26 @@ enum effectTAGTypes {
// Location Effects - effects that apply when a Location is the target
//
enum effectLocationTypes {
locateDummy = 1
enum kEffectLocationTypes {
kLocateDummy = 1
};
enum objectFlags {
objectOpen = (1 << 0), // object is in the "open" state
objectLocked = (1 << 1), // object cannot be opened
objectImportant = (1 << 2), // object must be recycled when trashed
objectGhosted = (1 << 3), // object drawn translucent
objectInvisible = (1 << 4), // object cannot be seen
objectObscured = (1 << 5), // object obscured by terrain
objectMoving = (1 << 6), // object has attached motion task
objectScavengable = (1 << 7), // object can be deleted
objectFloating = (1 << 8), // object not affected by Gravity
objectNoRecycle = (1 << 9), // object is referred to by script, don't delete
objectActivated = (1 << 10), // object is activated
objectAlias = (1 << 11), // object is not real, just a copy of another object
objectTriggeringTAG = (1 << 12), // object has triggerred TAG upon which it rests
objectOnScreen = (1 << 13), // object is on display list
objectSightedByCenter = (1 << 14) // there is a line of sight to center actor
kObjectOpen = (1 << 0), // object is in the "open" state
kObjectLocked = (1 << 1), // object cannot be opened
kObjectImportant = (1 << 2), // object must be recycled when trashed
kObjectGhosted = (1 << 3), // object drawn translucent
kObjectInvisible = (1 << 4), // object cannot be seen
kObjectObscured = (1 << 5), // object obscured by terrain
kObjectMoving = (1 << 6), // object has attached motion task
kObjectScavengable = (1 << 7), // object can be deleted
kObjectFloating = (1 << 8), // object not affected by Gravity
kObjectNoRecycle = (1 << 9), // object is referred to by script, don't delete
kObjectActivated = (1 << 10), // object is activated
kObjectAlias = (1 << 11), // object is not real, just a copy of another object
kObjectTriggeringTAG = (1 << 12), // object has triggerred TAG upon which it rests
kObjectOnScreen = (1 << 13), // object is on display list
kObjectSightedByCenter = (1 << 14) // there is a line of sight to center actor
};
@ -238,18 +238,18 @@ enum objectFlags {
//
enum effectSpecialTypes {
specialDispellHelpfulEnch = 1, // clears helpful enchantments
specialDispellHarmfulEnch, // clears harmful enchantments
specialKill, // death spell
specialRessurect, // raise dead spell
specialTeleport, // Teleportation
specialCreateActor, // Create an actor or wall
specialSagaFunc, // calls a saga function
specialCreateWWisp, // calls a saga function
specialCreateFWisp, // calls a saga function
specialCreateWraith, // calls a saga function
specialCreateFood, // calls a saga function
specialRejoin
kSpecialDispellHelpfulEnch = 1, // clears helpful enchantments
kSpecialDispellHarmfulEnch, // clears harmful enchantments
kSpecialKill, // death spell
kSpecialRessurect, // raise dead spell
kSpecialTeleport, // Teleportation
kSpecialCreateActor, // Create an actor or wall
kSpecialSagaFunc, // calls a saga function
kSpecialCreateWWisp, // calls a saga function
kSpecialCreateFWisp, // calls a saga function
kSpecialCreateWraith, // calls a saga function
kSpecialCreateFood, // calls a saga function
kSpecialRejoin
};
// ------------------------------------------------------------------
@ -270,27 +270,27 @@ inline uint16 makeEnchantmentID(uint16 type, uint16 damtyp, int16 damamt) {
/* skill* are now in the spellid enum ;AS;
inline uint16 makeEnchantmentID(effectAttribTypes atttyp, int16 damamt)
{ return (effectAttrib << 13) | (atttyp << 8) + (damamt+128); }
{ return (kEffectAttrib << 13) | (atttyp << 8) + (damamt+128); }
*/
inline uint16 makeEnchantmentID(effectResistTypes restyp, bool damamt) {
return ((effectResist << 13) | (restyp << 8)) + (damamt + 128);
return ((kEffectResist << 13) | (restyp << 8)) + (damamt + 128);
}
inline uint16 makeEnchantmentID(effectImmuneTypes immtyp, bool damamt) {
return ((effectImmune << 13) | (immtyp << 8)) + (damamt + 128);
return ((kEffectImmune << 13) | (immtyp << 8)) + (damamt + 128);
}
inline uint16 makeEnchantmentID(effectOthersTypes othtyp, bool damamt) {
return ((effectOthers << 13) | (othtyp << 8)) + (damamt + 128);
return ((kEffectOthers << 13) | (othtyp << 8)) + (damamt + 128);
}
inline uint16 makeEnchantmentID(objectFlags othtyp, bool damamt) {
return ((effectNonActor << 13) | (othtyp << 8)) + (damamt + 128);
return ((kEffectNonActor << 13) | (othtyp << 8)) + (damamt + 128);
}
inline uint16 makeEnchantmentID(uint8 damamt) {
return ((effectPoison << 13) | (0 << 8)) + damamt;
return ((kEffectPoison << 13) | (0 << 8)) + damamt;
}
inline effectTypes getEnchantmentType(uint16 eID) {
@ -312,9 +312,9 @@ inline bool isHarmful(uint16 enchID) {
int16 typ = getEnchantmentType(enchID);
int16 sub = getEnchantmentSubType(enchID);
int16 amt = getEnchantmentAmount(enchID);
if (typ == effectAttrib) return amt < 0;
if (typ == effectOthers)
return (sub >= actorSlowAttack && sub <= actorBlind);
if (typ == kEffectAttrib) return amt < 0;
if (typ == kEffectOthers)
return (sub >= kActorSlowAttack && sub <= kActorBlind);
return false;
}
@ -323,7 +323,7 @@ inline bool isHarmful(uint16 enchID) {
inline bool isSaveable(uint16 enchID) {
int16 typ = getEnchantmentType(enchID);
return (typ == effectOthers && isHarmful(enchID));
return (typ == kEffectOthers && isHarmful(enchID));
}
// ------------------------------------------------------------------
@ -506,11 +506,11 @@ public:
// is where they'll be
class ProtoLocationEffect: public ProtoEffect {
effectLocationTypes _affectBit;
kEffectLocationTypes _affectBit;
int16 _value;
public:
ProtoLocationEffect(effectLocationTypes elt, int16 v) {
ProtoLocationEffect(kEffectLocationTypes elt, int16 v) {
_affectBit = elt;
_value = v;
}

View File

@ -160,22 +160,22 @@ void addEnchantment(Actor *a, uint16 enchantmentID) {
int16 eAmount = getEnchantmentAmount(enchantmentID);
switch (eType) {
case effectAttrib:
case kEffectAttrib:
stats[eSubType] = clamp(0, stats[eSubType] + eAmount, 100);
break;
case effectResist:
case kEffectResist:
a->setResist((effectResistTypes) eSubType, eAmount);
break;
case effectImmune:
case kEffectImmune:
a->setImmune((effectImmuneTypes) eSubType, eAmount);
break;
case effectOthers:
case kEffectOthers:
a->setEffect((effectOthersTypes) eSubType, eAmount);
break;
case effectSpecial: // damage shouldn't be an enchantment
case kEffectSpecial: // damage shouldn't be an enchantment
// Special code needed
case effectDamage: // damage shouldn't be an enchantment
case effectNone:
case kEffectDamage: // damage shouldn't be an enchantment
case kEffectNone:
break;
}
@ -230,12 +230,12 @@ void evalObjectEnchantments(GameObject *obj) {
// If more enchantment types are added, then we'll
// have to do this a bit differently...
if (FindObjectEnchantment(obj->thisID(), makeEnchantmentID(effectNonActor, objectInvisible, true)))
obj->setFlags((uint8) - 1, objectInvisible);
if (FindObjectEnchantment(obj->thisID(), makeEnchantmentID(kEffectNonActor, kObjectInvisible, true)))
obj->setFlags((uint8) - 1, kObjectInvisible);
else
obj->setFlags(0, objectInvisible);
if (FindObjectEnchantment(obj->thisID(), makeEnchantmentID(effectNonActor, objectLocked, false)))
obj->setFlags((uint8) - 1, objectLocked);
obj->setFlags(0, kObjectInvisible);
if (FindObjectEnchantment(obj->thisID(), makeEnchantmentID(kEffectNonActor, kObjectLocked, false)))
obj->setFlags((uint8) - 1, kObjectLocked);
}
//-------------------------------------------------------------------

View File

@ -542,13 +542,13 @@ void CPortrait::getStateString(char buf[], int8 size, uint16 brotherID) {
buf[0] = '\0';
if (a->_enchantmentFlags & (1 << actorAsleep)) {
if (a->_enchantmentFlags & (1 << kActorAsleep)) {
Common::strlcat(buf, asleepStr, size);
} else if (a->_enchantmentFlags & (1 << actorParalyzed)) {
} else if (a->_enchantmentFlags & (1 << kActorParalyzed)) {
Common::strlcat(buf, paralysedStr, size);
} else if (a->_enchantmentFlags & (1 << actorBlind)) {
} else if (a->_enchantmentFlags & (1 << kActorBlind)) {
Common::strlcat(buf, blindStr, size);
} else if (a->_enchantmentFlags & (1 << actorFear)) {
} else if (a->_enchantmentFlags & (1 << kActorFear)) {
Common::strlcat(buf, afraidStr, size);
} else if (pa->isAggressive()) {
Common::strlcat(buf, angryStr, size);
@ -566,12 +566,12 @@ void CPortrait::getStateString(char buf[], int8 size, uint16 brotherID) {
Common::strlcat(buf, hurtStr, size);
}
if (a->_enchantmentFlags & (1 << actorPoisoned)) {
if (a->_enchantmentFlags & (1 << kActorPoisoned)) {
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 << kActorDiseased)) {
if (buf[0] != '\0') // strlen(buf) > 0
Common::strlcat(buf, commaStr, size);
@ -2708,7 +2708,7 @@ void gEnchantmentDisplay::setValue(PlayerActorID pID) {
uint8 duration = obj->getHitPoints(); // get hitpoints of enchant
switch (eType) {
case effectAttrib:
case kEffectAttrib:
switch (eSubType) {
// case kSkillIDArchery:
// case kSkillIDShieldcraft:
@ -2730,7 +2730,7 @@ void gEnchantmentDisplay::setValue(PlayerActorID pID) {
}
break;
case effectResist:
case kEffectResist:
switch (eSubType) {
case kDamageImpact:
@ -2769,7 +2769,7 @@ void gEnchantmentDisplay::setValue(PlayerActorID pID) {
}
break;
case effectImmune:
case kEffectImmune:
switch (eSubType) {
case kDamageImpact:
newIconFlags[iconIronskin] = duration;
@ -2801,47 +2801,47 @@ void gEnchantmentDisplay::setValue(PlayerActorID pID) {
}
break;
case effectOthers:
case kEffectOthers:
switch (eSubType) {
case actorPoisoned:
case actorDiseased:
case kActorPoisoned:
case kActorDiseased:
newIconFlags[iconPoisoned] = duration;
break;
case actorFear:
case kActorFear:
newIconFlags[iconAfraid] = duration;
break;
case actorParalyzed:
case kActorParalyzed:
newIconFlags[iconParalysed] = duration;
break; // iconFrozen ??
case actorSlowFall:
case kActorSlowFall:
newIconFlags[iconCushionAir] = duration;
break;
case actorImmobile:
case kActorImmobile:
newIconFlags[iconConstrained] = duration;
break;
case actorSeeInvis:
case kActorSeeInvis:
newIconFlags[iconSoulSight] = duration;
break;
case actorInvisible:
case kActorInvisible:
newIconFlags[iconInvisible] = duration;
break;
case actorUndetectable:
case kActorUndetectable:
newIconFlags[iconNumbscent] = duration;
break;
case actorDetPoison:
case kActorDetPoison:
newIconFlags[iconDetectPoison] = duration;
break;
case actorNoDrain:
case kActorNoDrain:
newIconFlags[iconNetherWard] = duration;
break;
case actorWaterBreathe:
case kActorWaterBreathe:
newIconFlags[iconSeawalk] = duration;
break;
case actorRepelEvil:
case kActorRepelEvil:
newIconFlags[iconProtectEvil] = duration;
break;
// case actorRepelUndead: newIconFlags[iconProtectUndead] = duration; break;
// case kActorRepelUndead: newIconFlags[iconProtectUndead] = duration; break;
// case actorRepelGhosts: newIconFlags[iconProtectGhosts] = duration; break;
}
}
@ -2853,38 +2853,38 @@ void gEnchantmentDisplay::setValue(PlayerActorID pID) {
if ((cSet & (ProtoObj::isArmor | ProtoObj::isWeapon | ProtoObj::isWearable))
&& proto->isObjectBeingUsed(obj)) {
if (proto->immunity & (1 << resistImpact)) newIconFlags[iconResistImpact] = 255;
else if (proto->resistance & (1 << resistImpact)) newIconFlags[iconResistImpact] = 255;
if (proto->immunity & (1 << kResistImpact)) newIconFlags[iconResistImpact] = 255;
else if (proto->resistance & (1 << kResistImpact)) newIconFlags[iconResistImpact] = 255;
if (proto->immunity & (1 << resistSlash)) newIconFlags[iconResistSlash] = 255;
else if (proto->resistance & (1 << resistSlash)) newIconFlags[iconResistSlash] = 255;
if (proto->immunity & (1 << kResistSlash)) newIconFlags[iconResistSlash] = 255;
else if (proto->resistance & (1 << kResistSlash)) newIconFlags[iconResistSlash] = 255;
if (proto->immunity & (1 << resistProjectile)) newIconFlags[iconResistProjectile] = 255;
else if (proto->resistance & (1 << resistProjectile)) newIconFlags[iconResistProjectile] = 255;
if (proto->immunity & (1 << kResistProjectile)) newIconFlags[iconResistProjectile] = 255;
else if (proto->resistance & (1 << kResistProjectile)) newIconFlags[iconResistProjectile] = 255;
if (proto->immunity & (1 << immuneFire)) newIconFlags[iconImmuneFire] = 255;
else if (proto->resistance & (1 << resistFire)) newIconFlags[iconResistFire] = 255;
if (proto->immunity & (1 << kImmuneFire)) newIconFlags[iconImmuneFire] = 255;
else if (proto->resistance & (1 << kResistFire)) newIconFlags[iconResistFire] = 255;
if (proto->immunity & (1 << immuneAcid)) newIconFlags[iconImmuneAcid] = 255;
else if (proto->resistance & (1 << resistAcid)) newIconFlags[iconResistAcid] = 255;
if (proto->immunity & (1 << kImmuneAcid)) newIconFlags[iconImmuneAcid] = 255;
else if (proto->resistance & (1 << kResistAcid)) newIconFlags[iconResistAcid] = 255;
if (proto->immunity & (1 << immuneHeat)) newIconFlags[iconImmuneHeat] = 255;
else if (proto->resistance & (1 << resistHeat)) newIconFlags[iconResistHeat] = 255;
if (proto->immunity & (1 << kImmuneHeat)) newIconFlags[iconImmuneHeat] = 255;
else if (proto->resistance & (1 << kResistHeat)) newIconFlags[iconResistHeat] = 255;
if (proto->immunity & (1 << immuneCold)) newIconFlags[iconImmuneCold] = 255;
else if (proto->resistance & (1 << resistCold)) newIconFlags[iconResistCold] = 255;
if (proto->immunity & (1 << kImmuneCold)) newIconFlags[iconImmuneCold] = 255;
else if (proto->resistance & (1 << kResistCold)) newIconFlags[iconResistCold] = 255;
if (proto->immunity & (1 << immuneLightning)) newIconFlags[iconImmuneLightning] = 255;
else if (proto->resistance & (1 << resistLightning)) newIconFlags[iconResistLightning] = 255;
if (proto->immunity & (1 << kImmuneLightning)) newIconFlags[iconImmuneLightning] = 255;
else if (proto->resistance & (1 << kResistLightning)) newIconFlags[iconResistLightning] = 255;
if (proto->immunity & (1 << immunePoison)) newIconFlags[iconImmunePoison] = 255;
else if (proto->resistance & (1 << resistPoison)) newIconFlags[iconResistPoison] = 255;
if (proto->immunity & (1 << kImmunePoison)) newIconFlags[iconImmunePoison] = 255;
else if (proto->resistance & (1 << kResistPoison)) newIconFlags[iconResistPoison] = 255;
if (proto->immunity & (1 << immuneMental)) newIconFlags[iconImmunePsionic] = 255;
else if (proto->resistance & (1 << resistMental)) newIconFlags[iconResistPsionic] = 255;
if (proto->immunity & (1 << kImmuneMental)) newIconFlags[iconImmunePsionic] = 255;
else if (proto->resistance & (1 << kResistMental)) newIconFlags[iconResistPsionic] = 255;
if (proto->immunity & (1 << resistDirMagic)) newIconFlags[iconResistDirectMagic] = 255;
else if (proto->resistance & (1 << resistDirMagic))newIconFlags[iconResistDirectMagic] = 255;
if (proto->immunity & (1 << kResistDirMagic)) newIconFlags[iconResistDirectMagic] = 255;
else if (proto->resistance & (1 << kResistDirMagic))newIconFlags[iconResistDirectMagic] = 255;
}
}
@ -2893,41 +2893,41 @@ void gEnchantmentDisplay::setValue(PlayerActorID pID) {
#if 0
enum effectOthersTypes {
// Movement flags
o actorNoncorporeal = 1, // The creature can walk through things
x actorWaterBreathe = 2, // death spell
x actorSlowFall = 3, // the creature is not harmed by falling (but falls none the less)
- actorLevitate = 4, // flying with no height control ?
- actorFlying = 5, // the creature flys
o kActorNoncorporeal = 1, // The creature can walk through things
x kActorWaterBreathe = 2, // death spell
x kActorSlowFall = 3, // the creature is not harmed by falling (but falls none the less)
- kActorLevitate = 4, // flying with no height control ?
- kActorFlying = 5, // the creature flys
// speed flags
- actorFastMove = 6, //
- actorFastAttack = 7, //
actorSlowAttack = 8, // come... back... here... lit... tle... bun... ny...
- kActorFastMove = 6, //
- kActorFastAttack = 7, //
kActorSlowAttack = 8, // come... back... here... lit... tle... bun... ny...
x actorSlowMove = 9, // I thought I told you to leave the piano at home
// ill effects
- actorAsleep = 10, // Zzzzzzzzzzz
x actorParalyzed = 11, // the creature can't move an inch
x actorFear = 12, // run away! run away
x actorDiseased = 13, // cannot heal
x actorPoisoned = 14, // death spell
- kActorAsleep = 10, // Zzzzzzzzzzz
x kActorParalyzed = 11, // the creature can't move an inch
x kActorFear = 12, // run away! run away
x kActorDiseased = 13, // cannot heal
x kActorPoisoned = 14, // death spell
// perception & perceivability flags
x actorBlind = 15, // can't see
x actorSeeInvis = 16, // can see invisible
- actorClairvoyant = 17, // unknown effects
x actorInvisible = 18, // is invisible
x actorUndetectable = 19, // can't be seen, smelled
x actorDetPoison = 20, // poison things glow green
x kActorBlind = 15, // can't see
x kActorSeeInvis = 16, // can see invisible
- kActorClairvoyant = 17, // unknown effects
x kActorInvisible = 18, // is invisible
x kActorUndetectable = 19, // can't be seen, smelled
x kActorDetPoison = 20, // poison things glow green
// flags preventing changes to other flags
actorNoEnchant = 21, // no bad enchantments
x actorNoDrain = 22, // no mana / food drains
kActorNoEnchant = 21, // no bad enchantments
x kActorNoDrain = 22, // no mana / food drains
// flags that make things run away
x actorRepelEvil = 23, // death spell
x actorRepelGood = 24, // death spell
x actorRepelUndead = 25, // death spell
x kActorRepelEvil = 23, // death spell
x kActorRepelGood = 24, // death spell
x kActorRepelUndead = 25, // death spell
// dead or moved flags
// actorMapping =15, //
// actorLandWalk =0 , // someone else had this I have no idea what it is
// actorFloat =2 , // the creature can travel through malts shakes & sundaes
actorWaterWalk, // can walk on water (same as float ?)
kActorWaterWalk, // can walk on water (same as float ?)
// actorPanic =13, // creature takes off randomly
// actorSpotHidden =17, // can see hidden
// actorDetTraps =22, // traps glow green

View File

@ -153,7 +153,7 @@ bool validTarget(GameObject *enactor, GameObject *target, ActiveItem *tag, Skill
if (isActor(target)) {
Actor *a = (Actor *) target;
Actor *e = (Actor *) enactor;
if (a->hasEffect(actorInvisible) && !e->hasEffect(actorSeeInvis))
if (a->hasEffect(kActorInvisible) && !e->hasEffect(kActorSeeInvis))
return false;
}
if (target->thisID() == enactor->thisID())

View File

@ -449,7 +449,7 @@ MotionTask *MotionTaskList::newTask(GameObject *obj) {
((Actor *)obj)->_moveTask = mt;
}
obj->_data.objectFlags |= objectMoving;
obj->_data.objectFlags |= kObjectMoving;
return mt;
}
@ -1070,11 +1070,11 @@ void MotionTask::remove(int16 returnVal) {
if (g_vm->_mTaskList->_nextMT != g_vm->_mTaskList->_list.end() && *(g_vm->_mTaskList->_nextMT) == this)
++g_vm->_mTaskList->_nextMT;
_object->_data.objectFlags &= ~objectMoving;
_object->_data.objectFlags &= ~kObjectMoving;
if (objObscured(_object))
_object->_data.objectFlags |= objectObscured;
_object->_data.objectFlags |= kObjectObscured;
else
_object->_data.objectFlags &= ~objectObscured;
_object->_data.objectFlags &= ~kObjectObscured;
if (isActor(_object)) {
Actor *a = (Actor *)_object;
@ -4511,7 +4511,7 @@ void MotionTask::updatePositions() {
} else {
moveTaskDone = true;
a->setInterruptablity(true);
if (!a->hasEffect(actorDisappearOnDeath)) {
if (!a->hasEffect(kActorDisappearOnDeath)) {
a->setAction(kActionDead, 0);
a->die();
} else {
@ -4523,7 +4523,7 @@ void MotionTask::updatePositions() {
} else if (a->nextAnimationFrame()) {
moveTaskDone = true;
a->setInterruptablity(true);
if (!a->hasEffect(actorDisappearOnDeath)) {
if (!a->hasEffect(kActorDisappearOnDeath)) {
a->setAction(kActionDead, 0);
a->die();
} else {
@ -4550,7 +4550,7 @@ bool MotionTask::freeFall(TilePoint &newPos, StandingTileInfo &sti) {
tHeight = tileSlopeHeight(newPos, _object, &sti);
if (_object->_data.objectFlags & objectFloating) return false;
if (_object->_data.objectFlags & kObjectFloating) return false;
_velocity.u = (newPos.u - _object->_data.location.u) * 2 / 3;
_velocity.v = (newPos.v - _object->_data.location.v) * 2 / 3;

View File

@ -1046,9 +1046,9 @@ void GameObject::updateImage(ObjectID oldParentID) {
if (!isMoving()) {
if (objObscured(this)) {
_data.objectFlags |= objectObscured;
_data.objectFlags |= kObjectObscured;
} else {
_data.objectFlags &= ~objectObscured;
_data.objectFlags &= ~kObjectObscured;
}
}
int u = _data.location.u >> kSectorShift;
@ -1062,7 +1062,7 @@ void GameObject::updateImage(ObjectID oldParentID) {
else
warning("GameObject::updateImage: Invalid Sector (%d, %d))", u, v);
} else {
_data.objectFlags &= ~objectObscured;
_data.objectFlags &= ~kObjectObscured;
if ((isActor(_data.parentID)
&& isPlayerActor((Actor *)parent))
@ -1234,7 +1234,7 @@ ObjectID GameObject::makeAlias(const Location &l) {
if (newObjID != Nothing) {
GameObject *newObject = objectAddress(newObjID);
newObject->_data.objectFlags |= objectAlias;
newObject->_data.objectFlags |= kObjectAlias;
}
return newObjID;
@ -1336,11 +1336,11 @@ void GameObject::deleteObject() {
if (isActor(this))
((Actor *)this)->deleteActor();
else if (_data.objectFlags & objectImportant) {
else if (_data.objectFlags & kObjectImportant) {
append(ImportantLimbo);
_data.parentID = ImportantLimbo;
importantLimboCount++;
} else if (!(_data.objectFlags & objectNoRecycle)) {
} else if (!(_data.objectFlags & kObjectNoRecycle)) {
append(ObjectLimbo);
_data.parentID = ObjectLimbo;
objectLimboCount++;
@ -1407,7 +1407,7 @@ void GameObject::deleteObjectRecursive() {
// Activate this object
void GameObject::activate() {
if (_data.objectFlags & objectActivated)
if (_data.objectFlags & kObjectActivated)
return;
debugC(1, kDebugActors, "GameObject::activate %d (%s)", thisID(), objName());
@ -1415,7 +1415,7 @@ void GameObject::activate() {
ObjectID dObj = thisID();
scriptCallFrame scf;
_data.objectFlags |= objectActivated;
_data.objectFlags |= kObjectActivated;
scf.invokedObject = dObj;
scf.enactor = dObj;
@ -1436,7 +1436,7 @@ void GameObject::activate() {
// Deactivate this object
void GameObject::deactivate() {
if (!(_data.objectFlags & objectActivated))
if (!(_data.objectFlags & kObjectActivated))
return;
debugC(1, kDebugActors, "GameObject::deactivate %d (%s)", thisID(), objName());
@ -1445,7 +1445,7 @@ void GameObject::deactivate() {
scriptCallFrame scf;
// Clear activated flag
_data.objectFlags &= ~objectActivated;
_data.objectFlags &= ~kObjectActivated;
scf.invokedObject = dObj;
scf.enactor = dObj;
@ -1531,7 +1531,7 @@ void GameObject::updateState() {
// currently at, then raise us up a bit.
if (isMoving()) return;
if (_data.objectFlags & objectFloating) return;
if (_data.objectFlags & kObjectFloating) return;
if (tHeight > _data.location.z + kMaxStepHeight) {
unstickObject(this);
@ -2254,11 +2254,11 @@ void GameObject::evalEnchantments() {
}
}
#define noMergeFlags (objectImportant|\
objectGhosted|\
objectInvisible|\
objectFloating|\
objectNoRecycle)
#define noMergeFlags (kObjectImportant|\
kObjectGhosted|\
kObjectInvisible|\
kObjectFloating|\
kObjectNoRecycle)
int32 GameObject::canStackOrMerge(GameObject *dropObj, GameObject *target) {
int32 cSet = dropObj->proto()->containmentSet();
@ -4233,12 +4233,12 @@ bool lineOfSight(GameObject *obj1, GameObject *obj2, uint32 terrainMask) {
#if 0
if (isActor(obj1)) {
Actor *a1 = (Actor *) obj1;
if (!a1->hasEffect(actorSeeInvis)) {
if (!a1->hasEffect(kActorSeeInvis)) {
if (!isActor(obj2) && obj2->isInvisible())
return false;
else if (isActor(obj2)) {
Actor *a2 = (Actor *) obj2;
if (a2->hasEffect(actorInvisible))
if (a2->hasEffect(kActorInvisible))
return false;
}
}

View File

@ -298,7 +298,7 @@ public:
// Determine if this object is an alias for another object
bool isAlias() {
return (_data.objectFlags & objectAlias) != 0;
return (_data.objectFlags & kObjectAlias) != 0;
}
// check to see if item can be contained by this object
@ -494,77 +494,77 @@ public:
// Flag test functions
bool isOpen() {
return (int16)(_data.objectFlags & objectOpen);
return (int16)(_data.objectFlags & kObjectOpen);
}
bool isLocked() {
return (int16)(_data.objectFlags & objectLocked);
return (int16)(_data.objectFlags & kObjectLocked);
}
bool isImportant() {
return (int16)(_data.objectFlags & objectImportant);
return (int16)(_data.objectFlags & kObjectImportant);
}
bool isGhosted() {
return (_data.objectFlags & objectGhosted)
return (_data.objectFlags & kObjectGhosted)
|| (_prototype->flags & ResourceObjectPrototype::objPropGhosted);
}
bool isInvisible() {
return (_data.objectFlags & objectInvisible)
return (_data.objectFlags & kObjectInvisible)
|| (_prototype->flags & ResourceObjectPrototype::objPropHidden);
}
bool isMoving() {
return (int16)(_data.objectFlags & objectMoving);
return (int16)(_data.objectFlags & kObjectMoving);
}
bool isActivated() {
return (int16)(_data.objectFlags & objectActivated);
return (int16)(_data.objectFlags & kObjectActivated);
}
void setScavengable(bool val) {
if (val)
_data.objectFlags |= objectScavengable;
_data.objectFlags |= kObjectScavengable;
else
_data.objectFlags &= ~objectScavengable;
_data.objectFlags &= ~kObjectScavengable;
}
bool isScavengable() {
return (_data.objectFlags & objectScavengable) != 0;
return (_data.objectFlags & kObjectScavengable) != 0;
}
void setObscured(bool val) {
if (val)
_data.objectFlags |= objectObscured;
_data.objectFlags |= kObjectObscured;
else
_data.objectFlags &= ~objectObscured;
_data.objectFlags &= ~kObjectObscured;
}
bool isObscured() {
return (_data.objectFlags & objectObscured) != 0;
return (_data.objectFlags & kObjectObscured) != 0;
}
void setTriggeringTAG(bool val) {
if (val)
_data.objectFlags |= objectTriggeringTAG;
_data.objectFlags |= kObjectTriggeringTAG;
else
_data.objectFlags &= ~objectTriggeringTAG;
_data.objectFlags &= ~kObjectTriggeringTAG;
}
bool isTriggeringTAG() {
return (_data.objectFlags & objectTriggeringTAG) != 0;
return (_data.objectFlags & kObjectTriggeringTAG) != 0;
}
void setOnScreen(bool val) {
if (val)
_data.objectFlags |= objectOnScreen;
_data.objectFlags |= kObjectOnScreen;
else
_data.objectFlags &= ~objectOnScreen;
_data.objectFlags &= ~kObjectOnScreen;
}
bool isOnScreen() {
return (_data.objectFlags & objectOnScreen) != 0;
return (_data.objectFlags & kObjectOnScreen) != 0;
}
void setSightedByCenter(bool val) {
if (val)
_data.objectFlags |= objectSightedByCenter;
_data.objectFlags |= kObjectSightedByCenter;
else
_data.objectFlags &= ~objectSightedByCenter;
_data.objectFlags &= ~kObjectSightedByCenter;
}
bool isSightedByCenter() {
return (_data.objectFlags & objectSightedByCenter) != 0;
return (_data.objectFlags & kObjectSightedByCenter) != 0;
}
bool isMissile() {

View File

@ -1231,7 +1231,7 @@ bool PhysicalContainerProto::useAction(ObjectID dObj, ObjectID enactor) {
bool result;
GameObject *dObjPtr = GameObject::objectAddress(dObj);
if (dObjPtr->_data.objectFlags & objectOpen)
if (dObjPtr->_data.objectFlags & kObjectOpen)
result = close(dObj, enactor);
else
result = open(dObj, enactor);
@ -1256,7 +1256,7 @@ bool PhysicalContainerProto::openAction(ObjectID dObj, ObjectID) {
cn = CreateContainerNode(dObj, false);
cn->markForShow(); // Deferred open
dObjPtr->_data.objectFlags |= objectOpen; // Set open bit;
dObjPtr->_data.objectFlags |= kObjectOpen; // Set open bit;
g_vm->_cnm->setUpdate(dObjPtr->IDParent());
return true;
@ -1273,7 +1273,7 @@ bool PhysicalContainerProto::closeAction(ObjectID dObj, ObjectID) {
cn->markForDelete();
// Clear open bit
dObjPtr->_data.objectFlags &= ~objectOpen;
dObjPtr->_data.objectFlags &= ~kObjectOpen;
g_vm->_cnm->setUpdate(dObjPtr->IDParent());
return true;
@ -1296,7 +1296,7 @@ bool PhysicalContainerProto::acceptLockToggleAction(
GameObject *dObjPtr = GameObject::objectAddress(dObj);
// Toggle locked bit
dObjPtr->_data.objectFlags ^= objectLocked;
dObjPtr->_data.objectFlags ^= kObjectLocked;
return true;
}
@ -1314,7 +1314,7 @@ bool PhysicalContainerProto::acceptInsertionAction(
GameObject *itemPtr = GameObject::objectAddress(item);
// Place the object in the container (if possible)
if ((dObjPtr->_data.objectFlags & objectLocked)
if ((dObjPtr->_data.objectFlags & kObjectLocked)
|| !dObjPtr->placeObject(enactor, item, true, num)) {
if (isWorld(dObjPtr->IDParent()))
dObjPtr->dropInventoryObject(itemPtr, num);
@ -2757,7 +2757,7 @@ void EnchantmentProto::doBackgroundUpdate(GameObject *obj) {
uint16 type = getEnchantmentType(flgs),
subType = getEnchantmentSubType(flgs);
if (type == effectOthers && subType == actorPoisoned) {
if (type == kEffectOthers && subType == kActorPoisoned) {
// get the damage amount for this poison
int16 damage = getEnchantmentAmount(flgs);
@ -2898,7 +2898,7 @@ bool IntangibleContainerProto::useAction(ObjectID dObj, ObjectID enactor) {
bool result;
GameObject *dObjPtr = GameObject::objectAddress(dObj);
if (dObjPtr->_data.objectFlags & objectOpen)
if (dObjPtr->_data.objectFlags & kObjectOpen)
result = close(dObj, enactor);
else
result = open(dObj, enactor);

View File

@ -1472,7 +1472,7 @@ void PathRequest::initialize() {
// obstacles.
if (isActor(obj)
&& (((Actor *)obj)->isDead()
|| ((Actor *)obj)->hasEffect(actorInvisible)))
|| ((Actor *)obj)->hasEffect(kActorInvisible)))
continue;
// Compute the objects volume

View File

@ -103,15 +103,15 @@ void PlayerActor::recalcPortraitType() {
if (a->isDead())
pType = kPortraitDead;
else if (a->_enchantmentFlags & (1 << actorAsleep))
else if (a->_enchantmentFlags & (1 << kActorAsleep))
pType = kPortraitAsleep;
else if (stats.vitality >= a->_effectiveStats.vitality * 3)
pType = kPortraitWounded;
else if (a->_enchantmentFlags & ((1 << actorDiseased) | (1 << actorPoisoned)))
else if (a->_enchantmentFlags & ((1 << kActorDiseased) | (1 << kActorPoisoned)))
pType = kPortraitSick;
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 << kActorParalyzed) | (1 << kActorFear) | (1 << kActorBlind)))
pType = kPortraitConfused;
else if (isAggressive())
pType = kPortraitAngry;

View File

@ -618,7 +618,7 @@ int16 scriptActorSetOpen( int16 *args )
{
(((ObjectData *)thisThread->_thisObject)->obj)->setFlags(
args[0] ? 0xffff : 0,
objectOpen );
kObjectOpen );
return 0;
}
@ -626,7 +626,7 @@ int16 scriptActorSetLocked( int16 *args )
{
(((ObjectData *)thisThread->_thisObject)->obj)->setFlags(
args[0] ? 0xffff : 0,
objectLocked );
kObjectLocked );
return 0;
}
*/
@ -635,7 +635,7 @@ int16 scriptActorSetImportant(int16 *args) {
OBJLOG(SetImportant);
(((ObjectData *)thisThread->_thisObject)->obj)->setFlags(
args[0] ? (int16) 0xffff : (int16) 0,
objectImportant);
kObjectImportant);
return 0;
}
@ -643,7 +643,7 @@ int16 scriptActorSetScavengable(int16 *args) {
OBJLOG(SetScavengable);
(((ObjectData *)thisThread->_thisObject)->obj)->setFlags(
args[0] ? (int16) 0xffff : (int16) 0,
objectScavengable);
kObjectScavengable);
return 0;
}

View File

@ -430,15 +430,15 @@ bool ProtaganistSensor::check(SenseInfo &info, uint32 senseFlags) {
if (protag->isDead())
continue;
if (senseFlags & (1 << actorBlind))
if (senseFlags & (1 << kActorBlind))
continue;
// This extra test is a HACK to ensure that the center actor
// will be able to sense a protaganist even if the protaganist
// is invisible.
if (!objIsActor || getObject() != getCenterActor()) {
if (!(senseFlags & actorSeeInvis)
&& protag->hasEffect(actorInvisible))
if (!(senseFlags & kActorSeeInvis)
&& protag->hasEffect(kActorInvisible))
continue;
}
@ -487,7 +487,7 @@ bool ObjectSensor::check(SenseInfo &info, uint32 senseFlags) {
for (iter.first(&objToTest);
objToTest != nullptr;
iter.next(&objToTest)) {
if (senseFlags & (1 << actorBlind))
if (senseFlags & (1 << kActorBlind))
continue;
bool objToTestIsActor = isActor(objToTest);
@ -499,7 +499,7 @@ bool ObjectSensor::check(SenseInfo &info, uint32 senseFlags) {
|| getObject() != getCenterActor()
|| !isPlayerActor((Actor *)objToTest))) {
Actor *a = (Actor *) objToTest;
if (!(senseFlags & actorSeeInvis) && a->hasEffect(actorInvisible))
if (!(senseFlags & kActorSeeInvis) && a->hasEffect(kActorInvisible))
continue;
}
// Skip if object is out of _range
@ -571,7 +571,7 @@ bool SpecificObjectSensor::check(SenseInfo &info, uint32 senseFlags) {
GameObject *soughtObject = GameObject::objectAddress(_soughtObjID);
bool objIsActor = isActor(getObject());
if (senseFlags & (1 << actorBlind))
if (senseFlags & (1 << kActorBlind))
return false;
// This extra test is a HACK to ensure that the center actor
@ -582,7 +582,7 @@ bool SpecificObjectSensor::check(SenseInfo &info, uint32 senseFlags) {
|| getObject() != getCenterActor()
|| !isPlayerActor((Actor *)soughtObject))) {
Actor *a = (Actor *) soughtObject;
if (!(senseFlags & actorSeeInvis) && a->hasEffect(actorInvisible))
if (!(senseFlags & kActorSeeInvis) && a->hasEffect(kActorInvisible))
return false;
}
@ -700,7 +700,7 @@ bool SpecificActorSensor::check(SenseInfo &info, uint32 senseFlags) {
assert(isActor(_soughtActor));
bool objIsActor = isActor(getObject());
if (senseFlags & (1 << actorBlind))
if (senseFlags & (1 << kActorBlind))
return false;
// This extra test is a HACK to ensure that the center actor
@ -709,7 +709,7 @@ bool SpecificActorSensor::check(SenseInfo &info, uint32 senseFlags) {
if (!objIsActor
|| getObject() != getCenterActor()
|| !isPlayerActor(_soughtActor)) {
if (!(senseFlags & actorSeeInvis) && _soughtActor->hasEffect(actorInvisible))
if (!(senseFlags & kActorSeeInvis) && _soughtActor->hasEffect(kActorInvisible))
return false;
}

View File

@ -28,7 +28,7 @@
namespace Saga2 {
const uint32 nonActorSenseFlags = actorSeeInvis;
const uint32 nonActorSenseFlags = kActorSeeInvis;
//const size_t maxSensorSize = 24;
const size_t maxSensorSize = 48;

View File

@ -91,9 +91,9 @@ void SpellStuff::addEffect(ResourceSpellEffect *rse) {
ProtoEffect *pe = nullptr;
assert(rse && rse->spell == _master);
switch (rse->effectGroup) {
case effectNone :
case kEffectNone :
return;
case effectAttrib :
case kEffectAttrib :
pe = new ProtoEnchantment(
makeEnchantmentID(
rse->effectGroup,
@ -102,10 +102,10 @@ void SpellStuff::addEffect(ResourceSpellEffect *rse) {
rse->enchTimeLo,
rse->enchTimeHi);
break;
case effectResist :
case effectImmune :
case effectOthers :
case effectNonActor :
case kEffectResist :
case kEffectImmune :
case kEffectOthers :
case kEffectNonActor :
pe = new ProtoEnchantment(
makeEnchantmentID(
rse->effectGroup,
@ -114,7 +114,7 @@ void SpellStuff::addEffect(ResourceSpellEffect *rse) {
rse->enchTimeLo,
rse->enchTimeHi);
break;
case effectDamage :
case kEffectDamage :
pe = new ProtoDamage(
rse->baseDice,
rse->diceSides ? rse->diceSides : 6,
@ -124,7 +124,7 @@ void SpellStuff::addEffect(ResourceSpellEffect *rse) {
0,
rse->targeting & spellTargCaster);
break;
case effectDrains :
case kEffectDrains :
pe = new ProtoDrainage(
rse->baseDice,
rse->diceSides ? rse->diceSides : 6,
@ -134,53 +134,53 @@ void SpellStuff::addEffect(ResourceSpellEffect *rse) {
0,
rse->targeting & spellTargCaster);
break;
case effectTAG :
case kEffectTAG :
pe = new ProtoTAGEffect(
(effectTAGTypes) rse->effectType,
rse->flagSet,
rse->attribModifier);
break;
case effectLocation :
case kEffectLocation :
pe = new ProtoLocationEffect(
(effectLocationTypes) rse->effectType,
(kEffectLocationTypes) rse->effectType,
rse->attribModifier);
break;
case effectSpecial : {
case kEffectSpecial : {
switch (rse->effectType) {
case specialDispellHelpfulEnch : // clears helpful enchantments
case kSpecialDispellHelpfulEnch : // clears helpful enchantments
pe = new ProtoSpecialEffect(DispellProtections, rse->attribModifier);
break;
case specialDispellHarmfulEnch : // clears harmful enchantments
case kSpecialDispellHarmfulEnch : // clears harmful enchantments
pe = new ProtoSpecialEffect(DispellCurses, rse->attribModifier);
break;
case specialKill : // death spell
case kSpecialKill : // death spell
pe = new ProtoSpecialEffect(DeathSpell, rse->attribModifier);
break;
case specialRessurect : // raise dead spell
case kSpecialRessurect : // raise dead spell
pe = new ProtoSpecialEffect(Resurrect, rse->attribModifier);
break;
case specialTeleport : // Teleportation
case kSpecialTeleport : // Teleportation
pe = new ProtoSpecialEffect(TeleportToLocation, rse->attribModifier);
break;
case specialCreateActor : // Create an actor or wall
case kSpecialCreateActor : // Create an actor or wall
pe = new ProtoSpecialEffect(CreateWraith, rse->attribModifier);
break;
case specialSagaFunc : // calls a saga function
case kSpecialSagaFunc : // calls a saga function
pe = new ProtoSpecialEffect(SagaSpellCall, rse->attribModifier);
break;
case specialRejoin : // Create an actor or wall
case kSpecialRejoin : // Create an actor or wall
pe = new ProtoSpecialEffect(Rejoin, rse->attribModifier);
break;
case specialCreateWWisp : // calls a saga function
case kSpecialCreateWWisp : // calls a saga function
pe = new ProtoSpecialEffect(CreateWWisp, rse->attribModifier);
break;
case specialCreateFWisp : // calls a saga function
case kSpecialCreateFWisp : // calls a saga function
pe = new ProtoSpecialEffect(CreateFWisp, rse->attribModifier);
break;
case specialCreateWraith : // calls a saga function
case kSpecialCreateWraith : // calls a saga function
pe = new ProtoSpecialEffect(CreateWraith, rse->attribModifier);
break;
case specialCreateFood : // calls a saga function
case kSpecialCreateFood : // calls a saga function
pe = new ProtoSpecialEffect(CreateFood, rse->attribModifier);
break;
}

View File

@ -45,7 +45,7 @@ static MetaTilePtr prevMeta = nullptr;
void drown(GameObject *obj) {
if (isActor(obj)) {
Actor *a = (Actor *) obj;
if (!a->hasEffect(actorWaterBreathe)) {
if (!a->hasEffect(kActorWaterBreathe)) {
if (g_vm->_rnd->getRandomNumber(drowningDamageOddsYes + drowningDamageOddsNo - 1) > drowningDamageOddsNo - 1) {
a->acceptDamage(a->thisID(), drowningDamagePerFrame);
}
@ -57,7 +57,7 @@ void drown(GameObject *obj) {
void lavaDamage(GameObject *obj) {
if (isActor(obj)) {
Actor *a = (Actor *) obj;
if (a->resists(resistHeat))
if (a->resists(kResistHeat))
return;
}
if (g_vm->_rnd->getRandomNumber(heatDamageOddsYes + heatDamageOddsNo - 1) > heatDamageOddsNo - 1) {
@ -68,7 +68,7 @@ void lavaDamage(GameObject *obj) {
void coldDamage(GameObject *obj) {
if (isActor(obj)) {
Actor *a = (Actor *) obj;
if (a->resists(resistCold))
if (a->resists(kResistCold))
return;
}
if (g_vm->_rnd->getRandomNumber(coldDamageOddsYes + coldDamageOddsNo - 1) > coldDamageOddsNo - 1) {
@ -91,7 +91,7 @@ void terrainDamageBash(GameObject *obj) {
void fallingDamage(GameObject *obj, int16 speed) {
if (isActor(obj)) {
Actor *a = (Actor *) obj;
if (!a->hasEffect(actorSlowFall)) {
if (!a->hasEffect(kActorSlowFall)) {
a->acceptDamage(a->thisID(), (MAX(0, speed - 16)*fallingDamageMult) / fallingDamageDiv);
}
}
@ -792,7 +792,7 @@ int16 checkBlocked(
// check to make sure the actor recognizes terrain
if (!isActor(obj) || !((Actor *) obj)->hasEffect(actorNoncorporeal)) {
if (!isActor(obj) || !((Actor *) obj)->hasEffect(kActorNoncorporeal)) {
TilePoint testLoc = loc;
testLoc.z = MAX<int16>(loc.z, 8);

View File

@ -67,44 +67,44 @@ ProtoEffect *createNewProtoEffect(Common::SeekableReadStream *stream) {
diceSides = 6;
switch (effectGroup) {
case effectNone:
case kEffectNone:
return nullptr;
case effectAttrib:
case kEffectAttrib:
pe = new ProtoEnchantment(makeEnchantmentID(effectGroup, effectType, baseDamage), reserved0, reserved1);
break;
case effectResist:
case effectImmune:
case effectOthers:
case effectNonActor:
case kEffectResist:
case kEffectImmune:
case kEffectOthers:
case kEffectNonActor:
pe = new ProtoEnchantment(makeEnchantmentID(effectGroup, effectType, skillDamage), reserved0, reserved1);
break;
case effectDamage:
case kEffectDamage:
pe = new ProtoDamage(baseDice, diceSides, skillDice, baseDamage,
(effectDamageTypes)effectType, 0, targeting & spellTargCaster, skillDamage);
break;
case effectDrains:
case kEffectDrains:
pe = new ProtoDrainage(baseDice, diceSides, skillDice, baseDamage,
(effectDrainsTypes)effectType, 0, targeting & spellTargCaster);
break;
case effectPoison:
case kEffectPoison:
pe = new ProtoEnchantment(makeEnchantmentID(baseDamage), // poison
reserved0, reserved1);
break;
case effectTAG:
case kEffectTAG:
pe = new ProtoTAGEffect((effectTAGTypes)effectType, skillDamage, baseDamage);
break;
case effectLocation:
pe = new ProtoLocationEffect((effectLocationTypes)effectType, baseDamage);
case kEffectLocation:
pe = new ProtoLocationEffect((kEffectLocationTypes)effectType, baseDamage);
break;
case effectSpecial:
case kEffectSpecial:
pe = new ProtoSpecialEffect(SagaSpellCall, baseDamage);
break;
}
@ -211,7 +211,7 @@ void WeaponStuff::addEffect(Common::SeekableReadStream *stream) {
/*int16 item = */stream->readSint16LE(); // spell ID
int16 effectGroup = stream->readSint16LE(); // effect group
if (effectGroup == effectStrike) {
if (effectGroup == kEffectStrike) {
effectDamageTypes effectType = (effectDamageTypes)stream->readSint16LE(); // effect ID
/*int16 targeting = */stream->readSint16LE(); // targeting
int16 baseDice = stream->readSint16LE(); // base dice