/* flags */ ATTRIB(BallStealer, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
/* impulse */ ATTRIB(BallStealer, impulse, int, 0);
/* refname */ ATTRIB(BallStealer, netname, string, "ballstealer");
-/* wepname */ ATTRIB(BallStealer, message, string, _("Ball Stealer"));
+/* wepname */ ATTRIB(BallStealer, m_name, string, _("Ball Stealer"));
ENDCLASS(BallStealer)
REGISTER_WEAPON(NEXBALL, NEW(BallStealer));
#include "pickup.qh"
CLASS(Armor, Pickup)
#ifdef SVQC
+ ATTRIB(Armor, m_mins, vector, '-16 -16 0')
+ ATTRIB(Armor, m_maxs, vector, '16 16 48')
ATTRIB(Armor, m_pickupevalfunc, float(entity player, entity item), commodity_pickupevalfunc)
#endif
ENDCLASS(Armor)
#include "pickup.qh"
CLASS(Health, Pickup)
#ifdef SVQC
+ ATTRIB(Health, m_mins, vector, '-16 -16 0')
+ ATTRIB(Health, m_maxs, vector, '16 16 48')
ATTRIB(Health, m_pickupevalfunc, float(entity player, entity item), commodity_pickupevalfunc)
#endif
ENDCLASS(Health)
METHOD(Pickup, show, void(entity this));
void Pickup_show(entity this) { LOG_INFOF("%s: %s\n", etos(this), this.m_name); }
#ifdef SVQC
+ ATTRIB(Pickup, m_mins, vector, '-16 -16 0')
+ ATTRIB(Pickup, m_maxs, vector, '16 16 32')
ATTRIB(Pickup, m_botvalue, int, 0)
ATTRIB(Pickup, m_itemflags, int, 0)
ATTRIB(Pickup, m_itemid, int, 0)
#include "pickup.qh"
CLASS(Powerup, Pickup)
#ifdef SVQC
+ ATTRIB(Powerup, m_mins, vector, '-16 -16 0')
+ ATTRIB(Powerup, m_maxs, vector, '16 16 48')
ATTRIB(Powerup, m_botvalue, int, 100000)
ATTRIB(Powerup, m_itemflags, int, FL_POWERUP)
ATTRIB(Powerup, m_respawntime, float(), GET(g_pickup_respawntime_powerup))
/* 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"));
+/* wepname */ ATTRIB(MageSpike, m_name, string, _("Mage spike"));
ENDCLASS(MageSpike)
REGISTER_WEAPON(MAGE_SPIKE, NEW(MageSpike));
/* 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"));
+/* wepname */ ATTRIB(SpiderAttack, m_name, string, _("Spider attack"));
ENDCLASS(SpiderAttack)
REGISTER_WEAPON(SPIDER_ATTACK, NEW(SpiderAttack));
/* 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"));
+/* wepname */ ATTRIB(WyvernAttack, m_name, string, _("Wyvern attack"));
ENDCLASS(WyvernAttack)
REGISTER_WEAPON(WYVERN_ATTACK, NEW(WyvernAttack));
/* 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"));
+/* wepname */ ATTRIB(EWheelAttack, m_name, string, _("eWheel"));
ENDCLASS(EWheelAttack)
REGISTER_WEAPON(EWHEEL, NEW(EWheelAttack));
/* 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"));
+/* wepname */ ATTRIB(FlacAttack, m_name, string, _("FLAC"));
ENDCLASS(FlacAttack)
REGISTER_WEAPON(FLAC, NEW(FlacAttack));
/* 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"));
+/* wepname */ ATTRIB(HellionAttack, m_name, string, _("Hellion"));
ENDCLASS(HellionAttack)
REGISTER_WEAPON(HELLION, NEW(HellionAttack));
/* 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"));
+/* wepname */ ATTRIB(HunterKillerAttack, m_name, string, _("Hunter-Killer"));
ENDCLASS(HunterKillerAttack)
REGISTER_WEAPON(HK, NEW(HunterKillerAttack));
/* 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"));
+/* wepname */ ATTRIB(MachineGunTurretAttack, m_name, string, _("Machinegun"));
ENDCLASS(MachineGunTurretAttack)
REGISTER_WEAPON(TUR_MACHINEGUN, NEW(MachineGunTurretAttack));
/* 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"));
+/* wepname */ ATTRIB(MLRSTurretAttack, m_name, string, _("MLRS"));
ENDCLASS(MLRSTurretAttack)
REGISTER_WEAPON(TUR_MLRS, NEW(MLRSTurretAttack));
/* 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"));
+/* wepname */ ATTRIB(PhaserTurretAttack, m_name, string, _("Phaser"));
ENDCLASS(PhaserTurretAttack)
REGISTER_WEAPON(PHASER, NEW(PhaserTurretAttack));
CLASS(PlasmaDualAttack, PlasmaAttack)
/* refname */ ATTRIB(PlasmaDualAttack, netname, string, "turret_plasma_dual");
-/* wepname */ ATTRIB(PlasmaDualAttack, message, string, _("Dual plasma"));
+/* wepname */ ATTRIB(PlasmaDualAttack, m_name, string, _("Dual plasma"));
ENDCLASS(PlasmaDualAttack)
REGISTER_WEAPON(PLASMA_DUAL, NEW(PlasmaDualAttack));
/* 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"));
+/* wepname */ ATTRIB(PlasmaAttack, m_name, string, _("Plasma"));
ENDCLASS(PlasmaAttack)
REGISTER_WEAPON(PLASMA, NEW(PlasmaAttack));
/* 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"));
+/* wepname */ ATTRIB(TeslaCoilTurretAttack, m_name, string, _("Tesla Coil"));
ENDCLASS(TeslaCoilTurretAttack)
REGISTER_WEAPON(TESLA, NEW(TeslaCoilTurretAttack));
/* 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"));
+/* wepname */ ATTRIB(WalkerTurretAttack, m_name, string, _("Walker"));
ENDCLASS(WalkerTurretAttack)
REGISTER_WEAPON(WALKER, NEW(WalkerTurretAttack));
/* 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"));
+/* wepname */ ATTRIB(RacerAttack, m_name, string, _("Racer cannon"));
ENDCLASS(RacerAttack)
REGISTER_WEAPON(RACER, NEW(RacerAttack));
/* 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"));
+/* wepname */ ATTRIB(RaptorCannon, m_name, string, _("Raptor cannon"));
ENDCLASS(RaptorCannon)
REGISTER_WEAPON(RAPTOR, NEW(RaptorCannon));
/* 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"));
+/* wepname */ ATTRIB(RaptorBomb, m_name, string, _("Raptor bomb"));
ENDCLASS(RaptorBomb)
REGISTER_WEAPON(RAPTOR_BOMB, NEW(RaptorBomb));
/* 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"));
+/* wepname */ ATTRIB(RaptorFlare, m_name, string, _("Raptor flare"));
ENDCLASS(RaptorFlare)
REGISTER_WEAPON(RAPTOR_FLARE, NEW(RaptorFlare));
/** M: refname : reference name name */
ATTRIB(Weapon, netname, string, "");
/** M: wepname : human readable name */
- ATTRIB(Weapon, message, string, "AOL CD Thrower");
+ ATTRIB(Weapon, m_name, string, "AOL CD Thrower");
ATTRIB(Weapon, m_pickup, entity, NULL);
METHOD(Weapon, wr_pickup, void(Weapon this)) {}
METHOD(Weapon, display, void(entity this, void(string name, string icon) returns)) {
- returns(this.message, this.model2 ? sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.model2) : string_null);
+ returns(this.m_name, this.model2 ? sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.model2) : string_null);
}
ENDCLASS(Weapon)
#include "../items/all.qh"
CLASS(WeaponPickup, Pickup)
+ ATTRIB(WeaponPickup, m_weapon, Weapon, NULL)
+ ATTRIB(WeaponPickup, m_name, string, string_null)
#ifndef MENUQC
ATTRIB(WeaponPickup, m_sound, Sound, SND_WEAPONPICKUP)
#endif
#endif
CONSTRUCTOR(WeaponPickup, Weapon w) {
CONSTRUCT(WeaponPickup);
+ this.m_weapon = w;
+ this.m_name = w.m_name;
#ifndef MENUQC
this.m_model = w.m_model;
#endif
// other useful macros
#define WEP_AMMO(wpn) (WEP_##wpn.ammo_field) // only used inside weapon files/with direct name, don't duplicate prefix
-#define WEP_NAME(wpn) ((get_weaponinfo(wpn)).message)
+#define WEP_NAME(wpn) ((get_weaponinfo(wpn)).m_name)
#endif
/* crosshair */ ATTRIB(Arc, w_crosshair_size, float, 0.7);
/* wepimg */ ATTRIB(Arc, model2, string, "weaponarc");
/* refname */ ATTRIB(Arc, netname, string, "arc");
-/* wepname */ ATTRIB(Arc, message, string, _("Arc"));
+/* wepname */ ATTRIB(Arc, m_name, string, _("Arc"));
ENDCLASS(Arc)
REGISTER_WEAPON(ARC, NEW(Arc));
/* crosshair */ ATTRIB(Blaster, w_crosshair_size, float, 0.5);
/* wepimg */ ATTRIB(Blaster, model2, string, "weaponlaser");
/* refname */ ATTRIB(Blaster, netname, string, "blaster");
-/* wepname */ ATTRIB(Blaster, message, string, _("Blaster"));
+/* wepname */ ATTRIB(Blaster, m_name, string, _("Blaster"));
ENDCLASS(Blaster)
REGISTER_WEAPON(BLASTER, NEW(Blaster));
/* crosshair */ ATTRIB(Crylink, w_crosshair_size, float, 0.5);
/* wepimg */ ATTRIB(Crylink, model2, string, "weaponcrylink");
/* refname */ ATTRIB(Crylink, netname, string, "crylink");
-/* wepname */ ATTRIB(Crylink, message, string, _("Crylink"));
+/* wepname */ ATTRIB(Crylink, m_name, string, _("Crylink"));
ENDCLASS(Crylink)
REGISTER_WEAPON(CRYLINK, NEW(Crylink));
/* crosshair */ ATTRIB(Devastator, w_crosshair_size, float, 0.7);
/* wepimg */ ATTRIB(Devastator, model2, string, "weaponrocketlauncher");
/* refname */ ATTRIB(Devastator, netname, string, "devastator");
-/* wepname */ ATTRIB(Devastator, message, string, _("Devastator"));
+/* wepname */ ATTRIB(Devastator, m_name, string, _("Devastator"));
ENDCLASS(Devastator)
REGISTER_WEAPON(DEVASTATOR, NEW(Devastator));
/* crosshair */ ATTRIB(Electro, w_crosshair_size, float, 0.6);
/* wepimg */ ATTRIB(Electro, model2, string, "weaponelectro");
/* refname */ ATTRIB(Electro, netname, string, "electro");
-/* wepname */ ATTRIB(Electro, message, string, _("Electro"));
+/* wepname */ ATTRIB(Electro, m_name, string, _("Electro"));
ENDCLASS(Electro)
REGISTER_WEAPON(ELECTRO, NEW(Electro));
/* crosshair */ //ATTRIB(Fireball, w_crosshair_size, float, 0.65);
/* wepimg */ ATTRIB(Fireball, model2, string, "weaponfireball");
/* refname */ ATTRIB(Fireball, netname, string, "fireball");
-/* wepname */ ATTRIB(Fireball, message, string, _("Fireball"));
+/* wepname */ ATTRIB(Fireball, m_name, string, _("Fireball"));
ENDCLASS(Fireball)
REGISTER_WEAPON(FIREBALL, NEW(Fireball));
/* crosshair */ ATTRIB(Hagar, w_crosshair_size, float, 0.8);
/* wepimg */ ATTRIB(Hagar, model2, string, "weaponhagar");
/* refname */ ATTRIB(Hagar, netname, string, "hagar");
-/* wepname */ ATTRIB(Hagar, message, string, _("Hagar"));
+/* wepname */ ATTRIB(Hagar, m_name, string, _("Hagar"));
ENDCLASS(Hagar)
REGISTER_WEAPON(HAGAR, NEW(Hagar));
/* crosshair */ ATTRIB(HLAC, w_crosshair_size, float, 0.6);
/* wepimg */ ATTRIB(HLAC, model2, string, "weaponhlac");
/* refname */ ATTRIB(HLAC, netname, string, "hlac");
-/* wepname */ ATTRIB(HLAC, message, string, _("Heavy Laser Assault Cannon"));
+/* wepname */ ATTRIB(HLAC, m_name, string, _("Heavy Laser Assault Cannon"));
ENDCLASS(HLAC)
REGISTER_WEAPON(HLAC, NEW(HLAC));
/* crosshair */ ATTRIB(HeavyMachineGun, w_crosshair_size, float, 0.6);
/* wepimg */ ATTRIB(HeavyMachineGun, model2, string, "weaponhmg");
/* refname */ ATTRIB(HeavyMachineGun, netname, string, "hmg");
-/* wepname */ ATTRIB(HeavyMachineGun, message, string, _("Heavy Machine Gun"));
+/* wepname */ ATTRIB(HeavyMachineGun, m_name, string, _("Heavy Machine Gun"));
ENDCLASS(HeavyMachineGun)
REGISTER_WEAPON(HMG, NEW(HeavyMachineGun));
/* crosshair */ ATTRIB(Hook, w_crosshair_size, float, 0.5);
/* wepimg */ ATTRIB(Hook, model2, string, "weaponhook");
/* refname */ ATTRIB(Hook, netname, string, "hook");
-/* wepname */ ATTRIB(Hook, message, string, _("Grappling Hook"));
+/* wepname */ ATTRIB(Hook, m_name, string, _("Grappling Hook"));
ATTRIB(Hook, ammo_factor, float, 1)
ENDCLASS(Hook)
REGISTER_WEAPON(HOOK, NEW(Hook));
/* crosshair */ ATTRIB(MachineGun, w_crosshair_size, float, 0.6);
/* wepimg */ ATTRIB(MachineGun, model2, string, "weaponuzi");
/* refname */ ATTRIB(MachineGun, netname, string, "machinegun");
-/* wepname */ ATTRIB(MachineGun, message, string, _("MachineGun"));
+/* wepname */ ATTRIB(MachineGun, m_name, string, _("MachineGun"));
ENDCLASS(MachineGun)
REGISTER_WEAPON(MACHINEGUN, NEW(MachineGun));
/* crosshair */ ATTRIB(MineLayer, w_crosshair_size, float, 0.9);
/* wepimg */ ATTRIB(MineLayer, model2, string, "weaponminelayer");
/* refname */ ATTRIB(MineLayer, netname, string, "minelayer");
-/* wepname */ ATTRIB(MineLayer, message, string, _("Mine Layer"));
+/* wepname */ ATTRIB(MineLayer, m_name, string, _("Mine Layer"));
ENDCLASS(MineLayer)
REGISTER_WEAPON(MINE_LAYER, NEW(MineLayer));
/* crosshair */ ATTRIB(Mortar, w_crosshair_size, float, 0.7);
/* wepimg */ ATTRIB(Mortar, model2, string, "weapongrenadelauncher");
/* refname */ ATTRIB(Mortar, netname, string, "mortar");
-/* wepname */ ATTRIB(Mortar, message, string, _("Mortar"));
+/* wepname */ ATTRIB(Mortar, m_name, string, _("Mortar"));
ENDCLASS(Mortar)
REGISTER_WEAPON(MORTAR, NEW(Mortar));
/* crosshair */ ATTRIB(PortoLaunch, w_crosshair_size, float, 0.6);
/* wepimg */ ATTRIB(PortoLaunch, model2, string, "weaponporto");
/* refname */ ATTRIB(PortoLaunch, netname, string, "porto");
-/* wepname */ ATTRIB(PortoLaunch, message, string, _("Port-O-Launch"));
+/* wepname */ ATTRIB(PortoLaunch, m_name, string, _("Port-O-Launch"));
ENDCLASS(PortoLaunch)
REGISTER_WEAPON(PORTO, NEW(PortoLaunch));
/* crosshair */ ATTRIB(Rifle, w_crosshair_size, float, 0.6);
/* wepimg */ ATTRIB(Rifle, model2, string, "weaponrifle");
/* refname */ ATTRIB(Rifle, netname, string, "rifle");
-/* wepname */ ATTRIB(Rifle, message, string, _("Rifle"));
+/* wepname */ ATTRIB(Rifle, m_name, string, _("Rifle"));
ENDCLASS(Rifle)
REGISTER_WEAPON(RIFLE, NEW(Rifle));
/* crosshair */ ATTRIB(RocketPropelledChainsaw, w_crosshair_size, float, 0.6);
/* wepimg */ ATTRIB(RocketPropelledChainsaw, model2, string, "weaponrpc");
/* refname */ ATTRIB(RocketPropelledChainsaw, netname, string, "rpc");
-/* wepname */ ATTRIB(RocketPropelledChainsaw, message, string, _("Rocket Propelled Chainsaw"));
+/* wepname */ ATTRIB(RocketPropelledChainsaw, m_name, string, _("Rocket Propelled Chainsaw"));
ENDCLASS(RocketPropelledChainsaw)
REGISTER_WEAPON(RPC, NEW(RocketPropelledChainsaw));
/* crosshair */ ATTRIB(Seeker, w_crosshair_size, float, 0.8);
/* wepimg */ ATTRIB(Seeker, model2, string, "weaponseeker");
/* refname */ ATTRIB(Seeker, netname, string, "seeker");
-/* wepname */ ATTRIB(Seeker, message, string, _("T.A.G. Seeker"));
+/* wepname */ ATTRIB(Seeker, m_name, string, _("T.A.G. Seeker"));
ENDCLASS(Seeker)
REGISTER_WEAPON(SEEKER, NEW(Seeker));
/* crosshair */ ATTRIB(Shockwave, w_crosshair_size, float, 0.7);
/* wepimg */ ATTRIB(Shockwave, model2, string, "weaponshotgun");
/* refname */ ATTRIB(Shockwave, netname, string, "shockwave");
-/* wepname */ ATTRIB(Shockwave, message, string, _("Shockwave"));
+/* wepname */ ATTRIB(Shockwave, m_name, string, _("Shockwave"));
ENDCLASS(Shockwave)
REGISTER_WEAPON(SHOCKWAVE, NEW(Shockwave));
/* crosshair */ ATTRIB(Shotgun, w_crosshair_size, float, 0.65);
/* wepimg */ ATTRIB(Shotgun, model2, string, "weaponshotgun");
/* refname */ ATTRIB(Shotgun, netname, string, "shotgun");
-/* wepname */ ATTRIB(Shotgun, message, string, _("Shotgun"));
+/* wepname */ ATTRIB(Shotgun, m_name, string, _("Shotgun"));
ENDCLASS(Shotgun)
REGISTER_WEAPON(SHOTGUN, NEW(Shotgun));
/* wepimg */ ATTRIB(Tuba, model2, string, "weapontuba");
/* refname */ ATTRIB(Tuba, netname, string, "tuba");
/* xgettext:no-c-format */
-/* wepname */ ATTRIB(Tuba, message, string, _("@!#%'n Tuba"));
+/* wepname */ ATTRIB(Tuba, m_name, string, _("@!#%'n Tuba"));
ENDCLASS(Tuba)
REGISTER_WEAPON(TUBA, NEW(Tuba));
/* crosshair */ ATTRIB(Vaporizer, w_crosshair_size, float, 0.6);
/* wepimg */ ATTRIB(Vaporizer, model2, string, "weaponminstanex");
/* refname */ ATTRIB(Vaporizer, netname, string, "vaporizer");
-/* wepname */ ATTRIB(Vaporizer, message, string, _("Vaporizer"));
+/* wepname */ ATTRIB(Vaporizer, m_name, string, _("Vaporizer"));
ENDCLASS(Vaporizer)
REGISTER_WEAPON(VAPORIZER, NEW(Vaporizer));
/* crosshair */ ATTRIB(Vortex, w_crosshair_size, float, 0.65);
/* wepimg */ ATTRIB(Vortex, model2, string, "weaponnex");
/* refname */ ATTRIB(Vortex, netname, string, "vortex");
-/* wepname */ ATTRIB(Vortex, message, string, _("Vortex"));
+/* wepname */ ATTRIB(Vortex, m_name, string, _("Vortex"));
ENDCLASS(Vortex)
REGISTER_WEAPON(VORTEX, NEW(Vortex));
if(sf & ISF_SIZE)
{
- WriteByte(MSG_ENTITY, ((self.flags & FL_POWERUP) || self.health || self.armorvalue));
+ Pickup p = this.itemdef;
+ WriteByte(MSG_ENTITY, p.instanceOfPowerup || p.instanceOfHealth || p.instanceOfArmor);
}
if(sf & ISF_STATUS)
item.SendFlags |= ISF_LOCATION;
}
-float have_pickup_item(void)
-{SELFPARAM();
- if(self.flags & FL_POWERUP)
+bool have_pickup_item(entity this)
+{
+ if(this.itemdef.instanceOfPowerup)
{
if(autocvar_g_powerups > 0)
return true;
if(autocvar_g_pickup_items == 0)
return false;
if(g_weaponarena)
- if(self.weapons || (self.items & IT_AMMO)) // no item or ammo pickups in weaponarena
+ if(this.weapons || (this.items & IT_AMMO)) // no item or ammo pickups in weaponarena
return false;
}
return true;
e.spawnshieldtime = 1;
e.ItemStatus &= ~ITS_AVAILABLE;
}
- else if((e.flags & FL_WEAPON) && !(e.flags & FL_NO_WEAPON_STAY) && g_weapon_stay)
+ else if(e.itemdef.instanceOfWeaponPickup && !(e.flags & FL_NO_WEAPON_STAY) && g_weapon_stay)
{
// make the item translucent and not touchable
e.model = e.mdl;
pickedup |= Item_GiveAmmoTo(item, player, health, item.max_health, ITEM_MODE_HEALTH);
pickedup |= Item_GiveAmmoTo(item, player, armorvalue, item.max_armorvalue, ITEM_MODE_ARMOR);
- if (item.flags & FL_WEAPON)
+ if (item.itemdef.instanceOfWeaponPickup)
{
WepSet it;
it = item.weapons;
return 0;
// crude hack to enforce switching weapons
- if(g_cts && (item.flags & FL_WEAPON))
+ if(g_cts && item.itemdef.instanceOfWeaponPickup)
{
W_SwitchWeapon_Force(player, item.weapon);
return 1;
if (this.waypointsprite_attached)
WaypointSprite_Kill(this.waypointsprite_attached);
- if ((this.flags & FL_POWERUP) || (this.weapons & WEPSET_SUPERWEAPONS)) // do not spawn powerups initially!
+ if (this.itemdef.instanceOfPowerup || (this.weapons & WEPSET_SUPERWEAPONS)) // do not spawn powerups initially!
Item_ScheduleInitialRespawn(this);
}
}
RemoveItem();
}
-void _StartItem(entity this, entity def, float defaultrespawntime, float defaultrespawntimejitter, string itemname, float itemid, float weaponid, float itemflags)
+void _StartItem(entity this, entity def, float defaultrespawntime, float defaultrespawntimejitter, float itemflags)
{
+ string itemname = def.m_name;
Model itemmodel = def.m_model;
Sound pickupsound = def.m_sound;
float(entity player, entity item) pickupevalfunc = def.m_pickupevalfunc;
this.respawntimejitter = defaultrespawntimejitter;
}
+ int itemid = def.m_itemid;
this.items = itemid;
+ int weaponid = def.instanceOfWeaponPickup ? def.m_weapon.m_id : 0;
this.weapon = weaponid;
if(!this.fade_end)
}
else
{
- if(!have_pickup_item())
+ if(!have_pickup_item(this))
{
startitem_failed = true;
remove (this);
// first nudge it off the floor a little bit to avoid math errors
setorigin(this, this.origin + '0 0 1');
// set item size before we spawn a spawnfunc_waypoint
- if((itemflags & FL_POWERUP) || this.health || this.armorvalue)
- setsize (this, '-16 -16 0', '16 16 48');
- else
- setsize (this, '-16 -16 0', '16 16 32');
+ setsize(this, def.m_mins, def.m_maxs);
this.SendFlags |= ISF_SIZE;
// note droptofloor returns false if stuck/or would fall too far
WITH(entity, self, this, droptofloor());
precache_model(this.model);
precache_sound(this.item_pickupsound);
- if ((itemflags & (FL_POWERUP | FL_WEAPON)) || (itemid & (IT_HEALTH | IT_ARMOR | IT_KEY1 | IT_KEY2)))
- this.target = "###item###"; // for finding the nearest item using find()
+ if ( def.instanceOfPowerup
+ || def.instanceOfWeaponPickup
+ || (def.instanceOfHealth && def != ITEM_HealthSmall)
+ || (def.instanceOfArmor && def != ITEM_ArmorSmall)
+ || (itemid & (IT_KEY1 | IT_KEY2))
+ ) this.target = "###item###"; // for finding the nearest item using find()
Item_ItemsTime_SetTime(this, 0);
}
setmodel(this, MDL_Null); // precision set below
//this.effects |= EF_LOWPRECISION;
- if((itemflags & FL_POWERUP) || this.health || this.armorvalue)
- {
- this.pos1 = '-16 -16 0';
- this.pos2 = '16 16 48';
- }
- else
- {
- this.pos1 = '-16 -16 0';
- this.pos2 = '16 16 32';
- }
- setsize (this, this.pos1, this.pos2);
+ setsize (this, this.pos1 = def.m_mins, this.pos2 = def.m_maxs);
this.SendFlags |= ISF_SIZE;
- if(itemflags & FL_POWERUP)
+ if(def.instanceOfPowerup)
this.ItemStatus |= ITS_ANIMATE1;
if(this.armorvalue || this.health)
this.ItemStatus |= ITS_ANIMATE2;
- if(itemflags & FL_WEAPON)
+ if(def.instanceOfWeaponPickup)
{
if (this.classname != "droppedweapon") // if dropped, colormap is already set up nicely
this.colormap = 1024; // color shirt=0 pants=0 grey
else
Item_Reset(this);
- Net_LinkEntity(this, !((itemflags & FL_POWERUP) || this.health || this.armorvalue), 0, ItemSend);
+ Net_LinkEntity(this, !(def.instanceOfPowerup || def.instanceOfHealth || def.instanceOfArmor), 0, ItemSend);
// call this hook after everything else has been done
if (MUTATOR_CALLHOOK(Item_Spawn, this))
this.itemdef = def,
def.m_respawntime(), // defaultrespawntime
def.m_respawntimejitter(), // defaultrespawntimejitter
- def.m_name, // itemname
- def.m_itemid, // itemid
- 0, // weaponid
def.m_itemflags // itemflags
);
}
bool ItemSend(entity this, entity to, int sf);
-float have_pickup_item(void);
+bool have_pickup_item(entity this);
const float ITEM_RESPAWN_TICKS = 10;
.float is_item;
.entity itemdef;
-void _StartItem(entity this, entity def, float defaultrespawntime, float defaultrespawntimejitter, string itemname, float itemid, float weaponid, float itemflags);
+void _StartItem(entity this, entity def, float defaultrespawntime, float defaultrespawntimejitter, float itemflags);
void target_items_use (void);
this.itemdef = def,
this.respawntime, // defaultrespawntime
this.respawntimejitter, // defaultrespawntimejitter
- e.message, // itemname
- 0, // itemid
- e.weapon, // weaponid
f // itemflags
);
#if 0 // WEAPONTODO