r79 - trunk/basezym/progsqc
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Fri Nov 9 13:53:21 EST 2007
Author: Vermeulen
Date: 2007-11-09 13:53:21 -0500 (Fri, 09 Nov 2007)
New Revision: 79
Modified:
trunk/basezym/progsqc/actor.qc
trunk/basezym/progsqc/bots.qc
trunk/basezym/progsqc/gamedefs.qc
trunk/basezym/progsqc/inventory.qc
trunk/basezym/progsqc/player.qc
Log:
Weapons use only 4 different types of ammo now, Energy-Metal-Explosives-Plasma
Modified: trunk/basezym/progsqc/actor.qc
===================================================================
--- trunk/basezym/progsqc/actor.qc 2007-11-09 01:06:47 UTC (rev 78)
+++ trunk/basezym/progsqc/actor.qc 2007-11-09 18:53:21 UTC (rev 79)
@@ -249,24 +249,15 @@
}
else if (self.weaponstate == WS_RELOAD)
{
- if (iteminfo_ammo1itemtype >= 0)
+ if (iteminfo_ammotype >= 0)
{
- f1 = min(iteminfo_ammo1max - iteminfo_ammo1, iteminfo_ammo1inventory);
+ f1 = min(iteminfo_ammomax - iteminfo_ammo, iteminfo_ammoinventory);
if (f1 > 0)
{
- Inventory_ModifyItem(self, self.weaponitem, 0, f1, 0);
- Inventory_ModifyItem(self, iteminfo_ammo1itemtype, 0 - f1, 0, 0);
+ Inventory_ModifyItem(self, self.weaponitem, 0, f1);
+ Inventory_ModifyItem(self, iteminfo_ammotype, 0 - f1, 0);
}
}
- if (iteminfo_ammo2itemtype >= 0)
- {
- f2 = min(iteminfo_ammo2max - iteminfo_ammo2, iteminfo_ammo2inventory);
- if (f2 > 0)
- {
- Inventory_ModifyItem(self, self.weaponitem, 0, 0, f2);
- Inventory_ModifyItem(self, iteminfo_ammo2itemtype, 0 - f2, 0, 0);
- }
- }
weapon_state(WS_IDLE);
}
else if (self.weaponstate == WS_TURNON)
@@ -296,7 +287,7 @@
//bprint("lowering\n");
weapon_state(WS_LOWER);
}
- else if (self.button4 && ((iteminfo_ammo1 < iteminfo_ammo1max && iteminfo_ammo1inventory >= 1) || (iteminfo_ammo2 < iteminfo_ammo2max && iteminfo_ammo2inventory >= 1)))
+ else if (self.button4 && ((iteminfo_ammo < iteminfo_ammomax && iteminfo_ammoinventory >= 1)))
weapon_state(WS_RELOAD);
else if (self.button0 && iteminfo_weapon_canfire1 && (!self.weapon_oldbutton0 || !(iteminfo_ammo1flags & PROJECTILEFLAG_SEMIAUTOMATIC)))
weapon_state(WS_FIRE1);
@@ -452,10 +443,16 @@
projcolormod = iteminfo_ammo1colormod;
}
- if (self.weaponitem >= ITEMTYPE_ITEM1)
- Inventory_ModifyItem(self, self.weaponitem, 0 - mintofire, 0, 0);
+ if (self.unlimitedinventory == 0)
+ if (self.weaponitem >= ITEMTYPE_ITEM1)
+ {
+ Inventory_ModifyItem(self, self.weaponitem, 0 - mintofire, 0);
+ Item_Spawn(self.weaponitem,1,0,self.origin,'300 0 0',0,world);
+ }
else
- Inventory_ModifyItem(self, self.weaponitem, 0, 0 - mintofire, 0);
+ {
+ Inventory_ModifyItem(self, self.weaponitem, 0, 0 - mintofire);
+ }
weapon_recoil(recoil);
Modified: trunk/basezym/progsqc/bots.qc
===================================================================
--- trunk/basezym/progsqc/bots.qc 2007-11-09 01:06:47 UTC (rev 78)
+++ trunk/basezym/progsqc/bots.qc 2007-11-09 18:53:21 UTC (rev 79)
@@ -189,7 +189,8 @@
setorigin(self, self.origin + '0 0 1');
self.think = bot_npcthink;
self.nextthink = time;
- self.team = 2;
+ self.team = cvar("g_defaultenemyteam");
+ self.unlimitedinventory = 1;
player_spawn(ACTORTYPE_CLASS2);
}
};
@@ -201,7 +202,8 @@
setorigin(self, self.origin + '0 0 1');
self.think = bot_npcthink;
self.nextthink = time;
- self.team = 2;
+ self.team = cvar("g_defaultenemyteam");
+ self.unlimitedinventory = 1;
player_spawn(ACTORTYPE_CLASS3);
}
};
@@ -213,7 +215,8 @@
setorigin(self, self.origin + '0 0 1');
self.think = bot_npcthink;
self.nextthink = time;
- self.team = 2;
+ self.team = cvar("g_defaultenemyteam");
+ self.unlimitedinventory = 1;
player_spawn(ACTORTYPE_CLASS4);
}
};
@@ -225,7 +228,8 @@
setorigin(self, self.origin + '0 0 1');
self.think = bot_npcthink;
self.nextthink = time;
- self.team = 2;
+ self.team = cvar("g_defaultenemyteam");
+ self.unlimitedinventory = 1;
player_spawn(ACTORTYPE_CLASS5);
}
};
@@ -238,7 +242,8 @@
setorigin(self, self.origin + '0 0 1');
self.think = bot_npcthink;
self.nextthink = time;
- self.team = 2;
+ self.team = cvar("g_defaultenemyteam");
+ self.unlimitedinventory = 1;
player_spawn(ACTORTYPE_CLASS6);
}
};
@@ -250,7 +255,8 @@
setorigin(self, self.origin + '0 0 1');
self.think = bot_npcthink;
self.nextthink = time;
- self.team = 2;
+ self.team = cvar("g_defaultenemyteam");
+ self.unlimitedinventory = 1;
player_spawn(ACTORTYPE_CLASS7);
}
};
Modified: trunk/basezym/progsqc/gamedefs.qc
===================================================================
--- trunk/basezym/progsqc/gamedefs.qc 2007-11-09 01:06:47 UTC (rev 78)
+++ trunk/basezym/progsqc/gamedefs.qc 2007-11-09 18:53:21 UTC (rev 79)
@@ -3,6 +3,8 @@
.float ladder_time;
.entity ladder_entity;
+.float respawntime;
+
.float fade_time;
.float fade_rate;
.vector finaldest, finalangle;
Modified: trunk/basezym/progsqc/inventory.qc
===================================================================
--- trunk/basezym/progsqc/inventory.qc 2007-11-09 01:06:47 UTC (rev 78)
+++ trunk/basezym/progsqc/inventory.qc 2007-11-09 18:53:21 UTC (rev 79)
@@ -22,15 +22,12 @@
float ITEMTYPE_ITEM1 = 13;
float ITEMTYPE_ITEM2 = 14;
-float ITEMTYPE_WEAP1_AMMO = 15;
-float ITEMTYPE_WEAP2_AMMO = 16;
-float ITEMTYPE_WEAP3_AMMO = 17;
-float ITEMTYPE_WEAP4_AMMO = 18;
-float ITEMTYPE_WEAP5_AMMO = 19;
-float ITEMTYPE_WEAP6_AMMO = 20;
-float ITEMTYPE_WEAP7_AMMO = 21;
+float ITEMTYPE_AMMO1 = 15;
+float ITEMTYPE_AMMO2 = 16;
+float ITEMTYPE_AMMO3 = 17;
+float ITEMTYPE_AMMO4 = 18;
-float ITEMTYPE_TOTAL = 22;
+float ITEMTYPE_TOTAL = 19;
float WS_IDLE = 0;
float WS_FIRE1 = 1;
@@ -47,23 +44,22 @@
// current item stats
float iteminfo_quantity;
-float iteminfo_ammo1;
-float iteminfo_ammo2;
-// how much ammo is in inventory (can be loaded into the gun)
-float iteminfo_ammo1inventory;
-float iteminfo_ammo2inventory;
+float iteminfo_ammo;
+float iteminfo_ammoinventory; // how much ammo is in inventory (can be loaded into the gun)
// general information about the item
+string iteminfo_model;
+string iteminfo_pickupsound;
+string iteminfo_pickupmodel;
+string iteminfo_name;
float iteminfo_itemtype;
float iteminfo_quantitymax;
-float iteminfo_ammo1max;
-float iteminfo_ammo2max;
-float iteminfo_ammo1inventorymax;
-float iteminfo_ammo2inventorymax;
+float iteminfo_ammomax;
+float iteminfo_ammoinventorymax;
+float iteminfo_ammotype;
+
float iteminfo_ammo1minimumtofire;
float iteminfo_ammo2minimumtofire;
-float iteminfo_ammo1itemtype;
-float iteminfo_ammo2itemtype;
float iteminfo_ammo1numberof;
float iteminfo_ammo2numberof;
float iteminfo_ammo1recoil;
@@ -86,10 +82,6 @@
string iteminfo_ammo2bouncesound;
string iteminfo_ammo1firesound;
string iteminfo_ammo2firesound;
-string iteminfo_model;
-string iteminfo_pickupsound;
-string iteminfo_pickupmodel;
-string iteminfo_name;
float iteminfo_ammo1tracer;
float iteminfo_ammo2tracer;
string iteminfo_ammo1tracermodel;
@@ -148,21 +140,19 @@
iteminfo_itemtype = itemtype;
item = Inventory_GetItem(character, itemtype);
iteminfo_quantity = item_x;
- iteminfo_ammo1 = item_y;
- iteminfo_ammo2 = item_z;
- iteminfo_ammo1inventory = 0;
- iteminfo_ammo2inventory = 0;
-
+ iteminfo_ammo = item_y;
+ iteminfo_ammoinventory = 0;
iteminfo_model = "";
iteminfo_pickupmodel = "";
iteminfo_name = "unknown";
iteminfo_pickupsound = "";
iteminfo_quantitymax = 0;
- iteminfo_ammo1max = 0;
- iteminfo_ammo1inventorymax = 0;
+ iteminfo_ammomax = 0;
+ iteminfo_ammoinventorymax = 0;
+ iteminfo_ammotype = ITEMTYPE_NONE;
+
iteminfo_ammo1minimumtofire = 0;
- iteminfo_ammo1itemtype = ITEMTYPE_NONE;
iteminfo_ammo1damagetype = DAMAGETYPE_UNKNOWN;
iteminfo_ammo1damage = '0 0 0';
iteminfo_ammo1speeds = '0 0 0';
@@ -180,10 +170,7 @@
iteminfo_ammo1health = 0;
iteminfo_ammo1mass = 0;
iteminfo_ammo1colormod = '0 0 0';
- iteminfo_ammo2max = 0;
- iteminfo_ammo2inventorymax = 0;
iteminfo_ammo2minimumtofire = 0;
- iteminfo_ammo2itemtype = ITEMTYPE_NONE;
iteminfo_ammo2damagetype = DAMAGETYPE_UNKNOWN;
iteminfo_ammo2damage = '0 0 0';
iteminfo_ammo2speeds = '0 0 0';
@@ -205,7 +192,7 @@
iteminfo_weapon_viewmodelanim_idle = '0 0 1';
iteminfo_weapon_viewmodelanim_fire1 = '0 0 2';
iteminfo_weapon_viewmodelanim_fire2 = '0 0 2';
- iteminfo_weapon_viewmodelanim_reload = '0 0 1';
+ iteminfo_weapon_viewmodelanim_reload = '0 0 0.1';
iteminfo_weapon_viewmodelanim_lower = '0 0 2';
iteminfo_weapon_viewmodelanim_raise = '0 0 2';
iteminfo_weapon_viewmodelanim_turnon = '0 0 2';
@@ -232,10 +219,8 @@
wname = strcat("g_weap",ftos(itemtype + 1));
else
wname = strcat("g_ai_weap",ftos(itemtype - ITEMTYPE_AI_WEAP1 + 1));
-
- iteminfo_ammo1itemtype = ITEMTYPE_WEAP1_AMMO + itemtype;
+
iteminfo_ammo1damagetype = DAMAGETYPE_WEAP1 + itemtype;
- iteminfo_ammo2itemtype = ITEMTYPE_WEAP1_AMMO + itemtype;
iteminfo_ammo2damagetype = DAMAGETYPE_WEAP1 + itemtype;
iteminfo_name = cvar_string(wname);
@@ -243,13 +228,15 @@
iteminfo_weapon_viewmodel = cvar_string(wname,"_viewmodel");
iteminfo_pickupmodel = cvar_string(wname,"_pickupmodel");
+ iteminfo_ammotype = cvar(wname,"_ammotype") + ITEMTYPE_AMMO1 - 1;
+ iteminfo_ammomax = cvar(wname,"_ammomax");
+ iteminfo_ammoinventorymax = cvar(wname,"_ammoinventorymax");
+
iteminfo_ammo1damage = stov(cvar_string(wname,"_ammo1damage"));
iteminfo_ammo1speeds = stov(cvar_string(wname,"_ammo1speeds"));
iteminfo_ammo1model = cvar_string(wname,"_ammo1model");
iteminfo_ammo1firesound = cvar_string(wname,"_ammo1firesound");
//iteminfo_ammo1explodesound = strzone(cvar_string(wname,"_ammo1explodesound")); // BAD
- iteminfo_ammo1max = cvar(wname,"_ammo1max");
- iteminfo_ammo1inventorymax = cvar(wname,"_ammo1inventorymax");
iteminfo_ammo1flags = cvar(wname,"_ammo1flags");
iteminfo_ammo1numberof = cvar(wname,"_ammo1numberof");
iteminfo_ammo1recoil = cvar(wname,"_ammo1recoil");
@@ -268,9 +255,6 @@
iteminfo_ammo2model = cvar_string(wname,"_ammo2model");
iteminfo_ammo2firesound = cvar_string(wname,"_ammo2firesound");
//iteminfo_ammo2explodesound = strzone(cvar_string(wname,"_ammo2explodesound")); // BAD
- iteminfo_ammo2max = cvar(wname,"_ammo2max");
- iteminfo_ammo2inventorymax = cvar(wname,"_ammo2inventorymax");
-
iteminfo_ammo2flags = cvar(wname,"_ammo2flags");
iteminfo_ammo2numberof = cvar(wname,"_ammo2numberof");
iteminfo_ammo2recoil = cvar(wname,"_ammo2recoil");
@@ -284,7 +268,7 @@
iteminfo_ammo2colormod = stov(cvar_string(wname,"_ammo2colormod"));
iteminfo_weapon_viewmodelanim_fire2 = stov(cvar_string(wname,"_fire2"));
}
- else if (itemtype < ITEMTYPE_WEAP1_AMMO)
+ else if (itemtype < ITEMTYPE_AMMO1)
{
wname = strcat("g_item",ftos(itemtype - ITEMTYPE_ITEM1 + 1));
@@ -296,34 +280,33 @@
iteminfo_ammo1bouncesound = cvar_string(wname,"_bouncesound");
iteminfo_quantitymax = cvar(wname,"_quantitymax");
iteminfo_ammo1speeds = stov(cvar_string(wname,"_speeds"));
- iteminfo_ammo1itemtype = itemtype;
+ iteminfo_ammotype = itemtype;
}
else if (itemtype < ITEMTYPE_TOTAL)
{
- wname = strcat("g_weap",ftos(itemtype - ITEMTYPE_WEAP1_AMMO + 1));
- iteminfo_name = cvar_string(wname,"_ammo_name");
- iteminfo_model = cvar_string(wname,"_ammo_model");
- iteminfo_pickupsound = cvar_string(wname,"_ammo_pickupsound");
- iteminfo_quantitymax = cvar(wname,"_ammo_quantitymax");
- iteminfo_pickupmodel = cvar_string(wname,"_ammo_pickupmodel");
+ wname = strcat("g_ammo",ftos(itemtype - ITEMTYPE_AMMO1 + 1));
+ iteminfo_name = cvar_string(wname,"_name");
+ iteminfo_pickupsound = cvar_string(wname,"_pickupsound");
+ iteminfo_pickupmodel = cvar_string(wname,"_pickupmodel");
+ iteminfo_quantitymax = cvar(wname,"_quantitymax");
}
else
error(ftos(itemtype)," Inventory_GetItemInfo: unknown itemtype\n");
if (iteminfo_quantity >= 1)
{
- if (iteminfo_ammo1itemtype == itemtype)
+ if (iteminfo_ammotype == itemtype)
{
// usable items such as flares
iteminfo_ammo1flags = PROJECTILEFLAG_SEMIAUTOMATIC;
iteminfo_ammo1minimumtofire = 1;
iteminfo_ammo1model = iteminfo_model;
- iteminfo_ammo1max = iteminfo_ammo1minimumtofire;
- iteminfo_ammo1inventorymax = iteminfo_quantitymax - iteminfo_ammo1minimumtofire;
+ iteminfo_ammomax = iteminfo_ammo1minimumtofire;
+ iteminfo_ammoinventorymax = iteminfo_quantitymax - iteminfo_ammo1minimumtofire;
if (iteminfo_quantity >= iteminfo_ammo1minimumtofire)
{
- iteminfo_ammo1 = iteminfo_ammo1minimumtofire;
- iteminfo_ammo1inventory = iteminfo_quantity - iteminfo_ammo1minimumtofire;
+ iteminfo_ammo = iteminfo_ammo1minimumtofire;
+ iteminfo_ammoinventory = iteminfo_quantity - iteminfo_ammo1minimumtofire;
iteminfo_weapon_canfire1 = TRUE;
iteminfo_weapon_canfire2 = TRUE;
iteminfo_weapon_canraise = iteminfo_weapon_canfire1 || iteminfo_weapon_canfire2;
@@ -333,13 +316,13 @@
else if (iteminfo_ammo1minimumtofire)
{
// weapons
- if (iteminfo_ammo1itemtype >= 0)
+ if (iteminfo_ammotype >= 0)
{
- item = Inventory_GetItem(character, iteminfo_ammo1itemtype);
- iteminfo_ammo1inventory = item_x;
+ item = Inventory_GetItem(character, iteminfo_ammotype);
+ iteminfo_ammoinventory = item_x;
}
- iteminfo_weapon_canreload = (iteminfo_ammo1 < iteminfo_ammo1max && iteminfo_ammo1inventory >= 1) || (iteminfo_ammo2 < iteminfo_ammo2max && iteminfo_ammo2inventory >= 1);
- iteminfo_weapon_canfire1 = iteminfo_ammo1 >= iteminfo_ammo1minimumtofire;
+ iteminfo_weapon_canreload = (iteminfo_ammo < iteminfo_ammomax && iteminfo_ammoinventory >= 1);
+ iteminfo_weapon_canfire1 = iteminfo_ammo >= iteminfo_ammo1minimumtofire;
if (iteminfo_ammo1flags & PROJECTILEFLAG_REMOTEDETONATE)
{
// one ammo type, but special altfire
@@ -358,17 +341,10 @@
e = find(e, classname, "projectile");
}
}
- else if (iteminfo_ammo2itemtype != iteminfo_ammo1itemtype && iteminfo_ammo2itemtype >= 0)
- {
- // really has two ammo types
- item = Inventory_GetItem(character, iteminfo_ammo2itemtype);
- iteminfo_ammo2inventory = item_x;
- iteminfo_weapon_canfire2 = iteminfo_ammo2 >= iteminfo_ammo2minimumtofire;
- }
else
{
// has only one ammo type, but can fire it two ways
- iteminfo_weapon_canfire2 = iteminfo_ammo1 >= iteminfo_ammo2minimumtofire;
+ iteminfo_weapon_canfire2 = iteminfo_ammo >= iteminfo_ammo2minimumtofire;
}
// fteqcc bug:
// these work
@@ -380,7 +356,7 @@
//iteminfo_weapon_canraise = (iteminfo_weapon_canfire1 || iteminfo_weapon_canfire2) || iteminfo_weapon_canreload;
//iteminfo_weapon_canraise = iteminfo_weapon_canfire1 || iteminfo_weapon_canfire2 || iteminfo_weapon_canreload;
if (iteminfo_weapon_canraise)
- iteminfo_weapon_rank = (iteminfo_ammo1 + iteminfo_ammo1inventory) * iteminfo_ammo1damage_x + (iteminfo_ammo2 + iteminfo_ammo2inventory) * iteminfo_ammo2damage_x;
+ iteminfo_weapon_rank = (iteminfo_ammo + iteminfo_ammoinventory) * iteminfo_ammo1damage_x + (iteminfo_ammo + iteminfo_ammoinventory) * iteminfo_ammo2damage_x;
}
else
{
@@ -394,23 +370,17 @@
character.ammo_nails = 0;
character.ammo_rockets = 0;
character.ammo_cells = 0;
- if (iteminfo_ammo1max + iteminfo_ammo1inventorymax)
+ if (iteminfo_ammomax + iteminfo_ammoinventorymax)
{
- character.currentammo = iteminfo_ammo1 * 200 / (iteminfo_ammo1max + iteminfo_ammo1inventorymax);
- character.ammo_shells = iteminfo_ammo1inventory * 200 / (iteminfo_ammo1max + iteminfo_ammo1inventorymax);
+ character.currentammo = iteminfo_ammo * 200 / (iteminfo_ammomax + iteminfo_ammoinventorymax);
+ character.ammo_shells = iteminfo_ammoinventory * 200 / (iteminfo_ammomax + iteminfo_ammoinventorymax);
}
- if (iteminfo_ammo2max + iteminfo_ammo2inventorymax)
- { //character.jetpack_fuel;
- character.ammo_nails = iteminfo_ammo2 * 200 / (iteminfo_ammo2max + iteminfo_ammo2inventorymax);
- character.ammo_rockets = iteminfo_ammo2inventory * 200 / (iteminfo_ammo2max + iteminfo_ammo2inventorymax);
+ //if (iteminfo_ammo2max + iteminfo_ammo2inventorymax)
+ {
+ character.ammo_nails = character.jetpack_fuel; // iteminfo_ammo2 * 200 / (iteminfo_ammo2max + iteminfo_ammo2inventorymax);
+ character.ammo_rockets = 0; //iteminfo_ammo2inventory * 200 / (iteminfo_ammo2max + iteminfo_ammo2inventorymax);
}
}
- if (character.unlimitedinventory)
- {
- d = (skill + 1) * 0.25;
- iteminfo_ammo1damage = iteminfo_ammo1damage * d;
- iteminfo_ammo2damage = iteminfo_ammo2damage * d;
- }
};
void() Inventory_Precache =
@@ -470,7 +440,7 @@
return best;
};
-vector(entity character, float itemtype, float adjustquantity, float adjustammo1, float adjustammo2) Inventory_ModifyItem =
+vector(entity character, float itemtype, float adjustquantity, float adjustammo) Inventory_ModifyItem =
{
local float olditemtype;
local vector item, olditem;
@@ -478,16 +448,15 @@
if (adjustquantity < 0)
adjustquantity = 0;
if (adjustquantity == 0)
- if (adjustammo1 == 0)
- if (adjustammo2 == 0)
+ if (adjustammo == 0)
return '0 0 0';
olditemtype = iteminfo_itemtype;
Inventory_GetItemInfo(character, itemtype);
item = Inventory_GetItem(character, itemtype);
olditem = item;
item_x = bound(0, item_x + adjustquantity, iteminfo_quantitymax);
- item_y = bound(0, item_y + adjustammo1, iteminfo_ammo1max);
- item_z = bound(0, item_z + adjustammo2, iteminfo_ammo2max);
+ item_y = bound(0, item_y + adjustammo, iteminfo_ammomax);
+ //item_z = bound(0, item_z + adjustammo2, iteminfo_ammo2max);
Inventory_SetItem(character, itemtype, item);
// update iteminfo for olditemtype
// (if olditemtype == itemtype then we want to update it because the item
@@ -517,7 +486,7 @@
{
item = Inventory_GetItem(from, itemtype);
if (item != '0 0 0')
- Inventory_ModifyItem(to, itemtype, item_x, item_y, item_z);
+ Inventory_ModifyItem(to, itemtype, item_x, item_y);
itemtype = itemtype + 1;
}
};
@@ -591,29 +560,38 @@
else
Inventory_AddFromInventory(other, self);
- self.solid = SOLID_NOT;
- self.nextthink = time + 15;
- self.think = Item_Respawn;
- self.alpha = 0.05;
- setorigin (self, self.origin);
+ if (self.respawntime > 0)
+ {
+ self.think = Item_Respawn;
+ self.solid = SOLID_NOT;
+ self.nextthink = time + self.respawntime;
+ self.alpha = 0.05;
+ setorigin (self, self.origin);
+ }
+ else
+ {
+ remove(self);
+ }
};
.float ispointable;
-void(float itemtype, float quantity, float ammo1, float ammo2, vector org, vector vel, float activated, entity own) Item_Spawn =
+void(float itemtype, float quantity, float ammo1, vector org, vector vel, float respawntim, entity own) Item_Spawn =
{
Inventory_GetItemInfo(world, itemtype);
newmis = spawn();
newmis.owner = own;
+ newmis.respawntime = respawntim;
newmis.classname = "item";
newmis.netname = strzone(iteminfo_name);
newmis.ispointable = TRUE;
newmis.solid = SOLID_BBOX;
- newmis.movetype = MOVETYPE_TOSS;
+ newmis.movetype = MOVETYPE_BOUNCE;
newmis.velocity = vel;
- newmis.angles = '25 0 0';
+ //newmis.angles = '25 0 0';
newmis.nextthink = time + 10;
newmis.think = Item_EnableOwner;
newmis.use = Item_Pickup;
+ newmis.mass = 25;
newmis.health = 0;
newmis.armorvalue = 0;
@@ -623,75 +601,63 @@
newmis.noise = iteminfo_pickupsound;
setorigin(newmis, org);
setmodel(newmis, iteminfo_pickupmodel);
- setsize(newmis, '-25 -25 -25', '8 8 8');
- Inventory_ModifyItem(newmis, itemtype, quantity, ammo1, ammo2);
+ //setsize(newmis, '-25 -25 -25', '8 8 8');
+ Inventory_ModifyItem(newmis, itemtype, quantity, ammo1);
newmis.effects = newmis.effects | EF_ADDITIVE | EF_FULLBRIGHT;
};
void() weapon_weap1 =
{
- Item_Spawn(ITEMTYPE_WEAP1,1,100,100,self.origin,'0 0 0',1,world);
+ Item_Spawn(ITEMTYPE_WEAP1,1,100,self.origin,'0 0 0',10,world);
}
void() weapon_weap2 =
{
- Item_Spawn(ITEMTYPE_WEAP2,1,100,100,self.origin,'0 0 0',1,world);
+ Item_Spawn(ITEMTYPE_WEAP2,1,100,self.origin,'0 0 0',10,world);
}
void() weapon_weap3 =
{
- Item_Spawn(ITEMTYPE_WEAP3,1,100,100,self.origin,'0 0 0',1,world);
+ Item_Spawn(ITEMTYPE_WEAP3,1,100,self.origin,'0 0 0',10,world);
}
void() weapon_weap4 =
{
- Item_Spawn(ITEMTYPE_WEAP4,1,100,100,self.origin,'0 0 0',1,world);
+ Item_Spawn(ITEMTYPE_WEAP4,1,100,self.origin,'0 0 0',10,world);
}
void() weapon_weap5 =
{
- Item_Spawn(ITEMTYPE_WEAP5,1,100,100,self.origin,'0 0 0',1,world);
+ Item_Spawn(ITEMTYPE_WEAP5,1,100,self.origin,'0 0 0',10,world);
}
void() weapon_weap6 =
{
- Item_Spawn(ITEMTYPE_WEAP6,1,100,100,self.origin,'0 0 0',1,world);
+ Item_Spawn(ITEMTYPE_WEAP6,1,100,self.origin,'0 0 0',10,world);
}
void() weapon_weap7 =
{
- Item_Spawn(ITEMTYPE_WEAP7,1,100,100,self.origin,'0 0 0',1,world);
+ Item_Spawn(ITEMTYPE_WEAP7,1,100,self.origin,'0 0 0',10,world);
}
-void() item_wep1ammo =
+void() item_ammo1 =
{
- Item_Spawn(ITEMTYPE_WEAP1_AMMO,1,100,100,self.origin,'0 0 0',1,world);
+ Item_Spawn(ITEMTYPE_AMMO1,50,0,self.origin,'0 0 0',10,world);
}
-void() item_wep2ammo =
+void() item_ammo2 =
{
- Item_Spawn(ITEMTYPE_WEAP2_AMMO,1,100,100,self.origin,'0 0 0',1,world);
+ Item_Spawn(ITEMTYPE_AMMO2,50,0,self.origin,'0 0 0',10,world);
}
-void() item_wep3ammo =
+void() item_ammo3 =
{
- Item_Spawn(ITEMTYPE_WEAP3_AMMO,1,100,100,self.origin,'0 0 0',1,world);
+ Item_Spawn(ITEMTYPE_AMMO3,50,0,self.origin,'0 0 0',10,world);
}
-void() item_wep4ammo =
+void() item_ammo4 =
{
- Item_Spawn(ITEMTYPE_WEAP4_AMMO,1,100,100,self.origin,'0 0 0',1,world);
+ Item_Spawn(ITEMTYPE_AMMO4,50,0,self.origin,'0 0 0',10,world);
}
-void() item_wep5ammo =
-{
- Item_Spawn(ITEMTYPE_WEAP5_AMMO,1,100,100,self.origin,'0 0 0',1,world);
-}
-void() item_wep6ammo =
-{
- Item_Spawn(ITEMTYPE_WEAP6_AMMO,1,100,100,self.origin,'0 0 0',1,world);
-}
-void() item_wep7ammo =
-{
- Item_Spawn(ITEMTYPE_WEAP7_AMMO,1,100,100,self.origin,'0 0 0',1,world);
-}
void() item_health1 =
{
Modified: trunk/basezym/progsqc/player.qc
===================================================================
--- trunk/basezym/progsqc/player.qc 2007-11-09 01:06:47 UTC (rev 78)
+++ trunk/basezym/progsqc/player.qc 2007-11-09 18:53:21 UTC (rev 79)
@@ -149,14 +149,14 @@
{
startingweapon = cvar(cname,"_startinguserweapon") - 1;
Inventory_GetItemInfo(pc, startingweapon);
- Inventory_ModifyItem(pc, startingweapon, 1, iteminfo_ammo1max, iteminfo_ammo2max);
- Inventory_ModifyItem(pc, ITEMTYPE_WEAP1_AMMO + startingweapon, iteminfo_ammo1inventorymax * 2, 0, 0);
+ Inventory_ModifyItem(pc, startingweapon, 1, iteminfo_ammomax);
+ Inventory_ModifyItem(pc, ITEMTYPE_AMMO1 + startingweapon, iteminfo_ammoinventorymax * 2, 0);
}
else if (cvar(cname,"_startingaiweapon") != 0) // AI weapons
{
startingweapon = cvar(cname,"_startingaiweapon") + ITEMTYPE_AI_WEAP1 - 1;
Inventory_GetItemInfo(pc, startingweapon);
- Inventory_ModifyItem(pc, startingweapon, 1, iteminfo_ammo1max, iteminfo_ammo2max);
+ Inventory_ModifyItem(pc, startingweapon, 1, iteminfo_ammomax);
}
}
};
@@ -1047,19 +1047,40 @@
newmis.nextthink = time;
oldself = self;
self = newmis;
- self.team = 2;
+ self.team = cvar("g_defaultenemyteam");
+ self.unlimitedinventory = 1;
player_spawn(impuls - 30);
-
self = oldself;
}
+ if (impuls == 21)
+ {
+ c = 0;
+ vector item;
+ while (c < ITEMTYPE_TOTAL)
+ {
+ if (c == ITEMTYPE_WEAP1)
+ bprint("User Weapons: AT=Ammotype Q=Quantity A=Ammo","\n");
+ if (c == ITEMTYPE_AI_WEAP1)
+ bprint("AI Weapons:","\n");
+ if (c == ITEMTYPE_ITEM1)
+ bprint("Items:","\n");
+ if (c == ITEMTYPE_AMMO1)
+ bprint("Ammo:","\n");
+
+ Inventory_GetItemInfo(self, c);
+ item = Inventory_GetItem(self, c);
+ bprint(ftos(c),". AT:", ftos(iteminfo_ammotype)," Q:",ftos(item_x)," A:",ftos(item_y));
+ bprint(" ", iteminfo_name,"\n");
+ c = c + 1;
+ }
+ }
if (impuls == 20)
{
c = 0;
while (c < ITEMTYPE_TOTAL)
{
Inventory_GetItemInfo(self, c);
- Inventory_ModifyItem(self, c, iteminfo_quantitymax, iteminfo_ammo1max, iteminfo_ammo2max);
- bprint(iteminfo_name, " ", ftos(iteminfo_ammo1max)," ", ftos(iteminfo_ammo1inventorymax)," ", ftos(iteminfo_quantitymax),"\n");
+ Inventory_ModifyItem(self, c, iteminfo_quantitymax, iteminfo_ammomax);
c = c + 1;
}
self.switchweaponitem = Inventory_GetBestWeapon(self);
More information about the zymotic-commits
mailing list