MCPcopy Create free account
hub / github.com/diasurgical/devilution / Obj_BCrossDamage

Function Obj_BCrossDamage

Source/objects.cpp:1687–1718  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1685}
1686
1687void Obj_BCrossDamage(int i)
1688{
1689 int fire_resist;
1690 int damage[4] = { 6, 8, 10, 12 };
1691
1692 if (plr[myplr]._pmode == PM_DEATH)
1693 return;
1694
1695 fire_resist = plr[myplr]._pFireResist;
1696 if (fire_resist > 0)
1697 damage[leveltype - 1] -= fire_resist * damage[leveltype - 1] / 100;
1698
1699 if (plr[myplr].WorldX != object[i]._ox || plr[myplr].WorldY != object[i]._oy - 1)
1700 return;
1701
1702 plr[myplr]._pHitPoints -= damage[leveltype - 1];
1703 plr[myplr]._pHPBase -= damage[leveltype - 1];
1704 if (plr[myplr]._pHitPoints >> 6 <= 0) {
1705 SyncPlrKill(myplr, 0);
1706 } else {
1707 if (plr[myplr]._pClass == PC_WARRIOR) {
1708 PlaySfxLoc(PS_WARR68, plr[myplr].WorldX, plr[myplr].WorldY);
1709#ifndef SPAWN
1710 } else if (plr[myplr]._pClass == PC_ROGUE) {
1711 PlaySfxLoc(PS_ROGUE68, plr[myplr].WorldX, plr[myplr].WorldY);
1712 } else if (plr[myplr]._pClass == PC_SORCERER) {
1713 PlaySfxLoc(PS_MAGE68, plr[myplr].WorldX, plr[myplr].WorldY);
1714#endif
1715 }
1716 }
1717 drawhpflag = TRUE;
1718}
1719
1720void ProcessObjects()
1721{

Callers 1

ProcessObjectsFunction · 0.85

Calls 2

SyncPlrKillFunction · 0.85
PlaySfxLocFunction · 0.85

Tested by

no test coverage detected