ResistanceAttributeTemplate - jimdroberts/FishMMO GitHub Wiki

Description

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.


Basic Usage

Setup

  1. Create a ResistanceAttributeTemplate ScriptableObject via the Unity editor (Assets > Create > FishMMO > Character > Attribute > Resistance Attribute).
  2. Use the template to define resistance types for characters, items, or effects.

Example

// Example 1: Assigning a resistance attribute to a character
character.Resistances.Add(resistanceAttributeTemplate);

// Example 2: Using in damage mitigation
float mitigated = CalculateMitigatedDamage(damage, resistanceAttributeTemplate);

Best Practices

  • 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.
⚠️ **GitHub.com Fallback** ⚠️