summaryrefslogtreecommitdiff
path: root/src/fpsgame/weapon.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/fpsgame/weapon.cpp')
-rw-r--r--src/fpsgame/weapon.cpp55
1 files changed, 2 insertions, 53 deletions
diff --git a/src/fpsgame/weapon.cpp b/src/fpsgame/weapon.cpp
index 6ade009..d911aba 100644
--- a/src/fpsgame/weapon.cpp
+++ b/src/fpsgame/weapon.cpp
@@ -13,8 +13,6 @@ namespace game
};
vector<hitmsg> hits;
- //~VARP(maxdebris, 10, 25, 1000);
-
ICOMMAND(getweapon, "", (), intret(player1->gunselect));
void gunselect(int gun, fpsent *d)
@@ -133,7 +131,6 @@ namespace game
loopi(guns[gun].rays) offsetray(from, to, guns[gun].spread, guns[gun].range, rays[i]);
}
- //~enum { BNC_GRENADE, BNC_GIBS, BNC_DEBRIS };
enum { BNC_GRENADE };
struct bouncer : physent
@@ -181,7 +178,6 @@ namespace game
{
bouncer &bnc = *bouncers.add(new bouncer);
bnc.o = from;
- //~bnc.radius = bnc.xradius = bnc.yradius = type==BNC_DEBRIS ? 0.5f : 1.5f;
bnc.radius = bnc.xradius = bnc.yradius = 1.5f;
bnc.eyeheight = bnc.radius;
bnc.aboveeye = bnc.radius;
@@ -194,13 +190,6 @@ namespace game
bnc.collidetype = COLLIDE_ELLIPSE_PRECISE;
- //~switch(type)
- //~{
- //~case BNC_GRENADE: bnc.collidetype = COLLIDE_ELLIPSE_PRECISE; break;
- //~case BNC_DEBRIS: bnc.variant = rnd(4); break;
- //~case BNC_GIBS: bnc.variant = rnd(3); break;
- //~}
-
vec dir(to);
dir.sub(from).safenormalize();
bnc.vel = dir;
@@ -225,7 +214,6 @@ namespace game
{
if(d->type != ENT_BOUNCE) return;
bouncer *b = (bouncer *)d;
- //~if(b->bouncetype != BNC_GIBS || b->bounces >= 2) return;
if(b->bounces >= 2) return;
b->bounces++;
adddecal(DECAL_BLOOD, vec(b->o).sub(vec(surface).mul(b->radius)), surface, 2.96f/b->bounces, bvec(0x60, 0xFF, 0xFF), rnd(4));
@@ -244,16 +232,7 @@ namespace game
vec old(bnc.o);
bool stopped = false;
if(bnc.bouncetype==BNC_GRENADE) stopped = bounce(&bnc, 0.6f, 0.5f, 0.8f) || (bnc.lifetime -= time)<0;
- //~else
- //~{
- //~// cheaper variable rate physics for debris, gibs, etc.
- //~for(int rtime = time; rtime > 0;)
- //~{
- //~int qtime = min(30, rtime);
- //~rtime -= qtime;
- //~if((bnc.lifetime -= qtime)<0 || bounce(&bnc, qtime/1000.0f, 0.6f, 0.5f, 1)) { stopped = true; break; }
- //~}
- //~}
+
if(stopped)
{
if(bnc.bouncetype==BNC_GRENADE)
@@ -345,13 +324,6 @@ namespace game
newbouncer(p, to, true, 0, d, type, rnd(1000)+1000, rnd(100)+20, light);
}
- //~void gibeffect(int damage, const vec &vel, fpsent *d)
- //~{
- //~if(!blood || damage <= 0) return;
- //~vec from = d->abovehead();
- //~loopi(min(damage/25, 40)+1) spawnbouncer(from, vel, d, BNC_GIBS);
- //~}
-
void hit(int damage, dynent *d, fpsent *at, const vec &vel, int gun, float info1, int info2 = 1)
{
if(at==player1 && d!=at)
@@ -433,16 +405,6 @@ namespace game
if(gun==GUN_RL) adddynlight(v, 1.15f*guns[gun].exprad, vec(2, 1.5f, 1), 700, 100, 0, guns[gun].exprad/2, vec(1, 0.75f, 0.5f));
else if(gun==GUN_GL) adddynlight(v, 1.15f*guns[gun].exprad, vec(0.5f, 1.5f, 2), 600, 100, 0, 8, vec(0.25f, 1, 1));
else adddynlight(v, 1.15f*guns[gun].exprad, vec(2, 1.5f, 1), 700, 100);
- //~int numdebris = rnd(maxdebris-5)+5;
- //~vec debrisvel = vec(owner->o).sub(v).safenormalize(), debrisorigin(v);
- //~if(gun==GUN_RL) debrisorigin.add(vec(debrisvel).mul(8));
- //~if(numdebris)
- //~{
- //~entitylight light;
- //~lightreaching(debrisorigin, light.color, light.dir);
- //~loopi(numdebris)
- //~spawnbouncer(debrisorigin, debrisvel, owner, BNC_DEBRIS, &light);
- //~}
if(!local) return;
int numdyn = numdynents();
loopi(numdyn)
@@ -583,8 +545,6 @@ namespace game
{
case GUN_FIST:
if(d->type==ENT_PLAYER && chainsawhudgun) sound = S_CHAINSAW_ATTACK;
- //~if(d->quadmillis)
- //~particle_splash(PART_FLAME, 60, 300, vec(0).sub(from), 0x802010, 0.24f);
break;
case GUN_SG:
@@ -841,14 +801,9 @@ namespace game
}
static const char * const projnames[2] = { "projectiles/grenade", "projectiles/rocket" };
- //~static const char * const gibnames[3] = { "gibs/gib01", "gibs/gib02", "gibs/gib03" };
- //~static const char * const debrisnames[4] = { "debris/debris01", "debris/debris02", "debris/debris03", "debris/debris04" };
- void preloadbouncers()
- {
+ void preloadbouncers() {
loopi(sizeof(projnames)/sizeof(projnames[0])) preloadmodel(projnames[i]);
- //~loopi(sizeof(gibnames)/sizeof(gibnames[0])) preloadmodel(gibnames[i]);
- //~loopi(sizeof(debrisnames)/sizeof(debrisnames[0])) preloadmodel(debrisnames[i]);
}
void renderbouncers()
@@ -875,12 +830,6 @@ namespace game
int cull = MDL_CULL_VFC|MDL_CULL_DIST|MDL_CULL_OCCLUDED;
float fade = 1;
if(bnc.lifetime < 250) fade = bnc.lifetime/250.0f;
- //~switch(bnc.bouncetype)
- //~{
- //~case BNC_GIBS: mdl = gibnames[bnc.variant]; cull |= MDL_LIGHT|MDL_LIGHT_FAST|MDL_DYNSHADOW; break;
- //~case BNC_DEBRIS: mdl = debrisnames[bnc.variant]; break;
- //~default: continue;
- //~}
rendermodel(&bnc.light, mdl, ANIM_MAPMODEL|ANIM_LOOP, pos, yaw, pitch, cull, NULL, NULL, 0, 0, fade);
}
}