}
vector spritelookupcolor(string s, vector def)
{
+ if(substring(s, 0, 4) == "wpn-")
+ return (get_weaponinfo(stof(substring(s, 4, strlen(s)))).wpcolor);
+
switch(s)
{
case "keycarrier-friend": return '0 1 0';
- case "wpn-laser": return '1 0.5 0.5';
- case "wpn-shotgun": return '0.5 0.25 0';
- case "wpn-uzi": return '1 1 0';
- case "wpn-gl": return '1 0 0';
- case "wpn-electro": return '0 0.5 1';
- case "wpn-crylink": return '1 0.5 1';
- case "wpn-nex": return '0.5 1 1';
- case "wpn-hagar": return '1 1 0.5';
- case "wpn-rl": return '1 1 0';
- case "wpn-porto": return '0.5 0.5 0.5';
- case "wpn-vaporizer": return '0.5 1 1';
- case "wpn-hookgun": return '0 0.5 0';
- case "wpn-fireball": return '1 0.5 0';
- case "wpn-hlac": return '0 1 0';
- case "wpn-campingrifle": return '0.5 1 0';
- case "wpn-minelayer": return '0.75 1 0';
default: return def;
}
}
string spritelookuptext(string s)
{
+ if(substring(s, 0, 4) == "wpn-")
+ {
+ print(s, "\n");
+ return (get_weaponinfo(stof(substring(s, 4, strlen(s)))).message);
+ }
+
switch(s)
{
case "as-push": return _("Push");
case "nb-ball": return _("Ball");
case "ka-ball": return _("Ball");
case "ka-ballcarrier": return _("Ball carrier");
- case "wpn-laser": return _("Laser");
- case "wpn-shotgun": return _("Shotgun");
- case "wpn-uzi": return _("Machine Gun");
- case "wpn-gl": return _("Mortar");
- case "wpn-electro": return _("Electro");
- case "wpn-crylink": return _("Crylink");
- case "wpn-nex": return _("Nex");
- case "wpn-hagar": return _("Hagar");
- case "wpn-rl": return _("Rocket Launcher");
- case "wpn-porto": return _("Port-O-Launch");
- case "wpn-vaporizer": return _("Vaporizer");
- case "wpn-hookgun": return _("Hook");
- case "wpn-fireball": return _("Fireball");
- case "wpn-hlac": return _("HLAC");
- case "wpn-campingrifle": return _("Rifle");
- case "wpn-minelayer": return _("Mine Layer");
case "dom-neut": return _("Control point");
case "dom-red": return _("Control point");
case "dom-blue": return _("Control point");
/* impulse */ 3,
/* flags */ WEP_FLAG_NORMAL,
/* rating */ BOT_PICKUP_RATING_HIGH,
+/* color */ '1 1 1',
/* model */ "arc",
/* netname */ "arc",
/* fullname */ _("Arc")
/* impulse */ 1,
/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH,
/* rating */ 0,
+/* color */ '1 0.5 0.5',
/* model */ "laser",
/* netname */ "laser",
/* fullname */ _("Blaster")
/* impulse */ 6,
/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH,
/* rating */ BOT_PICKUP_RATING_MID,
+/* color */ '1 0.5 1',
/* model */ "crylink",
/* netname */ "crylink",
/* fullname */ _("Crylink")
/* impulse */ 9,
/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH,
/* rating */ BOT_PICKUP_RATING_HIGH,
+/* color */ '1 1 0',
/* model */ "rl",
/* netname */ "devastator",
/* fullname */ _("Devastator")
/* impulse */ 5,
/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH,
/* rating */ BOT_PICKUP_RATING_MID,
+/* color */ '0 0.5 1',
/* model */ "electro",
/* netname */ "electro",
/* fullname */ _("Electro")
/* impulse */ 9,
/* flags */ WEP_FLAG_SUPERWEAPON | WEP_TYPE_SPLASH,
/* rating */ BOT_PICKUP_RATING_MID,
+/* color */ '1 0.5 0',
/* model */ "fireball",
/* netname */ "fireball",
/* fullname */ _("Fireball")
/* impulse */ 8,
/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH,
/* rating */ BOT_PICKUP_RATING_MID,
+/* color */ '1 1 0.5',
/* model */ "hagar",
/* netname */ "hagar",
/* fullname */ _("Hagar")
/* impulse */ 6,
/* flags */ WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH,
/* rating */ BOT_PICKUP_RATING_MID,
+/* color */ '0 1 0',
/* model */ "hlac",
/* netname */ "hlac",
/* fullname */ _("Heavy Laser Assault Cannon")
/* impulse */ 0,
/* flags */ WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH,
/* rating */ 0,
+/* color */ '0 0.5 0',
/* model */ "hookgun",
/* netname */ "hook",
/* fullname */ _("Grappling Hook")
/* impulse */ 3,
/* flags */ WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN,
/* rating */ BOT_PICKUP_RATING_MID,
+/* color */ '1 1 0',
/* model */ "uzi",
/* netname */ "uzi",
/* fullname */ _("Machine Gun")
/* impulse */ 4,
/* flags */ WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH,
/* rating */ BOT_PICKUP_RATING_HIGH,
+/* color */ '0.75 1 0',
/* model */ "minelayer",
/* netname */ "minelayer",
/* fullname */ _("Mine Layer")
/* impulse */ 4,
/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH,
/* rating */ BOT_PICKUP_RATING_MID,
+/* color */ '1 0 0',
/* model */ "gl",
/* netname */ "grenadelauncher",
/* fullname */ _("Mortar")
/* impulse */ 7,
/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN,
/* rating */ BOT_PICKUP_RATING_HIGH,
+/* color */ '0.5 1 1',
/* model */ "nex",
/* netname */ "nex",
/* fullname */ _("Vortex")
/* impulse */ 0,
/* flags */ WEP_TYPE_OTHER | WEP_FLAG_SUPERWEAPON,
/* rating */ 0,
+/* color */ '0.5 0.5 0.5',
/* model */ "porto" ,
/* netname */ "porto",
/* fullname */ _("Port-O-Launch")
/* impulse */ 7,
/* flags */ WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN,
/* rating */ BOT_PICKUP_RATING_MID,
+/* color */ '0.5 1 0',
/* model */ "campingrifle",
/* netname */ "rifle",
/* fullname */ _("Rifle")
/* impulse */ 8,
/* flags */ WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH,
/* rating */ BOT_PICKUP_RATING_MID,
+/* color */ '0.5 1 0',
/* model */ "seeker",
/* netname */ "seeker",
/* fullname */ _("T.A.G. Seeker")
/* impulse */ 2,
/* flags */ WEP_FLAG_NORMAL | WEP_TYPE_HITSCAN,
/* rating */ BOT_PICKUP_RATING_LOW,
+/* color */ '0.5 0.25 0',
/* model */ "shotgun",
/* netname */ "shockwave",
/* fullname */ _("Shockwave")
/* impulse */ 2,
/* flags */ WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_MUTATORBLOCKED,
/* rating */ BOT_PICKUP_RATING_LOW,
+/* color */ '0.5 0.25 0',
/* model */ "shotgun",
/* shortname */ "shotgun",
/* fullname */ _("Shotgun")
/* impulse */ 1,
/* flags */ WEP_FLAG_HIDDEN | WEP_TYPE_SPLASH,
/* rating */ BOT_PICKUP_RATING_MID,
+/* color */ '0 1 0',
/* model */ "tuba",
/* netname */ "tuba",
/* xgettext:no-c-format */
/* impulse */ 7,
/* flags */ WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_FLAG_SUPERWEAPON | WEP_TYPE_HITSCAN,
/* rating */ BOT_PICKUP_RATING_HIGH,
+/* color */ '0.5 1 1',
/* model */ "minstanex",
/* netname */ "minstanex",
/* fullname */ _("Vaporizer")
}
#endif
-void register_weapon(float id, WepSet bit, float(float) func, .float ammotype, float i, float weapontype, float pickupbasevalue, string modelname, string shortname, string wname)
+void register_weapon(float id, WepSet bit, float(float) func, .float ammotype, float i, float weapontype, float pickupbasevalue, vector clr, string modelname, string shortname, string wname)
{
entity e;
weapon_info[id - 1] = e = spawn();
e.message = wname;
//e.items = ammotype;
e.weapon_func = func;
+ e.wpcolor = clr;
e.mdl = modelname;
e.model = strzone(strcat("models/weapons/g_", modelname, ".md3"));
e.spawnflags = weapontype;
- e.model2 = strzone(strcat("wpn-", e.mdl));
+ e.model2 = strzone(strcat("wpn-", ftos(id)));
e.impulse = i;
e.bot_pickupbasevalue = pickupbasevalue;
e.current_ammo = ammotype;
.string message; // human readable name
.float items; // IT_...
.float(float) weapon_func; // w_...
+.vector wpcolor; // waypointsprite color
.string mdl; // modelname without g_, v_, w_
.string model; // full name of g_ model
.float spawnflags; // WEPSPAWNFLAG_... combined
#define WEP_SET_PROP(wepid,wepname,type,prop,name) get_weaponinfo(WEP_##wepid).##prop = autocvar_g_balance_##wepname##_##name;
float w_null(float dummy);
-void register_weapon(float id, WepSet bit, float(float) func, .float ammotype, float i, float weapontype, float pickupbasevalue, string modelname, string shortname, string wname);
+void register_weapon(float id, WepSet bit, float(float) func, .float ammotype, float i, float weapontype, float pickupbasevalue, vector clr, string modelname, string shortname, string wname);
void register_weapons_done();
// note: the fabs call is just there to hide "if result is constant" warning
-#define REGISTER_WEAPON_2(id,bit,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname) \
+#define REGISTER_WEAPON_2(id,bit,func,ammotype,i,weapontype,pickupbasevalue,clr,modelname,shortname,wname) \
float id; \
WepSet bit; \
float func(float); \
if((weapontype) & WEP_FLAG_SUPERWEAPON) \
WEPSET_SUPERWEAPONS |= bit; \
++WEP_COUNT; \
- register_weapon(id,bit,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname); \
+ register_weapon(id,bit,func,ammotype,i,weapontype,pickupbasevalue,clr,modelname,shortname,wname); \
} \
ACCUMULATE_FUNCTION(RegisterWeapons, RegisterWeapons_##id)
#ifdef MENUQC
-#define REGISTER_WEAPON(id,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname) \
- REGISTER_WEAPON_2(WEP_##id,WEPSET_##id,w_null,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname)
+#define REGISTER_WEAPON(id,func,ammotype,i,weapontype,pickupbasevalue,clr,modelname,shortname,wname) \
+ REGISTER_WEAPON_2(WEP_##id,WEPSET_##id,w_null,ammotype,i,weapontype,pickupbasevalue,clr,modelname,shortname,wname)
#else
-#define REGISTER_WEAPON(id,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname) \
- REGISTER_WEAPON_2(WEP_##id,WEPSET_##id,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname)
+#define REGISTER_WEAPON(id,func,ammotype,i,weapontype,pickupbasevalue,clr,modelname,shortname,wname) \
+ REGISTER_WEAPON_2(WEP_##id,WEPSET_##id,func,ammotype,i,weapontype,pickupbasevalue,clr,modelname,shortname,wname)
#endif
#include "all.qh"