From: TimePath Date: Fri, 2 Oct 2015 22:29:14 +0000 (+1000) Subject: Weapons: fix accuracy panel and hide the internal weapons X-Git-Tag: xonotic-v0.8.2~1874^2~13 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a0aa9384d83cbcb27854f0d89121eb547d894c91;p=xonotic%2Fxonotic-data.pk3dir.git Weapons: fix accuracy panel and hide the internal weapons --- diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 9a0f87b94..1b762f82d 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -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; diff --git a/qcsrc/client/scoreboard.qc b/qcsrc/client/scoreboard.qc index 407c08747..3c331fd49 100644 --- a/qcsrc/client/scoreboard.qc +++ b/qcsrc/client/scoreboard.qc @@ -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; diff --git a/qcsrc/common/monsters/monster/mage.qc b/qcsrc/common/monsters/monster/mage.qc index 0ae830c1e..63ebffc9c 100644 --- a/qcsrc/common/monsters/monster/mage.qc +++ b/qcsrc/common/monsters/monster/mage.qc @@ -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")); diff --git a/qcsrc/common/monsters/monster/spider.qc b/qcsrc/common/monsters/monster/spider.qc index b3ebeeac6..539e66ad2 100644 --- a/qcsrc/common/monsters/monster/spider.qc +++ b/qcsrc/common/monsters/monster/spider.qc @@ -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")); diff --git a/qcsrc/common/monsters/monster/wyvern.qc b/qcsrc/common/monsters/monster/wyvern.qc index 74449c715..17b0a96d7 100644 --- a/qcsrc/common/monsters/monster/wyvern.qc +++ b/qcsrc/common/monsters/monster/wyvern.qc @@ -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")); diff --git a/qcsrc/common/turrets/turret/ewheel_weapon.qc b/qcsrc/common/turrets/turret/ewheel_weapon.qc index 13ca1e11a..2e8e8dc29 100644 --- a/qcsrc/common/turrets/turret/ewheel_weapon.qc +++ b/qcsrc/common/turrets/turret/ewheel_weapon.qc @@ -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")); diff --git a/qcsrc/common/turrets/turret/flac_weapon.qc b/qcsrc/common/turrets/turret/flac_weapon.qc index fd59b8d0c..31bc7cb7b 100644 --- a/qcsrc/common/turrets/turret/flac_weapon.qc +++ b/qcsrc/common/turrets/turret/flac_weapon.qc @@ -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")); diff --git a/qcsrc/common/turrets/turret/hellion_weapon.qc b/qcsrc/common/turrets/turret/hellion_weapon.qc index 6e76f27fe..0503cbd90 100644 --- a/qcsrc/common/turrets/turret/hellion_weapon.qc +++ b/qcsrc/common/turrets/turret/hellion_weapon.qc @@ -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")); diff --git a/qcsrc/common/turrets/turret/hk_weapon.qc b/qcsrc/common/turrets/turret/hk_weapon.qc index 313b0f193..51ce0d983 100644 --- a/qcsrc/common/turrets/turret/hk_weapon.qc +++ b/qcsrc/common/turrets/turret/hk_weapon.qc @@ -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")); diff --git a/qcsrc/common/turrets/turret/machinegun_weapon.qc b/qcsrc/common/turrets/turret/machinegun_weapon.qc index d8993a3ed..264053fb6 100644 --- a/qcsrc/common/turrets/turret/machinegun_weapon.qc +++ b/qcsrc/common/turrets/turret/machinegun_weapon.qc @@ -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")); diff --git a/qcsrc/common/turrets/turret/mlrs_weapon.qc b/qcsrc/common/turrets/turret/mlrs_weapon.qc index bc9a94e91..f2d442df8 100644 --- a/qcsrc/common/turrets/turret/mlrs_weapon.qc +++ b/qcsrc/common/turrets/turret/mlrs_weapon.qc @@ -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")); diff --git a/qcsrc/common/turrets/turret/phaser_weapon.qc b/qcsrc/common/turrets/turret/phaser_weapon.qc index e8e4f1428..aa71a47d0 100644 --- a/qcsrc/common/turrets/turret/phaser_weapon.qc +++ b/qcsrc/common/turrets/turret/phaser_weapon.qc @@ -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")); diff --git a/qcsrc/common/turrets/turret/plasma_weapon.qc b/qcsrc/common/turrets/turret/plasma_weapon.qc index cc58d6059..83c205026 100644 --- a/qcsrc/common/turrets/turret/plasma_weapon.qc +++ b/qcsrc/common/turrets/turret/plasma_weapon.qc @@ -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")); diff --git a/qcsrc/common/turrets/turret/tesla_weapon.qc b/qcsrc/common/turrets/turret/tesla_weapon.qc index c8e61f748..8a4f55ed8 100644 --- a/qcsrc/common/turrets/turret/tesla_weapon.qc +++ b/qcsrc/common/turrets/turret/tesla_weapon.qc @@ -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")); diff --git a/qcsrc/common/turrets/turret/walker_weapon.qc b/qcsrc/common/turrets/turret/walker_weapon.qc index 0a2039ba1..676bf896e 100644 --- a/qcsrc/common/turrets/turret/walker_weapon.qc +++ b/qcsrc/common/turrets/turret/walker_weapon.qc @@ -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")); diff --git a/qcsrc/common/vehicles/vehicle/racer_weapon.qc b/qcsrc/common/vehicles/vehicle/racer_weapon.qc index 388564c98..094d12514 100644 --- a/qcsrc/common/vehicles/vehicle/racer_weapon.qc +++ b/qcsrc/common/vehicles/vehicle/racer_weapon.qc @@ -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")); diff --git a/qcsrc/common/vehicles/vehicle/raptor_weapons.qc b/qcsrc/common/vehicles/vehicle/raptor_weapons.qc index 6e8748877..62d8c12e5 100644 --- a/qcsrc/common/vehicles/vehicle/raptor_weapons.qc +++ b/qcsrc/common/vehicles/vehicle/raptor_weapons.qc @@ -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")); diff --git a/qcsrc/server/mutators/gamemode_nexball.qc b/qcsrc/server/mutators/gamemode_nexball.qc index a56d2847f..1eb3c9fd0 100644 --- a/qcsrc/server/mutators/gamemode_nexball.qc +++ b/qcsrc/server/mutators/gamemode_nexball.qc @@ -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; diff --git a/qcsrc/server/mutators/gamemode_nexball_weapon.qc b/qcsrc/server/mutators/gamemode_nexball_weapon.qc index 3ac5aff27..8d11877fe 100644 --- a/qcsrc/server/mutators/gamemode_nexball_weapon.qc +++ b/qcsrc/server/mutators/gamemode_nexball_weapon.qc @@ -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)