Counter-Strike: Updated the WEAPON_SMOKEGRENADE smoke particle effect.

This commit is contained in:
Marco Cawthorne 2020-04-23 03:41:56 +02:00
parent b44ea3320f
commit a31b3b0e47
12 changed files with 52 additions and 5 deletions

View file

@ -0,0 +1,14 @@
r_part effect
{
texture ball
count 1
scale 512
scalefactor 1
die 3
alpha 0.7
rgb 128 128 128
spawnmode ball
gravity -25
veladd -20
randomvel 64 -64
}

View file

@ -88,6 +88,13 @@ switch (fHeader) {
FX_Impact(iType, vOrigin, vNormal);
break;
case EV_SMOKE:
vector vSmokePos;
vSmokePos[0] = readcoord();
vSmokePos[1] = readcoord();
vSmokePos[2] = readcoord();
FX_Smokenade(vSmokePos);
break;
case EV_CHAT:
float fSender = readbyte();
float fTeam = readbyte();

View file

@ -122,6 +122,7 @@ Game_RendererRestarted(string rstr)
FX_GibHuman_Init();
FX_Spark_Init();
FX_Impact_Init();
FX_Smokenade_Init();
precache_model("sprites/640hud1.spr");
precache_model("sprites/640hud2.spr");

View file

@ -14,6 +14,7 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef CLIENT
var float DECAL_SHOT;
var float DECAL_GLASS;
var float PARTICLE_PIECES_BLACK;
@ -40,6 +41,7 @@ FX_Impact_Init(void)
PARTICLE_SMOKE_GREY = particleeffectnum("part_smoke_grey");
PARTICLE_SMOKE_BROWN = particleeffectnum("part_smoke_brown");
}
#endif
void
FX_Impact(int iType, vector vecPos, vector vNormal)

View file

@ -14,14 +14,24 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef CLIENT
var int PARTICLE_SMOKEGRENADE;
void
FX_Smokenade_Init(void)
{
PARTICLE_SMOKEGRENADE = particleeffectnum("fx_smokenade.effect");
}
#endif
void
FX_Smokenade(vector vecPos)
{
#ifdef SERVER
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EV_SMOKE);
WriteCoord(MSG_MULTICAST, vecPos[0]);
WriteCoord(MSG_MULTICAST, vecPos[1]);
WriteCoord(MSG_MULTICAST, vecPos[0]);
WriteCoord(MSG_MULTICAST, vecPos[1]);
WriteCoord(MSG_MULTICAST, vecPos[2]);
msg_entity = self;
multicast([0,0,0], MULTICAST_ALL);
@ -35,9 +45,9 @@ FX_Smokenade(vector vecPos)
if (self.frame <= 0) {
remove(self);
return;
}
// pointparticles(PARTICLE_SMOKEGRENADE, self.origin, [0,0,0], 1);
}
pointparticles(PARTICLE_SMOKEGRENADE, self.origin, [0,0,0], 1);
self.frame--;
self.nextthink = time + 0.2f;
self.skin = getstatf(STAT_GAMETIME);

View file

@ -101,6 +101,7 @@ void w_smokegrenade_throw(void)
{
static void smokegrenade_explode(void)
{
FX_Smokenade(self.origin);
Sound_Play(self, CHAN_BODY, "weapon_smokegrenade.explode");
remove(self);
}

View file

@ -14,6 +14,7 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef CLIENT
var float PARTICLE_BLOOD;
void
@ -23,6 +24,7 @@ FX_Blood_Init(void)
precache_model("sprites/blood.spr");
PARTICLE_BLOOD = particleeffectnum("part_blood");
}
#endif
void
FX_Blood(vector pos, vector color)

View file

@ -14,6 +14,7 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef CLIENT
void
FX_BreakModel_Init(void)
{
@ -39,6 +40,7 @@ FX_BreakModel_Init(void)
precache_sound("debris/bustconcrete2.wav");
precache_sound("debris/bustceiling.wav");
}
#endif
void
FX_BreakModel(int count, vector vMins, vector vMaxs, vector vVel, float fStyle)

View file

@ -14,6 +14,7 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef CLIENT
void
FX_Explosion_Init(void)
{
@ -22,6 +23,7 @@ FX_Explosion_Init(void)
precache_sound("weapons/explode5.wav");
precache_model("sprites/fexplo.spr");
}
#endif
void
FX_Explosion(vector vecPos)

View file

@ -14,6 +14,7 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef CLIENT
string g_hgibs[] = {
"models/gib_b_bone.mdl",
"models/gib_legbone.mdl",
@ -32,6 +33,7 @@ FX_GibHuman_Init(void)
precache_model("models/gib_b_gib.mdl");
precache_sound("common/bodysplat.wav");
}
#endif
void
FX_GibHuman(vector pos)

View file

@ -14,6 +14,7 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef CLIENT
var float DECAL_SHOT;
var float DECAL_GLASS;
var float PARTICLE_PIECES_BLACK;
@ -35,6 +36,7 @@ FX_Impact_Init(void)
PARTICLE_SMOKE_GREY = particleeffectnum("part_smoke_grey");
PARTICLE_SMOKE_BROWN = particleeffectnum("part_smoke_brown");
}
#endif
void
FX_Impact(int iType, vector vecPos, vector vNormal)

View file

@ -14,6 +14,7 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef CLIENT
var float PARTICLE_SPARK;
void
@ -27,6 +28,7 @@ FX_Spark_Init(void)
precache_sound("buttons/spark6.wav");
PARTICLE_SPARK = particleeffectnum("part_spark");
}
#endif
void
FX_Spark(vector pos, vector ang)