#include "sv_instagib.qh"
-int autocvar_g_instagib_ammo_drop;
+//int autocvar_g_instagib_ammo_drop;
+bool autocvar_g_instagib_ammo_convert_cells;
+bool autocvar_g_instagib_ammo_convert_rockets;
+bool autocvar_g_instagib_ammo_convert_shells;
+bool autocvar_g_instagib_ammo_convert_bullets;
int autocvar_g_instagib_extralives;
float autocvar_g_instagib_speed_highspeed;
spawnfunc(item_minst_cells)
{
if (!g_instagib) { delete(this); return; }
- if (!this.ammo_cells) this.ammo_cells = autocvar_g_instagib_ammo_drop;
StartItem(this, ITEM_VaporizerCells);
}
if(!IS_PLAYER(this))
return; // not a player
- if(IS_DEAD(this) || gameover)
+ if(IS_DEAD(this) || game_stopped)
instagib_stop_countdown(this);
else if (this.ammo_cells > 0 || (this.items & IT_UNLIMITED_WEAPON_AMMO) || (this.flags & FL_GODMODE))
instagib_stop_countdown(this);
{
entity item = M_ARGV(1, entity);
- item.monster_loot = spawnfunc_item_minst_cells;
+ item.monster_loot = ITEM_VaporizerCells;
}
MUTATOR_HOOKFUNCTION(mutator_instagib, MonsterSpawn)
return true;
}
-MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerDamage_Calculate)
+MUTATOR_HOOKFUNCTION(mutator_instagib, Damage_Calculate)
{
entity frag_attacker = M_ARGV(1, entity);
entity frag_target = M_ARGV(2, entity);
start_ammo_cells = warmup_start_ammo_cells = cvar("g_instagib_ammo_start");
start_ammo_plasma = warmup_start_ammo_plasma = 0;
start_ammo_rockets = warmup_start_ammo_rockets = 0;
- start_ammo_fuel = warmup_start_ammo_fuel = 0;
+ //start_ammo_fuel = warmup_start_ammo_fuel = 0;
start_weapons = warmup_start_weapons = WEPSET(VAPORIZER);
start_items |= IT_UNLIMITED_SUPERWEAPONS;
}
+MUTATOR_HOOKFUNCTION(mutator_instagib, SetWeaponArena)
+{
+ // turn weapon arena off
+ M_ARGV(0, string) = "off";
+}
+
+void replace_with_insta_cells(entity item)
+{
+ entity e = spawn();
+ setorigin(e, item.origin);
+ e.noalign = item.noalign;
+ e.cnt = item.cnt;
+ e.team = item.team;
+ e.spawnfunc_checked = true;
+ spawnfunc_item_minst_cells(e);
+}
+
MUTATOR_HOOKFUNCTION(mutator_instagib, FilterItem)
{
entity item = M_ARGV(0, entity);
if(item.classname == "item_cells")
- return true; // no normal cells?
+ {
+ if(autocvar_g_instagib_ammo_convert_cells)
+ {
+ replace_with_insta_cells(item);
+ }
+ return true;
+ }
+ else if(item.classname == "item_rockets")
+ {
+ if(autocvar_g_instagib_ammo_convert_rockets)
+ {
+ replace_with_insta_cells(item);
+ }
+ return true;
+ }
+ else if(item.classname == "item_shells")
+ {
+ if(autocvar_g_instagib_ammo_convert_shells)
+ {
+ replace_with_insta_cells(item);
+ }
+ return true;
+ }
+ else if(item.classname == "item_bullets")
+ {
+ if(autocvar_g_instagib_ammo_convert_bullets)
+ {
+ replace_with_insta_cells(item);
+ }
+ return true;
+ }
if(item.weapon == WEP_VAPORIZER.m_id && item.classname == "droppedweapon")
{
if(item.weapon == WEP_DEVASTATOR.m_id || item.weapon == WEP_VORTEX.m_id)
{
- entity e = spawn();
- setorigin(e, item.origin);
- e.noalign = item.noalign;
- e.cnt = item.cnt;
- e.team = item.team;
- e.spawnfunc_checked = true;
- spawnfunc_item_minst_cells(e);
+ replace_with_insta_cells(item);
return true;
}