Modular Equipment - SmArtKar/AthenaFramework GitHub Wiki

Modular equipment system can allow to make apparel or equipment with exchangeable modules that alter it's stats. It can be used on any CompEquippable objects

    public class CompProperties_Modular : CompProperties
    {
        // List of open slots
        public List<ModuleSlotPackage> slots = new List<ModuleSlotPackage>();
    }

In order to make a certain thing into a module it needs two comps: CompUsable_Module would allow the part to be installed

  <li Class="CompProperties_Usable">
    <compClass>AthenaFramework.CompUsable_Module</compClass>
    <useJob>Athena_InstallModule</useJob>
  </li>

While CompProperties_UseEffectModule contains module info

    public class CompProperties_UseEffectModule : CompProperties_Usable
    {
        // List of slot IDs that this module can be installed into
        public List<string> slotIDs;
        // Amount of slot capacity that this module takes
        public float requiredCapacity = 0;
        // List of IDs that this module is incompatible with
        public List<string> excludeIDs;
        // If this module can be ejected
        public bool ejectable = true;
        // Sound that is played when the module is installed
        public SoundDef installSound;
        // Sound that is played when the module is ejected
        public SoundDef ejectSound;
        // List of comps that are applied when this module is attached
        public List<CompProperties> comps;
        // List of additional graphics that are applied if the parent pawn has an IRenderable that accepts apparel graphic packages linked to it
        public List<ApparelGraphicPackage> additionalGraphics;
        // List of modified stats
        public List<StatModifier> equippedStatOffsets = new List<StatModifier>();
        public List<StatModifier> statOffsets = new List<StatModifier>();
        public List<StatModifier> statFactors = new List<StatModifier>();
        // List of areas that this module covers
        public List<BodyPartGroupDef> coveredParts;
        // How armor should behave
        public ArmorMode armorMode = ArmorMode.None;
        // Stats for armor
        public List<StatModifier> armorStats;
        // If block VFX should be metallic
        public bool metallicBlock = false;
    }

    public enum ArmorMode
    {
        None, // Armor calculations are disabled
        Additional, // Armor stats are applied to the original armor before armor calculations
        Ontop, // Acts as a second layer of armor, potentially halving the damage a second time
        Exclusive // Hijacks the armor calculations, preventing other modules or main apparel from applying their armor
    }

Slot info is specified using the same system as for modular hediffs

    public class ModuleSlotPackage
    {
        public string slotID;
        public string slotName = "Undefined";
        // -1 means unlimited capacity
        public float capacity = -1f;
    }
⚠️ **GitHub.com Fallback** ⚠️