13 WriteHeader(channel, net_gibsplash);
33 e.state |= 8 * gibowner.species;
37 if(gibowner.classname ==
"body")
38 e.team =
etof(gibowner.enemy);
40 e.team =
etof(gibowner);
53 void Violence_GibSplash(
entity source,
float type,
float amount,
entity attacker)
55 Violence_GibSplash_At(source.origin + source.view_ofs, source.velocity, type, amount, source, attacker);
72 void Gib_Delete(
entity this)
77 string species_prefix(
int specnum);
79 void Gib_setmodel(
entity gib,
string mdlname,
int specnum)
88 if(mdlname ==
"models/gibs/bloodyskull.md3")
95 gib.colormod =
'2 2 2';
101 _setmodel(gib, mdlname);
107 void new_te_bloodshower (
int ef,
vector org,
float explosionspeed,
int howmany)
110 pmod = autocvar_cl_particles_quality;
111 for (i = 0; i < 50 * pmod; ++i)
112 __pointparticles(ef, org,
randomvec() * explosionspeed, howmany / 50);
133 __pointparticles(_particleeffectnum(
strcat(species_prefix(this.
cnt),
"blood")), this.
origin +
'0 0 1',
'0 0 30', 10);
138 void Gib_Draw(
entity this)
147 if(gettouch(
this) == Gib_Touch)
149 __trailparticles(
this, _particleeffectnum(
strcat(species_prefix(this.
cnt), EFFECT_TR_SLIGHTBLOOD.eent_eff_name)), oldorg,
this.origin);
151 __trailparticles(
this, _particleeffectnum(
strcat(species_prefix(this.
cnt), EFFECT_TR_BLOOD.eent_eff_name)), oldorg,
this.origin);
168 void TossGib (
string mdlname,
vector safeorg,
vector org,
vector vconst,
vector vrand,
int specnum,
bool destroyontouch,
bool issilent)
173 gib = ListNewChildRubble(CasingsNGibs,
new(gib));
178 gib.silent = issilent;
180 gib.colormap |=
BIT(10);
181 Gib_setmodel(gib, mdlname, specnum);
183 setsize (gib,
'-8 -8 -8',
'8 8 8');
188 settouch(gib, Gib_Touch);
190 settouch(gib, SUB_RemoveOnNoImpact);
200 gib.velocity = vconst * autocvar_cl_gibs_velocity_scale + vrand * autocvar_cl_gibs_velocity_random +
'0 0 1' * autocvar_cl_gibs_velocity_up;
201 gib.avelocity =
prandomvec() *
vlen(gib.velocity) * autocvar_cl_gibs_avelocity_scale;
202 gib.move_time =
time;
203 gib.damageforcescale = autocvar_cl_gibs_damageforcescale;
205 gib.nextthink =
time + autocvar_cl_gibs_lifetime * (1 +
prandom() * 0.15);
208 LimitedChildrenRubble(CasingsNGibs,
"gib", autocvar_cl_gibs_maxcount, Gib_Delete,
NULL);
213 Net_Accept(net_gibsplash);
215 string gentle_prefix =
"morphed_";
217 int type = ReadByte();
218 int amount = ReadByte() / 16.0;
220 org.x = ReadShort() * 4 + 2;
221 org.y = ReadShort() * 4 + 2;
222 org.z = ReadShort() * 4 + 2;
227 float cl_gentle_gibs = autocvar_cl_gentle_gibs;
228 if(cl_gentle_gibs || autocvar_cl_gentle)
233 if(cl_gentle_gibs == 2)
235 else if(cl_gentle_gibs == 3)
236 gentle_prefix =
"happy_";
238 else if(autocvar_cl_particlegibs)
241 gentle_prefix =
"particlegibs_";
244 if (!(cl_gentle_gibs || autocvar_cl_gentle))
245 amount *= 1 - autocvar_cl_nogibs;
250 if(amount <= 0 || !isNew)
255 int specnum = (type & 0x78) / 8;
256 bool issilent = (type & 0x40);
258 string specstr = species_prefix(specnum);
267 TossGib (
"models/gibs/eye.md3", org, org, vel,
prandomvec() * 150, specnum, 0, issilent);
268 new_te_bloodshower(_particleeffectnum(
strcat(specstr,
"bloodshower")), org, 1200, amount);
270 TossGib (
"models/gibs/bloodyskull.md3", org, org + 16 *
prandomvec(), vel,
prandomvec() * 100, specnum, 0, issilent);
272 for(
int c = 0; c < amount; ++c)
274 int randomvalue = amount - c;
277 TossGib (
"models/gibs/arm.md3", org, org + 16 *
prandomvec() +
'0 0 8', vel,
prandomvec() * (
prandom() * 120 + 90), specnum,0, issilent);
279 TossGib (
"models/gibs/arm.md3", org, org + 16 *
prandomvec() +
'0 0 8', vel,
prandomvec() * (
prandom() * 120 + 90), specnum,0, issilent);
283 TossGib (
"models/gibs/smallchest.md3", org, org + 16 *
prandomvec(), vel,
prandomvec() * (
prandom() * 120 + 80), specnum,0, issilent);
285 TossGib (
"models/gibs/leg1.md3", org, org + 16 *
prandomvec() +
'0 0 -5', vel,
prandomvec() * (
prandom() * 120 + 85), specnum,0, issilent);
287 TossGib (
"models/gibs/leg2.md3", org, org + 16 *
prandomvec() +
'0 0 -5', vel,
prandomvec() * (
prandom() * 120 + 85), specnum,0, issilent);
291 TossGib (
"models/gibs/chunk.mdl", org, org + 16 *
prandomvec(), vel,
prandomvec() * 450, specnum,1, issilent);
293 TossGib (
"models/gibs/chunk.mdl", org, org + 16 *
prandomvec(), vel,
prandomvec() * 450, specnum,1, issilent);
295 TossGib (
"models/gibs/chunk.mdl", org, org + 16 *
prandomvec(), vel,
prandomvec() * 450, specnum,1, issilent);
297 TossGib (
"models/gibs/chunk.mdl", org, org + 16 *
prandomvec(), vel,
prandomvec() * 450, specnum,1, issilent);
301 __pointparticles(_particleeffectnum(
strcat(specstr,
"blood")), org, vel, amount * 16);
305 TossGib (
"models/gibs/chunk.mdl", org, org, vel,
prandomvec() * (
prandom() * 30 + 20), specnum, 1, issilent);
308 __pointparticles(_particleeffectnum(
strcat(gentle_prefix,
"damage_dissolve")), org, vel, amount);
311 __pointparticles(_particleeffectnum(
strcat(gentle_prefix,
"damage_hit")), org, vel, amount * 16);
const float ALPHA_MIN_VISIBLE
float compressShortVector(vector vec)
Sound SND_GIB_SPLAT_RANDOM()
const int SPECIES_ROBOT_RUSTY
float trace_dphitq3surfaceflags
#define FOREACH_CLIENT(cond, body)
#define NET_HANDLE(id, param)
#define IS_REAL_CLIENT(v)
#define setmodel(this, m)
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
const float MOVE_NOMONSTERS
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
void Movetype_Physics_MatchTicrate(entity this, float tr, bool sloppy)
Model MDL_GIB_ROBO_RANDOM()
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
float Q3SURFACEFLAG_NOIMPACT
const int SPECIES_ROBOT_SHINY
vector decompressShortVector(int data)
vector(float skel, float bonenum) _skel_get_boneabs_hidden
const int SPECIES_ROBOT_SOLID
#define new_pure(class)
purely logical entities (.origin doesn't work)
#define REGISTER_NET_TEMP(id)
#define sound(e, c, s, v, a)
IntrusiveList g_drawables
void set_movetype(entity this, int mt)