trusted
5,929
edits
SurtrFan8511 (talk | contribs) |
SurtrFan8511 (talk | contribs) (Welp let's try this out) |
||
Line 1: | Line 1: | ||
<includeonly><onlyinclude>{{#vardefine:range o|{{#explode:{{{1|0}}}| |0}}}}{{#vardefine:range h|{{#explode:{{{1}}}| |1}}}}{{#vardefine:range v|{{#explode:{{{1}}}| |2}}}}{{#vardefine:range d|{{#explode:{{{1}}}| |3}}}}{{#ifexpr:{{#var:range | <includeonly><onlyinclude>{{#vardefine:range o|{{#explode:{{{1|0}}}| |0}}}}{{#vardefine:range h|{{#explode:{{{1}}}| |1}}}}{{#vardefine:range v|{{#explode:{{{1}}}| |2}}}}{{#vardefine:range d|{{#explode:{{{1}}}| |3}}}}{{#vardefine:range s|{{#explode:{{{1}}}| |4}}}}{{#vardefine:range| | ||
<!--matching targets and ranges-->{{#switch:{{#var:target definition}} {{{1}}} | |||
| {{#var:self target}} 1 1 0 0 0 = in a Slash range | |||
| {{#var:self target}} -1 1 0 0 0 = in a reverse Slash range | |||
| {{#var:self target}} 1 2 0 0 0 = in a Long Slash range | |||
| {{#var:self target}} -1 2 0 0 0 = in a reverse Long Slash range | |||
| {{#var:self target}} 1 0 1 0 0 = in a Thrust range | |||
| {{#var:self target}} -1 0 1 0 0 = in a reverse Thrust range | |||
| {{#var:self target}} 2 0 1 0 0 = in a Shot range | |||
| {{#var:self target}} -2 0 1 0 0 = in a reverse Shot range | |||
| {{#var:self target}} 3 0 2 0 0 = in a Snipe range | |||
| {{#var:self target}} -3 0 2 0 0 = in a reverse Snipe range | |||
| {{#var:self target}} 2 1 1 0 0 = in a Magic range | |||
| {{#var:self target}} -2 1 1 0 0 = in a reverse Magic range | |||
<!--add new cases here--> | |||
| #default = <!--matching ranges-->{{#switch:{{{1}}} | |||
| 0 99 99 99 1 = on the entire board | |||
| 0 1 1 1 0 = 1 square around target | |||
| 0 0 0 0 0 = <!--nothing-->, , | |||
| 0 1 0 0 0 = to the left and right of target | |||
| 0 0 1 0 0 = in front and behind of target | |||
| 0 1 1 0 0 = directly adjacent to target | |||
<!--add new cases here--> | |||
| #default = <!--matching all ranges except center position-->{{#switch:{{#var:range h}} {{#var:range v}} {{#var:range d}} {{#var:range s}} | |||
| 2 2 1 0 = in a 2-square diamond radius center | |||
| 1 1 1 0 = in a 3x3 area center | |||
<!--add new cases here--> | |||
| #default = <!--math stuff--><!--filled areas-->{{#ifexpr:{{#var:range s}} > 0|in a {{#expr:1 + 2 * {{#var:range h}}}}x{{#expr:1 + 2 * {{#var:range v}}}} area center | |||
| <!--cross-->{{#ifexpr:{{#var:range h}} = {{#var:range v}} and {{#var:range d}} = 0 and {{#var:range s}} = 0|in a {{#var:range v}}-square cross radius center | |||
| <!--horizontal line-->{{#ifexpr:{{#var:range h}} > 0 and {{#var:range v}} = 0 and {{#var:range d}} = 0|in a {{#expr:1 + 2 * {{#var:range h}}}}-square horizontal line center | |||
| <!--vertical line-->{{#ifexpr:{{#var:range v}} > 0 and {{#var:range h}} = 0 and {{#var:range d}} = 0|in a {{#expr:1 + 2 * {{#var:range h}}}}-square vertical line center | |||
| <!--star shape-->{{#ifexpr:{{#var:range h}} = {{#var:range v}} and {{#var:range h}} = {{#var:range d}}|{{#var:range h}} squares horizontally, vertically and diagonally away from target center | |||
|<!--add cases here--> | |||
}} | |||
}} | |||
}} | |||
}} | |||
}} | |||
}}}}}}}}{{#if:{{#var:range|}}||<!--default-->{{#vardefine:range| | |||
{{#ifeq:{{#var:range h}}|0||{{#var:range h}} squares horizontally, }}{{#ifeq:{{#var:range h}}|0||{{#var:range v}} squares vertically, }}{{#ifeq:{{#var:range d}}|0||{{#var:range d}} squares diagonally, }}, away from target center | |||
}}}}<!-- | |||
{{#vardefine:range|{{#switch:{{#var:range o|}} | |||
| 0 = | | 0 = | ||
| 1 = in front of target, | | 1 = in front of target, | ||
| -1 = behind target, | | -1 = behind target, | ||
|#default = {{#expr:abs({{#var:range o|}})}} square(s) {{#ifexpr: {{#var:range o | |#default = {{#expr:abs({{#var:range o|}})}} square(s) {{#ifexpr:{{#var:range o}} > 0 |in front of|behind}} target, | ||
}} {{#ifexpr:{{#var:range d}} != 0 and {{#var:range d}} = {{#var:range h}} and {{#var:range h}} = {{#var:range v}} |{{#var:range d}} squares away | }} {{#ifexpr:{{#var:range d}} != 0 and {{#var:range d}} = {{#var:range h}} and {{#var:range h}} = {{#var:range v}} |{{#var:range d}} squares away | ||
|{{#ifexpr: {{#var:range h}} != 0 and {{#var:range h}} = {{#var:range v}} |{{#switch:{{#var:range h|}} | |{{#ifexpr: {{#var:range h}} != 0 and {{#var:range h}} = {{#var:range v}} |{{#switch:{{#var:range h|}} | ||
Line 20: | Line 61: | ||
| 1 = 1 square diagonally | | 1 = 1 square diagonally | ||
|#default = {{#var:range d|}} squares diagonally | |#default = {{#var:range d|}} squares diagonally | ||
}}}}}}{{ | }}}}}} | ||
#vardefine:range|{{#replace:{{#var:range}}|, | -->{{#vardefine:center| | ||
{{#ifeq:{{#var:range o}}|0|| | |||
{{#ifexpr:{{#var:range o}} > 0 | |||
|<!--front-->{{#ifeq:{{#var:range o}}|1|centered in front of target|centered {{#var:range o}} squares in front of target}} | |||
|<!--back-->{{#ifeq:{{#var:range o}}|-1|centered behind target|centered {{#expr: -{{#var:range o}}}} squares behind target}}}} | |||
}}}}{{ | |||
#vardefine:range|{{#replace:{{#var:range}}|, ,|}}}}{{ | |||
#vardefine:range|{{#replace:{{#var:range}}|, ,|}}}}<!--{{ | |||
#vardefine:range|{{#replace:{{#var:range}}|,.|}}}}{{ | #vardefine:range|{{#replace:{{#var:range}}|,.|}}}}{{ | ||
#vardefine:range|{{#replace:{{#var:range}}|.|}}}}{{ | #vardefine:range|{{#replace:{{#var:range}}|.|}}}}-->{{ | ||
#vardefine:range|{{#replace:{{#var:range}}|center|{{#var:center}}}}}}{{ | |||
#vardefine:range|{{#replace:{{#var:range}}|target|{{#var:target definition|<abbr title='Either the caster or the unit hit'>target</abbr>}}}}}}{{ | #vardefine:range|{{#replace:{{#var:range}}|target|{{#var:target definition|<abbr title='Either the caster or the unit hit'>target</abbr>}}}}}}{{ | ||
#vardefine:range|{{#replace:{{#var:range}}|diagonally|<abbr title='X-ward, in the corners'>diagonally</abbr>}}}}{{ | #vardefine:range|{{#replace:{{#var:range}}|diagonally|<abbr title='X-ward, in the corners'>diagonally</abbr>}}}}{{ | ||
Line 35: | Line 84: | ||
== Examples == | == Examples == | ||
<pre>{{Skill range|0 0 0 0}}</pre> {{Skill range|0 0 0 0}} | <pre>{{Skill range|0 0 0 0 0}}</pre> {{Skill range|0 0 0 0 0}} | ||
<pre>{{Skill range|1 0 0 2}}</pre> {{Skill range|1 0 0 2}} | <pre>{{Skill range|1 0 0 2 0}}</pre> {{Skill range|1 0 0 2 0}} | ||
<pre>{{Skill range|-2 0 0 1}}</pre> {{Skill range|-2 0 0 1}} | <pre>{{Skill range|-2 0 0 1 0}}</pre> {{Skill range|-2 0 0 1 0}} | ||
<pre>{{Skill range|1 0 1 0}}</pre> {{Skill range|1 0 1 0}} | <pre>{{Skill range|1 0 1 0 0}}</pre> {{Skill range|1 0 1 0 0}} | ||
<pre>{{Skill range|-2 1 0 0}}</pre> {{Skill range|-2 1 0 0}} | <pre>{{Skill range|-2 1 0 0 0}}</pre> {{Skill range|-2 1 0 0 0}} | ||
<pre>{{Skill range|0 1 1 0}}</pre> {{Skill range|0 1 1 0}} | <pre>{{Skill range|0 1 1 0 0}}</pre> {{Skill range|0 1 1 0 0}} | ||
<pre>{{Skill range|0 2 2 0}}</pre> {{Skill range|0 2 2 0}} | <pre>{{Skill range|0 2 2 0 0}}</pre> {{Skill range|0 2 2 0 0}} | ||
<pre>{{Skill range|0 1 1 1}}</pre> {{Skill range|0 1 1 1}} | <pre>{{Skill range|0 1 1 1 0}}</pre> {{Skill range|0 1 1 1 0}} | ||
<pre>{{Skill range|5 6 7 8}}</pre> {{Skill range|5 6 7 8}} | <pre>{{Skill range|5 6 7 8 0}}</pre> {{Skill range|5 6 7 8 0}} |