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,24 +827,26 @@ void() AI_SetAllEnemiesBBOX =
entity zombies = find(world, classname, "ai_zombie"); entity zombies = find(world, classname, "ai_zombie");
while(zombies != world) { while(zombies != world) {
zombies.last_solid = zombies.solid; if (zombies.aistatus == "1") {
zombies.solid = SOLID_BBOX; zombies.last_solid = zombies.solid;
zombies.solid = SOLID_BBOX;
if (zombies.head) { if (zombies.head) {
zombies.head.last_solid = zombies.head.solid; zombies.head.last_solid = zombies.head.solid;
zombies.head.solid = SOLID_BBOX; zombies.head.solid = SOLID_BBOX;
}
if (zombies.larm) {
zombies.larm.last_solid = zombies.larm.solid;
zombies.larm.solid = SOLID_BBOX;
}
if (zombies.rarm) {
zombies.rarm.last_solid = zombies.rarm.solid;
zombies.rarm.solid = SOLID_BBOX;
}
} }
if (zombies.larm) {
zombies.larm.last_solid = zombies.larm.solid;
zombies.larm.solid = SOLID_BBOX;
}
if (zombies.rarm) {
zombies.rarm.last_solid = zombies.rarm.solid;
zombies.rarm.solid = SOLID_BBOX;
}
zombies = find(zombies, classname, "ai_zombie"); zombies = find(zombies, classname, "ai_zombie");
} }
} }
@ -854,14 +856,16 @@ void() AI_RevertEnemySolidState =
entity zombies = find(world, classname, "ai_zombie"); entity zombies = find(world, classname, "ai_zombie");
while(zombies != world) { while(zombies != world) {
zombies.solid = zombies.last_solid; if (zombies.aistatus == "1") {
zombies.solid = zombies.last_solid;
if (zombies.head) if (zombies.head)
zombies.head.solid = zombies.head.last_solid; zombies.head.solid = zombies.head.last_solid;
if (zombies.larm) if (zombies.larm)
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