Let's assume:
items:
- type: STR_RIFLE
battleType: 1
categories: [STR_TWO_HANDED, STR_RIFLES]
compatibleAmmo: [STR_RIFLE_CLIP, STR_RIFLE_CLIP_HE]
- type: STR_RIFLE_CLIP
categories: [STR_PIERCING]
- type: STR_RIFLE_CLIP_HE
categories: [STR_EXPLOSIVE, STR_AWESOME]
For the following 2 purposes, the weapon (rifle) will inherit the categories of its ammo (clip, HE clip):
1. filtering on craft equipment GUI - the weapon inherits the categories from its equippable ammo (i.e. visible on the GUI)
2. starting conditions (allowed item categories, forbidden item categories) - the weapon inherits the categories from the ammo equipped on the craft
Considering example above:
a/ if only rifle is equipped, it has categories: STR_TWO_HANDED, STR_RIFLES
b/ if rifle and standard ammo is equipped, the rifle has categories: STR_TWO_HANDED, STR_RIFLES and STR_PIERCING
c/ if rifle, standard ammo and HE ammo is equipped, the rifle has categories: STR_TWO_HANDED, STR_RIFLES, STR_PIERCING, STR_EXPLOSIVE and STR_AWESOME
Solarius/Dioxine can describe the actual usage/purpose in a mod... I'm having trouble formulating that in words.
PS: not considered on the Buy/Sell/Transfer GUIs