CLIENT: Add support for Gib Event

This commit is contained in:
cypress 2023-11-08 12:30:26 -05:00
parent 3de18c324c
commit fd6cb138a2
4 changed files with 42 additions and 25 deletions

View file

@ -1245,7 +1245,7 @@ noref void() CSQC_Parse_Event =
pointparticles(particleeffectnum("weapons.explode"), org, '0 0 0', 1); pointparticles(particleeffectnum("weapons.explode"), org, '0 0 0', 1);
break; break;
case EVENT_BLOOD: case EVENT_BLOOD:
local vector loc; vector loc;
loc_x = readcoord(); loc_x = readcoord();
loc_y = readcoord(); loc_y = readcoord();
@ -1254,6 +1254,18 @@ noref void() CSQC_Parse_Event =
if (cvar("nzp_particles")) if (cvar("nzp_particles"))
pointparticles(particleeffectnum("blood.blood_particle"), loc, '0 0 0', 1); pointparticles(particleeffectnum("blood.blood_particle"), loc, '0 0 0', 1);
break; break;
case EVENT_LIMBGIB:
vector gloc;
gloc_x = readcoord();
gloc_y = readcoord();
gloc_z = readcoord();
if (cvar("nzp_particles")) {
pointparticles(particleeffectnum("blood.blood_particle"), gloc, '0 0 0', 1);
pointparticles(particleeffectnum("blood.gibs"), gloc, '0 0 0', 1);
}
break;
case EVENT_WEAPONCHANGE: case EVENT_WEAPONCHANGE:
local float to; local float to;
to = readbyte(); to = readbyte();

View file

@ -827,6 +827,7 @@ void() AI_SetAllEnemiesBBOX =
entity zombies = find(world, classname, "ai_zombie"); entity zombies = find(world, classname, "ai_zombie");
while(zombies != world) { while(zombies != world) {
if (zombies.aistatus == "1") {
zombies.last_solid = zombies.solid; zombies.last_solid = zombies.solid;
zombies.solid = SOLID_BBOX; zombies.solid = SOLID_BBOX;
@ -844,6 +845,7 @@ void() AI_SetAllEnemiesBBOX =
zombies.rarm.last_solid = zombies.rarm.solid; zombies.rarm.last_solid = zombies.rarm.solid;
zombies.rarm.solid = SOLID_BBOX; zombies.rarm.solid = SOLID_BBOX;
} }
}
zombies = find(zombies, classname, "ai_zombie"); zombies = find(zombies, classname, "ai_zombie");
} }
@ -854,6 +856,7 @@ void() AI_RevertEnemySolidState =
entity zombies = find(world, classname, "ai_zombie"); entity zombies = find(world, classname, "ai_zombie");
while(zombies != world) { while(zombies != world) {
if (zombies.aistatus == "1") {
zombies.solid = zombies.last_solid; zombies.solid = zombies.last_solid;
if (zombies.head) if (zombies.head)
@ -862,6 +865,7 @@ void() AI_RevertEnemySolidState =
zombies.larm.solid = zombies.larm.last_solid; zombies.larm.solid = zombies.larm.last_solid;
if (zombies.rarm) if (zombies.rarm)
zombies.rarm.solid = zombies.rarm.last_solid; zombies.rarm.solid = zombies.rarm.last_solid;
}
zombies = find(zombies, classname, "ai_zombie"); zombies = find(zombies, classname, "ai_zombie");
} }

View file

@ -590,7 +590,7 @@ void(vector where) spawn_gibs = {
#else #else
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET); WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EVENT_BLOOD); WriteByte(MSG_MULTICAST, EVENT_LIMBGIB);
WriteCoord(MSG_MULTICAST, where_x); WriteCoord(MSG_MULTICAST, where_x);
WriteCoord(MSG_MULTICAST, where_y); WriteCoord(MSG_MULTICAST, where_y);
WriteCoord(MSG_MULTICAST, where_z); WriteCoord(MSG_MULTICAST, where_z);

View file

@ -57,6 +57,7 @@ const float EVENT_WEAPONRECOIL = 40;
const float EVENT_SONGPLAY = 41; const float EVENT_SONGPLAY = 41;
const float EVENT_GRENADEPULSE = 42; const float EVENT_GRENADEPULSE = 42;
const float EVENT_BETTYPROMPT = 43; const float EVENT_BETTYPROMPT = 43;
const float EVENT_LIMBGIB = 44;
// Define our FTE platform // Define our FTE platform
#ifndef STANDARD #ifndef STANDARD