REGISTER_WEAPON(
/* WEP_##id */ ARC,
/* function */ w_arc,
-/* ammotype */ IT_CELLS,
+/* ammotype */ ammo_cells,
/* impulse */ 5,
/* flags */ WEP_FLAG_NORMAL,
/* rating */ BOT_PICKUP_RATING_HIGH,
REGISTER_WEAPON(
/* WEP_##id */ BLASTER,
/* function */ W_Blaster,
-/* ammotype */ 0,
+/* ammotype */ ammo_none,
/* impulse */ 1,
/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH,
/* rating */ 0,
REGISTER_WEAPON(
/* WEP_##id */ CRYLINK,
/* function */ w_crylink,
-/* ammotype */ IT_CELLS,
+/* ammotype */ ammo_cells,
/* impulse */ 6,
/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH,
/* rating */ BOT_PICKUP_RATING_MID,
REGISTER_WEAPON(
/* WEP_##id */ DEVASTATOR,
/* function */ W_Devastator,
-/* ammotype */ IT_ROCKETS,
+/* ammotype */ ammo_rockets,
/* impulse */ 9,
/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH,
/* rating */ BOT_PICKUP_RATING_HIGH,
REGISTER_WEAPON(
/* WEP_##id */ ELECTRO,
/* function */ W_Electro,
-/* ammotype */ IT_CELLS,
+/* ammotype */ ammo_cells,
/* impulse */ 5,
/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH,
/* rating */ BOT_PICKUP_RATING_MID,
REGISTER_WEAPON(
/* WEP_##id */ FIREBALL,
/* function */ w_fireball,
-/* ammotype */ 0,
+/* ammotype */ ammo_none, // WEAPONTODO
/* impulse */ 9,
/* flags */ WEP_FLAG_SUPERWEAPON | WEP_TYPE_SPLASH,
/* rating */ BOT_PICKUP_RATING_MID,
REGISTER_WEAPON(
/* WEP_##id */ HAGAR,
/* function */ w_hagar,
-/* ammotype */ IT_ROCKETS,
+/* ammotype */ ammo_rockets,
/* impulse */ 8,
/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH,
/* rating */ BOT_PICKUP_RATING_MID,
REGISTER_WEAPON(
/* WEP_##id */ HLAC,
/* function */ w_hlac,
-/* ammotype */ IT_CELLS,
+/* ammotype */ ammo_cells,
/* impulse */ 6,
/* flags */ WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH,
/* rating */ BOT_PICKUP_RATING_MID,
REGISTER_WEAPON(
/* WEP_##id */ HOOK,
/* function */ w_hook,
-/* ammotype */ IT_CELLS|IT_FUEL,
+/* ammotype */ ammo_fuel,
/* impulse */ 0,
/* flags */ WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH,
/* rating */ 0,
REGISTER_WEAPON(
/* WEP_##id */ UZI,
/* function */ w_uzi,
-/* ammotype */ IT_NAILS,
+/* ammotype */ ammo_nails,
/* impulse */ 3,
/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN,
/* rating */ BOT_PICKUP_RATING_MID,
REGISTER_WEAPON(
/* WEP_##id */ MINE_LAYER,
/* function */ w_minelayer,
-/* ammotype */ IT_ROCKETS,
+/* ammotype */ ammo_rockets,
/* impulse */ 4,
/* flags */ WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH,
/* rating */ BOT_PICKUP_RATING_HIGH,
REGISTER_WEAPON(
/* WEP_##id */ MINSTANEX,
/* function */ w_minstanex,
-/* ammotype */ IT_CELLS,
+/* ammotype */ ammo_cells,
/* impulse */ 7,
/* flags */ WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_FLAG_SUPERWEAPON | WEP_TYPE_HITSCAN,
/* rating */ BOT_PICKUP_RATING_HIGH,
REGISTER_WEAPON(
/* WEP_##id */ MORTAR,
/* function */ w_glauncher,
-/* ammotype */ IT_ROCKETS,
+/* ammotype */ ammo_rockets,
/* impulse */ 4,
/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH,
/* rating */ BOT_PICKUP_RATING_MID,
REGISTER_WEAPON(
/* WEP_##id */ NEX,
/* function */ w_nex,
-/* ammotype */ IT_CELLS,
+/* ammotype */ ammo_cells,
/* impulse */ 7,
/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN,
/* rating */ BOT_PICKUP_RATING_HIGH,
REGISTER_WEAPON(
/* WEP_##id */ PORTO,
/* function */ w_porto,
-/* ammotype */ 0,
+/* ammotype */ ammo_none,
/* impulse */ 0,
/* flags */ WEP_TYPE_OTHER | WEP_FLAG_SUPERWEAPON,
/* rating */ 0,
REGISTER_WEAPON(
/* WEP_##id */ RIFLE,
/* function */ w_rifle,
-/* ammotype */ IT_NAILS,
+/* ammotype */ ammo_nails,
/* impulse */ 7,
/* flags */ WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN,
/* rating */ BOT_PICKUP_RATING_MID,
REGISTER_WEAPON(
/* WEP_##id */ SEEKER,
/* function */ w_seeker,
-/* ammotype */ IT_ROCKETS,
+/* ammotype */ ammo_rockets,
/* impulse */ 8,
/* flags */ WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH,
/* rating */ BOT_PICKUP_RATING_MID,
REGISTER_WEAPON(
/* WEP_##id */ SHOCKWAVE,
/* function */ W_Shockwave,
-/* ammotype */ IT_SHELLS,
+/* ammotype */ ammo_shells,
/* impulse */ 2,
/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN,
/* rating */ BOT_PICKUP_RATING_LOW,
REGISTER_WEAPON(
/* WEP_##id */ TUBA,
/* function */ w_tuba,
-/* ammotype */ 0,
+/* ammotype */ ammo_none,
/* impulse */ 1,
/* flags */ WEP_FLAG_HIDDEN | WEP_TYPE_SPLASH,
/* rating */ BOT_PICKUP_RATING_MID,
}
#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, string modelname, string shortname, string wname)
{
entity e;
weapon_info[id - 1] = e = spawn();
e.weapons = bit;
e.netname = shortname;
e.message = wname;
- e.items = ammotype;
+ //e.items = ammotype;
e.weapon_func = func;
e.mdl = modelname;
e.model = strzone(strcat("models/weapons/g_", modelname, ".md3"));
e.model2 = strzone(strcat("wpn-", e.mdl));
e.impulse = i;
e.bot_pickupbasevalue = pickupbasevalue;
- if(ammotype & IT_SHELLS)
- e.ammo_field = ammo_shells;
- else if(ammotype & IT_NAILS)
- e.ammo_field = ammo_nails;
- else if(ammotype & IT_ROCKETS)
- e.ammo_field = ammo_rockets;
- else if(ammotype & IT_CELLS)
- e.ammo_field = ammo_cells;
- else if(ammotype & IT_FUEL)
- e.ammo_field = ammo_fuel;
- else
- e.ammo_field = ammo_batteries;
+ e.current_ammo = ammotype;
#ifndef MENUQC
func(WR_INIT);
dummy_weapon_info.weapons = '0 0 0';
dummy_weapon_info.netname = "";
dummy_weapon_info.message = "AOL CD Thrower";
- dummy_weapon_info.items = 0;
+ //dummy_weapon_info.items = 0;
dummy_weapon_info.weapon_func = w_null;
dummy_weapon_info.mdl = "";
dummy_weapon_info.model = "";
dummy_weapon_info.model2 = "";
dummy_weapon_info.impulse = -1;
dummy_weapon_info.bot_pickupbasevalue = 0;
+ dummy_weapon_info.current_ammo = ammo_broken;
float i;
weaponorder_byid = "";
float W_AmmoItemCode(float wpn)
{
- return (get_weaponinfo(wpn)).items & IT_AMMO;
+ return (get_weaponinfo(wpn)).items & IT_AMMO; // WEAPONTODO
}
.float ammo_rockets;
.float ammo_cells;
.float ammo_fuel;
-.float ammo_batteries; // dummy
+.float ammo_none;
+.float ammo_broken; // dummy
// entity properties of weaponinfo:
.float weapon; // WEP_...
.float impulse; // weapon impulse
.float bot_pickupbasevalue; // bot weapon priority
.string model2; // wpn- sprite name
-..float ammo_field; // main ammo field
+..float current_ammo; // main ammo field
// other useful macros
#define WEP_ACTION(wpn,wrequest) (get_weaponinfo(wpn)).weapon_func(wrequest)
#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, string modelname, string shortname, string wname);
void register_weapons_done();
// note: the fabs call is just there to hide "if result is constant" warning
float client_cefc_accumulatortime;
#endif
-..float current_ammo;
-
.float weapon_load[WEP_MAXCOUNT];
.float ammo_none; // used by the reloading system, must always be 0
.float clip_load;