there is no actual code per se, all this is done via the ruleset for example, i am adding a grenade launcher to the game
- type: STR_GRENADE_LAUNCHER
size: 0.2
costBuy: 3000
costSell: 2250
weight: 8
bigSprite: 111
floorSprite: 1
handSprite: 0
bulletSprite: 2
fireSound: 4
compatibleAmmo:
- STR_GL_EXPLOSIVE
- STR_GL_SMOKE
- STR_GL_INCENDIARY
- STR_GL_STUN_GAS
accuracyAuto: 35
accuracySnap: 60
accuracyAimed: 110
tuAuto: 35
tuSnap: 25
tuAimed: 80
battleType: 1
twoHanded: true
invWidth: 1
invHeight: 3
armor: 20
that is my definition to the actual weapon stating that it has multiple ammo types
and then i have this
- type: STR_GL_EXPLOSIVE
size: 0.1
costBuy: 200
costSell: 150
weight: 3
bigSprite: 112
floorSprite: 2
hitSound: 22
hitAnimation: 26
power: 30
damageType: 3
clipSize: 20
battleType: 2
armor: 20
and that defines one of my ammo types, of course if you do this then you have to make sure that this items are available in the ufopedia
at that time you coudl add something like this
- id: STR_GRENADE_LAUNCHER
type_id: 4
section: STR_WEAPONS_AND_EQUIPMENT
text: STR_GRENADE_LAUNCHER_UFOPEDIA
in this case i have put the item under weapons and equipment and linked the fluff text with STR_GRENADE_LAUNCHER_UFOPEDIA
if you do not want the item to show in the UFOPEDIA then you do something like this
- id: STR_GL_EXPLOSIVE
type_id: 4
section: STR_NOT_AVAILABLE
in this case i have said that my explosive ammo for the grenade launcher has no specific article in the UFOPEDIA
then you go to the language file and add something like this
STR_GRENADE_LAUNCHER
Grenade Launcher
STR_GRENADE_LAUNCHER_UFOPEDIA
This grenade launcher is awesome because i did it, nothing can bit it and it will hit anything with in a mile radius, and it has a blast radius of 2 miles and carries a shit load of ammo types... etc.
I hope that helps a little