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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -449,7 +449,7 @@ MotionTask *MotionTaskList::newTask(GameObject *obj) {
((Actor *)obj)->_moveTask = mt; ((Actor *)obj)->_moveTask = mt;
} }
obj->_data.objectFlags |= objectMoving; obj->_data.objectFlags |= kObjectMoving;
return mt; 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) if (g_vm->_mTaskList->_nextMT != g_vm->_mTaskList->_list.end() && *(g_vm->_mTaskList->_nextMT) == this)
++g_vm->_mTaskList->_nextMT; ++g_vm->_mTaskList->_nextMT;
_object->_data.objectFlags &= ~objectMoving; _object->_data.objectFlags &= ~kObjectMoving;
if (objObscured(_object)) if (objObscured(_object))
_object->_data.objectFlags |= objectObscured; _object->_data.objectFlags |= kObjectObscured;
else else
_object->_data.objectFlags &= ~objectObscured; _object->_data.objectFlags &= ~kObjectObscured;
if (isActor(_object)) { if (isActor(_object)) {
Actor *a = (Actor *)_object; Actor *a = (Actor *)_object;
@ -4511,7 +4511,7 @@ void MotionTask::updatePositions() {
} else { } else {
moveTaskDone = true; moveTaskDone = true;
a->setInterruptablity(true); a->setInterruptablity(true);
if (!a->hasEffect(actorDisappearOnDeath)) { if (!a->hasEffect(kActorDisappearOnDeath)) {
a->setAction(kActionDead, 0); a->setAction(kActionDead, 0);
a->die(); a->die();
} else { } else {
@ -4523,7 +4523,7 @@ void MotionTask::updatePositions() {
} else if (a->nextAnimationFrame()) { } else if (a->nextAnimationFrame()) {
moveTaskDone = true; moveTaskDone = true;
a->setInterruptablity(true); a->setInterruptablity(true);
if (!a->hasEffect(actorDisappearOnDeath)) { if (!a->hasEffect(kActorDisappearOnDeath)) {
a->setAction(kActionDead, 0); a->setAction(kActionDead, 0);
a->die(); a->die();
} else { } else {
@ -4550,7 +4550,7 @@ bool MotionTask::freeFall(TilePoint &newPos, StandingTileInfo &sti) {
tHeight = tileSlopeHeight(newPos, _object, &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.u = (newPos.u - _object->_data.location.u) * 2 / 3;
_velocity.v = (newPos.v - _object->_data.location.v) * 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 (!isMoving()) {
if (objObscured(this)) { if (objObscured(this)) {
_data.objectFlags |= objectObscured; _data.objectFlags |= kObjectObscured;
} else { } else {
_data.objectFlags &= ~objectObscured; _data.objectFlags &= ~kObjectObscured;
} }
} }
int u = _data.location.u >> kSectorShift; int u = _data.location.u >> kSectorShift;
@ -1062,7 +1062,7 @@ void GameObject::updateImage(ObjectID oldParentID) {
else else
warning("GameObject::updateImage: Invalid Sector (%d, %d))", u, v); warning("GameObject::updateImage: Invalid Sector (%d, %d))", u, v);
} else { } else {
_data.objectFlags &= ~objectObscured; _data.objectFlags &= ~kObjectObscured;
if ((isActor(_data.parentID) if ((isActor(_data.parentID)
&& isPlayerActor((Actor *)parent)) && isPlayerActor((Actor *)parent))
@ -1234,7 +1234,7 @@ ObjectID GameObject::makeAlias(const Location &l) {
if (newObjID != Nothing) { if (newObjID != Nothing) {
GameObject *newObject = objectAddress(newObjID); GameObject *newObject = objectAddress(newObjID);
newObject->_data.objectFlags |= objectAlias; newObject->_data.objectFlags |= kObjectAlias;
} }
return newObjID; return newObjID;
@ -1336,11 +1336,11 @@ void GameObject::deleteObject() {
if (isActor(this)) if (isActor(this))
((Actor *)this)->deleteActor(); ((Actor *)this)->deleteActor();
else if (_data.objectFlags & objectImportant) { else if (_data.objectFlags & kObjectImportant) {
append(ImportantLimbo); append(ImportantLimbo);
_data.parentID = ImportantLimbo; _data.parentID = ImportantLimbo;
importantLimboCount++; importantLimboCount++;
} else if (!(_data.objectFlags & objectNoRecycle)) { } else if (!(_data.objectFlags & kObjectNoRecycle)) {
append(ObjectLimbo); append(ObjectLimbo);
_data.parentID = ObjectLimbo; _data.parentID = ObjectLimbo;
objectLimboCount++; objectLimboCount++;
@ -1407,7 +1407,7 @@ void GameObject::deleteObjectRecursive() {
// Activate this object // Activate this object
void GameObject::activate() { void GameObject::activate() {
if (_data.objectFlags & objectActivated) if (_data.objectFlags & kObjectActivated)
return; return;
debugC(1, kDebugActors, "GameObject::activate %d (%s)", thisID(), objName()); debugC(1, kDebugActors, "GameObject::activate %d (%s)", thisID(), objName());
@ -1415,7 +1415,7 @@ void GameObject::activate() {
ObjectID dObj = thisID(); ObjectID dObj = thisID();
scriptCallFrame scf; scriptCallFrame scf;
_data.objectFlags |= objectActivated; _data.objectFlags |= kObjectActivated;
scf.invokedObject = dObj; scf.invokedObject = dObj;
scf.enactor = dObj; scf.enactor = dObj;
@ -1436,7 +1436,7 @@ void GameObject::activate() {
// Deactivate this object // Deactivate this object
void GameObject::deactivate() { void GameObject::deactivate() {
if (!(_data.objectFlags & objectActivated)) if (!(_data.objectFlags & kObjectActivated))
return; return;
debugC(1, kDebugActors, "GameObject::deactivate %d (%s)", thisID(), objName()); debugC(1, kDebugActors, "GameObject::deactivate %d (%s)", thisID(), objName());
@ -1445,7 +1445,7 @@ void GameObject::deactivate() {
scriptCallFrame scf; scriptCallFrame scf;
// Clear activated flag // Clear activated flag
_data.objectFlags &= ~objectActivated; _data.objectFlags &= ~kObjectActivated;
scf.invokedObject = dObj; scf.invokedObject = dObj;
scf.enactor = dObj; scf.enactor = dObj;
@ -1531,7 +1531,7 @@ void GameObject::updateState() {
// currently at, then raise us up a bit. // currently at, then raise us up a bit.
if (isMoving()) return; if (isMoving()) return;
if (_data.objectFlags & objectFloating) return; if (_data.objectFlags & kObjectFloating) return;
if (tHeight > _data.location.z + kMaxStepHeight) { if (tHeight > _data.location.z + kMaxStepHeight) {
unstickObject(this); unstickObject(this);
@ -2254,11 +2254,11 @@ void GameObject::evalEnchantments() {
} }
} }
#define noMergeFlags (objectImportant|\ #define noMergeFlags (kObjectImportant|\
objectGhosted|\ kObjectGhosted|\
objectInvisible|\ kObjectInvisible|\
objectFloating|\ kObjectFloating|\
objectNoRecycle) kObjectNoRecycle)
int32 GameObject::canStackOrMerge(GameObject *dropObj, GameObject *target) { int32 GameObject::canStackOrMerge(GameObject *dropObj, GameObject *target) {
int32 cSet = dropObj->proto()->containmentSet(); int32 cSet = dropObj->proto()->containmentSet();
@ -4233,12 +4233,12 @@ bool lineOfSight(GameObject *obj1, GameObject *obj2, uint32 terrainMask) {
#if 0 #if 0
if (isActor(obj1)) { if (isActor(obj1)) {
Actor *a1 = (Actor *) obj1; Actor *a1 = (Actor *) obj1;
if (!a1->hasEffect(actorSeeInvis)) { if (!a1->hasEffect(kActorSeeInvis)) {
if (!isActor(obj2) && obj2->isInvisible()) if (!isActor(obj2) && obj2->isInvisible())
return false; return false;
else if (isActor(obj2)) { else if (isActor(obj2)) {
Actor *a2 = (Actor *) obj2; Actor *a2 = (Actor *) obj2;
if (a2->hasEffect(actorInvisible)) if (a2->hasEffect(kActorInvisible))
return false; return false;
} }
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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