{
return 1;
}
+ case "blaster_self_damage":
+ {
+ return 1;
+ }
default:
{
// TODO: Report error.
}
float PlayerTemplate_Damage_Calculate(entity attacker, string attackertemplate,
- entity victim, string victimtemplate, float damage)
+ entity victim, string victimtemplate, float deathtype, float damage)
{
+ if ((attacker == victim) && (DEATH_ISWEAPON(deathtype, WEP_BLASTER)) &&
+ (PlayerTemplate_GetFloatValue(victimtemplate, "blaster_self_damage") ==
+ 0))
+ {
+ return 0;
+ }
damage *= PlayerTemplate_GetFloatValue(attackertemplate, "attack_scale");
damage /= PlayerTemplate_GetFloatValue(victimtemplate, "defense_scale");
return damage;
/// \param[in] attackertemplate Template of the attacker.
/// \param[in] victim Victim entity.
/// \param[in] victimtemplate Template of the victim.
+/// \param[in] deathtype Type of the damage.
/// \param[in] damage Damage to adjust.
/// \return Adjusted damage.
float PlayerTemplate_Damage_Calculate(entity attacker, string attackertemplate,
- entity victim, string victimtemplate, float damage);
+ entity victim, string victimtemplate, float deathtype, float damage);