From Dark and Darker Wiki

m (Fixed bug: invisible characters.)
(Monster Data structure was changed. Fixed call.)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<includeonly>{{#arraydefine:all|{{Monster Data|{{{1}}}s}}}}<!--
<includeonly>{{#arraydefine:all|{{Monster Data|{{{1}}}}}}}<!--
-->{{#arraydefine:bosses}}<!--
-->{{#arraydefine:bosses}}<!--
-->{{#arraydefine:minibosses}}<!--
-->{{#arraydefine:minibosses}}<!--
-->{{#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>{{
    |1
        #loop: i
    |{{#expr:{{#arraysize:bosses}}-1}}
        |1
    |{{#vardefine:current|{{ #arrayindex:bosses | {{ #var:i }}}}}}<!--
        |{{#expr:{{#arraysize:bosses}}-1}}
    --><li>[[{{#var:current}}]]</li>
        |{{#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>
    |1
    <ul>{{
    |{{#expr:{{#arraysize:minibosses}}-1}}
        #loop: i
    |{{#vardefine:current|{{ #arrayindex:minibosses | {{ #var:i }}}}}}<!--
        |1
    --><li>[[{{#var:current}}]]</li>
        |{{#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
    |1
    ||<h2>Monsters</h2>
    |{{#expr:{{#arraysize:monsters}}-1}}
    <ul>{{
    |{{#vardefine:current|{{ #arrayindex:monsters | {{ #var:i }}}}}}<!--
        #loop: i
    --><li>[[{{#var:current}}]]</li>
        |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>

Latest revision as of 21:33, 8 April 2024