Update variablemath authored by Lxlp's avatar Lxlp
Mechanic: VariableMath ## Description
======================
Sets a variable to the result of a math equation, where 'x' is the Sets a variable to the result of a math equation, where 'x' is the
[variable](/skills/variables)'s current value. [variable](/skills/variables)'s current value.
Attributes Basically a setvariable mechanic with some extra spices
----------
| Attribute | Aliases | Description | Default Value |
|-----------|---------|-------------------------------------------------|---------------|
| var | | The name and scope of the variable | |
| equation | eq, e | The operation to be done, must be inside quotes | |
## Attributes
| Attribute | Aliases | Description | Default |
|-----------|-----------|----------------------------------------------------------------------|---------|
| equation | eq, e | The operation to be done, must be inside quotes | x |
> This mechanic inherits every *inheritable* attribute of the [SetVariable](skills/mechanics/setvariable) mechanic
Examples
----
## Examples
Storing a placeholder in a variable Storing a placeholder in a variable
```yaml
MMOVar: MMOVar:
Skills: Skills:
- variableMath{var=target.exp;equation="%mmocore_level%"} - variableMath{var=target.exp;equation="%mmocore_level%"}
```
Doing math Doing math
```yaml
Math1: Math1:
Skills: Skills:
- variableMath{var=caster.damage;equation="<caster.hp>*5"} - variableMath{var=caster.damage;equation="<caster.hp>*5"}
Math2: Math2:
Skills: Skills:
- variableMath{var=caster.speed;equation="(<caster.var.age>/5)+1"} - variableMath{var=caster.speed;equation="(<caster.var.age>/5)+1"}
```
## Aliases
- [x] mathvariable
- [x] varmath
- [x] mathvar
\ No newline at end of file