One thing that's bothered me is the gun stuff. I happen to be a bit of a gun nerd, so I was a bit disappointed in the way the current code handles things.
This patch makes two changes.
One, weapons may have an alternate ammo type if they haven't been modified with a caliber conversion. (IRL, it's very rare that a caliber conversion kit of any sort allows you to load two dissimilar-length calibers.) Note that this would need to be changed should grenade launchers or other underbarrel accessories be implemented, but it should be fairly trivial.
Right now, it's a proof-of-concept that locks out .22CB from being used in autoloading weapons (S&W 22A, SIG Mosquito, Ruger 10/22, American-180, any .22 retooled weapons). That round quite simply isn't going to feed in an autoloader, at least not consistently - too short. You can use it in the .22 pipe rifle and the Marlin 39A (and I'd like to add a good .22 revolver - Colt Diamondback? S&W Model 617?). Sorry, but I haven't put in alternate mag sizes for different calibers. I'd like to change .38 Super/.38 Special too; .38 Super as an alternate in 9mm revolvers, .357 mag as an alternate in .38Spl revolvers. .40S&W and 10mm should also be changed - I was thinking about adding the Vector MP5/10 and /40 clone, Glock 20 and Colt Delta Elite. .270/.30-06 should stay as-is for now - until detachable gun mods are possible, or crafting that doesn't step on modded attributes, this is just too awkward a change because it means splitting two rifles for no good gameplay reason.
Two, tube-feed weapons work for any weapon skill, not just shotguns.
Does this look okay for a first pass at alternate ammo? Should I bother banging away on it further? Is my coding style a horrible abomination that should've been drowned at birth?
commit ad3a7938c0a575bbedfed5f2fcad992722ff9599
Author: michi <silverpower.1@gmail.com>
Date: Fri Jul 22 17:58:34 2011 -0500
proof-of-concept alt-ammo patch + tube-feed fix
diff --git a/item.cpp b/item.cpp
index 7e5dd5e..850ee06 100644
--- a/item.cpp
+++ b/item.cpp
@@ -914,7 +914,28 @@ ammotype item::ammo_type()
}
return AT_NULL;
}
-
+ammotype item::altammo_type()
+{
+ if (is_gun()) {
+ it_gun* gun = dynamic_cast<it_gun*>(type);
+ ammotype ret = gun->altammo;
+ for (int i = 0; i < contents.size(); i++) {
+ if (contents[i].is_gunmod()) {
+ it_gunmod* mod = dynamic_cast<it_gunmod*>(contents[i].type);
+ if (mod->newtype != AT_NULL)
+ ret = mod->newtype;
+ }
+ }
+ return ret;
+ } else if (is_tool()) {
+ it_tool* tool = dynamic_cast<it_tool*>(type);
+ return tool->ammo;
+ } else if (is_ammo()) {
+ it_ammo* amm = dynamic_cast<it_ammo*>(type);
+ return amm->type;
+ }
+ return AT_NULL;
+}
int item::pick_reload_ammo(player &u, bool interactive)
{
if (!type->is_gun() && !type->is_tool()) {
@@ -923,7 +944,7 @@ int item::pick_reload_ammo(player &u, bool interactive)
}
bool single_load = false;
int max_load = 0;
- std::vector<int> am; // List of indicies of valid ammo
+ std::vector<int> am, am_alt; // List of indicies of valid ammo
if (type->is_gun()) {
if (charges > 0) {
@@ -935,8 +956,11 @@ int item::pick_reload_ammo(player &u, bool interactive)
} else {
it_gun* tmp = dynamic_cast<it_gun*>(type);
am = u.has_ammo(ammo_type());
+ am_alt = u.has_ammo(altammo_type());
+ am.insert(am.end(), am_alt.begin(), am_alt.end());
max_load = tmp->clip;
- if (tmp->skill_used == sk_shotgun)
+ //if (tmp->skill_used == sk_shotgun)
+ if (has_weapon_flag(WF_RELOAD_ONE))
single_load = true;
}
} else {
diff --git a/item.h b/item.h
index a571a7b..220270f 100644
--- a/item.h
+++ b/item.h
@@ -36,6 +36,7 @@ public:
int burst_size();
int recoil(bool with_ammo = true);
ammotype ammo_type();
+ ammotype altammo_type();
int pick_reload_ammo(player &u, bool interactive);
bool reload(player &u, int index);
diff --git a/itype.h b/itype.h
index 63e0da0..f2f0a37 100644
--- a/itype.h
+++ b/itype.h
@@ -161,7 +161,7 @@ AT_NULL,
AT_BATT, AT_PLUT,
AT_NAIL, AT_BB, AT_BOLT,
AT_SHOT,
-AT_22, AT_9MM, AT_38, AT_40, AT_44, AT_45,
+AT_22, AT_22CB, AT_9MM, AT_38, AT_40, AT_44, AT_45,
AT_57, AT_46,
AT_762, AT_223, AT_3006, AT_308,
AT_GAS,
@@ -205,7 +205,7 @@ struct itype
char sym; // Symbol on the map
nc_color color; // Color on the map (color.h)
-
+
material m1; // Main material
material m2; // Secondary material -- MNULL if made of just 1 thing
@@ -355,6 +355,7 @@ struct it_ammo : public itype
struct it_gun : public itype
{
ammotype ammo;
+ ammotype altammo;
skill skill_used;
signed char dmg_bonus;
signed char accuracy;
@@ -372,13 +373,14 @@ struct it_gun : public itype
signed char pmelee_dam, signed char pmelee_cut, signed char pm_to_hit,
unsigned pweapon_flags,
- skill pskill_used, ammotype pammo, signed char pdmg_bonus,
+ skill pskill_used, ammotype pammo, ammotype paltammo, signed char pdmg_bonus,
signed char paccuracy, signed char precoil, unsigned char pdurability,
unsigned char pburst, unsigned char pclip)
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2,
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, pweapon_flags) {
skill_used = pskill_used;
ammo = pammo;
+ altammo = paltammo;
dmg_bonus = pdmg_bonus;
accuracy = paccuracy;
recoil = precoil;
diff --git a/itypedef.cpp b/itypedef.cpp
index 2cfea9c..6a08ec5 100644
--- a/itypedef.cpp
+++ b/itypedef.cpp
@@ -1210,7 +1210,7 @@ maintained popularity for nearly two centuries. Its minimal recoil, low cost\n\
and low noise are offset by its paltry damage.",
0);
-AMMO(".22 CB", 8, 180,AT_22, c_ltblue, STEEL,
+AMMO(".22 CB", 8, 180,AT_22CB, c_ltblue, STEEL,
2, 2, 7, 0, 10, 16, 4, 100, "\
Conical Ball .22 is a variety of .22 ammunition with a very small propellant\n\
charge, generally with no gunpowder, resulting in a subsonic round. It is\n\
@@ -1432,81 +1432,81 @@ mfb(WF_AMMO_FLAME));
// Burst is the # of rounds fired, 0 if no burst ability.
// clip is how many shots we get before reloading.
-#define GUN(name,rarity,price,color,mat1,mat2,skill,ammo,volume,wgt,melee_dam,\
+#define GUN(name,rarity,price,color,mat1,mat2,skill,ammo,altammo,volume,wgt,melee_dam,\
to_hit,dmg,accuracy,recoil,durability,burst,clip,des,flags) \
index++;itypes.push_back(new it_gun(index,rarity,price,name,des,'(',\
-color,mat1,mat2,volume,wgt,melee_dam,0,to_hit,flags,skill,ammo,dmg,accuracy,\
+color,mat1,mat2,volume,wgt,melee_dam,0,to_hit,flags,skill,ammo,altammo,dmg,accuracy,\
recoil,durability,burst,clip))
// NAME RAR PRC COLOR MAT1 MAT2
GUN("nail gun", 12, 100,c_ltblue, IRON, MNULL,
-// SKILL AMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
- sk_pistol, AT_NAIL, 4, 22, 12, 1, 0, 20, 0, 8, 5, 100, "\
+// SKILL AMMO ALTAMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
+ sk_pistol, AT_NAIL,AT_NULL,4, 22, 12, 1, 0, 20, 0, 8, 5, 100, "\
A tool used to drive nails into wood or other material. It could also be\n\
used as a ad-hoc weapon, or to practice your handgun skill up to level 1.",
0);
GUN("BB gun", 10, 100,c_ltblue, IRON, WOOD,
- sk_rifle, AT_BB, 8, 16, 9, 2, 0, 6, -5, 7, 0, 20, "\
+ sk_rifle, AT_BB,AT_NULL, 8, 16, 9, 2, 0, 6, -5, 7, 0, 20, "\
Popular among children. It's fairly accurate, but BBs deal nearly no damage.\n\
It could be used to practice your rifle skill up to level 1.",
0);
GUN("crossbow", 2, 500,c_green, IRON, WOOD,
- sk_pistol, AT_BOLT, 6, 9, 11, 1, 0, 18, 0, 6, 0, 1, "\
+ sk_pistol, AT_BOLT,AT_NULL, 6, 9, 11, 1, 0, 18, 0, 6, 0, 1, "\
A slow-loading hand weapon that launches bolts. Stronger people can reload\n\
it much faster. Bolts fired from this weapon have a good chance of remaining\n\
intact for re-use.",
0);
GUN("pipe rifle: .22", 0, 400,c_ltblue, IRON, WOOD,
- sk_rifle, AT_22, 9, 13, 10, 2, -2, 15, 2, 6, 0, 1, "\
-A home-made rifle. It is simply a pipe attached to a stock, with a hammer to\n\
-strike the single round it holds.",
+ sk_rifle, AT_22,AT_22CB, 9, 13, 10, 2, -2, 15, 2, 6, 0, 1, "\
+A home-made rifle in .22 rimfire. It is simply a pipe attached to a \n\
+stock, with a hammer to strike the single round it holds.",
0);
GUN("pipe rifle: 9mm", 0, 460,c_ltblue, IRON, WOOD,
- sk_rifle, AT_9MM, 10, 16, 10, 2, -2, 15, 2, 6, 0, 1, "\
+ sk_rifle, AT_9MM,AT_NULL, 10, 16, 10, 2, -2, 15, 2, 6, 0, 1, "\
A home-made rifle. It is simply a pipe attached to a stock, with a hammer to\n\
strike the single round it holds.",
0);
// NAME RAR PRC COLOR MAT1 MAT2
GUN("pipe SMG: 9mm", 0, 540,c_ltblue, IRON, WOOD,
-// SKILL AMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
- sk_smg, AT_9MM, 5, 8, 6, -1, 0, 30, 6, 5, 4, 10, "\
+// SKILL AMMO ALTAMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
+ sk_smg, AT_9MM,AT_NULL, 5, 8, 6, -1, 0, 30, 6, 5, 4, 10, "\
A home-made machine pistol. It features a rudimentary blowback system, which\n\
allows for small bursts.",
0);
GUN("pipe SMG: .45", 0, 575,c_ltblue, IRON, WOOD,
- sk_smg, AT_45, 6, 9, 7, -1, 0, 30, 6, 5, 3, 8, "\
+ sk_smg, AT_45,AT_NULL, 6, 9, 7, -1, 0, 30, 6, 5, 3, 8, "\
A home-made machine pistol. It features a rudimentary blowback system, which\n\
allows for small bursts.",
0);
GUN("SIG Mosquito", 5, 600,c_dkgray, STEEL, PLASTIC,
- sk_pistol, AT_22, 1, 6, 9, 1, 1, 28, 4, 8, 0, 10, "\
+ sk_pistol, AT_22,AT_NULL, 1, 6, 9, 1, 1, 28, 4, 8, 0, 10, "\
A popular, very small .22 pistol. \"Ergonomically designed to give the best\n\
shooting experience.\" --SIG Sauer official website",
0);
// NAME RAR PRC COLOR MAT1 MAT2
GUN("S&W 22A", 5, 650,c_dkgray, STEEL, PLASTIC,
-// SKILL AMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
- sk_pistol, AT_22, 1, 10, 9, 1, 1, 25, 5, 7, 0, 10, "\
+// SKILL AMMO ALTAMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
+ sk_pistol, AT_22,AT_NULL, 1, 10, 9, 1, 1, 25, 5, 7, 0, 10, "\
A popular .22 pistol. \"Ideal for competitive target shooting or recreational\n\
shooting.\" --Smith & Wesson official website",
0);
GUN("Glock 19", 7, 700,c_dkgray, STEEL, PLASTIC,
- sk_pistol, AT_9MM, 2, 5, 8, 1, 2, 24, 6, 6, 0, 15, "\
+ sk_pistol, AT_9MM,AT_NULL, 2, 5, 8, 1, 2, 24, 6, 6, 0, 15, "\
Possibly the most popular pistol in existance. The Glock 19 is often derided\n\
for its plastic contruction, but it is easy to shoot.",
0);
GUN("USP 9mm", 6, 780,c_dkgray, STEEL, PLASTIC,
- sk_pistol, AT_9MM, 2, 6, 8, 1, 1, 25, 5, 9, 0, 15, "\
+ sk_pistol, AT_9MM,AT_NULL, 2, 6, 8, 1, 1, 25, 5, 9, 0, 15, "\
A popular 9mm pistol, widely used among law enforcement. Extensively tested\n\
for durability, it has been found to stay accurate even after subjected to\n\
extreme abuse.",
@@ -1514,82 +1514,82 @@ extreme abuse.",
// NAME RAR PRC COLOR MAT1 MAT2
GUN("S&W 619", 4, 720,c_dkgray, STEEL, PLASTIC,
-// SKILL AMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
- sk_pistol, AT_38, 2, 9, 9, 1, 2, 23, 4, 8, 0, 7, "\
+// SKILL AMMO ALTAMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
+ sk_pistol, AT_38,AT_NULL, 2, 9, 9, 1, 2, 23, 4, 8, 0, 7, "\
A seven-round .38 revolver sold by Smith & Wesson. It features a fixed rear\n\
sight and a reinforced frame.",
0);
GUN("Taurus Pro .38", 4, 760,c_dkgray, STEEL, PLASTIC,
- sk_pistol, AT_38, 2, 6, 8, 1, 1, 22, 6, 7, 0, 10, "\
+ sk_pistol, AT_38,AT_NULL, 2, 6, 8, 1, 1, 22, 6, 7, 0, 10, "\
A popular .38 pistol. Designed with numerous safety features and built from\n\
high-quality, durable materials.",
0);
GUN("SIG Pro .40", 4, 750,c_dkgray, STEEL, PLASTIC,
- sk_pistol, AT_40, 2, 6, 8, 1, 1, 22, 8, 7, 0, 12, "\
+ sk_pistol, AT_40,AT_NULL, 2, 6, 8, 1, 1, 22, 8, 7, 0, 12, "\
Originally marketed as a lightweight and compact alternative to older SIG\n\
handguns, the Pro .40 is popular among European police forces.",
0);
GUN("S&W 610", 2, 720,c_dkgray, STEEL, WOOD,
- sk_pistol, AT_40, 2, 10, 10, 1, 2, 23, 6, 8, 0, 6, "\
+ sk_pistol, AT_40,AT_NULL, 2, 10, 10, 1, 2, 23, 6, 8, 0, 6, "\
The Smith and Wesson 610 is a classic six-shooter revolver chambered for 10mm\n\
rounds, or for S&W's own .40 round.",
0);
// NAME RAR PRC COLOR MAT1 MAT2
GUN("Ruger Redhawk", 3, 760,c_dkgray, STEEL, WOOD,
-// SKILL AMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
- sk_pistol, AT_44, 2, 12, 10, 1, 2, 21, 6, 8, 0, 6, "\
+// SKILL AMMO ALTAMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
+ sk_pistol, AT_44,AT_NULL, 2, 12, 10, 1, 2, 21, 6, 8, 0, 6, "\
One of the most powerful handguns in the world when it was released in 1979,\n\
the Redhawk offers very sturdy contruction, with an appearance that is\n\
reminiscent of \"Wild West\" revolvers.",
0);
GUN("Desert Eagle .44", 2, 840,c_dkgray, STEEL, PLASTIC,
- sk_pistol, AT_44, 4, 17, 14, 1, 4, 35, 3, 7, 0, 10, "\
+ sk_pistol, AT_44,AT_NULL, 4, 17, 14, 1, 4, 35, 3, 7, 0, 10, "\
One of the most recognizable handguns due to its popularity in movies, the\n\
\"Deagle\" is better known for its menacing appearance than its performace.\n\
It's highly innaccurate, but its heavy weight reduces recoil.",
0);
GUN("USP .45", 6, 800,c_dkgray, STEEL, PLASTIC,
- sk_pistol, AT_45, 2, 7, 9, 1, 1, 25, 8, 9, 0, 12, "\
+ sk_pistol, AT_45,AT_NULL, 2, 7, 9, 1, 1, 25, 8, 9, 0, 12, "\
A popular .45 pistol, widely used among law enforcement. Extensively tested\n\
for durability, it has been found to stay accurate even after subjected to\n\
extreme abuse.",
0);
GUN("M1911", 5, 880,c_ltgray, STEEL, PLASTIC,
- sk_pistol, AT_45, 3, 10, 12, 1, 6, 25, 9, 7, 0, 7, "\
+ sk_pistol, AT_45,AT_NULL, 3, 10, 12, 1, 6, 25, 9, 7, 0, 7, "\
The M1911 was the standard-issue sidearm from the US Military for most of the\n\
20th Century. It remains one of the most popular .45 pistols today.",
0);
// NAME RAR PRC COLOR MAT1 MAT2
GUN("FN Five-Seven", 2, 600,c_ltgray, STEEL, PLASTIC,
-// SKILL AMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
- sk_pistol, AT_57, 2, 5, 6, 0, 2, 13, 6, 8, 0, 20, "\
+// SKILL AMMO ALTAMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
+ sk_pistol, AT_57,AT_NULL, 2, 5, 6, 0, 2, 13, 6, 8, 0, 20, "\
Designed to work with FN's proprietary 5.7x28mm round, the Five-Seven is a\n\
lightweight pistol with a very high capacity, best used against armored\n\
opponents.",
0);
GUN("H&K UCP", 2, 620,c_ltgray, STEEL, PLASTIC,
- sk_pistol, AT_46, 2, 5, 6, 0, 2, 12, 6, 8, 0, 20, "\
+ sk_pistol, AT_46,AT_NULL, 2, 5, 6, 0, 2, 12, 6, 8, 0, 20, "\
Designed to work with H&K's proprietary 4.6x30mm round, the UCP is a small\n\
pistol with a very high capacity, best used against armored opponents.",
0);
GUN("sawn-off shotgun", 1, 350,c_red, IRON, WOOD,
- sk_shotgun, AT_SHOT, 6, 10, 14, 2, 4, 40, 15, 4, 0, 2, "\
+ sk_shotgun, AT_SHOT,AT_NULL, 6, 10, 14, 2, 4, 40, 15, 4, 0, 2, "\
The barrels of shotguns are often sawed in half to make it more maneuverable\n\
and concealable. This has the added effect of reducing accuracy greatly.",
mfb(WF_RELOAD_ONE));
GUN("single barrel shotgun",1,300,c_red,IRON, WOOD,
- sk_shotgun, AT_SHOT,10, 20, 14, 3, 0, 6, 5, 6, 0, 1, "\
+ sk_shotgun, AT_SHOT,AT_NULL,10, 20, 14, 3, 0, 6, 5, 6, 0, 1, "\
An old shotgun, possibly antique. It is little more than a barrel, a wood\n\
stock, and a hammer to strike the cartridge. Its simple design keeps it both\n\
light and accurate.",
@@ -1598,26 +1598,26 @@ light and accurate.",
// NAME RAR PRC COLOR MAT1 MAT2
GUN("double barrel shotgun",2,580,c_red,IRON, WOOD,
// SKILL AMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
- sk_shotgun, AT_SHOT,12, 26, 15, 3, 0, 7, 4, 7, 2, 2, "\
+ sk_shotgun, AT_SHOT,AT_NULL,12, 26, 15, 3, 0, 7, 4, 7, 2, 2, "\
An old shotgun, possibly antique. It is little more than a pair of barrels,\n\
a wood stock, and a hammer to strike the cartridge.",
mfb(WF_RELOAD_ONE));
GUN("Remington 870", 9,1200,c_red, STEEL, PLASTIC,
- sk_shotgun, AT_SHOT,16, 30, 17, 3, 5, 10, 0, 8, 3, 6, "\
+ sk_shotgun, AT_SHOT,AT_NULL,16, 30, 17, 3, 5, 10, 0, 8, 3, 6, "\
One of the most popular shotguns on the market, the Remington 870 is used by\n\
hunters and law enforcement agencies alike thanks to its high accuracy and\n\
muzzle velocity.",
mfb(WF_RELOAD_ONE));
GUN("Mossberg 500", 5,1150,c_red, STEEL, PLASTIC,
- sk_shotgun, AT_SHOT,15, 30, 17, 3, 0, 13, -2, 9, 3, 8, "\
+ sk_shotgun, AT_SHOT,AT_NULL,15, 30, 17, 3, 0, 13, -2, 9, 3, 8, "\
The Mossberg 500 is a popular series of pump-action shotguns, often acquired\n\
for military use. It is noted for its high durability and low recoil.",
mfb(WF_RELOAD_ONE));
GUN("Saiga-12", 3,1100,c_red, STEEL, PLASTIC,
- sk_shotgun, AT_SHOT,15, 36, 17, 3, 0, 17, 2, 7, 4, 10, "\
+ sk_shotgun, AT_SHOT,AT_NULL,15, 36, 17, 3, 0, 17, 2, 7, 4, 10, "\
The Saiga-12 shotgun is designed on the same Kalishnikov pattern as the AK47\n\
rifle. It reloads with a magazine, rather than one shell at a time like most\n\
shotguns.",
@@ -1625,29 +1625,29 @@ shotguns.",
// NAME RAR PRC COLOR MAT1 MAT2
GUN("American-180", 2, 800,c_cyan, STEEL, MNULL,
-// SKILL AMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
- sk_smg, AT_22, 12, 23, 11, 0, 2, 20, 0, 6, 20,165, "\
+// SKILL AMMO ALTAMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
+ sk_smg, AT_22,AT_NULL, 12, 23, 11, 0, 2, 20, 0, 6, 20,165, "\
The American-180 is a submachine gun developed in the 1960s which fires .22\n\
LR, unusual for an SMG. Though the round is low-powered, the high rate of\n\
fire and large magazine makes the 180 a formidable weapon.",
0);
GUN("Uzi 9mm", 8, 980,c_cyan, STEEL, MNULL,
- sk_smg, AT_9MM, 6, 29, 10, 1, 0, 25, -2, 7, 8, 32, "\
+ sk_smg, AT_9MM,AT_NULL, 6, 29, 10, 1, 0, 25, -2, 7, 8, 32, "\
The Uzi 9mm has enjoyed immense popularity, selling more units than any other\n\
submachine gun. It is widely used as a personal defense weapon, or as a\n\
primary weapon by elite frontline forces.",
0);
GUN("TEC-9", 10, 880,c_cyan, STEEL, MNULL,
- sk_smg, AT_9MM, 5, 12, 9, 1, 3, 24, 0, 6, 6, 32, "\
+ sk_smg, AT_9MM,AT_NULL, 5, 12, 9, 1, 3, 24, 0, 6, 6, 32, "\
The TEC-9 is a machine pistol made of cheap polymers and machine stamped\n\
parts. Its rise in popularity among criminals is largely due to its\n\
intimidating looks and low price.",
0);
GUN("Calico M960", 6,1200,c_cyan, STEEL, MNULL,
- sk_smg, AT_9MM, 7, 19, 9, 1, -3, 28, -4, 6, 12, 50, "\
+ sk_smg, AT_9MM,AT_NULL, 7, 19, 9, 1, -3, 28, -4, 6, 12, 50, "\
The Calico M960 is an automatic carbine with a unique circular magazine which\n\
allows for high capacities and reduced recoil.",
0);
@@ -1655,14 +1655,14 @@ allows for high capacities and reduced recoil.",
// NAME RAR PRC COLOR MAT1 MAT2
GUN("H&K MP5", 12,1400,c_cyan, STEEL, PLASTIC,
// SKILL AMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
- sk_smg, AT_9MM, 12, 26, 10, 2, -1, 18, -3, 8, 4, 30, "\
+ sk_smg, AT_9MM,AT_NULL, 12, 26, 10, 2, -1, 18, -3, 8, 4, 30, "\
The Heckler & Koch MP5 is one of the most widely-used submachine guns in the\n\
world, and has been adopted by special police forces and militaries alike.\n\
Its high degree of accuracy and low recoil are universally praised.",
0);
GUN("MAC-10", 14, 920,c_cyan, STEEL, MNULL,
- sk_smg, AT_45, 4, 25, 8, 1, -4, 28, 0, 7, 20, 30, "\
+ sk_smg, AT_45,AT_NULL, 4, 25, 8, 1, -4, 28, 0, 7, 20, 30, "\
The MAC-10 is a popular machine pistol originally designed for military use.\n\
For many years they were the most inexpensive automatic weapon in the US, and\n\
enjoyed great popularity among criminals less concerned with quality firearms."
@@ -1670,7 +1670,7 @@ enjoyed great popularity among criminals less concerned with quality firearms."
0);
GUN("H&K UMP45", 12,1500,c_cyan, STEEL, PLASTIC,
- sk_smg, AT_45, 13, 20, 11, 1, 0, 13, -3, 8, 4, 25, "\
+ sk_smg, AT_45,AT_NULL, 13, 20, 11, 1, 0, 13, -3, 8, 4, 25, "\
Developed as a successor to the MP5 submachine gun, the UMP45 retains the\n\
earlier model's supreme accuracy and low recoil, but in the higher .45 caliber."
,
@@ -1678,21 +1678,21 @@ earlier model's supreme accuracy and low recoil, but in the higher .45 caliber."
// NAME RAR PRC COLOR MAT1 MAT2
GUN("TDI Vector", 4,1800,c_cyan, STEEL, PLASTIC,
-// SKILL AMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
- sk_smg, AT_45, 13, 20, 9, 0, -2, 15,-14, 7, 8, 30, "\
+// SKILL AMMO ALTAMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
+ sk_smg, AT_45,AT_NULL, 13, 20, 9, 0, -2, 15,-14, 7, 8, 30, "\
The TDI Vector is a submachine gun with a unique in-line design which makes\n\
recoil very managable, even in the powerful .45 caliber.",
0);
GUN("FN P90", 7,2000,c_cyan, STEEL, PLASTIC,
- sk_smg, AT_57, 14, 22, 10, 1, 0, 22, -8, 8, 15, 50, "\
+ sk_smg, AT_57,AT_NULL, 14, 22, 10, 1, 0, 22, -8, 8, 15, 50, "\
The first in a new genre of guns, termed \"personal defense weapons.\" FN\n\
designed the P90 to use their proprietary 5.7x28mm ammunition. It is made\n\
for firing bursts managably.",
0);
GUN("H&K MP7", 5,1600,c_cyan, STEEL, PLASTIC,
- sk_smg, AT_46, 7, 17, 7, 1, 0, 21,-10, 8, 20, 20, "\
+ sk_smg, AT_46,AT_NULL, 7, 17, 7, 1, 0, 21,-10, 8, 20, 20, "\
Designed by Heckler & Koch as a competitor to the FN P90, as well as a\n\
successor to the extremely popular H&K MP5. Using H&K's proprietary 4.6x30mm\n\
ammunition, it is designed for burst fire.",
@@ -1700,79 +1700,79 @@ ammunition, it is designed for burst fire.",
// NAME RAR PRC COLOR MAT1 MAT2
GUN("Marlin 39A", 14, 800,c_brown,IRON, WOOD,
-// SKILL AMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
- sk_rifle, AT_22, 11, 26, 12, 3, 3, 10, -5, 8, 0, 10, "\
+// SKILL AMMO ALTAMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
+ sk_rifle, AT_22,AT_22CB, 11, 26, 12, 3, 3, 10, -5, 8, 0, 10, "\
The oldest and longest-produced shoulder firearm in the world. Though it\n\
fires the weak .22 round, it is highly accurate and damaging, and essentially\n\
has no recoil.",
-0);
+mfb(WF_RELOAD_ONE));
GUN("Ruger 10/22", 12, 820,c_brown,IRON, WOOD,
- sk_rifle, AT_22, 11, 23, 12, 3, 0, 8, -5, 8, 0, 10, "\
+ sk_rifle, AT_22,AT_NULL, 11, 23, 12, 3, 0, 8, -5, 8, 0, 10, "\
A popular and highly accurate .22 rifle. At the time of its introduction in\n\
1964, it was one of the first modern .22 rifles designed for quality, and not\n\
as a gun for children.",
0);
GUN("Browning BLR", 8,1200,c_brown,IRON, WOOD,
- sk_rifle, AT_3006,12, 28, 12, 3, -3, 6, -4, 7, 0, 4, "\
+ sk_rifle, AT_3006,AT_NULL,12, 28, 12, 3, -3, 6, -4, 7, 0, 4, "\
A very popular rifle for hunting and sniping. Its low ammo capacity is\n\
offset by the very powerful .30-06 round it fires.",
0);
// NAME RAR PRC COLOR MAT1 MAT2
GUN("Remington 700", 14,1300,c_brown,IRON, WOOD,
-// SKILL AMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
- sk_rifle, AT_3006,12, 34, 13, 3, 7, 9, -3, 8, 0, 4, "\
+// SKILL AMMO ALTAMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
+ sk_rifle, AT_3006,AT_NULL,12, 34, 13, 3, 7, 9, -3, 8, 0, 4, "\
A very popular and durable hunting or sniping rifle. Popular among SWAT\n\
and US Marine snipers. Highly damaging, but perhaps not as accurate as the\n\
competing Browning BLR.",
0);
GUN("SKS", 12,1600,c_brown,IRON, WOOD,
- sk_rifle, AT_762, 12, 34, 13, 3, 0, 5, -4, 8, 0, 10, "\
+ sk_rifle, AT_762,AT_NULL, 12, 34, 13, 3, 0, 5, -4, 8, 0, 10, "\
Developed by the Soviets in 1945, this rifle was quickly replaced by the\n\
full-auto AK47. However, due to its superb accuracy and low recoil, this gun\n\
maintains immense popularity.",
0);
GUN("Ruger Mini-14", 12,1650,c_brown,IRON, WOOD,
- sk_rifle, AT_223, 12, 26, 12, 3, 4, 5, -4, 8, 0, 10, "\
+ sk_rifle, AT_223,AT_NULL, 12, 26, 12, 3, 4, 5, -4, 8, 0, 10, "\
A small, lightweight semi-auto carbine designed for military use. Its superb\n\
accuracy and low recoil makes it more suitable than full-auto rifles for some\n\
situations.",
0);
GUN("Savage 111F", 10,1980,c_brown,STEEL, PLASTIC,
- sk_rifle, AT_308, 12, 26, 13, 3, 6, 5,-11, 9, 0, 3, "\
+ sk_rifle, AT_308,AT_NULL, 12, 26, 13, 3, 6, 5,-11, 9, 0, 3, "\
A very accurate rifle chambered for the powerful .308 round. Its very low\n\
ammo capacity is offset by its accuracy and near-complete lack of recoil.",
0);
// NAME RAR PRC COLOR MAT1 MAT2
GUN("H&K G3", 15,2550,c_blue, IRON, WOOD,
-// SKILL AMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
- sk_rifle, AT_308, 16, 40, 13, 2, 8, 11, 4, 8, 7, 20, "\
+// SKILL AMMO ALTAMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
+ sk_rifle, AT_308,AT_NULL, 16, 40, 13, 2, 8, 11, 4, 8, 7, 20, "\
An early battle rifle developed after the end of WWII. The G3 is designed to\n\
unload large amounts of deadly ammunition, but it is less suitable over long\n\
ranges.",
0);
GUN("H&K G36", 17,2300,c_blue, IRON, PLASTIC,
- sk_rifle, AT_223, 15, 32, 13, 2, 6, 8, 5, 8, 10, 30, "\
+ sk_rifle, AT_223,AT_NULL, 15, 32, 13, 2, 6, 8, 5, 8, 10, 30, "\
Designed as a replacement for the early H&K G3 battle rifle, the G36 is more\n\
accurate, and uses the much-lighter .223 round, allowing for a higher ammo\n\
capacity.",
0);
GUN("AK-47", 16,2100,c_blue, IRON, WOOD,
- sk_rifle, AT_762, 16, 38, 14, 2, 0, 13, 4, 9, 4, 30, "\
+ sk_rifle, AT_762,AT_NULL, 16, 38, 14, 2, 0, 13, 4, 9, 4, 30, "\
One of the most recognizable assault rifles ever made, the AK-47 is renowned\n\
for its durability even under the worst conditions.",
0);
GUN("FN FAL", 16,2250,c_blue, IRON, WOOD,
- sk_rifle, AT_308, 19, 36, 14, 2, 7, 15, -2, 8, 10, 20, "\
+ sk_rifle, AT_308,AT_NULL, 19, 36, 14, 2, 7, 15, -2, 8, 10, 20, "\
A Belgian-designed battle rifle, the FN FAL is not very accurate for a rifle,\n\
but its high fire rate and powerful .308 ammunition have made it one of the\n\
most widely-used battle rifles in the world.",
@@ -1780,21 +1780,21 @@ most widely-used battle rifles in the world.",
// NAME RAR PRC COLOR MAT1 MAT2
GUN("Bushmaster ACR", 4,2150,c_blue, STEEL, PLASTIC,
-// SKILL AMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
- sk_rifle, AT_223, 15, 27, 18, 2, 2, 10, -2, 8, 3, 30, "\
+// SKILL AMMO ALTAMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
+ sk_rifle, AT_223,AT_NULL, 15, 27, 18, 2, 2, 10, -2, 8, 3, 30, "\
This carbine was developed for military use in the early 21st century. It is\n\
damaging and accurate, though its rate of fire is a bit slower than competing\n\
.223 carbines.",
0);
GUN("AR-15", 9,2200,c_blue, STEEL, PLASTIC,
- sk_rifle, AT_223, 19, 28, 12, 2, 0, 6, 0, 7, 5, 30, "\
+ sk_rifle, AT_223,AT_NULL, 19, 28, 12, 2, 0, 6, 0, 7, 5, 30, "\
A widely used assault rifle and the father of popular rifles such as the M16.\n\
It is light and accurate, but not very durable.",
0);
GUN("M4A1", 7,2400,c_blue, STEEL, PLASTIC,
- sk_rifle, AT_223, 14, 24, 13, 2, 4, 7, 2, 6, 5, 30, "\
+ sk_rifle, AT_223,AT_NULL, 14, 24, 13, 2, 4, 7, 2, 6, 5, 30, "\
A popular carbine, long used by the US military. Though accurate, small, and\n\
lightweight, it is infamous for its fragility, particularly in less-than-\n\
ideal terrain.",
@@ -1802,29 +1802,29 @@ ideal terrain.",
// NAME RAR PRC COLOR MAT1 MAT2
GUN("FN SCAR-L", 6,2500,c_blue, STEEL, PLASTIC,
-// SKILL AMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
- sk_rifle, AT_223, 15, 29, 18, 2, 1, 6, -4, 8, 6, 30, "\
+// SKILL AMMO ALTAMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
+ sk_rifle, AT_223,AT_NULL, 15, 29, 18, 2, 1, 6, -4, 8, 6, 30, "\
A modular assault rifle designed for use by US Special Ops units. The 'L' in\n\
its name stands for light, as it uses the lightweight .223 round. It is very\n\
accurate and low on recoil.",
0);
GUN("FN SCAR-H", 5,2750,c_blue, STEEL, PLASTIC,
- sk_rifle, AT_308, 16, 32, 20, 2, 1, 12, -4, 8, 5, 20, "\
+ sk_rifle, AT_308,AT_NULL, 16, 32, 20, 2, 1, 12, -4, 8, 5, 20, "\
A modular assault rifle designed for use by US Special Ops units. The 'H' in\n\
its name stands for heavy, as it uses the powerful .308 round. It is fairly\n\
accurate and low on recoil.",
0);
GUN("Steyr AUG", 6,2900,c_blue, STEEL, PLASTIC,
- sk_rifle, AT_223, 14, 32, 17, 1, -3, 7, -8, 8, 3, 30, "\
+ sk_rifle, AT_223,AT_NULL, 14, 32, 17, 1, -3, 7, -8, 8, 3, 30, "\
The Steyr AUG is an Austrian assault rifle that uses a bullpup design. It is\n\
used in the armed forces and police forces of many nations, and enjoys\n\
low recoil and high accuracy.",
0);
GUN("M249", 1,3500,c_ltred,STEEL, PLASTIC,
- sk_rifle, AT_223, 32, 68, 27, -4, -6, 20, 6, 7, 20,200, "\
+ sk_rifle, AT_223,AT_NULL, 32, 68, 27, -4, -6, 20, 6, 7, 20,200, "\
The M249 is a mountable machine gun used by the US Military and SWAT teams.\n\
Quite innaccurate and difficult to control, the M249 is designed to fire many\n\
rounds very quickly."
@@ -1833,15 +1833,15 @@ rounds very quickly."
// NAME RAR PRC COLOR MAT1 MAT2
GUN("V29 laser pistol", 1,3800,c_magenta,STEEL,PLASTIC,
-// SKILL AMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
- sk_pistol, AT_FUSION,4, 6, 5, 1, -2, 20, 0, 8, 0, 20, "\
+// SKILL AMMO ALTAMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
+ sk_pistol, AT_FUSION,AT_NULL,4, 6, 5, 1, -2, 20, 0, 8, 0, 20, "\
The V29 laser pistol was designed in the mid-21st century, and was one of the\n\
first firearms to use fusion as its ammunition. It is larger than most\n\
traditional handguns, but displays no recoil whatsoever.",
0);
GUN("FTK-93 fusion gun", 1,5200,c_magenta,STEEL, PLASTIC,
- sk_rifle, AT_FUSION,18,20, 10, 1, 40, 10, 0, 9, 0, 2, "\
+ sk_rifle, AT_FUSION,AT_NULL,18,20, 10, 1, 40, 10, 0, 9, 0, 2, "\
A very powerful fusion rifle developed shortly before the influx of monsters.\n\
It can only hold two rounds at a time, but a special superheating unit causes\n\
its bolts to be extremely deadly.",
@@ -1849,14 +1849,14 @@ its bolts to be extremely deadly.",
// NAME RAR PRC COLOR MAT1 MAT2
GUN("simple flamethrower",1,800,c_pink, STEEL, PLASTIC,
-// SKILL AMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
- sk_shotgun, AT_GAS, 16, 8, 8, -1, -5, 6, 0, 6, 0, 12, "\
+// SKILL AMMO ALTAMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
+ sk_shotgun, AT_GAS,AT_NULL, 16, 8, 8, -1, -5, 6, 0, 6, 0, 12, "\
A simple, home-made flamethrower. While its capacity is not superb, it is\n\
more than capable of igniting terrain and monsters alike.",
0);
GUN("flamethrower", 1,1800,c_pink, STEEL, MNULL,
- sk_shotgun, AT_GAS, 20, 14, 10, -2, 10, 4, 0, 8, 4, 100, "\
+ sk_shotgun, AT_GAS,AT_NULL, 20, 14, 10, -2, 10, 4, 0, 8, 4, 100, "\
A large flamethrower with substantial gas reserves. Very manacing and\n\
deadly.",
0);
@@ -2714,8 +2714,8 @@ AMMO("Fusion blast", 0,0, AT_FUSION,c_dkgray, MNULL,
// NAME RARE COLOR MAT1 MAT2
GUN("fusion blaster", 0,0,c_magenta, STEEL, PLASTIC,
-// SKILL AMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
- sk_rifle, AT_FUSION, 12, 0, 0, 0, 0, 4, 0, 10, 0, 1, "",0);
+// SKILL AMMO ALTAMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
+ sk_rifle, AT_FUSION,AT_NULL, 12, 0, 0, 0, 0, 4, 0, 10, 0, 1, "",0);
if (itypes.size() != num_all_items)
debugmsg("%d items, %d itypes (+bio)", itypes.size(), num_all_items - 1);
@@ -2728,7 +2728,8 @@ std::string ammo_name(ammotype t)
case AT_BB: return "BBs";
case AT_BOLT: return "bolts";
case AT_SHOT: return "shot";
- case AT_22: return ".22";
+ case AT_22: return ".22 LR";
+ case AT_22CB: return ".22 CB";
case AT_9MM: return "9mm";
case AT_38: return ".38";
case AT_40: return ".40";
@@ -2756,6 +2757,7 @@ itype_id default_ammo(ammotype guntype)
case AT_BOLT: return itm_bolt_wood;
case AT_SHOT: return itm_shot_00;
case AT_22: return itm_22_lr;
+ case AT_22CB: return itm_22_cb;
case AT_9MM: return itm_9mm;
case AT_38: return itm_38_special;
case AT_40: return itm_10mm;