]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/w_minelayer.qc
Merge branch 'master' into terencehill/ca_arena_mutators
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / w_minelayer.qc
index 03c2651289418644b01006f2f62ef30c42a06a78..1b4f7c6cd06aa232811c06b67617006ba6f031d2 100644 (file)
@@ -1,5 +1,5 @@
 #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);
@@ -45,7 +45,7 @@ void W_Mine_Stick (entity to)
 
        newmine.mine_time = self.mine_time;
 
-       newmine.touch = SUB_Null;
+       newmine.touch = func_null;
        newmine.think = W_Mine_Think;
        newmine.nextthink = time;
        newmine.cnt = self.cnt;
@@ -67,7 +67,7 @@ void W_Mine_Explode ()
                                        if(IsFlying(other))
                                                AnnounceTo(self.realowner, "airshot");
 
-       self.event_damage = SUB_Null;
+       self.event_damage = func_null;
        self.takedamage = DAMAGE_NO;
 
        RadiusDamage (self, self.realowner, autocvar_g_balance_minelayer_damage, autocvar_g_balance_minelayer_edgedamage, autocvar_g_balance_minelayer_radius, world, autocvar_g_balance_minelayer_force, self.projectiledeathtype, other);
@@ -91,7 +91,7 @@ void W_Mine_Explode ()
 
 void W_Mine_DoRemoteExplode ()
 {
-       self.event_damage = SUB_Null;
+       self.event_damage = func_null;
        self.takedamage = DAMAGE_NO;
 
        if(self.movetype == MOVETYPE_NONE || self.movetype == MOVETYPE_FOLLOW)
@@ -149,7 +149,7 @@ void W_Mine_ProximityExplode ()
 
 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;
@@ -267,7 +267,7 @@ void W_Mine_Attack (void)
                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;
                }
@@ -308,6 +308,7 @@ void W_Mine_Attack (void)
        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);
 
@@ -325,12 +326,10 @@ void W_Mine_Attack (void)
        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)
        {
@@ -529,7 +528,10 @@ 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)