BuffAttribute - jimdroberts/FishMMO GitHub Wiki
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.
-
public int Value
The value to add (or subtract) from the target attribute.
-
public CharacterAttributeTemplate Template
The character attribute template that this buff modifies.
-
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).
- Create a BuffAttribute instance with a value and a CharacterAttributeTemplate.
- Use BuffAttribute objects in buffs to define attribute modifications.
// Example 1: Creating a BuffAttribute
BuffAttribute buffAttr = new BuffAttribute(10, someAttributeTemplate);
// Example 2: Displaying the tooltip
string tooltip = buffAttr.Tooltip();
- 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.