makes the an object cloaked
| 574 | #include "stringtable.h" |
| 575 | // makes the an object cloaked |
| 576 | void 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 |
| 602 | void MakeObjectVisible(object *obj) { |
no test coverage detected