From f498671bdb85941e884b070c0e6d85647fca8847 Mon Sep 17 00:00:00 2001 From: otta8634 Date: Fri, 20 Dec 2024 02:18:16 +0800 Subject: [PATCH] Relocate m_color constants to common/colors.qh This allows for the colors to be used in guide descriptions in future, without causing duplicate code. This will also make editing multiple colors at once easier. Also renamed wpcolor attrib (waypointsprite color) used by weapons to m_color, as with all other item-things. --- qcsrc/client/hud/crosshair.qc | 2 +- qcsrc/common/colors.qh | 81 +++++++++++++++++++ qcsrc/common/items/item/armor.qh | 6 +- qcsrc/common/items/item/health.qh | 6 +- qcsrc/common/items/item/jetpack.qh | 5 +- qcsrc/common/monsters/monster/spider.qh | 3 +- qcsrc/common/mutators/mutator/buffs/all.inc | 28 ++++--- .../mutator/damagetext/cl_damagetext.qc | 2 +- qcsrc/common/mutators/mutator/nades/nades.inc | 24 +++--- .../common/mutators/mutator/overkill/okhmg.qh | 3 +- .../mutators/mutator/overkill/okmachinegun.qh | 4 +- .../common/mutators/mutator/overkill/oknex.qh | 4 +- .../common/mutators/mutator/overkill/okrpc.qh | 3 +- .../mutators/mutator/overkill/okshotgun.qh | 4 +- .../mutator/powerups/powerup/invisibility.qh | 5 +- .../mutator/powerups/powerup/shield.qh | 3 +- .../mutator/powerups/powerup/speed.qh | 5 +- .../mutator/powerups/powerup/strength.qh | 3 +- .../status_effects/status_effect/burning.qh | 3 +- .../status_effect/spawnshield.qh | 3 +- .../status_effects/status_effect/stunned.qh | 3 +- .../mutator/waypoints/waypointsprites.qc | 2 +- qcsrc/common/weapons/weapon.qh | 4 +- qcsrc/common/weapons/weapon/arc.qh | 4 +- qcsrc/common/weapons/weapon/blaster.qh | 4 +- qcsrc/common/weapons/weapon/crylink.qh | 4 +- qcsrc/common/weapons/weapon/devastator.qh | 4 +- qcsrc/common/weapons/weapon/electro.qh | 4 +- qcsrc/common/weapons/weapon/fireball.qh | 4 +- qcsrc/common/weapons/weapon/hagar.qh | 4 +- qcsrc/common/weapons/weapon/hlac.qh | 4 +- qcsrc/common/weapons/weapon/hook.qh | 4 +- qcsrc/common/weapons/weapon/machinegun.qh | 4 +- qcsrc/common/weapons/weapon/minelayer.qh | 4 +- qcsrc/common/weapons/weapon/mortar.qh | 4 +- qcsrc/common/weapons/weapon/porto.qh | 4 +- qcsrc/common/weapons/weapon/rifle.qh | 4 +- qcsrc/common/weapons/weapon/seeker.qh | 4 +- qcsrc/common/weapons/weapon/shockwave.qh | 4 +- qcsrc/common/weapons/weapon/shotgun.qh | 4 +- qcsrc/common/weapons/weapon/tuba.qh | 4 +- qcsrc/common/weapons/weapon/vaporizer.qh | 4 +- qcsrc/common/weapons/weapon/vortex.qh | 4 +- qcsrc/server/weapons/spawning.qc | 2 +- 44 files changed, 217 insertions(+), 71 deletions(-) create mode 100644 qcsrc/common/colors.qh diff --git a/qcsrc/client/hud/crosshair.qc b/qcsrc/client/hud/crosshair.qc index 39d568696..404bd74ca 100644 --- a/qcsrc/client/hud/crosshair.qc +++ b/qcsrc/client/hud/crosshair.qc @@ -181,7 +181,7 @@ vector crosshair_getcolor(entity this, float health_stat) { if(this != WEP_Null && hud == HUD_NORMAL) { - wcross_color = this.wpcolor; + wcross_color = this.m_color; break; } else { goto normalcolor; } diff --git a/qcsrc/common/colors.qh b/qcsrc/common/colors.qh new file mode 100644 index 000000000..610db5094 --- /dev/null +++ b/qcsrc/common/colors.qh @@ -0,0 +1,81 @@ +#pragma once + +/* + * This file holds all m_color vals for the following, + * to avoid duplicate values, since some are referenced in multiple places + * (e.g. Vortex m_color in common/weapons/weapon/vortex.qh and in the describe method of ./rifle.qh): + * - Weapons + * - Items + * - Buffs, powerups + * - Nades + * - Status effects + * Perhaps in future this file can be converted to something like gfx/menu/luma/skinvalues.txt + */ + +const vector COLOR_WEP_ARC = '1 1 1'; +const vector COLOR_WEP_BLASTER = '1 0.5 0.5'; +const vector COLOR_WEP_CRYLINK = '1 0.5 1'; +const vector COLOR_WEP_DEVASTATOR = '1 1 0'; +const vector COLOR_WEP_ELECTRO = '0 0.5 1'; +const vector COLOR_WEP_FIREBALL = '1 0.5 0'; +const vector COLOR_WEP_HAGAR = '1 1 0.5'; +const vector COLOR_WEP_HLAC = '0 1 0'; +const vector COLOR_WEP_HOOK = '0 0.5 0'; +const vector COLOR_WEP_MACHINEGUN = '1 1 0'; +const vector COLOR_WEP_MINELAYER = '0.75 1 0'; +const vector COLOR_WEP_MORTAR = '1 0 0'; +const vector COLOR_WEP_PORTO = '0.5 0.5 0.5'; +const vector COLOR_WEP_RIFLE = '0.5 1 0'; +const vector COLOR_WEP_SEEKER = '0.5 1 0'; +const vector COLOR_WEP_SHOCKWAVE = '0.5 0.25 0'; +const vector COLOR_WEP_SHOTGUN = '0.5 0.25 0'; +const vector COLOR_WEP_TUBA = '0 1 0'; +const vector COLOR_WEP_VAPORIZER = '0.5 1 1'; +const vector COLOR_WEP_VORTEX = '0.5 1 1'; +const vector COLOR_WEP_OKHMG = '0.5 0.5 0'; +const vector COLOR_WEP_OKMACHINEGUN = '1 1 0'; +const vector COLOR_WEP_OKNEX = '0.5 1 1'; +const vector COLOR_WEP_OKRPC = '0.5 0.5 0'; +const vector COLOR_WEP_OKSHOTGUN = '0.5 0.25 0'; + +const vector COLOR_ITEM_ARMOR = '0 1 0'; +const vector COLOR_ITEM_HEALTH = '1 0 0'; +const vector COLOR_ITEM_JETPACK = '0.5 0.5 0.5'; + +const vector COLOR_POWERUP_JETPACKREGEN = '1 0.5 0'; +const vector COLOR_POWERUP_EXTRALIFE = '1 0 0'; +const vector COLOR_POWERUP_INVISIBILITY = '0.5 0.5 1'; +const vector COLOR_POWERUP_SHIELD = '1 0 1'; +const vector COLOR_POWERUP_SPEED = '0.1 1 0.84'; +const vector COLOR_POWERUP_STRENGTH = '0 0 1'; + +const vector COLOR_BUFF_AMMO = '0.76 1 0.1'; +const vector COLOR_BUFF_RESISTANCE = '0.36 0 0.07'; +const vector COLOR_BUFF_MEDIC = '1 0.12 0'; +const vector COLOR_BUFF_BASH = '1 0.39 0'; +const vector COLOR_BUFF_VAMPIRE = '1 0 0.24'; +const vector COLOR_BUFF_DISABILITY = '0.94 0.3 1'; +const vector COLOR_BUFF_VENGEANCE = '1 0.23 0.61'; +const vector COLOR_BUFF_JUMP = '0.24 0.78 1'; +const vector COLOR_BUFF_INFERNO = '1 0.62 0'; +const vector COLOR_BUFF_SWAPPER = '0.63 0.36 1'; +const vector COLOR_BUFF_MAGNET = '1 0.95 0.18'; +const vector COLOR_BUFF_LUCK = '1 0.23 0.44'; +const vector COLOR_BUFF_FLIGHT = '0.23 0.44 1'; + +const vector COLOR_NADE_NORMAL = '1 1 1'; +const vector COLOR_NADE_NAPALM = '2 0.5 0'; +const vector COLOR_NADE_ICE = '0 0.5 2'; +const vector COLOR_NADE_TRANSLOCATE = '1 0 1'; +const vector COLOR_NADE_SPAWN = '1 0.9 0'; +const vector COLOR_NADE_HEAL = '1 0 0'; +const vector COLOR_NADE_MONSTER = '0.25 0.75 0'; +const vector COLOR_NADE_ENTRAP = '0.15 0.85 0'; +const vector COLOR_NADE_VEIL = '0.65 0.85 0.65'; +const vector COLOR_NADE_AMMO = '0.66 0.33 0'; +const vector COLOR_NADE_DARKNESS = '0.23 0 0.23'; + +const vector COLOR_STATUSEFFECT_BURNING = '1 0.62 0'; +const vector COLOR_STATUSEFFECT_SPAWNSHIELD = '0.36 1 0.07'; +const vector COLOR_STATUSEFFECT_STUNNED = '0.67 0.84 1'; +const vector COLOR_STATUSEFFECT_WEBBED = '0.94 0.3 1'; diff --git a/qcsrc/common/items/item/armor.qh b/qcsrc/common/items/item/armor.qh index 34d939b1a..3021c40c6 100644 --- a/qcsrc/common/items/item/armor.qh +++ b/qcsrc/common/items/item/armor.qh @@ -1,5 +1,7 @@ #pragma once +#include + #include "pickup.qh" CLASS(Armor, Pickup) #ifdef SVQC @@ -167,7 +169,7 @@ REGISTER_ITEM(ArmorBig, NEW(ArmorBig)) { if(precache_pic(strcat("gfx/hud/luma/", this.m_icon)) == "") this.m_icon = "armor"; // compatible with Xonotic v0.8.2 or lower #endif - this.m_color = '0 1 0'; + this.m_color = COLOR_ITEM_ARMOR; this.m_waypoint = _("Big armor"); #ifdef SVQC this.m_itemid = IT_RESOURCE; @@ -224,7 +226,7 @@ REGISTER_ITEM(ArmorMega, NEW(ArmorMega)) { if(precache_pic(strcat("gfx/hud/luma/", this.m_icon)) == "") this.m_icon = "item_large_armor"; // compatible with Xonotic v0.8.2 or lower #endif - this.m_color = '0 1 0'; + this.m_color = COLOR_ITEM_ARMOR; this.m_waypoint = _("Mega armor"); this.m_waypointblink = 2; #ifdef SVQC diff --git a/qcsrc/common/items/item/health.qh b/qcsrc/common/items/item/health.qh index 00fb93e5b..45346dd35 100644 --- a/qcsrc/common/items/item/health.qh +++ b/qcsrc/common/items/item/health.qh @@ -1,5 +1,7 @@ #pragma once +#include + #include "pickup.qh" CLASS(Health, Pickup) #ifdef SVQC @@ -163,7 +165,7 @@ REGISTER_ITEM(HealthBig, NEW(HealthBig)) { this.netname = "health_big"; this.m_name = _("Big health"); this.m_icon = "health_big"; - this.m_color = '1 0 0'; + this.m_color = COLOR_ITEM_HEALTH; this.m_waypoint = _("Big health"); #ifdef CSQC if(precache_pic(strcat("gfx/hud/luma/", this.m_icon)) == "") @@ -223,7 +225,7 @@ REGISTER_ITEM(HealthMega, NEW(HealthMega)) { if(precache_pic(strcat("gfx/hud/luma/", this.m_icon)) == "") this.m_icon = "item_mega_health"; // compatible with Xonotic v0.8.2 or lower #endif - this.m_color = '1 0 0'; + this.m_color = COLOR_ITEM_HEALTH; this.m_waypoint = _("Mega health"); this.m_waypointblink = 2; #ifdef SVQC diff --git a/qcsrc/common/items/item/jetpack.qh b/qcsrc/common/items/item/jetpack.qh index 38e3122f3..ba68c5363 100644 --- a/qcsrc/common/items/item/jetpack.qh +++ b/qcsrc/common/items/item/jetpack.qh @@ -5,6 +5,7 @@ #endif #include "ammo.qh" +#include #include #ifndef SVQC @@ -51,7 +52,7 @@ REGISTER_ITEM(Jetpack, NEW(Jetpack)) { this.netname = "jetpack"; this.m_name = _("Jetpack"); this.m_icon = "jetpack"; - this.m_color = '0.5 0.5 0.5'; + this.m_color = COLOR_ITEM_JETPACK; this.m_waypoint = _("Jetpack"); this.m_waypointblink = 2; #ifdef SVQC @@ -139,7 +140,7 @@ REGISTER_ITEM(JetpackRegen, NEW(JetpackRegen)) { this.netname = "fuel_regen"; this.m_name = _("Fuel regenerator"); this.m_icon = "fuelregen"; - this.m_color = '1 0.5 0'; + this.m_color = COLOR_POWERUP_JETPACKREGEN; this.m_waypoint = _("Fuel regen"); this.m_waypointblink = 2; #ifdef SVQC diff --git a/qcsrc/common/monsters/monster/spider.qh b/qcsrc/common/monsters/monster/spider.qh index 9173d7270..ee7257db7 100644 --- a/qcsrc/common/monsters/monster/spider.qh +++ b/qcsrc/common/monsters/monster/spider.qh @@ -1,6 +1,7 @@ #pragma once #include "../all.qh" +#include #ifdef GAMEQC MODEL(MON_SPIDER, M_Model("spider.dpm")); @@ -47,7 +48,7 @@ CLASS(Webbed, StatusEffects) ATTRIB(Webbed, m_name, string, _("Webbed")); ATTRIB(Webbed, m_icon, string, "buff_disability"); #endif - ATTRIB(Webbed, m_color, vector, '0.94 0.3 1'); + ATTRIB(Webbed, m_color, vector, COLOR_STATUSEFFECT_WEBBED); ATTRIB(Webbed, m_hidden, bool, true); ATTRIB(Webbed, m_lifetime, float, 10); ENDCLASS(Webbed) diff --git a/qcsrc/common/mutators/mutator/buffs/all.inc b/qcsrc/common/mutators/mutator/buffs/all.inc index e469881dc..f109da0dc 100644 --- a/qcsrc/common/mutators/mutator/buffs/all.inc +++ b/qcsrc/common/mutators/mutator/buffs/all.inc @@ -1,3 +1,5 @@ +#include + string Buff_CompatName(string buffname) { switch(buffname) @@ -20,7 +22,7 @@ CLASS(AmmoBuff, Buff) ATTRIB(AmmoBuff, netname, string, "ammo"); ATTRIB(AmmoBuff, m_icon, string, "buff_ammo"); ATTRIB(AmmoBuff, m_skin, int, 3); - ATTRIB(AmmoBuff, m_color, vector, '0.76 1 0.1'); + ATTRIB(AmmoBuff, m_color, vector, COLOR_BUFF_AMMO); #ifdef MENUQC METHOD(AmmoBuff, describe, string(AmmoBuff this)) { @@ -38,7 +40,7 @@ CLASS(ResistanceBuff, Buff) ATTRIB(ResistanceBuff, netname, string, "resistance"); ATTRIB(ResistanceBuff, m_icon, string, "buff_resistance"); ATTRIB(ResistanceBuff, m_skin, int, 0); - ATTRIB(ResistanceBuff, m_color, vector, '0.36 1 0.07'); + ATTRIB(ResistanceBuff, m_color, vector, COLOR_BUFF_RESISTANCE); #ifdef MENUQC METHOD(ResistanceBuff, describe, string(ResistanceBuff this)) { @@ -56,7 +58,7 @@ CLASS(MedicBuff, Buff) ATTRIB(MedicBuff, netname, string, "medic"); ATTRIB(MedicBuff, m_icon, string, "buff_medic"); ATTRIB(MedicBuff, m_skin, int, 1); - ATTRIB(MedicBuff, m_color, vector, '1 0.12 0'); + ATTRIB(MedicBuff, m_color, vector, COLOR_BUFF_MEDIC); #ifdef MENUQC METHOD(MedicBuff, describe, string(MedicBuff this)) { @@ -76,7 +78,7 @@ CLASS(BashBuff, Buff) ATTRIB(BashBuff, netname, string, "bash"); ATTRIB(BashBuff, m_icon, string, "buff_bash"); ATTRIB(BashBuff, m_skin, int, 5); - ATTRIB(BashBuff, m_color, vector, '1 0.39 0'); + ATTRIB(BashBuff, m_color, vector, COLOR_BUFF_BASH); #ifdef MENUQC METHOD(BashBuff, describe, string(BashBuff this)) { @@ -95,7 +97,7 @@ CLASS(VampireBuff, Buff) ATTRIB(VampireBuff, netname, string, "vampire"); ATTRIB(VampireBuff, m_icon, string, "buff_vampire"); ATTRIB(VampireBuff, m_skin, int, 2); - ATTRIB(VampireBuff, m_color, vector, '1 0 0.24'); + ATTRIB(VampireBuff, m_color, vector, COLOR_BUFF_VAMPIRE); #ifdef MENUQC METHOD(VampireBuff, describe, string(VampireBuff this)) { @@ -113,7 +115,7 @@ CLASS(DisabilityBuff, Buff) ATTRIB(DisabilityBuff, netname, string, "disability"); ATTRIB(DisabilityBuff, m_icon, string, "buff_disability"); ATTRIB(DisabilityBuff, m_skin, int, 7); - ATTRIB(DisabilityBuff, m_color, vector, '0.94 0.3 1'); + ATTRIB(DisabilityBuff, m_color, vector, COLOR_BUFF_DISABILITY); #ifdef MENUQC METHOD(DisabilityBuff, describe, string(DisabilityBuff this)) { @@ -131,7 +133,7 @@ CLASS(VengeanceBuff, Buff) ATTRIB(VengeanceBuff, netname, string, "vengeance"); ATTRIB(VengeanceBuff, m_icon, string, "buff_vengeance"); ATTRIB(VengeanceBuff, m_skin, int, 15); - ATTRIB(VengeanceBuff, m_color, vector, '1 0.23 0.61'); + ATTRIB(VengeanceBuff, m_color, vector, COLOR_BUFF_VENGEANCE); #ifdef MENUQC METHOD(VengeanceBuff, describe, string(VengeanceBuff this)) { @@ -149,7 +151,7 @@ CLASS(JumpBuff, Buff) ATTRIB(JumpBuff, netname, string, "jump"); ATTRIB(JumpBuff, m_icon, string, "buff_jump"); ATTRIB(JumpBuff, m_skin, int, 10); - ATTRIB(JumpBuff, m_color, vector, '0.24 0.78 1'); + ATTRIB(JumpBuff, m_color, vector, COLOR_BUFF_JUMP); #ifdef MENUQC METHOD(JumpBuff, describe, string(JumpBuff this)) { @@ -167,7 +169,7 @@ CLASS(InfernoBuff, Buff) ATTRIB(InfernoBuff, netname, string, "inferno"); ATTRIB(InfernoBuff, m_icon, string, "buff_inferno"); ATTRIB(InfernoBuff, m_skin, int, 16); - ATTRIB(InfernoBuff, m_color, vector, '1 0.62 0'); + ATTRIB(InfernoBuff, m_color, vector, COLOR_BUFF_INFERNO); #ifdef MENUQC METHOD(InfernoBuff, describe, string(InfernoBuff this)) { @@ -185,7 +187,7 @@ CLASS(SwapperBuff, Buff) ATTRIB(SwapperBuff, netname, string, "swapper"); ATTRIB(SwapperBuff, m_icon, string, "buff_swapper"); ATTRIB(SwapperBuff, m_skin, int, 17); - ATTRIB(SwapperBuff, m_color, vector, '0.63 0.36 1'); + ATTRIB(SwapperBuff, m_color, vector, COLOR_BUFF_SWAPPER); #ifdef MENUQC METHOD(SwapperBuff, describe, string(SwapperBuff this)) { @@ -204,7 +206,7 @@ CLASS(MagnetBuff, Buff) ATTRIB(MagnetBuff, netname, string, "magnet"); ATTRIB(MagnetBuff, m_icon, string, "buff_magnet"); ATTRIB(MagnetBuff, m_skin, int, 18); - ATTRIB(MagnetBuff, m_color, vector, '1 0.95 0.18'); + ATTRIB(MagnetBuff, m_color, vector, COLOR_BUFF_MAGNET); #ifdef MENUQC METHOD(MagnetBuff, describe, string(MagnetBuff this)) { @@ -221,7 +223,7 @@ CLASS(LuckBuff, Buff) ATTRIB(LuckBuff, netname, string, "luck"); ATTRIB(LuckBuff, m_icon, string, "buff_luck"); ATTRIB(LuckBuff, m_skin, int, 19); - ATTRIB(LuckBuff, m_color, vector, '1 0.23 0.44'); + ATTRIB(LuckBuff, m_color, vector, COLOR_BUFF_LUCK); #ifdef MENUQC METHOD(LuckBuff, describe, string(LuckBuff this)) { @@ -238,7 +240,7 @@ CLASS(FlightBuff, Buff) ATTRIB(FlightBuff, netname, string, "flight"); ATTRIB(FlightBuff, m_icon, string, "buff_flight"); ATTRIB(FlightBuff, m_skin, int, 11); - ATTRIB(FlightBuff, m_color, vector, '0.23 0.44 1'); + ATTRIB(FlightBuff, m_color, vector, COLOR_BUFF_FLIGHT); #ifdef MENUQC METHOD(FlightBuff, describe, string(FlightBuff this)) { diff --git a/qcsrc/common/mutators/mutator/damagetext/cl_damagetext.qc b/qcsrc/common/mutators/mutator/damagetext/cl_damagetext.qc index c49ebb7e5..2bd6fba28 100644 --- a/qcsrc/common/mutators/mutator/damagetext/cl_damagetext.qc +++ b/qcsrc/common/mutators/mutator/damagetext/cl_damagetext.qc @@ -85,7 +85,7 @@ CLASS(DamageText, Object) if (autocvar_cl_damagetext_color_per_weapon) { Weapon w = DEATH_WEAPONOF(this.m_deathtype); - if (w != WEP_Null) rgb = w.wpcolor; + if (w != WEP_Null) rgb = w.m_color; } vector drawfontscale_save = drawfontscale; diff --git a/qcsrc/common/mutators/mutator/nades/nades.inc b/qcsrc/common/mutators/mutator/nades/nades.inc index 7572ef006..fb416ce29 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.inc +++ b/qcsrc/common/mutators/mutator/nades/nades.inc @@ -1,3 +1,5 @@ +#include + #ifdef GAMEQC #define NADE_PROJECTILE(i, projectile, trail) MACRO_BEGIN \ this.m_projectile[i] = projectile; \ @@ -16,7 +18,7 @@ CLASS(NormalNade, Nade) #endif ENDCLASS(NormalNade) REGISTER_NADE(NORMAL, NEW(NormalNade)) { - this.m_color = '1 1 1'; + this.m_color = COLOR_NADE_NORMAL; #ifdef GAMEQC NADE_PROJECTILE(0, PROJECTILE_NADE, EFFECT_Null); NADE_PROJECTILE(1, PROJECTILE_NADE_BURN, EFFECT_Null); @@ -34,7 +36,7 @@ CLASS(NapalmNade, Nade) #endif ENDCLASS(NapalmNade) REGISTER_NADE(NAPALM, NEW(NapalmNade)) { - this.m_color = '2 0.5 0'; + this.m_color = COLOR_NADE_NAPALM; this.m_name = _("Napalm grenade"); this.m_icon = "nade_napalm"; #ifdef GAMEQC @@ -54,7 +56,7 @@ CLASS(IceNade, Nade) #endif ENDCLASS(IceNade) REGISTER_NADE(ICE, NEW(IceNade)) { - this.m_color = '0 0.5 2'; + this.m_color = COLOR_NADE_ICE; this.m_name = _("Ice grenade"); this.m_icon = "nade_ice"; #ifdef GAMEQC @@ -73,7 +75,7 @@ CLASS(TranslocateNade, Nade) #endif ENDCLASS(TranslocateNade) REGISTER_NADE(TRANSLOCATE, NEW(TranslocateNade)) { - this.m_color = '1 0 1'; + this.m_color = COLOR_NADE_TRANSLOCATE; this.m_name = _("Translocate grenade"); this.m_icon = "nade_translocate"; #ifdef GAMEQC @@ -93,7 +95,7 @@ CLASS(SpawnNade, Nade) #endif ENDCLASS(SpawnNade) REGISTER_NADE(SPAWN, NEW(SpawnNade)) { - this.m_color = '1 0.9 0'; + this.m_color = COLOR_NADE_SPAWN; this.m_name = _("Spawn grenade"); this.m_icon = "nade_spawn"; #ifdef GAMEQC @@ -113,7 +115,7 @@ CLASS(HealNade, Nade) #endif ENDCLASS(HealNade) REGISTER_NADE(HEAL, NEW(HealNade)) { - this.m_color = '1 0 0'; + this.m_color = COLOR_NADE_HEAL; this.m_name = _("Heal grenade"); this.m_icon = "nade_heal"; #ifdef GAMEQC @@ -132,7 +134,7 @@ CLASS(MonsterNade, Nade) #endif ENDCLASS(MonsterNade) REGISTER_NADE(MONSTER, NEW(MonsterNade)) { - this.m_color = '0.25 0.75 0'; + this.m_color = COLOR_NADE_MONSTER; this.m_name = _("Monster grenade"); this.m_icon = "nade_monster"; #ifdef GAMEQC @@ -152,7 +154,7 @@ CLASS(EntrapNade, Nade) #endif ENDCLASS(EntrapNade) REGISTER_NADE(ENTRAP, NEW(EntrapNade)) { - this.m_color = '0.15 0.85 0'; + this.m_color = COLOR_NADE_ENTRAP; this.m_name = _("Entrap grenade"); this.m_icon = "nade_entrap"; #ifdef GAMEQC @@ -172,7 +174,7 @@ CLASS(VeilNade, Nade) #endif ENDCLASS(VeilNade) REGISTER_NADE(VEIL, NEW(VeilNade)) { - this.m_color = '0.65 0.85 0.65'; + this.m_color = COLOR_NADE_VEIL; this.m_name = _("Veil grenade"); this.m_icon = "nade_veil"; this.m_alpha = 0.45; @@ -194,7 +196,7 @@ CLASS(AmmoNade, Nade) #endif ENDCLASS(AmmoNade) REGISTER_NADE(AMMO, NEW(AmmoNade)) { - this.m_color = '0.66 0.33 0'; + this.m_color = COLOR_NADE_AMMO; this.m_name = _("Ammo grenade"); this.m_icon = "nade_ammo"; #ifdef GAMEQC @@ -213,7 +215,7 @@ CLASS(DarknessNade, Nade) #endif ENDCLASS(DarknessNade) REGISTER_NADE(DARKNESS, NEW(DarknessNade)) { - this.m_color = '0.23 0 0.23'; + this.m_color = COLOR_NADE_DARKNESS; this.m_name = _("Darkness grenade"); this.m_icon = "nade_darkness"; #ifdef GAMEQC diff --git a/qcsrc/common/mutators/mutator/overkill/okhmg.qh b/qcsrc/common/mutators/mutator/overkill/okhmg.qh index 83988c921..5236b0f22 100644 --- a/qcsrc/common/mutators/mutator/overkill/okhmg.qh +++ b/qcsrc/common/mutators/mutator/overkill/okhmg.qh @@ -1,6 +1,7 @@ #pragma once #include +#include CLASS(OverkillHeavyMachineGun, Weapon) /* spawnfunc */ ATTRIB(OverkillHeavyMachineGun, m_canonical_spawnfunc, string, "weapon_okhmg"); @@ -8,7 +9,7 @@ CLASS(OverkillHeavyMachineGun, Weapon) /* impulse */ ATTRIB(OverkillHeavyMachineGun, impulse, int, 3); /* 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'); +/* color */ ATTRIB(OverkillHeavyMachineGun, m_color, vector, COLOR_WEP_OKHMG); /* modelname */ ATTRIB(OverkillHeavyMachineGun, mdl, string, "ok_hmg"); #ifdef GAMEQC /* model */ ATTRIB(OverkillHeavyMachineGun, m_model, Model, MDL_HMG_ITEM); diff --git a/qcsrc/common/mutators/mutator/overkill/okmachinegun.qh b/qcsrc/common/mutators/mutator/overkill/okmachinegun.qh index d3918fd36..917ca66d9 100644 --- a/qcsrc/common/mutators/mutator/overkill/okmachinegun.qh +++ b/qcsrc/common/mutators/mutator/overkill/okmachinegun.qh @@ -1,12 +1,14 @@ #pragma once +#include + CLASS(OverkillMachineGun, Weapon) /* spawnfunc */ ATTRIB(OverkillMachineGun, m_canonical_spawnfunc, string, "weapon_okmachinegun"); /* ammotype */ ATTRIB(OverkillMachineGun, ammo_type, Resource, RES_BULLETS); /* impulse */ ATTRIB(OverkillMachineGun, impulse, int, 3); /* flags */ ATTRIB(OverkillMachineGun, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_PENETRATEWALLS | WEP_FLAG_MUTATORBLOCKED); /* rating */ ATTRIB(OverkillMachineGun, bot_pickupbasevalue, float, 7000); -/* color */ ATTRIB(OverkillMachineGun, wpcolor, vector, '1 1 0'); +/* color */ ATTRIB(OverkillMachineGun, m_color, vector, COLOR_WEP_OKMACHINEGUN); /* modelname */ ATTRIB(OverkillMachineGun, mdl, string, "ok_mg"); #ifdef GAMEQC /* model */ ATTRIB(OverkillMachineGun, m_model, Model, MDL_OK_MG_ITEM); diff --git a/qcsrc/common/mutators/mutator/overkill/oknex.qh b/qcsrc/common/mutators/mutator/overkill/oknex.qh index 97fda0d79..93ee6200a 100644 --- a/qcsrc/common/mutators/mutator/overkill/oknex.qh +++ b/qcsrc/common/mutators/mutator/overkill/oknex.qh @@ -1,12 +1,14 @@ #pragma once +#include + CLASS(OverkillNex, Weapon) /* spawnfunc */ ATTRIB(OverkillNex, m_canonical_spawnfunc, string, "weapon_oknex"); /* ammotype */ ATTRIB(OverkillNex, ammo_type, Resource, RES_CELLS); /* impulse */ ATTRIB(OverkillNex, impulse, int, 7); /* flags */ ATTRIB(OverkillNex, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_MUTATORBLOCKED); /* rating */ ATTRIB(OverkillNex, bot_pickupbasevalue, float, 8000); -/* color */ ATTRIB(OverkillNex, wpcolor, vector, '0.5 1 1'); +/* color */ ATTRIB(OverkillNex, m_color, vector, COLOR_WEP_OKNEX); /* modelname */ ATTRIB(OverkillNex, mdl, string, "ok_sniper"); #ifdef GAMEQC /* model */ ATTRIB(OverkillNex, m_model, Model, MDL_OK_SNIPER_ITEM); diff --git a/qcsrc/common/mutators/mutator/overkill/okrpc.qh b/qcsrc/common/mutators/mutator/overkill/okrpc.qh index 5a1c7a29b..a18110510 100644 --- a/qcsrc/common/mutators/mutator/overkill/okrpc.qh +++ b/qcsrc/common/mutators/mutator/overkill/okrpc.qh @@ -1,6 +1,7 @@ #pragma once #include +#include CLASS(OverkillRocketPropelledChainsaw, Weapon) /* spawnfunc */ ATTRIB(OverkillRocketPropelledChainsaw, m_canonical_spawnfunc, string, "weapon_okrpc"); @@ -8,7 +9,7 @@ CLASS(OverkillRocketPropelledChainsaw, Weapon) /* impulse */ ATTRIB(OverkillRocketPropelledChainsaw, impulse, int, 9); /* 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'); +/* color */ ATTRIB(OverkillRocketPropelledChainsaw, m_color, vector, COLOR_WEP_OKRPC); /* modelname */ ATTRIB(OverkillRocketPropelledChainsaw, mdl, string, "ok_rl"); #ifdef GAMEQC /* model */ ATTRIB(OverkillRocketPropelledChainsaw, m_model, Model, MDL_RPC_ITEM); diff --git a/qcsrc/common/mutators/mutator/overkill/okshotgun.qh b/qcsrc/common/mutators/mutator/overkill/okshotgun.qh index 7753b3ea9..647215a31 100644 --- a/qcsrc/common/mutators/mutator/overkill/okshotgun.qh +++ b/qcsrc/common/mutators/mutator/overkill/okshotgun.qh @@ -1,12 +1,14 @@ #pragma once +#include + CLASS(OverkillShotgun, Weapon) /* spawnfunc */ ATTRIB(OverkillShotgun, m_canonical_spawnfunc, string, "weapon_okshotgun"); /* ammotype */ ATTRIB(OverkillShotgun, ammo_type, Resource, RES_SHELLS); /* impulse */ ATTRIB(OverkillShotgun, impulse, int, 2); /* flags */ ATTRIB(OverkillShotgun, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_MUTATORBLOCKED); /* rating */ ATTRIB(OverkillShotgun, bot_pickupbasevalue, float, 6000); -/* color */ ATTRIB(OverkillShotgun, wpcolor, vector, '0.5 0.25 0'); +/* color */ ATTRIB(OverkillShotgun, m_color, vector, COLOR_WEP_OKSHOTGUN); /* modelname */ ATTRIB(OverkillShotgun, mdl, string, "ok_shotgun"); #ifdef GAMEQC /* model */ ATTRIB(OverkillShotgun, m_model, Model, MDL_OK_SHOTGUN_ITEM); diff --git a/qcsrc/common/mutators/mutator/powerups/powerup/invisibility.qh b/qcsrc/common/mutators/mutator/powerups/powerup/invisibility.qh index 3bbb6a344..0bd65fb07 100644 --- a/qcsrc/common/mutators/mutator/powerups/powerup/invisibility.qh +++ b/qcsrc/common/mutators/mutator/powerups/powerup/invisibility.qh @@ -2,6 +2,7 @@ #include #include +#include #ifdef SVQC // For FL_POWERUP #include @@ -45,7 +46,7 @@ REGISTER_ITEM(Invisibility, NEW(Powerup)) { this.netname = "invisibility"; this.m_name = _("Invisibility"); this.m_icon = "buff_invisible"; - this.m_color = '0.5 0.5 1'; + this.m_color = COLOR_POWERUP_INVISIBILITY; this.m_waypoint = _("Invisibility"); this.m_waypointblink = 2; } @@ -56,7 +57,7 @@ SPAWNFUNC_ITEM(item_buff_invisibility, ITEM_Invisibility) CLASS(Invisibility, Powerups) ATTRIB(Invisibility, netname, string, "invisibility"); ATTRIB(Invisibility, m_name, string, _("Invisibility")); - ATTRIB(Invisibility, m_color, vector, '0.5 0.5 1'); + ATTRIB(Invisibility, m_color, vector, COLOR_POWERUP_INVISIBILITY); ATTRIB(Invisibility, m_icon, string, "buff_invisible"); #ifdef MENUQC METHOD(Invisibility, describe, string(Invisibility this)) diff --git a/qcsrc/common/mutators/mutator/powerups/powerup/shield.qh b/qcsrc/common/mutators/mutator/powerups/powerup/shield.qh index e4cdedc01..08d5b180a 100644 --- a/qcsrc/common/mutators/mutator/powerups/powerup/shield.qh +++ b/qcsrc/common/mutators/mutator/powerups/powerup/shield.qh @@ -2,6 +2,7 @@ #include #include +#include #ifdef SVQC // For FL_POWERUP #include @@ -43,7 +44,7 @@ REGISTER_ITEM(Shield, NEW(Powerup)) { this.netname = "invincible"; this.m_name = _("Shield"); this.m_icon = "shield"; - this.m_color = '1 0 1'; + this.m_color = COLOR_POWERUP_SHIELD; this.m_waypoint = _("Shield"); this.m_waypointblink = 2; } diff --git a/qcsrc/common/mutators/mutator/powerups/powerup/speed.qh b/qcsrc/common/mutators/mutator/powerups/powerup/speed.qh index 385c7615c..219a64520 100644 --- a/qcsrc/common/mutators/mutator/powerups/powerup/speed.qh +++ b/qcsrc/common/mutators/mutator/powerups/powerup/speed.qh @@ -2,6 +2,7 @@ #include #include +#include #ifdef SVQC // For FL_POWERUP #include @@ -46,7 +47,7 @@ REGISTER_ITEM(Speed, NEW(Powerup)) { this.netname = "speed"; this.m_name = _("Speed"); this.m_icon = "buff_speed"; - this.m_color = '0.1 1 0.84'; + this.m_color = COLOR_POWERUP_SPEED; this.m_waypoint = _("Speed"); this.m_waypointblink = 2; } @@ -57,7 +58,7 @@ SPAWNFUNC_ITEM(item_buff_speed, ITEM_Speed) CLASS(Speed, Powerups) ATTRIB(Speed, netname, string, "speed"); ATTRIB(Speed, m_name, string, _("Speed")); - ATTRIB(Speed, m_color, vector, '0.1 1 0.84'); + ATTRIB(Speed, m_color, vector, COLOR_POWERUP_SPEED); ATTRIB(Speed, m_icon, string, "buff_speed"); #ifdef MENUQC METHOD(Speed, describe, string(Speed this)) diff --git a/qcsrc/common/mutators/mutator/powerups/powerup/strength.qh b/qcsrc/common/mutators/mutator/powerups/powerup/strength.qh index 83fe5a40f..fd2e598f9 100644 --- a/qcsrc/common/mutators/mutator/powerups/powerup/strength.qh +++ b/qcsrc/common/mutators/mutator/powerups/powerup/strength.qh @@ -2,6 +2,7 @@ #include #include +#include #ifdef SVQC // For FL_POWERUP #include @@ -45,7 +46,7 @@ REGISTER_ITEM(Strength, NEW(Powerup)) { this.netname = "strength"; this.m_name = _("Strength"); this.m_icon = "strength"; - this.m_color = '0 0 1'; + this.m_color = COLOR_POWERUP_STRENGTH; this.m_waypoint = _("Strength"); this.m_waypointblink = 2; } diff --git a/qcsrc/common/mutators/mutator/status_effects/status_effect/burning.qh b/qcsrc/common/mutators/mutator/status_effects/status_effect/burning.qh index 8935d49a2..138b89d42 100644 --- a/qcsrc/common/mutators/mutator/status_effects/status_effect/burning.qh +++ b/qcsrc/common/mutators/mutator/status_effects/status_effect/burning.qh @@ -1,6 +1,7 @@ #pragma once #include +#include #ifdef SVQC void Fire_ApplyDamage(entity e); @@ -16,7 +17,7 @@ CLASS(Burning, StatusEffects) ATTRIB(Burning, m_name, string, _("Burning")); ATTRIB(Burning, m_icon, string, "buff_inferno"); #endif - ATTRIB(Burning, m_color, vector, '1 0.62 0'); + ATTRIB(Burning, m_color, vector, COLOR_STATUSEFFECT_BURNING); ATTRIB(Burning, m_hidden, bool, true); ATTRIB(Burning, m_lifetime, float, 10); #ifdef GAMEQC diff --git a/qcsrc/common/mutators/mutator/status_effects/status_effect/spawnshield.qh b/qcsrc/common/mutators/mutator/status_effects/status_effect/spawnshield.qh index 14db80807..638d8552c 100644 --- a/qcsrc/common/mutators/mutator/status_effects/status_effect/spawnshield.qh +++ b/qcsrc/common/mutators/mutator/status_effects/status_effect/spawnshield.qh @@ -1,6 +1,7 @@ #pragma once #include +#include CLASS(SpawnShield, StatusEffects) ATTRIB(SpawnShield, netname, string, "spawnshield"); @@ -10,7 +11,7 @@ CLASS(SpawnShield, StatusEffects) ATTRIB(SpawnShield, m_name, string, _("Spawn Shield")); ATTRIB(SpawnShield, m_icon, string, "shield"); #endif - ATTRIB(SpawnShield, m_color, vector, '0.36 1 0.07'); + ATTRIB(SpawnShield, m_color, vector, COLOR_STATUSEFFECT_SPAWNSHIELD); ATTRIB(SpawnShield, m_hidden, bool, true); ATTRIB(SpawnShield, m_lifetime, float, 10); ENDCLASS(SpawnShield) diff --git a/qcsrc/common/mutators/mutator/status_effects/status_effect/stunned.qh b/qcsrc/common/mutators/mutator/status_effects/status_effect/stunned.qh index 1acf49c12..43847aba0 100644 --- a/qcsrc/common/mutators/mutator/status_effects/status_effect/stunned.qh +++ b/qcsrc/common/mutators/mutator/status_effects/status_effect/stunned.qh @@ -1,6 +1,7 @@ #pragma once #include +#include #ifdef SVQC //void Shock_ApplyDamage(entity e); @@ -16,7 +17,7 @@ CLASS(Stunned, StatusEffects) ATTRIB(Stunned, m_name, string, _("Stunned")); ATTRIB(Stunned, m_icon, string, "buff_disability"); #endif - ATTRIB(Stunned, m_color, vector, '0.67 0.84 1'); + ATTRIB(Stunned, m_color, vector, COLOR_STATUSEFFECT_STUNNED); ATTRIB(Stunned, m_hidden, bool, true); ATTRIB(Stunned, m_lifetime, float, 10); #ifdef GAMEQC diff --git a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc index 0625f412e..c9d4d9a73 100644 --- a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc +++ b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc @@ -221,7 +221,7 @@ float spritelookupblinkvalue(entity this, string s) vector spritelookupcolor(entity this, string s, vector def) { - if (s == WP_Weapon.netname || s == RADARICON_Weapon.netname) return REGISTRY_GET(Weapons, this.wp_extra).wpcolor; + if (s == WP_Weapon.netname || s == RADARICON_Weapon.netname) return REGISTRY_GET(Weapons, this.wp_extra).m_color; if (s == WP_Item.netname || s == RADARICON_Item.netname) return REGISTRY_GET(Items, this.wp_extra).m_color; if (MUTATOR_CALLHOOK(WP_Format, this, s)) { diff --git a/qcsrc/common/weapons/weapon.qh b/qcsrc/common/weapons/weapon.qh index 8b02d203b..5554f6b60 100644 --- a/qcsrc/common/weapons/weapon.qh +++ b/qcsrc/common/weapons/weapon.qh @@ -52,8 +52,8 @@ CLASS(Weapon, Object) ATTRIB(Weapon, spawnflags, int, 0); /** M: rating : bot weapon priority */ ATTRIB(Weapon, bot_pickupbasevalue, float, 0); - /** M: color : waypointsprite color */ - ATTRIB(Weapon, wpcolor, vector, '0 0 0'); + /** M: color : waypointsprite color. previously called "wpcolor" */ + ATTRIB(Weapon, m_color, vector, '0 0 0'); /** M: modelname : name of model (without g_ v_ or h_ prefixes) */ ATTRIB(Weapon, mdl, string, ""); #ifdef GAMEQC diff --git a/qcsrc/common/weapons/weapon/arc.qh b/qcsrc/common/weapons/weapon/arc.qh index 193a66211..36b924849 100644 --- a/qcsrc/common/weapons/weapon/arc.qh +++ b/qcsrc/common/weapons/weapon/arc.qh @@ -1,12 +1,14 @@ #pragma once +#include + CLASS(Arc, Weapon) /* spawnfunc */ ATTRIB(Arc, m_canonical_spawnfunc, string, "weapon_arc"); /* ammotype */ ATTRIB(Arc, ammo_type, Resource, RES_CELLS); /* impulse */ ATTRIB(Arc, impulse, int, 3); /* flags */ ATTRIB(Arc, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_TYPE_HITSCAN); /* rating */ ATTRIB(Arc, bot_pickupbasevalue, float, 8000); -/* color */ ATTRIB(Arc, wpcolor, vector, '1 1 1'); +/* color */ ATTRIB(Arc, m_color, vector, COLOR_WEP_ARC); /* modelname */ ATTRIB(Arc, mdl, string, "arc"); #ifdef GAMEQC /* model */ ATTRIB(Arc, m_model, Model, MDL_ARC_ITEM); diff --git a/qcsrc/common/weapons/weapon/blaster.qh b/qcsrc/common/weapons/weapon/blaster.qh index 8d0186c7a..7bd781ac8 100644 --- a/qcsrc/common/weapons/weapon/blaster.qh +++ b/qcsrc/common/weapons/weapon/blaster.qh @@ -1,12 +1,14 @@ #pragma once +#include + CLASS(Blaster, Weapon) /* spawnfunc */ ATTRIB(Blaster, m_canonical_spawnfunc, string, "weapon_blaster"); /* ammotype */ //ATTRIB(Blaster, ammo_type, Resource, RES_NONE); /* impulse */ ATTRIB(Blaster, impulse, int, 1); /* flags */ ATTRIB(Blaster, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH); /* rating */ ATTRIB(Blaster, bot_pickupbasevalue, float, 0); -/* color */ ATTRIB(Blaster, wpcolor, vector, '1 0.5 0.5'); +/* color */ ATTRIB(Blaster, m_color, vector, COLOR_WEP_BLASTER); /* modelname */ ATTRIB(Blaster, mdl, string, "laser"); #ifdef GAMEQC /* model */ ATTRIB(Blaster, m_model, Model, MDL_BLASTER_ITEM); diff --git a/qcsrc/common/weapons/weapon/crylink.qh b/qcsrc/common/weapons/weapon/crylink.qh index b8aaffc5c..d7cb9eb02 100644 --- a/qcsrc/common/weapons/weapon/crylink.qh +++ b/qcsrc/common/weapons/weapon/crylink.qh @@ -1,12 +1,14 @@ #pragma once +#include + CLASS(Crylink, Weapon) /* spawnfunc */ ATTRIB(Crylink, m_canonical_spawnfunc, string, "weapon_crylink"); /* ammotype */ ATTRIB(Crylink, ammo_type, Resource, RES_CELLS); /* impulse */ ATTRIB(Crylink, impulse, int, 6); /* flags */ ATTRIB(Crylink, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH | WEP_FLAG_CANCLIMB); /* rating */ ATTRIB(Crylink, bot_pickupbasevalue, float, 6000); -/* color */ ATTRIB(Crylink, wpcolor, vector, '1 0.5 1'); +/* color */ ATTRIB(Crylink, m_color, vector, COLOR_WEP_CRYLINK); /* modelname */ ATTRIB(Crylink, mdl, string, "crylink"); #ifdef GAMEQC /* model */ ATTRIB(Crylink, m_model, Model, MDL_CRYLINK_ITEM); diff --git a/qcsrc/common/weapons/weapon/devastator.qh b/qcsrc/common/weapons/weapon/devastator.qh index 62e5d77a0..a57f87fc7 100644 --- a/qcsrc/common/weapons/weapon/devastator.qh +++ b/qcsrc/common/weapons/weapon/devastator.qh @@ -1,12 +1,14 @@ #pragma once +#include + CLASS(Devastator, Weapon) /* spawnfunc */ ATTRIB(Devastator, m_canonical_spawnfunc, string, "weapon_devastator"); /* ammotype */ ATTRIB(Devastator, ammo_type, Resource, RES_ROCKETS); /* impulse */ ATTRIB(Devastator, impulse, int, 9); /* flags */ ATTRIB(Devastator, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH); /* rating */ ATTRIB(Devastator, bot_pickupbasevalue, float, 8000); -/* color */ ATTRIB(Devastator, wpcolor, vector, '1 1 0'); +/* color */ ATTRIB(Devastator, m_color, vector, COLOR_WEP_DEVASTATOR); /* modelname */ ATTRIB(Devastator, mdl, string, "rl"); #ifdef GAMEQC /* model */ ATTRIB(Devastator, m_model, Model, MDL_DEVASTATOR_ITEM); diff --git a/qcsrc/common/weapons/weapon/electro.qh b/qcsrc/common/weapons/weapon/electro.qh index 0520bc5b9..6394ce226 100644 --- a/qcsrc/common/weapons/weapon/electro.qh +++ b/qcsrc/common/weapons/weapon/electro.qh @@ -1,12 +1,14 @@ #pragma once +#include + CLASS(Electro, Weapon) /* spawnfunc */ ATTRIB(Electro, m_canonical_spawnfunc, string, "weapon_electro"); /* ammotype */ ATTRIB(Electro, ammo_type, Resource, RES_CELLS); /* impulse */ ATTRIB(Electro, impulse, int, 5); /* flags */ ATTRIB(Electro, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH); /* rating */ ATTRIB(Electro, bot_pickupbasevalue, float, 5000); -/* color */ ATTRIB(Electro, wpcolor, vector, '0 0.5 1'); +/* color */ ATTRIB(Electro, m_color, vector, COLOR_WEP_ELECTRO); /* modelname */ ATTRIB(Electro, mdl, string, "electro"); #ifdef GAMEQC /* model */ ATTRIB(Electro, m_model, Model, MDL_ELECTRO_ITEM); diff --git a/qcsrc/common/weapons/weapon/fireball.qh b/qcsrc/common/weapons/weapon/fireball.qh index b8a518e9e..a7e2e2176 100644 --- a/qcsrc/common/weapons/weapon/fireball.qh +++ b/qcsrc/common/weapons/weapon/fireball.qh @@ -1,12 +1,14 @@ #pragma once +#include + CLASS(Fireball, Weapon) /* spawnfunc */ ATTRIB(Fireball, m_canonical_spawnfunc, string, "weapon_fireball"); /* ammotype */ //ATTRIB(Fireball, ammo_type, Resource, RES_NONE); /* impulse */ ATTRIB(Fireball, impulse, int, 9); /* flags */ ATTRIB(Fireball, spawnflags, int, WEP_FLAG_SUPERWEAPON | WEP_TYPE_SPLASH | WEP_FLAG_NODUAL); /* rating */ ATTRIB(Fireball, bot_pickupbasevalue, float, 5000); -/* color */ ATTRIB(Fireball, wpcolor, vector, '1 0.5 0'); +/* color */ ATTRIB(Fireball, m_color, vector, COLOR_WEP_FIREBALL); /* modelname */ ATTRIB(Fireball, mdl, string, "fireball"); #ifdef GAMEQC /* model */ ATTRIB(Fireball, m_model, Model, MDL_FIREBALL_ITEM); diff --git a/qcsrc/common/weapons/weapon/hagar.qh b/qcsrc/common/weapons/weapon/hagar.qh index a028f7112..7b3b42dc6 100644 --- a/qcsrc/common/weapons/weapon/hagar.qh +++ b/qcsrc/common/weapons/weapon/hagar.qh @@ -1,12 +1,14 @@ #pragma once +#include + CLASS(Hagar, Weapon) /* spawnfunc */ ATTRIB(Hagar, m_canonical_spawnfunc, string, "weapon_hagar"); /* ammotype */ ATTRIB(Hagar, ammo_type, Resource, RES_ROCKETS); /* impulse */ ATTRIB(Hagar, impulse, int, 8); /* flags */ ATTRIB(Hagar, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH); /* rating */ ATTRIB(Hagar, bot_pickupbasevalue, float, 6000); -/* color */ ATTRIB(Hagar, wpcolor, vector, '1 1 0.5'); +/* color */ ATTRIB(Hagar, m_color, vector, COLOR_WEP_HAGAR); /* modelname */ ATTRIB(Hagar, mdl, string, "hagar"); #ifdef GAMEQC /* model */ ATTRIB(Hagar, m_model, Model, MDL_HAGAR_ITEM); diff --git a/qcsrc/common/weapons/weapon/hlac.qh b/qcsrc/common/weapons/weapon/hlac.qh index 181f2c3c5..77bb82df7 100644 --- a/qcsrc/common/weapons/weapon/hlac.qh +++ b/qcsrc/common/weapons/weapon/hlac.qh @@ -1,12 +1,14 @@ #pragma once +#include + CLASS(HLAC, Weapon) /* spawnfunc */ ATTRIB(HLAC, m_canonical_spawnfunc, string, "weapon_hlac"); /* ammotype */ ATTRIB(HLAC, ammo_type, Resource, RES_CELLS); /* impulse */ ATTRIB(HLAC, impulse, int, 6); /* flags */ ATTRIB(HLAC, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH); /* rating */ ATTRIB(HLAC, bot_pickupbasevalue, float, 4000); -/* color */ ATTRIB(HLAC, wpcolor, vector, '0 1 0'); +/* color */ ATTRIB(HLAC, m_color, vector, COLOR_WEP_HLAC); /* modelname */ ATTRIB(HLAC, mdl, string, "hlac"); #ifdef GAMEQC /* model */ ATTRIB(HLAC, m_model, Model, MDL_HLAC_ITEM); diff --git a/qcsrc/common/weapons/weapon/hook.qh b/qcsrc/common/weapons/weapon/hook.qh index 924bde024..4d974bace 100644 --- a/qcsrc/common/weapons/weapon/hook.qh +++ b/qcsrc/common/weapons/weapon/hook.qh @@ -1,12 +1,14 @@ #pragma once +#include + CLASS(Hook, Weapon) /* spawnfunc */ ATTRIB(Hook, m_canonical_spawnfunc, string, "weapon_hook"); /* ammotype */ ATTRIB(Hook, ammo_type, Resource, RES_FUEL); /* impulse */ ATTRIB(Hook, impulse, int, 0); /* flags */ ATTRIB(Hook, spawnflags, int, WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH | WEP_FLAG_NOTRUEAIM); /* rating */ ATTRIB(Hook, bot_pickupbasevalue, float, 0); -/* color */ ATTRIB(Hook, wpcolor, vector, '0 0.5 0'); +/* color */ ATTRIB(Hook, m_color, vector, COLOR_WEP_HOOK); /* modelname */ ATTRIB(Hook, mdl, string, "hookgun"); #ifdef GAMEQC /* model */ ATTRIB(Hook, m_model, Model, MDL_HOOK_ITEM); diff --git a/qcsrc/common/weapons/weapon/machinegun.qh b/qcsrc/common/weapons/weapon/machinegun.qh index c0bbc97e0..cf700397a 100644 --- a/qcsrc/common/weapons/weapon/machinegun.qh +++ b/qcsrc/common/weapons/weapon/machinegun.qh @@ -1,12 +1,14 @@ #pragma once +#include + CLASS(MachineGun, Weapon) /* spawnfunc */ ATTRIB(MachineGun, m_canonical_spawnfunc, string, "weapon_machinegun"); /* ammotype */ ATTRIB(MachineGun, ammo_type, Resource, RES_BULLETS); /* impulse */ ATTRIB(MachineGun, impulse, int, 3); /* flags */ ATTRIB(MachineGun, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_PENETRATEWALLS | WEP_FLAG_BLEED); /* rating */ ATTRIB(MachineGun, bot_pickupbasevalue, float, 7000); -/* color */ ATTRIB(MachineGun, wpcolor, vector, '1 1 0'); +/* color */ ATTRIB(MachineGun, m_color, vector, COLOR_WEP_MACHINEGUN); /* modelname */ ATTRIB(MachineGun, mdl, string, "uzi"); #ifdef GAMEQC /* model */ ATTRIB(MachineGun, m_model, Model, MDL_MACHINEGUN_ITEM); diff --git a/qcsrc/common/weapons/weapon/minelayer.qh b/qcsrc/common/weapons/weapon/minelayer.qh index 671c20305..06e454bb7 100644 --- a/qcsrc/common/weapons/weapon/minelayer.qh +++ b/qcsrc/common/weapons/weapon/minelayer.qh @@ -1,12 +1,14 @@ #pragma once +#include + CLASS(MineLayer, Weapon) /* spawnfunc */ ATTRIB(MineLayer, m_canonical_spawnfunc, string, "weapon_minelayer"); /* ammotype */ ATTRIB(MineLayer, ammo_type, Resource, RES_ROCKETS); /* impulse */ ATTRIB(MineLayer, impulse, int, 4); /* flags */ ATTRIB(MineLayer, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH); /* rating */ ATTRIB(MineLayer, bot_pickupbasevalue, float, 7000); -/* color */ ATTRIB(MineLayer, wpcolor, vector, '0.75 1 0'); +/* color */ ATTRIB(MineLayer, m_color, vector, COLOR_WEP_MINELAYER); /* modelname */ ATTRIB(MineLayer, mdl, string, "minelayer"); #ifdef GAMEQC /* model */ ATTRIB(MineLayer, m_model, Model, MDL_MINELAYER_ITEM); diff --git a/qcsrc/common/weapons/weapon/mortar.qh b/qcsrc/common/weapons/weapon/mortar.qh index 5c8189ca1..c7903fe63 100644 --- a/qcsrc/common/weapons/weapon/mortar.qh +++ b/qcsrc/common/weapons/weapon/mortar.qh @@ -1,12 +1,14 @@ #pragma once +#include + CLASS(Mortar, Weapon) /* spawnfunc */ ATTRIB(Mortar, m_canonical_spawnfunc, string, "weapon_mortar"); /* ammotype */ ATTRIB(Mortar, ammo_type, Resource, RES_ROCKETS); /* impulse */ ATTRIB(Mortar, impulse, int, 4); /* flags */ ATTRIB(Mortar, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH | WEP_FLAG_NOTRUEAIM); /* rating */ ATTRIB(Mortar, bot_pickupbasevalue, float, 7000); -/* color */ ATTRIB(Mortar, wpcolor, vector, '1 0 0'); +/* color */ ATTRIB(Mortar, m_color, vector, COLOR_WEP_MORTAR); /* modelname */ ATTRIB(Mortar, mdl, string, "gl"); #ifdef GAMEQC /* model */ ATTRIB(Mortar, m_model, Model, MDL_MORTAR_ITEM); diff --git a/qcsrc/common/weapons/weapon/porto.qh b/qcsrc/common/weapons/weapon/porto.qh index 2d711a770..b83316ca0 100644 --- a/qcsrc/common/weapons/weapon/porto.qh +++ b/qcsrc/common/weapons/weapon/porto.qh @@ -1,12 +1,14 @@ #pragma once +#include + CLASS(PortoLaunch, Weapon) /* spawnfunc */ ATTRIB(PortoLaunch, m_canonical_spawnfunc, string, "weapon_porto"); /* ammotype */ ATTRIB(PortoLaunch, ammo_type, Resource, RES_NONE); /* impulse */ ATTRIB(PortoLaunch, impulse, int, 0); /* flags */ ATTRIB(PortoLaunch, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_SUPERWEAPON | WEP_FLAG_NODUAL | WEP_FLAG_NOTRUEAIM); /* rating */ ATTRIB(PortoLaunch, bot_pickupbasevalue, float, 0); -/* color */ ATTRIB(PortoLaunch, wpcolor, vector, '0.5 0.5 0.5'); +/* color */ ATTRIB(PortoLaunch, m_color, vector, COLOR_WEP_PORTO); /* modelname */ ATTRIB(PortoLaunch, mdl, string, "porto"); #ifdef GAMEQC /* model */ ATTRIB(PortoLaunch, m_model, Model, MDL_PORTO_ITEM); diff --git a/qcsrc/common/weapons/weapon/rifle.qh b/qcsrc/common/weapons/weapon/rifle.qh index 4239b0bcf..40475cb0f 100644 --- a/qcsrc/common/weapons/weapon/rifle.qh +++ b/qcsrc/common/weapons/weapon/rifle.qh @@ -1,12 +1,14 @@ #pragma once +#include + CLASS(Rifle, Weapon) /* spawnfunc */ ATTRIB(Rifle, m_canonical_spawnfunc, string, "weapon_rifle"); /* ammotype */ ATTRIB(Rifle, ammo_type, Resource, RES_BULLETS); /* impulse */ ATTRIB(Rifle, impulse, int, 7); /* flags */ ATTRIB(Rifle, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_PENETRATEWALLS); /* rating */ ATTRIB(Rifle, bot_pickupbasevalue, float, 7000); -/* color */ ATTRIB(Rifle, wpcolor, vector, '0.5 1 0'); +/* color */ ATTRIB(Rifle, m_color, vector, COLOR_WEP_RIFLE); /* modelname */ ATTRIB(Rifle, mdl, string, "campingrifle"); #ifdef GAMEQC /* model */ ATTRIB(Rifle, m_model, Model, MDL_RIFLE_ITEM); diff --git a/qcsrc/common/weapons/weapon/seeker.qh b/qcsrc/common/weapons/weapon/seeker.qh index 3681e1547..e6081a733 100644 --- a/qcsrc/common/weapons/weapon/seeker.qh +++ b/qcsrc/common/weapons/weapon/seeker.qh @@ -1,12 +1,14 @@ #pragma once +#include + CLASS(Seeker, Weapon) /* spawnfunc */ ATTRIB(Seeker, m_canonical_spawnfunc, string, "weapon_seeker"); /* ammotype */ ATTRIB(Seeker, ammo_type, Resource, RES_ROCKETS); /* impulse */ ATTRIB(Seeker, impulse, int, 8); /* flags */ ATTRIB(Seeker, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH); /* rating */ ATTRIB(Seeker, bot_pickupbasevalue, float, 5000); -/* color */ ATTRIB(Seeker, wpcolor, vector, '0.5 1 0'); +/* color */ ATTRIB(Seeker, m_color, vector, COLOR_WEP_SEEKER); /* modelname */ ATTRIB(Seeker, mdl, string, "seeker"); #ifdef GAMEQC /* model */ ATTRIB(Seeker, m_model, Model, MDL_SEEKER_ITEM); diff --git a/qcsrc/common/weapons/weapon/shockwave.qh b/qcsrc/common/weapons/weapon/shockwave.qh index d9716f1f3..33a7d1922 100644 --- a/qcsrc/common/weapons/weapon/shockwave.qh +++ b/qcsrc/common/weapons/weapon/shockwave.qh @@ -1,12 +1,14 @@ #pragma once +#include + CLASS(Shockwave, Weapon) /* spawnfunc */ ATTRIB(Shockwave, m_canonical_spawnfunc, string, "weapon_shockwave"); /* ammotype */ //ATTRIB(Shockwave, ammo_type, Resource, RES_NONE); /* impulse */ ATTRIB(Shockwave, impulse, int, 2); /* flags */ ATTRIB(Shockwave, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | 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'); +/* color */ ATTRIB(Shockwave, m_color, vector, COLOR_WEP_SHOCKWAVE); /* modelname */ ATTRIB(Shockwave, mdl, string, "shotgun"); #ifdef GAMEQC /* model */ ATTRIB(Shockwave, m_model, Model, MDL_SHOCKWAVE_ITEM); diff --git a/qcsrc/common/weapons/weapon/shotgun.qh b/qcsrc/common/weapons/weapon/shotgun.qh index 7de5a6036..4fe8e10a9 100644 --- a/qcsrc/common/weapons/weapon/shotgun.qh +++ b/qcsrc/common/weapons/weapon/shotgun.qh @@ -1,12 +1,14 @@ #pragma once +#include + CLASS(Shotgun, Weapon) /* spawnfunc */ ATTRIB(Shotgun, m_canonical_spawnfunc, string, "weapon_shotgun"); /* ammotype */ ATTRIB(Shotgun, ammo_type, Resource, RES_SHELLS); /* impulse */ ATTRIB(Shotgun, impulse, int, 2); /* flags */ ATTRIB(Shotgun, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_TYPE_MELEE_SEC | WEP_FLAG_BLEED); /* rating */ ATTRIB(Shotgun, bot_pickupbasevalue, float, 6000); -/* color */ ATTRIB(Shotgun, wpcolor, vector, '0.5 0.25 0'); +/* color */ ATTRIB(Shotgun, m_color, vector, COLOR_WEP_SHOTGUN); /* modelname */ ATTRIB(Shotgun, mdl, string, "shotgun"); #ifdef GAMEQC /* model */ ATTRIB(Shotgun, m_model, Model, MDL_SHOTGUN_ITEM); diff --git a/qcsrc/common/weapons/weapon/tuba.qh b/qcsrc/common/weapons/weapon/tuba.qh index 1f571f57f..c7fc19978 100644 --- a/qcsrc/common/weapons/weapon/tuba.qh +++ b/qcsrc/common/weapons/weapon/tuba.qh @@ -1,11 +1,13 @@ #pragma once +#include + CLASS(Tuba, Weapon) /* spawnfunc */ ATTRIB(Tuba, m_canonical_spawnfunc, string, "weapon_tuba"); /* impulse */ ATTRIB(Tuba, impulse, int, 1); /* flags */ ATTRIB(Tuba, spawnflags, int, WEP_FLAG_HIDDEN | WEP_TYPE_SPLASH | WEP_FLAG_NODUAL | WEP_FLAG_NOTRUEAIM); /* rating */ ATTRIB(Tuba, bot_pickupbasevalue, float, 2000); -/* color */ ATTRIB(Tuba, wpcolor, vector, '0 1 0'); +/* color */ ATTRIB(Tuba, m_color, vector, COLOR_WEP_TUBA); /* modelname */ ATTRIB(Tuba, mdl, string, "tuba"); #ifdef GAMEQC /* model */ ATTRIB(Tuba, m_model, Model, MDL_TUBA_ITEM); diff --git a/qcsrc/common/weapons/weapon/vaporizer.qh b/qcsrc/common/weapons/weapon/vaporizer.qh index 241e2965a..7b9147720 100644 --- a/qcsrc/common/weapons/weapon/vaporizer.qh +++ b/qcsrc/common/weapons/weapon/vaporizer.qh @@ -1,12 +1,14 @@ #pragma once +#include + CLASS(Vaporizer, Weapon) /* spawnfunc */ ATTRIB(Vaporizer, m_canonical_spawnfunc, string, "weapon_vaporizer"); /* ammotype */ ATTRIB(Vaporizer, ammo_type, Resource, RES_CELLS); /* impulse */ ATTRIB(Vaporizer, impulse, int, 7); /* flags */ ATTRIB(Vaporizer, spawnflags, int, WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_FLAG_SUPERWEAPON | WEP_TYPE_HITSCAN | WEP_FLAG_NODUAL); /* rating */ ATTRIB(Vaporizer, bot_pickupbasevalue, float, 10000); -/* color */ ATTRIB(Vaporizer, wpcolor, vector, '0.5 1 1'); +/* color */ ATTRIB(Vaporizer, m_color, vector, COLOR_WEP_VAPORIZER); /* modelname */ ATTRIB(Vaporizer, mdl, string, "minstanex"); #ifdef GAMEQC /* model */ ATTRIB(Vaporizer, m_model, Model, MDL_VAPORIZER_ITEM); diff --git a/qcsrc/common/weapons/weapon/vortex.qh b/qcsrc/common/weapons/weapon/vortex.qh index 5e41fda7a..b1061ced7 100644 --- a/qcsrc/common/weapons/weapon/vortex.qh +++ b/qcsrc/common/weapons/weapon/vortex.qh @@ -1,12 +1,14 @@ #pragma once +#include + CLASS(Vortex, Weapon) /* spawnfunc */ ATTRIB(Vortex, m_canonical_spawnfunc, string, "weapon_vortex"); /* ammotype */ ATTRIB(Vortex, ammo_type, Resource, RES_CELLS); /* impulse */ ATTRIB(Vortex, impulse, int, 7); /* flags */ ATTRIB(Vortex, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN); /* rating */ ATTRIB(Vortex, bot_pickupbasevalue, float, 8000); -/* color */ ATTRIB(Vortex, wpcolor, vector, '0.5 1 1'); +/* color */ ATTRIB(Vortex, m_color, vector, COLOR_WEP_VORTEX); /* modelname */ ATTRIB(Vortex, mdl, string, "nex"); #ifdef GAMEQC /* model */ ATTRIB(Vortex, m_model, Model, MDL_VORTEX_ITEM); diff --git a/qcsrc/server/weapons/spawning.qc b/qcsrc/server/weapons/spawning.qc index 8ce5c570b..f614f4aff 100644 --- a/qcsrc/server/weapons/spawning.qc +++ b/qcsrc/server/weapons/spawning.qc @@ -150,7 +150,7 @@ void weapon_defaultspawnfunc(entity this, Weapon wpn) this.pickup_anyway = true; if(!this.owner) - this.glowmod = wpn.wpcolor; + this.glowmod = wpn.m_color; else this.glowmod = colormapPaletteColor(this.owner.clientcolors & 0x0F, true); -- 2.39.2