#include "../../common/items/all.qc"
void spawnfunc_item_minst_cells (void)
-{
+{SELFPARAM();
if (!g_instagib) { remove(self); return; }
if (!self.ammo_cells)
self.ammo_cells = autocvar_g_instagib_ammo_drop;
}
void instagib_health_mega()
-{
+{SELFPARAM();
self.max_health = 1;
StartItemA (ITEM_ExtraLife);
}
e.instagib_needammo = false;
}
void instagib_ammocheck()
-{
+{SELFPARAM();
if(time < self.instagib_nextthink)
return;
if(!IS_PLAYER(self))
}
MUTATOR_HOOKFUNCTION(instagib_MonsterSpawn)
-{
+{SELFPARAM();
// always refill ammo
if(self.monsterid == MON_MAGE.monsterid)
self.skin = 1;
}
MUTATOR_HOOKFUNCTION(instagib_MakePlayerObserver)
-{
+{SELFPARAM();
instagib_stop_countdown(self);
return false;
}
MUTATOR_HOOKFUNCTION(instagib_PlayerSpawn)
-{
+{SELFPARAM();
self.effects |= EF_FULLBRIGHT;
return false;
}
}
MUTATOR_HOOKFUNCTION(instagib_PlayerPowerups)
-{
+{SELFPARAM();
if (!(self.effects & EF_FULLBRIGHT))
self.effects |= EF_FULLBRIGHT;
}
MUTATOR_HOOKFUNCTION(instagib_PlayerPhysics)
-{
+{SELFPARAM();
if(self.items & ITEM_Shield.m_itemid)
self.stat_sv_maxspeed = self.stat_sv_maxspeed * autocvar_g_instagib_speed_highspeed;
if(IS_PLAYER(frag_target))
{
- if ((frag_deathtype == DEATH_FALL) ||
- (frag_deathtype == DEATH_DROWN) ||
- (frag_deathtype == DEATH_SLIME) ||
- (frag_deathtype == DEATH_LAVA))
+ if(frag_deathtype == DEATH_FALL)
+ frag_damage = 0; // never count fall damage
+
+ if(!autocvar_g_instagib_damagedbycontents)
+ switch(frag_deathtype)
{
- frag_damage = 0;
+ case DEATH_DROWN:
+ case DEATH_SLIME:
+ case DEATH_LAVA:
+ frag_damage = 0;
+ break;
}
if(IS_PLAYER(frag_attacker))
{
if(frag_deathtype & HITTYPE_SECONDARY)
{
- frag_damage = frag_mirrordamage = 0;
+ if(!autocvar_g_instagib_blaster_keepdamage)
+ frag_damage = frag_mirrordamage = 0;
if(frag_target != frag_attacker)
{
- if(frag_target.health > 0) { Send_Notification(NOTIF_ONE, frag_attacker, MSG_CENTER, CENTER_SECONDARY_NODAMAGE); }
- frag_force = '0 0 0';
+ if(frag_damage <= 0 && frag_target.health > 0) { Send_Notification(NOTIF_ONE, frag_attacker, MSG_CENTER, CENTER_SECONDARY_NODAMAGE); }
+ if(!autocvar_g_instagib_blaster_keepforce)
+ frag_force = '0 0 0';
}
}
}
{
frag_attacker.armorvalue -= 1;
Send_Notification(NOTIF_ONE, frag_attacker, MSG_CENTER, CENTER_INSTAGIB_LIVES_REMAINING, frag_attacker.armorvalue);
- frag_attacker.damage_dealt += 1;
+ frag_attacker.damage_dealt += frag_mirrordamage;
}
frag_mirrordamage = 0;
}
}
MUTATOR_HOOKFUNCTION(instagib_FilterItem)
-{
+{SELFPARAM();
if(self.classname == "item_cells")
return true; // no normal cells?
{
entity e = spawn();
setorigin(e, self.origin);
- entity oldself;
- oldself = self;
- self = e;
- spawnfunc_item_minst_cells();
- self = oldself;
+ e.noalign = self.noalign;
+ e.cnt = self.cnt;
+ e.team = self.team;
+ WITH(entity, self, e, spawnfunc_item_minst_cells());
return true;
}
}
MUTATOR_HOOKFUNCTION(instagib_CustomizeWaypoint)
-{
+{SELFPARAM();
entity e = WaypointSprite_getviewentity(other);
// if you have the invisibility powerup, sprites ALWAYS are restricted to your team
}
MUTATOR_HOOKFUNCTION(instagib_ItemCountdown)
-{
+{SELFPARAM();
switch (self.items)
{
case ITEM_Strength.m_itemid: item_name = "item-invis"; item_color = '0 0 1'; break;
return false;
}
+MUTATOR_HOOKFUNCTION(instagib_PlayerDies)
+{
+ if(DEATH_ISWEAPON(frag_deathtype, WEP_VAPORIZER.m_id))
+ frag_damage = 1000; // always gib if it was a vaporizer death
+
+ return FALSE;
+}
+
MUTATOR_HOOKFUNCTION(instagib_ItemTouch)
-{
+{SELFPARAM();
if(self.ammo_cells)
{
// play some cool sounds ;)
}
MUTATOR_HOOKFUNCTION(instagib_OnEntityPreSpawn)
-{
+{SELFPARAM();
if (!autocvar_g_powerups) { return false; }
if (!(self.classname == "item_strength" || self.classname == "item_invincible" || self.itemdef == ITEM_HealthMega))
return false;
MUTATOR_HOOK(FilterItem, instagib_FilterItem, CBC_ORDER_ANY);
MUTATOR_HOOK(CustomizeWaypoint, instagib_CustomizeWaypoint, CBC_ORDER_ANY);
MUTATOR_HOOK(Item_RespawnCountdown, instagib_ItemCountdown, CBC_ORDER_ANY);
+ MUTATOR_HOOK(PlayerDies, instagib_PlayerDies, CBC_ORDER_ANY);
MUTATOR_HOOK(PlayerDamage_SplitHealthArmor, instagib_SplitHealthArmor, CBC_ORDER_ANY);
MUTATOR_HOOK(PlayerPowerups, instagib_PlayerPowerups, CBC_ORDER_ANY);
MUTATOR_HOOK(ForbidThrowCurrentWeapon, instagib_ForbidThrowing, CBC_ORDER_ANY);