Causes an object to have napalm attached to it
| 616 | #define MAX_NAPALM_DAMAGE_TIME 10.0f |
| 617 | // Causes an object to have napalm attached to it |
| 618 | void 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 |
| 648 | void ApplyFreezeDamageEffect(object *obj) { |
no test coverage detected