+float have_pickup_item(void)
+{
+ // minstagib: only allow filtered items
+ if(g_minstagib)
+ if(self.classname != "minstagib")
+ return FALSE;
+
+ if(self.items == IT_STRENGTH || self.items == IT_INVINCIBLE)
+ {
+ if(autocvar_g_powerups > 0)
+ return TRUE;
+ if(autocvar_g_powerups == 0)
+ return FALSE;
+ if(g_lms)
+ return FALSE;
+ if(g_ca)
+ return FALSE;
+ if(g_arena)
+ return FALSE;
+ }
+ else
+ {
+ if(autocvar_g_pickup_items > 0)
+ return TRUE;
+ if(autocvar_g_pickup_items == 0)
+ return FALSE;
+ if(g_lms)
+ return FALSE;
+ if(g_ca)
+ return FALSE;
+ if(g_weaponarena)
+ if((self.weapons & WEPBIT_ALL) || (self.items & IT_AMMO))
+ return FALSE;
+ }
+ return TRUE;
+}
+
#define ITEM_RESPAWN_TICKS 10
#define ITEM_RESPAWNTIME(i) ((i).respawntime + crandom() * (i).respawntimejitter)
// pickup evaluation functions
// these functions decide how desirable an item is to the bots
-float generic_pickupevalfunc(entity player, entity item) {return item.bot_pickupbasevalue;};
+float generic_pickupevalfunc(entity player, entity item) {return item.bot_pickupbasevalue;}
float weapon_pickupevalfunc(entity player, entity item)
{
}
return item.bot_pickupbasevalue * c;
-};
+}
float commodity_pickupevalfunc(entity player, entity item)
{
c = c + max(0, 1 - player.health / item.max_health);
return item.bot_pickupbasevalue * c;
-};
+}
.float is_item;
return;
}
+ if(!have_pickup_item())
+ {
+ startitem_failed = TRUE;
+ remove (self);
+ return;
+ }
+
self.reset = Item_Reset;
// it's a level item
if(self.spawnflags & 1)
self.is_item = TRUE;
}
- if(g_lms || g_ca)
- {
- startitem_failed = TRUE;
- remove(self);
- return;
- }
- else if (g_weaponarena && ((weaponid & WEPBIT_ALL) || (itemid & IT_AMMO)))
- {
- startitem_failed = TRUE;
- remove(self);
- return;
- }
- else if (g_minstagib)
- {
- // don't remove dropped items and powerups
- if (self.classname != "minstagib")
- {
- startitem_failed = TRUE;
- remove (self);
- return;
- }
- }
- else if (!autocvar_g_pickup_items && itemid != IT_STRENGTH && itemid != IT_INVINCIBLE && itemid != IT_HEALTH)
- {
- startitem_failed = TRUE;
- remove (self);
- return;
- }
-
weaponsInMap |= weaponid;
precache_model (itemmodel);
*/
void minstagib_items (float itemid)
{
- local float rnd;
+ float rnd;
self.classname = "minstagib";
// replace rocket launchers and nex guns with ammo cells
}
void spawnfunc_item_health_mega (void) {
- if(!autocvar_g_powerup_superhealth)
- return;
-
- if((g_arena || g_ca) && !autocvar_g_arena_powerups)
- return;
-
if(g_minstagib) {
minstagib_items(IT_NAILS);
} else {
void spawnfunc_item_health100() { spawnfunc_item_health_mega(); }
void spawnfunc_item_strength (void) {
- if(!autocvar_g_powerup_strength)
- return;
-
- if((g_arena || g_ca) && !autocvar_g_arena_powerups)
- return;
-
if(g_minstagib) {
minstagib_items(IT_STRENGTH);
} else {
}
void spawnfunc_item_invincible (void) {
- if(!autocvar_g_powerup_shield)
- return;
-
- if((g_arena || g_ca) && !autocvar_g_arena_powerups)
- return;
-
if(g_minstagib) {
minstagib_items(IT_INVINCIBLE);
} else {