From: Mario Date: Tue, 13 Aug 2019 14:10:28 +0000 (+1000) Subject: Implement WEP_FLAG_SPECIALATTACK, a flag for the 'attack' weapons are that are intend... X-Git-Tag: xonotic-v0.8.5~1392^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=97acd4ed6f919824662aca0b2f227a2f9b8c3f44;p=xonotic%2Fxonotic-data.pk3dir.git Implement WEP_FLAG_SPECIALATTACK, a flag for the 'attack' weapons are that are intended to be hidden from all weapon lists --- diff --git a/qcsrc/client/hud/panel/scoreboard.qc b/qcsrc/client/hud/panel/scoreboard.qc index 93162f6bc..fc61b6f25 100644 --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@ -1167,7 +1167,7 @@ vector Scoreboard_AccuracyStats_Draw(vector pos, vector rgb, vector bg_size) } if (weapon_stats < 0 && !((weapons_stat & set) || (weapons_inmap & set))) { - if (((it.spawnflags & WEP_FLAG_HIDDEN) || (it.spawnflags & WEP_FLAG_MUTATORBLOCKED))) + if (((it.spawnflags & WEP_FLAG_HIDDEN) || (it.spawnflags & WEP_FLAG_MUTATORBLOCKED) || (it.spawnflags & WEP_FLAG_SPECIALATTACK))) ++nHidden; else ++disownedcnt; diff --git a/qcsrc/client/hud/panel/weapons.qc b/qcsrc/client/hud/panel/weapons.qc index 3f6778702..96cc86a06 100644 --- a/qcsrc/client/hud/panel/weapons.qc +++ b/qcsrc/client/hud/panel/weapons.qc @@ -30,7 +30,7 @@ int weaponorder_cmp(int i, int j, entity pass) int nHidden = 0; \ FOREACH(Weapons, it != WEP_Null, { \ if (weapons_stat & WepSet_FromWeapon(it)) continue; \ - if ((it.spawnflags & WEP_FLAG_HIDDEN) || (it.spawnflags & WEP_FLAG_MUTATORBLOCKED)) nHidden += 1; \ + if ((it.spawnflags & WEP_FLAG_HIDDEN) || (it.spawnflags & WEP_FLAG_MUTATORBLOCKED) || (it.spawnflags & WEP_FLAG_SPECIALATTACK)) nHidden += 1; \ }); \ vector table_size = HUD_GetTableSize_BestItemAR((Weapons_COUNT - 1) - nHidden, panel_size, aspect); \ columns = table_size.x; \ @@ -123,7 +123,7 @@ void HUD_Weapons() { int j = 0; FOREACH(Weapons, it != WEP_Null && it.impulse >= 0 && (it.impulse % 3 != 0) && j < 6, { - if(!(it.spawnflags & WEP_FLAG_MUTATORBLOCKED)) + if(!(it.spawnflags & WEP_FLAG_MUTATORBLOCKED) && !(it.spawnflags & WEP_FLAG_SPECIALATTACK)) { if(!panel_switchweapon || j < 4) panel_switchweapon = it; @@ -418,7 +418,7 @@ void HUD_Weapons() } else { - if (((it.spawnflags & WEP_FLAG_HIDDEN) || (it.spawnflags & WEP_FLAG_MUTATORBLOCKED)) && !(weapons_stat & WepSet_FromWeapon(it))) + if (((it.spawnflags & WEP_FLAG_HIDDEN) || (it.spawnflags & WEP_FLAG_MUTATORBLOCKED) || (it.spawnflags & WEP_FLAG_SPECIALATTACK)) && !(weapons_stat & WepSet_FromWeapon(it))) continue; } diff --git a/qcsrc/common/gamemodes/gamemode/nexball/weapon.qh b/qcsrc/common/gamemodes/gamemode/nexball/weapon.qh index 7790663ac..1e3127eb5 100644 --- a/qcsrc/common/gamemodes/gamemode/nexball/weapon.qh +++ b/qcsrc/common/gamemodes/gamemode/nexball/weapon.qh @@ -1,7 +1,7 @@ #pragma once CLASS(BallStealer, PortoLaunch) -/* flags */ ATTRIB(BallStealer, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_NOTRUEAIM); +/* flags */ ATTRIB(BallStealer, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_SPECIALATTACK | WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_NOTRUEAIM); /* impulse */ ATTRIB(BallStealer, impulse, int, 0); /* refname */ ATTRIB(BallStealer, netname, string, "ballstealer"); /* wepname */ ATTRIB(BallStealer, m_name, string, _("Ball Stealer")); diff --git a/qcsrc/common/monsters/monster/mage.qh b/qcsrc/common/monsters/monster/mage.qh index 18f8f5963..23de31062 100644 --- a/qcsrc/common/monsters/monster/mage.qh +++ b/qcsrc/common/monsters/monster/mage.qh @@ -23,7 +23,7 @@ REGISTER_MONSTER(MAGE, NEW(Mage)); #include CLASS(MageSpike, PortoLaunch) -/* flags */ ATTRIB(MageSpike, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); +/* flags */ ATTRIB(MageSpike, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_SPECIALATTACK); /* impulse */ ATTRIB(MageSpike, impulse, int, 9); /* refname */ ATTRIB(MageSpike, netname, string, "magespike"); /* wepname */ ATTRIB(MageSpike, m_name, string, _("Mage spike")); diff --git a/qcsrc/common/monsters/monster/spider.qh b/qcsrc/common/monsters/monster/spider.qh index 908f0f942..679b14049 100644 --- a/qcsrc/common/monsters/monster/spider.qh +++ b/qcsrc/common/monsters/monster/spider.qh @@ -22,7 +22,7 @@ REGISTER_MONSTER(SPIDER, NEW(Spider)); #include CLASS(SpiderAttack, PortoLaunch) -/* flags */ ATTRIB(SpiderAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); +/* flags */ ATTRIB(SpiderAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_SPECIALATTACK); /* impulse */ ATTRIB(SpiderAttack, impulse, int, 9); /* refname */ ATTRIB(SpiderAttack, netname, string, "spider"); /* wepname */ ATTRIB(SpiderAttack, m_name, string, _("Spider attack")); diff --git a/qcsrc/common/monsters/monster/wyvern.qh b/qcsrc/common/monsters/monster/wyvern.qh index 2c5df0564..e54c9a797 100644 --- a/qcsrc/common/monsters/monster/wyvern.qh +++ b/qcsrc/common/monsters/monster/wyvern.qh @@ -22,7 +22,7 @@ REGISTER_MONSTER(WYVERN, NEW(Wyvern)); #include CLASS(WyvernAttack, PortoLaunch) -/* flags */ ATTRIB(WyvernAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); +/* flags */ ATTRIB(WyvernAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_SPECIALATTACK); /* impulse */ ATTRIB(WyvernAttack, impulse, int, 9); /* refname */ ATTRIB(WyvernAttack, netname, string, "wyvern"); /* wepname */ ATTRIB(WyvernAttack, m_name, string, _("Wyvern attack")); diff --git a/qcsrc/common/mutators/mutator/overkill/okhmg.qh b/qcsrc/common/mutators/mutator/overkill/okhmg.qh index 94ca17a92..dec03323f 100644 --- a/qcsrc/common/mutators/mutator/overkill/okhmg.qh +++ b/qcsrc/common/mutators/mutator/overkill/okhmg.qh @@ -6,7 +6,7 @@ CLASS(OverkillHeavyMachineGun, Weapon) /* spawnfunc */ ATTRIB(OverkillHeavyMachineGun, m_canonical_spawnfunc, string, "weapon_okhmg"); /* ammotype */ ATTRIB(OverkillHeavyMachineGun, ammo_type, int, RES_BULLETS); /* impulse */ ATTRIB(OverkillHeavyMachineGun, impulse, int, 3); -/* flags */ ATTRIB(OverkillHeavyMachineGun, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_HIDDEN | WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_SUPERWEAPON | WEP_FLAG_PENETRATEWALLS); +/* flags */ ATTRIB(OverkillHeavyMachineGun, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_HIDDEN | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_SUPERWEAPON | WEP_FLAG_PENETRATEWALLS); /* rating */ ATTRIB(OverkillHeavyMachineGun, bot_pickupbasevalue, float, 10000); /* color */ ATTRIB(OverkillHeavyMachineGun, wpcolor, vector, '0.5 0.5 0'); /* modelname */ ATTRIB(OverkillHeavyMachineGun, mdl, string, "ok_hmg"); diff --git a/qcsrc/common/mutators/mutator/overkill/okrpc.qh b/qcsrc/common/mutators/mutator/overkill/okrpc.qh index 7d95296f9..429073e8c 100644 --- a/qcsrc/common/mutators/mutator/overkill/okrpc.qh +++ b/qcsrc/common/mutators/mutator/overkill/okrpc.qh @@ -6,7 +6,7 @@ CLASS(OverkillRocketPropelledChainsaw, Weapon) /* spawnfunc */ ATTRIB(OverkillRocketPropelledChainsaw, m_canonical_spawnfunc, string, "weapon_okrpc"); /* ammotype */ ATTRIB(OverkillRocketPropelledChainsaw, ammo_type, int, RES_ROCKETS); /* impulse */ ATTRIB(OverkillRocketPropelledChainsaw, impulse, int, 9); -/* flags */ ATTRIB(OverkillRocketPropelledChainsaw, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_HIDDEN | WEP_FLAG_NORMAL | WEP_FLAG_CANCLIMB | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH | WEP_FLAG_SUPERWEAPON); +/* flags */ ATTRIB(OverkillRocketPropelledChainsaw, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_HIDDEN | WEP_FLAG_CANCLIMB | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH | WEP_FLAG_SUPERWEAPON); /* rating */ ATTRIB(OverkillRocketPropelledChainsaw, bot_pickupbasevalue, float, 10000); /* color */ ATTRIB(OverkillRocketPropelledChainsaw, wpcolor, vector, '0.5 0.5 0'); /* modelname */ ATTRIB(OverkillRocketPropelledChainsaw, mdl, string, "ok_rl"); diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index a6b3f45ce..15415456f 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -1766,7 +1766,7 @@ float GiveItems(entity e, float beginarg, float endarg) got += GiveResourceValue(e, RES_HEALTH, op, val); got += GiveResourceValue(e, RES_ARMOR, op, val); case "allweapons": - FOREACH(Weapons, it != WEP_Null && !(it.spawnflags & WEP_FLAG_MUTATORBLOCKED), got += GiveWeapon(e, it.m_id, op, val)); + FOREACH(Weapons, it != WEP_Null && !(it.spawnflags & WEP_FLAG_MUTATORBLOCKED) && !(it.spawnflags & WEP_FLAG_SPECIALATTACK), got += GiveWeapon(e, it.m_id, op, val)); //case "allbuffs": // all buffs makes a player god, do not want! //FOREACH(Buffs, it != BUFF_Null, got += GiveBuff(e, it.m_itemid, op, val)); case "allammo": diff --git a/qcsrc/common/turrets/turret/ewheel_weapon.qh b/qcsrc/common/turrets/turret/ewheel_weapon.qh index cbf7cb30f..dfce8d3a0 100644 --- a/qcsrc/common/turrets/turret/ewheel_weapon.qh +++ b/qcsrc/common/turrets/turret/ewheel_weapon.qh @@ -1,7 +1,7 @@ #pragma once CLASS(EWheelAttack, PortoLaunch) -/* flags */ ATTRIB(EWheelAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); +/* flags */ ATTRIB(EWheelAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_SPECIALATTACK); /* impulse */ ATTRIB(EWheelAttack, impulse, int, 5); /* refname */ ATTRIB(EWheelAttack, netname, string, "turret_ewheel"); /* wepname */ ATTRIB(EWheelAttack, m_name, string, _("eWheel")); diff --git a/qcsrc/common/turrets/turret/flac_weapon.qh b/qcsrc/common/turrets/turret/flac_weapon.qh index 13965bf51..d27061473 100644 --- a/qcsrc/common/turrets/turret/flac_weapon.qh +++ b/qcsrc/common/turrets/turret/flac_weapon.qh @@ -1,9 +1,7 @@ #pragma once -// TODO: WEP_TYPE_OTHER? - CLASS(FlacAttack, PortoLaunch) -/* flags */ ATTRIB(FlacAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); +/* flags */ ATTRIB(FlacAttack, spawnflags, int, WEP_FLAG_SPECIALATTACK | WEP_FLAG_HIDDEN); /* impulse */ ATTRIB(FlacAttack, impulse, int, 5); /* refname */ ATTRIB(FlacAttack, netname, string, "turret_flac"); /* wepname */ ATTRIB(FlacAttack, m_name, string, _("FLAC")); diff --git a/qcsrc/common/turrets/turret/hellion_weapon.qh b/qcsrc/common/turrets/turret/hellion_weapon.qh index 69c67b800..61896cc3d 100644 --- a/qcsrc/common/turrets/turret/hellion_weapon.qh +++ b/qcsrc/common/turrets/turret/hellion_weapon.qh @@ -1,7 +1,7 @@ #pragma once CLASS(HellionAttack, PortoLaunch) -/* flags */ ATTRIB(HellionAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); +/* flags */ ATTRIB(HellionAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_SPECIALATTACK); /* impulse */ ATTRIB(HellionAttack, impulse, int, 9); /* refname */ ATTRIB(HellionAttack, netname, string, "turret_hellion"); /* wepname */ ATTRIB(HellionAttack, m_name, string, _("Hellion")); diff --git a/qcsrc/common/turrets/turret/hk_weapon.qh b/qcsrc/common/turrets/turret/hk_weapon.qh index 7d44cfff9..f8acc5d3c 100644 --- a/qcsrc/common/turrets/turret/hk_weapon.qh +++ b/qcsrc/common/turrets/turret/hk_weapon.qh @@ -1,7 +1,7 @@ #pragma once CLASS(HunterKillerAttack, PortoLaunch) -/* flags */ ATTRIB(HunterKillerAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); +/* flags */ ATTRIB(HunterKillerAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_SPECIALATTACK); /* impulse */ ATTRIB(HunterKillerAttack, impulse, int, 9); /* refname */ ATTRIB(HunterKillerAttack, netname, string, "turret_hk"); /* wepname */ ATTRIB(HunterKillerAttack, m_name, string, _("Hunter-Killer")); diff --git a/qcsrc/common/turrets/turret/machinegun_weapon.qh b/qcsrc/common/turrets/turret/machinegun_weapon.qh index ab8169e6c..517eef83a 100644 --- a/qcsrc/common/turrets/turret/machinegun_weapon.qh +++ b/qcsrc/common/turrets/turret/machinegun_weapon.qh @@ -1,7 +1,7 @@ #pragma once CLASS(MachineGunTurretAttack, PortoLaunch) -/* flags */ ATTRIB(MachineGunTurretAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); +/* flags */ ATTRIB(MachineGunTurretAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_SPECIALATTACK); /* impulse */ ATTRIB(MachineGunTurretAttack, impulse, int, 9); /* refname */ ATTRIB(MachineGunTurretAttack, netname, string, "turret_machinegun"); /* wepname */ ATTRIB(MachineGunTurretAttack, m_name, string, _("Machinegun")); diff --git a/qcsrc/common/turrets/turret/mlrs_weapon.qh b/qcsrc/common/turrets/turret/mlrs_weapon.qh index ccb74771a..5eb3755a6 100644 --- a/qcsrc/common/turrets/turret/mlrs_weapon.qh +++ b/qcsrc/common/turrets/turret/mlrs_weapon.qh @@ -1,7 +1,7 @@ #pragma once CLASS(MLRSTurretAttack, PortoLaunch) -/* flags */ ATTRIB(MLRSTurretAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); +/* flags */ ATTRIB(MLRSTurretAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_SPECIALATTACK); /* impulse */ ATTRIB(MLRSTurretAttack, impulse, int, 9); /* refname */ ATTRIB(MLRSTurretAttack, netname, string, "turret_mlrs"); /* wepname */ ATTRIB(MLRSTurretAttack, m_name, string, _("MLRS")); diff --git a/qcsrc/common/turrets/turret/phaser_weapon.qh b/qcsrc/common/turrets/turret/phaser_weapon.qh index ea45977d5..7b9dc457f 100644 --- a/qcsrc/common/turrets/turret/phaser_weapon.qh +++ b/qcsrc/common/turrets/turret/phaser_weapon.qh @@ -1,7 +1,7 @@ #pragma once CLASS(PhaserTurretAttack, PortoLaunch) -/* flags */ ATTRIB(PhaserTurretAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); +/* flags */ ATTRIB(PhaserTurretAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_SPECIALATTACK); /* impulse */ ATTRIB(PhaserTurretAttack, impulse, int, 9); /* refname */ ATTRIB(PhaserTurretAttack, netname, string, "turret_phaser"); /* wepname */ ATTRIB(PhaserTurretAttack, m_name, string, _("Phaser")); diff --git a/qcsrc/common/turrets/turret/plasma_dual.qh b/qcsrc/common/turrets/turret/plasma_dual.qh index c0f63c103..299475cd0 100644 --- a/qcsrc/common/turrets/turret/plasma_dual.qh +++ b/qcsrc/common/turrets/turret/plasma_dual.qh @@ -3,7 +3,7 @@ #include "plasma_weapon.qh" CLASS(PlasmaDualAttack, PlasmaAttack) -/* flags */ ATTRIB(PlasmaDualAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); +/* flags */ ATTRIB(PlasmaDualAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_SPECIALATTACK); /* refname */ ATTRIB(PlasmaDualAttack, netname, string, "turret_plasma_dual"); /* wepname */ ATTRIB(PlasmaDualAttack, m_name, string, _("Dual plasma")); ENDCLASS(PlasmaDualAttack) diff --git a/qcsrc/common/turrets/turret/plasma_weapon.qh b/qcsrc/common/turrets/turret/plasma_weapon.qh index 3c11fdc00..5ad91c363 100644 --- a/qcsrc/common/turrets/turret/plasma_weapon.qh +++ b/qcsrc/common/turrets/turret/plasma_weapon.qh @@ -1,7 +1,7 @@ #pragma once CLASS(PlasmaAttack, PortoLaunch) -/* flags */ ATTRIB(PlasmaAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); +/* flags */ ATTRIB(PlasmaAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_SPECIALATTACK); /* impulse */ ATTRIB(PlasmaAttack, impulse, int, 5); /* refname */ ATTRIB(PlasmaAttack, netname, string, "turret_plasma"); /* wepname */ ATTRIB(PlasmaAttack, m_name, string, _("Plasma")); diff --git a/qcsrc/common/turrets/turret/tesla_weapon.qh b/qcsrc/common/turrets/turret/tesla_weapon.qh index a73985266..071f1d140 100644 --- a/qcsrc/common/turrets/turret/tesla_weapon.qh +++ b/qcsrc/common/turrets/turret/tesla_weapon.qh @@ -1,7 +1,7 @@ #pragma once CLASS(TeslaCoilTurretAttack, PortoLaunch) -/* flags */ ATTRIB(TeslaCoilTurretAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); +/* flags */ ATTRIB(TeslaCoilTurretAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_SPECIALATTACK); /* impulse */ ATTRIB(TeslaCoilTurretAttack, impulse, int, 9); /* refname */ ATTRIB(TeslaCoilTurretAttack, netname, string, "turret_tesla"); /* wepname */ ATTRIB(TeslaCoilTurretAttack, m_name, string, _("Tesla Coil")); diff --git a/qcsrc/common/turrets/turret/walker_weapon.qh b/qcsrc/common/turrets/turret/walker_weapon.qh index 7c4fc0bed..9f23ffb65 100644 --- a/qcsrc/common/turrets/turret/walker_weapon.qh +++ b/qcsrc/common/turrets/turret/walker_weapon.qh @@ -1,7 +1,7 @@ #pragma once CLASS(WalkerTurretAttack, PortoLaunch) -/* flags */ ATTRIB(WalkerTurretAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); +/* flags */ ATTRIB(WalkerTurretAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_SPECIALATTACK); /* impulse */ ATTRIB(WalkerTurretAttack, impulse, int, 5); /* refname */ ATTRIB(WalkerTurretAttack, netname, string, "turret_walker"); /* wepname */ ATTRIB(WalkerTurretAttack, m_name, string, _("Walker")); diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index 0366f4604..7713679f3 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -522,7 +522,7 @@ string fixPriorityList(string order, float from, float to, float subtract, float for(w = to; w >= from; --w) { int wflags = Weapons_from(w).spawnflags; - if((wflags & WEP_FLAG_HIDDEN) && (wflags & WEP_FLAG_MUTATORBLOCKED) && !(wflags & WEP_FLAG_NORMAL)) + if(wflags & WEP_FLAG_SPECIALATTACK) continue; for(i = 0; i < n; ++i) if(stof(argv(i)) == w) diff --git a/qcsrc/common/vehicles/vehicle/racer_weapon.qh b/qcsrc/common/vehicles/vehicle/racer_weapon.qh index 7e4505ca3..ede81f6c5 100644 --- a/qcsrc/common/vehicles/vehicle/racer_weapon.qh +++ b/qcsrc/common/vehicles/vehicle/racer_weapon.qh @@ -3,7 +3,7 @@ #include CLASS(RacerAttack, PortoLaunch) -/* flags */ ATTRIB(RacerAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); +/* flags */ ATTRIB(RacerAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_SPECIALATTACK); /* impulse */ ATTRIB(RacerAttack, impulse, int, 3); /* refname */ ATTRIB(RacerAttack, netname, string, "racercannon"); /* wepname */ ATTRIB(RacerAttack, m_name, string, _("Racer cannon")); diff --git a/qcsrc/common/vehicles/vehicle/raptor_weapons.qh b/qcsrc/common/vehicles/vehicle/raptor_weapons.qh index c7ffff797..37b87bbad 100644 --- a/qcsrc/common/vehicles/vehicle/raptor_weapons.qh +++ b/qcsrc/common/vehicles/vehicle/raptor_weapons.qh @@ -3,7 +3,7 @@ #include CLASS(RaptorCannon, PortoLaunch) -/* flags */ ATTRIB(RaptorCannon, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); +/* flags */ ATTRIB(RaptorCannon, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_SPECIALATTACK); /* impulse */ ATTRIB(RaptorCannon, impulse, int, 3); /* refname */ ATTRIB(RaptorCannon, netname, string, "raptorcannon"); /* wepname */ ATTRIB(RaptorCannon, m_name, string, _("Raptor cannon")); @@ -11,7 +11,7 @@ ENDCLASS(RaptorCannon) REGISTER_WEAPON(RAPTOR, NEW(RaptorCannon)); CLASS(RaptorBomb, PortoLaunch) -/* flags */ ATTRIB(RaptorBomb, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); +/* flags */ ATTRIB(RaptorBomb, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_SPECIALATTACK); /* impulse */ ATTRIB(RaptorBomb, impulse, int, 3); /* refname */ ATTRIB(RaptorBomb, netname, string, "raptorbomb"); /* wepname */ ATTRIB(RaptorBomb, m_name, string, _("Raptor bomb")); @@ -19,7 +19,7 @@ ENDCLASS(RaptorBomb) REGISTER_WEAPON(RAPTOR_BOMB, NEW(RaptorBomb)); CLASS(RaptorFlare, PortoLaunch) -/* flags */ ATTRIB(RaptorFlare, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); +/* flags */ ATTRIB(RaptorFlare, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_SPECIALATTACK); /* impulse */ ATTRIB(RaptorFlare, impulse, int, 3); /* refname */ ATTRIB(RaptorFlare, netname, string, "raptorflare"); /* wepname */ ATTRIB(RaptorFlare, m_name, string, _("Raptor flare")); diff --git a/qcsrc/common/weapons/config.qc b/qcsrc/common/weapons/config.qc index f1cc349ca..ab0fa0c17 100644 --- a/qcsrc/common/weapons/config.qc +++ b/qcsrc/common/weapons/config.qc @@ -34,7 +34,7 @@ void Dump_Weapon_Settings() int wepcount = 1; #define WEP_CONFIG_WRITETOFILE(str) write_String_To_File(wep_config_file, str, wep_config_alsoprint) FOREACH(Weapons, it != WEP_Null, { - if((it.spawnflags & WEP_FLAG_HIDDEN) && (it.spawnflags & WEP_FLAG_MUTATORBLOCKED) && !(it.spawnflags & WEP_FLAG_NORMAL)) + if(it.spawnflags & WEP_FLAG_SPECIALATTACK) continue; // never include the attacks // step 1: clear the queue WEP_CONFIG_COUNT = 0; diff --git a/qcsrc/common/weapons/weapon.qh b/qcsrc/common/weapons/weapon.qh index 8c025cb19..3dd2a8048 100644 --- a/qcsrc/common/weapons/weapon.qh +++ b/qcsrc/common/weapons/weapon.qh @@ -199,6 +199,7 @@ const int WEP_FLAG_NODUAL = BIT(12); // weapon doesn't work well with d const int WEP_FLAG_PENETRATEWALLS = BIT(13); // weapon has high calibur bullets that can penetrate thick walls (WEAPONTODO) const int WEP_FLAG_BLEED = BIT(14); // weapon pierces and causes bleeding (used for damage effects) const int WEP_FLAG_NOTRUEAIM = BIT(15); // weapon doesn't aim directly at targets +const int WEP_FLAG_SPECIALATTACK = BIT(16); // marked as a special attack (not a true weapon), hidden from most weapon lists // variables: string weaponorder_byid; diff --git a/qcsrc/common/weapons/weapon/shockwave.qh b/qcsrc/common/weapons/weapon/shockwave.qh index f42eea7d4..8b1cd48ef 100644 --- a/qcsrc/common/weapons/weapon/shockwave.qh +++ b/qcsrc/common/weapons/weapon/shockwave.qh @@ -4,7 +4,7 @@ CLASS(Shockwave, Weapon) /* spawnfunc */ ATTRIB(Shockwave, m_canonical_spawnfunc, string, "weapon_shockwave"); /* ammotype */ //ATTRIB(Shockwave, ammo_type, int, RES_NONE); /* impulse */ ATTRIB(Shockwave, impulse, int, 2); -/* flags */ ATTRIB(Shockwave, spawnflags, int, WEP_TYPE_HITSCAN | WEP_FLAG_CANCLIMB | WEP_TYPE_MELEE_SEC); +/* flags */ ATTRIB(Shockwave, spawnflags, int, WEP_FLAG_HIDDEN | WEP_TYPE_HITSCAN | WEP_FLAG_CANCLIMB | WEP_TYPE_MELEE_SEC); /* rating */ ATTRIB(Shockwave, bot_pickupbasevalue, float, 3000); /* color */ ATTRIB(Shockwave, wpcolor, vector, '0.5 0.25 0'); /* modelname */ ATTRIB(Shockwave, mdl, string, "shotgun"); diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc b/qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc index 8b6dd4b73..3e9e4cbef 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc +++ b/qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc @@ -251,7 +251,7 @@ void XonoticMutatorsDialog_fill(entity me) for(i = WEP_FIRST, j = 0; i <= WEP_LAST; ++i) { w = Weapons_from(i); - if(w.spawnflags & WEP_FLAG_HIDDEN) + if((w.spawnflags & WEP_FLAG_HIDDEN) || (w.spawnflags & WEP_FLAG_SPECIALATTACK)) continue; if ((j % 3) == 0) { diff --git a/qcsrc/menu/xonotic/keybinder.qc b/qcsrc/menu/xonotic/keybinder.qc index 7f6424bfc..3706aabad 100644 --- a/qcsrc/menu/xonotic/keybinder.qc +++ b/qcsrc/menu/xonotic/keybinder.qc @@ -68,9 +68,9 @@ void KeyBinds_Read() for(int imp = 1; imp <= 9; ++imp) { string w_list = ""; - ADD_TO_W_LIST(!(it.spawnflags & WEP_FLAG_MUTATORBLOCKED) && !(it.spawnflags & WEP_FLAG_HIDDEN) && !(it.spawnflags & WEP_FLAG_SUPERWEAPON)); + ADD_TO_W_LIST(!(it.spawnflags & WEP_FLAG_MUTATORBLOCKED) && !(it.spawnflags & WEP_FLAG_HIDDEN) && !(it.spawnflags & WEP_FLAG_SPECIALATTACK) && !(it.spawnflags & WEP_FLAG_SUPERWEAPON)); ADD_TO_W_LIST((it.spawnflags & WEP_FLAG_SUPERWEAPON) && !(it.spawnflags & WEP_FLAG_HIDDEN)); - ADD_TO_W_LIST((it.spawnflags & WEP_FLAG_MUTATORBLOCKED) && !(it.spawnflags & WEP_FLAG_HIDDEN)); + ADD_TO_W_LIST((it.spawnflags & WEP_FLAG_MUTATORBLOCKED) && !(it.spawnflags & WEP_FLAG_HIDDEN) && !(it.spawnflags & WEP_FLAG_SPECIALATTACK)); if(w_list) KEYBIND_DEF(strcat("weapon_group_", itos(imp)), substring(w_list, 0, -4)); if(imp == 0) diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 167a75ae2..8f875ba09 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -499,7 +499,7 @@ float want_weapon(entity weaponinfo, float allguns) // WEAPONTODO: what still ne allow_mutatorblocked = M_ARGV(3, bool); if(allguns) - d = boolean((weaponinfo.spawnflags & WEP_FLAG_NORMAL) && !(weaponinfo.spawnflags & WEP_FLAG_HIDDEN)); + d = boolean((weaponinfo.spawnflags & WEP_FLAG_NORMAL) && !(weaponinfo.spawnflags & WEP_FLAG_HIDDEN) && !(weaponinfo.spawnflags & WEP_FLAG_SPECIALATTACK)); else if(!mutator_returnvalue) d = !(!weaponinfo.weaponstart); @@ -565,7 +565,7 @@ void readplayerstartcvars() g_weaponarena = 1; g_weaponarena_list = "All Weapons"; FOREACH(Weapons, it != WEP_Null, { - if(!(it.spawnflags & WEP_FLAG_MUTATORBLOCKED)) + if(!(it.spawnflags & WEP_FLAG_MUTATORBLOCKED) && !(it.spawnflags & WEP_FLAG_SPECIALATTACK)) g_weaponarena_weapons |= (it.m_wepset); }); } @@ -583,7 +583,7 @@ void readplayerstartcvars() g_weaponarena = 1; g_weaponarena_list = "Most Weapons"; FOREACH(Weapons, it != WEP_Null, { - if(!(it.spawnflags & WEP_FLAG_MUTATORBLOCKED) && (it.spawnflags & WEP_FLAG_NORMAL) && !(it.spawnflags & WEP_FLAG_HIDDEN)) + if(!(it.spawnflags & WEP_FLAG_MUTATORBLOCKED) && (it.spawnflags & WEP_FLAG_NORMAL) && !(it.spawnflags & WEP_FLAG_HIDDEN) && !(it.spawnflags & WEP_FLAG_SPECIALATTACK)) g_weaponarena_weapons |= (it.m_wepset); }); }