In ECS everything is broken down to components that describe functions.
- A weapon is a physical item so one component will be a physical position. If it is on the ground or thrown at an enemy (sword / throwing knife) then you need the physical position component to decide if it was picked up or hit something (e.g. wall or monster). When a weapon is held you can use the physical positional component of the owner. A physical component is important because it helps useus keep in mind that a weapon does not have to be held to be useful (mines for instance and gun towers are an example).
- A weapon is sometimes a container. It contains an Ammo entity. Some weapons could contain different types of ammo for different effects. Some weapons can be enhanced or enchanted so you may or may not need another container for such buffs.
- A Weapon is a factory. It creates moving projectiles or AoE zones that collide and affect mobs.
- A weapon can sometimes deteriorate (as in Diablo) so it may have a health component.
So this is how I would define a weapon:
Factory component, Container component, Physical (position & velocity) component and health component.