CleverRaven/Cataclysm-DDA — pull request #10537 by BevapDin (2014-12-19 03:14:01+00:00)
Title: Gun and gunmod item type slot.

Similar to books, everything can be a gun and a gunmod.

Made some gun / gunmod properties optional in json and removed the json data that has the default value to make the json a bit cleaner.

Auxiliary gunmods (those that can be fired independent from the main gun) are now proper guns, they have gun data and gunmod data. Their gunmod data is included in calculations just like any other gunmod, the gun data is used when it's fired (even auxiliary gunmods can affect the guns stat). I removed the MODE_AUX flag from those items, instead it checks for presence of a gun and gunmod data. Those gunmods can not be fired only when attached to a gun, but as they are technically normal guns, I installed some checks for this. Trying to fire a gunmod will

The gun-specific data of auxiliary gunmods are mostly placeholders (except those that have been copied from the gun itself), so they should be revisited by someone who knows that kind of stuff.

Guns have (implicitly as they share some data with gunmods) a loudness now. However it is not loaded and not used anywhere. The current code does seem to care about the gun itself (the item type is not used for the sound level, neither in `item::noise` nor in `make_gun_sound_effect`), it only uses it (sometimes) to determine the name of the sound.

gumods can affect the range of the gun, but no mod does so currently. They could also affect the armor pierce rating of the gun, but this is not implemented (gunmods have the matching member now, but it's not loaded or used).

The item info now displays the gun stats of the active gunmod (if there is one).