Module dpmod: Change committed
havoc at icculus.org
havoc at icculus.org
Tue Nov 18 13:12:53 EST 2003
Commiter : havoc
CVSROOT : /cvs/cvsroot/twilight
Module : dpmod
Commit time: 2003-11-18 18:12:53 UTC
Log message:
remove the old obsolete weapon files
Removed files:
qc/w_common.qc qc/w_dbshotgun.qc qc/w_fake1.qc qc/w_fake10.qc
qc/w_frame.qc qc/w_grenade.qc qc/w_info.qc qc/w_lightning.qc
qc/w_nailgun.qc qc/w_oldplasmarifle.qc qc/w_pistol.qc
qc/w_plasmarifle.qc qc/w_plasmawave.qc qc/w_rocket.qc
qc/w_shotgun.qc qc/w_supernailgun.qc
------=MIME.15c139fe746f3623dce889e1962fee8b
Content-Type: text/plain; name="dpmod.20031118.181253.havoc.diff"
Content-Disposition: attachment; filename="dpmod.20031118.181253.havoc.diff"
Content-Transfer-Encoding: 8bit
Index: dpmod/qc/w_common.qc
diff -u dpmod/qc/w_common.qc:1.5 dpmod/qc/w_common.qc:removed
--- dpmod/qc/w_common.qc:1.5 Mon Nov 17 22:32:47 2003
+++ dpmod/qc/w_common.qc Tue Nov 18 13:12:53 2003
@@ -1,356 +0,0 @@
-
-.float wload;
-.float wloadtime;
-
-void() grapple_precache;
-void() common_precache =
-{
- precache_model("progs/muzzleflash.spr32");
- grapple_precache();
-};
-
-void(vector muzzleorg, float kickback) w_muzzleflash =
-{
- local float image;
- image = floor(random() * 9.7);
- if (kickback >= 3)
- effect(muzzleorg, "progs/muzzleflash.spr32", image + 10, 1, 20);
- else
- effect(muzzleorg, "progs/muzzleflash.spr32", image, 1, 30);
- //te_smallflash(muzzleorg);
- self.effects = self.effects | EF_MUZZLEFLASH;
- //if (self.flags & FL_CLIENT)
- // stuffcmd(self, "bf\n");
- self.punchangle = (randomvec() + '-1 0 0') * kickback;
- self.punchangle_z = 0; // don't want roll
-};
-
-/*
-vector(vector srcvec, vector dstvec) w_axeaim =
-{
- if (vlen(dstvec - srcvec) > 80)
- return '0 0 0';
- traceline(srcvec, dstvec, FALSE, self);
- if (trace_fraction < 1 && trace_ent != self.enemy)
- return '0 0 0';
- return dstvec - srcvec;
-};
-*/
-
-vector(vector srcvec, vector dstvec, vector dstvel, float shotspeed) w_directaim =
-{
- dstvec = dstvec + dstvel * (vlen(dstvec - srcvec) / shotspeed);
- traceline(srcvec, dstvec, FALSE, self);
- if (trace_fraction < 1 && trace_ent != self.enemy)
- return '0 0 0';
- return dstvec - srcvec;
-};
-
-vector(vector srcvec, vector dstvec, vector dstvel, float shotspeed) w_rocketaim =
-{
- dstvec = dstvec + dstvel * (vlen(dstvec - srcvec) / shotspeed);
- if (vlen(dstvec - srcvec) < 150)
- return '0 0 0';
- traceline(srcvec, dstvec, FALSE, self);
- if (trace_fraction < 1 && trace_ent != self.enemy)
- return '0 0 0';
- return dstvec - srcvec;
-};
-
-vector(vector srcvec, vector dstvec, vector dstvel, float shotspeed) w_grenadeaim =
-{
- local vector v;
- dstvec = dstvec + dstvel * (vlen(dstvec - srcvec) / shotspeed);
- if (vlen(dstvec - srcvec) < 150)
- return '0 0 0';
- traceline(srcvec, dstvec, FALSE, self);
- if (trace_fraction < 1 && trace_ent != self.enemy)
- return '0 0 0';
- if (!findtrajectorywithleading(srcvec, '0 0 0', '0 0 0', self.enemy, 600, 5, 0, self))
- return '0 0 0';
- return findtrajectory_velocity;
-};
-
-float(entity e) w_shouldattack =
-{
- if (!e.takedamage)
- return FALSE;
- if (e.deadflag)
- return FALSE;
- if (e.classname == "player")
- if (coop)
- return FALSE;
- if (e.team == self.team)
- if (self.team != 0)
- if (teamplay != 0)
- return FALSE;
- if (e == self)
- return FALSE;
- return TRUE;
-};
-
-.float painintensity;
-.entity aimtarg;
-.float aimlatency;
-.vector aimtargorigin;
-.vector aimtargvelocity;
-.float mousesticktime;
-float(vector v, float maxfiredeviation) w_aimdir =
-{
- local float dist;
- local vector desiredang, diffang;
- // get the desired angles to aim at
- desiredang = vectoangles(v);
- desiredang_z = self.v_angle_z;
-
- // pain throws off aim
- if (self.painintensity)
- {
- // shake from pain
- desiredang = desiredang + randomvec() * self.painintensity * 0.2;
- }
-
- // calculate turn angles
- diffang = desiredang - self.v_angle;
- while (diffang_y < -180)
- diffang_y = diffang_y + 360;
- while (diffang_y > 180)
- diffang_y = diffang_y - 360;
-
- // jitter tracking
- dist = vlen(diffang);
- diffang = randomvec() * (dist * 0.15 * (3.5 - skill));
-
- // simulate slight 'stickyness' of mouse on small moves
- if (vlen(diffang) < 0.1)
- {
- if (time < self.mousesticktime)
- return vlen(diffang) < maxfiredeviation;
- else if (random() < 0.5)
- {
- self.mousesticktime = time + 0.2;
- return vlen(diffang) < maxfiredeviation;
- }
- }
-
- // turn
- self.v_angle = self.v_angle + diffang * (5 * frametime);
-
- // calculate turn angles again
- diffang = desiredang - self.v_angle;
- while (diffang_y < -180)
- diffang_y = diffang_y + 360;
- while (diffang_y > 180)
- diffang_y = diffang_y - 360;
-
- // decide whether to fire this time
- return vlen(diffang) < maxfiredeviation;
-};
-
-vector(vector targorigin, vector targvelocity, float shotspeed, float shotdelay) w_shotlead =
-{
- return targorigin + targvelocity * (shotdelay + vlen(targorigin - shotorg) / shotspeed);
-};
-
-float(float shotspeed, float maxshottime) w_directattackaim =
-{
- local vector v;
- v = w_shotlead(self.aimtargorigin, self.aimtargvelocity, shotspeed, self.aimlatency);
- if (vlen(v - shotorg) < maxshottime * shotspeed)
- return FALSE;
- traceline(shotorg, v, FALSE, self);
- if (trace_fraction == 1)
- return w_aimdir(v - shotorg, 0.1);
- if (w_shouldattack(trace_ent))
- return w_aimdir(v - shotorg, 0.1);
- return FALSE;
-};
-
-float(float shotspeed, float maxshottime) w_grenadeattackaim =
-{
- if (!findtrajectorywithleading(shotorg, '0 0 0', '0 0 0', self.aimtarg, shotspeed, maxshottime, 0, self))
- return FALSE;
- return w_aimdir(findtrajectory_velocity, 0.1);
-};
-
-void() W_Hostile =
-{
- // wake up monsters
- self.show_hostile = time + 1;
- weaponwakeup(self.origin, self);
- fightdone = time + 1; // delay stuff until fighting is over
- SuperDamageSound();
-};
-
-.float firing;
-.float oldfiring;
-float(float nextshotdelay) W_ShotsToFire =
-{
- local float shotcount;
-
- self.firing = TRUE;
-
- // check if still busy with the previous shot
- if (time < self.attack_finished)
- return 0;
-
- // if not firing yet, set base time to avoid double shots
- if (!self.oldfiring)
- self.attack_finished = time;
-
- shotcount = 0;
- while (time >= self.attack_finished)
- {
- self.attack_finished = self.attack_finished + nextshotdelay;
- shotcount = shotcount + 1;
- }
- return shotcount;
-};
-
-float(float haveammo) W_CheckNoAmmo =
-{
- if (haveammo)
- return TRUE;
- self.switchweapon = W_BestWeapon(TRUE);
- return FALSE;
-};
-
-.float wstate;
-vector weaponaimdir;
-vector weaponaimtarget;
-
-float(string wname, float hasammo, float request, void() setupfunc, void() activefunc, void() raisefunc, string name, float minrange, float preferredrange, float baserating, void() precachefunc) weapongeneric =
-{
- if (request == WR_PRECACHE)
- {
- precachefunc();
- return TRUE;
- }
- if (request == WR_SETUP)
- {
- setupfunc();
- return TRUE;
- }
- if (request == WR_SELECTABLE)
- {
- if (!Inventory_Quantity(self, wname))
- return FALSE;
- return hasammo;
- }
- if (request == WR_SWITCH)
- {
- if (Inventory_Quantity(self, wname))
- if (hasammo)
- {
- self.switchweapon = WeaponToNumber(wname);
- return TRUE;
- }
- return FALSE;
- }
- if (request == WR_RAISE)
- {
- self.activeweapon = self.switchweapon;
- self.weaponframecode = raisefunc;
- self.wburst = 0;
- self.wload = 0;
- raisefunc();
- return TRUE;
- }
- if (request == WR_INSTANT)
- {
- self.activeweapon = self.switchweapon;
- self.weaponframecode = activefunc;
- raisefunc(); // sometimes needed to initialize some variables (whether a shotgun is loaded, etc)
- activefunc();
- return TRUE;
- }
- if (request == WR_NAME)
- {
- weaponstring = name;
- return TRUE;
- }
- if (request == WR_WEAPONRATING)
- return genericweaponrating(minrange, preferredrange, baserating);
- bprint("weapongeneric: invalid request number: ");
- bprintfloat(request);
- bprint("\n");
- return FALSE;
-};
-
-void(string wname, float ammotype, float ammo, float vwep, string m) wset =
-{
- self.activeweapon = WeaponToNumber(wname);
- self.items = (self.items - (self.items & (IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS))) | ammotype;
- self.currentammo = ammo;
- self.visibleweapon = vwep;
- self.weaponmodel = m;
-};
-
-.void() wnextframefunc;
-.float wnextframetime, wanimframe;
-
-void() w_switchcode = {setweapon(self.switchweapon, WR_RAISE);};
-
-void() w_animcode =
-{
- self.attack_finished = time; // avoid double shot if holding fire while switching weapons
- self.weaponframe = self.wanimframe;
- if (self.wstate == WS_RAISE)
- if (self.activeweapon != self.switchweapon)
- {
- w_switchcode();
- return;
- }
- if (time >= self.wnextframetime)
- {
- self.weaponframecode = self.wnextframefunc;
- self.weaponframecode();
- }
-};
-
-void(float f, void() framefunc, float t) wraise =
-{
- self.attack_finished = time; // avoid double shot if holding fire while switching weapons
- if (self.activeweapon != self.switchweapon)
- {
- w_switchcode();
- return;
- }
- self.wstate = WS_RAISE;
- self.weaponframe = self.wanimframe = f;
- self.wnextframefunc = framefunc;
- self.wnextframetime = time + t;
- self.weaponframecode = w_animcode;
-};
-
-void(float f, void() framefunc, float t) wdrop =
-{
- self.attack_finished = time; // avoid double shot if holding fire while switching weapons
- self.wstate = WS_DROP;
- self.weaponframe = self.wanimframe = f;
- self.wnextframefunc = framefunc;
- self.wnextframetime = time + t;
- self.weaponframecode = w_animcode;
-};
-
-void(float f, float t) wdropped = {wdrop(f, w_switchcode, t);};
-
-float(void() dropfunc) widle =
-{
- self.wstate = WS_ACTIVE;
- if (self.switchweapon == self.activeweapon)
- if (!setweapon(self.activeweapon, WR_SELECTABLE))
- self.switchweapon = W_BestWeapon(TRUE);
- if (!setweapon(self.switchweapon, WR_SELECTABLE))
- self.switchweapon = self.activeweapon;
- if (self.switchweapon != self.activeweapon)
- if (self.wstate == WS_ACTIVE)
- if (time > self.attack_finished)
- {
- self.wstate = WS_DROP;
- self.weaponframecode = dropfunc;
- dropfunc();
- return TRUE;
- }
- return FALSE;
-};
Index: dpmod/qc/w_dbshotgun.qc
diff -u dpmod/qc/w_dbshotgun.qc:1.15 dpmod/qc/w_dbshotgun.qc:removed
--- dpmod/qc/w_dbshotgun.qc:1.15 Mon Nov 17 22:32:47 2003
+++ dpmod/qc/w_dbshotgun.qc Tue Nov 18 13:12:53 2003
@@ -1,208 +0,0 @@
-
-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 = "";
- }
- else
- Obituary_Fallback(targ, attacker, dmsg, dtype);
-};
-
-void(entity targ, entity attacker, string dmsg, float dtype) Obituary_DBShotgunDouble =
-{
- if (dtype == DTYPE_PLAYER)
- {
- deathstring1 = targ.netname;
- deathstring2 = " took both barrels from ";
- deathstring3 = attacker.netname;
- deathstring4 = "";
- }
- else
- Obituary_Fallback(targ, attacker, dmsg, dtype);
-};
-
-float DBSHOTGUN = 50;
-
-.float shotgunshells;
-
-/*
-void(void(entity t, entity a, string m, float dtyp) obitfunc, float spreadboost) W_DBShotgunFireShell =
-{
- local vector v;
-
- v = shotorg;
- if (!(self.shotgunshells & 1))
- {
- self.shotgunshells = self.shotgunshells + 1;
- shotorg = shotorg - v_right;
- }
- else if (!(self.shotgunshells & 2))
- {
- self.shotgunshells = self.shotgunshells + 2;
- shotorg = shotorg + v_right;
- }
- self.wload = self.wload - 1;
- Inventory_AdjustQuantity(self, "shells", -1);
- self.wfiretime = time;
- w_muzzleflash(v, 4);
- FireBullets(self, self, 1, 5, DBSHOTGUN * 0.1, DBSHOTGUN * 0.1, 0, 0, shotdir * 6000, spreadboost + 0.03, "SHOTGUN", DT_SHOTGUN, obitfunc);
- FireBullets(self, self, 0, 5, DBSHOTGUN * 0.1, DBSHOTGUN * 0.1, 0, 0, shotdir * 6000, spreadboost + 0.03, "SHOTGUN", DT_SHOTGUN, obitfunc);
- shotorg = v;
-};
-
-void() W_DBShotgunSingleFireCode =
-{
- W_DBShotgunFireShell(Obituary_DBShotgunSingle, 0, FALSE);
-};
-
-void() W_DBShotgunDoubleFireCode =
-{
- while (self.wload > 0)
- W_DBShotgunFireShell(Obituary_DBShotgunDouble, 0, FALSE);
-};
-*/
-
-void(void(entity t, entity a, string m, float dtyp) obitfunc, float spreadboost) W_DBShotgunGatlingFireShell =
-{
- local vector v;
-
- v = shotorg;
- if (self.wload)
- {
- self.wload = 0;
- self.shotgunshells = self.shotgunshells + 1;
- shotorg = shotorg - v_right;
- }
- else
- {
- self.wload = 1;
- self.shotgunshells = self.shotgunshells + 2;
- shotorg = shotorg + v_right;
- }
- Inventory_AdjustQuantity(self, "shells", -1);
- self.wfiretime = time;
- w_muzzleflash(v, 2);
- FireBullets(self, self, 1, 5, DBSHOTGUN * 0.1, DBSHOTGUN * 0.1, 0, 0, shotdir * 6000, spreadboost + 0.03, "SHOTGUN", DT_SHOTGUN, obitfunc);
- FireBullets(self, self, 0, 5, DBSHOTGUN * 0.1, DBSHOTGUN * 0.1, 0, 0, shotdir * 6000, spreadboost + 0.03, "SHOTGUN", DT_SHOTGUN, obitfunc);
- shotorg = v;
-};
-
-void() W_DBShotgunGatlingFireCode =
-{
- W_Hostile();
- sound(self, CHAN_WEAPON, "weapons/shotgn2.wav", 1, ATTN_NORM);
- W_DBShotgunGatlingFireShell(Obituary_DBShotgunSingle, 0);
-};
-
-
-void() w_dbshotgundrop1;
-void() w_dbshotgundrop2;
-void() w_dbshotgunraise1;
-void() w_dbshotgunraise2;
-void() w_dbshotgun =
-{
- //local float swapmode, otherammo;
- local vector v, ang;
-
- if (widle(w_dbshotgundrop1))
- return;
-
- if (self.aimtarg) // bot target
- self.button0 = w_directattackaim(6000, 1);
-
- if (time > self.attack_finished)
- {
- if (self.shotgunshells)
- {
- sound(self, CHAN_AUTO, "weapons/bsgload.wav", 1, ATTN_STATIC);
- v = shotorg + v_forward * -8;
- ang = self.v_angle;ang_x = 0 - ang_x;
- if (self.shotgunshells & 1) ejectcasing (v + v_right * 1, '0 0 0', 30, ang, '0 0 0', 150, 1);
- if (self.shotgunshells & 2) ejectcasing (v + v_right * -1, '0 0 0', 30, ang, '0 0 0', 150, 1);
- self.shotgunshells = 0;
- }
- if (self.button0)
- if (Inventory_Quantity(self, "shells") > 0)
- if (W_ShotsToFire(0.2))
- W_DBShotgunGatlingFireCode();
- }
-
- /*
- if (self.wload > 0)
- {
- if (self.button0)
- W_GenericSlowFireCode("weapons/shotgn2.wav", 0.2, W_DBShotgunSingleFireCode);
- }
- else
- {
- if (time > self.attack_finished)
- {
- if (self.shotgunshells)
- {
- self.attack_finished = time + 0.4;
- sound(self, CHAN_AUTO, "weapons/bsgload.wav", 1, ATTN_STATIC);
- v = shotorg + v_forward * -8;
- ang = self.v_angle;ang_x = 0 - ang_x;
- if (self.shotgunshells & 1) ejectcasing (v + v_right * 1, '0 0 0', 30, ang, '0 0 0', 150, 1);
- if (self.shotgunshells & 2) ejectcasing (v + v_right * -1, '0 0 0', 30, ang, '0 0 0', 150, 1);
- self.shotgunshells = 0;
- }
- else
- {
- if (Inventory_Quantity(self, "shells") >= 1)
- {
- self.wload = min(Inventory_Quantity(self, "shells"), 2);
- self.attack_finished = time + 0.2;
- sound(self, CHAN_AUTO, "weapons/bsgload.wav", 1, ATTN_STATIC);
- }
- }
- }
- }
- */
-
- if (self.wfiretime)
- {
- self.weaponframe = floor((time - self.wfiretime) * 10 + 1);
- if (self.weaponframe >= 8)
- self.weaponframe = self.wfiretime = 0;
- }
- else
- self.weaponframe = 0;
-
- if (self.weaponframe < 7)
- havoc_shotanimupdate(self.weaponframe);
- else // super shotgun has one more recoil frame than the player model
- havoc_shotanimupdate(0);
-};
-
-void() w_dbshotgunprecache =
-{
- precache_model("progs/v_dpshot2.mdl");
- precache_sound("weapons/shotgn2.wav");
- precache_sound("weapons/bsgnoammo.wav");
- precache_sound("weapons/bsgload.wav");
-};
-
-/*
-vector(vector srcvec, vector dstvec, vector dstvel) w_dbshotgunaim =
-{
- dstvec = dstvec + dstvel * (vlen(dstvec - srcvec) / shotspeed);
- traceline(srcvec, dstvec, FALSE, self);
- if (trace_fraction < 1 && trace_ent != self.enemy)
- return '0 0 0';
- return dstvec - srcvec;
-};
-*/
-
-void() w_dbshotgunsetup = {wset("supershotgun", IT_SHELLS, Inventory_Quantity(self, "shells"), VWEP_SUPER_SHOTGUN, "progs/v_dpshot2.mdl");};
-float(float request) setupweapon_supershotgun = {return weapongeneric("supershotgun", Inventory_Quantity(self, "shells") >= 1, request, w_dbshotgunsetup, w_dbshotgun, w_dbshotgunraise1, "Double Barrel Shotgun", 0, 250, 175, w_dbshotgunprecache);};
-
-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);};
-void() w_dbshotgundrop2 = {wdropped(9, 0.1);};
Index: dpmod/qc/w_fake1.qc
diff -u dpmod/qc/w_fake1.qc:1.1 dpmod/qc/w_fake1.qc:removed
--- dpmod/qc/w_fake1.qc:1.1 Thu Feb 13 21:47:16 2003
+++ dpmod/qc/w_fake1.qc Tue Nov 18 13:12:53 2003
@@ -1,4 +0,0 @@
-void() weapon1_precache =
-{
-};
-float(float request) setweapon1 = {return FALSE;};
Index: dpmod/qc/w_fake10.qc
diff -u dpmod/qc/w_fake10.qc:1.1.1.1 dpmod/qc/w_fake10.qc:removed
--- dpmod/qc/w_fake10.qc:1.1.1.1 Thu Sep 19 15:07:24 2002
+++ dpmod/qc/w_fake10.qc Tue Nov 18 13:12:53 2003
@@ -1,4 +0,0 @@
-void() weapon10_precache =
-{
-};
-float(float request) setweapon10 = {return FALSE;};
Index: dpmod/qc/w_frame.qc
diff -u dpmod/qc/w_frame.qc:1.8 dpmod/qc/w_frame.qc:removed
--- dpmod/qc/w_frame.qc:1.8 Mon Nov 17 22:32:47 2003
+++ dpmod/qc/w_frame.qc Tue Nov 18 13:12:53 2003
@@ -1,152 +0,0 @@
-
-.float character_nextsave;
-.float character_loaded;
-
-.float seenhelp;
-.float idealzoom;
-
-/*
-============
-W_WeaponFrame
-
-Called every frame so impulse events can be handled as well as possible
-============
-*/
-.float notfiringcountdown;
-void() w_frame_grapple;
-void() W_WeaponFrame =
-{
- local vector v;
- local float f;
- local string s;
- //local vector v, realvangle;
-
- updateammodisplay(self);
-
- if (time > self.seenhelp)
- {
- if (self.seenhelp == 0)
- self.seenhelp = time + 5;
- else
- {
- self.seenhelp = time + 9999999;
- if (self.flags & FL_CLIENT)
- {
- // 12345678901234567890123456789012345678
- sprint(self, "Lord Havoc's Dark Places\n");
- sprint(self, "be sure to type dphelp in console for very useful information\n");
- sprint(self, "http://icculus.org/twilight/darkplaces\n");
- }
- }
- }
- /*
- if (time > self.character_nextsave)
- {
- self.character_nextsave = time + 15;
- if (self.character_loaded)
- Character_Save();
- else
- Character_Load();
- }
- */
-
- if (!self.solid) // observer
- return;
-
- if (self.deadflag >= DEAD_DYING) // dead
- return;
-
- if (nofire)
- self.button0 = self.button3 = self.button4 = self.button5 = self.button6 = self.button7 = self.button8 = 0;
-
- /*
- realvangle = self.v_angle;
- makevectors (self.v_angle);
- traceline(self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * 65536, FALSE, self);
- shotorg = self.origin + self.view_ofs + v_right * 6 - v_up * 6 + v_forward * 15;
- //shotorg = self.origin + '0 0 16' + v_forward * 15;
- shotdir = normalize(trace_endpos - shotorg);
- self.v_angle = vectoangles(shotdir);
- self.v_angle_z = realvangle_z;
- self.v_angle_x = 0 - self.v_angle_x;
- */
- makevectors(self.v_angle + self.punchangle);
- shotorg = self.origin + self.view_ofs + v_right * 6 - v_up * 6 + v_forward * 15;
- shotdir = v_forward;
-
- /*
- // DP_QC_TRACE_MOVETYPE_HITMODEL test code
- traceline(shotorg, shotorg + shotdir * 1000, MOVE_NORMAL, self);
- if (trace_fraction < 1)
- if (trace_ent.solid == SOLID_SLIDEBOX)
- {
- sprint(self, "aiming at slidebox entity ");
- s = etos(trace_ent);
- sprint(self, s);
- sprint(self, " box");
- traceline(shotorg, shotorg + shotdir * 1000, MOVE_HITMODEL, self);
- if (trace_fraction < 1)
- if (trace_ent.solid == SOLID_SLIDEBOX)
- sprint(self, " model");
- sprint(self, \n");
- }
- */
-
- self.idealzoom = 1;
- if (self.button4)
- self.idealzoom = 0.2;
-
- if (self.viewzoom == 0)
- self.viewzoom = 1;
-
- w_frame_grapple();
-
- // weapon animation, firing, etc
- setweapon(self.activeweapon, WR_SETUP);
- self.oldfiring = self.firing;
- self.firing = FALSE;
- self.weaponframecode();
- setweapon(self.activeweapon, WR_SETUP);
-
- if (self.viewzoom != self.idealzoom)
- {
- if (self.viewzoom > self.idealzoom)
- {
- self.viewzoom = self.viewzoom - frametime * 10;
- if (self.viewzoom < self.idealzoom)
- self.viewzoom = self.idealzoom;
- }
- else if (self.viewzoom < self.idealzoom)
- {
- self.viewzoom = self.viewzoom + frametime * 10;
- if (self.viewzoom > self.idealzoom)
- self.viewzoom = self.idealzoom;
- }
- }
-
- //self.v_angle = realvangle;
-
- if (cvar("temp1") & 4096)
- if (self.flags & FL_CLIENT)
- {
- v = self.velocity;
- v_z = 0;
- sprint(self, "vel ");
- s = ftos(self.velocity_x);
- sprint(self, s);
- sprint(self, " ");
- s = ftos(self.velocity_y);
- sprint(self, s);
- sprint(self, " speed ");
- f = vlen(v);
- s = ftos(f);
- sprint(self, s);
- sprint(self, " (");
- f = f * 100 / cvar("sv_maxspeed");
- f = floor(f);
- s = ftos(f);
- sprint(self, s);
- sprint(self, "%)\n");
- }
-};
-
Index: dpmod/qc/w_grenade.qc
diff -u dpmod/qc/w_grenade.qc:1.13 dpmod/qc/w_grenade.qc:removed
--- dpmod/qc/w_grenade.qc:1.13 Mon Nov 17 22:32:47 2003
+++ dpmod/qc/w_grenade.qc Tue Nov 18 13:12:53 2003
@@ -1,276 +0,0 @@
-
-void(entity targ, entity attacker, string dmsg, float dtype) Obituary_Grenade =
-{
- if (dtype == DTYPE_PLAYER && dmsg == "GRENADE")
- {
- deathstring1 = targ.netname;
- deathstring3 = attacker.netname;
- if (targ.bodyhealth < 1) // gib
- {
- deathstring2 = " ate one of ";
- deathstring4 = "'s pineapples";
- }
- else
- {
- deathstring2 = " was blown away by ";
- deathstring4 = "'s grenade";
- }
- }
- else if (dtype == DTYPE_SUICIDE && dmsg == "GRENADE")
- {
- deathstring1 = targ.netname;
- if (targ.bodyhealth < 1) // gib
- deathstring2 = " ate a pineapple";
- else
- deathstring2 = " held onto the grenade";
- }
- else if (dtype == DTYPE_PLAYER && dmsg == "STICKYGRENADE")
- {
- deathstring1 = targ.netname;
- deathstring3 = attacker.netname;
- if (targ.bodyhealth < 1) // gib
- {
- deathstring2 = " was torn asunder by ";
- deathstring4 = "'s mine";
- }
- else
- {
- deathstring2 = " was a victim of ";
- deathstring4 = "'s mine";
- }
- }
- else if (dtype == DTYPE_SUICIDE && dmsg == "STICKYGRENADE")
- {
- deathstring1 = targ.netname;
- deathstring2 = " pressed the button";
- }
- else
- Obituary_Fallback(targ, attacker, dmsg, dtype);
-};
-
-//.float grenademode;
-
-void() W_GrenadeFireImpact =
-{
- W_Hostile();
- sound(self, CHAN_WEAPON, "weapons/grenade.wav", 1, ATTN_NORM);
- self.wfiretime = time;
- Inventory_AdjustQuantity(self, "rockets", -1);
- w_muzzleflash(shotorg, 5);
- //LaunchGrenade(shotorg, shotdir * 1000 + v_up * 200 + self.velocity, self, 150, 200, GRENADE_IMPACT | GRENADE_IMMUNETODAMAGE, 25, "GRENADE", Obituary_Grenade);
- LaunchGrenade(shotorg, shotdir * 1000 + v_up * 200, self, 150, 120, GRENADE_IMPACT | GRENADE_IMMUNETODAMAGE, 25, "GRENADE", Obituary_Grenade);
-};
-
-/*
-void() W_GrenadeFirePipebomb =
-{
- W_Hostile();
- sound(self, CHAN_WEAPON, "weapons/grenade.wav", 1, ATTN_NORM);
- self.wfiretime = time;
- Inventory_AdjustQuantity(self, "rockets", -1);
- w_muzzleflash(shotorg, 5);
- LaunchGrenade(shotorg, shotdir * 1000 + v_up * 200, self, 150, 120, GRENADE_DETONATABLE | GRENADE_DETONATEONCREATURE, 60, "PIPEBOMB", Obituary_Grenade);
-};
-*/
-
-/*
-void() W_GrenadeFireProximity =
-{
- self.wfiretime = time;
- Inventory_AdjustQuantity(self, "rockets", -1);
- w_muzzleflash(shotorg, 3);
- LaunchGrenade(shotorg, shotdir * 1000 + v_up * 200, self, 100, 150, GRENADE_PROXIMITY, 5, "GRENADE", Obituary_Grenade);
-};
-*/
-
-/*
-void() W_GrenadeFireSticky =
-{
- self.wfiretime = time;
- Inventory_AdjustQuantity(self, "rockets", -1);
- w_muzzleflash(shotorg, 3);
- LaunchMine(shotorg, shotdir * 1000 + v_up * 200, self, 120, 120, 50, 20, MINE_DETONATABLE, 60, "STICKYGRENADE", Obituary_Grenade);
-};
-*/
-
-//.float activemines;
-//.float oldbutton3;
-void() w_grenadedrop1;
-void() w_grenadedrop2;
-void() w_grenaderaise1;
-void() w_grenaderaise2;
-void() w_grenade =
-{
- local float c;
- if (widle(w_grenadedrop1))
- return;
-
- if (self.aimtarg) // bot target
- self.button0 = w_grenadeattackaim(1000, 2);
-
- if (time > self.detonatetimeout)
- if (time > self.attack_finished)
- {
- if (self.button0)
- {
- //if (self.activemines < 20)
- //{
- if (Inventory_Quantity(self, "rockets") >= 1)
- {
- if (W_ShotsToFire(0.6))
- W_GrenadeFireImpact();
- //W_GrenadeFirePipebomb();
- }
- else
- self.switchweapon = W_BestWeapon(TRUE);
- /*
- }
- else
- {
- self.attack_finished = time + 0.3;
- sprint(self, "only 20 remote explosives allowed, you must detonate some before placing more\n");
- }
- */
- }
- /*
- if (self.button3)
- if (self.activemines > 0)
- {
- self.attack_finished = time + 0.3;
- sound(self, CHAN_WEAPON, "weapons/bomb/trigger.wav", 1, ATTN_STATIC);
- self.detonatetimeout = time + 0.1;
- }
- */
- }
-
- /*
- if (time > self.attack_finished)
- {
- if (self.button3)
- {
- if (self.activemines < 20)
- {
- if (Inventory_Quantity(self, "rockets") >= 1)
- W_GenericSlowFireCode("weapons/grenade.wav", 0.6, W_GrenadeFirePipebomb);
- }
- else
- {
- if (time > self.attack_finished)
- {
- self.attack_finished = time + 0.5;
- sprint(self, "only 20 remote explosives allowed, you must detonate some before placing more\n");
- }
- }
- }
- else if (self.button0)
- {
- if (self.activemines > 0)
- {
- self.attack_finished = time + 0.2;
- sound(self, CHAN_WEAPON, "weapons/bomb/trigger.wav", 1, ATTN_STATIC);
- self.detonatetimeout = time + 0.1;
- }
- else if (Inventory_Quantity(self, "rockets") >= 1)
- W_GenericSlowFireCode("weapons/grenade.wav", 0.6, W_GrenadeFireImpact);
- else
- self.switchweapon = W_BestWeapon(TRUE);
- }
- }
- */
-
- /*
- if (time > self.attack_finished)
- {
- if ((self.button3 && !self.oldbutton3) || (self.activemines < 1 && self.grenademode == 2))
- {
- self.attack_finished = time + 0.2;
- if (self.activemines >= 1)
- {
- sound(self, CHAN_WEAPON, "weapons/bomb/trigger.wav", 1, ATTN_STATIC);
- self.detonatetimeout = time + 0.1;
- }
- else
- {
- sound(self, CHAN_WEAPON, "weapons/bsgload.wav", 1, ATTN_STATIC);
- self.grenademode = self.grenademode + 1;
- if (self.grenademode >= 2)
- self.grenademode = 0;
- if (self.grenademode == 0)
- sprint(self, "mode: impact grenades\n");
- else if (self.grenademode == 1)
- sprint(self, "mode: pipebombs\n");
- }
- }
- else if (self.button0)
- {
- if (Inventory_Quantity(self, "rockets") >= 1)
- {
- if (self.grenademode == 0)
- W_GenericSlowFireCode("weapons/grenade.wav", 0.6, W_GrenadeFireImpact);
- else if (self.grenademode == 1)
- {
- if (self.activemines < 20)
- W_GenericSlowFireCode("weapons/grenade.wav", 0.6, W_GrenadeFirePipebomb);
- else
- {
- if (time > self.attack_finished)
- {
- self.attack_finished = time + 0.5;
- sprint(self, "only 20 remote explosives allowed, you must detonate some before placing more\n");
- }
- }
- }
- }
- else
- self.switchweapon = W_BestWeapon(TRUE);
- }
- }
- self.oldbutton3 = self.button3;
- */
- /*
- if (self.button0)
- {
- if (Inventory_Quantity(self, "rockets") >= 1)
- W_GenericSlowFireCode("weapons/grenade.wav", 0.5, W_GrenadeFireImpact);
- }
- else if (self.button3)
- {
- if (Inventory_Quantity(self, "rockets") >= 1)
- W_GenericSlowFireCode("weapons/grenade.wav", 0.8, W_GrenadeFireProximity);
- }
- */
-
- if (self.wfiretime)
- {
- self.weaponframe = (time - self.wfiretime) * 10 + 1;
- if (self.weaponframe >= 7)
- {
- self.weaponframe = 0;
- self.wfiretime = 0;
- }
- }
- else
- self.weaponframe = 0;
- havoc_rockanimupdate(self.weaponframe);
-};
-
-void() w_grenadeprecache =
-{
- precache_model("progs/v_dprock.mdl");
- precache_model("progs/grenade.mdl");
- precache_model("progs/s_explod.spr");
- precache_sound("weapons/grenade.wav");
- precache_sound("weapons/bomb/fire.wav");
- precache_sound("weapons/bomb/trigger.wav");
- precache_sound("weapons/bounce.wav");
-};
-
-void() w_grenadesetup = {wset("grenadelauncher", IT_ROCKETS, Inventory_Quantity(self, "rockets"), VWEP_GRENADE_LAUNCHER, "progs/v_dprock.mdl");};
-float(float request) setupweapon_grenadelauncher = {return weapongeneric("grenadelauncher", Inventory_Quantity(self, "rockets") >= 1/* || self.activemines > 0*/, request, w_grenadesetup, w_grenade, w_grenaderaise1, "Grenade Launcher", 200, 500, 300, w_grenadeprecache);};
-
-void() w_grenaderaise1 = {wraise(8, w_grenaderaise2, 0.1);};
-void() w_grenaderaise2 = {wraise(7, w_grenade, 0.1);};
-
-void() w_grenadedrop1 = {wdrop(7, w_grenadedrop2, 0.1);};
-void() w_grenadedrop2 = {wdropped(8, 0.1);};
-
Index: dpmod/qc/w_info.qc
diff -u dpmod/qc/w_info.qc:1.6 dpmod/qc/w_info.qc:removed
--- dpmod/qc/w_info.qc:1.6 Mon Nov 17 22:32:47 2003
+++ dpmod/qc/w_info.qc Tue Nov 18 13:12:53 2003
@@ -1,218 +0,0 @@
-
-// called by worldspawn
-void() W_Precache =
-{
- explosionfx_precache();
- fire_precache();
- lightning_precache();
- common_precache();
-
- //precache_model ("progs/lsight.mdl");
-};
-
-float(string wname, float request) setweapon =
-{
- local string s;
- local entity it;
- if (self.health < 1)
- return FALSE;
- it = Inventory_ItemByName(self, wname);
- if (it == world || it.count == 0 || !it.it_setupweapon)
- return FALSE;
- return it.it_setupweapon(request);
-};
-
-string(float dangerous) W_BestWeapon =
-{
- local string wname;
- wname = "thunderbolt";if(setweapon(wname, WR_SELECTABLE)) return wname;
- wname = "plasmarifle";if(setweapon(wname, WR_SELECTABLE)) return wname;
- if (dangerous)
- {
- wname = "rocketlauncher";if(setweapon(wname, WR_SELECTABLE)) return wname;
- wname = "grenadelauncher";if(setweapon(wname, WR_SELECTABLE)) return wname;
- }
- wname = "supernailgun";if(setweapon(wname, WR_SELECTABLE)) return wname;
- wname = "supershotgun";if(setweapon(wname, WR_SELECTABLE)) return wname;
- wname = "nailgun";if(setweapon(wname, WR_SELECTABLE)) return wname;
- wname = "shotgun";if(setweapon(wname, WR_SELECTABLE)) return wname;
- wname = "pistol";if(setweapon(wname, WR_SELECTABLE)) return wname;
- return "";
-};
-
-string(entity targ) W_BestWeaponForTarget =
-{
- local float bestrating, rating, bit;
- local string s, best;
- best = "";
- bestrating = 0;
- weaponrange = vlen(targ.origin - self.origin);
- bit = 1;
- s = NumberToWeapon(bit);
- while(s != "")
- {
- rating = setweapon(s, WR_WEAPONRATING);
- if (rating > bestrating)
- {
- best = s;
- bestrating = rating;
- }
- bit = bit + bit;
- s = NumberToWeapon(bit);
- }
- return best;
-};
-
-float(float minrange, float preferredrange, float baserating) genericweaponrating =
-{
- if (weaponrange < minrange)
- return 0;
- if (weaponrange <= preferredrange)
- return baserating;
- return baserating * preferredrange * preferredrange / (weaponrange * weaponrange);
-};
-
-/*
-============
-W_ChangeWeapon
-
-============
-*/
-void() W_ChangeWeapon =
-{
- local float n, bit;
- local string s;
- if (self.health < 1)
- return;
- if (self.impulse >= 200)
- self.impulse = self.impulse - 200;
- n = 1;
- bit = 1;
- while (n < self.impulse)
- {
- n = n + 1;
- bit = bit * 2;
- }
- s = NumberToWeapon(bit);
- if (s != "")
- setweapon(s, WR_SWITCH);
- self.impulse = 0;
-};
-
-/*
-============
-CheatCommand
-============
-*/
-void() CheatCommand =
-{
- local float bit;
- local string s;
- if (deathmatch) // || coop)
- return;
- if (self.health < 1)
- return;
-
- Inventory_SetQuantity(self, "shells", AMMOMAX_SHELLS);
- Inventory_SetQuantity(self, "nails", AMMOMAX_NAILS);
- Inventory_SetQuantity(self, "rockets", AMMOMAX_ROCKETS);
- Inventory_SetQuantity(self, "cells", AMMOMAX_SHELLS);
- /*
- self.items = self.items
- | IT_WEAPON1
- | IT_WEAPON2
- | IT_WEAPON3
- | IT_WEAPON4
- | IT_WEAPON5
- | IT_WEAPON6
- | IT_WEAPON7
- | IT_WEAPON8
- | IT_WEAPON9
- | IT_WEAPON10
- // | IT_KEY1 | IT_KEY2
- ;
- */
- bit = 1;
- s = NumberToWeapon(bit);
- while (s != "")
- {
- Inventory_SetQuantity(self, s, 9999);
- bit = bit * 2;
- s = NumberToWeapon(bit);
- }
-
- self.impulse = 0;
-};
-
-/*
-============
-CycleWeaponCommand
-
-Go to the next weapon with ammo
-============
-*/
-void() CycleWeaponCommand =
-{
- local float looped, w;
- local string s;
- if (self.health < 1)
- return;
- looped = FALSE;
- w = WeaponToNumber(self.switchweapon);
- while(1)
- {
- w = w * 2;
- s = NumberToWeapon(w);
- if (s == "")
- {
- if (looped)
- return;
- looped = TRUE;
- w = 1;
- s = NumberToWeapon(w);
- }
- if (setweapon(s, WR_SELECTABLE))
- {
- self.switchweapon = s;
- return;
- }
- }
-};
-
-/*
-============
-CycleWeaponReverseCommand
-
-Go to the prev weapon with ammo
-============
-*/
-void() CycleWeaponReverseCommand =
-{
- local float looped, w;
- local string s;
- if (self.health < 1)
- return;
- looped = FALSE;
- w = WeaponToNumber(self.switchweapon);
- while(1)
- {
- w = w * 0.5;
- s = NumberToWeapon(w);
- if (s == "")
- {
- if (looped)
- return;
- looped = TRUE;
- w = 1;
- while (NumberToWeapon(w) != "")
- w = w * 2;
- w = w * 0.5;
- s = NumberToWeapon(w);
- }
- if (setweapon(s, WR_SELECTABLE))
- {
- self.switchweapon = s;
- return;
- }
- }
-};
Index: dpmod/qc/w_lightning.qc
diff -u dpmod/qc/w_lightning.qc:1.6 dpmod/qc/w_lightning.qc:removed
--- dpmod/qc/w_lightning.qc:1.6 Mon Nov 17 22:32:47 2003
+++ dpmod/qc/w_lightning.qc Tue Nov 18 13:12:53 2003
@@ -1,197 +0,0 @@
-
-void(entity targ, entity attacker, string dmsg, float dtype) Obituary_Lightning =
-{
- if (dtype == DTYPE_PLAYER)
- {
- deathstring1 = targ.netname;
- deathstring2 = " was sizzled by ";
- deathstring3 = attacker.netname;
- deathstring4 = "";
- }
- else
- Obituary_Fallback(targ, attacker, dmsg, dtype);
-};
-
-void(entity targ, entity attacker, string dmsg, float dtype) Obituary_LightningExplode =
-{
- if (dtype == DTYPE_PLAYER)
- {
- deathstring1 = targ.netname;
- deathstring2 = " was destroyed by ";
- deathstring3 = attacker.netname;
- deathstring4 = "'s lightning gun explosion";
- }
- else if (dtype == DTYPE_SUICIDE)
- {
- deathstring1 = targ.netname;
- deathstring2 = " blow dries his hair in the water";
- deathstring3 = "";
- deathstring4 = "";
- }
- else
- Obituary_Fallback(targ, attacker, dmsg, dtype);
-};
-
-void(entity targ, entity attacker, string dmsg, float dtype) Obituary_LightningSuperBeam =
-{
- if (dtype == DTYPE_PLAYER)
- {
- deathstring1 = targ.netname;
- deathstring2 = " was shocked by ";
- deathstring3 = attacker.netname;
- deathstring4 = "'s super lightning";
- }
- else if (dtype == DTYPE_SUICIDE)
- {
- deathstring1 = targ.netname;
- deathstring2 = " forgot to run from the super lightning";
- deathstring3 = "";
- deathstring4 = "";
- }
- else
- Obituary_Fallback(targ, attacker, dmsg, dtype);
-};
-
-void(entity targ, entity attacker, string dmsg, float dtype) Obituary_LightningSuperBeamDirectHit =
-{
- if (dtype == DTYPE_PLAYER)
- {
- deathstring1 = targ.netname;
- deathstring2 = " was incinerated by ";
- deathstring3 = attacker.netname;
- deathstring4 = "'s super lightning";
- }
- else
- Obituary_Fallback(targ, attacker, dmsg, dtype);
-};
-
-.entity lightningchain;
-.float lightningsolidbackup;
-.vector lightninghitpoint;
-vector(entity inflictor, entity attacker, vector start, vector end, float hdamage, float bdamage, string dmsg, float dtype, void(entity targ2, entity attacker2, string dmsg2, float dtype2) obitfunc) W_BeamDamage =
-{
- local entity lightningchainhead, e;
- local float c;
- local vector force;
- force = (normalize(end - start) + '0 0 0.25') * 2 * bdamage;
-
- // find entities in the beam
- c = 0;
- lightningchainhead = world;
- // need to change self to SOLID_BBOX to do weapon traces (able to hit a corpse)
- self.lightningsolidbackup = self.solid;
- self.solid = SOLID_BBOX;
- while (c < 10)
- {
- c = c + 1;
- traceline(start, end, FALSE, self);
- if (trace_fraction == 1)
- break;
- if (trace_ent.solid == SOLID_BSP)
- break;
- // make entity non-solid so the beam can continue
- trace_ent.lightningsolidbackup = trace_ent.solid;
- trace_ent.solid = SOLID_NOT;
- trace_ent.lightninghitpoint = trace_endpos;
- // add entity to chain
- trace_ent.lightningchain = lightningchainhead;
- lightningchainhead = trace_ent;
- }
- // restore their .solid
- self.solid = self.lightningsolidbackup;
- e = lightningchainhead;
- while (e != world)
- {
- e.solid = e.lightningsolidbackup;
- e = e.lightningchain;
- }
- end = trace_endpos;
-
- // now damage them
- e = lightningchainhead;
- while (e != world)
- {
- T_Damage(e, inflictor, attacker, hdamage, bdamage, dmsg, dtype, trace_endpos, force, obitfunc);
- e = e.lightningchain;
- }
- return end;
-};
-
-void(float cells) W_LightningFireCode =
-{
- if (cells > Inventory_Quantity(self, "cells"))
- cells = Inventory_Quantity(self, "cells");
- self.wfiretime = time;
- Inventory_AdjustQuantity(self, "cells", 0 - cells);
- self.wframe = self.wframe + 1;
- if (self.wframe >= 3)
- self.wframe = 1;
- W_BeamDamage(self, self, shotorg, shotorg + shotdir * 100000, cells * 30, cells * 15, "LIGHTNING", DT_LIGHTNING, Obituary_Lightning);
-
- traceline(shotorg, shotorg + shotdir * 100000, TRUE, self);
- te_lightning2(self, shotorg, trace_endpos);
-};
-
-void() w_lightningdrop1;
-void() w_lightningdrop2;
-void() w_lightningraise1;
-void() w_lightningraise2;
-.float oldbutton0;
-void() w_lightning =
-{
- if (widle(w_lightningdrop1))
- return;
-
- if (self.aimtarg) // bot target
- self.button0 = w_directattackaim(6000, 0.1);
-
- if (self.button0)
- {
- if (Inventory_Quantity(self, "cells") > 0)
- {
- if (!self.oldbutton0)
- sound(self, CHAN_AUTO, "weapons/lstart.wav", 1, ATTN_NORM);
- if (time >= self.wfiretime + 0.1)
- {
- self.wfiretime = time;
- W_Hostile();
- sound(self, CHAN_WEAPON, "weapons/lhit.wav", 1, ATTN_NORM);
- }
- self.wload = W_ShotsToFire(1/20);
- if (self.wload > 0)
- W_LightningFireCode(self.wload / 2);
- }
- }
- /*
- else if (self.button3)
- {
- //if (self.button3)
- //if (Inventory_Quantity(self, "rockets") >= 1)
- // W_GenericSlowFireCode("weapons/grenade.wav", 0.5, W_SuperNailgunMineFireCode);
- }
- */
- self.oldbutton0 = self.button0;
-
- if ((time - self.wfiretime) < 0.15)
- self.weaponframe = self.wframe;
- else
- self.weaponframe = 0;
-
- havoc_lightanimupdate(self.weaponframe);
-};
-
-void() w_lightningprecache =
-{
- precache_model("progs/v_dplight.mdl");
- precache_sound("weapons/lhit.wav");
- precache_sound("weapons/lstart.wav");
-};
-
-void() w_lightningraise1 = {wraise(6, w_lightningraise2, 0.1);};
-void() w_lightningraise2 = {wraise( 5, w_lightning, 0.1);};
-
-void() w_lightningdrop1 = {wdrop( 5, w_lightningdrop2, 0.1);};
-void() w_lightningdrop2 = {wdropped(6, 0.1);};
-
-void() w_lightningsetup = {wset("thunderbolt", IT_CELLS, Inventory_Quantity(self, "cells"), VWEP_LIGHTNING, "progs/v_dplight.mdl");};
-float(float request) setupweapon_thunderbolt = {return weapongeneric("thunderbolt", Inventory_Quantity(self, "cells") >= 1, request, w_lightningsetup, w_lightning, w_lightningraise1, "Thunderbolt", 0, 1000, 300, w_lightningprecache);};
Index: dpmod/qc/w_nailgun.qc
diff -u dpmod/qc/w_nailgun.qc:1.12 dpmod/qc/w_nailgun.qc:removed
--- dpmod/qc/w_nailgun.qc:1.12 Mon Nov 17 22:32:47 2003
+++ dpmod/qc/w_nailgun.qc Tue Nov 18 13:12:53 2003
@@ -1,157 +0,0 @@
-
-void(entity targ, entity attacker, string dmsg, float dtype) Obituary_Nailgun =
-{
- if (dtype == DTYPE_PLAYER)
- {
- deathstring1 = targ.netname;
- deathstring2 = "'s coffin was nailed by ";
- deathstring3 = attacker.netname;
- deathstring4 = "";
- }
- else
- Obituary_Fallback(targ, attacker, dmsg, dtype);
-};
-
-void(float shots) W_NailgunFireCode =
-{
- local vector v, casingdir, ang;
- W_Hostile();
- sound(self, CHAN_WEAPON, "weapons/rocket1i.wav", 1, ATTN_NORM);
- while (shots > 0 && Inventory_Quantity(self, "nails") >= 1)
- {
- shots = shots - 1;
- self.wfiretime = time;
- Inventory_AdjustQuantity(self, "nails", -1);
- self.wframe = self.wframe + 1;
- if (self.wframe >= 9)
- self.wframe = 1;
- self.wfiretime = time;
- self.punchangle_x = -2;
-
- v = shotorg;
- ang = self.v_angle;ang_x = 0 - ang_x;
- if (self.wframe & 1)
- {
- shotorg = shotorg + v_right * 2;
- ejectcasing(shotorg, v_right * 200 + v_up * 50, 50, ang, '0 250 0', 100, 0);
- }
- else
- {
- shotorg = shotorg - v_right * 2;
- ejectcasing(shotorg, v_right * -200 + v_up * 50, 50, ang, '0 -250 0', 100, 0);
- }
-
- w_muzzleflash(shotorg, 1);
- FireBullets(self, self, 4, 1, 15, 15, 0, 0, shotdir * 15000, 0.025, "NAILGUN", DT_NAIL, Obituary_Nailgun);
- shotorg = v;
- }
-};
-
-void(entity targ, entity attacker, string dmsg, float dtype) Obituary_NailgunMine =
-{
- if (dtype == DTYPE_PLAYER)
- {
- deathstring1 = targ.netname;
- deathstring3 = attacker.netname;
- if (targ.bodyhealth < 1) // gib
- {
- deathstring2 = " was shredded by ";
- deathstring4 = "'s porcupine";
- }
- else
- {
- deathstring2 = " was torn up by ";
- deathstring4 = "'s porcupine";
- }
- }
- else if (dtype == DTYPE_SUICIDE)
- {
- deathstring1 = targ.netname;
- if (targ.bodyhealth < 1) // gib
- deathstring2 = " was shredded by his own porcupine";
- else
- deathstring2 = " was torn up by his own porcupine";
- }
- else
- Obituary_Fallback(targ, attacker, dmsg, dtype);
-};
-
-void() W_NailgunGrenadeFireCode =
-{
- W_Hostile();
- sound(self, CHAN_WEAPON, "weapons/grenade.wav", 1, ATTN_NORM);
- self.wfiretime = time;
- Inventory_AdjustQuantity(self, "rockets", -1);
- w_muzzleflash(shotorg, 1);
- //LaunchGrenade(shotorg, shotdir * 1000 + v_up * 200, self, 80, 300, GRENADE_IMPACT, 2.5, "NAILGUNGRENADE", Obituary_NailgunGrenade);
- LaunchMine(shotorg, shotdir * 1000 + v_up * 200, self, 200, 70, 20, 10, MINE_LASERTRIP, 60, "LASERTRIPMINE", Obituary_NailgunMine);
-};
-
-void() w_nailgundrop1;
-void() w_nailgundrop2;
-void() w_nailgunraise1;
-void() w_nailgunraise2;
-void() w_nailgun =
-{
- if (widle(w_nailgundrop1))
- return;
-
- if (self.aimtarg) // bot target
- {
- if (time > self.altfirechecktimeout)
- {
- self.altfirechecktimeout = time + 0.1 + random() * 0.2;
- if (time > self.altfiretimeout)
- if (vlen(self.aimtarg.origin - self.origin) < 600)
- if (random() < 0.2)
- self.altfiretimeout = time + 0.5 + random() * 0.5;
- }
- if (Inventory_Quantity(self, "rockets") && time < self.altfiretimeout)
- self.button3 = w_grenadeattackaim(1000, 1);
- else
- self.button0 = w_directattackaim(12000, 2);
- }
-
- if (self.button0)
- {
- if (Inventory_Quantity(self, "nails") >= 1)
- {
- self.wload = W_ShotsToFire(0.1);
- if (self.wload)
- W_NailgunFireCode(self.wload);
- }
- }
- else
- {
- if (self.button3)
- if (Inventory_Quantity(self, "rockets") >= 1)
- if (W_ShotsToFire(0.8))
- W_NailgunGrenadeFireCode();
- }
-
- if ((time - self.wfiretime) < 0.15)
- self.weaponframe = self.wframe;
- else
- self.weaponframe = 0;
-
- havoc_nailanimupdate(self.weaponframe);
-};
-
-void() w_nailgunprecache =
-{
- precache_model("progs/v_dpnail.mdl");
- precache_model("progs/s_spike.mdl");
- precache_model("progs/s_explod.spr");
- precache_sound("weapons/rocket1i.wav");
- precache_sound("weapons/spike2.wav");
-};
-
-void() w_nailgunraise1 = {wraise(10, w_nailgunraise2, 0.1);};
-void() w_nailgunraise2 = {wraise( 9, w_nailgun, 0.1);};
-
-void() w_nailgundrop1 = {wdrop( 9, w_nailgundrop2, 0.1);};
-void() w_nailgundrop2 = {wdropped(10, 0.1);};
-
-void() w_nailgunsetup = {wset("nailgun", IT_NAILS, Inventory_Quantity(self, "nails"), VWEP_NAILGUN, "progs/v_dpnail.mdl");};
-float(float request) setupweapon_nailgun = {return weapongeneric("nailgun", Inventory_Quantity(self, "nails") >= 1 || Inventory_Quantity(self, "rockets") >= 1, request, w_nailgunsetup, w_nailgun, w_nailgunraise1, "Nailgun", 0, 1200, 150, w_nailgunprecache);};
-
Index: dpmod/qc/w_oldplasmarifle.qc
diff -u dpmod/qc/w_oldplasmarifle.qc:1.4 dpmod/qc/w_oldplasmarifle.qc:removed
--- dpmod/qc/w_oldplasmarifle.qc:1.4 Wed Jul 16 08:16:45 2003
+++ dpmod/qc/w_oldplasmarifle.qc Tue Nov 18 13:12:53 2003
@@ -1,107 +0,0 @@
-
-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;
- Inventory_AdjustQuantity(self, "cells", -1);
- self.wfiretime = time;
- dir = shotdir + randomvec() * 0.03;
- w_muzzleflash(shotorg, 1);
- //FireBullets(self, self, shotorg, 4, 1, 30, 30, dir * 10000, 0, "PLASMARIFLE", DT_NAIL, Obituary_PlasmaRifle);
- FirePlasma(self, shotorg, dir, 30, 45, '0 0 0', "PLASMARIFLE", Obituary_PlasmaRifle);
-};
-
-void() W_PlasmaRifleFireHighPower =
-{
- Inventory_AdjustQuantity(self, "cells", 0 - 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, 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 > Inventory_Quantity(self, "cells"))
- self.wload = Inventory_Quantity(self, "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 = Inventory_Quantity(self, "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, Inventory_Quantity(self, "cells"), VWEP_SHOTGUN, "progs/v_dpshot.mdl");};
-float(float request) setweapon8 = {return weapongeneric(IT_WEAPON8, Inventory_Quantity(self, "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.11 dpmod/qc/w_pistol.qc:removed
--- dpmod/qc/w_pistol.qc:1.11 Mon Nov 17 22:32:47 2003
+++ dpmod/qc/w_pistol.qc Tue Nov 18 13:12:53 2003
@@ -1,68 +0,0 @@
-
-void(entity targ, entity attacker, string dmsg, float dtype) Obituary_Pistol =
-{
- if (dtype == DTYPE_PLAYER)
- {
- deathstring1 = targ.netname;
- deathstring2 = " was gunned down by ";
- deathstring3 = attacker.netname;
- deathstring4 = "";
- }
- else
- Obituary_Fallback(targ, attacker, dmsg, dtype);
-};
-
-void() W_PistolFireCode =
-{
- local vector ang;
- W_Hostile();
- sound(self, CHAN_WEAPON, "weapons/rocket1i.wav", 1, ATTN_NORM);
- self.wfiretime = time;
- w_muzzleflash(shotorg, 1);
- ang = self.v_angle;ang_x = 0 - ang_x;
- ejectcasing(shotorg, v_right * 150 + v_up * 50, 50, ang, '0 250 0', 100, 0);
- FireBullets(self, self, 4, 1, 35, 35, 0, 0, shotdir * 12000, 0, "PISTOL", DT_NAIL, Obituary_Pistol);
-};
-
-void() w_pistoldrop1;
-void() w_pistoldrop2;
-void() w_pistolraise1;
-void() w_pistolraise2;
-void() w_pistol =
-{
- if (widle(w_pistoldrop1))
- return;
-
- if (self.aimtarg) // bot target
- self.button0 = w_directattackaim(12000, 2);
-
- if (self.button0)
- if (W_ShotsToFire(0.4))
- W_PistolFireCode();
-
- 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() w_pistolprecache =
-{
- precache_model("progs/v_dpshot.mdl");
- precache_sound("weapons/rocket1i.wav");
-};
-
-void() w_pistolsetup = {wset("pistol", 0, 0, VWEP_SHOTGUN, "progs/v_dpshot.mdl");};
-float(float request) setupweapon_pistol = {return weapongeneric("pistol", TRUE, request, w_pistolsetup, w_pistol, w_pistolraise1, "Pistol", 0, 99999, 75, w_pistolprecache);};
-
-void() w_pistolraise1 = {wraise(8, w_pistolraise2, 0.1);};
-void() w_pistolraise2 = {wraise(7, w_pistol, 0.1);};
-
-void() w_pistoldrop1 = {wdrop(7, w_pistoldrop2, 0.1);};
-void() w_pistoldrop2 = {wdropped(8, 0.1);};
Index: dpmod/qc/w_plasmarifle.qc
diff -u dpmod/qc/w_plasmarifle.qc:1.14 dpmod/qc/w_plasmarifle.qc:removed
--- dpmod/qc/w_plasmarifle.qc:1.14 Mon Nov 17 22:32:47 2003
+++ dpmod/qc/w_plasmarifle.qc Tue Nov 18 13:12:53 2003
@@ -1,178 +0,0 @@
-
-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";
- if (targ.bodyhealth < 1)
- deathstring2 = " was splattered by ";
- }
- else if (dtype == DTYPE_SUICIDE)
- {
- deathstring1 = targ.netname;
- deathstring2 = " became crispy";
- deathstring3 = "";
- deathstring4 = "";
- }
- else
- Obituary_Fallback(targ, attacker, dmsg, dtype);
-};
-
-.float plasmabarrel;
-void(float shots, float cellspershot, float damagepercell, float r) W_PlasmaRifleFire =
-{
- local vector v;
- local float cells;
- W_Hostile();
- sound(self, CHAN_WEAPON, "plasma/plasma.wav", 1, ATTN_NORM);
- while (shots > 0)
- {
- shots = shots - 1;
- cells = cellspershot;
- if (cells > Inventory_Quantity(self, "cells"))
- cells = Inventory_Quantity(self, "cells");
- if (cells <= 0)
- return;
- Inventory_AdjustQuantity(self, "cells", 0 - cells);
- self.wfiretime = time;
- if (self.plasmabarrel == 0)
- {
- self.plasmabarrel = 1;
- v = v_up * 2;
- }
- else if (self.plasmabarrel == 1)
- {
- self.plasmabarrel = 2;
- v = v_right * 1.4 + v_up * -1.4;
- }
- else
- {
- self.plasmabarrel = 0;
- v = v_right * -1.4 + v_up * -1.4;
- }
- FirePlasma(self, shotorg + v, (shotdir + v * 0.005) * 25000, damagepercell * cells, r, "PLASMARIFLE", Obituary_PlasmaRifle);
- }
-};
-
-.float woverload;
-/*
-void() W_PlasmaRifleFireOverload2 =
-{
- local float d, r;
- local vector v;
- W_Hostile();
- sound(self, CHAN_WEAPON, "plasma/plasma.wav", 1, ATTN_NORM);
- self.wfiretime = time;
- d = self.woverload * 20;
- r = 120;
- v = v_up * 2 ;FirePlasma(self, shotorg + v, (shotdir + v * 0.005) * 10000, d, r, "PLASMARIFLE", Obituary_PlasmaRifle);
- v = v_right * 1.414 + v_up * -1.414;FirePlasma(self, shotorg + v, (shotdir + v * 0.005) * 10000, d, r, "PLASMARIFLE", Obituary_PlasmaRifle);
- v = v_right * -1.414 + v_up * -1.414;FirePlasma(self, shotorg + v, (shotdir + v * 0.005) * 10000, d, r, "PLASMARIFLE", Obituary_PlasmaRifle);
-};
-*/
-
-void() w_plasmarifledrop1;
-void() w_plasmarifledrop2;
-void() w_plasmarifleraise1;
-void() w_plasmarifleraise2;
-void() w_plasmarifle =
-{
- if (self.aimtarg) // bot target
- {
- if (time > self.altfirechecktimeout)
- {
- self.altfirechecktimeout = time + 0.1 + random() * 0.2;
- if (time > self.altfiretimeout)
- if (random() < 0.2)
- self.altfiretimeout = time + 0.5 + random() * 0.5;
- }
- if (time < self.altfiretimeout)
- self.button3 = w_directattackaim(25000, 1);
- else
- self.button0 = w_directattackaim(25000, 1);
- }
-
- /*
- // FIXME: need overload fire sound (second overload sound)
- if (self.woverload > 0)
- {
- if (W_ShotsToFire(1))
- {
- W_PlasmaRifleFire(3, self.woverload / 3, 30, 120);
- self.woverload = 0;
- }
- }
- else */if (self.button0 && Inventory_Quantity(self, "cells") > 0)
- {
- self.wload = W_ShotsToFire(0.05);
- if (self.wload > 0)
- W_PlasmaRifleFire(self.wload, 1, 30, 60);
- }
- else if (time >= self.attack_finished)
- {
- if (self.button3 && Inventory_Quantity(self, "cells") > 0 && self.woverload < 50)
- {
- // FIXME: need overload charge sound (first overload sound)
- if (!self.woverload)
- sound(self, CHAN_WEAPON, "plasma/plasexpl.wav", 1, ATTN_NORM);
- self.woverload = self.woverload + frametime * 50;
- }
- else if (self.woverload > 0)
- {
- if (W_ShotsToFire(0.5))
- {
- // FIXME: need overload fire sound (second overload sound)
- if (self.woverload > 50)
- self.woverload = 50;
- if (self.woverload > Inventory_Quantity(self, "cells"))
- self.woverload = Inventory_Quantity(self, "cells");
- if (self.woverload >= 3)
- W_PlasmaRifleFire(3, self.woverload / 3, 30, self.woverload * 20);
- self.woverload = 0;
- }
- /*
- //if (self.woverload > Inventory_Quantity(self, "cells"))
- // self.woverload = Inventory_Quantity(self, "cells");
- //Inventory_AdjustQuantity(self, "cells", 0 - self.woverload);
- self.attack_finished = time + 0.2;
- // FIXME: need overload charge sound (first overload sound)
- sound(self, CHAN_WEAPON, "plasma/plasexpl.wav", 1, ATTN_NORM);
- */
- }
- else 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() w_plasmarifleprecache =
-{
- precache_model("progs/v_dpshot.mdl");
- precache_model("progs/s_bubble.spr");
- precache_model("progs/plasmashot.spr32");
- //precache_sound("weapons/rocket1i.wav");
- precache_sound("plasma/plasma.wav");
- precache_sound("plasma/plasexpl.wav");
-};
-
-void() w_plasmariflesetup = {wset("plasmarifle", IT_CELLS, Inventory_Quantity(self, "cells"), VWEP_SHOTGUN, "progs/v_dpshot.mdl");};
-float(float request) setupweapon_plasmarifle = {return weapongeneric("plasmarifle", Inventory_Quantity(self, "cells") >= 1, request, w_plasmariflesetup, w_plasmarifle, w_plasmarifleraise1, "PlasmaRifle", 0, 1500, 200, w_plasmarifleprecache);};
-
-void() w_plasmarifleraise1 = {wraise(8, w_plasmarifleraise2, 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_plasmawave.qc
diff -u dpmod/qc/w_plasmawave.qc:1.6 dpmod/qc/w_plasmawave.qc:removed
--- dpmod/qc/w_plasmawave.qc:1.6 Mon Nov 17 22:32:47 2003
+++ dpmod/qc/w_plasmawave.qc Tue Nov 18 13:12:53 2003
@@ -1,174 +0,0 @@
-
-void(entity targ, entity attacker, string dmsg, float dtype) Obituary_PlasmaWaveShot =
-{
- if (dtype == DTYPE_PLAYER)
- {
- deathstring1 = targ.netname;
- deathstring2 = " was incinerated by ";
- deathstring3 = attacker.netname;
- deathstring4 = "'s plasma inferno";
- if (targ.bodyhealth < 1)
- deathstring2 = " was obliterated by ";
- }
- else if (dtype == DTYPE_SUICIDE)
- {
- deathstring1 = targ.netname;
- deathstring2 = " became crispy";
- deathstring3 = "";
- deathstring4 = "";
- }
- else
- Obituary_Fallback(targ, attacker, dmsg, dtype);
-};
-
-void(entity targ, entity attacker, string dmsg, float dtype) Obituary_PlasmaWaveOverload =
-{
- if (dtype == DTYPE_PLAYER)
- {
- deathstring1 = targ.netname;
- deathstring2 = " surfed ";
- deathstring3 = attacker.netname;
- deathstring4 = "'s plasma wave";
- if (targ.bodyhealth < 1)
- deathstring2 = " wiped out in ";
- }
- else if (dtype == DTYPE_SUICIDE)
- {
- deathstring1 = targ.netname;
- deathstring2 = " became crispy";
- deathstring3 = "";
- deathstring4 = "";
- }
- else
- Obituary_Fallback(targ, attacker, dmsg, dtype);
-};
-
-void() W_PlasmaWaveFireShot =
-{
- local float cells;
- W_Hostile();
- sound(self, CHAN_WEAPON, "plasma/plasma.wav", 1, ATTN_NORM);
- cells = Inventory_Quantity(self, "cells");
- if (cells > 10)
- cells = 10;
- self.wfiretime = time;
- Inventory_AdjustQuantity(self, "cells", 0 - cells);
- FirePlasmaBall(self, shotorg, shotdir * 1000, cells * 20, 120, "PLASMAWAVE", Obituary_PlasmaWaveShot);
-};
-
-void() W_PlasmaWaveFireWave =
-{
- /*
- local float cells;
- W_Hostile();
- sound(self, CHAN_WEAPON, "plasma/plasma.wav", 1, ATTN_NORM);
- cells = Inventory_Quantity(self, "cells");
- if (cells > 50)
- cells = 50;
- self.wfiretime = time;
- Inventory_AdjustQuantity(self, "cells", 0 - cells);
- FirePlasmaBall(self, shotorg, shotdir * 1000, cells * 15, 300, "PLASMAWAVE", Obituary_PlasmaWaveShot);
- */
- local float cells, shots, damage;
- local vector ang;
- W_Hostile();
- sound(self, CHAN_WEAPON, "plasma/plasma.wav", 1, ATTN_NORM);
- cells = Inventory_Quantity(self, "cells");
- if (cells > 50)
- cells = 50;
- self.wfiretime = time;
- Inventory_AdjustQuantity(self, "cells", 0 - cells);
- //cells = cells + 60;
- shots = ceil(cells / 5);
- if (shots > 12)
- shots = 12;
- damage = cells * 20 / shots;
- ang = self.v_angle - (shots * '0 3 0');
- while (shots > 0)
- {
- shots = shots - 1;
- makevectors(ang);
- FirePlasmaBall(self, shotorg, v_forward * 1000, damage, 120, "PLASMAWAVE", Obituary_PlasmaWaveOverload);
- ang = ang + '0 6 0';
- }
-};
-
-.float woverload;
-void() w_plasmawavedrop1;
-void() w_plasmawavedrop2;
-void() w_plasmawaveraise1;
-void() w_plasmawaveraise2;
-void() w_plasmawave =
-{
- if (self.aimtarg) // bot target
- {
- if (time > self.altfirechecktimeout)
- {
- self.altfirechecktimeout = time + 0.1 + random() * 0.2;
- if (time > self.altfiretimeout)
- if (random() < 0.2)
- self.altfiretimeout = time + 0.5 + random() * 0.5;
- }
- if (time < self.altfiretimeout)
- self.button3 = w_directattackaim(1000, 3);
- else
- self.button0 = w_directattackaim(1000, 3);
- }
-
- // FIXME: need overload fire sound (second overload sound)
- if (self.woverload > 0)
- {
- if (W_ShotsToFire(1))
- {
- self.woverload = 0;
- W_PlasmaWaveFireWave();
- }
- }
- else if (self.button0 && Inventory_Quantity(self, "cells") > 0)
- {
- if (W_ShotsToFire(0.5))
- W_PlasmaWaveFireShot();
- }
- else if (time >= self.attack_finished)
- {
- if (self.button3 && Inventory_Quantity(self, "cells") > 0)
- {
- self.woverload = 1;
- self.attack_finished = time + 0.5;
- // FIXME: need overload charge sound (first overload sound)
- sound(self, CHAN_WEAPON, "plasma/plasexpl.wav", 1, ATTN_NORM);
- }
- else if (widle(w_plasmawavedrop1))
- return;
- }
-
- if (self.wfiretime)
- {
- self.weaponframe = floor((time - self.wfiretime) * 10 + 1);
- if (self.weaponframe >= 3)
- self.weaponframe = self.wfiretime = 0;
- }
- else
- self.weaponframe = 0;
-
- havoc_shotanimupdate(self.weaponframe);
-};
-
-void() w_plasmawaveprecache =
-{
- precache_model("progs/v_dpshot.mdl");
- precache_model("progs/s_bubble.spr");
- precache_model("progs/plasmashot.spr32");
- precache_sound("weapons/rocket1i.wav");
- //precache_sound("plasma/plasma.wav");
- precache_sound("plasma/plasexpl.wav");
-};
-
-void() w_plasmawavesetup = {wset("plasmawave", IT_CELLS, Inventory_Quantity(self, "cells"), VWEP_LIGHTNING, "progs/v_dplight.mdl");};
-float(float request) setupweapon_plasmawave = {return weapongeneric("plasmawave", Inventory_Quantity(self, "cells") >= 1, request, w_plasmawavesetup, w_plasmawave, w_plasmawaveraise1, "Plasma Wave Cannon", 0, 1500, 200, w_plasmawaveprecache);};
-
-void() w_plasmawaveraise1 = {wraise(3, w_plasmawaveraise2, 0.1);};
-void() w_plasmawaveraise2 = {self.wburst = 4;wraise(7, w_plasmawave, 0.1);};
-
-void() w_plasmawavedrop1 = {wdrop(3, w_plasmawavedrop2, 0.1);};
-void() w_plasmawavedrop2 = {wdropped(4, 0.1);};
Index: dpmod/qc/w_rocket.qc
diff -u dpmod/qc/w_rocket.qc:1.13 dpmod/qc/w_rocket.qc:removed
--- dpmod/qc/w_rocket.qc:1.13 Mon Nov 17 22:32:47 2003
+++ dpmod/qc/w_rocket.qc Tue Nov 18 13:12:53 2003
@@ -1,192 +0,0 @@
-
-void(entity targ, entity attacker, string dmsg, float dtype) Obituary_Rocket =
-{
- local float r;
- //bprint("targ bodyhealth ");
- //bprintfloat(targ.bodyhealth);
- //bprint("\n");
- if (dtype == DTYPE_PLAYER)
- {
- deathstring1 = targ.netname;
- deathstring3 = attacker.netname;
- if (targ.bodyhealth < -200 && targ.ping >= 400 && attacker.ping < 200)
- {
- // LordHavoc: Thanks to BramBo for this suggestion
- deathstring2 = " found out online gaming with ";
- deathstring4 = " was a big mistake";
- }
- else if (targ.bodyhealth < -150)
- {
- if (random() < 0.5)
- {
- deathstring2 = " was mistified by ";
- deathstring4 = "'s rocket";
- }
- else
- {
- deathstring2 = " became one with the walls thanks to ";
- deathstring4 = "";
- }
- }
- else if (targ.bodyhealth < 1)
- {
- r = random() * 3;
- if (r < 1)
- {
- deathstring2 = " was torn asunder by ";
- deathstring4 = "";
- }
- else if (r < 2)
- {
- deathstring2 = " was gibbed by ";
- deathstring4 = "";
- }
- else
- {
- deathstring2 = " became extra chunky thanks to ";
- deathstring4 = "";
- }
- }
- else
- {
- r = random() * 4;
- if (r < 1)
- {
- deathstring2 = " was sent flying by ";
- deathstring4 = "";
- }
- else if (r < 2)
- {
- deathstring2 = " got bounced around by ";
- deathstring4 = "";
- }
- else if (r < 3)
- {
- deathstring2 = " was clobbered by ";
- deathstring4 = "";
- }
- else
- {
- deathstring2 = " was fragged by ";
- deathstring4 = "";
- }
- }
- }
- else if (dtype == DTYPE_SUICIDE)
- {
- deathstring1 = targ.netname;
- if (targ.bodyhealth < 1)
- {
- r = random() * 3;
- if (r < 1)
- deathstring2 = " became a fine red mist";
- else if (r < 2)
- deathstring2 = " tripped and fell... all over";
- else
- deathstring2 = " becomes extra chunky";
- }
- else
- deathstring2 = " blew himself up";
- }
- else
- Obituary_Fallback(targ, attacker, dmsg, dtype);
-}
-
-void() W_RocketFireSingle =
-{
- W_Hostile();
- sound(self, CHAN_WEAPON, "weapons/sgun1.wav", 1, ATTN_NORM);
- self.wfiretime = time;
- self.flags = self.flags - (self.flags & FL_ONGROUND);
- Inventory_AdjustQuantity(self, "rockets", -1);
- w_muzzleflash(shotorg, 2);
- LaunchMissile(shotorg, shotdir * 5000, self, 100, 100, "ROCKET", Obituary_Rocket);
-};
-
-void() W_RocketFireTripleSpiral =
-{
- W_Hostile();
- sound(self, CHAN_WEAPON, "weapons/sgun1.wav", 1, ATTN_NORM);
- self.wfiretime = time;
- self.flags = self.flags - (self.flags & FL_ONGROUND);
- self.velocity = self.velocity - shotdir * 450;
- Inventory_AdjustQuantity(self, "rockets", -1);
- w_muzzleflash(shotorg, 4);
- LaunchMissile(shotorg, shotdir * 3000, self, 100, 100, "ROCKET", Obituary_Rocket);
- spiralmissile_orbitentity = newmis;
- if (Inventory_Quantity(self, "rockets") < 1)
- return;
- Inventory_AdjustQuantity(self, "rockets", -1);
- w_muzzleflash(shotorg + v_right * 8, 4);
- LaunchSpiralMissile(shotorg, shotdir, self, 100, 100, "ROCKET", Obituary_Rocket, -12);
- if (Inventory_Quantity(self, "rockets") < 1)
- return;
- Inventory_AdjustQuantity(self, "rockets", -1);
- w_muzzleflash(shotorg - v_right * 8, 4);
- LaunchSpiralMissile(shotorg, shotdir, self, 100, 100, "ROCKET", Obituary_Rocket, 12);
-};
-
-void() w_rocketdrop1;
-void() w_rocketdrop2;
-void() w_rocketraise1;
-void() w_rocketraise2;
-void() w_rocket =
-{
- if (widle(w_rocketdrop1))
- return;
-
- if (self.aimtarg) // bot target
- {
- if (time > self.altfirechecktimeout)
- {
- self.altfirechecktimeout = time + 0.1 + random() * 0.2;
- if (time > self.altfiretimeout)
- if (random() < 0.2)
- self.altfiretimeout = time + 0.5 + random() * 0.5;
- }
- if (time < self.altfiretimeout)
- self.button3 = w_directattackaim(3000, 1);
- else
- self.button0 = w_directattackaim(5000, 1);
- }
-
- if (self.button3)
- {
- if (W_ShotsToFire(1.2))
- W_RocketFireTripleSpiral();
- }
- else if (self.button0)
- {
- if (W_ShotsToFire(0.6))
- W_RocketFireSingle();
- }
-
- if (self.wfiretime)
- {
- self.weaponframe = floor((time - self.wfiretime) * 10 + 1);
- if (self.weaponframe >= 7)
- {
- self.weaponframe = 0;
- self.wfiretime = 0;
- }
- }
- else
- self.weaponframe = 0;
- havoc_rockanimupdate(self.weaponframe);
-};
-
-void() w_rocketprecache =
-{
- precache_model("progs/missile.mdl");
- precache_model("progs/v_dprock2.mdl");
- precache_sound("weapons/sgun1.wav");
-};
-
-void() w_rocketsetup = {wset("rocketlauncher", IT_ROCKETS, Inventory_Quantity(self, "rockets"), VWEP_ROCKET_LAUNCHER, "progs/v_dprock2.mdl");};
-float(float request) setupweapon_rocketlauncher = {return weapongeneric("rocketlauncher", Inventory_Quantity(self, "rockets") >= 1, request, w_rocketsetup, w_rocket, w_rocketraise1, "Rocket Launcher", 200, 1000, 240, w_rocketprecache);};
-
-void() w_rocketraise1 = {wraise(8, w_rocketraise2, 0.1);};
-void() w_rocketraise2 = {self.wload = 0;wraise(7, w_rocket, 0.1);};
-
-void() w_rocketdrop1 = {wdrop(7, w_rocketdrop2, 0.1);};
-void() w_rocketdrop2 = {wdropped(8, 0.1);};
Index: dpmod/qc/w_shotgun.qc
diff -u dpmod/qc/w_shotgun.qc:1.14 dpmod/qc/w_shotgun.qc:removed
--- dpmod/qc/w_shotgun.qc:1.14 Mon Nov 17 22:32:47 2003
+++ dpmod/qc/w_shotgun.qc Tue Nov 18 13:12:53 2003
@@ -1,100 +0,0 @@
-
-void(entity targ, entity attacker, string dmsg, float dtype) Obituary_Shotgun =
-{
- if (dtype == DTYPE_PLAYER)
- {
- deathstring1 = targ.netname;
- deathstring2 = " was another victim of ";
- deathstring3 = attacker.netname;
- deathstring4 = "'s hunting season";
- }
- else
- Obituary_Fallback(targ, attacker, dmsg, dtype);
-};
-
-float SHOTGUN = 50;
-
-void() W_SingleShotgunFireCode =
-{
- W_Hostile();
- sound(self, CHAN_WEAPON, "weapons/shotgn2.wav", 1, ATTN_NORM);
- self.wfiretime = time;
- Inventory_AdjustQuantity(self, "shells", -1);
- w_muzzleflash(shotorg, 2);
- FireBullets(self, self, 1, 5, SHOTGUN * 0.1, SHOTGUN * 0.1, 0, 0, shotdir * 6000, 0.05, "SHOTGUN", DT_SHOTGUN, Obituary_Shotgun);
- FireBullets(self, self, 0, 5, SHOTGUN * 0.1, SHOTGUN * 0.1, 0, 0, shotdir * 6000, 0.05, "SHOTGUN", DT_SHOTGUN, Obituary_Shotgun);
- self.wload = -1;
-};
-
-void() w_shotgundrop1;
-void() w_shotgundrop2;
-void() w_shotgunraise1;
-void() w_shotgunraise2;
-void() w_shotgun =
-{
- local vector v, ang;
- if (widle(w_shotgundrop1))
- return;
-
- if (self.aimtarg) // bot target
- self.button0 = w_directattackaim(6000, 1);
-
- if (self.wload > Inventory_Quantity(self, "shells"))
- self.wload = Inventory_Quantity(self, "shells");
-
- if (self.button0)
- {
- if (self.wload >= 1) // is it loaded?
- if (W_ShotsToFire(0.3))
- W_SingleShotgunFireCode();
- }
-
- if (self.wload < 1 && time > self.attack_finished)
- {
- if (self.wload < 0)
- {
- self.attack_finished = time + 0.2;
- sound(self, CHAN_AUTO, "weapons/bsgload.wav", 1, ATTN_STATIC);
- v = shotorg + v_forward * -5;
- ang = self.v_angle;ang_x = 0 - ang_x;
- ejectcasing(v, v_right * 100 + v_up * 40, 30, ang, '0 250 0', 100, 1);
- self.wload = 0;
- }
- else if (Inventory_Quantity(self, "shells") >= 1)
- {
- self.wload = 1;
- self.attack_finished = time + 0.2;
- sound(self, CHAN_AUTO, "weapons/bsgload.wav", 1, ATTN_STATIC);
- }
- else if (widle(w_shotgundrop1))
- return;
- }
- else if (widle(w_shotgundrop1))
- 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() w_shotgunprecache =
-{
- precache_model("progs/v_dpshot.mdl");
- precache_sound("weapons/shotgn2.wav");
-};
-
-void() w_shotgunsetup = {wset("shotgun", IT_SHELLS, Inventory_Quantity(self, "shells"), VWEP_SHOTGUN, "progs/v_dpshot.mdl");};
-float(float request) setupweapon_shotgun = {return weapongeneric("shotgun", Inventory_Quantity(self, "shells") >= 1, request, w_shotgunsetup, w_shotgun, w_shotgunraise1, "Shotgun", 0, 2000, 128, w_shotgunprecache);};
-
-void() w_shotgunraise1 = {self.wload = 1;wraise(8, w_shotgunraise2, 0.1);};
-void() w_shotgunraise2 = {wraise(7, w_shotgun, 0.1);};
-
-void() w_shotgundrop1 = {wdrop(7, w_shotgundrop2, 0.1);};
-void() w_shotgundrop2 = {wdropped(8, 0.1);};
Index: dpmod/qc/w_supernailgun.qc
diff -u dpmod/qc/w_supernailgun.qc:1.12 dpmod/qc/w_supernailgun.qc:removed
--- dpmod/qc/w_supernailgun.qc:1.12 Mon Nov 17 22:32:47 2003
+++ dpmod/qc/w_supernailgun.qc Tue Nov 18 13:12:53 2003
@@ -1,154 +0,0 @@
-
-void(entity targ, entity attacker, string dmsg, float dtype) Obituary_SuperNailgun =
-{
- if (dtype == DTYPE_PLAYER)
- {
- deathstring1 = targ.netname;
- deathstring2 = " was shredded by ";
- deathstring3 = attacker.netname;
- deathstring4 = "";
- }
- else
- Obituary_Fallback(targ, attacker, dmsg, dtype);
-};
-
-void(float shots) W_SuperNailgunFireCode =
-{
- local vector v, ang;
- W_Hostile();
- sound(self, CHAN_WEAPON, "weapons/spike2.wav", 1, ATTN_NORM);
- v = shotorg;
- while (shots > 0 && Inventory_Quantity(self, "nails") >= 1)
- {
- shots = shots - 1;
- Inventory_AdjustQuantity(self, "nails", -1);
- self.wframe = self.wframe + 0.5; // 10fps animation
- if (self.wframe >= 9)
- self.wframe = 1;
- self.wfiretime = time;
-
- shotorg = shotorg + v_up * 2;
- w_muzzleflash(shotorg, 1);
- ang = self.v_angle;ang_x = 0 - ang_x;
- ejectcasing(shotorg, v_right * 200 + v_up * 50, 50, ang, '0 50 0', 100, 0);
- FireBullets(self, self, 4, 1, 15, 15, 0, 0, shotdir * 12000, 0.05, "SUPERNAILGUN", DT_NAIL, Obituary_SuperNailgun);
- }
- shotorg = v;
-};
-
-void(entity targ, entity attacker, string dmsg, float dtype) Obituary_ProximityMine =
-{
- if (dtype == DTYPE_PLAYER)
- {
- deathstring1 = targ.netname;
- deathstring3 = attacker.netname;
- if (targ.bodyhealth < -150) // gib
- {
- deathstring2 = " was turned into a fine red mist by ";
- deathstring4 = "'s mine";
- }
- else if (targ.bodyhealth < 1) // gib
- {
- deathstring2 = " was turned into kibble by ";
- deathstring4 = "'s mine";
- }
- else
- {
- deathstring2 = " was thrown into the afterlife by ";
- deathstring4 = "'s mine";
- }
- }
- else if (dtype == DTYPE_SUICIDE)
- {
- deathstring1 = targ.netname;
- if (targ.bodyhealth < -100) // gib
- deathstring2 = " was turned into a fine red mist by his own mine";
- else if (targ.bodyhealth < 1) // gib
- deathstring2 = " was turned into kibble by his own mine";
- else
- deathstring2 = " was thrown into the afterlife by his own mine";
- }
- else
- Obituary_Fallback(targ, attacker, dmsg, dtype);
-};
-
-void() W_SuperNailgunMineFireCode =
-{
- local float a;
- W_Hostile();
- sound(self, CHAN_WEAPON, "weapons/grenade.wav", 1, ATTN_NORM);
- self.wfiretime = time;
- a = 3;
- if (a > Inventory_Quantity(self, "rockets"))
- a = Inventory_Quantity(self, "rockets");
- Inventory_AdjustQuantity(self, "rockets", 0 - a);
- w_muzzleflash(shotorg, 3);
- LaunchMine(shotorg, shotdir * 1000 + v_up * 200, self, a * 100, a * 100 + 50, 20, 10, MINE_PROXIMITY, 60, "PROXIMITYMINE", Obituary_ProximityMine);
-};
-
-void() w_snailgundrop1;
-void() w_snailgundrop2;
-void() w_snailgunraise1;
-void() w_snailgunraise2;
-void() w_snailgun =
-{
- if (widle(w_snailgundrop1))
- return;
-
- if (self.aimtarg) // bot target
- {
- if (time > self.altfirechecktimeout)
- {
- self.altfirechecktimeout = time + 0.1 + random() * 0.2;
- if (time > self.altfiretimeout)
- if (vlen(self.aimtarg.origin - self.origin) < 600)
- if (random() < 0.2)
- self.altfiretimeout = time + 0.5 + random() * 0.5;
- }
- if (Inventory_Quantity(self, "rockets") >= 3 && time < self.altfiretimeout)
- self.button3 = w_grenadeattackaim(1000, 1);
- else
- self.button0 = w_directattackaim(12000, 1);
- }
-
- if (self.button0)
- {
- if (Inventory_Quantity(self, "nails") >= 1)
- {
- self.wload = W_ShotsToFire(0.05);
- if (self.wload > 0)
- W_SuperNailgunFireCode(self.wload);
- }
- }
- else
- {
- if (self.button3)
- if (Inventory_Quantity(self, "rockets") >= 1)
- if (W_ShotsToFire(0.5))
- W_SuperNailgunMineFireCode();
- }
-
- if ((time - self.wfiretime) < 0.15)
- self.weaponframe = self.wframe;
- else
- self.weaponframe = 0;
-
- havoc_nailanimupdate(self.weaponframe);
-};
-
-void() w_snailgunprecache =
-{
- precache_model("progs/v_dpnail2.mdl");
- precache_model("progs/s_spike.mdl");
- precache_sound("weapons/rocket1i.wav");
- precache_sound("weapons/spike2.wav");
-};
-
-void() w_snailgunraise1 = {wraise(10, w_snailgunraise2, 0.1);};
-void() w_snailgunraise2 = {wraise( 9, w_snailgun , 0.1);};
-
-void() w_snailgundrop1 = {wdrop( 9, w_snailgundrop2, 0.1);};
-void() w_snailgundrop2 = {wdropped(10, 0.1);};
-
-void() w_snailgunsetup = {wset("supernailgun", IT_NAILS, Inventory_Quantity(self, "nails"), VWEP_SUPER_NAILGUN, "progs/v_dpnail2.mdl");};
-float(float request) setupweapon_supernailgun = {return weapongeneric("supernailgun", Inventory_Quantity(self, "nails") >= 1 || Inventory_Quantity(self, "rockets") >= 1, request, w_snailgunsetup, w_snailgun, w_snailgunraise1, "Super Nailgun", 0, 1000, 300, w_snailgunprecache);};
More information about the twilight-commits
mailing list