void DamageEffect_Think()
{
self.nextthink = time;
-
- float foundgib;
vector org;
if(time >= self.lifetime)
}
if(self.dmgtime > time)
return;
-
- org = gettaginfo(self.owner, self.bone);
-
- // Scan the owner of all gibs in the world. If a gib owner is the same as the player we're applying
- // the effect to, it means our player is gibbed. Therefore, apply particles to the gibs instead.
- entity head;
- for(head = world; (head = find(head, classname, "gib")); )
- {
- if(head.team == self.team)
- {
- if(autocvar_cl_damageeffect_gibs)
- {
- if(autocvar_cl_damageeffect_gibs_randomize >= random())
- pointparticles(self.dmgpartnum, head.origin, '0 0 0', 1);
- self.dmgtime = time + autocvar_cl_damageeffect_gibs;
- }
- foundgib = TRUE;
- }
- }
-
- if(foundgib || !autocvar_cl_damageeffect_player)
+ 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 actual players
+ // Now apply the effect to the player
+ org = gettaginfo(self.owner, self.bone);
pointparticles(self.dmgpartnum, org, '0 0 0', 1);
- self.dmgtime = time + autocvar_cl_damageeffect_player;
+ self.dmgtime = time + autocvar_cl_damageeffect;
}
void DamageEffect(vector hitorg, float dmg, float type, float specnum, float entnumber)
string specstr, effectnum;
entity e;
- if(!autocvar_cl_damageeffect_player && !autocvar_cl_damageeffect_gibs)
- return;
- if(autocvar_cl_gentle || autocvar_cl_gentle_damage)
+ if(!autocvar_cl_damageeffect || autocvar_cl_gentle || autocvar_cl_gentle_damage)
return;
if(self.model == "" || !self.model)
return;
if(e.team == entnumber)
i += 1;
}
- if(i >= autocvar_cl_damageeffect_player_limit)
+ if(i >= autocvar_cl_damageeffect_limit)
return;
specstr = species_prefix(specnum);
}
}
-void TossGib (string mdlname, vector safeorg, vector org, vector vconst, vector vrand, float specnum, float destroyontouch, float issilent, float gibownernum)
+void TossGib (string mdlname, vector safeorg, vector org, vector vconst, vector vrand, float specnum, float destroyontouch, float issilent)
{
entity gib;
gib.solid = SOLID_CORPSE;
gib.cnt = specnum;
gib.silent = issilent;
- gib.team = gibownernum - 1;
Gib_setmodel(gib, mdlname, specnum);
setsize (gib, '-8 -8 -8', '8 8 8');
sound (self, CH_PAIN, "misc/gib.wav", VOL_BASE, ATTN_NORM);
if(prandom() < amount)
- TossGib ("models/gibs/eye.md3", org, org, vel, prandomvec() * 150, specnum, 0, issilent, entnumber);
+ TossGib ("models/gibs/eye.md3", org, org, vel, prandomvec() * 150, specnum, 0, issilent);
new_te_bloodshower(particleeffectnum(strcat(specstr, "bloodshower")), org, 1200, amount);
if(prandom() < amount)
- TossGib ("models/gibs/bloodyskull.md3", org, org + 16 * prandomvec(), vel, prandomvec() * 100, specnum, 0, issilent, entnumber);
+ TossGib ("models/gibs/bloodyskull.md3", org, org + 16 * prandomvec(), vel, prandomvec() * 100, specnum, 0, issilent);
for(c = 0; c < amount; ++c)
{
randomvalue = amount - c;
if(prandom() < randomvalue)
- TossGib ("models/gibs/arm.md3", org, org + 16 * prandomvec() + '0 0 8', vel, prandomvec() * (prandom() * 120 + 90), specnum,0, issilent, entnumber);
+ TossGib ("models/gibs/arm.md3", org, org + 16 * prandomvec() + '0 0 8', vel, prandomvec() * (prandom() * 120 + 90), specnum,0, issilent);
if(prandom() < randomvalue)
- TossGib ("models/gibs/arm.md3", org, org + 16 * prandomvec() + '0 0 8', vel, prandomvec() * (prandom() * 120 + 90), specnum,0, issilent, entnumber);
+ TossGib ("models/gibs/arm.md3", org, org + 16 * prandomvec() + '0 0 8', vel, prandomvec() * (prandom() * 120 + 90), specnum,0, issilent);
if(prandom() < randomvalue)
- TossGib ("models/gibs/chest.md3", org, org + 16 * prandomvec(), vel, prandomvec() * (prandom() * 120 + 80), specnum,0, issilent, entnumber);
+ TossGib ("models/gibs/chest.md3", org, org + 16 * prandomvec(), vel, prandomvec() * (prandom() * 120 + 80), specnum,0, issilent);
if(prandom() < randomvalue)
- TossGib ("models/gibs/smallchest.md3", org, org + 16 * prandomvec(), vel, prandomvec() * (prandom() * 120 + 80), specnum,0, issilent, entnumber);
+ TossGib ("models/gibs/smallchest.md3", org, org + 16 * prandomvec(), vel, prandomvec() * (prandom() * 120 + 80), specnum,0, issilent);
if(prandom() < randomvalue)
- TossGib ("models/gibs/leg1.md3", org, org + 16 * prandomvec() + '0 0 -5', vel, prandomvec() * (prandom() * 120 + 85), specnum,0, issilent, entnumber);
+ TossGib ("models/gibs/leg1.md3", org, org + 16 * prandomvec() + '0 0 -5', vel, prandomvec() * (prandom() * 120 + 85), specnum,0, issilent);
if(prandom() < randomvalue)
- TossGib ("models/gibs/leg2.md3", org, org + 16 * prandomvec() + '0 0 -5', vel, prandomvec() * (prandom() * 120 + 85), specnum,0, issilent, entnumber);
+ TossGib ("models/gibs/leg2.md3", org, org + 16 * prandomvec() + '0 0 -5', vel, prandomvec() * (prandom() * 120 + 85), specnum,0, issilent);
// these splat on impact
if(prandom() < randomvalue)
- TossGib ("models/gibs/chunk.mdl", org, org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,1, issilent, entnumber);
+ TossGib ("models/gibs/chunk.mdl", org, org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,1, issilent);
if(prandom() < randomvalue)
- TossGib ("models/gibs/chunk.mdl", org, org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,1, issilent, entnumber);
+ TossGib ("models/gibs/chunk.mdl", org, org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,1, issilent);
if(prandom() < randomvalue)
- TossGib ("models/gibs/chunk.mdl", org, org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,1, issilent, entnumber);
+ TossGib ("models/gibs/chunk.mdl", org, org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,1, issilent);
if(prandom() < randomvalue)
- TossGib ("models/gibs/chunk.mdl", org, org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,1, issilent, entnumber);
+ TossGib ("models/gibs/chunk.mdl", org, org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,1, issilent);
}
break;
case 0x02:
break;
case 0x03:
if(prandom() < amount)
- TossGib ("models/gibs/chunk.mdl", org, org, vel, prandomvec() * (prandom() * 30 + 20), specnum, 1, issilent, entnumber); // TODO maybe adjust to more randomization?
+ TossGib ("models/gibs/chunk.mdl", org, org, vel, prandomvec() * (prandom() * 30 + 20), specnum, 1, issilent); // TODO maybe adjust to more randomization?
break;
case 0x81:
pointparticles(particleeffectnum(strcat(gentle_prefix, "damage_dissolve")), org, vel, amount);