From Dark and Darker Wiki
m (plurify race call) |
(Monster Data structure was changed. Fixed call.) |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{#arraydefine:all|{{Monster Data|{{ | <includeonly>{{#arraydefine:all|{{Monster Data|{{{1}}}}}}}<!-- | ||
{{#arraydefine:bosses}} | -->{{#arraydefine:bosses}}<!-- | ||
{{#arraydefine:minibosses}} | -->{{#arraydefine:minibosses}}<!-- | ||
{{#arraydefine:monsters}} | -->{{#arraydefine:monsters}}<!-- | ||
<!-- Sieves the array | Sieves the array "all" into three types | ||
{{#loop:i | -->{{ | ||
#loop:i | |||
|0 | |0 | ||
|{{#arraysize:all}} | |{{#arraysize:all}} | ||
|{{#vardefine:current|{{ #arrayindex:all | {{ #var:i }}}}}}<!-- | |{{#vardefine:current|{{ #arrayindex:all | {{ #var:i }}}}}}<!-- | ||
If is Boss, add to bosses array | If is Boss, add to bosses array | ||
-->{{#if:{{Monster Data|{{#var:current}}|Boss}} | -->{{#if:{{Monster Data|{{#var:current}}|Boss}}<!-- | ||
-->{{#arraydefine:bosses|{{#arrayprint:bosses}},{{#var:current}}}} | -->|{{#arraydefine:bosses|{{#arrayprint:bosses}},{{#var:current}}}}<!-- | ||
If is not a Boss and is a Miniboss, add to the minibosses array | If is not a Boss and is a Miniboss, add to the minibosses array | ||
-->{{#if:{{Monster Data|{{#var:current}}|MiniBoss}} | -->|{{#if:{{Monster Data|{{#var:current}}|MiniBoss}}<!-- | ||
-->{{#arraydefine:minibosses|{{#arrayprint:minibosses}},{{#var:current}}}} | -->|{{#arraydefine:minibosses|{{#arrayprint:minibosses}},{{#var:current}}}}<!-- | ||
If neither Boss nor Miniboss, add to monsters array | If neither Boss nor Miniboss, add to monsters array | ||
-->{{#arraydefine:monsters|{{#arrayprint:monsters}},{{#var:current}}}}}}}} | -->|{{#arraydefine:monsters|{{#arrayprint:monsters}},{{#var:current}}}}}}}} | ||
}} | }}<!-- | ||
-->{{#ifeq:{{#arraysize:bosses}}|0 | |||
<ul>{{#loop: i | ||<h2>Bosses</h2> | ||
<ul>{{ | |||
#loop: i | |||
|1 | |||
|{{#expr:{{#arraysize:bosses}}-1}} | |||
}}</ul> | |{{#vardefine:current|{{ #arrayindex:bosses | {{ #var:i }}}}}}<!-- | ||
--><li>[[{{#var:current}}]]</li> | |||
<ul>{{#loop: i | }}</ul>}}<!-- | ||
-->{{#ifeq:{{#arraysize:minibosses}}|0 | |||
||<h2>Mini Bosses</h2> | |||
<ul>{{ | |||
#loop: i | |||
}}</ul> | |1 | ||
|{{#expr:{{#arraysize:minibosses}}-1}} | |||
<ul>{{#loop: i | |{{#vardefine:current|{{ #arrayindex:minibosses | {{ #var:i }}}}}}<!-- | ||
--><li>[[{{#var:current}}]]</li> | |||
}}</ul>}}<!-- | |||
-->{{#ifeq:{{#arraysize:monsters}}|0 | |||
||<h2>Monsters</h2> | |||
}}</ul> | <ul>{{ | ||
#loop: i | |||
|1 | |||
|{{#expr:{{#arraysize:monsters}}-1}} | |||
|{{#vardefine:current|{{ #arrayindex:monsters | {{ #var:i }}}}}}<!-- | |||
--><li>[[{{#var:current}}]]</li> | |||
}}</ul>}}<!-- | |||
--></includeonly><noinclude> | |||
Example: <pre> {{GenerateMonsterRace|Skeleton}} </pre> | |||
{{GenerateRacePage|Skeleton}} | |||
</noinclude> |
Latest revision as of 21:33, 8 April 2024
Example:
{{GenerateMonsterRace|Skeleton}}