CLIENT: Add CSQC Flame particle effect

This commit is contained in:
cypress 2023-11-29 14:48:01 -05:00
parent 922789b413
commit 75b9adb1a6
7 changed files with 42 additions and 53 deletions

View file

@ -1403,6 +1403,17 @@ 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_FLAME:
vector floc;
floc_x = readcoord();
floc_y = readcoord();
floc_z = readcoord();
if (cvar("nzp_particles")) {
pointparticles(particleeffectnum("flames.flame_particle"), floc, '0 0 0', 1);
}
break;
case EVENT_LIMBGIB: case EVENT_LIMBGIB:
vector gloc; vector gloc;

View file

@ -157,18 +157,8 @@ void() Dog_Think =
// Play particles if we're on fire // Play particles if we're on fire
if (self.onfire) { if (self.onfire) {
Effect_Fire(self.origin);
#ifdef FTE
te_flamejet(self.origin, v_up*8, 10);
#else
particle (self.origin, v_up*8, 0, 0);
#endif // FTE
} }
} }
float dogCount; float dogCount;

View file

@ -647,6 +647,28 @@ void(entity who, float version) nzp_setdoubletapver =
#endif // FTE #endif // FTE
void(vector org) Effect_Fire =
{
#ifndef FTE
particle (self.origin, v_up*8, 111, 0);
#else
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EVENT_FLAME);
WriteCoord(MSG_MULTICAST, org_x);
WriteCoord(MSG_MULTICAST, org_y);
WriteCoord(MSG_MULTICAST, org_z);
multicast('0 0 0', MULTICAST_ALL);
//te_flamejet(self.origin, v_up*8, 10);
#endif // FTE
};
// ***************************************** // *****************************************
// Unrelated to engine, but custom functions // Unrelated to engine, but custom functions
// ***************************************** // *****************************************

View file

@ -54,17 +54,7 @@ void() Barrel_Think =
{ {
// Spawn the flame particles // Spawn the flame particles
if (self.ltime > 10) { if (self.ltime > 10) {
Effect_Fire(self.origin + '0 0 45');
#ifndef FTE
particle (self.origin, v_up, 111, 0);
#else
te_flamejet(self.origin + '0 0 45', v_up, 10);
#endif // FTE
self.ltime = 0; self.ltime = 0;
} }
self.ltime++; self.ltime++;

View file

@ -28,33 +28,17 @@
string(float wep, float gorvmodel) GetWeaponModel; string(float wep, float gorvmodel) GetWeaponModel;
void() ReturnWeaponModel; void() ReturnWeaponModel;
void() flame_update = { void() flame_update =
{
#ifndef FTE Effect_Fire(self.origin);
particle (self.origin, v_up, 111, 0);
#else
te_flamejet(self.origin, v_up, 10);
#endif // FTE
self.think = flame_update; self.think = flame_update;
self.nextthink = time + random()+0.1; self.nextthink = time + random()+0.1;
} }
void() place_fire = void() place_fire =
{ {
Effect_Fire(self.origin);
#ifndef FTE
particle (self.origin, v_up*8, self.frame, 0);
#else
te_flamejet(self.origin, v_up*8, 10);
#endif // FTE
self.think = flame_update; self.think = flame_update;
self.nextthink = time + random()+0.1; self.nextthink = time + random()+0.1;

View file

@ -33,16 +33,7 @@
// //
void() Flame_LingerThink = void() Flame_LingerThink =
{ {
Effect_Fire(self.origin);
#ifdef FTE
te_flamejet(self.origin, v_up*8, 5);
#else
particle (self.origin, v_up*8, 0, 0);
#endif // FTE
if (self.ltime < time) if (self.ltime < time)
remove(self); remove(self);

View file

@ -60,6 +60,7 @@ const float EVENT_BETTYPROMPT = 43;
const float EVENT_LIMBGIB = 44; const float EVENT_LIMBGIB = 44;
const float EVENT_CHATMESSAGE = 45; const float EVENT_CHATMESSAGE = 45;
const float EVENT_DOUBLETAPUPDATE = 46; const float EVENT_DOUBLETAPUPDATE = 46;
const float EVENT_FLAME = 47;
// Define our FTE platform // Define our FTE platform
#ifndef STANDARD #ifndef STANDARD