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"))
pointparticles(particleeffectnum("blood.blood_particle"), loc, '0 0 0', 1);
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:
vector gloc;

View file

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

View file

@ -647,6 +647,28 @@ void(entity who, float version) nzp_setdoubletapver =
#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
// *****************************************

View file

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

View file

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

View file

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

View file

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