#include "item.qh"
-// 24 so it matches the limit for the .items field
-REGISTRY(Items, 24)
+// NOTE: 24 is the limit for the .items field
+REGISTRY(Items, 32)
#ifdef GAMEQC
REGISTRY_DEPENDS(Items, Models)
#endif
REGISTER_NET_LINKED(ENT_CLIENT_INVENTORY)
const int Inventory_groups_minor = 8; // exactly 1 byte
-const int Inventory_groups_major = 3; // ceil(REGISTRY_MAX(Items) / Inventory_groups_minor)
+const int Inventory_groups_major = 4; // ceil(REGISTRY_MAX(Items) / Inventory_groups_minor)
#define G_MAJOR(id) (floor((id) / Inventory_groups_minor))
#define G_MINOR(id) ((id) % Inventory_groups_minor)
const int IT_USING_JETPACK = BIT(3); // confirmation that button is pressed
const int IT_FUEL_REGEN = BIT(4); // fuel regeneration trigger
-const int IT_FUEL = BIT(5);
-const int IT_SHELLS = BIT(6);
-const int IT_NAILS = BIT(7);
-const int IT_ROCKETS = BIT(8);
-const int IT_CELLS = BIT(9);
-const int IT_PLASMA = BIT(10);
+const int IT_RESOURCE = BIT(5); // bitflag to mark this item as a resource (unused)
-const int IT_5HP = BIT(11);
-const int IT_25HP = BIT(12);
-const int IT_HEALTH = BIT(13);
+const int IT_KEY1 = BIT(6);
+const int IT_KEY2 = BIT(7);
-const int IT_ARMOR_SHARD = BIT(14);
-const int IT_ARMOR = BIT(15);
-
-const int IT_KEY1 = BIT(16);
-const int IT_KEY2 = BIT(17);
-
-const int IT_CTF_SHIELDED = BIT(18); // set for the flag shield
+const int IT_CTF_SHIELDED = BIT(8); // set for the flag shield
// special colorblend meaning in engine
-const int IT_INVISIBILITY = BIT(19);
-const int IT_INVINCIBLE = BIT(20);
-const int IT_SUPERWEAPON = BIT(21); // suit
-const int IT_STRENGTH = BIT(22);
+const int IT_INVISIBILITY = BIT(9);
+const int IT_INVINCIBLE = BIT(10);
+const int IT_SUPERWEAPON = BIT(11); // suit
+const int IT_STRENGTH = BIT(12);
// item masks
const int IT_PICKUPMASK = IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS | IT_JETPACK | IT_FUEL_REGEN; // strength and invincible are handled separately
this.m_icon = "ammo_bullets";
#ifdef SVQC
this.m_botvalue = 1500;
- this.m_itemid = IT_NAILS;
+ this.m_itemid = IT_RESOURCE;
this.m_iteminit = ammo_bullets_init;
#endif
}
this.m_icon = "ammo_cells";
#ifdef SVQC
this.m_botvalue = 1500;
- this.m_itemid = IT_CELLS;
+ this.m_itemid = IT_RESOURCE;
this.m_iteminit = ammo_cells_init;
#endif
}
this.m_icon = "ammo_plasma";
#ifdef SVQC
this.m_botvalue = 1500;
- this.m_itemid = IT_PLASMA;
+ this.m_itemid = IT_RESOURCE;
this.m_iteminit = ammo_plasma_init;
#endif
}
this.m_icon = "ammo_rockets";
#ifdef SVQC
this.m_botvalue = 1500;
- this.m_itemid = IT_ROCKETS;
+ this.m_itemid = IT_RESOURCE;
this.m_iteminit = ammo_rockets_init;
#endif
}
this.m_icon = "ammo_shells";
#ifdef SVQC
this.m_botvalue = 1000;
- this.m_itemid = IT_SHELLS;
+ this.m_itemid = IT_RESOURCE;
this.m_iteminit = ammo_shells_init;
#endif
}
this.m_name = _("Small armor");
this.m_icon = "armor";
#ifdef SVQC
- this.m_itemid = IT_ARMOR_SHARD;
+ this.m_itemid = IT_RESOURCE;
this.m_respawntime = GET(g_pickup_respawntime_short);
this.m_respawntimejitter = GET(g_pickup_respawntimejitter_short);
this.m_pickupanyway = GET(g_pickup_armorsmall_anyway);
this.m_name = _("Medium armor");
this.m_icon = "armor";
#ifdef SVQC
- this.m_itemid = IT_ARMOR;
+ this.m_itemid = IT_RESOURCE;
this.m_respawntime = GET(g_pickup_respawntime_medium);
this.m_respawntimejitter = GET(g_pickup_respawntimejitter_medium);
this.m_pickupanyway = GET(g_pickup_armormedium_anyway);
this.m_color = '0 1 0';
this.m_waypoint = _("Big armor");
#ifdef SVQC
- this.m_itemid = IT_ARMOR;
+ this.m_itemid = IT_RESOURCE;
this.m_respawntime = GET(g_pickup_respawntime_long);
this.m_respawntimejitter = GET(g_pickup_respawntimejitter_long);
this.m_pickupanyway = GET(g_pickup_armorbig_anyway);
this.m_waypointblink = 2;
#ifdef SVQC
this.m_maxs = '16 16 70';
- this.m_itemid = IT_ARMOR;
+ this.m_itemid = IT_RESOURCE;
this.m_respawntime = GET(g_pickup_respawntime_long);
this.m_respawntimejitter = GET(g_pickup_respawntimejitter_long);
this.m_pickupanyway = GET(g_pickup_armormega_anyway);
this.m_name = _("Small health");
this.m_icon = "health";
#ifdef SVQC
- this.m_itemid = IT_5HP;
+ this.m_itemid = IT_RESOURCE;
this.m_respawntime = GET(g_pickup_respawntime_short);
this.m_respawntimejitter = GET(g_pickup_respawntimejitter_short);
this.m_pickupanyway = GET(g_pickup_healthsmall_anyway);
this.m_name = _("Medium health");
this.m_icon = "health";
#ifdef SVQC
- this.m_itemid = IT_25HP;
+ this.m_itemid = IT_RESOURCE;
this.m_respawntime = GET(g_pickup_respawntime_short);
this.m_respawntimejitter = GET(g_pickup_respawntimejitter_short);
this.m_pickupanyway = GET(g_pickup_healthmedium_anyway);
this.m_color = '1 0 0';
this.m_waypoint = _("Big health");
#ifdef SVQC
- this.m_itemid = IT_25HP;
+ this.m_itemid = IT_RESOURCE;
this.m_respawntime = GET(g_pickup_respawntime_medium);
this.m_respawntimejitter = GET(g_pickup_respawntimejitter_medium);
this.m_pickupanyway = GET(g_pickup_healthbig_anyway);
this.m_waypointblink = 2;
#ifdef SVQC
this.m_maxs = '16 16 70';
- this.m_itemid = IT_HEALTH;
+ this.m_itemid = IT_RESOURCE;
this.m_respawntime = GET(g_pickup_respawntime_long);
this.m_respawntimejitter = GET(g_pickup_respawntimejitter_long);
this.m_pickupanyway = GET(g_pickup_healthmega_anyway);
this.m_icon = "ammo_fuel";
#ifdef SVQC
this.m_botvalue = 2000;
- this.m_itemid = IT_FUEL;
+ this.m_itemid = IT_RESOURCE;
this.m_iteminit = ammo_fuel_init;
#endif
}
this.m_icon = "ammo_supercells";
#ifdef SVQC
this.m_botvalue = 2000;
- this.m_itemid = IT_CELLS;
+ this.m_itemid = IT_RESOURCE;
this.m_respawntime = GET(instagib_respawntime_ammo);
this.m_respawntimejitter = GET(instagib_respawntimejitter_ammo);
this.m_iteminit = ammo_vaporizercells_init;
this.m_color = '1 0 0';
this.m_waypoint = _("Extra life");
this.m_waypointblink = 2;
- this.m_itemid = IT_NAILS;
+ this.m_itemid = IT_RESOURCE;
}
SPAWNFUNC_ITEM(item_extralife, ITEM_ExtraLife)
return true;
}
-.int items_added;
.string shootfromfixedorigin;
.bool dualwielding_prev;
bool PlayerThink(entity this)
// LordHavoc: allow firing on move frames (sub-ticrate), this gives better timing on slow servers
//if(frametime)
{
- this.items &= ~this.items_added;
-
for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
{
.entity weaponentity = weaponentities[slot];
W_Vortex_Charge(this, weaponentity, frametime);
W_WeaponFrame(this, weaponentity);
}
-
- this.items_added = 0;
- if ((this.items & ITEM_Jetpack.m_itemid) && ((this.items & ITEM_JetpackRegen.m_itemid) || GetResource(this, RES_FUEL) >= 0.01))
- this.items_added |= IT_FUEL;
-
- this.items |= this.items_added;
}
if (frametime)