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

Function MakePlayerInvulnerable

Descent3/Player.cpp:1582–1600  ·  view source on GitHub ↗

makes the player invulnerable

Source from the content-addressed store, hash-verified

1580
1581// makes the player invulnerable
1582void MakePlayerInvulnerable(int slot, float time, bool play_sound_and_message) {
1583 ASSERT(slot >= 0 && slot < MAX_PLAYERS);
1584 Players[slot].flags |= PLAYER_FLAGS_INVULNERABLE;
1585 Players[slot].invulnerable_time = time;
1586
1587 if (play_sound_and_message) {
1588 Players[slot].flags |= PLAYER_FLAGS_PLAYSOUNDMSGFORINVULN;
1589 static int inv_sound_on_id = -2;
1590 if (inv_sound_on_id == -2)
1591 inv_sound_on_id = FindSoundName("Invulnerability on");
1592
1593 if (inv_sound_on_id != -1)
1594 Sound_system.Play3dSound(inv_sound_on_id, &Objects[Players[slot].objnum], MAX_GAME_VOLUME / 2);
1595
1596 if (slot == Player_num) {
1597 AddHUDMessage(TXT_INVULNON);
1598 }
1599 }
1600}
1601
1602// makes the player invulnerable
1603void MakePlayerVulnerable(int slot) {

Callers 8

ProcessTestKeysFunction · 0.85
msafe_CallFunctionFunction · 0.85
HandleCommonPowerupsFunction · 0.85
MultiDoRenewPlayerFunction · 0.85
DemoCheatsFunction · 0.85
InitPlayerNewLevelFunction · 0.85
EndPlayerDeathFunction · 0.85

Calls 3

FindSoundNameFunction · 0.85
AddHUDMessageFunction · 0.85
Play3dSoundMethod · 0.80

Tested by

no test coverage detected