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

Function MakeObjectInvisible

Descent3/object_lighting.cpp:576–599  ·  view source on GitHub ↗

makes the an object cloaked

Source from the content-addressed store, hash-verified

574#include "stringtable.h"
575// makes the an object cloaked
576void MakeObjectInvisible(object *obj, float time, float fade_time, bool no_hud_message) {
577 if (obj->effect_info) {
578 obj->effect_info->cloak_time = time;
579 obj->effect_info->type_flags |= EF_FADING_OUT;
580 obj->effect_info->fade_time = fade_time;
581 obj->effect_info->fade_max_time = fade_time;
582 }
583
584 if (obj->type == OBJ_PLAYER && !no_hud_message) {
585 static int cloak_sound_on_id = -2;
586 if (cloak_sound_on_id == -2)
587 cloak_sound_on_id = FindSoundName("Cloak on");
588
589 if (cloak_sound_on_id != -1)
590 Sound_system.Play3dSound(cloak_sound_on_id, SND_PRIORITY_HIGHEST, obj, MAX_GAME_VOLUME / 2);
591
592 if (obj->id == Player_num) {
593 AddHUDMessage(TXT_CLOAKON);
594 }
595
596 if (obj->effect_info)
597 obj->effect_info->type_flags |= EF_CLOAK_WITH_MSG;
598 }
599}
600
601// makes an object visbile
602void MakeObjectVisible(object *obj) {

Callers 4

ProcessTestKeysFunction · 0.85
msafe_CallFunctionFunction · 0.85
HandleCommonPowerupsFunction · 0.85
DemoCheatsFunction · 0.85

Calls 3

FindSoundNameFunction · 0.85
AddHUDMessageFunction · 0.85
Play3dSoundMethod · 0.80

Tested by

no test coverage detected