ResistanceAttributeTemplate - jimdroberts/FishMMO GitHub Wiki
ScriptableObject template for a resistance attribute (e.g., Fire Resistance, Ice Resistance). Inherits from CharacterAttributeTemplate and is used to define attributes that mitigate specific damage types in the FishMMO system.
- Create a ResistanceAttributeTemplate ScriptableObject via the Unity editor (Assets > Create > FishMMO > Character > Attribute > Resistance Attribute).
- Use the template to define resistance types for characters, items, or effects.
// Example 1: Assigning a resistance attribute to a character
character.Resistances.Add(resistanceAttributeTemplate);
// Example 2: Using in damage mitigation
float mitigated = CalculateMitigatedDamage(damage, resistanceAttributeTemplate);
- Use a unique ResistanceAttributeTemplate for each damage type to enable proper mitigation.
- Inherit from CharacterAttributeTemplate to leverage shared attribute logic.
- Use ScriptableObjects for easy data management and editor integration.