From Dark and Darker Wiki
m (Race Page prototype.) |
m (Updated logic to sieve the array into three categories, which it then prints.) |
||
Line 1: | Line 1: | ||
<!--{{#arraydefine:all|{{Monster Data| | <!--{{#arraydefine:all|{{Monster Data|{{{1}}}}}}}--> | ||
{{#arraydefine:all|Cave Troll,Cockatrice,Dire Wolf}} | {{#arraydefine:all|Cave Troll,Cockatrice,Dire Wolf}} | ||
{{#arraydefine:bosses}} | |||
< | {{#arraydefine:minibosses}} | ||
{{#arraydefine:monsters}} | |||
<!-- Sieves the {{{1}}} array into the three types --> | |||
{{#loop:i | |||
|0 | |0 | ||
|{{#arraysize:all}} | |{{#arraysize:all}} | ||
|{{#vardefine:current|{{ #arrayindex:all | {{ #var:i }}}}}}<!-- | |{{#vardefine:current|{{ #arrayindex:all | {{ #var:i }}}}}}<!-- | ||
-->{{#if:{{Monster Data|{{#var:current}}|Boss}}|<li>[[{{#var:current}}]]</li> | If is Boss, add to bosses array | ||
-->{{#if:{{Monster Data|{{#var:current}}|Boss}}|<!-- | |||
-->{{#arraydefine:bosses|{{#arrayprint:bosses}},{{#var:current}}}}|<!-- | |||
If is not a Boss and is a Miniboss, add to the minibosses array | |||
-->{{#if:{{Monster Data|{{#var:current}}|MiniBoss}}|<!-- | |||
-->{{#arraydefine:minibosses|{{#arrayprint:minibosses}},{{#var:current}}}}|<!-- | |||
If neither Boss nor Miniboss, add to monsters array | |||
-->{{#arraydefine:monsters|{{#arrayprint:monsters}},{{#var:current}}}}}}}} | |||
}} | |||
==Bosses== | |||
<ul>{{#loop: i | |||
|1 | |||
|{{#expr:{{#arraysize:bosses}}-1}} | |||
|{{#vardefine:current|{{ #arrayindex:bosses | {{ #var:i }}}}}}<!-- | |||
--><li>[[{{#var:current}}]]</li> | |||
}}</ul> | }}</ul> | ||
==Mini Bosses== | ==Mini Bosses== | ||
<ul>{{#loop: i | <ul>{{#loop: i | ||
| | |1 | ||
|{{#arraysize: | |{{#expr:{{#arraysize:minibosses}}-1}} | ||
|{{#vardefine:current|{{ #arrayindex: | |{{#vardefine:current|{{ #arrayindex:minibosses | {{ #var:i }}}}}}<!-- | ||
--><li>[[{{#var:current}}]]</li> | |||
--> | |||
}}</ul> | }}</ul> | ||
==Monsters== | ==Monsters== | ||
<ul>{{#loop: i | <ul>{{#loop: i | ||
| | |1 | ||
|{{#arraysize: | |{{#expr:{{#arraysize:monsters}}-1}} | ||
|{{#vardefine:current|{{ #arrayindex: | |{{#vardefine:current|{{ #arrayindex:monsters | {{ #var:i }}}}}}<!-- | ||
--><li>[[{{#var:current}}]]</li> | |||
--> | |||
}}</ul> | }}</ul> |