#ifdef SVQC
bool autocvar_g_pickup_ammo_anyway;
+float autocvar_g_pickup_respawntime_ammo;
+float autocvar_g_pickup_respawntimejitter_ammo;
#endif
CLASS(Ammo, Pickup)
#ifdef SVQC
ATTRIB(Ammo, m_pickupevalfunc, float(entity player, entity item), ammo_pickupevalfunc);
- ATTRIB(Ammo, m_respawntime, float(), GET(g_pickup_respawntime_ammo));
- ATTRIB(Ammo, m_respawntimejitter, float(), GET(g_pickup_respawntimejitter_ammo));
+ ATTRIB(Ammo, m_respawntime, float, autocvar_g_pickup_respawntime_ammo);
+ ATTRIB(Ammo, m_respawntimejitter, float, autocvar_g_pickup_respawntimejitter_ammo);
ATTRIB(Ammo, m_pickupanyway, bool, autocvar_g_pickup_ammo_anyway);
#endif
ENDCLASS(Ammo)
bool autocvar_g_pickup_armorsmall_anyway;
int autocvar_g_pickup_armorsmall;
int autocvar_g_pickup_armorsmall_max;
+float autocvar_g_pickup_respawntime_armor_small;
+float autocvar_g_pickup_respawntimejitter_armor_small;
void item_armorsmall_init(Pickup this, entity item)
{
if(!item.max_armorvalue)
/* minsize */ ATTRIB(ArmorSmall, m_mins, vector, ITEM_S_MINS);
/* maxsize */ ATTRIB(ArmorSmall, m_maxs, vector, ITEM_S_MAXS);
/* itemid */ ATTRIB(ArmorSmall, m_itemid, int, IT_RESOURCE);
-/* respawntime */ ATTRIB(ArmorSmall, m_respawntime, float(), GET(g_pickup_respawntime_armor_small));
-/* */ ATTRIB(ArmorSmall, m_respawntimejitter, float(), GET(g_pickup_respawntimejitter_armor_small));
+/* respawntime */ ATTRIB(ArmorSmall, m_respawntime, float, autocvar_g_pickup_respawntime_armor_small);
+/* */ ATTRIB(ArmorSmall, m_respawntimejitter, float, autocvar_g_pickup_respawntimejitter_armor_small);
/* pickupanyway */ ATTRIB(ArmorSmall, m_pickupanyway, bool, autocvar_g_pickup_armorsmall_anyway);
/* iteminit */ ATTRIB(ArmorSmall, m_iteminit, void(Pickup this, entity item), item_armorsmall_init);
#endif
bool autocvar_g_pickup_armormedium_anyway;
int autocvar_g_pickup_armormedium;
int autocvar_g_pickup_armormedium_max;
+float autocvar_g_pickup_respawntime_armor_medium;
+float autocvar_g_pickup_respawntimejitter_armor_medium;
void item_armormedium_init(Pickup this, entity item)
{
if(!item.max_armorvalue)
/* minsize */ ATTRIB(ArmorMedium, m_mins, vector, ITEM_S_MINS);
/* maxsize */ ATTRIB(ArmorMedium, m_maxs, vector, ITEM_S_MAXS);
/* itemid */ ATTRIB(ArmorMedium, m_itemid, int, IT_RESOURCE);
-/* respawntime */ ATTRIB(ArmorMedium, m_respawntime, float(), GET(g_pickup_respawntime_armor_medium));
-/* */ ATTRIB(ArmorMedium, m_respawntimejitter, float(), GET(g_pickup_respawntimejitter_armor_medium));
+/* respawntime */ ATTRIB(ArmorMedium, m_respawntime, float, autocvar_g_pickup_respawntime_armor_medium);
+/* */ ATTRIB(ArmorMedium, m_respawntimejitter, float, autocvar_g_pickup_respawntimejitter_armor_medium);
/* pickupanyway */ ATTRIB(ArmorMedium, m_pickupanyway, bool, autocvar_g_pickup_armormedium_anyway);
/* iteminit */ ATTRIB(ArmorMedium, m_iteminit, void(Pickup this, entity item), item_armormedium_init);
#endif
bool autocvar_g_pickup_armorbig_anyway;
int autocvar_g_pickup_armorbig;
int autocvar_g_pickup_armorbig_max;
+float autocvar_g_pickup_respawntime_armor_big;
+float autocvar_g_pickup_respawntimejitter_armor_big;
void item_armorbig_init(Pickup this, entity item)
{
if(!item.max_armorvalue)
/* wptext */ ATTRIB(ArmorBig, m_waypoint, string, _("Big armor"));
#ifdef SVQC
/* itemid */ ATTRIB(ArmorBig, m_itemid, int, IT_RESOURCE);
-/* respawntime */ ATTRIB(ArmorBig, m_respawntime, float(), GET(g_pickup_respawntime_armor_big));
-/* */ ATTRIB(ArmorBig, m_respawntimejitter, float(), GET(g_pickup_respawntimejitter_armor_big));
+/* respawntime */ ATTRIB(ArmorBig, m_respawntime, float, autocvar_g_pickup_respawntime_armor_big);
+/* */ ATTRIB(ArmorBig, m_respawntimejitter, float, autocvar_g_pickup_respawntimejitter_armor_big);
/* pickupanyway */ ATTRIB(ArmorBig, m_pickupanyway, bool, autocvar_g_pickup_armorbig_anyway);
/* iteminit */ ATTRIB(ArmorBig, m_iteminit, void(Pickup this, entity item), item_armorbig_init);
#endif
bool autocvar_g_pickup_armormega_anyway;
int autocvar_g_pickup_armormega;
int autocvar_g_pickup_armormega_max;
+float autocvar_g_pickup_respawntime_armor_mega;
+float autocvar_g_pickup_respawntimejitter_armor_mega;
void item_armormega_init(Pickup this, entity item)
{
if(!item.max_armorvalue)
#ifdef SVQC
/* maxsize */ ATTRIB(ArmorMega, m_maxs, vector, ITEM_L_MAXS);
/* itemid */ ATTRIB(ArmorMega, m_itemid, int, IT_RESOURCE);
-/* respawntime */ ATTRIB(ArmorMega, m_respawntime, float(), GET(g_pickup_respawntime_armor_mega));
-/* */ ATTRIB(ArmorMega, m_respawntimejitter, float(), GET(g_pickup_respawntimejitter_armor_mega));
+/* respawntime */ ATTRIB(ArmorMega, m_respawntime, float, autocvar_g_pickup_respawntime_armor_mega);
+/* */ ATTRIB(ArmorMega, m_respawntimejitter, float, autocvar_g_pickup_respawntimejitter_armor_mega);
/* pickupanyway */ ATTRIB(ArmorMega, m_pickupanyway, bool, autocvar_g_pickup_armormega_anyway);
/* iteminit */ ATTRIB(ArmorMega, m_iteminit, void(Pickup this, entity item), item_armormega_init);
#endif
bool autocvar_g_pickup_healthsmall_anyway;
int autocvar_g_pickup_healthsmall;
int autocvar_g_pickup_healthsmall_max;
+float autocvar_g_pickup_respawntime_health_small;
+float autocvar_g_pickup_respawntimejitter_health_small;
void item_healthsmall_init(Pickup this, entity item)
{
if(!item.max_health)
/* minsize */ ATTRIB(HealthSmall, m_mins, vector, ITEM_S_MINS);
/* maxsize */ ATTRIB(HealthSmall, m_maxs, vector, ITEM_S_MAXS);
/* itemid */ ATTRIB(HealthSmall, m_itemid, int, IT_RESOURCE);
-/* respawntime */ ATTRIB(HealthSmall, m_respawntime, float(), GET(g_pickup_respawntime_health_small));
-/* */ ATTRIB(HealthSmall, m_respawntimejitter, float(), GET(g_pickup_respawntimejitter_health_small));
+/* respawntime */ ATTRIB(HealthSmall, m_respawntime, float, autocvar_g_pickup_respawntime_health_small);
+/* */ ATTRIB(HealthSmall, m_respawntimejitter, float, autocvar_g_pickup_respawntimejitter_health_small);
/* pickupanyway */ ATTRIB(HealthSmall, m_pickupanyway, bool, autocvar_g_pickup_healthsmall_anyway);
/* iteminit */ ATTRIB(HealthSmall, m_iteminit, void(Pickup this, entity item), item_healthsmall_init);
#endif
bool autocvar_g_pickup_healthmedium_anyway;
int autocvar_g_pickup_healthmedium;
int autocvar_g_pickup_healthmedium_max;
+float autocvar_g_pickup_respawntime_health_medium;
+float autocvar_g_pickup_respawntimejitter_health_medium;
void item_healthmedium_init(Pickup this, entity item)
{
if(!item.max_health)
/* minsize */ ATTRIB(HealthMedium, m_mins, vector, ITEM_S_MINS);
/* maxsize */ ATTRIB(HealthMedium, m_maxs, vector, ITEM_S_MAXS);
/* itemid */ ATTRIB(HealthMedium, m_itemid, int, IT_RESOURCE);
-/* respawntime */ ATTRIB(HealthMedium, m_respawntime, float(), GET(g_pickup_respawntime_health_medium));
-/* */ ATTRIB(HealthMedium, m_respawntimejitter, float(), GET(g_pickup_respawntimejitter_health_medium));
+/* respawntime */ ATTRIB(HealthMedium, m_respawntime, float, autocvar_g_pickup_respawntime_health_medium);
+/* */ ATTRIB(HealthMedium, m_respawntimejitter, float, autocvar_g_pickup_respawntimejitter_health_medium);
/* pickupanyway */ ATTRIB(HealthMedium, m_pickupanyway, bool, autocvar_g_pickup_healthmedium_anyway);
/* iteminit */ ATTRIB(HealthMedium, m_iteminit, void(Pickup this, entity item), item_healthmedium_init);
#endif
bool autocvar_g_pickup_healthbig_anyway;
int autocvar_g_pickup_healthbig;
int autocvar_g_pickup_healthbig_max;
+float autocvar_g_pickup_respawntime_health_big;
+float autocvar_g_pickup_respawntimejitter_health_big;
void item_healthbig_init(Pickup this, entity item)
{
if(!item.max_health)
/* wptext */ ATTRIB(HealthBig, m_waypoint, string, _("Big health"));
#ifdef SVQC
/* itemid */ ATTRIB(HealthBig, m_itemid, int, IT_RESOURCE);
-/* respawntime */ ATTRIB(HealthBig, m_respawntime, float(), GET(g_pickup_respawntime_health_big));
-/* */ ATTRIB(HealthBig, m_respawntimejitter, float(), GET(g_pickup_respawntimejitter_health_big));
+/* respawntime */ ATTRIB(HealthBig, m_respawntime, float, autocvar_g_pickup_respawntime_health_big);
+/* */ ATTRIB(HealthBig, m_respawntimejitter, float, autocvar_g_pickup_respawntimejitter_health_big);
/* pickupanyway */ ATTRIB(HealthBig, m_pickupanyway, bool, autocvar_g_pickup_healthbig_anyway);
/* iteminit */ ATTRIB(HealthBig, m_iteminit, void(Pickup this, entity item), item_healthbig_init);
#endif
bool autocvar_g_pickup_healthmega_anyway;
int autocvar_g_pickup_healthmega;
int autocvar_g_pickup_healthmega_max;
+float autocvar_g_pickup_respawntime_health_mega;
+float autocvar_g_pickup_respawntimejitter_health_mega;
void item_healthmega_init(Pickup this, entity item)
{
if(!item.max_health)
#ifdef SVQC
/* maxsize */ ATTRIB(HealthMega, m_maxs, vector, ITEM_L_MAXS);
/* itemid */ ATTRIB(HealthMega, m_itemid, int, IT_RESOURCE);
-/* respawntime */ ATTRIB(HealthMega, m_respawntime, float(), GET(g_pickup_respawntime_health_mega));
-/* */ ATTRIB(HealthMega, m_respawntimejitter, float(), GET(g_pickup_respawntimejitter_health_mega));
+/* respawntime */ ATTRIB(HealthMega, m_respawntime, float, autocvar_g_pickup_respawntime_health_mega);
+/* */ ATTRIB(HealthMega, m_respawntimejitter, float, autocvar_g_pickup_respawntimejitter_health_mega);
/* pickupanyway */ ATTRIB(HealthMega, m_pickupanyway, bool, autocvar_g_pickup_healthmega_anyway);
/* iteminit */ ATTRIB(HealthMega, m_iteminit, void(Pickup this, entity item), item_healthmega_init);
#endif
#pragma once
-#ifdef SVQC
-PROPERTY(float, g_pickup_respawntime_weapon)
-PROPERTY(float, g_pickup_respawntime_superweapon)
-PROPERTY(float, g_pickup_respawntime_ammo)
-PROPERTY(float, g_pickup_respawntime_armor_small)
-PROPERTY(float, g_pickup_respawntime_armor_medium)
-PROPERTY(float, g_pickup_respawntime_armor_big)
-PROPERTY(float, g_pickup_respawntime_armor_mega)
-PROPERTY(float, g_pickup_respawntime_health_small)
-PROPERTY(float, g_pickup_respawntime_health_medium)
-PROPERTY(float, g_pickup_respawntime_health_big)
-PROPERTY(float, g_pickup_respawntime_health_mega)
-PROPERTY(float, g_pickup_respawntime_powerup)
-PROPERTY(float, g_pickup_respawntimejitter_weapon)
-PROPERTY(float, g_pickup_respawntimejitter_superweapon)
-PROPERTY(float, g_pickup_respawntimejitter_ammo)
-PROPERTY(float, g_pickup_respawntimejitter_health_small)
-PROPERTY(float, g_pickup_respawntimejitter_health_medium)
-PROPERTY(float, g_pickup_respawntimejitter_health_big)
-PROPERTY(float, g_pickup_respawntimejitter_health_mega)
-PROPERTY(float, g_pickup_respawntimejitter_armor_small)
-PROPERTY(float, g_pickup_respawntimejitter_armor_medium)
-PROPERTY(float, g_pickup_respawntimejitter_armor_big)
-PROPERTY(float, g_pickup_respawntimejitter_armor_mega)
-PROPERTY(float, g_pickup_respawntimejitter_powerup)
-#endif
-
#include <common/items/item.qh>
CLASS(Pickup, GameItem)
ATTRIB(Pickup, m_itemflags, int, 0);
float generic_pickupevalfunc(entity player, entity item);
ATTRIB(Pickup, m_pickupevalfunc, float(entity player, entity item), generic_pickupevalfunc);
- ATTRIB(Pickup, m_respawntime, float());
- ATTRIB(Pickup, m_respawntimejitter, float());
+ ATTRIB(Pickup, m_respawntime, float);
+ ATTRIB(Pickup, m_respawntimejitter, float);
ATTRIB(Pickup, m_pickupanyway, bool);
ATTRIB(Pickup, m_iteminit, void(Pickup this, entity item));
float Item_GiveTo(entity item, entity player);
#include <common/items/item/ammo.qh>
#include <common/mutators/mutator/powerups/_mod.qh>
-float instagib_respawntime_ammo = 45;
-float instagib_respawntimejitter_ammo = 0;
-GETTER(float, instagib_respawntime_ammo)
-GETTER(float, instagib_respawntimejitter_ammo)
-
#ifdef GAMEQC
MODEL(VaporizerCells_ITEM, Item_Model("a_cells.md3"));
SOUND(VaporizerCells, Item_Sound("itempickup"));
#ifdef SVQC
/* botvalue */ ATTRIB(VaporizerCells, m_botvalue, int, 2000);
/* itemid */ ATTRIB(VaporizerCells, m_itemid, int, IT_RESOURCE);
-/* respawntime */ ATTRIB(VaporizerCells, m_respawntime, float(), GET(instagib_respawntime_ammo));
-/* */ ATTRIB(VaporizerCells, m_respawntimejitter, float(), GET(instagib_respawntimejitter_ammo));
+/* respawntime */ ATTRIB(VaporizerCells, m_respawntime, float, 45);
+/* */ ATTRIB(VaporizerCells, m_respawntimejitter, float, 0);
/* iteminit */ ATTRIB(VaporizerCells, m_iteminit, void(Pickup this, entity item), ammo_vaporizercells_init);
#endif
ENDCLASS(VaporizerCells)
entity wep = spawn();
Item_CopyFields(item, wep);
wep.ok_item = true;
- wep.respawntime = g_pickup_respawntime_superweapon;
+ wep.respawntime = autocvar_g_pickup_respawntime_superweapon;
wep.pickup_anyway = true;
wep.itemdef = WEP_OVERKILL_HMG;
wep.lifetime = -1;
entity wep = spawn();
Item_CopyFields(item, wep);
wep.ok_item = true;
- wep.respawntime = g_pickup_respawntime_superweapon;
+ wep.respawntime = autocvar_g_pickup_respawntime_superweapon;
wep.pickup_anyway = true;
wep.itemdef = WEP_OVERKILL_RPC;
wep.lifetime = -1;
#pragma once
#include <common/items/item/pickup.qh>
+
+#ifdef SVQC
+float autocvar_g_pickup_respawntime_powerup;
+float autocvar_g_pickup_respawntimejitter_powerup;
+#endif
+
CLASS(Powerup, Pickup)
#ifdef SVQC
ATTRIB(Powerup, m_maxs, vector, ITEM_L_MAXS);
ATTRIB(Powerup, m_botvalue, int, 11000);
ATTRIB(Powerup, m_itemflags, int, FL_POWERUP);
- ATTRIB(Powerup, m_respawntime, float(), GET(g_pickup_respawntime_powerup));
- ATTRIB(Powerup, m_respawntimejitter, float(), GET(g_pickup_respawntimejitter_powerup));
+ ATTRIB(Powerup, m_respawntime, float, autocvar_g_pickup_respawntime_powerup);
+ ATTRIB(Powerup, m_respawntimejitter, float, autocvar_g_pickup_respawntimejitter_powerup);
#endif
ENDCLASS(Powerup)
// already defined
#endif
-#define GET(name) name##get
-#define GETTER(type, name) type GET(name)() { return name; }
-#define PROPERTY(type, name) type name; GETTER(type, name)
#define LAMBDA(...) { __VA_ARGS__; }
// With block may not contain continue or break
if(!this.respawntime) // both need to be set
{
if (def.m_respawntime)
- this.respawntime = def.m_respawntime();
+ this.respawntime = def.m_respawntime;
else
LOG_WARNF("Default respawntime for a %s is unavailable from its itemdef", this.classname);
if (def.m_respawntimejitter)
- this.respawntimejitter = def.m_respawntimejitter();
+ this.respawntimejitter = def.m_respawntimejitter;
else
LOG_WARNF("Default respawntimejitter for a %s is unavailable from its itemdef", this.classname);
}
{
if (wpn.spawnflags & WEP_FLAG_SUPERWEAPON)
{
- this.respawntime = g_pickup_respawntime_superweapon;
- this.respawntimejitter = g_pickup_respawntimejitter_superweapon;
+ this.respawntime = autocvar_g_pickup_respawntime_superweapon;
+ this.respawntimejitter = autocvar_g_pickup_respawntimejitter_superweapon;
}
else
{
- this.respawntime = g_pickup_respawntime_weapon;
- this.respawntimejitter = g_pickup_respawntimejitter_weapon;
+ this.respawntime = autocvar_g_pickup_respawntime_weapon;
+ this.respawntimejitter = autocvar_g_pickup_respawntimejitter_weapon;
}
}
#include <common/stats.qh>
bool autocvar_g_pickup_weapons_anyway;
+float autocvar_g_pickup_respawntime_superweapon;
+float autocvar_g_pickup_respawntimejitter_superweapon;
+float autocvar_g_pickup_respawntime_weapon;
+float autocvar_g_pickup_respawntimejitter_weapon;
string W_Apply_Weaponreplace(string in);
}
}
- g_pickup_respawntime_weapon = cvar("g_pickup_respawntime_weapon");
- g_pickup_respawntime_superweapon = cvar("g_pickup_respawntime_superweapon");
- g_pickup_respawntime_ammo = cvar("g_pickup_respawntime_ammo");
- g_pickup_respawntime_armor_small = cvar("g_pickup_respawntime_armor_small");
- g_pickup_respawntime_armor_medium = cvar("g_pickup_respawntime_armor_medium");
- g_pickup_respawntime_armor_big = cvar("g_pickup_respawntime_armor_big");
- g_pickup_respawntime_armor_mega = cvar("g_pickup_respawntime_armor_mega");
- g_pickup_respawntime_health_small = cvar("g_pickup_respawntime_health_small");
- g_pickup_respawntime_health_medium = cvar("g_pickup_respawntime_health_medium");
- g_pickup_respawntime_health_big = cvar("g_pickup_respawntime_health_big");
- g_pickup_respawntime_health_mega = cvar("g_pickup_respawntime_health_mega");
- g_pickup_respawntime_powerup = cvar("g_pickup_respawntime_powerup");
- g_pickup_respawntimejitter_weapon = cvar("g_pickup_respawntimejitter_weapon");
- g_pickup_respawntimejitter_superweapon = cvar("g_pickup_respawntimejitter_superweapon");
- g_pickup_respawntimejitter_ammo = cvar("g_pickup_respawntimejitter_ammo");
- g_pickup_respawntimejitter_armor_small = cvar("g_pickup_respawntimejitter_armor_small");
- g_pickup_respawntimejitter_armor_medium = cvar("g_pickup_respawntimejitter_armor_medium");
- g_pickup_respawntimejitter_armor_big = cvar("g_pickup_respawntimejitter_armor_big");
- g_pickup_respawntimejitter_armor_mega = cvar("g_pickup_respawntimejitter_armor_mega");
- g_pickup_respawntimejitter_health_small = cvar("g_pickup_respawntimejitter_health_small");
- g_pickup_respawntimejitter_health_medium = cvar("g_pickup_respawntimejitter_health_medium");
- g_pickup_respawntimejitter_health_big = cvar("g_pickup_respawntimejitter_health_big");
- g_pickup_respawntimejitter_health_mega = cvar("g_pickup_respawntimejitter_health_mega");
- g_pickup_respawntimejitter_powerup = cvar("g_pickup_respawntimejitter_powerup");
-
g_weapon_stay = cvar(strcat("g_", GetGametype(), "_weapon_stay"));
if(!g_weapon_stay)
g_weapon_stay = cvar("g_weapon_stay");