e.model = e.mdl;
e.solid = SOLID_NOT;
e.colormod = stov(cvar_string("g_ghost_items_color"));
- self.glowmod = self.colormod;
+ e.glowmod = e.colormod;
e.alpha = g_ghost_items;
e.customizeentityforclient = func_null;
e.model = string_null;
e.solid = SOLID_NOT;
e.colormod = stov(cvar_string("g_ghost_items_color"));
- self.glowmod = self.colormod;
+ e.glowmod = e.colormod;
e.alpha = 0;
e.customizeentityforclient = func_null;
void Item_ScheduleRespawn(entity e)
{
- Item_Show(e, 0);
- Item_ScheduleRespawnIn(e, ITEM_RESPAWNTIME(e));
+ if(e.respawntime > 0)
+ {
+ Item_Show(e, 0);
+ Item_ScheduleRespawnIn(e, ITEM_RESPAWNTIME(e));
+ }
+ else // if respawntime is -1, this item does not respawn
+ Item_Show(e, -1);
}
void Item_ScheduleInitialRespawn(entity e)
pickedup = TRUE;
// sound not available
// AnnounceTo(player, "_lives");
- player.armorvalue = player.armorvalue + cvar("g_minstagib_extralives");
+ player.armorvalue = min(player.armorvalue + cvar("g_minstagib_extralives"), 999);
sprint(player, "^3You picked up some extra lives\n");
}
else
precache_sound ("misc/itemrespawn.wav");
- if((itemid & (IT_STRENGTH | IT_INVINCIBLE | IT_HEALTH | IT_ARMOR | IT_KEY1 | IT_KEY2)) || (weaponid & WEPBIT_ALL))
+ if((itemflags & (FL_POWERUP | FL_WEAPON)) || (itemid & (IT_HEALTH | IT_ARMOR | IT_KEY1 | IT_KEY2)))
self.target = "###item###"; // for finding the nearest item using find()
}
*/
void minstagib_items (float itemid)
{
- // we don't want to replace dropped weapons ;)
- if (self.classname == "droppedweapon")
- {
- self.ammo_cells = 25;
- StartItem ("models/weapons/g_nex.md3",
- "weapons/weaponpickup.wav", 15, 0,
- "MinstaNex", 0, WEPBIT_MINSTANEX, FL_WEAPON, generic_pickupevalfunc, 1000);
- return;
- }
-
local float rnd;
self.classname = "minstagib";
{
if (g_minstagib)
{
- minstagib_items(IT_CELLS);
+ minstagib_items(IT_CELLS); // replace rocketlauncher with cells
self.think = minst_remove_item;
self.nextthink = time;
return;
self.max_armorvalue = g_pickup_armorsmall_max;
if(!self.pickup_anyway)
self.pickup_anyway = g_pickup_armorsmall_anyway;
- StartItem ("models/items/g_a1.md3", "misc/armor1.wav", g_pickup_respawntime_short, g_pickup_respawntimejitter_short, "5 Armor", IT_ARMOR_SHARD, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_LOW);
+ StartItem ("models/items/item_armor_small.md3", "misc/armor1.wav", g_pickup_respawntime_short, g_pickup_respawntimejitter_short, "5 Armor", IT_ARMOR_SHARD, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_LOW);
}
void spawnfunc_item_armor_medium (void) {
self.max_armorvalue = g_pickup_armormedium_max;
if(!self.pickup_anyway)
self.pickup_anyway = g_pickup_armormedium_anyway;
- StartItem ("models/items/g_armormedium.md3", "misc/armor10.wav", g_pickup_respawntime_medium, g_pickup_respawntimejitter_medium, "25 Armor", IT_ARMOR, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_MID);
+ StartItem ("models/items/item_armor_medium.md3", "misc/armor10.wav", g_pickup_respawntime_medium, g_pickup_respawntimejitter_medium, "25 Armor", IT_ARMOR, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_MID);
}
void spawnfunc_item_armor_big (void) {
self.max_armorvalue = g_pickup_armorbig_max;
if(!self.pickup_anyway)
self.pickup_anyway = g_pickup_armorbig_anyway;
- StartItem ("models/items/g_a50.md3", "misc/armor17_5.wav", g_pickup_respawntime_long, g_pickup_respawntimejitter_long, "50 Armor", IT_ARMOR, 0, 0, commodity_pickupevalfunc, 20000);
+ StartItem ("models/items/item_armor_big.md3", "misc/armor17_5.wav", g_pickup_respawntime_long, g_pickup_respawntimejitter_long, "50 Armor", IT_ARMOR, 0, 0, commodity_pickupevalfunc, 20000);
}
void spawnfunc_item_armor_large (void) {
self.max_armorvalue = g_pickup_armorlarge_max;
if(!self.pickup_anyway)
self.pickup_anyway = g_pickup_armorlarge_anyway;
- StartItem ("models/items/g_a25.md3", "misc/armor25.wav", g_pickup_respawntime_long, g_pickup_respawntimejitter_long, "100 Armor", IT_ARMOR, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_HIGH);
+ StartItem ("models/items/item_armor_large.md3", "misc/armor25.wav", g_pickup_respawntime_long, g_pickup_respawntimejitter_long, "100 Armor", IT_ARMOR, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_HIGH);
}
void spawnfunc_item_health_small (void) {
POSTGIVE_VALUE_ROT(e, armorvalue, 1, pauserotarmor_finished, cvar("g_balance_pause_armor_rot"), pauseregen_finished, cvar("g_balance_pause_health_regen"), "misc/armor25.wav", string_null);
POSTGIVE_VALUE_ROT(e, health, 1, pauserothealth_finished, cvar("g_balance_pause_health_rot"), pauseregen_finished, cvar("g_balance_pause_health_regen"), "misc/megahealth.wav", string_null);
+ if (g_minstagib)
+ {
+ e.health = bound(0, e.health, 100);
+ e.armorvalue = bound(0, e.armorvalue, 999);
+ }
+
if(e.strength_finished <= 0)
e.strength_finished = 0;
else