Removed MMO reference authored by mikekevie's avatar mikekevie
......@@ -4,7 +4,8 @@
Conditions are used to determine whether or not an action may execute.
Conditions can be used in [1]:
Conditions can be used in \[1\]:
- [Skill Mechanics](/skills/mechanics/skill)
- [Drop Tables](/drops/Drops#drop-tables)
- [Spawners](/Spawners)
......@@ -14,7 +15,6 @@ When applying multiple conditions, all of them must be met in order for the skil
To see how to use in-line conditions, [click here!](/skills/Inline-Conditions)
## Types
Conditions can be broken into four types:
......@@ -22,53 +22,67 @@ Conditions can be broken into four types:
1. Entity Conditions: These check the conditions of an entity.
2. Location Conditions: These check the conditions at a location. If a location condition is used while an entity is targeted, it will check the conditions at the entity's location.
3. Compare conditions: These check for certain conditions between two different "things". For example, "Cuboid" will return true if a target is within a cube where the corners are two coordinates
4. Meta conditions: they will not necessarily check against any inherent property of either the caster or a target. For instance, "StringEquals" will return true or false depending on whether two strings match. Those strings *can* be placeholders that fetch the value from either the caster or a target, but that is just one possible application.
4. Meta conditions: they will not necessarily check against any inherent property of either the caster or a target. For instance, "StringEquals" will return true or false depending on whether two strings match. Those strings _can_ be placeholders that fetch the value from either the caster or a target, but that is just one possible application.
## Usage
Conditions can also be used in three different places within a metaskill:
#### Conditions
Conditions in this section check against the caster or its location.
```yaml
Conditions:
- health{h=>10}
```
> Checks if the caster has more than 10 health points
```yaml
Conditions:
- globalscore{objective=Test;v=>10}
```
> In the example above, the globalscore condition will check the caster's global score.
---
#### TargetConditions
Conditions in this section check against the [inherited target](/Skills/Metaskills#inheritance) of the metaskill
```yaml
TargetConditions:
- health{h=>10}
```
> Checks if the inherited targeted entities have more than 10 health points, and only those that do will be inherited as an inherited target by the metaskill. If none do then the metaskill, by default, will not execute.
```yaml
TargetConditions:
- globalscore{objective=Test;v=>10}
```
> The example above the globalscore condition will check the inherited target's global score. Since globalscore is an entity condition, it will only work if an entity is targeted.
---
#### TriggerConditions
Conditions in this section check against the trigger of the metaskill
```yaml
TriggerConditions:
- health{h=>10}
```
> Checks if the trigger of the metaskill has more than 10 health points
## Ranged Values
Ranged values use either the format **#to#** or **#-#**. You must use "to" instead of "-" if you want to use negative numbers in the range. For:
```yaml
YourMagnificentSkill:
Conditions:
......@@ -84,17 +98,15 @@ YourMagnificentSkill:
Condition Actions allow you to do additional things based off of conditions. The default condition action is **true**
| Action | Description |
|----------------|---------------------------------------------------------------------------------------|
|--------|-------------|
| `true` | The skill will run if this condition is met |
| `false` | The skill will *not* run if this condition is met |
| `power` [multiplier] | Multiplies the skill's power by the value of `multiplier` (e.i. power 2.0 would double the skill's power) |
| `cast` [skill] | Casts an additional skill if the condition is met, without having effect on the execution of original skill |
| `castinstead` [skill] | Casts a different skill instead if the condition is met |
| `orElseCast` [skill] | Casts a different skill instead if the condition is not met |
| `false` | The skill will _not_ run if this condition is met |
| `power` \[multiplier\] | Multiplies the skill's power by the value of `multiplier` (e.i. power 2.0 would double the skill's power) |
| `cast` \[skill\] | Casts an additional skill if the condition is met, without having effect on the execution of original skill |
| `castinstead` \[skill\] | Casts a different skill instead if the condition is met |
| `orElseCast` \[skill\] | Casts a different skill instead if the condition is not met |
<!--
| `level` | |
-->
<!--| `level` | |-->
```yaml
Conditions:
......@@ -102,6 +114,7 @@ Condition Actions allow you to do additional things based off of conditions. The
Skills:
- message{m="It's day!"} @self
```
> Will run only if it's day in the caster's world
```yaml
......@@ -110,7 +123,8 @@ Condition Actions allow you to do additional things based off of conditions. The
Skills:
- message{m="It's *not* day!"} @self
```
> Will run only if it's *not* day in the caster's world
> Will run only if it's _not_ day in the caster's world\
> The opposite behavior of `true`
```yaml
......@@ -125,10 +139,11 @@ OtherSkill:
Skills:
- message{m="It's day and not sunny!"} @self
```
> If a condition line is not met *(the condition is met and the condition action if false or vice versa)* [no more conditions will be checked](https://en.wikipedia.org/wiki/Short-circuit_evaluation)
> So even if OtherSkill is executed because of the `sunny` condition we can be sure that the `day` condition is also met, or else no skill would have run at all because
> `day true`
> is checked before
> If a condition line is not met _(the condition is met and the condition action if false or vice versa)_ [no more conditions will be checked](https://en.wikipedia.org/wiki/Short-circuit_evaluation)\
> So even if OtherSkill is executed because of the `sunny` condition we can be sure that the `day` condition is also met, or else no skill would have run at all because\
> `day true`\
> is checked before\
> `sunny orElseCast OtherSkill`
```yaml
......@@ -143,29 +158,52 @@ YourAwesomeSkill:
- haspotioneffect{type=POISON;level=>0;duration=0to100} true
```
## Composite Conditions
Conditions can also be grouped by parenthesis and evaluated via the **AND** (`&&`) and **OR** (`||`) boolean operators.
Conditions used this way can still have a condition action.
Conditions can also be grouped by parenthesis and evaluated via the **AND** (`&&`) and **OR** (`||`) boolean operators. Conditions used this way can still have a condition action.
```yaml
Conditions:
- ((day false || raining true) && onBlock{material=LIME_CONCRETE}) true
```
> The condition is met when it's either raining or not daytime, and, in addition to that, only when the caster is on a LIME_CONCRETE block
> The day and raining have their condition action declared, while onBlock uses the default one, `true`
## Universal Attributes
Every condition shares and can use the following attributes
| Attribute | Aliases | Description | Default |
|-----------|-----------|----------------------------------------------------------------------|---------|
| onFailSkill | onFail | The Metaskill to call if this condition does not check |<!--type:Metaskill-->|
| onPassSkill | onPass | The Metaskill to call if this condition does check |<!--type:Metaskill-->|
Every condition shares and can use the following attributes
<table>
<tr>
<th>Attribute</th>
<th>Aliases</th>
<th>Description</th>
<th>Default</th>
</tr>
<tr>
<td>onFailSkill</td>
<td>onFail</td>
<td>The Metaskill to call if this condition does not check</td>
<td>
<!--type:Metaskill-->
</td>
</tr>
<tr>
<td>onPassSkill</td>
<td>onPass</td>
<td>The Metaskill to call if this condition does check</td>
<td>
<!--type:Metaskill-->
</td>
</tr>
</table>
# Additional Conditions
Links to conditions added by addon plugins. Any conditions from these links will not work without that plugin installed.
- [ModelEngine 4](https://git.mythiccraft.io/mythiccraft/model-engine-4/-/wikis/Skills/Conditions)
......@@ -176,7 +214,7 @@ Links to conditions added by addon plugins. Any conditions from these links will
# Conditions
| Condition | Type | Description |
|-------------------------------------------------------------------------------|----------|----------------------------------------------------------------------------------------------|
|-----------|------|-------------|
| [Altitude](/skills/conditions/altitude) | Entity | Tests how far above the ground the target entity is |
| [Biome](/skills/conditions/biome) | Location | Tests if the target is within the given list of biomes |
| [BiomeType](/skills/conditions/biometype) | Location | Tests for the biome category at a location. |
......@@ -244,7 +282,7 @@ Links to conditions added by addon plugins. Any conditions from these links will
| [Height](/skills/conditions/height) | Location | Checks if the target's Y location is within a range |
| [HeightAbove](/skills/conditions/heightabove) | Location | Checks if the target's Y location is above a value |
| [HeightBelow](/skills/conditions/heightbelow) | Location | Checks if the target's Y location is below a given value |
| [Holding](/skills/conditions/holding) | Entity | Checks if the target is holding a given material(support MythicMobs and MMOItems) |
| [Holding](/skills/conditions/holding) | Entity | Checks if the target is holding a given material(support MythicMobs and Vanilla) |
| [inBounds](/skills/conditions/inBounds) | Compare | Tests whether the target is inside an axis-aligned bounds box between two corners |
| [inClaim](/skills/conditions/inClaim) | Location | Checks if the target location is inside a claim |
| [InCombat](/skills/conditions/incombat) | Entity | Checks if the target mob is considered in combat |
......@@ -373,8 +411,8 @@ Links to conditions added by addon plugins. Any conditions from these links will
| [yDiff](/skills/conditions/ydiff) | Entity | Checks the difference in Y between the targeted entity and the caster. |
| [zDiff](/skills/conditions/zdiff) | Entity | Checks the difference in Z between the targeted entity and the caster. |
More Examples
-------------
## More Examples
```yaml
FlameShock:
Cooldown: 1
......@@ -394,4 +432,5 @@ FlameShock:
- effect:particles{p=flame;a=20;hS=3;vS=1;s=0;y=2}
- potion{t=HARM;d=1;l=1}
```
[1] Not all conditions may be applicable everywhere.
\ No newline at end of file
\[1\] Not all conditions may be applicable everywhere.
\ No newline at end of file