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

Function SetNapalmDamageEffect

Descent3/damage.cpp:618–645  ·  view source on GitHub ↗

Causes an object to have napalm attached to it

Source from the content-addressed store, hash-verified

616#define MAX_NAPALM_DAMAGE_TIME 10.0f
617// Causes an object to have napalm attached to it
618void SetNapalmDamageEffect(object *obj, object *killer, int weapon_id) {
619 if (obj->effect_info) {
620 obj->effect_info->type_flags |= EF_NAPALMED;
621
622 if (Weapons[weapon_id].flags & WF_INVISIBLE)
623 obj->effect_info->damage_time += (MAX_NAPALM_DAMAGE_TIME / 5.0f);
624 else
625 obj->effect_info->damage_time += (MAX_NAPALM_DAMAGE_TIME / 1.5f);
626
627 obj->effect_info->damage_time = std::min(MAX_NAPALM_DAMAGE_TIME, obj->effect_info->damage_time);
628
629 if (obj->type == OBJ_PLAYER)
630 obj->effect_info->damage_per_second = Weapons[weapon_id].player_damage;
631 else
632 obj->effect_info->damage_per_second = Weapons[weapon_id].generic_damage;
633
634 if (Gametime - obj->effect_info->last_damage_time > 1.0f)
635 obj->effect_info->last_damage_time = 0;
636
637 if (killer != NULL)
638 obj->effect_info->damage_handle = killer->handle;
639 else
640 obj->effect_info->damage_handle = OBJECT_HANDLE_NONE;
641
642 if (obj->effect_info->sound_handle == SOUND_NONE_INDEX)
643 obj->effect_info->sound_handle = Sound_system.Play3dSound(SOUND_PLAYER_BURNING, SND_PRIORITY_HIGHEST, obj);
644 }
645}
646
647// Causes an object to have napalm attached to it
648void ApplyFreezeDamageEffect(object *obj) {

Callers 6

collide_player_and_wallFunction · 0.85
collide_generic_and_wallFunction · 0.85
ApplyDamageToPlayerFunction · 0.85
ApplyDamageToGenericFunction · 0.85
DoPlayerFrameForOneFunction · 0.85

Calls 1

Play3dSoundMethod · 0.80

Tested by

no test coverage detected