From Dark and Darker Wiki
m (Fixed bug: invisible characters.) |
m (Cleaned up whitespace. Formatted the code to indicate scope level.) |
||
Line 4: | Line 4: | ||
-->{{#arraydefine:monsters}}<!-- | -->{{#arraydefine:monsters}}<!-- | ||
Sieves the array "all" into three types | 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|| | -->{{#ifeq:{{#arraysize:bosses}}|0 | ||
<h2>Bosses</h2> | ||<h2>Bosses</h2> | ||
<ul>{{#loop: i | <ul>{{ | ||
#loop: i | |||
|1 | |||
|{{#expr:{{#arraysize:bosses}}-1}} | |||
|{{#vardefine:current|{{ #arrayindex:bosses | {{ #var:i }}}}}}<!-- | |||
}}</ul>}}<!-- | --><li>[[{{#var:current}}]]</li> | ||
-->{{#ifeq:{{#arraysize:minibosses}}|0|| | }}</ul>}}<!-- | ||
<h2>Mini Bosses</h2> | -->{{#ifeq:{{#arraysize:minibosses}}|0 | ||
<ul>{{#loop: i | ||<h2>Mini Bosses</h2> | ||
<ul>{{ | |||
#loop: i | |||
|1 | |||
|{{#expr:{{#arraysize:minibosses}}-1}} | |||
}}</ul>}}<!-- | |{{#vardefine:current|{{ #arrayindex:minibosses | {{ #var:i }}}}}}<!-- | ||
-->{{#ifeq:{{#arraysize:monsters}}|0|| | --><li>[[{{#var:current}}]]</li> | ||
<h2>Monsters</h2> | }}</ul>}}<!-- | ||
<ul>{{#loop: i | -->{{#ifeq:{{#arraysize:monsters}}|0 | ||
||<h2>Monsters</h2> | |||
<ul>{{ | |||
#loop: i | |||
|1 | |||
}}</ul>}}</includeonly><noinclude> | |{{#expr:{{#arraysize:monsters}}-1}} | ||
|{{#vardefine:current|{{ #arrayindex:monsters | {{ #var:i }}}}}}<!-- | |||
--><li>[[{{#var:current}}]]</li> | |||
}}</ul>}}<!-- | |||
--></includeonly><noinclude> | |||
Example: <pre> {{GenerateMonsterRace|Skeleton}} </pre> | Example: <pre> {{GenerateMonsterRace|Skeleton}} </pre> | ||
{{GenerateRacePage|Skeleton}} | {{GenerateRacePage|Skeleton}} | ||
</noinclude> | </noinclude> |
Revision as of 02:00, 4 March 2024
Example:
{{GenerateMonsterRace|Skeleton}}