So, I couldnāt figure out how to make a piece of furniture be able to fire a projectile, or be reloaded. It looks like there isnāt an examine action available at present to make that possible. Also, per @mlangsdorf the gundata flag wonāt work with furniture, so I have no idea how to link the weapon stats to a furniture item.
Since I couldnāt code my way out of a wet paper bag, Iāve come up with an alternative, at least for the 20mm rifle. I decided to take advantage of the existing MOUNTED_GUN flag, and just made the thing humongous. Weight is accurate based on the high end model. Price is based on their website: http://www.anzioironworks.com/MAG-FED-20MM-RIFLE.htm
I THINK the barrel length should be correct. Wiki says anzio barrel is 1.9 meters, and the Barrett .50 has a barrel length of 50cm.
In the code, barrett barrel length is 5, so that means the anzio should be 19 if barrel length =1= 10cm.
I had to kind of fudge the volume. Just using density of steel says it should be 7 liters, but the volume in game of the barrett .50 is higher than that. Based on density of steel, barrett should have a volume of 1.73 liters, but in game it has a volume of 3.5 liters, which is roughly double. So I just did the same thing, and made the 20mm Rifle volume 14 liters.
I havenāt made the ammunition yet, but the overall power is going to be 3.93 times that of the standard .50 BMG round, based on the kinetic energy data from wiki, and come in several varieties, based off the different versions of the 20mm vulcan round used by the military: https://en.wikipedia.org/wiki/M61_Vulcan#Ammunition
Magazine will hold 3 rounds per the manufacturerās website.
This is the prototype, see what you think. Am I missing anything it should need, or anything I need to add for balance purposes?
{
āidā: āanzio_20mmā,
ācopy-fromā: ārifle_baseā,
ātypeā: āGUNā,
ānameā: āAnzio 20mm Rifleā,
āname_pluralā: āAnzio 20mm Rifleā,
ādescriptionā: āA massive anti-materiel rifle chambered for 20mm rounds, designed to destroy armored vehicles & equipment. This weapon is too large to wield directly, and must be set up on a stable surface to fire.ā,
āweightā: 59000,
āvolumeā: 56,
āpriceā: 1190000,
ālooks_likeā: ām107a1ā,
āto_hitā: -1,
ābashingā: 12,
āmaterialā: āsteelā,
āammoā: ā20mmā,
ārangeā: 45,
āranged_damageā: -5,
ādispersionā: 50,
ādurabilityā: 8,
ābarrel_lengthā: 19,
ādefault_modsā: [ ābipodā, ārifle_scopeā, āmuzzle_brakeā ],
āmagazine_wellā: 1,
āmagazinesā: [ [ ā20mmā, [ āanziomagā ] ] ],
āflagsā: [ āNEVER_JAMSā,āMOUNTED_GUNā ]
},