set g_telefrags_avoid 1 "when teleporters have a random destination, avoid teleporting to locations where a telefrag would happen"
set g_teleport_maxspeed 0 "maximum speed that a player can keep when going through a teleporter (if a misc_teleporter_dest also has a cap the smallest one of these will be used), 0 = don't limit, -1 = keep no speed"
-set cl_damageeffect 0.05 "enable weapon damage effects on players, value specifies how often to show the effect"
-set cl_damageeffect_limit 3 "how many damages to show on a player at once"
+set cl_damageeffect 2 "enable weapon damage effects. 1 enables effects on players, 2 on players and objects"
+set cl_damageeffect_ticrate 0.05 "particles spawn rate"
+set cl_damageeffect_limit 3 "how many damages to show on a player at once (objects are limited to one effect)"
set cl_damageeffect_lifetime 0.1 "how much a damage effect lasts, multiplied by damage amount"
-set cl_damageeffect_lifetime_min 2 "minimum amount of life a damage effect may have"
-set cl_damageeffect_lifetime_max 6 "maximum amount of life a damage effect may have"
+set cl_damageeffect_lifetime_min 2 "minimum lifetime a damage effect may have"
+set cl_damageeffect_lifetime_max 6 "maximum lifetime a damage effect may have"
set g_respawn_ghosts 1 "if 1 dead bodies become ghosts and float away when the player respawns"
set g_respawn_ghosts_speed 5 "the speed with which respawn ghosts float and rotate"
}
if(self.dmgtime > time)
return;
- if(!autocvar_cl_damageeffect)
- return; // don't show effects on the invisible dead body if gibs exist
if(self.team == player_localentnum - 1 && !autocvar_chase_active)
return; // if we aren't in third person mode, hide own damage effect
// Now apply the effect to the player
org = gettaginfo(self, 0);
pointparticles(self.dmgpartnum, org, '0 0 0', 1);
- self.dmgtime = time + autocvar_cl_damageeffect;
+ self.dmgtime = time + autocvar_cl_damageeffect_ticrate;
}
void DamageEffect(vector hitorg, float dmg, float type, float specnum, float entnumber)
{
+ // particle effects for players and objects damaged by weapons (eg: flames coming out of victims shot with rockets)
+
float life, i;
string specstr, effectnum;
entity e;
- if(!autocvar_cl_damageeffect || autocvar_cl_gentle || autocvar_cl_gentle_damage)
+ if(autocvar_cl_gentle || autocvar_cl_gentle_damage)
return;
if(self.model == "" || !self.model || !self.drawmask)
return;
- // return if we reached our damage effect count limit
+ // return if we reached our damage effect limit
for(e = world; (e = find(e, classname, "damageeffect")); )
if(e.team == entnumber)
i += 1;
- if(self.isplayermodel && i >= autocvar_cl_damageeffect_limit)
+ if(autocvar_cl_damageeffect < 1 || (self.isplayermodel && i >= autocvar_cl_damageeffect_limit))
return; // allow multiple damage effects on players
- if(!self.isplayermodel && i)
+ if(autocvar_cl_damageeffect < 2 || (!self.isplayermodel && i))
return; // allow a single damage effect on objects
specstr = species_prefix(specnum);
if(!closest || vlen(hitorg - gettaginfo(self, tagnum)) <= vlen(hitorg - gettaginfo(self, closest)))
closest = tagnum;
}
- gettaginfo(self, closest); // set gettaginfo_name
+ gettaginfo(self, closest); // set gettaginfo_name to bone
}
else
- gettaginfo(self, 0);
+ gettaginfo(self, 0); // set gettaginfo_name to origin
e = spawn();
- setmodel(e, "models/null.md3");
- setattachment(e, self, gettaginfo_name);
+ setmodel(e, "models/null.md3"); // necessary to attach and read origin
+ setattachment(e, self, gettaginfo_name); // attach to the given bone
e.owner = self;
e.team = entnumber;
e.lifetime = time + life;