-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
137 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
Index: src/fpsgame/weapon.cpp | ||
=================================================================== | ||
--- src/fpsgame/weapon.cpp (revision 6519) | ||
+++ src/fpsgame/weapon.cpp (working copy) | ||
@@ -228,6 +228,8 @@ | ||
adddecal(DECAL_BLOOD, vec(b->o).sub(vec(surface).mul(b->radius)), surface, 2.96f/b->bounces, bvec(0x60, 0xFF, 0xFF), rnd(4)); | ||
} | ||
|
||
+ MOD(HVARP, trailcolorgrenadelauncher, 0, 0x404040, 0xFFFFFF); | ||
+ | ||
void updatebouncers(int time) | ||
{ | ||
loopv(bouncers) | ||
@@ -236,7 +238,7 @@ | ||
if(bnc.bouncetype==BNC_GRENADE && bnc.vel.magnitude() > 50.0f) | ||
{ | ||
vec pos = bnc.offsetpos(); | ||
- regular_particle_splash(PART_SMOKE, 1, 150, pos, 0x404040, 2.4f, 50, -20); | ||
+ regular_particle_splash(PART_SMOKE, 1, 150, pos, trailcolorgrenadelauncher, 2.4f, 50, -20); | ||
} | ||
vec old(bnc.o); | ||
bool stopped = false; | ||
@@ -520,6 +522,8 @@ | ||
return true; | ||
} | ||
|
||
+ MOD(HVARP, trailcolorrocketlauncher, 0, 0x404040, 0xFFFFFF); | ||
+ | ||
void updateprojectiles(int time) | ||
{ | ||
loopv(projs) | ||
@@ -570,7 +574,7 @@ | ||
} | ||
particle_splash(guns[p.gun].part, 1, 1, pos, color, 4.8f, 150, 20); | ||
} | ||
- else regular_particle_splash(PART_SMOKE, 2, 300, pos, 0x404040, 2.4f, 50, -20); | ||
+ else regular_particle_splash(PART_SMOKE, 2, 300, pos, p.gun==GUN_RL ? trailcolorrocketlauncher : 0x404040, 2.4f, 50, -20); | ||
} | ||
} | ||
if(exploded) | ||
@@ -588,6 +592,10 @@ | ||
|
||
VARP(muzzleflash, 0, 1, 1); | ||
VARP(muzzlelight, 0, 1, 1); | ||
+ MOD(HVARP, trailcolorshotgun, 0, 0xFFC864, 0xFFFFFF); | ||
+ MOD(HVARP, trailcolorchaingun, 0, 0xFFC864, 0xFFFFFF); | ||
+ MOD(HVARP, trailcolorrifle, 0, 0x404040, 0xFFFFFF); | ||
+ MOD(HVARP, trailcolorpistol, 0, 0xFFC864, 0xFFFFFF); | ||
|
||
void shoteffects(int gun, const vec &from, const vec &to, fpsent *d, bool local, int id, int prevaction) // create visual effect from a shot | ||
{ | ||
@@ -606,7 +614,7 @@ | ||
loopi(guns[gun].rays) | ||
{ | ||
particle_splash(PART_SPARK, 20, 250, rays[i], 0xB49B4B, 0.24f); | ||
- particle_flare(hudgunorigin(gun, from, rays[i], d), rays[i], 300, PART_STREAK, 0xFFC864, 0.28f); | ||
+ particle_flare(hudgunorigin(gun, from, rays[i], d), rays[i], 300, PART_STREAK, trailcolorshotgun, 0.28f); | ||
if(!local) adddecal(DECAL_BULLET, rays[i], vec(from).sub(rays[i]).safenormalize(), 2.0f); | ||
} | ||
if(muzzlelight) adddynlight(hudgunorigin(gun, d->o, to, d), 30, vec(0.5f, 0.375f, 0.25f), 100, 100, DL_FLASH, 0, vec(0, 0, 0), d); | ||
@@ -617,7 +625,7 @@ | ||
case GUN_PISTOL: | ||
{ | ||
particle_splash(PART_SPARK, 200, 250, to, 0xB49B4B, 0.24f); | ||
- particle_flare(hudgunorigin(gun, from, to, d), to, 600, PART_STREAK, 0xFFC864, 0.28f); | ||
+ particle_flare(hudgunorigin(gun, from, to, d), to, 600, PART_STREAK, gun==GUN_CG ? trailcolorchaingun : trailcolorpistol, 0.28f); | ||
if(muzzleflash && d->muzzle.x >= 0) | ||
particle_flare(d->muzzle, d->muzzle, gun==GUN_CG ? 100 : 200, PART_MUZZLE_FLASH1, 0xFFFFFF, gun==GUN_CG ? 2.25f : 1.25f, d); | ||
if(!local) adddecal(DECAL_BULLET, to, vec(from).sub(to).safenormalize(), 2.0f); | ||
@@ -650,7 +658,7 @@ | ||
|
||
case GUN_RIFLE: | ||
particle_splash(PART_SPARK, 200, 250, to, 0xB49B4B, 0.24f); | ||
- particle_trail(PART_SMOKE, 500, hudgunorigin(gun, from, to, d), to, 0x404040, 0.6f, 20); | ||
+ particle_trail(PART_SMOKE, 500, hudgunorigin(gun, from, to, d), to, trailcolorrifle, 0.6f, 20); | ||
if(muzzleflash && d->muzzle.x >= 0) | ||
particle_flare(d->muzzle, d->muzzle, 150, PART_MUZZLE_FLASH3, 0xFFFFFF, 1.25f, d); | ||
if(!local) adddecal(DECAL_BULLET, to, vec(from).sub(to).safenormalize(), 3.0f); | ||
@@ -676,6 +684,19 @@ | ||
if(d->quadmillis && lastmillis-prevaction>200 && !looped) playsound(S_ITEMPUP, d==h ? NULL : &d->o); | ||
} | ||
|
||
+ ICOMMAND(settrailcolor, "sf", (char *name, float *color), { | ||
+ if(!color) return; | ||
+ switch (getweapon(name)) | ||
+ { | ||
+ case GUN_SG: trailcolorshotgun = *color; break; | ||
+ case GUN_CG: trailcolorchaingun = *color; break; | ||
+ case GUN_RL: trailcolorrocketlauncher = *color; break; | ||
+ case GUN_RIFLE: trailcolorrifle = *color; break; | ||
+ case GUN_GL: trailcolorgrenadelauncher = *color; break; | ||
+ case GUN_PISTOL: trailcolorpistol = *color; break; | ||
+ } | ||
+ }); | ||
+ | ||
void particletrack(physent *owner, vec &o, vec &d) | ||
{ | ||
if(owner->type!=ENT_PLAYER && owner->type!=ENT_AI) return; | ||
@@ -1000,4 +1021,3 @@ | ||
} | ||
} | ||
}; | ||
- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters