SAGA2: Rename more constants in idtypes.h
This commit is contained in:
parent
500a6ba468
commit
2ac1b6f55d
15 changed files with 128 additions and 128 deletions
|
@ -419,9 +419,9 @@ bool ActorProto::acceptDamageAction(
|
||||||
return acceptHealing(dObj, enactor, -damage);
|
return acceptHealing(dObj, enactor, -damage);
|
||||||
|
|
||||||
// Apply applicable armor adjustments
|
// Apply applicable armor adjustments
|
||||||
if (dType == damageImpact
|
if (dType == kDamageImpact
|
||||||
|| dType == damageSlash
|
|| dType == kDamageSlash
|
||||||
|| dType == damageProjectile) {
|
|| dType == kDamageProjectile) {
|
||||||
ArmorAttributes armorAttribs;
|
ArmorAttributes armorAttribs;
|
||||||
|
|
||||||
a->totalArmorAttributes(armorAttribs);
|
a->totalArmorAttributes(armorAttribs);
|
||||||
|
|
|
@ -50,23 +50,23 @@ extern void updateIndicators(void); // Kludge, put in intrface.h later (go
|
||||||
int16 ProtoDamage::getRelevantStat(effectDamageTypes dt, Actor *a) {
|
int16 ProtoDamage::getRelevantStat(effectDamageTypes dt, Actor *a) {
|
||||||
switch (dt) {
|
switch (dt) {
|
||||||
|
|
||||||
case damageImpact :
|
case kDamageImpact :
|
||||||
case damageSlash :
|
case kDamageSlash :
|
||||||
case damageProjectile :
|
case kDamageProjectile :
|
||||||
return a->getStats()->getSkillLevel(skillIDBrawn);
|
return a->getStats()->getSkillLevel(skillIDBrawn);
|
||||||
case damageFire :
|
case kDamageFire :
|
||||||
case damageAcid :
|
case kDamageAcid :
|
||||||
case damageHeat :
|
case kDamageHeat :
|
||||||
case damageCold :
|
case kDamageCold :
|
||||||
case damageLightning :
|
case kDamageLightning :
|
||||||
case damagePoison :
|
case kDamagePoison :
|
||||||
case damageMental :
|
case kDamageMental :
|
||||||
case damageToUndead :
|
case kDamageToUndead :
|
||||||
return a->getStats()->getSkillLevel(skillIDSpellcraft);
|
return a->getStats()->getSkillLevel(skillIDSpellcraft);
|
||||||
case damageDirMagic :
|
case kDamageDirMagic :
|
||||||
case damageOther :
|
case kDamageOther :
|
||||||
case damageStarve :
|
case kDamageStarve :
|
||||||
case damageEnergy :
|
case kDamageEnergy :
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -148,11 +148,11 @@ void ProtoDrainage::drainLevel(GameObject *cst, Actor *a, effectDrainsTypes edt,
|
||||||
{
|
{
|
||||||
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, damageOther);
|
a->acceptDamage(cst->thisID(), amt > 0 ? 1 : -1, kDamageOther);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case drainsVitality:
|
case drainsVitality:
|
||||||
a->acceptDamage(cst->thisID(), amt, damageOther);
|
a->acceptDamage(cst->thisID(), amt, kDamageOther);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -437,7 +437,7 @@ SPECIALSPELL(DeathSpell) {
|
||||||
if (!a->makeSavingThrow()) {
|
if (!a->makeSavingThrow()) {
|
||||||
a->acceptDamage(cst->thisID(),
|
a->acceptDamage(cst->thisID(),
|
||||||
a->effectiveStats.vitality,
|
a->effectiveStats.vitality,
|
||||||
damageEnergy, 1, 2, 0);
|
kDamageEnergy, 1, 2, 0);
|
||||||
a->die();
|
a->die();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,26 +83,26 @@ enum effectTypes {
|
||||||
//
|
//
|
||||||
|
|
||||||
enum effectResistTypes {
|
enum effectResistTypes {
|
||||||
resistOther = damageOther,
|
resistOther = kDamageOther,
|
||||||
// Combat resist
|
// Combat resist
|
||||||
resistImpact = damageImpact,
|
resistImpact = kDamageImpact,
|
||||||
resistSlash = damageSlash,
|
resistSlash = kDamageSlash,
|
||||||
resistProjectile = damageProjectile,
|
resistProjectile = kDamageProjectile,
|
||||||
// Magic resist
|
// Magic resist
|
||||||
resistFire = damageFire,
|
resistFire = kDamageFire,
|
||||||
resistAcid = damageAcid,
|
resistAcid = kDamageAcid,
|
||||||
resistHeat = damageHeat,
|
resistHeat = kDamageHeat,
|
||||||
resistCold = damageCold,
|
resistCold = kDamageCold,
|
||||||
resistLightning = damageLightning,
|
resistLightning = kDamageLightning,
|
||||||
resistPoison = damagePoison,
|
resistPoison = kDamagePoison,
|
||||||
// Other magic resist
|
// Other magic resist
|
||||||
resistMental = damageMental,
|
resistMental = kDamageMental,
|
||||||
resistToUndead = damageToUndead,
|
resistToUndead = kDamageToUndead,
|
||||||
resistDirMagic = damageDirMagic,
|
resistDirMagic = kDamageDirMagic,
|
||||||
// Physiological Damage
|
// Physiological Damage
|
||||||
resistStarve = damageStarve,
|
resistStarve = kDamageStarve,
|
||||||
// other
|
// other
|
||||||
resistEnergy = damageEnergy,
|
resistEnergy = kDamageEnergy,
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -339,7 +339,7 @@ inline bool isSaveable(uint16 enchID) {
|
||||||
// Determine whether a damage type is magical
|
// Determine whether a damage type is magical
|
||||||
|
|
||||||
inline bool isMagicDamage(effectDamageTypes t) {
|
inline bool isMagicDamage(effectDamageTypes t) {
|
||||||
return t >= damageFire && t <= damageDirMagic;
|
return t >= kDamageFire && t <= kDamageDirMagic;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define Forever (255)
|
#define Forever (255)
|
||||||
|
|
|
@ -241,26 +241,26 @@ enum {
|
||||||
//
|
//
|
||||||
enum effectDamageTypes {
|
enum effectDamageTypes {
|
||||||
// Generic
|
// Generic
|
||||||
damageOther = 0, // Healing, cause wounds
|
kDamageOther = 0, // Healing, cause wounds
|
||||||
// Combat damage
|
// Combat damage
|
||||||
damageImpact = 1, // hammers, maces
|
kDamageImpact = 1, // hammers, maces
|
||||||
damageSlash = 2, // swords
|
kDamageSlash = 2, // swords
|
||||||
damageProjectile = 3, // arrows, poin-ted sticks
|
kDamageProjectile = 3, // arrows, poin-ted sticks
|
||||||
// Magic damage
|
// Magic damage
|
||||||
damageFire = 4, // Yellow
|
kDamageFire = 4, // Yellow
|
||||||
damageAcid = 5, // Violet
|
kDamageAcid = 5, // Violet
|
||||||
damageHeat = 6, // Red
|
kDamageHeat = 6, // Red
|
||||||
damageCold = 7, // Blue
|
kDamageCold = 7, // Blue
|
||||||
damageLightning = 8, // Orange
|
kDamageLightning = 8, // Orange
|
||||||
damagePoison = 9, // Green
|
kDamagePoison = 9, // Green
|
||||||
// Other magic damage
|
// Other magic damage
|
||||||
damageMental = 10, // dain bramage
|
kDamageMental = 10, // dain bramage
|
||||||
damageToUndead = 11, // undead take this damage
|
kDamageToUndead = 11, // undead take this damage
|
||||||
damageDirMagic = 12, // the plusses on swords etc.
|
kDamageDirMagic = 12, // the plusses on swords etc.
|
||||||
// Physiological Damage
|
// Physiological Damage
|
||||||
damageStarve = 13, // You must eat!
|
kDamageStarve = 13, // You must eat!
|
||||||
// other
|
// other
|
||||||
damageEnergy = 14 // Generally hard to resist - god damage
|
kDamageEnergy = 14 // Generally hard to resist - god damage
|
||||||
};
|
};
|
||||||
|
|
||||||
// Tile metrics
|
// Tile metrics
|
||||||
|
@ -336,10 +336,10 @@ enum {
|
||||||
|
|
||||||
// Maximum height that a character can climb w/o steps or ladders
|
// Maximum height that a character can climb w/o steps or ladders
|
||||||
enum {
|
enum {
|
||||||
maxStepHeight = 16, // highest climbable step
|
kMaxStepHeight = 16, // highest climbable step
|
||||||
maxPickHeight = 64, // highest pickable step
|
kMaxPickHeight = 64, // highest pickable step
|
||||||
maxSmoothStep = 8, // highest smoothly climbable
|
kMaxSmoothStep = 8, // highest smoothly climbable
|
||||||
maxJumpStep = 64 // highest jump character likes
|
kMaxJumpStep = 64 // highest jump character likes
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end of namespace Saga2
|
} // end of namespace Saga2
|
||||||
|
|
|
@ -2893,37 +2893,37 @@ void gEnchantmentDisplay::setValue(PlayerActorID pID) {
|
||||||
case effectResist:
|
case effectResist:
|
||||||
|
|
||||||
switch (eSubType) {
|
switch (eSubType) {
|
||||||
case damageImpact:
|
case kDamageImpact:
|
||||||
newIconFlags[iconResistImpact] = duration;
|
newIconFlags[iconResistImpact] = duration;
|
||||||
break;
|
break;
|
||||||
case damageSlash:
|
case kDamageSlash:
|
||||||
newIconFlags[iconResistSlash] = duration;
|
newIconFlags[iconResistSlash] = duration;
|
||||||
break;
|
break;
|
||||||
case damageProjectile:
|
case kDamageProjectile:
|
||||||
newIconFlags[iconResistProjectile] = duration;
|
newIconFlags[iconResistProjectile] = duration;
|
||||||
break;
|
break;
|
||||||
case damageFire:
|
case kDamageFire:
|
||||||
newIconFlags[iconResistFire] = duration;
|
newIconFlags[iconResistFire] = duration;
|
||||||
break;
|
break;
|
||||||
case damageAcid:
|
case kDamageAcid:
|
||||||
newIconFlags[iconResistAcid] = duration;
|
newIconFlags[iconResistAcid] = duration;
|
||||||
break;
|
break;
|
||||||
case damageHeat:
|
case kDamageHeat:
|
||||||
newIconFlags[iconResistHeat] = duration;
|
newIconFlags[iconResistHeat] = duration;
|
||||||
break;
|
break;
|
||||||
case damageCold:
|
case kDamageCold:
|
||||||
newIconFlags[iconResistCold] = duration;
|
newIconFlags[iconResistCold] = duration;
|
||||||
break;
|
break;
|
||||||
case damageLightning:
|
case kDamageLightning:
|
||||||
newIconFlags[iconResistLightning] = duration;
|
newIconFlags[iconResistLightning] = duration;
|
||||||
break;
|
break;
|
||||||
case damagePoison:
|
case kDamagePoison:
|
||||||
newIconFlags[iconResistPoison] = duration;
|
newIconFlags[iconResistPoison] = duration;
|
||||||
break;
|
break;
|
||||||
case damageMental:
|
case kDamageMental:
|
||||||
newIconFlags[iconResistPsionic] = duration;
|
newIconFlags[iconResistPsionic] = duration;
|
||||||
break;
|
break;
|
||||||
case damageDirMagic:
|
case kDamageDirMagic:
|
||||||
newIconFlags[iconResistDirectMagic] = duration;
|
newIconFlags[iconResistDirectMagic] = duration;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2931,31 +2931,31 @@ void gEnchantmentDisplay::setValue(PlayerActorID pID) {
|
||||||
|
|
||||||
case effectImmune:
|
case effectImmune:
|
||||||
switch (eSubType) {
|
switch (eSubType) {
|
||||||
case damageImpact:
|
case kDamageImpact:
|
||||||
newIconFlags[iconIronskin] = duration;
|
newIconFlags[iconIronskin] = duration;
|
||||||
break;
|
break;
|
||||||
case damageSlash:
|
case kDamageSlash:
|
||||||
newIconFlags[iconIronskin] = duration;
|
newIconFlags[iconIronskin] = duration;
|
||||||
break;
|
break;
|
||||||
case damageFire:
|
case kDamageFire:
|
||||||
newIconFlags[iconImmuneFire] = duration;
|
newIconFlags[iconImmuneFire] = duration;
|
||||||
break;
|
break;
|
||||||
case damageAcid:
|
case kDamageAcid:
|
||||||
newIconFlags[iconImmuneAcid] = duration;
|
newIconFlags[iconImmuneAcid] = duration;
|
||||||
break;
|
break;
|
||||||
case damageHeat:
|
case kDamageHeat:
|
||||||
newIconFlags[iconImmuneHeat] = duration;
|
newIconFlags[iconImmuneHeat] = duration;
|
||||||
break;
|
break;
|
||||||
case damageCold:
|
case kDamageCold:
|
||||||
newIconFlags[iconImmuneCold] = duration;
|
newIconFlags[iconImmuneCold] = duration;
|
||||||
break;
|
break;
|
||||||
case damageLightning:
|
case kDamageLightning:
|
||||||
newIconFlags[iconImmuneLightning] = duration;
|
newIconFlags[iconImmuneLightning] = duration;
|
||||||
break;
|
break;
|
||||||
case damagePoison:
|
case kDamagePoison:
|
||||||
newIconFlags[iconImmunePoison] = duration;
|
newIconFlags[iconImmunePoison] = duration;
|
||||||
break;
|
break;
|
||||||
case damageMental:
|
case kDamageMental:
|
||||||
newIconFlags[iconImmunePsionic] = duration;
|
newIconFlags[iconImmunePsionic] = duration;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -268,8 +268,8 @@ bool unstickObject(GameObject *obj) {
|
||||||
|
|
||||||
// If the surface height is too far away from the sample
|
// If the surface height is too far away from the sample
|
||||||
// height, then ignore it.
|
// height, then ignore it.
|
||||||
if (tHeight > pos.z + maxStepHeight
|
if (tHeight > pos.z + kMaxStepHeight
|
||||||
|| tHeight < pos.z - maxStepHeight * 4) continue;
|
|| tHeight < pos.z - kMaxStepHeight * 4) continue;
|
||||||
|
|
||||||
// Recompute the coordinate
|
// Recompute the coordinate
|
||||||
dz = tHeight - objZ;
|
dz = tHeight - objZ;
|
||||||
|
@ -324,8 +324,8 @@ bool unstickObject(GameObject *obj) {
|
||||||
int16 tHeight;
|
int16 tHeight;
|
||||||
|
|
||||||
tHeight = tileSlopeHeight(pos, obj);
|
tHeight = tileSlopeHeight(pos, obj);
|
||||||
if (tHeight <= pos.z + maxStepHeight
|
if (tHeight <= pos.z + kMaxStepHeight
|
||||||
&& tHeight >= pos.z - maxStepHeight * 4) {
|
&& tHeight >= pos.z - kMaxStepHeight * 4) {
|
||||||
pos.z = tHeight;
|
pos.z = tHeight;
|
||||||
obj->move(pos);
|
obj->move(pos);
|
||||||
return true;
|
return true;
|
||||||
|
@ -2466,7 +2466,7 @@ bool MotionTask::nextWayPoint(void) {
|
||||||
// use dumb pathfinding until the pathfinder finishes it's task.
|
// use dumb pathfinding until the pathfinder finishes it's task.
|
||||||
|
|
||||||
if ((finalTarget - object->location).quickHDistance() > 0
|
if ((finalTarget - object->location).quickHDistance() > 0
|
||||||
|| abs(finalTarget.z - object->location.z) > maxStepHeight) {
|
|| abs(finalTarget.z - object->location.z) > kMaxStepHeight) {
|
||||||
// If no pathfind in progress
|
// If no pathfind in progress
|
||||||
if ((flags & pathFind)
|
if ((flags & pathFind)
|
||||||
&& !(flags & finalPath)
|
&& !(flags & finalPath)
|
||||||
|
@ -2621,7 +2621,7 @@ void MotionTask::walkAction(void) {
|
||||||
|
|
||||||
// If we're not already there, then proceed towards
|
// If we're not already there, then proceed towards
|
||||||
// the target.
|
// the target.
|
||||||
if (targetDist > 0 || abs(targetVector.z) > maxStepHeight)
|
if (targetDist > 0 || abs(targetVector.z) > kMaxStepHeight)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2681,7 +2681,7 @@ void MotionTask::walkAction(void) {
|
||||||
|
|
||||||
if (moveTaskDone || moveTaskWaiting) {
|
if (moveTaskDone || moveTaskWaiting) {
|
||||||
movementDirection = a->currentFacing;
|
movementDirection = a->currentFacing;
|
||||||
} else if (targetDist == 0 && abs(targetVector.z) > maxStepHeight) {
|
} else if (targetDist == 0 && abs(targetVector.z) > kMaxStepHeight) {
|
||||||
if (pathFindTask)
|
if (pathFindTask)
|
||||||
moveTaskWaiting = true;
|
moveTaskWaiting = true;
|
||||||
else {
|
else {
|
||||||
|
@ -2712,7 +2712,7 @@ void MotionTask::walkAction(void) {
|
||||||
// Test the terrain to see if we can go there.
|
// Test the terrain to see if we can go there.
|
||||||
if ((blockageType = checkWalkable(object, newPos)) != false) {
|
if ((blockageType = checkWalkable(object, newPos)) != false) {
|
||||||
// Try stepping up to a higher terrain too.
|
// Try stepping up to a higher terrain too.
|
||||||
newPos.z = object->location.z + maxStepHeight;
|
newPos.z = object->location.z + kMaxStepHeight;
|
||||||
if (checkWalkable(object, newPos) != blockageNone) {
|
if (checkWalkable(object, newPos) != blockageNone) {
|
||||||
// If there is a path find task pending, put the walk action
|
// If there is a path find task pending, put the walk action
|
||||||
// on hold until it finishes, else, abort the walk action.
|
// on hold until it finishes, else, abort the walk action.
|
||||||
|
@ -2749,7 +2749,7 @@ void MotionTask::walkAction(void) {
|
||||||
// Check the terrain in various directions.
|
// Check the terrain in various directions.
|
||||||
// Check in the forward direction first, at various heights
|
// Check in the forward direction first, at various heights
|
||||||
|
|
||||||
for (height = 0; height <= maxStepHeight; height += maxSmoothStep) {
|
for (height = 0; height <= kMaxStepHeight; height += kMaxSmoothStep) {
|
||||||
// This code has him move along the exact direction
|
// This code has him move along the exact direction
|
||||||
// vector, even if it's not aligned with one of the
|
// vector, even if it's not aligned with one of the
|
||||||
// cardinal directions.
|
// cardinal directions.
|
||||||
|
@ -2771,7 +2771,7 @@ void MotionTask::walkAction(void) {
|
||||||
int16 leftDir = spinLeft(movementDirection),
|
int16 leftDir = spinLeft(movementDirection),
|
||||||
rightDir = spinRight(movementDirection);
|
rightDir = spinRight(movementDirection);
|
||||||
|
|
||||||
for (height = 0; height <= maxStepHeight; height += 8) {
|
for (height = 0; height <= kMaxStepHeight; height += 8) {
|
||||||
if (checkWalk(rightDir, speedScale, height, newPos)) {
|
if (checkWalk(rightDir, speedScale, height, newPos)) {
|
||||||
movementDirection = rightDir;
|
movementDirection = rightDir;
|
||||||
foundPath = true;
|
foundPath = true;
|
||||||
|
@ -2887,7 +2887,7 @@ void MotionTask::walkAction(void) {
|
||||||
// This is a kludge to keep the character from
|
// This is a kludge to keep the character from
|
||||||
// "jumping" as he climbs up a small step.
|
// "jumping" as he climbs up a small step.
|
||||||
|
|
||||||
if (tHeight >= object->location.z - maxSmoothStep
|
if (tHeight >= object->location.z - kMaxSmoothStep
|
||||||
* ((sti.surfaceTile != NULL
|
* ((sti.surfaceTile != NULL
|
||||||
&& (sti.surfaceTile->combinedTerrainMask() & terrainStair))
|
&& (sti.surfaceTile->combinedTerrainMask() & terrainStair))
|
||||||
? 4
|
? 4
|
||||||
|
@ -4719,7 +4719,7 @@ supported:
|
||||||
if (motionType != motionTypeWalk
|
if (motionType != motionTypeWalk
|
||||||
|| tHeight <= newPos.z
|
|| tHeight <= newPos.z
|
||||||
|| !(flags & inWater)) {
|
|| !(flags & inWater)) {
|
||||||
if (tHeight > newPos.z + maxStepHeight) {
|
if (tHeight > newPos.z + kMaxStepHeight) {
|
||||||
unstickObject(object);
|
unstickObject(object);
|
||||||
tHeight = tileSlopeHeight(newPos, object, &sti);
|
tHeight = tileSlopeHeight(newPos, object, &sti);
|
||||||
}
|
}
|
||||||
|
@ -4791,7 +4791,7 @@ falling:
|
||||||
|
|
||||||
tPos.u += objCrossSection;
|
tPos.u += objCrossSection;
|
||||||
tHeight = tileSlopeHeight(tPos, object, &sti);
|
tHeight = tileSlopeHeight(tPos, object, &sti);
|
||||||
if (tHeight <= tPos.z + maxStepHeight
|
if (tHeight <= tPos.z + kMaxStepHeight
|
||||||
&& tHeight >= tPos.z - gravity * 4) {
|
&& tHeight >= tPos.z - gravity * 4) {
|
||||||
newPos = tPos;
|
newPos = tPos;
|
||||||
goto supported;
|
goto supported;
|
||||||
|
@ -4799,7 +4799,7 @@ falling:
|
||||||
|
|
||||||
tPos.u -= objCrossSection * 2;
|
tPos.u -= objCrossSection * 2;
|
||||||
tHeight = tileSlopeHeight(tPos, object, &sti);
|
tHeight = tileSlopeHeight(tPos, object, &sti);
|
||||||
if (tHeight <= tPos.z + maxStepHeight
|
if (tHeight <= tPos.z + kMaxStepHeight
|
||||||
&& tHeight >= tPos.z - gravity * 4) {
|
&& tHeight >= tPos.z - gravity * 4) {
|
||||||
newPos = tPos;
|
newPos = tPos;
|
||||||
goto supported;
|
goto supported;
|
||||||
|
@ -4808,7 +4808,7 @@ falling:
|
||||||
tPos.u += objCrossSection;
|
tPos.u += objCrossSection;
|
||||||
tPos.v += objCrossSection;
|
tPos.v += objCrossSection;
|
||||||
tHeight = tileSlopeHeight(tPos, object, &sti);
|
tHeight = tileSlopeHeight(tPos, object, &sti);
|
||||||
if (tHeight <= tPos.z + maxStepHeight
|
if (tHeight <= tPos.z + kMaxStepHeight
|
||||||
&& tHeight >= tPos.z - gravity * 4) {
|
&& tHeight >= tPos.z - gravity * 4) {
|
||||||
newPos = tPos;
|
newPos = tPos;
|
||||||
goto supported;
|
goto supported;
|
||||||
|
@ -4816,7 +4816,7 @@ falling:
|
||||||
|
|
||||||
tPos.v -= objCrossSection * 2;
|
tPos.v -= objCrossSection * 2;
|
||||||
tHeight = tileSlopeHeight(tPos, object, &sti);
|
tHeight = tileSlopeHeight(tPos, object, &sti);
|
||||||
if (tHeight <= tPos.z + maxStepHeight
|
if (tHeight <= tPos.z + kMaxStepHeight
|
||||||
&& tHeight >= tPos.z - gravity * 4) {
|
&& tHeight >= tPos.z - gravity * 4) {
|
||||||
newPos = tPos;
|
newPos = tPos;
|
||||||
goto supported;
|
goto supported;
|
||||||
|
@ -4941,7 +4941,7 @@ bool checkLadder(Actor *a, const TilePoint &loc) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (loc.z
|
if (loc.z
|
||||||
< tileSlopeHeight(a->getLocation(), a) + maxStepHeight)
|
< tileSlopeHeight(a->getLocation(), a) + kMaxStepHeight)
|
||||||
MotionTask::upLadder(*a);
|
MotionTask::upLadder(*a);
|
||||||
else
|
else
|
||||||
MotionTask::downLadder(*a);
|
MotionTask::downLadder(*a);
|
||||||
|
|
|
@ -1442,7 +1442,7 @@ void GameObject::updateState(void) {
|
||||||
|
|
||||||
if (objectFlags & objectFloating) return;
|
if (objectFlags & objectFloating) return;
|
||||||
|
|
||||||
if (tHeight > location.z + maxStepHeight) {
|
if (tHeight > location.z + kMaxStepHeight) {
|
||||||
unstickObject(this);
|
unstickObject(this);
|
||||||
tHeight = tileSlopeHeight(location, this, &sti);
|
tHeight = tileSlopeHeight(location, this, &sti);
|
||||||
}
|
}
|
||||||
|
@ -4200,7 +4200,7 @@ GameObject *objectCollision(GameObject *obj, GameWorld *world, const TilePoint &
|
||||||
volume.max.z = loc.z + proto->height;
|
volume.max.z = loc.z + proto->height;
|
||||||
|
|
||||||
// Adjust MIN Z for the fact that they can step over obstacles.
|
// Adjust MIN Z for the fact that they can step over obstacles.
|
||||||
if (isActor(obj)) volume.min.z += maxStepHeight / 2;
|
if (isActor(obj)) volume.min.z += kMaxStepHeight / 2;
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
CircularObjectIterator iter(world, loc, proto->crossSection + 32);
|
CircularObjectIterator iter(world, loc, proto->crossSection + 32);
|
||||||
|
|
|
@ -393,7 +393,7 @@ public:
|
||||||
bool acceptDamage(
|
bool acceptDamage(
|
||||||
ObjectID enactor,
|
ObjectID enactor,
|
||||||
int8 absDamage,
|
int8 absDamage,
|
||||||
effectDamageTypes dType = damageOther,
|
effectDamageTypes dType = kDamageOther,
|
||||||
int8 dice = 0,
|
int8 dice = 0,
|
||||||
uint8 sides = 1,
|
uint8 sides = 1,
|
||||||
int8 perDieMod = 0) {
|
int8 perDieMod = 0) {
|
||||||
|
|
|
@ -2787,7 +2787,7 @@ void EnchantmentProto::doBackgroundUpdate(GameObject *obj) {
|
||||||
int16 damage = getEnchantmentAmount(flags);
|
int16 damage = getEnchantmentAmount(flags);
|
||||||
|
|
||||||
// apply the damage
|
// apply the damage
|
||||||
parentObj->acceptDamage(obj->thisID(), damage, damagePoison);
|
parentObj->acceptDamage(obj->thisID(), damage, kDamagePoison);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -446,7 +446,7 @@ public:
|
||||||
ObjectID dObj,
|
ObjectID dObj,
|
||||||
ObjectID enactor,
|
ObjectID enactor,
|
||||||
int8 absDamage,
|
int8 absDamage,
|
||||||
effectDamageTypes dType = damageOther,
|
effectDamageTypes dType = kDamageOther,
|
||||||
int8 dice = 0,
|
int8 dice = 0,
|
||||||
uint8 sides = 1,
|
uint8 sides = 1,
|
||||||
int8 perDieMod = 0);
|
int8 perDieMod = 0);
|
||||||
|
|
|
@ -917,7 +917,7 @@ uint32 tileTerrain(
|
||||||
|
|
||||||
// If only checking the top of raised terrain treat it
|
// If only checking the top of raised terrain treat it
|
||||||
// as if it were normal terrain.
|
// as if it were normal terrain.
|
||||||
if (minZ + maxStepHeight >= tileMaxZ) {
|
if (minZ + kMaxStepHeight >= tileMaxZ) {
|
||||||
if (tileFgdTerrain & terrainSupportingRaised)
|
if (tileFgdTerrain & terrainSupportingRaised)
|
||||||
tileFgdTerrain = terrainNormal;
|
tileFgdTerrain = terrainNormal;
|
||||||
if (tileBgdTerrain & terrainSupportingRaised)
|
if (tileBgdTerrain & terrainSupportingRaised)
|
||||||
|
@ -934,7 +934,7 @@ uint32 tileTerrain(
|
||||||
// catwalks and other surfaces which have no bottom.
|
// catwalks and other surfaces which have no bottom.
|
||||||
|
|
||||||
if ((terrainResult & terrainSolidSurface)
|
if ((terrainResult & terrainSolidSurface)
|
||||||
&& height > minZ + maxStepHeight) {
|
&& height > minZ + kMaxStepHeight) {
|
||||||
terrainResult |= terrainStone;
|
terrainResult |= terrainStone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1594,7 +1594,7 @@ big_break:
|
||||||
|
|
||||||
// If the height difference is too great skip this tile
|
// If the height difference is too great skip this tile
|
||||||
// position
|
// position
|
||||||
if (abs(quantizedCoords.z - startingCoords.z) > maxStepHeight)
|
if (abs(quantizedCoords.z - startingCoords.z) > kMaxStepHeight)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Compute initial cost based upon the distance from the
|
// Compute initial cost based upon the distance from the
|
||||||
|
@ -1646,7 +1646,7 @@ void PathRequest::finish(void) {
|
||||||
|
|
||||||
if (cell->direction != dirInvalid) {
|
if (cell->direction != dirInvalid) {
|
||||||
if (cell->direction != prevDir
|
if (cell->direction != prevDir
|
||||||
|| abs(cell->height - prevHeight) > maxStepHeight) {
|
|| abs(cell->height - prevHeight) > kMaxStepHeight) {
|
||||||
if (res <= tempResult) break;
|
if (res <= tempResult) break;
|
||||||
|
|
||||||
coords.u =
|
coords.u =
|
||||||
|
@ -1871,7 +1871,7 @@ PathResult PathRequest::findPath(void) {
|
||||||
&testPlatform);
|
&testPlatform);
|
||||||
|
|
||||||
// Determine if elevation change is too great
|
// Determine if elevation change is too great
|
||||||
if (abs(testPt.z - prevZ) <= maxStepHeight)
|
if (abs(testPt.z - prevZ) <= kMaxStepHeight)
|
||||||
prevZ = testPt.z;
|
prevZ = testPt.z;
|
||||||
else
|
else
|
||||||
goto big_continue;
|
goto big_continue;
|
||||||
|
@ -1917,7 +1917,7 @@ PathResult PathRequest::findPath(void) {
|
||||||
&& trv->min.v < actorVolume.max.v
|
&& trv->min.v < actorVolume.max.v
|
||||||
&& actorVolume.min.v < trv->max.v
|
&& actorVolume.min.v < trv->max.v
|
||||||
&& trv->min.z < actorVolume.max.z
|
&& trv->min.z < actorVolume.max.z
|
||||||
&& actorVolume.min.z + maxStepHeight
|
&& actorVolume.min.z + kMaxStepHeight
|
||||||
< trv->max.z)
|
< trv->max.z)
|
||||||
goto big_continue;
|
goto big_continue;
|
||||||
}
|
}
|
||||||
|
@ -2002,8 +2002,8 @@ PathResult PathRequest::findPath(void) {
|
||||||
// (i.e. don't jmup off of cliffs). Also we can
|
// (i.e. don't jmup off of cliffs). Also we can
|
||||||
// only climb steps below a certain height.
|
// only climb steps below a certain height.
|
||||||
|
|
||||||
// if ( testPt.z < centerPt.z - maxJumpStep
|
// if ( testPt.z < centerPt.z - kMaxJumpStep
|
||||||
// || testPt.z > centerPt.z + maxStepHeight)
|
// || testPt.z > centerPt.z + kMaxStepHeight)
|
||||||
// continue;
|
// continue;
|
||||||
|
|
||||||
// Turns are expensive, the sharper turns are more so.
|
// Turns are expensive, the sharper turns are more so.
|
||||||
|
@ -2136,7 +2136,7 @@ bool DestinationPathRequest::setCenter(
|
||||||
bestDist = centerCost;
|
bestDist = centerCost;
|
||||||
|
|
||||||
// If we're at target square, then we're done!
|
// If we're at target square, then we're done!
|
||||||
if (dist == 0 && zDist <= maxStepHeight) {
|
if (dist == 0 && zDist <= kMaxStepHeight) {
|
||||||
flags |= PathRequest::completed;
|
flags |= PathRequest::completed;
|
||||||
|
|
||||||
// Return true to indicate that the path finding is done.
|
// Return true to indicate that the path finding is done.
|
||||||
|
@ -2541,7 +2541,7 @@ TilePoint selectNearbySite(
|
||||||
// If the object is higher than the actor's head, or
|
// If the object is higher than the actor's head, or
|
||||||
// low enough to step over, then ignore it.
|
// low enough to step over, then ignore it.
|
||||||
if (objLoc.z >= startingCoords.z + 80
|
if (objLoc.z >= startingCoords.z + 80
|
||||||
|| objLoc.z + objProto->height <= startingCoords.z + maxStepHeight / 2) {
|
|| objLoc.z + objProto->height <= startingCoords.z + kMaxStepHeight / 2) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2665,7 +2665,7 @@ TilePoint selectNearbySite(
|
||||||
testPt.z = tileSlopeHeight(testPt, mapNum, 68, &sti);
|
testPt.z = tileSlopeHeight(testPt, mapNum, 68, &sti);
|
||||||
|
|
||||||
// If it's too high to step, then don't continue
|
// If it's too high to step, then don't continue
|
||||||
// if (testPt.z - qi.z > maxStepHeight) continue;
|
// if (testPt.z - qi.z > kMaxStepHeight) continue;
|
||||||
fromSubPt = centerPt;
|
fromSubPt = centerPt;
|
||||||
for (i = 0; i < kTileSubSize; i++) {
|
for (i = 0; i < kTileSubSize; i++) {
|
||||||
int16 deltaZ;
|
int16 deltaZ;
|
||||||
|
@ -2677,7 +2677,7 @@ TilePoint selectNearbySite(
|
||||||
deltaZ = toSubPt.z - fromSubPt.z;
|
deltaZ = toSubPt.z - fromSubPt.z;
|
||||||
|
|
||||||
// If it's too high to step, then don't continue
|
// If it's too high to step, then don't continue
|
||||||
if (deltaZ > maxStepHeight || deltaZ < -(maxStepHeight * 2)) {
|
if (deltaZ > kMaxStepHeight || deltaZ < -(kMaxStepHeight * 2)) {
|
||||||
traversable = false;
|
traversable = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2877,7 +2877,7 @@ bool checkPath(
|
||||||
|
|
||||||
// If the height difference is too great skip this tile
|
// If the height difference is too great skip this tile
|
||||||
// position
|
// position
|
||||||
if (abs(quantizedCoords.z - startingCoords.z) > maxStepHeight)
|
if (abs(quantizedCoords.z - startingCoords.z) > kMaxStepHeight)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Compute initial cost based upon the distance from the
|
// Compute initial cost based upon the distance from the
|
||||||
|
@ -2971,7 +2971,7 @@ bool checkPath(
|
||||||
deltaZ = toSubPt.z - fromSubPt.z;
|
deltaZ = toSubPt.z - fromSubPt.z;
|
||||||
|
|
||||||
// If it's too high to step, then don't continue
|
// If it's too high to step, then don't continue
|
||||||
if (deltaZ > maxStepHeight || deltaZ < -(maxStepHeight * 2)) {
|
if (deltaZ > kMaxStepHeight || deltaZ < -(kMaxStepHeight * 2)) {
|
||||||
traversable = false;
|
traversable = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -3004,7 +3004,7 @@ bool checkPath(
|
||||||
// If the resulting height is significantly different
|
// If the resulting height is significantly different
|
||||||
// from the destination height, assume we're on a
|
// from the destination height, assume we're on a
|
||||||
// different level and return false.
|
// different level and return false.
|
||||||
return abs(testPt.z - destCoords.z) <= maxStepHeight;
|
return abs(testPt.z - destCoords.z) <= kMaxStepHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1018,7 +1018,7 @@ GameObject *objectNollision(Effectron *obj, const TilePoint &loc) {
|
||||||
volume.max.z = loc.z + obj->hgtCall();
|
volume.max.z = loc.z + obj->hgtCall();
|
||||||
|
|
||||||
// Adjust MIN Z for the fact that they can step over obstacles.
|
// Adjust MIN Z for the fact that they can step over obstacles.
|
||||||
//if ( isActor( obj )) volume.min.z += maxStepHeight / 2;
|
//if ( isActor( obj )) volume.min.z += kMaxStepHeight / 2;
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
CircularObjectIterator iter(obj->world(), loc, obj->brdCall() + 32);
|
CircularObjectIterator iter(obj->world(), loc, obj->brdCall() + 32);
|
||||||
|
|
|
@ -4362,7 +4362,7 @@ bool BandTask::atTarget(void) {
|
||||||
TilePoint actorLoc = stack->getActor()->getLocation();
|
TilePoint actorLoc = stack->getActor()->getLocation();
|
||||||
|
|
||||||
if ((actorLoc - currentTarget).quickHDistance() > 6
|
if ((actorLoc - currentTarget).quickHDistance() > 6
|
||||||
|| abs(actorLoc.z - currentTarget.z) > maxStepHeight) {
|
|| abs(actorLoc.z - currentTarget.z) > kMaxStepHeight) {
|
||||||
if (attend != NULL) {
|
if (attend != NULL) {
|
||||||
attend->abortTask();
|
attend->abortTask();
|
||||||
delete attend;
|
delete attend;
|
||||||
|
@ -4699,7 +4699,7 @@ TaskResult FollowPatrolRouteTask::handleFollowPatrolRoute(void) {
|
||||||
== (currentWayPoint.u >> kTileUVShift)
|
== (currentWayPoint.u >> kTileUVShift)
|
||||||
&& (actorLoc.v >> kTileUVShift)
|
&& (actorLoc.v >> kTileUVShift)
|
||||||
== (currentWayPoint.v >> kTileUVShift)
|
== (currentWayPoint.v >> kTileUVShift)
|
||||||
&& abs(actorLoc.z - currentWayPoint.z) <= maxStepHeight) {
|
&& abs(actorLoc.z - currentWayPoint.z) <= kMaxStepHeight) {
|
||||||
// Delete the gotoWayPoint task
|
// Delete the gotoWayPoint task
|
||||||
if (gotoWayPoint != NULL) {
|
if (gotoWayPoint != NULL) {
|
||||||
gotoWayPoint->abortTask();
|
gotoWayPoint->abortTask();
|
||||||
|
|
|
@ -64,7 +64,7 @@ void lavaDamage(GameObject *obj) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (g_vm->_rnd->getRandomNumber(heatDamageOddsYes + heatDamageOddsNo - 1) > heatDamageOddsNo - 1) {
|
if (g_vm->_rnd->getRandomNumber(heatDamageOddsYes + heatDamageOddsNo - 1) > heatDamageOddsNo - 1) {
|
||||||
obj->acceptDamage(obj->thisID(), heatDamagePerFrame, damageHeat, heatDamageDicePerFrame, 6);
|
obj->acceptDamage(obj->thisID(), heatDamagePerFrame, kDamageHeat, heatDamageDicePerFrame, 6);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,19 +75,19 @@ void coldDamage(GameObject *obj) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (g_vm->_rnd->getRandomNumber(coldDamageOddsYes + coldDamageOddsNo - 1) > coldDamageOddsNo - 1) {
|
if (g_vm->_rnd->getRandomNumber(coldDamageOddsYes + coldDamageOddsNo - 1) > coldDamageOddsNo - 1) {
|
||||||
obj->acceptDamage(obj->thisID(), coldDamagePerFrame, damageCold, coldDamageDicePerFrame, 6);
|
obj->acceptDamage(obj->thisID(), coldDamagePerFrame, kDamageCold, coldDamageDicePerFrame, 6);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void terrainDamageSlash(GameObject *obj) {
|
void terrainDamageSlash(GameObject *obj) {
|
||||||
if (g_vm->_rnd->getRandomNumber(terrainDamageOddsYes + terrainDamageOddsNo - 1) > terrainDamageOddsNo - 1) {
|
if (g_vm->_rnd->getRandomNumber(terrainDamageOddsYes + terrainDamageOddsNo - 1) > terrainDamageOddsNo - 1) {
|
||||||
obj->acceptDamage(obj->thisID(), terrainDamagePerFrame, damageSlash, terrainDamageDicePerFrame, 6);
|
obj->acceptDamage(obj->thisID(), terrainDamagePerFrame, kDamageSlash, terrainDamageDicePerFrame, 6);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void terrainDamageBash(GameObject *obj) {
|
void terrainDamageBash(GameObject *obj) {
|
||||||
if (g_vm->_rnd->getRandomNumber(terrainDamageOddsYes + terrainDamageOddsNo - 1) > terrainDamageOddsNo - 1) {
|
if (g_vm->_rnd->getRandomNumber(terrainDamageOddsYes + terrainDamageOddsNo - 1) > terrainDamageOddsNo - 1) {
|
||||||
obj->acceptDamage(obj->thisID(), terrainDamagePerFrame, damageImpact, terrainDamageDicePerFrame, 6);
|
obj->acceptDamage(obj->thisID(), terrainDamagePerFrame, kDamageImpact, terrainDamageDicePerFrame, 6);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,7 +195,7 @@ uint32 tileTerrain(
|
||||||
// catwalks and other surfaces which have no bottom.
|
// catwalks and other surfaces which have no bottom.
|
||||||
|
|
||||||
if ((terrainResult & terrainSolidSurface)
|
if ((terrainResult & terrainSolidSurface)
|
||||||
&& height > minZ + maxStepHeight) {
|
&& height > minZ + kMaxStepHeight) {
|
||||||
terrainResult |= terrainStone;
|
terrainResult |= terrainStone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -858,7 +858,7 @@ int16 checkWalkable(
|
||||||
|
|
||||||
supportHeight = tileSlopeHeight(loc, obj, &sti);
|
supportHeight = tileSlopeHeight(loc, obj, &sti);
|
||||||
|
|
||||||
if (supportHeight < loc.z - maxStepHeight * 4)
|
if (supportHeight < loc.z - kMaxStepHeight * 4)
|
||||||
return blockageTerrain;
|
return blockageTerrain;
|
||||||
|
|
||||||
if (sti.surfaceTile != NULL) {
|
if (sti.surfaceTile != NULL) {
|
||||||
|
|
|
@ -4161,8 +4161,8 @@ TilePoint pickTile(Point32 pos,
|
||||||
// down levels, only search for surfaces which could be stepped
|
// down levels, only search for surfaces which could be stepped
|
||||||
// on by the protagonist.
|
// on by the protagonist.
|
||||||
mag = (coords - protagPos).quickHDistance();
|
mag = (coords - protagPos).quickHDistance();
|
||||||
zMin = protagPos.z - maxPickHeight - mag;
|
zMin = protagPos.z - kMaxPickHeight - mag;
|
||||||
zMax = protagPos.z + maxPickHeight + mag;
|
zMax = protagPos.z + kMaxPickHeight + mag;
|
||||||
|
|
||||||
// Compute the coords of the actual tile that they clicked on.
|
// Compute the coords of the actual tile that they clicked on.
|
||||||
tileCoords = coords >> kTileUVShift;
|
tileCoords = coords >> kTileUVShift;
|
||||||
|
@ -4184,7 +4184,7 @@ TilePoint pickTile(Point32 pos,
|
||||||
mt = curMap->lookupMeta(mCoords);
|
mt = curMap->lookupMeta(mCoords);
|
||||||
|
|
||||||
// While we are less than the pick altitude
|
// While we are less than the pick altitude
|
||||||
while (relPos.y < zMax + kTileDX + maxStepHeight - abs(relPos.x >> 1)) {
|
while (relPos.y < zMax + kTileDX + kMaxStepHeight - abs(relPos.x >> 1)) {
|
||||||
// If there is a metatile on this spot
|
// If there is a metatile on this spot
|
||||||
if (mt != nullptr) {
|
if (mt != nullptr) {
|
||||||
// Iterate through all platforms
|
// Iterate through all platforms
|
||||||
|
@ -4213,7 +4213,7 @@ TilePoint pickTile(Point32 pos,
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Reject the tile if it's too high.
|
// Reject the tile if it's too high.
|
||||||
if (sti.surfaceHeight > zMax + maxStepHeight) continue;
|
if (sti.surfaceHeight > zMax + kMaxStepHeight) continue;
|
||||||
|
|
||||||
// Reject the tile if mouse position is below lower tile
|
// Reject the tile if mouse position is below lower tile
|
||||||
// boundary
|
// boundary
|
||||||
|
@ -4299,8 +4299,8 @@ TilePoint pickTile(Point32 pos,
|
||||||
|
|
||||||
// Compute new altitude range based upon the tile position
|
// Compute new altitude range based upon the tile position
|
||||||
// relative to the protaganist's position.
|
// relative to the protaganist's position.
|
||||||
zMin = protagPos.z - maxPickHeight - (coords - protagPos).quickHDistance();
|
zMin = protagPos.z - kMaxPickHeight - (coords - protagPos).quickHDistance();
|
||||||
zMax = protagPos.z + maxPickHeight + (coords - protagPos).quickHDistance();
|
zMax = protagPos.z + kMaxPickHeight + (coords - protagPos).quickHDistance();
|
||||||
}
|
}
|
||||||
|
|
||||||
// If no tile was found, return the default.
|
// If no tile was found, return the default.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue