conditions and mechanics - magemonkeystudio/fabled GitHub Wiki
βοΈ Conditions & Mechanics
Conditions and Mechanics are the building blocks of skill behavior in Fabled. Conditions determine when a mechanic should trigger, and mechanics define what happens.
These are configured within the Skill Editor using either the Form view or Blockly Mode.
π§ͺ Conditions
Conditions are logic checks that must pass for a mechanic to activate. You can chain multiple conditions together using AND/OR logic.
π Common Conditions:
Condition | Description |
---|---|
Health | Checks if the target's health is above or below a threshold |
Chance | Passes with a certain probability (e.g., 0.25 = 25%) |
Has Tag | Checks if the entity has a specific tag |
In Group | Checks if the target is in a specific class/group |
Distance | Compares distance from the caster to the target |
Direction | Checks if the target is in front, behind, etc. |
Level | Compares the class or skill level of the caster or target |
Each condition can be inverted with a βnotβ checkbox, and many support dynamic formulas.
π Condition Variables:
a
β Attribute valuev
β Skill levelc
β Class levelt
β Target class level
π οΈ Mechanics
Mechanics are the effects your skill produces. These include damage, healing, motion, visual effects, messages, and more.
π Common Mechanics:
Mechanic | Description |
---|---|
Damage | Deals damage to a target (supports types and classifications) |
Heal | Restores health to a target |
Message | Sends a message to the caster or target |
Stun | Applies a stun or status effect |
Teleport | Teleports the target to a location |
Particle | Spawns visual effects |
Sound | Plays a sound to the player |
Command | Runs a server command as console, player, or operator |
Attribute Modify | Temporarily changes an attribute value |
Knockback | Pushes the target away from the source |
Potion Effect | Applies a vanilla potion effect (e.g., speed, blindness) |
Mechanics support duration, strength, scaling, and often support both caster- and target-based references.
π Mechanics + Conditions Flow
Each Trigger leads to a Target, which may have Conditions applied before executing Mechanics.
You can create multi-branch logic trees such as:
Cast β Area β (if health < 50%) β Damage
(if group != Mage) β Message
In Blockly Mode, this is built visually using drag-and-drop logic blocks. In Form Mode, these are configured in tree form under each trigger tab.
π Formula Support
Most mechanics and conditions support dynamic scaling:
a
β Attribute valuev
β Skill levelc
β Class levelt
β Targetβs class level
Example formulas:
10 + a * 0.25
v(a * 0.05 + 1)
(scaling based on percentage)
π¦ Supported Targets
Conditions and mechanics are typically applied to targets such as:
Self
Target
Area
Cone
Projectile
Location
Targets define the entity or area the mechanic applies to, and often provide context for conditions (e.g., distance between caster and target).
π§ Tips
- Use multiple mechanics per trigger for combos and layered effects.
- Conditions run per target β if one target fails a condition, it won't receive the mechanic.
- Use
{attr:*}
or{req:*}
placeholders in messages and descriptions to display scaling values.