+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)
{
Item_Show(self, 1);
if(!g_minstagib && self.items == IT_STRENGTH)
- asound (self, CH_TRIGGER, "misc/strength_respawn.wav", VOL_BASE, ATTN_NORM); // play respawn sound
+ sound (self, CH_TRIGGER, "misc/strength_respawn.wav", VOL_BASE, ATTN_NORM); // play respawn sound
else if(!g_minstagib && self.items == IT_INVINCIBLE)
- asound (self, CH_TRIGGER, "misc/shield_respawn.wav", VOL_BASE, ATTN_NORM); // play respawn sound
+ sound (self, CH_TRIGGER, "misc/shield_respawn.wav", VOL_BASE, ATTN_NORM); // play respawn sound
else
- asound (self, CH_TRIGGER, "misc/itemrespawn.wav", VOL_BASE, ATTN_NORM); // play respawn sound
+ sound (self, CH_TRIGGER, "misc/itemrespawn.wav", VOL_BASE, ATTN_NORM); // play respawn sound
setorigin (self, self.origin);
//pointparticles(particleeffectnum("item_respawn"), self.origin + self.mins_z * '0 0 1' + '0 0 48', '0 0 0', 1);
WaypointSprite_UpdateBuildFinished(self.waypointsprite_attached, time + ITEM_RESPAWN_TICKS);
}
}
- asound (self, CH_TRIGGER, "misc/itemrespawncountdown.wav", VOL_BASE, ATTN_NORM); // play respawn sound
+ sound (self, CH_TRIGGER, "misc/itemrespawncountdown.wav", VOL_BASE, ATTN_NORM); // play respawn sound
if(self.waypointsprite_attached)
{
WaypointSprite_Ping(self.waypointsprite_attached);
{
pickedup = TRUE;
// play some cool sounds ;)
- centerprint(player, "\n");
if (clienttype(player) == CLIENTTYPE_REAL)
{
if(player.health <= 5)
}
if (item.flags & FL_WEAPON)
- if ((it = item.weapons - (item.weapons & player.weapons)) || (g_pickup_weapons_anyway && !(g_weapon_stay == 3 && !e.spawnshieldtime)))
+ if ((it = item.weapons - (item.weapons & player.weapons)) || (g_pickup_weapons_anyway && g_weapon_stay == 0))
{
pickedup = TRUE;
for(i = WEP_FIRST; i <= WEP_LAST; ++i)
if (!pickedup)
return 0;
- asound (player, CH_TRIGGER, item.item_pickupsound, VOL_BASE, ATTN_NORM);
+ sound (player, CH_TRIGGER, item.item_pickupsound, VOL_BASE, ATTN_NORM);
if (_switchweapon)
if (player.switchweapon != w_getbestweapon(player))
W_SwitchWeapon_Force(player, w_getbestweapon(player));
// 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_weapon_shotgun (void);
void spawnfunc_weapon_uzi (void) {
- if(q3acompat_machineshotgunswap)
+ if(autocvar_sv_q3acompat_machineshotgunswap)
if(self.classname != "droppedweapon")
{
weapon_defaultspawnfunc(WEP_SHOTGUN);
}
void spawnfunc_weapon_shotgun (void) {
- if(q3acompat_machineshotgunswap)
+ if(autocvar_sv_q3acompat_machineshotgunswap)
if(self.classname != "droppedweapon")
{
weapon_defaultspawnfunc(WEP_UZI);
void spawnfunc_item_shells (void);
void spawnfunc_item_bullets (void) {
if(!weaponswapping)
- if(q3acompat_machineshotgunswap)
+ if(autocvar_sv_q3acompat_machineshotgunswap)
if(self.classname != "droppedweapon")
{
weaponswapping = TRUE;
void spawnfunc_item_shells (void) {
if(!weaponswapping)
- if(q3acompat_machineshotgunswap)
+ if(autocvar_sv_q3acompat_machineshotgunswap)
if(self.classname != "droppedweapon")
{
weaponswapping = TRUE;
}
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 {
if(v1 <= v0 - t)
{
if(snd_decr != "")
- asound (e, CH_TRIGGER, snd_decr, VOL_BASE, ATTN_NORM);
+ sound (e, CH_TRIGGER, snd_decr, VOL_BASE, ATTN_NORM);
}
else if(v0 >= v0 + t)
{
if(snd_incr != "")
- asound (e, CH_TRIGGER, snd_incr, VOL_BASE, ATTN_NORM);
+ sound (e, CH_TRIGGER, snd_incr, VOL_BASE, ATTN_NORM);
}
}