set g_buffs_invisible 1 "invisible buff: carrier becomes invisible"
set g_buffs_invisible_alpha 0.4 "player invisibility multiplier while holding invisible buff"
set g_buffs_inferno 1 "inferno buff: targets damaged by player carrying inferno buff will also receive burning damage"
-set g_buffs_inferno_burntime 1.5 "burning time of damaged target"
set g_buffs_inferno_damagemultiplier 0.25 "multiplier of damage dealt during burn"
+set g_buffs_inferno_burntime_factor 2 "burn time logarithm base. 0 < x < 1: increasing, x > 1: increasing"
+set g_buffs_inferno_burntime_target_damage 150 "damage required for g_buffs_inferno_burntime_target_time seconds of burn"
+set g_buffs_inferno_burntime_target_time 5 "seconds of burn given g_buffs_inferno_burntime_target_damage damage"
float autocvar_g_buffs_invisible_alpha;
float autocvar_g_buffs_flight_gravity;
float autocvar_g_buffs_jump_height;
-float autocvar_g_buffs_inferno_burntime;
+float autocvar_g_buffs_inferno_burntime_factor;
+float autocvar_g_buffs_inferno_burntime_target_damage;
+float autocvar_g_buffs_inferno_burntime_target_time;
float autocvar_g_buffs_inferno_damagemultiplier;
#endif
return;
}
+float buff_Inferno_CalculateTime(float x, float offset_x, float offset_y, float intersect_x, float intersect_y, float base)
+{
+ float f = (x - offset_x) / intersect_x;
+ return offset_y + (intersect_y - offset_y) * logn((base - 1) * (f + 1), base);
+}
+
MUTATOR_HOOKFUNCTION(buffs_PlayerDamage_Calculate)
{
if(frag_deathtype == DEATH_BUFF) { return false; }
}
if(frag_attacker.buffs & BUFF_INFERNO)
- if(frag_target != frag_attacker)
- Fire_AddDamage(frag_target, frag_attacker, (frag_damage * autocvar_g_buffs_inferno_damagemultiplier) * autocvar_g_buffs_inferno_burntime, autocvar_g_buffs_inferno_burntime, DEATH_BUFF);
+ if(frag_target != frag_attacker) {
+ float time = buff_Inferno_CalculateTime(
+ frag_damage,
+ 0, 0,
+ autocvar_g_buffs_inferno_burntime_target_damage,
+ autocvar_g_buffs_inferno_burntime_target_time,
+ autocvar_g_buffs_inferno_burntime_factor
+ );
+ Fire_AddDamage(frag_target, frag_attacker, (frag_damage * autocvar_g_buffs_inferno_damagemultiplier) * time, time, DEATH_BUFF);
+ }
// this... is ridiculous (TODO: fix!)
if(frag_attacker.buffs & BUFF_VAMPIRE)