Module dpmod: Change committed
havoc at icculus.org
havoc at icculus.org
Thu Feb 13 21:47:27 EST 2003
Commiter : havoc
CVSROOT : /cvs/cvsroot/twilight
Module : dpmod
Commit time: 2003-02-14 02:47:27 UTC
Log message:
I made these changes a long time ago but never committed them until now... my memory is hazy on these...
single barreled shotgun is gone, now spawn with pistol as weapon 2 (weapon slot 1 empty)
added switchable modes on weapons, more specifically the double barreled shotgun can use explosive slugs (use +button5 to switch if I remember correctly)
plasma gun is reworked entirely again (rapid fire in bursts, altfire zooms and makes it fire more powerful shots but burst runs out sooner)
FireBullets reworked to take lots of parameters again (supporting old qcc's is pointless)
Modified files:
qc/bullets.qc qc/casings.qc qc/client.qc qc/damage.qc
qc/explosion.qc qc/item_ammo.qc qc/item_weapons.qc
qc/m_soldier.qc qc/mine.qc qc/progs.src qc/w_dbshotgun.qc
qc/w_nailgun.qc qc/w_pistol.qc qc/w_plasmarifle.qc
qc/w_shotgun.qc qc/w_supernailgun.qc
Added files:
qc/w_fake1.qc qc/w_oldplasmarifle.qc
------=MIME.2df054392014470c4e3ce475f2ccebca
Content-Type: text/plain; name="dpmod.20030214.024727.havoc.diff"
Content-Disposition: attachment; filename="dpmod.20030214.024727.havoc.diff"
Content-Transfer-Encoding: 8bit
Index: dpmod/qc/bullets.qc
diff -u dpmod/qc/bullets.qc:1.3 dpmod/qc/bullets.qc:1.4
--- dpmod/qc/bullets.qc:1.3 Fri Nov 15 07:59:54 2002
+++ dpmod/qc/bullets.qc Thu Feb 13 21:47:16 2003
@@ -7,39 +7,28 @@
local vector dir;
dir = normalize(self.velocity);
T_Damage(other, self, self.realowner, self.dmg, self.count, self.deathtype, self.cnt, self.origin, dir * self.count, self.obitfunc1);
+ if (other.solid == SOLID_BSP) // hit a wall
if (self.lefty >= 0)
if (pointcontents(self.origin) != CONTENT_SKY)
{
- traceline(self.origin - dir, self.origin + dir, FALSE, self);
- if (trace_fraction < 1)
- if (trace_ent.solid == SOLID_BSP) // hit a wall
+ if (self.lefty == 4) // nail
{
- if (self.lefty == 4) // nail
- {
- nailpuff(trace_endpos - dir * 4, self.effects & EF_BLUE);
- //newwallspike (trace_endpos, trace_ent, dir);
- }
- else if (self.lefty == 1) // shotgun pellet
- bulletpuff(trace_endpos - dir * 4, self.effects & EF_BLUE);
+ nailpuff(self.origin - dir * 4, self.effects & EF_BLUE);
+ //newwallspike (self.origin, other, dir);
}
+ else if (self.lefty == 1) // shotgun pellet
+ bulletpuff(self.origin - dir * 4, self.effects & EF_BLUE);
}
- remove(self);
+ if (self.count2)
+ BecomeExplosion(self, self.dmg2, self.count2, self.deathtype, '-1 0 0', self.effects & EF_BLUE, self.obitfunc1);
+ else
+ remove(self);
};
-entity bullet_owner;
-entity bullet_ignoreentity;
-entity bullet_launcher;
-float bullet_type;
-void(float shotcount, float damage, float bdamage, vector vel, float spread, string dethtype, float damgtype, void(entity t, entity a, string m, float dtyp) obitfunc) FireBullets =
+void(entity realbulletowner, entity bulletowner, float bullettype, float shotcount, float damage, float bdamage, float edamage, float eradius, vector vel, float spread, string dethtype, float damgtype, void(entity t, entity a, string m, float dtyp) obitfunc) FireBullets =
{
fightdone = time + 1; // delay stuff until fighting is over
spread = spread * vlen(vel);
- if (bullet_owner == world)
- bullet_owner = self;
- if (bullet_launcher == world)
- bullet_launcher = bullet_owner;
- if (bullet_ignoreentity == world && bullet_launcher == bullet_owner)
- bullet_ignoreentity = bullet_owner;
while (shotcount > 0)
{
shotcount = shotcount - 1;
@@ -48,31 +37,32 @@
setorigin(newmis, shotorg);
newmis.dmg = damage;
newmis.count = bdamage;
+ newmis.dmg2 = edamage;
+ newmis.count2 = eradius;
newmis.effects = EF_LOWPRECISION;
- if (bullet_owner.items & IT_QUAD)
- {
- newmis.effects = newmis.effects | EF_BLUE;
- newmis.dmg = newmis.dmg * 4;
- newmis.count = newmis.count * 4;
- }
- newmis.dmg = newmis.dmg;
- newmis.count = newmis.count;
- if (bullet_type < 0)
- newmis.movetype = MOVETYPE_FLY;
- else
- newmis.movetype = MOVETYPE_TOSS;
+ newmis.lefty = bullettype;
newmis.solid = SOLID_BBOX;
+ newmis.movetype = MOVETYPE_FLY;
newmis.velocity = vel + randomvec() * spread;// + bullet_launcher.velocity;
- newmis.realowner = bullet_owner;
- newmis.owner = bullet_ignoreentity;
+ newmis.realowner = realbulletowner;
+ newmis.owner = bulletowner;
newmis.deathtype = dethtype;
newmis.obitfunc1 = obitfunc;
newmis.cnt = damgtype;
newmis.touch = bullet_touch;
newmis.nextthink = time + 3;
newmis.think = SUB_Remove;
- newmis.lefty = bullet_type;
- if (maxclients == 1/* && bullet_type >= 0*/)
+ if (bulletowner.items & IT_QUAD)
+ {
+ newmis.effects = newmis.effects | EF_BLUE;
+ newmis.dmg = newmis.dmg * 4;
+ newmis.count = newmis.count * 4;
+ newmis.dmg2 = newmis.dmg2 * 4;
+ }
+ //if (self.lefty >= 0)
+ // newmis.movetype = MOVETYPE_TOSS;
+ //if (self.lefty >= 0)
+ if (maxclients == 1)
{
// only visible in singleplayer (network bandwidth reasons)
setmodel(newmis, "progs/s_spike.mdl");
@@ -80,10 +70,6 @@
}
setsize(newmis, '0 0 0', '0 0 0');
}
- bullet_owner = world;
- bullet_ignoreentity = world;
- bullet_launcher = world;
- bullet_type = 0;
};
/*
Index: dpmod/qc/casings.qc
diff -u dpmod/qc/casings.qc:1.1.1.1 dpmod/qc/casings.qc:1.2
--- dpmod/qc/casings.qc:1.1.1.1 Thu Sep 19 15:07:14 2002
+++ dpmod/qc/casings.qc Thu Feb 13 21:47:16 2003
@@ -1,7 +1,9 @@
void() InitCasings =
{
- precache_model ("progs/casing.mdl"); // bullet/shell/whatever casing
+ precache_model ("progs/casing_bronze.mdl"); // bullet casing (made by Tomaz)
+ precache_model ("progs/casing_steel.mdl"); // bullet casing (made by Tomaz)
+ precache_model ("progs/casing_shell.mdl"); // shell casing (made by Tomaz)
precache_sound ("weapons/tink1.wav");
};
@@ -75,25 +77,26 @@
e.touch = casingtouch;
e.knockedloosefunc = casingknockedloosefunc;
e.effects = EF_LOWPRECISION;
- setmodel (e, "progs/casing.mdl");
- if (maxclients == 1)
- e.cnt = time + 3000;
- else
- e.cnt = time + 30;
- if (casingtype == 1) // shotgun shell
+ e.createdtime = time;
+ if (casingtype == 1)
{
- //e.cnt = time + 30;
+ setmodel (e, "progs/casing_shell.mdl");
+ e.cnt = time + 30;
+ // bias to make these be considered more important than other things
e.createdtime = time + 1;
- e.skin = 2;
}
else if (casingtype == 2)
{
- //e.cnt = time + 10;
- e.createdtime = time;
- e.skin = 1;
+ setmodel (e, "progs/casing_steel.mdl");
+ e.cnt = time + 10;
}
else
- e.createdtime = time;
+ {
+ setmodel (e, "progs/casing_bronze.mdl");
+ e.cnt = time + 10;
+ }
+ if (maxclients == 1)
+ e.cnt = time + 3000;
setsize (e, '0 0 -1', '0 0 -1');
setorigin (e, org);
};
Index: dpmod/qc/client.qc
diff -u dpmod/qc/client.qc:1.3 dpmod/qc/client.qc:1.4
--- dpmod/qc/client.qc:1.3 Tue Nov 19 02:49:52 2002
+++ dpmod/qc/client.qc Thu Feb 13 21:47:16 2003
@@ -145,6 +145,7 @@
parm7 = STARTSP_AMMO_CELLS;
parm8 = STARTSP_WEAPON; // selected weapon
parm9 = 0; // armortype * 100
+ parm10 = STARTSP_AMMO_XSHELLS;
};
void() SetChangeParms =
@@ -167,6 +168,7 @@
parm7 = self.ammo_cells;
parm8 = self.weapon;
parm9 = self.armortype * 100;
+ parm10 = self.ammo_xshells;
};
void() DecodeLevelParms =
@@ -184,6 +186,7 @@
self.ammo_nails = 9999999;
self.ammo_rockets = 9999999;
self.ammo_cells = 9999999;
+ self.ammo_xshells = 9999999;
self.weapon = W_BestWeapon(TRUE);
}
else if (deathmatch)
@@ -197,6 +200,7 @@
self.ammo_nails = STARTDM_AMMO_NAILS;
self.ammo_rockets = STARTDM_AMMO_ROCKETS;
self.ammo_cells = STARTDM_AMMO_CELLS;
+ self.ammo_xshells = STARTDM_AMMO_XSHELLS;
self.weapon = W_BestWeapon(TRUE);
}
else // singleplayer or coop
@@ -216,6 +220,7 @@
self.ammo_cells = parm7;
self.weapon = parm8;
self.armortype = parm9 / 100;
+ self.ammo_xshells = parm10;
}
self.bodyhealth = self.health + 100;
bound_ammo(self);
@@ -846,7 +851,7 @@
self.solid = SOLID_NOT;
self.classname = "player";
self.health = 999;
- self.armortype = self.armorvalue = self.currentammo = self.ammo_shells = self.ammo_nails = self.ammo_rockets = self.ammo_cells = 0;
+ self.armortype = self.armorvalue = self.currentammo = self.ammo_shells = self.ammo_nails = self.ammo_rockets = self.ammo_cells = self.ammo_xshells = 0;
self.items = 0;
self.think = SUB_Null;
self.nextthink = 0;
@@ -1159,6 +1164,7 @@
self.ammo_nails = AMMOMAX_NAILS;
self.ammo_rockets = AMMOMAX_ROCKETS;
self.ammo_cells = AMMOMAX_CELLS;
+ self.ammo_xshells = AMMOMAX_XSHELLS;
}
if (intermission_running)
Index: dpmod/qc/damage.qc
diff -u dpmod/qc/damage.qc:1.1.1.1 dpmod/qc/damage.qc:1.2
--- dpmod/qc/damage.qc:1.1.1.1 Thu Sep 19 15:07:40 2002
+++ dpmod/qc/damage.qc Thu Feb 13 21:47:16 2003
@@ -3,21 +3,25 @@
.float ammo_nails;
.float ammo_rockets;
.float ammo_cells;
+.float ammo_xshells;
float AMMOMAX_SHELLS = 100;
float AMMOMAX_NAILS = 200;
float AMMOMAX_ROCKETS = 100;
-float AMMOMAX_CELLS = 100;
+float AMMOMAX_CELLS = 200;
+float AMMOMAX_XSHELLS = 100;
-float STARTDM_AMMO_SHELLS = 20;
+float STARTDM_AMMO_SHELLS = 0;
float STARTDM_AMMO_NAILS = 0;
float STARTDM_AMMO_ROCKETS = 0;
float STARTDM_AMMO_CELLS = 0;
+float STARTDM_AMMO_XSHELLS = 0;
-float STARTSP_AMMO_SHELLS = 20;
+float STARTSP_AMMO_SHELLS = 0;
float STARTSP_AMMO_NAILS = 0;
float STARTSP_AMMO_ROCKETS = 0;
float STARTSP_AMMO_CELLS = 0;
+float STARTSP_AMMO_XSHELLS = 0;
float STARTSP_WEAPON = IT_WEAPON2;
// ammo given by collecting weapons when already at weapon's fill-up limit
@@ -25,12 +29,14 @@
float AMMOWEAPONOVERFLOW_SHELLS = 3;
float AMMOWEAPONOVERFLOW_NAILS = 5;
float AMMOWEAPONOVERFLOW_ROCKETS = 1;
-float AMMOWEAPONOVERFLOW_CELLS = 2;
+float AMMOWEAPONOVERFLOW_CELLS = 5;
+float AMMOWEAPONOVERFLOW_XSHELLS = 3;
float AMMO_SHELLS = 20; // double if big box
float AMMO_NAILS = 25; // double if big box
float AMMO_ROCKETS = 5; // double if big box
-float AMMO_CELLS = 7; // double if big box
+float AMMO_CELLS = 14; // double if big box
+float AMMO_XSHELLS = 20; // double if big box
float AMMO_GRUNT_PISTOL_ROUNDS = 5;
float AMMO_GRUNT_SHOTGUN_SHELLS = 2;
@@ -112,6 +118,7 @@
if (e.ammo_nails > AMMOMAX_NAILS ) e.ammo_nails = AMMOMAX_NAILS;
if (e.ammo_rockets > AMMOMAX_ROCKETS) e.ammo_rockets = AMMOMAX_ROCKETS;
if (e.ammo_cells > AMMOMAX_CELLS ) e.ammo_cells = AMMOMAX_CELLS;
+ if (e.ammo_xshells > AMMOMAX_XSHELLS) e.ammo_xshells = AMMOMAX_XSHELLS;
};
float(entity e, float t, float a) full_ammo =
@@ -120,6 +127,7 @@
if (t == 2 && (e.ammo_nails + a) > AMMOMAX_NAILS ) return (AMMOMAX_NAILS - e.ammo_nails );
if (t == 3 && (e.ammo_rockets + a) > AMMOMAX_ROCKETS) return (AMMOMAX_ROCKETS - e.ammo_rockets);
if (t == 4 && (e.ammo_cells + a) > AMMOMAX_CELLS ) return (AMMOMAX_CELLS - e.ammo_cells );
+ if (t == 5 && (e.ammo_xshells + a) > AMMOMAX_XSHELLS) return (AMMOMAX_XSHELLS - e.ammo_xshells);
return a;
};
Index: dpmod/qc/explosion.qc
diff -u dpmod/qc/explosion.qc:1.2 dpmod/qc/explosion.qc:1.3
--- dpmod/qc/explosion.qc:1.2 Fri Nov 15 05:44:27 2002
+++ dpmod/qc/explosion.qc Thu Feb 13 21:47:16 2003
@@ -123,15 +123,20 @@
org = e.origin;
findbetterlocation2(e);
- if (explosioncolor == '0 0 0')
+ if (explosioncolor_x >= 0)
{
- if (quad)
- te_explosionquad(e.origin);
+ if (explosioncolor == '0 0 0')
+ {
+ if (quad)
+ te_explosionquad(e.origin);
+ else
+ te_explosion(e.origin);
+ }
else
- te_explosion(e.origin);
+ te_explosionrgb(e.origin, explosioncolor);
}
else
- te_explosionrgb(e.origin, explosioncolor);
+ sound(e, CHAN_AUTO, "weapons/r_exp3.wav", 1, ATTN_NORM);
T_RadiusDamage(e, e.owner, damg, radius, world, dt, DT_EXPLOSION, obitfunc);
remove(e);
Index: dpmod/qc/item_ammo.qc
diff -u dpmod/qc/item_ammo.qc:1.1.1.1 dpmod/qc/item_ammo.qc:1.2
--- dpmod/qc/item_ammo.qc:1.1.1.1 Thu Sep 19 15:06:58 2002
+++ dpmod/qc/item_ammo.qc Thu Feb 13 21:47:16 2003
@@ -31,6 +31,7 @@
if (self.weapon == 2) other.ammo_nails = other.ammo_nails + self.aflag;
if (self.weapon == 3) other.ammo_rockets = other.ammo_rockets + self.aflag;
if (self.weapon == 4) other.ammo_cells = other.ammo_cells + self.aflag;
+ if (self.weapon == 5) other.ammo_xshells = other.ammo_xshells + self.aflag;
bound_ammo (other);
@@ -80,21 +81,24 @@
float(entity player, entity item) item_nails_pickupeval = {if (player.ammo_nails < AMMOMAX_NAILS) return (AMMOMAX_NAILS - player.ammo_nails) * (AMMOMAX_NAILS - player.ammo_nails) * item.dmg;else return 0;};
float(entity player, entity item) item_rockets_pickupeval = {if (player.ammo_rockets < AMMOMAX_ROCKETS) return (AMMOMAX_ROCKETS - player.ammo_rockets) * (AMMOMAX_ROCKETS - player.ammo_rockets) * item.dmg;else return 0;};
float(entity player, entity item) item_cells_pickupeval = {if (player.ammo_cells < AMMOMAX_CELLS) return (AMMOMAX_CELLS - player.ammo_cells) * (AMMOMAX_CELLS - player.ammo_cells) * item.dmg;else return 0;};
+float(entity player, entity item) item_xshells_pickupeval = {if (player.ammo_xshells < AMMOMAX_XSHELLS) return (AMMOMAX_XSHELLS - player.ammo_xshells) * (AMMOMAX_XSHELLS - player.ammo_xshells) * item.dmg;else return 0;};
/*QUAKED item_shells (0 .5 .8) (0 0 0) (32 32 32)
*/
+float spawnxshells;
void() item_shells =
{
self.touch = ammo_touch;
+ self.weapon = 1;
if (self.spawnflags & WEAPON_BIG2)
{
precache_model ("progs/a_shell2.mdl");
setmodel (self, "progs/a_shell2.mdl");
if (self.aflag < 1)
self.aflag = AMMO_SHELLS * 2;
- self.netname = "You got some shotgun shells\n";
+ self.netname = "You got some shotgun buckshot shells\n";
}
else
{
@@ -102,16 +106,24 @@
setmodel (self, "progs/a_shell1.mdl");
if (self.aflag < 1)
self.aflag = AMMO_SHELLS;
- self.netname = "You got some shotgun shells\n";
+ self.netname = "You got some shotgun buckshot shells\n";
}
setsize (self, '-16 -16 0', '16 16 8');
setorigin(self, self.origin + '16 16 0');
- self.weapon = 1;
self.havocpickup = TRUE;
self.dmg = 60 * self.aflag / (AMMOMAX_SHELLS * AMMOMAX_SHELLS);
self.pickupevalfunc = item_shells_pickupeval;
+ spawnxshells = spawnxshells + 1;
+ if (spawnxshells & 1)
+ {
+ self.weapon = 5;
+ self.netname = "You got some shotgun explosive slugs\n";
+ self.dmg = 110 * self.aflag / (AMMOMAX_XSHELLS * AMMOMAX_XSHELLS);
+ self.pickupevalfunc = item_xshells_pickupeval;
+ }
+
StartItem ();
};
@@ -154,9 +166,9 @@
void() item_rockets =
{
- if (deathmatch == 7) {remove(self);return;}
-
self.touch = ammo_touch;
+
+ self.weapon = 3;
if (self.spawnflags & WEAPON_BIG2)
{
precache_model ("progs/a_rock8.mdl");
@@ -175,7 +187,6 @@
}
setsize (self, '-16 -16 0', '16 16 16');
setorigin(self, self.origin + '16 16 0');
- self.weapon = 3;
self.havocpickup = TRUE;
self.dmg = 120 * self.aflag / (AMMOMAX_ROCKETS * AMMOMAX_ROCKETS);
Index: dpmod/qc/item_weapons.qc
diff -u dpmod/qc/item_weapons.qc:1.1.1.1 dpmod/qc/item_weapons.qc:1.2
--- dpmod/qc/item_weapons.qc:1.1.1.1 Thu Sep 19 15:07:24 2002
+++ dpmod/qc/item_weapons.qc Thu Feb 13 21:47:16 2003
@@ -26,6 +26,7 @@
if ((other.ammo_nails >= AMMOMAX_NAILS ) || (self.ammo_nails < 1))
if ((other.ammo_rockets >= AMMOMAX_ROCKETS) || (self.ammo_rockets < 1))
if ((other.ammo_cells >= AMMOMAX_CELLS ) || (self.ammo_cells < 1))
+ if ((other.ammo_xshells >= AMMOMAX_XSHELLS) || (self.ammo_xshells < 1))
return; // would gain no ammo or weapon
// if the player was using their best weapon, change up to the new one if better
@@ -41,6 +42,7 @@
if (self.ammo_nails ) if (other.ammo_nails < self.ammo_nails ) other.ammo_nails = self.ammo_nails ; else other.ammo_nails = other.ammo_nails + AMMOWEAPONOVERFLOW_NAILS ;
if (self.ammo_rockets) if (other.ammo_rockets < self.ammo_rockets) other.ammo_rockets = self.ammo_rockets; else other.ammo_rockets = other.ammo_rockets + AMMOWEAPONOVERFLOW_ROCKETS;
if (self.ammo_cells ) if (other.ammo_cells < self.ammo_cells ) other.ammo_cells = self.ammo_cells ; else other.ammo_cells = other.ammo_cells + AMMOWEAPONOVERFLOW_CELLS ;
+ if (self.ammo_xshells) if (other.ammo_xshells < self.ammo_xshells) other.ammo_xshells = self.ammo_xshells; else other.ammo_xshells = other.ammo_xshells + AMMOWEAPONOVERFLOW_XSHELLS;
}
else
{
@@ -48,6 +50,7 @@
other.ammo_nails = other.ammo_nails + self.ammo_nails ;
other.ammo_rockets = other.ammo_rockets + self.ammo_rockets;
other.ammo_cells = other.ammo_cells + self.ammo_cells ;
+ other.ammo_xshells = other.ammo_xshells + self.ammo_xshells;
}
if (other.flags & FL_CLIENT)
@@ -117,10 +120,13 @@
if (item.ammo_cells)
if (player.ammo_cells < AMMOMAX_CELLS)
f = f + (AMMOMAX_CELLS - player.ammo_cells) * (AMMOMAX_CELLS - player.ammo_cells) * 30 * item.ammo_cells / (AMMOMAX_CELLS * AMMOMAX_CELLS);
+ if (item.ammo_xshells)
+ if (player.ammo_xshells < AMMOMAX_XSHELLS)
+ f = f + (AMMOMAX_XSHELLS - player.ammo_xshells) * (AMMOMAX_XSHELLS - player.ammo_xshells) * 110 * item.ammo_xshells / (AMMOMAX_XSHELLS * AMMOMAX_XSHELLS);
return f;
};
-void(string wmdl, float w, float shells, float nails, float rockets, float cells, string name) weapon_spawnhandler =
+void(string wmdl, float w, float shells, float nails, float rockets, float cells, float xshells, string name) weapon_spawnhandler =
{
self.havocpickup = TRUE;
self.pickupevalfunc = item_weapon_pickupeval;
@@ -132,10 +138,12 @@
self.ammo_nails = nails;
self.ammo_rockets = rockets;
self.ammo_cells = cells;
+ self.ammo_xshells = xshells;
// self.havocrating = self.havocrating + self.ammo_shells * 60;
// self.havocrating = self.havocrating + self.ammo_nails * 15;
// self.havocrating = self.havocrating + self.ammo_rockets * 120;
// self.havocrating = self.havocrating + self.ammo_cells * 30;
+// self.havocrating = self.havocrating + self.ammo_xshells * 110;
self.touch = weapon_touch;
setsize (self, '-16 -16 0', '16 16 32');
/*
@@ -145,6 +153,7 @@
if (nails ) self.ammo_nails = 999;
if (rockets) self.ammo_rockets = 999;
if (cells ) self.ammo_cells = 999;
+ if (xshells) self.ammo_xshells = 999;
}
*/
StartItem ();
@@ -152,26 +161,26 @@
/*QUAKED weapon_supershotgun (0 .5 .8) (-16 -16 0) (16 16 32)
*/
-void() weapon_supershotgun = {weapon_spawnhandler("progs/g_shot.mdl" , IT_WEAPON3, 20, 0, 0, 0, "You got the Super Shotgun!\n");};
+void() weapon_supershotgun = {weapon_spawnhandler("progs/g_shot.mdl" , IT_WEAPON3, 30, 0, 0, 0, 20, "You got the Super Shotgun!\n");};
/*QUAKED weapon_nailgun (0 .5 .8) (-16 -16 0) (16 16 32)
*/
-void() weapon_nailgun = {weapon_spawnhandler("progs/g_nail.mdl" , IT_WEAPON4, 0, 30, 0, 0, "You got the Nailgun!\n");};
+void() weapon_nailgun = {weapon_spawnhandler("progs/g_nail.mdl" , IT_WEAPON4, 0, 50, 0, 0, 0, "You got the Nailgun!\n");};
/*QUAKED weapon_supernailgun (0 .5 .8) (-16 -16 0) (16 16 32)
*/
-void() weapon_supernailgun = {weapon_spawnhandler("progs/g_nail2.mdl", IT_WEAPON5, 0, 30, 0, 0, "You got the Super Nailgun!\n");};
+void() weapon_supernailgun = {weapon_spawnhandler("progs/g_nail2.mdl", IT_WEAPON5, 0, 50, 0, 0, 0, "You got the Super Nailgun!\n");};
/*QUAKED weapon_grenadelauncher (0 .5 .8) (-16 -16 0) (16 16 32)
*/
-void() weapon_grenadelauncher = {weapon_spawnhandler("progs/g_rock.mdl" , IT_WEAPON6, 0, 0, 40, 0, "You got the Proximity Grenade Launcher!\n");};
+void() weapon_grenadelauncher = {weapon_spawnhandler("progs/g_rock.mdl" , IT_WEAPON6, 0, 0, 10, 0, 0, "You got the Proximity Grenade Launcher!\n");};
/*QUAKED weapon_rocketlauncher (0 .5 .8) (-16 -16 0) (16 16 32)
*/
-void() weapon_rocketlauncher = {weapon_spawnhandler("progs/g_rock2.mdl", IT_WEAPON7, 0, 0, 10, 0, "You got the Rocket Launcher!\n");};
+void() weapon_rocketlauncher = {weapon_spawnhandler("progs/g_rock2.mdl", IT_WEAPON7, 0, 0, 10, 0, 0, "You got the Rocket Launcher!\n");};
/*QUAKED weapon_lightning (0 .5 .8) (-16 -16 0) (16 16 32)
*/
-//void() weapon_lightning = {weapon_spawnhandler("progs/g_light.mdl" , IT_WEAPON8 | IT_WEAPON9 | IT_WEAPON10, 0, 0, 0, 40, "You got the Plasma Gun!\n");};
-void() weapon_lightning = {weapon_spawnhandler("progs/g_light.mdl" , IT_WEAPON8 | IT_WEAPON9, 0, 0, 0, 40, "You got the Plasma Gun!\n");};
+//void() weapon_lightning = {weapon_spawnhandler("progs/g_light.mdl" , IT_WEAPON8 | IT_WEAPON9 | IT_WEAPON10, 0, 0, 0, 20, 0, "You got the Plasma Gun!\n");};
+void() weapon_lightning = {weapon_spawnhandler("progs/g_light.mdl" , IT_WEAPON8 | IT_WEAPON9, 0, 0, 0, 50, 0, "You got the Plasma Gun!\n");};
Index: dpmod/qc/m_soldier.qc
diff -u dpmod/qc/m_soldier.qc:1.1.1.1 dpmod/qc/m_soldier.qc:1.2
--- dpmod/qc/m_soldier.qc:1.1.1.1 Thu Sep 19 15:07:39 2002
+++ dpmod/qc/m_soldier.qc Thu Feb 13 21:47:16 2003
@@ -159,8 +159,7 @@
sound (self, CHAN_WEAPON, "weapons/rocket1i.wav", 1, ATTN_NORM);
w_muzzleflash (shotorg, 1);
ejectcasing (shotorg, shotdir, '0 0 0', 50, 0);
- bullet_type = 4;
- FireBullets(1, DMG_SOLDIER_PISTOL_DAMAGE, DMG_SOLDIER_PISTOL_BDAMAGE, shotdir * 6000, 0.025, self.deathtype, DT_NAIL, Obituary_Generic);
+ FireBullets (self, self, 4, 1, DMG_SOLDIER_PISTOL_DAMAGE, DMG_SOLDIER_PISTOL_BDAMAGE, 0, 0, shotdir * 6000, 0.025, self.deathtype, DT_NAIL, Obituary_Generic);
};
void() army_pistol1 =[$shoot1, army_pistol2] {ai_face();self.dest = monster_shotleadbullet(0.4);};
@@ -191,8 +190,7 @@
sound (self, CHAN_WEAPON, "weapons/rocket1i.wav", 1, ATTN_NORM);
w_muzzleflash (shotorg, 1);
ejectcasing (shotorg, shotdir, '0 0 0', 50, 0);
- bullet_type = 4;
- FireBullets(1, DMG_SOLDIER_MACHINEGUN_DAMAGE, DMG_SOLDIER_MACHINEGUN_BDAMAGE, shotdir * 5000, 0.05, self.deathtype, DT_NAIL, Obituary_Generic);
+ FireBullets (self, self, 4, 1, DMG_SOLDIER_MACHINEGUN_DAMAGE, DMG_SOLDIER_MACHINEGUN_BDAMAGE, 0, 0, shotdir * 5000, 0.05, self.deathtype, DT_NAIL, Obituary_Generic);
};
void() army_nail1 =[$shoot1, army_nail2 ] {ai_face();self.dest1 = monster_shotleadbullet(0.4);};
@@ -226,8 +224,7 @@
sound (self, CHAN_WEAPON, "weapons/shotgn2.wav", 1, ATTN_NORM);
w_muzzleflash (shotorg, 2);
ejectcasing (shotorg, shotdir, '0 0 0', 50, 1);
- bullet_type = 1;
- FireBullets (DMG_SOLDIER_SHOTGUN_PELLETS, DMG_SOLDIER_SHOTGUN_DAMAGE, DMG_SOLDIER_SHOTGUN_BDAMAGE, shotdir * 4000, 0.1, self.deathtype, DT_SHOTGUN, Obituary_Generic);
+ FireBullets (self, self, 1, DMG_SOLDIER_SHOTGUN_PELLETS, DMG_SOLDIER_SHOTGUN_DAMAGE, DMG_SOLDIER_SHOTGUN_BDAMAGE, 0, 0, shotdir * 4000, 0.1, self.deathtype, DT_SHOTGUN, Obituary_Generic);
};
void() army_shotgun1 =[$shoot1, army_shotgun2 ] {ai_face();self.dest = monster_shotleadbullet(0.4);};
Index: dpmod/qc/mine.qc
diff -u dpmod/qc/mine.qc:1.3 dpmod/qc/mine.qc:1.4
--- dpmod/qc/mine.qc:1.3 Fri Nov 15 07:59:54 2002
+++ dpmod/qc/mine.qc Thu Feb 13 21:47:16 2003
@@ -29,12 +29,8 @@
v = self.angles;
v_x = 0 - v_x;
makevectors(v);
- bullet_type = -1;
- bullet_owner = self.owner;
- bullet_launcher = self;
- bullet_ignoreentity = world;
shotorg = self.origin;
- FireBullets(4, self.dmg / 4, self.dmg / 4, v_forward * 7000, 0.05, "LASERTRIPMINEDIRECT", DT_NAIL, self.obitfunc1);
+ FireBullets(self.owner, self, -1, 4, self.dmg / 4, self.dmg / 4, 0, 0, v_forward * 7000, 0.05, "LASERTRIPMINEDIRECT", DT_NAIL, self.obitfunc1);
Explosion(self.origin, self.owner, self.dmg, self.dmg2, "LASERTRIPMINEBLAST", '0 0 0', self.effects & EF_BLUE, self.obitfunc1);
}
else if (self.lefty == 3)
Index: dpmod/qc/progs.src
diff -u dpmod/qc/progs.src:1.2 dpmod/qc/progs.src:1.3
--- dpmod/qc/progs.src:1.2 Fri Nov 15 07:59:54 2002
+++ dpmod/qc/progs.src Thu Feb 13 21:47:16 2003
@@ -82,8 +82,8 @@
w_common.qc
-w_pistol.qc // 1
-w_shotgun.qc // 2
+w_fake1.qc // 1
+w_pistol.qc // 2
w_dbshotgun.qc // 3
w_nailgun.qc // 4
w_supernailgun.qc // 5
Index: dpmod/qc/w_dbshotgun.qc
diff -u dpmod/qc/w_dbshotgun.qc:1.3 dpmod/qc/w_dbshotgun.qc:1.4
--- dpmod/qc/w_dbshotgun.qc:1.3 Fri Nov 15 07:59:54 2002
+++ dpmod/qc/w_dbshotgun.qc Thu Feb 13 21:47:16 2003
@@ -1,14 +1,32 @@
-.float shotgunshells;
-
void(entity targ, entity attacker, string dmsg, float dtype) Obituary_DBShotgunSingle =
{
if (dtype == DTYPE_PLAYER)
{
- deathstring1 = targ.netname;
- deathstring2 = " was blown away by ";
- deathstring3 = attacker.netname;
- deathstring4 = "";
+ if (dmsg == "SHOTGUNEXPLOSIVESLUG")
+ {
+ if (targ.bodyhealth < 1)
+ {
+ deathstring1 = targ.netname;
+ deathstring2 = " was blown apart by an explosive slug from ";
+ deathstring3 = attacker.netname;
+ deathstring4 = "";
+ }
+ else
+ {
+ deathstring1 = targ.netname;
+ deathstring2 = " met an explosive slug from ";
+ deathstring3 = attacker.netname;
+ deathstring4 = "";
+ }
+ }
+ else
+ {
+ deathstring1 = targ.netname;
+ deathstring2 = " was blown away by ";
+ deathstring3 = attacker.netname;
+ deathstring4 = "";
+ }
}
else
Obituary_Fallback(targ, attacker, dmsg, dtype);
@@ -18,22 +36,43 @@
{
if (dtype == DTYPE_PLAYER)
{
- deathstring1 = targ.netname;
- deathstring2 = " took both barrels from ";
- deathstring3 = attacker.netname;
- deathstring4 = "";
+ if (dmsg == "SHOTGUNEXPLOSIVESLUG")
+ {
+ if (targ.bodyhealth < 1)
+ {
+ deathstring1 = targ.netname;
+ deathstring2 = " was blown apart by two explosive slugs from ";
+ deathstring3 = attacker.netname;
+ deathstring4 = "";
+ }
+ else
+ {
+ deathstring1 = targ.netname;
+ deathstring2 = " took two explosive slugs from ";
+ deathstring3 = attacker.netname;
+ deathstring4 = "";
+ }
+ }
+ else
+ {
+ deathstring1 = targ.netname;
+ deathstring2 = " took both barrels from ";
+ deathstring3 = attacker.netname;
+ deathstring4 = "";
+ }
}
else
Obituary_Fallback(targ, attacker, dmsg, dtype);
};
+
+float DBSHOTGUNBUCKSHOT = 60;
+float DBSHOTGUNEXPLOSIVESLUG = 85;
-void(void(entity t, entity a, string m, float dtyp) obitfunc) W_DBShotgunFireShell =
+.float shotgunmode, shotgunshells;
+void(void(entity t, entity a, string m, float dtyp) obitfunc, float spreadboost) W_DBShotgunFireShell =
{
local vector v;
- self.wfiretime = time;
- self.currentammo = self.ammo_shells = self.ammo_shells - 1;
- self.wload = self.wload - 1;
v = shotorg;
if (!(self.shotgunshells & 1))
{
@@ -45,127 +84,119 @@
self.shotgunshells = self.shotgunshells + 2;
shotorg = shotorg + v_right;
}
+ self.wload = self.wload - 1;
+ if (self.shotgunmode)
+ self.currentammo = self.ammo_xshells = self.ammo_xshells - 1;
else
- return; // never happens
+ self.currentammo = self.ammo_shells = self.ammo_shells - 1;
+ self.wfiretime = time;
w_muzzleflash(v, 4);
- //bullet_type = 1;
- //FireBullets(5, 9 * damagescale, 9 * damagescale, shotdir * 4000, 0.1, "SUPERSHOTGUN", DT_SHOTGUN, obitfunc);
- //bullet_type = 0;
- //FireBullets(10, 9 * damagescale, 9 * damagescale, shotdir * 4000, 0.1, "SUPERSHOTGUN", DT_SHOTGUN, obitfunc);
- bullet_type = 1;
- FireBullets(5, 4 * damagescale, 4 * damagescale, shotdir * 4000, 0.1, "SUPERSHOTGUN", DT_SHOTGUN, obitfunc);
- bullet_type = 0;
- FireBullets(10, 4 * damagescale, 4 * damagescale, shotdir * 4000, 0.1, "SUPERSHOTGUN", DT_SHOTGUN, obitfunc);
+ if (self.shotgunmode)
+ FireBullets(self, self, 1, 1, 0, 0, DBSHOTGUNEXPLOSIVESLUG * damagescale, 80, shotdir * 5000, spreadboost, "SHOTGUNEXPLOSIVESLUG", DT_SHOTGUN, obitfunc);
+ else
+ {
+ FireBullets(self, self, 1, 5, DBSHOTGUNBUCKSHOT * 0.1 * damagescale, DBSHOTGUNBUCKSHOT * 0.1 * damagescale, 0, 0, shotdir * 6000, spreadboost + 0.03, "SHOTGUN", DT_SHOTGUN, obitfunc);
+ FireBullets(self, self, 0, 5, DBSHOTGUNBUCKSHOT * 0.1 * damagescale, DBSHOTGUNBUCKSHOT * 0.1 * damagescale, 0, 0, shotdir * 6000, spreadboost + 0.03, "SHOTGUN", DT_SHOTGUN, obitfunc);
+ }
shotorg = v;
};
void() W_DBShotgunSingleFireCode =
{
- W_DBShotgunFireShell(Obituary_DBShotgunSingle);
+ W_DBShotgunFireShell(Obituary_DBShotgunSingle, 0);
};
void() W_DBShotgunDoubleFireCode =
-{
- while (self.wload >= 1)
- W_DBShotgunFireShell(Obituary_DBShotgunDouble);
-};
-
-/*
-void(entity targ, entity attacker, string dmsg, float dtype) Obituary_DBShotgunMine =
-{
- Obituary_Fallback(targ, attacker, dmsg, dtype);
-};
-
-void() W_DBShotgunMineFireCode =
-{
- self.wfiretime = time;
- self.currentammo = self.ammo_rockets = self.ammo_rockets - 1;
- w_muzzleflash(shotorg, 3);
- LaunchMine(shotorg, shotdir * 1000 + v_up * 200, self, 200 * damagescale, 250, MINE_PROXIMITY | MINE_DETONATEONBUTTON3, 2.5, "DBSHOTGUNMINE", Obituary_DBShotgunMine);
-};
-*/
-
-void(entity targ, entity attacker, string dmsg, float dtype) Obituary_DBShotgunGrenade =
{
- if (dtype == DTYPE_PLAYER)
+ if (self.wload > 1)
{
- deathstring1 = targ.netname;
- deathstring3 = attacker.netname;
- if (targ.bodyhealth < 1) // gib
- {
- deathstring2 = " ate one of ";
- deathstring4 = "'s pineapples";
- }
- else
- {
- deathstring2 = " was torn up by ";
- deathstring4 = "'s grenades";
- }
+ while (self.wload > 0)
+ W_DBShotgunFireShell(Obituary_DBShotgunDouble, 0.02);
}
else
- Obituary_Fallback(targ, attacker, dmsg, dtype);
+ W_DBShotgunSingleFireCode();
};
-void() W_DBShotgunGrenadeFireCode =
-{
- self.wfiretime = time;
- self.currentammo = self.ammo_rockets = self.ammo_rockets - 1;
- w_muzzleflash(shotorg, 3);
- //LaunchGrenade(shotorg, shotdir * 1000 + v_up * 200, self, 200 * damagescale, 250, GRENADE_IMPACT, 2.5, "DBSHOTGUNGRENADE", Obituary_DBShotgunGrenade);
- LaunchGrenade(shotorg, shotdir * 1000 + v_up * 200, self, 100 * damagescale, 250, GRENADE_IMPACT, 2.5, "DBSHOTGUNGRENADE", Obituary_DBShotgunGrenade);
-};
-
void() w_dbshotgundrop1;
void() w_dbshotgundrop2;
void() w_dbshotgunraise1;
void() w_dbshotgunraise2;
void() w_dbshotgun =
{
+ local float swapmode, otherammo;
local vector v;
- if (self.wload > self.ammo_shells)
- self.wload = self.ammo_shells;
+ if (widle(w_dbshotgundrop1))
+ return;
- if (self.button0)
+ if (self.shotgunmode)
{
- if (self.wload > 0)
- W_GenericSlowFireCode("weapons/shotgn2.wav", 0.2, W_DBShotgunDoubleFireCode);
- //W_GenericSlowFireCode("weapons/shotgn2.wav", 0.2, W_DBShotgunSingleFireCode);
+ swapmode = self.ammo_xshells < 1 && self.ammo_shells >= 1;
+ otherammo = self.ammo_shells >= 1;
+ }
+ else
+ {
+ swapmode = self.ammo_shells < 1 && self.ammo_xshells >= 1;
+ otherammo = self.ammo_xshells >= 1;
}
- else if (self.button3)
+
+ if (otherammo)
+ if (self.button5 || swapmode)
+ if (time > self.attack_finished)
+ {
+ self.shotgunmode = !self.shotgunmode;
+ self.wload = 0;
+ sound(self, CHAN_AUTO, "weapons/bsgload.wav", 1, ATTN_STATIC);
+ self.attack_finished = time + 1;
+ if (self.shotgunmode)
+ sprint(self, "Ammo: Explosive slugs\n");
+ else
+ sprint(self, "Ammo: Buckshot\n");
+ }
+
+ if (self.wload > 0)
{
- /*
- if (self.wload > 0)
+ if (self.button0)
+ W_GenericSlowFireCode("weapons/shotgn2.wav", 0.2, W_DBShotgunSingleFireCode);
+ else if (self.button3)
W_GenericSlowFireCode("weapons/shotgn2.wav", 0.2, W_DBShotgunDoubleFireCode);
- */
- if (self.ammo_rockets > 0)
- W_GenericSlowFireCode("weapons/grenade.wav", 0.8, W_DBShotgunGrenadeFireCode);
}
else
- self.notfiring = TRUE;
-
- if (self.wload < 1 && time > self.attack_finished)
{
- if (self.shotgunshells)
- {
- self.attack_finished = time + 0.3;
- sound(self, CHAN_AUTO, "weapons/bsgload.wav", 1, ATTN_STATIC);
- v = shotorg + v_forward * -8;
- if (self.shotgunshells & 1) ejectcasing (v + v_right * 1, shotdir, '0 0 0', 30, 1);
- if (self.shotgunshells & 2) ejectcasing (v + v_right * -1, shotdir, '0 0 0', 30, 1);
- self.shotgunshells = 0;
- }
- else if (self.ammo_shells >= 1)
+ if (time > self.attack_finished)
{
- self.wload = 2;
- self.attack_finished = time + 0.2;
- sound(self, CHAN_AUTO, "weapons/bsgload.wav", 1, ATTN_STATIC);
+ if (self.shotgunshells)
+ {
+ self.attack_finished = time + 0.4;
+ sound(self, CHAN_AUTO, "weapons/bsgload.wav", 1, ATTN_STATIC);
+ v = shotorg + v_forward * -8;
+ if (self.shotgunshells & 1) ejectcasing (v + v_right * 1, shotdir, '0 0 0', 30, 1);
+ if (self.shotgunshells & 2) ejectcasing (v + v_right * -1, shotdir, '0 0 0', 30, 1);
+ self.shotgunshells = 0;
+ }
+ else
+ {
+ if (self.shotgunmode)
+ {
+ if (self.ammo_xshells >= 1)
+ {
+ self.wload = min(self.ammo_xshells, 2);
+ self.attack_finished = time + 0.2;
+ sound(self, CHAN_AUTO, "weapons/bsgload.wav", 1, ATTN_STATIC);
+ }
+ }
+ else
+ {
+ if (self.ammo_shells >= 1)
+ {
+ self.wload = min(self.ammo_shells, 2);
+ self.attack_finished = time + 0.2;
+ sound(self, CHAN_AUTO, "weapons/bsgload.wav", 1, ATTN_STATIC);
+ }
+ }
+ }
}
- else if (widle(w_dbshotgundrop1))
- return;
}
- else if (widle(w_dbshotgundrop1))
- return;
if (self.wfiretime)
{
@@ -185,18 +216,22 @@
void() weapon3_precache =
{
precache_model("progs/v_dpshot2.mdl");
- precache_model("progs/grenade.mdl");
precache_sound("weapons/shotgn2.wav");
- precache_sound("weapons/grenade.wav");
precache_sound("weapons/bsgnoammo.wav");
precache_sound("weapons/bsgload.wav");
};
float() w_dbshotgunrating = {return genericweaponrating(0, 250, 175);};
-void() w_dbshotgunsetup = {wset(IT_WEAPON3, IT_SHELLS, self.ammo_shells, VWEP_SUPER_SHOTGUN, "progs/v_dpshot2.mdl");};
-float(float request) setweapon3 = {return weapongeneric(IT_WEAPON3, self.ammo_shells >= 1, request, w_dbshotgunsetup, w_dbshotgun, w_dbshotgunraise1, w_directaim, w_dbshotgunrating, "Double Barrel Shotgun");};
+void() w_dbshotgunsetup =
+{
+ if (self.shotgunmode)
+ wset(IT_WEAPON3, IT_SHELLS, self.ammo_xshells, VWEP_SUPER_SHOTGUN, "progs/v_dpshot2.mdl");
+ else
+ wset(IT_WEAPON3, IT_SHELLS, self.ammo_shells, VWEP_SUPER_SHOTGUN, "progs/v_dpshot2.mdl");
+};
+float(float request) setweapon3 = {return weapongeneric(IT_WEAPON3, self.ammo_shells >= 1 || self.ammo_xshells >= 1, request, w_dbshotgunsetup, w_dbshotgun, w_dbshotgunraise1, w_directaim, w_dbshotgunrating, "Double Barrel Shotgun");};
-void() w_dbshotgunraise1 = {self.wload = 2;self.shotgunshells = 0;wraise(9, w_dbshotgunraise2, 0.1);};
+void() w_dbshotgunraise1 = {self.wload = 0;self.shotgunshells = 0;wraise(9, w_dbshotgunraise2, 0.1);};
void() w_dbshotgunraise2 = {wraise(8, w_dbshotgun, 0.1);};
void() w_dbshotgundrop1 = {wdrop(8, w_dbshotgundrop2, 0.1);};
Index: dpmod/qc/w_fake1.qc
diff -u /dev/null dpmod/qc/w_fake1.qc:1.1
--- /dev/null Thu Feb 13 21:47:27 2003
+++ dpmod/qc/w_fake1.qc Thu Feb 13 21:47:16 2003
@@ -0,0 +1,4 @@
+void() weapon1_precache =
+{
+};
+float(float request) setweapon1 = {return FALSE;};
Index: dpmod/qc/w_nailgun.qc
diff -u dpmod/qc/w_nailgun.qc:1.3 dpmod/qc/w_nailgun.qc:1.4
--- dpmod/qc/w_nailgun.qc:1.3 Fri Nov 15 07:59:54 2002
+++ dpmod/qc/w_nailgun.qc Thu Feb 13 21:47:16 2003
@@ -37,8 +37,7 @@
}
w_muzzleflash(shotorg, 1);
- bullet_type = 4;
- FireBullets(1, 15 * damagescale, 15 * damagescale, shotdir * 7000, 0.025, "NAILGUN", DT_NAIL, Obituary_Nailgun);
+ FireBullets(self, self, 4, 1, 15 * damagescale, 15 * damagescale, 0, 0, shotdir * 7000, 0.025, "NAILGUN", DT_NAIL, Obituary_Nailgun);
shotorg = v;
if (self.ammo_nails < 1) {stopfiring = TRUE;return;}
Index: dpmod/qc/w_oldplasmarifle.qc
diff -u /dev/null dpmod/qc/w_oldplasmarifle.qc:1.1
--- /dev/null Thu Feb 13 21:47:27 2003
+++ dpmod/qc/w_oldplasmarifle.qc Thu Feb 13 21:47:16 2003
@@ -0,0 +1,107 @@
+
+void(entity targ, entity attacker, string dmsg, float dtype) Obituary_PlasmaRifle =
+{
+ if (dtype == DTYPE_PLAYER)
+ {
+ deathstring1 = targ.netname;
+ deathstring2 = " was burned by ";
+ deathstring3 = attacker.netname;
+ deathstring4 = "'s plasma rifle";
+ }
+ else
+ Obituary_Fallback(targ, attacker, dmsg, dtype);
+};
+
+void() W_PlasmaRifleFireRapid =
+{
+ local vector dir;
+ self.wload = self.wload - 1;
+ self.currentammo = self.ammo_cells = self.ammo_cells - 1;
+ self.wfiretime = time;
+ dir = shotdir + randomvec() * 0.03;
+ w_muzzleflash(shotorg, 1);
+ //FireBullets(self, self, shotorg, 4, 1, 30 * damagescale, 30 * damagescale, dir * 10000, 0, "PLASMARIFLE", DT_NAIL, Obituary_PlasmaRifle);
+ FirePlasma(self, shotorg, dir, 30 * damagescale, 45, '0 0 0', "PLASMARIFLE", Obituary_PlasmaRifle);
+};
+
+void() W_PlasmaRifleFireHighPower =
+{
+ self.currentammo = self.ammo_cells = self.ammo_cells - self.wload;
+ self.wfiretime = time;
+ //FireBullets(self, self, shotorg, 4, 1, self.wload * 30, self.wload * 30, dir * 10000, 0, "PLASMARIFLE", DT_NAIL, Obituary_PlasmaRifle);
+ FirePlasma(self, shotorg, shotdir, self.wload * 30 * damagescale, 105, '0 0 0', "PLASMARIFLE", Obituary_PlasmaRifle);
+ self.wload = 0;
+};
+
+.float idealzoom;
+
+void() w_plasmarifledrop1;
+void() w_plasmarifledrop2;
+void() w_plasmarifleraise1;
+void() w_plasmarifleraise2;
+void() w_plasmarifle =
+{
+ local float charge;
+ if (widle(w_plasmarifledrop1))
+ return;
+
+ if (self.button3)
+ self.idealzoom = 0.2;
+
+ if (self.wload > self.ammo_cells)
+ self.wload = self.ammo_cells;
+
+ if (self.button0 && self.wload >= 1)
+ {
+ if (self.viewzoom < 1)
+ W_GenericSlowFireCode("", 0.3, W_PlasmaRifleFireHighPower);
+ else
+ W_GenericSlowFireCode("", 0.1, W_PlasmaRifleFireRapid);
+ }
+ else if (time > self.attack_finished)
+ {
+ charge = self.ammo_cells;
+ if (charge > 8)
+ charge = 8;
+ if (self.wload < charge)
+ {
+ self.wload = charge;
+ self.attack_finished = time + 0.2;
+ // FIXME: need a charge sound
+ //sound (self, CHAN_WEAPON, "weapons/plasmarifle/charge.wav", 1, ATTN_NORM);
+ }
+ }
+
+ if (widle(w_plasmarifledrop1))
+ return;
+
+ if (self.wfiretime)
+ {
+ self.weaponframe = floor((time - self.wfiretime) * 10 + 1);
+ if (self.weaponframe >= 7)
+ self.weaponframe = self.wfiretime = 0;
+ }
+ else
+ self.weaponframe = 0;
+
+ havoc_shotanimupdate(self.weaponframe);
+};
+
+void() weapon8_precache =
+{
+ precache_model("progs/v_dpshot.mdl");
+ precache_model("progs/s_bubble.spr");
+ precache_model("progs/plasmashot.spr32");
+ //precache_sound("plasma/plasma.wav");
+ precache_sound("plasma/plasexpl.wav");
+};
+
+float() w_plasmariflerating = {return genericweaponrating(0, 1500, 200);};
+void() w_plasmariflesetup = {wset(IT_WEAPON8, IT_CELLS, self.ammo_cells, VWEP_SHOTGUN, "progs/v_dpshot.mdl");};
+float(float request) setweapon8 = {return weapongeneric(IT_WEAPON8, self.ammo_cells >= 1, request, w_plasmariflesetup, w_plasmarifle, w_plasmarifleraise1, w_directaim, w_plasmariflerating, "PlasmaRifle");};
+
+void() w_plasmarifleraise1 = {wraise(8, w_plasmarifleraise2, 0.1);};
+void() w_plasmarifleraise2 = {wraise(7, w_plasmarifle, 0.1);};
+
+void() w_plasmarifledrop1 = {wdrop(7, w_plasmarifledrop2, 0.1);};
+void() w_plasmarifledrop2 = {wdropped(8, 0.1);};
Index: dpmod/qc/w_pistol.qc
diff -u dpmod/qc/w_pistol.qc:1.3 dpmod/qc/w_pistol.qc:1.4
--- dpmod/qc/w_pistol.qc:1.3 Fri Nov 15 07:59:54 2002
+++ dpmod/qc/w_pistol.qc Thu Feb 13 21:47:16 2003
@@ -17,11 +17,7 @@
self.wfiretime = time;
w_muzzleflash(shotorg, 1);
ejectcasing(shotorg, shotdir, v_right * 150 + v_up * 50, 50, 0);
- bullet_type = 4;
- if (self.button3)
- FireBullets(1, 30 * damagescale, 30 * damagescale, shotdir * 7000, 0.05, "PISTOL", DT_NAIL, Obituary_Pistol);
- else
- FireBullets(1, 30 * damagescale, 30 * damagescale, shotdir * 7000, 0.0125, "PISTOL", DT_NAIL, Obituary_Pistol);
+ FireBullets(self, self, 4, 1, 30 * damagescale, 30 * damagescale, 0, 0, shotdir * 7000, 0, "PISTOL", DT_NAIL, Obituary_Pistol);
};
void() w_pistoldrop1;
@@ -35,8 +31,6 @@
if (self.button0)
W_GenericSlowFireCode("weapons/rocket1i.wav", 0.4, W_PistolFireCode);
- else if (self.button3)
- W_GenericSlowFireCode("weapons/rocket1i.wav", 0.2, W_PistolFireCode);
if (self.wfiretime)
{
@@ -50,15 +44,15 @@
havoc_shotanimupdate(self.weaponframe);
};
-void() weapon1_precache =
+void() weapon2_precache =
{
precache_model("progs/v_dpshot.mdl");
precache_sound("weapons/rocket1i.wav");
};
float() w_pistolrating = {return genericweaponrating(0, 99999, 75);};
-void() w_pistolsetup = {wset(IT_WEAPON1, 0, 0, VWEP_SHOTGUN, "progs/v_dpshot.mdl");};
-float(float request) setweapon1 = {return weapongeneric(IT_WEAPON1, TRUE, request, w_pistolsetup, w_pistol, w_pistolraise1, w_directaim, w_pistolrating, "Pistol");};
+void() w_pistolsetup = {wset(IT_WEAPON2, 0, 0, VWEP_SHOTGUN, "progs/v_dpshot.mdl");};
+float(float request) setweapon2 = {return weapongeneric(IT_WEAPON2, TRUE, request, w_pistolsetup, w_pistol, w_pistolraise1, w_directaim, w_pistolrating, "Pistol");};
void() w_pistolraise1 = {wraise(8, w_pistolraise2, 0.1);};
void() w_pistolraise2 = {wraise(7, w_pistol, 0.1);};
Index: dpmod/qc/w_plasmarifle.qc
diff -u dpmod/qc/w_plasmarifle.qc:1.4 dpmod/qc/w_plasmarifle.qc:1.5
--- dpmod/qc/w_plasmarifle.qc:1.4 Fri Nov 15 08:37:02 2002
+++ dpmod/qc/w_plasmarifle.qc Thu Feb 13 21:47:16 2003
@@ -14,6 +14,7 @@
Obituary_Fallback(targ, attacker, dmsg, dtype);
};
+/*
void() W_PlasmaRifleFire5 =
{
self.wfiretime = time;
@@ -27,7 +28,18 @@
self.currentammo = self.ammo_cells = self.ammo_cells - 1;
FirePlasma(self, shotorg, shotdir, 120 * damagescale, 60, '0 0 0', "PLASMARIFLE", Obituary_PlasmaRifle);
};
+*/
+void() W_PlasmaRifleFire =
+{
+ if (self.wload > self.ammo_cells)
+ self.wload = self.ammo_cells;
+ self.wfiretime = time;
+ self.currentammo = self.ammo_cells = self.ammo_cells - self.wload;
+ self.wburst = self.wburst - self.wload;
+ FirePlasma(self, shotorg, shotdir, self.wload * 30 * damagescale, 45, '0 0 0', "PLASMARIFLE", Obituary_PlasmaRifle);
+};
+
.float idealzoom;
void() w_plasmarifledrop1;
@@ -39,17 +51,48 @@
if (self.button3)
self.idealzoom = 0.2;
- if (self.button0)
+ /*
+ if (time > self.attack_finished)
{
- // FIXME: need a high power fire sound (and a new low power one)
- if (self.button3 && self.ammo_cells >= 5)
- W_GenericSlowFireCode("plasma/plasma.wav", 2, W_PlasmaRifleFire5);
+ if (self.button0)
+ {
+ if (self.ammo_cells >= 1)
+ if (self.wburst < 5)
+ {
+ if (self.wburst < 1)
+ {
+ self.wburst = 1;
+ // FIXME: need a prep sound
+ sound(self, CHAN_WEAPON, "plasma/plasexpl.wav", 1, ATTN_NORM);
+ }
+ self.wburst = self.wburst + frametime * 4;
+ if (self.wburst >= 5)
+ {
+ self.wburst = 5;
+ // FIXME: need a full charge reached sound
+ sound(self, CHAN_WEAPON, "plasma/plasexpl.wav", 1, ATTN_NORM);
+ }
+ }
+ }
else
- W_GenericSlowFireCode("plasma/plasma.wav", 0.7, W_PlasmaRifleFire1);
+ {
+ // discharge sound
+ if (self.ammo_cells >= 1)
+ if (self.wburst)
+ {
+ // FIXME: need a high power fire sound (and a new low power one)
+ if (self.wburst >= 5)
+ W_GenericSlowFireCode("plasma/plasma.wav", 2, W_PlasmaRifleFire5);
+ else
+ W_GenericSlowFireCode("plasma/plasma.wav", 0.7, W_PlasmaRifleFire1);
+ }
+ self.wburst = 0;
+ if (!self.button3)
+ if (widle(w_plasmarifledrop1))
+ return;
+ }
}
- else if (!self.button3)
- if (widle(w_plasmarifledrop1))
- return;
+ */
/*
if (time > self.attack_finished)
@@ -97,6 +140,28 @@
}
*/
+ if (time >= self.attack_finished)
+ {
+ if (self.button0 && self.wburst > 0 && self.ammo_cells > 0)
+ {
+ // fire higher powered shots if zoomed
+ // (but they use ammo faster, so the burst runs out sooner)
+ self.wload = 1;
+ if (self.idealzoom < 1)
+ self.wload = 3;
+ if (self.wload > self.wburst)
+ self.wload = self.wburst;
+ W_GenericSlowFireCode("plasma/plasma.wav", 0.05, W_PlasmaRifleFire);
+ }
+ else if (self.wburst <= 0 && self.ammo_cells > 0)
+ {
+ self.wburst = 9;
+ self.attack_finished = time + 0.4;
+ }
+ else if (widle(w_plasmarifledrop1))
+ return;
+ }
+
if (self.wfiretime)
{
self.weaponframe = floor((time - self.wfiretime) * 10 + 1);
@@ -123,7 +188,7 @@
float(float request) setweapon8 = {return weapongeneric(IT_WEAPON8, self.ammo_cells >= 1, request, w_plasmariflesetup, w_plasmarifle, w_plasmarifleraise1, w_directaim, w_plasmariflerating, "PlasmaRifle");};
void() w_plasmarifleraise1 = {wraise(8, w_plasmarifleraise2, 0.1);};
-void() w_plasmarifleraise2 = {wraise(7, w_plasmarifle, 0.1);};
+void() w_plasmarifleraise2 = {self.wburst = 9;wraise(7, w_plasmarifle, 0.1);};
void() w_plasmarifledrop1 = {wdrop(7, w_plasmarifledrop2, 0.1);};
void() w_plasmarifledrop2 = {wdropped(8, 0.1);};
Index: dpmod/qc/w_shotgun.qc
diff -u dpmod/qc/w_shotgun.qc:1.3 dpmod/qc/w_shotgun.qc:1.4
--- dpmod/qc/w_shotgun.qc:1.3 Fri Nov 15 07:59:54 2002
+++ dpmod/qc/w_shotgun.qc Thu Feb 13 21:47:16 2003
@@ -12,15 +12,22 @@
Obituary_Fallback(targ, attacker, dmsg, dtype);
};
+float SHOTGUNBUCKSHOT = 75;
+float SHOTGUNEXPLOSIVESLUG = 120;
+
+.float shotgunmode;
void() W_SingleShotgunFireCode =
{
self.wfiretime = time;
self.currentammo = self.ammo_shells = self.ammo_shells - 1;
w_muzzleflash(shotorg, 2);
- bullet_type = 1;
- FireBullets(5, 5 * damagescale, 5 * damagescale, shotdir * 6000, 0.05, "SHOTGUN", DT_SHOTGUN, Obituary_Shotgun);
- bullet_type = 0;
- FireBullets(10, 5 * damagescale, 5 * damagescale, shotdir * 6000, 0.05, "SHOTGUN", DT_SHOTGUN, Obituary_Shotgun);
+ if (self.shotgunmode)
+ FireBullets(self, self, 1, 1, SHOTGUNEXPLOSIVESLUG * 0.2 * damagescale, SHOTGUNEXPLOSIVESLUG * 0.2 * damagescale, SHOTGUNEXPLOSIVESLUG * 0.8 * damagescale, 80, shotdir * 5000, 0, "SHOTGUNEXPLOSIVESLUG", DT_SHOTGUN, Obituary_Shotgun);
+ else
+ {
+ FireBullets(self, self, 1, 5, SHOTGUNBUCKSHOT * 0.1 * damagescale, SHOTGUNBUCKSHOT * 0.1 * damagescale, 0, 0, shotdir * 6000, 0.05, "SHOTGUN", DT_SHOTGUN, Obituary_Shotgun);
+ FireBullets(self, self, 0, 5, SHOTGUNBUCKSHOT * 0.1 * damagescale, SHOTGUNBUCKSHOT * 0.1 * damagescale, 0, 0, shotdir * 6000, 0.05, "SHOTGUN", DT_SHOTGUN, Obituary_Shotgun);
+ }
self.wload = -1;
};
@@ -33,6 +40,18 @@
local vector v;
if (widle(w_shotgundrop1))
return;
+
+ if (self.button5)
+ if (time > self.attack_finished)
+ {
+ self.shotgunmode = !self.shotgunmode;
+ sound(self, CHAN_AUTO, "weapons/bsgload.wav", 1, ATTN_STATIC);
+ self.attack_finished = time + 1;
+ if (self.shotgunmode)
+ sprint(self, "Ammo: Explosive slugs\n");
+ else
+ sprint(self, "Ammo: Buckshot\n");
+ }
if (self.wload > self.ammo_shells)
self.wload = self.ammo_shells;
Index: dpmod/qc/w_supernailgun.qc
diff -u dpmod/qc/w_supernailgun.qc:1.3 dpmod/qc/w_supernailgun.qc:1.4
--- dpmod/qc/w_supernailgun.qc:1.3 Fri Nov 15 07:59:54 2002
+++ dpmod/qc/w_supernailgun.qc Thu Feb 13 21:47:16 2003
@@ -24,9 +24,8 @@
v = shotorg;
shotorg = shotorg + v_up * 2;
w_muzzleflash(shotorg, 1);
- //ejectcasing(shotorg, shotdir, v_right * 200 + v_up * 50, 50, 0);
- bullet_type = 4;
- FireBullets(1, 15 * damagescale, 15 * damagescale, shotdir * 7000, 0.05, "SUPERNAILGUN", DT_NAIL, Obituary_SuperNailgun);
+ ejectcasing(shotorg, shotdir, v_right * 200 + v_up * 50, 50, 2);
+ FireBullets(self, self, 4, 1, 15 * damagescale, 15 * damagescale, 0, 0, shotdir * 7000, 0.05, "SUPERNAILGUN", DT_NAIL, Obituary_SuperNailgun);
shotorg = v;
if (self.ammo_nails < 1) {stopfiring = TRUE;return;}
More information about the twilight-commits
mailing list