Compare commits
No commits in common. "9edc7863118aa110e15a380f3b3f43a04fa42073" and "f1c8b09b94b4de8d6fb622a44f134ca72e45d7be" have entirely different histories.
9edc786311
...
f1c8b09b94
120
source/items.qc
120
source/items.qc
|
@ -1,32 +1,4 @@
|
|||
const string WEPNAME_AXE = "Axe";
|
||||
const string WEPNAME_SHOTGUN = "Shotgun";
|
||||
const string WEPNAME_SUPER_SHOTGUN = "Double-barrelled Shotgun";
|
||||
const string WEPNAME_NAILGUN = "Nailgun";
|
||||
const string WEPNAME_SUPER_NAILGUN = "Super Nailgun";
|
||||
const string WEPNAME_GRENADE_LAUNCHER = "Grenade Launcher";
|
||||
const string WEPNAME_ROCKET_LAUNCHER = "Rocket Launcher";
|
||||
const string WEPNAME_LIGHTNING = "Thunderbolt";
|
||||
|
||||
void() W_SetCurrentAmmo;
|
||||
|
||||
string() Key1Name = {
|
||||
switch(world.worldtype) {
|
||||
case 0: return "silver key";
|
||||
case 1: return "silver runekey";
|
||||
case 2: return "silver keycard";
|
||||
default: return string_null;
|
||||
}
|
||||
};
|
||||
|
||||
string() Key2Name = {
|
||||
switch(world.worldtype) {
|
||||
case 0: return "gold key";
|
||||
case 1: return "gold runekey";
|
||||
case 2: return "gold keycard";
|
||||
default: return string_null;
|
||||
}
|
||||
};
|
||||
|
||||
/* ALL LIGHTS SHOULD BE 0 1 0 IN COLOR ALL OTHER ITEMS SHOULD
|
||||
BE .8 .3 .4 IN COLOR */
|
||||
|
||||
|
@ -525,7 +497,7 @@ void() weapon_supershotgun = {
|
|||
precache_model("progs/g_shot.mdl");
|
||||
setmodel(self, "progs/g_shot.mdl");
|
||||
self.weapon = IT_SUPER_SHOTGUN;
|
||||
self.netname = WEPNAME_SUPER_SHOTGUN;
|
||||
self.netname = "Double-barrelled Shotgun";
|
||||
self.touch = weapon_touch;
|
||||
setsize(self, '-16 -16 0', '16 16 56');
|
||||
StartItem();
|
||||
|
@ -538,7 +510,7 @@ void() weapon_nailgun = {
|
|||
precache_model("progs/g_nail.mdl");
|
||||
setmodel(self, "progs/g_nail.mdl");
|
||||
self.weapon = IT_NAILGUN;
|
||||
self.netname = WEPNAME_NAILGUN;
|
||||
self.netname = "nailgun";
|
||||
self.touch = weapon_touch;
|
||||
setsize(self, '-16 -16 0', '16 16 56');
|
||||
StartItem();
|
||||
|
@ -551,7 +523,7 @@ void() weapon_supernailgun = {
|
|||
precache_model("progs/g_nail2.mdl");
|
||||
setmodel(self, "progs/g_nail2.mdl");
|
||||
self.weapon = IT_SUPER_NAILGUN;
|
||||
self.netname = WEPNAME_SUPER_NAILGUN;
|
||||
self.netname = "Super Nailgun";
|
||||
self.touch = weapon_touch;
|
||||
setsize(self, '-16 -16 0', '16 16 56');
|
||||
StartItem();
|
||||
|
@ -564,7 +536,7 @@ void() weapon_grenadelauncher = {
|
|||
precache_model("progs/g_rock.mdl");
|
||||
setmodel(self, "progs/g_rock.mdl");
|
||||
self.weapon = 3;
|
||||
self.netname = WEPNAME_GRENADE_LAUNCHER;
|
||||
self.netname = "Grenade Launcher";
|
||||
self.touch = weapon_touch;
|
||||
setsize(self, '-16 -16 0', '16 16 56');
|
||||
StartItem();
|
||||
|
@ -577,7 +549,7 @@ void() weapon_rocketlauncher = {
|
|||
precache_model("progs/g_rock2.mdl");
|
||||
setmodel(self, "progs/g_rock2.mdl");
|
||||
self.weapon = 3;
|
||||
self.netname = WEPNAME_ROCKET_LAUNCHER;
|
||||
self.netname = "Rocket Launcher";
|
||||
self.touch = weapon_touch;
|
||||
setsize(self, '-16 -16 0', '16 16 56');
|
||||
StartItem();
|
||||
|
@ -591,7 +563,7 @@ void() weapon_lightning = {
|
|||
precache_model("progs/g_light.mdl");
|
||||
setmodel(self, "progs/g_light.mdl");
|
||||
self.weapon = 3;
|
||||
self.netname = WEPNAME_LIGHTNING;
|
||||
self.netname = "Thunderbolt";
|
||||
self.touch = weapon_touch;
|
||||
setsize(self, '-16 -16 0', '16 16 56');
|
||||
StartItem();
|
||||
|
@ -913,20 +885,18 @@ following:
|
|||
*/
|
||||
|
||||
void() item_key1 = {
|
||||
self.netname = Key1Name();
|
||||
switch(world.worldtype) {
|
||||
case 0:
|
||||
if(world.worldtype == 0) {
|
||||
precache_model("progs/w_s_key.mdl");
|
||||
setmodel(self, "progs/w_s_key.mdl");
|
||||
break;
|
||||
case 1:
|
||||
self.netname = "silver key";
|
||||
} else if(world.worldtype == 1) {
|
||||
precache_model("progs/m_s_key.mdl");
|
||||
setmodel(self, "progs/m_s_key.mdl");
|
||||
break;
|
||||
case 2:
|
||||
self.netname = "silver runekey";
|
||||
} else if(world.worldtype == 2) {
|
||||
precache_model2("progs/b_s_key.mdl");
|
||||
setmodel(self, "progs/b_s_key.mdl");
|
||||
break;
|
||||
self.netname = "silver keycard";
|
||||
}
|
||||
key_setsounds();
|
||||
self.touch = key_touch;
|
||||
|
@ -947,20 +917,20 @@ following:
|
|||
*/
|
||||
|
||||
void() item_key2 = {
|
||||
self.netname = Key2Name();
|
||||
switch(world.worldtype) {
|
||||
case 0:
|
||||
if(world.worldtype == 0) {
|
||||
precache_model("progs/w_g_key.mdl");
|
||||
setmodel(self, "progs/w_g_key.mdl");
|
||||
break;
|
||||
case 1:
|
||||
self.netname = "gold key";
|
||||
}
|
||||
if(world.worldtype == 1) {
|
||||
precache_model("progs/m_g_key.mdl");
|
||||
setmodel(self, "progs/m_g_key.mdl");
|
||||
break;
|
||||
case 2:
|
||||
self.netname = "gold runekey";
|
||||
}
|
||||
if(world.worldtype == 2) {
|
||||
precache_model2("progs/b_g_key.mdl");
|
||||
setmodel(self, "progs/b_g_key.mdl");
|
||||
break;
|
||||
self.netname = "gold keycard";
|
||||
}
|
||||
key_setsounds();
|
||||
self.touch = key_touch;
|
||||
|
@ -1197,20 +1167,24 @@ void() BackpackTouch = {
|
|||
local entity stemp;
|
||||
local float acount;
|
||||
|
||||
if(other.classname != "player" || other.health <= 0) {
|
||||
if(other.classname != "player") {
|
||||
return;
|
||||
}
|
||||
if(other.health <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
acount = 0;
|
||||
sprint(other, "You get ");
|
||||
|
||||
if(self.items && (other.items & self.items) == 0) {
|
||||
if(self.items)
|
||||
if((other.items & self.items) == 0) {
|
||||
acount = 1;
|
||||
sprint(other, "the ");
|
||||
sprint(other, self.netname);
|
||||
}
|
||||
|
||||
// if the player was using their best weapon, change up to the new one if better
|
||||
// if the player was using his best weapon, change up to the new one if better
|
||||
stemp = self;
|
||||
self = other;
|
||||
best = W_BestWeapon();
|
||||
|
@ -1267,20 +1241,6 @@ void() BackpackTouch = {
|
|||
sprint(other, s);
|
||||
sprint(other, " cells");
|
||||
}
|
||||
if(self.items & IT_KEY1) {
|
||||
if(acount) {
|
||||
sprint(other, ", ");
|
||||
}
|
||||
acount = 1;
|
||||
sprint(other, Key1Name());
|
||||
}
|
||||
if(self.items & IT_KEY2) {
|
||||
if(acount) {
|
||||
sprint(other, ", ");
|
||||
}
|
||||
acount = 1;
|
||||
sprint(other, Key2Name());
|
||||
}
|
||||
|
||||
sprint(other, "\n");
|
||||
// backpack touch sound
|
||||
|
@ -1306,29 +1266,33 @@ void() BackpackTouch = {
|
|||
DropBackpack
|
||||
===============
|
||||
*/
|
||||
entity() DropBackpack = {
|
||||
void() DropBackpack = {
|
||||
local entity item;
|
||||
|
||||
if(!(self.ammo_shells + self.ammo_nails + self.ammo_rockets + self.ammo_cells)) {
|
||||
return; // nothing in it
|
||||
}
|
||||
|
||||
item = spawn();
|
||||
item.origin = self.origin - '0 0 24';
|
||||
item.items = self.weapon | (self.items & (IT_KEY1 | IT_KEY2));
|
||||
|
||||
item.items = self.weapon;
|
||||
if(item.items == IT_AXE) {
|
||||
item.netname = WEPNAME_AXE;
|
||||
item.netname = "Axe";
|
||||
} else if(item.items == IT_SHOTGUN) {
|
||||
item.netname = WEPNAME_SHOTGUN;
|
||||
item.netname = "Shotgun";
|
||||
} else if(item.items == IT_SUPER_SHOTGUN) {
|
||||
item.netname = WEPNAME_SUPER_SHOTGUN;
|
||||
item.netname = "Double-barrelled Shotgun";
|
||||
} else if(item.items == IT_NAILGUN) {
|
||||
item.netname = WEPNAME_NAILGUN;
|
||||
item.netname = "Nailgun";
|
||||
} else if(item.items == IT_SUPER_NAILGUN) {
|
||||
item.netname = WEPNAME_SUPER_NAILGUN;
|
||||
item.netname = "Super Nailgun";
|
||||
} else if(item.items == IT_GRENADE_LAUNCHER) {
|
||||
item.netname = WEPNAME_GRENADE_LAUNCHER;
|
||||
item.netname = "Grenade Launcher";
|
||||
} else if(item.items == IT_ROCKET_LAUNCHER) {
|
||||
item.netname = WEPNAME_ROCKET_LAUNCHER;
|
||||
item.netname = "Rocket Launcher";
|
||||
} else if(item.items == IT_LIGHTNING) {
|
||||
item.netname = WEPNAME_LIGHTNING;
|
||||
item.netname = "Thunderbolt";
|
||||
} else {
|
||||
item.netname = "";
|
||||
}
|
||||
|
@ -1351,6 +1315,4 @@ entity() DropBackpack = {
|
|||
|
||||
item.nextthink = time + 120; // remove after 2 minutes
|
||||
item.think = SUB_Remove;
|
||||
|
||||
return item;
|
||||
};
|
||||
|
|
|
@ -558,7 +558,10 @@ void() PlayerDie = {
|
|||
return;
|
||||
}
|
||||
|
||||
i = cvar("temp1");
|
||||
if(!i) {
|
||||
i = 1 + floor(random() * 6);
|
||||
}
|
||||
|
||||
if(i == 1) {
|
||||
player_diea1();
|
||||
|
|
Loading…
Reference in New Issue
Block a user