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|Beasts}}}}-->
<!--{{#arraydefine:all|{{Monster Data|{{{1}}}}}}}-->
{{#arraydefine:all|Cave Troll,Cockatrice,Dire Wolf}}
{{#arraydefine:all|Cave Troll,Cockatrice,Dire Wolf}}
==Bosses==
{{#arraydefine:bosses}}
<ul>{{#loop: i
{{#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
     |0
     |1
     |{{#arraysize:all}}
     |{{#expr:{{#arraysize:minibosses}}-1}}
     |{{#vardefine:current|{{ #arrayindex:all | {{ #var:i }}}}}}<!--
     |{{#vardefine:current|{{ #arrayindex:minibosses | {{ #var:i }}}}}}<!--
    If current monster is miniboss but not a boss, display it.
     --><li>[[{{#var:current}}]]</li>
     -->{{#if:{{Monster Data|{{#var:current}}|Boss}}||{{#if:{{Monster Data|{{#var:current}}|MiniBoss}}|<li>[[{{#var:current}}]]</li>}}}}
}}</ul>
}}</ul>
==Monsters==
==Monsters==
<ul>{{#loop: i
<ul>{{#loop: i
     |0
     |1
     |{{#arraysize:all}}
     |{{#expr:{{#arraysize:monsters}}-1}}
     |{{#vardefine:current|{{ #arrayindex:all | {{ #var:i }}}}}}<!--
     |{{#vardefine:current|{{ #arrayindex:monsters | {{ #var:i }}}}}}<!--
    If current monster is not a miniboss and not a boss, display it.
     --><li>[[{{#var:current}}]]</li>
     -->{{#if:{{Monster Data|{{#var:current}}|Boss}}||{{#if:{{Monster Data|{{#var:current}}|MiniBoss}}||<li>[[{{#var:current}}]]</li>}}}}
}}</ul>
}}</ul>

Revision as of 18:30, 20 February 2024




Bosses

Mini Bosses

Monsters