BuffAttribute - jimdroberts/FishMMO GitHub Wiki

Description

Represents a single attribute modification from a buff, including value and target attribute template. Used to define how buffs affect character attributes in the FishMMO system.


API Access

Fields

  • public int Value

    The value to add (or subtract) from the target attribute.

  • public CharacterAttributeTemplate Template

    The character attribute template that this buff modifies.

Methods

  • public BuffAttribute(int value, CharacterAttributeTemplate template)

    Constructs a new BuffAttribute with the specified value and template. value (int): The value to apply to the attribute. template (CharacterAttributeTemplate): The attribute template to modify.

  • public string Tooltip()

    Returns a formatted tooltip string describing this buff attribute. Returns a colorized string with the attribute name and value (string).


Basic Usage

Setup

  1. Create a BuffAttribute instance with a value and a CharacterAttributeTemplate.
  2. Use BuffAttribute objects in buffs to define attribute modifications.

Example

// Example 1: Creating a BuffAttribute
BuffAttribute buffAttr = new BuffAttribute(10, someAttributeTemplate);

// Example 2: Displaying the tooltip
string tooltip = buffAttr.Tooltip();

Best Practices

  • Always assign a valid CharacterAttributeTemplate to the Template field.
  • Use positive or negative values in Value to increase or decrease attributes.
  • Use the Tooltip method to provide clear information to players.
⚠️ **GitHub.com Fallback** ⚠️