]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Weapons: fix accuracy panel and hide the internal weapons
authorTimePath <andrew.hardaker1995@gmail.com>
Fri, 2 Oct 2015 22:29:14 +0000 (08:29 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Fri, 2 Oct 2015 22:29:14 +0000 (08:29 +1000)
19 files changed:
qcsrc/client/hud.qc
qcsrc/client/scoreboard.qc
qcsrc/common/monsters/monster/mage.qc
qcsrc/common/monsters/monster/spider.qc
qcsrc/common/monsters/monster/wyvern.qc
qcsrc/common/turrets/turret/ewheel_weapon.qc
qcsrc/common/turrets/turret/flac_weapon.qc
qcsrc/common/turrets/turret/hellion_weapon.qc
qcsrc/common/turrets/turret/hk_weapon.qc
qcsrc/common/turrets/turret/machinegun_weapon.qc
qcsrc/common/turrets/turret/mlrs_weapon.qc
qcsrc/common/turrets/turret/phaser_weapon.qc
qcsrc/common/turrets/turret/plasma_weapon.qc
qcsrc/common/turrets/turret/tesla_weapon.qc
qcsrc/common/turrets/turret/walker_weapon.qc
qcsrc/common/vehicles/vehicle/racer_weapon.qc
qcsrc/common/vehicles/vehicle/raptor_weapons.qc
qcsrc/server/mutators/gamemode_nexball.qc
qcsrc/server/mutators/gamemode_nexball_weapon.qc

index 9a0f87b944a56dfe49d3ce222976c748e6efa0ca..1b762f82d0422d98776f92d4f2c7763d563ff737 100644 (file)
@@ -441,7 +441,7 @@ void HUD_Weapons(void)
                if(cvar("wep_add"))
                {
                        weapons_stat = '0 0 0';
-                       float countw = 1 + floor((floor(time * cvar("wep_add"))) % WEP_COUNT);
+                       float countw = 1 + floor((floor(time * cvar("wep_add"))) % (WEP_COUNT - 1));
                        for(i = WEP_FIRST; i <= countw; ++i)
                                weapons_stat |= WepSet_FromWeapon(i);
                }
@@ -472,7 +472,7 @@ void HUD_Weapons(void)
                vector padded_panel_size = panel_size - '2 2 0' * panel_bg_padding;
 
                // get the all-weapons layout
-               vector table_size = HUD_GetTableSize_BestItemAR(WEP_COUNT, padded_panel_size, aspect);
+               vector table_size = HUD_GetTableSize_BestItemAR((WEP_COUNT - 1), padded_panel_size, aspect);
                columns = table_size.x;
                rows = table_size.y;
                weapon_size.x = padded_panel_size.x / columns;
@@ -527,7 +527,7 @@ void HUD_Weapons(void)
                        panel_pos.y += (old_panel_size.y - panel_size.y) / 2;
        }
        else
-               weapon_count = WEP_COUNT;
+               weapon_count = (WEP_COUNT - 1);
 
        // animation for fading in/out the panel respectively when not in use
        if(!autocvar__hud_configure)
@@ -632,7 +632,7 @@ void HUD_Weapons(void)
 
        if(!rows) // if rows is > 0 onlyowned code has already updated these vars
        {
-               vector table_size = HUD_GetTableSize_BestItemAR(WEP_COUNT, panel_size, aspect);
+               vector table_size = HUD_GetTableSize_BestItemAR((WEP_COUNT - 1), panel_size, aspect);
                columns = table_size.x;
                rows = table_size.y;
                weapon_size.x = panel_size.x / columns;
index 407c087470ab8dfde6f9d21db71fed1169ba8ff8..3c331fd49470424ca4e81a2dd968bc855a250d5b 100644 (file)
@@ -994,13 +994,13 @@ vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size)
                        ++disownedcnt;
        }
 
-       int weapon_cnt = WEP_COUNT - disownedcnt;
+       int weapon_cnt = (WEP_COUNT - 1) - disownedcnt;
 
        if(weapon_cnt <= 0)
                return pos;
 
        int rows;
-       if(autocvar_scoreboard_accuracy_doublerows && weapon_cnt >= floor(WEP_COUNT * 0.5))
+       if(autocvar_scoreboard_accuracy_doublerows && weapon_cnt >= floor((WEP_COUNT - 1) * 0.5))
                rows = 2;
        else
                rows = 1;
index 0ae830c1eb92cba7c20681d7f890e48425a872e0..63ebffc9c054f41938637c6346f433e0bdf46703 100644 (file)
@@ -25,7 +25,7 @@ REGISTER_MONSTER(MAGE, NEW(Mage)) {
 #include "../../weapons/all.qh"
 
 CLASS(MageSpike, PortoLaunch)
-/* flags     */ ATTRIB(MageSpike, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN);
+/* flags     */ ATTRIB(MageSpike, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
 /* impulse   */ ATTRIB(MageSpike, impulse, int, 9);
 /* refname   */ ATTRIB(MageSpike, netname, string, "magespike");
 /* wepname   */ ATTRIB(MageSpike, message, string, _("Mage spike"));
index b3ebeeac689b36f832a0a855f583fb89021c3464..539e66ad2058cc387bba14dc5dc2659f8059c37c 100644 (file)
@@ -25,7 +25,7 @@ REGISTER_MONSTER(SPIDER, NEW(Spider)) {
 #include "../../weapons/all.qh"
 
 CLASS(SpiderAttack, PortoLaunch)
-/* flags     */ ATTRIB(SpiderAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN);
+/* flags     */ ATTRIB(SpiderAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
 /* impulse   */ ATTRIB(SpiderAttack, impulse, int, 9);
 /* refname   */ ATTRIB(SpiderAttack, netname, string, "spider");
 /* wepname   */ ATTRIB(SpiderAttack, message, string, _("Spider attack"));
index 74449c7153d64bdb2c041fa577de9ba4edf38b11..17b0a96d7bab0991ae8478f3e077739ebc11dca1 100644 (file)
@@ -25,7 +25,7 @@ REGISTER_MONSTER(WYVERN, NEW(Wyvern)) {
 #include "../../weapons/all.qh"
 
 CLASS(WyvernAttack, PortoLaunch)
-/* flags     */ ATTRIB(WyvernAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN);
+/* flags     */ ATTRIB(WyvernAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
 /* impulse   */ ATTRIB(WyvernAttack, impulse, int, 9);
 /* refname   */ ATTRIB(WyvernAttack, netname, string, "wyvern");
 /* wepname   */ ATTRIB(WyvernAttack, message, string, _("Wyvern attack"));
index 13ca1e11a96f24a488b3ba568c75119709f35735..2e8e8dc29d1ae87ec6a11a97a38e63483d5f53e9 100644 (file)
@@ -2,7 +2,7 @@
 #define TURRET_EWHEEL_WEAPON_H
 
 CLASS(EWheelAttack, PortoLaunch)
-/* flags     */ ATTRIB(EWheelAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN);
+/* flags     */ ATTRIB(EWheelAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
 /* impulse   */ ATTRIB(EWheelAttack, impulse, int, 5);
 /* refname   */ ATTRIB(EWheelAttack, netname, string, "turret_ewheel");
 /* wepname   */ ATTRIB(EWheelAttack, message, string, _("eWheel"));
index fd59b8d0cf1c68765179c23989ec8a80fb311f6c..31bc7cb7b3d663c2964ac319c2386fbc23c8c0ae 100644 (file)
@@ -2,7 +2,7 @@
 #define TURRET_FLAC_WEAPON_H
 
 CLASS(FlacAttack, PortoLaunch)
-/* flags     */ ATTRIB(FlacAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN);
+/* flags     */ ATTRIB(FlacAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
 /* impulse   */ ATTRIB(FlacAttack, impulse, int, 5);
 /* refname   */ ATTRIB(FlacAttack, netname, string, "turret_flac");
 /* wepname   */ ATTRIB(FlacAttack, message, string, _("FLAC"));
index 6e76f27fe4c45fcad809fd7f325347b628e2aa14..0503cbd90a03d4275e0961e6f18103b75cc2c516 100644 (file)
@@ -2,7 +2,7 @@
 #define TURRET_HELLION_WEAPON_H
 
 CLASS(HellionAttack, PortoLaunch)
-/* flags     */ ATTRIB(HellionAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN);
+/* flags     */ ATTRIB(HellionAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
 /* impulse   */ ATTRIB(HellionAttack, impulse, int, 9);
 /* refname   */ ATTRIB(HellionAttack, netname, string, "turret_hellion");
 /* wepname   */ ATTRIB(HellionAttack, message, string, _("Hellion"));
index 313b0f193f60bd225f99ec41797e836b0c98efb0..51ce0d98304f0928cf29c1b596949c1be76df138 100644 (file)
@@ -2,7 +2,7 @@
 #define TURRET_HK_WEAPON_H
 
 CLASS(HunterKillerAttack, PortoLaunch)
-/* flags     */ ATTRIB(HunterKillerAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN);
+/* flags     */ ATTRIB(HunterKillerAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
 /* impulse   */ ATTRIB(HunterKillerAttack, impulse, int, 9);
 /* refname   */ ATTRIB(HunterKillerAttack, netname, string, "turret_hk");
 /* wepname   */ ATTRIB(HunterKillerAttack, message, string, _("Hunter-Killer"));
index d8993a3ed6ad2c4a4e6307aad9cc7f2aacd7fedf..264053fb61374147f6e71d2ff4eee9c742d6ac55 100644 (file)
@@ -2,7 +2,7 @@
 #define TURRET_MACHINEGUN_WEAPON_H
 
 CLASS(MachineGunTurretAttack, PortoLaunch)
-/* flags     */ ATTRIB(MachineGunTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN);
+/* flags     */ ATTRIB(MachineGunTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
 /* impulse   */ ATTRIB(MachineGunTurretAttack, impulse, int, 9);
 /* refname   */ ATTRIB(MachineGunTurretAttack, netname, string, "turret_machinegun");
 /* wepname   */ ATTRIB(MachineGunTurretAttack, message, string, _("Machinegun"));
index bc9a94e91d07c533e8422591344578016d8f6095..f2d442df8c251ebacd84bd7ea097ba3f214c6349 100644 (file)
@@ -2,7 +2,7 @@
 #define TURRET_MLRS_WEAPON_H
 
 CLASS(MLRSTurretAttack, PortoLaunch)
-/* flags     */ ATTRIB(MLRSTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN);
+/* flags     */ ATTRIB(MLRSTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
 /* impulse   */ ATTRIB(MLRSTurretAttack, impulse, int, 9);
 /* refname   */ ATTRIB(MLRSTurretAttack, netname, string, "turret_mlrs");
 /* wepname   */ ATTRIB(MLRSTurretAttack, message, string, _("MLRS"));
index e8e4f1428d40a9f3ee176b0a3b7b9df3265f5809..aa71a47d008c08eac2cb62139a4c7170c566936c 100644 (file)
@@ -2,7 +2,7 @@
 #define TURRET_PHASER_WEAPON_H
 
 CLASS(PhaserTurretAttack, PortoLaunch)
-/* flags     */ ATTRIB(PhaserTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN);
+/* flags     */ ATTRIB(PhaserTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
 /* impulse   */ ATTRIB(PhaserTurretAttack, impulse, int, 9);
 /* refname   */ ATTRIB(PhaserTurretAttack, netname, string, "turret_phaser");
 /* wepname   */ ATTRIB(PhaserTurretAttack, message, string, _("Phaser"));
index cc58d6059a78fff8380d263f52bb3d1440c6d271..83c205026315af710dd41af4a89b3e1504a1d5c4 100644 (file)
@@ -2,7 +2,7 @@
 #define TURRET_PLASMA_WEAPON_H
 
 CLASS(PlasmaAttack, PortoLaunch)
-/* flags     */ ATTRIB(PlasmaAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN);
+/* flags     */ ATTRIB(PlasmaAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
 /* impulse   */ ATTRIB(PlasmaAttack, impulse, int, 5);
 /* refname   */ ATTRIB(PlasmaAttack, netname, string, "turret_plasma");
 /* wepname   */ ATTRIB(PlasmaAttack, message, string, _("Plasma"));
index c8e61f7482f3dbe141e416cbc744fc51ba48a5b6..8a4f55ed8b4c4b2740df5516d4375ec793ab6a7c 100644 (file)
@@ -2,7 +2,7 @@
 #define TURRET_TESLA_WEAPON_H
 
 CLASS(TeslaCoilTurretAttack, PortoLaunch)
-/* flags     */ ATTRIB(TeslaCoilTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN);
+/* flags     */ ATTRIB(TeslaCoilTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
 /* impulse   */ ATTRIB(TeslaCoilTurretAttack, impulse, int, 9);
 /* refname   */ ATTRIB(TeslaCoilTurretAttack, netname, string, "turret_tesla");
 /* wepname   */ ATTRIB(TeslaCoilTurretAttack, message, string, _("Tesla Coil"));
index 0a2039ba177909cca4348f5c2a1e6ebecc77754a..676bf896e59ae76059142cca0c99058a58537e58 100644 (file)
@@ -2,7 +2,7 @@
 #define TURRET_WALKER_WEAPON_H
 
 CLASS(WalkerTurretAttack, PortoLaunch)
-/* flags     */ ATTRIB(WalkerTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN);
+/* flags     */ ATTRIB(WalkerTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
 /* impulse   */ ATTRIB(WalkerTurretAttack, impulse, int, 5);
 /* refname   */ ATTRIB(WalkerTurretAttack, netname, string, "turret_walker");
 /* wepname   */ ATTRIB(WalkerTurretAttack, message, string, _("Walker"));
index 388564c98b7bf382498c733a696597584460ef6f..094d1251471743c481d1e9202ea873bc63bec313 100644 (file)
@@ -4,7 +4,7 @@
 #include "../../weapons/all.qh"
 
 CLASS(RacerAttack, PortoLaunch)
-/* flags     */ ATTRIB(RacerAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN);
+/* flags     */ ATTRIB(RacerAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
 /* impulse   */ ATTRIB(RacerAttack, impulse, int, 3);
 /* refname   */ ATTRIB(RacerAttack, netname, string, "racercannon");
 /* wepname   */ ATTRIB(RacerAttack, message, string, _("Racer cannon"));
index 6e8748877fb5ae426a6a2859ef7f3d858b1b41b2..62d8c12e567901bdb41627abcc091bb949bcb8ef 100644 (file)
@@ -4,7 +4,7 @@
 #include "../../weapons/all.qh"
 
 CLASS(RaptorCannon, PortoLaunch)
-/* flags     */ ATTRIB(RaptorCannon, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN);
+/* flags     */ ATTRIB(RaptorCannon, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
 /* impulse   */ ATTRIB(RaptorCannon, impulse, int, 3);
 /* refname   */ ATTRIB(RaptorCannon, netname, string, "raptorcannon");
 /* wepname   */ ATTRIB(RaptorCannon, message, string, _("Raptor cannon"));
@@ -12,7 +12,7 @@ ENDCLASS(RaptorCannon)
 REGISTER_WEAPON(RAPTOR, NEW(RaptorCannon));
 
 CLASS(RaptorBomb, PortoLaunch)
-/* flags     */ ATTRIB(RaptorBomb, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN);
+/* flags     */ ATTRIB(RaptorBomb, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
 /* impulse   */ ATTRIB(RaptorBomb, impulse, int, 3);
 /* refname   */ ATTRIB(RaptorBomb, netname, string, "raptorbomb");
 /* wepname   */ ATTRIB(RaptorBomb, message, string, _("Raptor bomb"));
@@ -20,7 +20,7 @@ ENDCLASS(RaptorBomb)
 REGISTER_WEAPON(RAPTOR_BOMB, NEW(RaptorBomb));
 
 CLASS(RaptorFlare, PortoLaunch)
-/* flags     */ ATTRIB(RaptorFlare, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN);
+/* flags     */ ATTRIB(RaptorFlare, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
 /* impulse   */ ATTRIB(RaptorFlare, impulse, int, 3);
 /* refname   */ ATTRIB(RaptorFlare, netname, string, "raptorflare");
 /* wepname   */ ATTRIB(RaptorFlare, message, string, _("Raptor flare"));
index a56d2847f75b80a09bf3dcba9aead9350c438653..1eb3c9fd0a1fa0c5dc05bf2c41f3e2235cb647b7 100644 (file)
@@ -787,11 +787,8 @@ void W_Nexball_Attack2(void)
        if(!autocvar_g_nexball_tackling)
                return;
 
-       entity missile;
-       if(!(balls & BALL_BASKET))
-               return;
        W_SetupShot(self, false, 2, SND(NB_SHOOT2), CH_WEAPON_A, 0);
-       missile = spawn();
+       entity missile = spawn();
 
        missile.owner = self;
        missile.classname = "ballstealer";
@@ -982,7 +979,7 @@ MUTATOR_HOOKFUNCTION(nexball_PlayerPhysics)
 
 MUTATOR_HOOKFUNCTION(nexball_ForbidThrowing)
 {SELFPARAM();
-       if(self.weapon == WEP_MORTAR.m_id)
+       if(self.weapon == WEP_NEXBALL.m_id)
                return true;
 
        return false;
@@ -991,7 +988,7 @@ MUTATOR_HOOKFUNCTION(nexball_ForbidThrowing)
 MUTATOR_HOOKFUNCTION(nexball_FilterItem)
 {SELFPARAM();
        if(self.classname == "droppedweapon")
-       if(self.weapon == WEP_MORTAR.m_id)
+       if(self.weapon == WEP_NEXBALL.m_id)
                return true;
 
        return false;
index 3ac5aff276a33eab584f1c406f58cec3f8e47020..8d11877fe5226031e79c03a4877e74948a9d5d4b 100644 (file)
@@ -3,7 +3,7 @@
 
 CLASS(BallStealer, PortoLaunch)
 /* flags     */ ATTRIB(BallStealer, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN);
-/* impulse   */ ATTRIB(BallStealer, impulse, int, 2);
+/* impulse   */ ATTRIB(BallStealer, impulse, int, 0);
 /* refname   */ ATTRIB(BallStealer, netname, string, "ballstealer");
 /* wepname   */ ATTRIB(BallStealer, message, string, _("Ball Stealer"));
 ENDCLASS(BallStealer)