#ifdef REGISTER_WEAPON
-REGISTER_WEAPON(MINE_LAYER, w_minelayer, IT_ROCKETS, 4, WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_HIGH, "minelayer", "minelayer", _("Mine Layer"))
+REGISTER_WEAPON(MINE_LAYER, w_minelayer, IT_ROCKETS, 4, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_HIGH, "minelayer", "minelayer", _("Mine Layer"))
#else
#ifdef SVQC
void W_Mine_Think (void);
newmine.health = self.health;
newmine.event_damage = self.event_damage;
newmine.spawnshieldtime = self.spawnshieldtime;
+ newmine.damagedbycontents = TRUE;
newmine.movetype = MOVETYPE_NONE; // lock the mine in place
newmine.projectiledeathtype = self.projectiledeathtype;
float W_Mine_Count(entity e)
{
- float minecount;
+ float minecount = 0;
entity mine;
for(mine = world; (mine = find(mine, classname, "mine")); ) if(mine.realowner == e)
minecount += 1;
{
if (self.health <= 0)
return;
+
+ float is_from_enemy = (inflictor.realowner != self.realowner);
+
+ if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, (is_from_enemy ? 1 : -1)))
+ return; // g_projectiles_damage says to halt
+
self.health = self.health - damage;
self.angles = vectoangles(self.velocity);
+
if (self.health <= 0)
W_PrepareExplosionByDamage(attacker, W_Mine_Explode);
}
if(W_Mine_Count(self) >= autocvar_g_balance_minelayer_limit)
{
// the refire delay keeps this message from being spammed
- sprint(self, strcat("You cannot place more than ^2", ftos(autocvar_g_balance_minelayer_limit), " ^7mines at a time\n") );
+ sprint(self, strcat("minelayer: You cannot place more than ^2", ftos(autocvar_g_balance_minelayer_limit), " ^7mines at a time\n") );
play2(self, "weapons/unavailable.wav");
return;
}
mine.damageforcescale = autocvar_g_balance_minelayer_damageforcescale;
mine.health = autocvar_g_balance_minelayer_health;
mine.event_damage = W_Mine_Damage;
+ mine.damagedbycontents = TRUE;
mine.movetype = MOVETYPE_TOSS;
PROJECTILE_MAKETRIGGER(mine);
mine.nextthink = time;
mine.cnt = time + (autocvar_g_balance_minelayer_lifetime - autocvar_g_balance_minelayer_lifetime_countdown);
mine.flags = FL_PROJECTILE;
+ mine.missile_flags = MIF_SPLASH | MIF_ARC | MIF_PROXY;
CSQCProjectile(mine, TRUE, PROJECTILE_MINE, TRUE);
self.minelayer_mines = W_Mine_Count(self);
}
-void spawnfunc_weapon_minelayer (void); // defined in t_items.qc
-
float W_PlacedMines(float detonate)
{
entity mine;
- float minfound;
+ float minfound = 0;
for(mine = world; (mine = find(mine, classname, "mine")); ) if(mine.realowner == self)
{
W_Reload(autocvar_g_balance_minelayer_ammo, autocvar_g_balance_minelayer_reload_ammo, autocvar_g_balance_minelayer_reload_time, "weapons/reload.wav");
}
return TRUE;
-};
+}
#endif
#ifdef CSQC
float w_minelayer(float req)
precache_sound("weapons/mine_exp.wav");
}
else if (req == WR_SUICIDEMESSAGE)
- w_deathtypestring = _("%s exploded");
+ if(w_deathtype & HITTYPE_BOUNCE) // (remote detonation)
+ w_deathtypestring = _("%s blew themself up with their minelayer");
+ else
+ w_deathtypestring = _("%s forgot about their mine");
else if (req == WR_KILLMESSAGE)
{
if(w_deathtype & HITTYPE_BOUNCE) // (remote detonation)