MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / MakePlayerVulnerable

Function MakePlayerVulnerable

Descent3/Player.cpp:1603–1621  ·  view source on GitHub ↗

makes the player invulnerable

Source from the content-addressed store, hash-verified

1601
1602// makes the player invulnerable
1603void MakePlayerVulnerable(int slot) {
1604 ASSERT(slot >= 0 && slot < MAX_PLAYERS);
1605 // Play sound maybe.
1606 Players[slot].flags &= ~PLAYER_FLAGS_INVULNERABLE;
1607 Players[slot].invulnerable_time = 0.0f;
1608
1609 if (Players[slot].flags & PLAYER_FLAGS_PLAYSOUNDMSGFORINVULN) {
1610 static int inv_sound_off_id = -1;
1611 if (inv_sound_off_id == -1)
1612 inv_sound_off_id = FindSoundName("Invulnerability off");
1613
1614 if (inv_sound_off_id != -1)
1615 Sound_system.Play3dSound(inv_sound_off_id, &Objects[Players[slot].objnum], MAX_GAME_VOLUME / 2);
1616
1617 if (slot == Player_num) {
1618 AddHUDMessage(TXT_INVULNOFF);
1619 }
1620 }
1621}
1622
1623// Performs the player death sequence.
1624

Callers 5

ProcessTestKeysFunction · 0.85
msafe_CallFunctionFunction · 0.85
DemoCheatsFunction · 0.85
DoPlayerFrameForOneFunction · 0.85
ThiefStealItemFunction · 0.85

Calls 3

FindSoundNameFunction · 0.85
AddHUDMessageFunction · 0.85
Play3dSoundMethod · 0.80

Tested by

no test coverage detected