MCPcopy Create free account
hub / github.com/diasurgical/DevilutionX / UpdateBurningCrossDamage

Function UpdateBurningCrossDamage

Source/objects.cpp:1744–1764  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1742}
1743
1744void UpdateBurningCrossDamage(Object &cross)
1745{
1746 int damage[6] = { 6, 8, 10, 12, 10, 12 };
1747
1748 Player &myPlayer = *MyPlayer;
1749
1750 if (myPlayer._pmode == PM_DEATH)
1751 return;
1752
1753 int8_t fireResist = myPlayer._pFireResist;
1754 if (fireResist > 0)
1755 damage[leveltype - 1] -= fireResist * damage[leveltype - 1] / 100;
1756
1757 if (myPlayer.position.tile != cross.position + Displacement { 0, -1 })
1758 return;
1759
1760 ApplyPlrDamage(DamageType::Fire, myPlayer, 0, 0, damage[leveltype - 1]);
1761 if (myPlayer._pHitPoints >> 6 > 0) {
1762 myPlayer.Say(HeroSpeech::Argh);
1763 }
1764}
1765
1766void ObjSetMini(Point position, int v)
1767{

Callers 1

ProcessObjectsFunction · 0.85

Calls 2

ApplyPlrDamageFunction · 0.85
SayMethod · 0.80

Tested by

no test coverage detected