|
|
|
@ -156,7 +156,7 @@ void StartWalkAnimation(Player &player, Direction dir, bool pmWillBeCalled) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
void StartWalk(Player &player, Direction dir, bool pmWillBeCalled) |
|
|
|
void StartWalk(Player &player, Direction dir, bool pmWillBeCalled) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (player._pInvincible && player._pHitPoints == 0 && &player == MyPlayer) { |
|
|
|
if (player._pInvincible && player.hasNoLife() && &player == MyPlayer) { |
|
|
|
SyncPlrKill(player, DeathReason::Unknown); |
|
|
|
SyncPlrKill(player, DeathReason::Unknown); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -174,7 +174,7 @@ void ClearStateVariables(Player &player) |
|
|
|
|
|
|
|
|
|
|
|
void StartAttack(Player &player, Direction d, bool includesFirstFrame) |
|
|
|
void StartAttack(Player &player, Direction d, bool includesFirstFrame) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (player._pInvincible && player._pHitPoints == 0 && &player == MyPlayer) { |
|
|
|
if (player._pInvincible && player.hasNoLife() && &player == MyPlayer) { |
|
|
|
SyncPlrKill(player, DeathReason::Unknown); |
|
|
|
SyncPlrKill(player, DeathReason::Unknown); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -206,7 +206,7 @@ void StartAttack(Player &player, Direction d, bool includesFirstFrame) |
|
|
|
|
|
|
|
|
|
|
|
void StartRangeAttack(Player &player, Direction d, WorldTileCoord cx, WorldTileCoord cy, bool includesFirstFrame) |
|
|
|
void StartRangeAttack(Player &player, Direction d, WorldTileCoord cx, WorldTileCoord cy, bool includesFirstFrame) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (player._pInvincible && player._pHitPoints == 0 && &player == MyPlayer) { |
|
|
|
if (player._pInvincible && player.hasNoLife() && &player == MyPlayer) { |
|
|
|
SyncPlrKill(player, DeathReason::Unknown); |
|
|
|
SyncPlrKill(player, DeathReason::Unknown); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -248,7 +248,7 @@ player_graphic GetPlayerGraphicForSpell(SpellID spellId) |
|
|
|
|
|
|
|
|
|
|
|
void StartSpell(Player &player, Direction d, WorldTileCoord cx, WorldTileCoord cy) |
|
|
|
void StartSpell(Player &player, Direction d, WorldTileCoord cx, WorldTileCoord cy) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (player._pInvincible && player._pHitPoints == 0 && &player == MyPlayer) { |
|
|
|
if (player._pInvincible && player.hasNoLife() && &player == MyPlayer) { |
|
|
|
SyncPlrKill(player, DeathReason::Unknown); |
|
|
|
SyncPlrKill(player, DeathReason::Unknown); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1117,7 +1117,7 @@ void CheckNewPath(Player &player, bool pmWillBeCalled) |
|
|
|
case ACTION_RATTACKPLR: |
|
|
|
case ACTION_RATTACKPLR: |
|
|
|
case ACTION_SPELLPLR: |
|
|
|
case ACTION_SPELLPLR: |
|
|
|
target = &Players[targetId]; |
|
|
|
target = &Players[targetId]; |
|
|
|
if ((target->_pHitPoints >> 6) <= 0) { |
|
|
|
if (!target->hasNoLife()) { |
|
|
|
player.Stop(); |
|
|
|
player.Stop(); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -2187,7 +2187,7 @@ void InitPlayerGFX(Player &player) |
|
|
|
|
|
|
|
|
|
|
|
ResetPlayerGFX(player); |
|
|
|
ResetPlayerGFX(player); |
|
|
|
|
|
|
|
|
|
|
|
if (player._pHitPoints >> 6 == 0) { |
|
|
|
if (player.hasNoLife()) { |
|
|
|
player._pgfxnum &= ~0xFU; |
|
|
|
player._pgfxnum &= ~0xFU; |
|
|
|
LoadPlrGFX(player, player_graphic::Death); |
|
|
|
LoadPlrGFX(player, player_graphic::Death); |
|
|
|
return; |
|
|
|
return; |
|
|
|
@ -2501,7 +2501,7 @@ void InitPlayer(Player &player, bool firstTime) |
|
|
|
|
|
|
|
|
|
|
|
ClearStateVariables(player); |
|
|
|
ClearStateVariables(player); |
|
|
|
|
|
|
|
|
|
|
|
if (player._pHitPoints >> 6 > 0) { |
|
|
|
if (!player.hasNoLife()) { |
|
|
|
player._pmode = PM_STAND; |
|
|
|
player._pmode = PM_STAND; |
|
|
|
NewPlrAnim(player, player_graphic::Stand, Direction::South); |
|
|
|
NewPlrAnim(player, player_graphic::Stand, Direction::South); |
|
|
|
player.AnimInfo.currentFrame = GenerateRnd(player._pNFrames - 1); |
|
|
|
player.AnimInfo.currentFrame = GenerateRnd(player._pNFrames - 1); |
|
|
|
@ -2590,7 +2590,7 @@ void FixPlayerLocation(Player &player, Direction bDir) |
|
|
|
|
|
|
|
|
|
|
|
void StartStand(Player &player, Direction dir) |
|
|
|
void StartStand(Player &player, Direction dir) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (player._pInvincible && player._pHitPoints == 0 && &player == MyPlayer) { |
|
|
|
if (player._pInvincible && player.hasNoLife() && &player == MyPlayer) { |
|
|
|
SyncPlrKill(player, DeathReason::Unknown); |
|
|
|
SyncPlrKill(player, DeathReason::Unknown); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -2605,7 +2605,7 @@ void StartStand(Player &player, Direction dir) |
|
|
|
|
|
|
|
|
|
|
|
void StartPlrBlock(Player &player, Direction dir) |
|
|
|
void StartPlrBlock(Player &player, Direction dir) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (player._pInvincible && player._pHitPoints == 0 && &player == MyPlayer) { |
|
|
|
if (player._pInvincible && player.hasNoLife() && &player == MyPlayer) { |
|
|
|
SyncPlrKill(player, DeathReason::Unknown); |
|
|
|
SyncPlrKill(player, DeathReason::Unknown); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -2639,7 +2639,7 @@ void FixPlrWalkTags(const Player &player) |
|
|
|
|
|
|
|
|
|
|
|
void StartPlrHit(Player &player, int dam, bool forcehit) |
|
|
|
void StartPlrHit(Player &player, int dam, bool forcehit) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (player._pInvincible && player._pHitPoints == 0 && &player == MyPlayer) { |
|
|
|
if (player._pInvincible && player.hasNoLife() && &player == MyPlayer) { |
|
|
|
SyncPlrKill(player, DeathReason::Unknown); |
|
|
|
SyncPlrKill(player, DeathReason::Unknown); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -2866,7 +2866,7 @@ void ApplyPlrDamage(DamageType damageType, Player &player, int dam, int minHP /* |
|
|
|
if (player._pHitPoints < minHitPoints) { |
|
|
|
if (player._pHitPoints < minHitPoints) { |
|
|
|
SetPlayerHitPoints(player, minHitPoints); |
|
|
|
SetPlayerHitPoints(player, minHitPoints); |
|
|
|
} |
|
|
|
} |
|
|
|
if (player._pHitPoints >> 6 <= 0) { |
|
|
|
if (player.hasNoLife()) { |
|
|
|
SyncPlrKill(player, deathReason); |
|
|
|
SyncPlrKill(player, deathReason); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -3024,7 +3024,7 @@ void ProcessPlayers() |
|
|
|
for (size_t pnum = 0; pnum < Players.size(); pnum++) { |
|
|
|
for (size_t pnum = 0; pnum < Players.size(); pnum++) { |
|
|
|
Player &player = Players[pnum]; |
|
|
|
Player &player = Players[pnum]; |
|
|
|
if (player.plractive && player.isOnActiveLevel() && (&player == MyPlayer || !player._pLvlChanging)) { |
|
|
|
if (player.plractive && player.isOnActiveLevel() && (&player == MyPlayer || !player._pLvlChanging)) { |
|
|
|
if (!PlrDeathModeOK(player) && (player._pHitPoints >> 6) <= 0) { |
|
|
|
if (!PlrDeathModeOK(player) && player.hasNoLife()) { |
|
|
|
SyncPlrKill(player, DeathReason::Unknown); |
|
|
|
SyncPlrKill(player, DeathReason::Unknown); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -3100,7 +3100,7 @@ bool PosOkPlayer(const Player &player, Point position) |
|
|
|
if (!IsTileWalkable(position)) |
|
|
|
if (!IsTileWalkable(position)) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
Player *otherPlayer = PlayerAtPosition(position); |
|
|
|
Player *otherPlayer = PlayerAtPosition(position); |
|
|
|
if (otherPlayer != nullptr && otherPlayer != &player && otherPlayer->_pHitPoints != 0) |
|
|
|
if (otherPlayer != nullptr && otherPlayer != &player && !otherPlayer->hasNoLife()) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
if (dMonster[position.x][position.y] != 0) { |
|
|
|
if (dMonster[position.x][position.y] != 0) { |
|
|
|
|