Template:Creature mutation: Difference between revisions

From Caves of Qud Wiki
Jump to navigation Jump to search
m (fixed bug with negative ego bonus)
(JoinKey, moved stuff to doc)
Line 2: Line 2:
|Mutation=Page
|Mutation=Page
|MutationLevel=Integer
|MutationLevel=Integer
|Bonus=Integer}}</noinclude><includeonly>{{#cargo_store:_table=CreatureMutations
|Bonus=Integer
|JoinKey=String}}</noinclude><includeonly>{{#cargo_store:_table=CreatureMutations
|Mutation={{{1|}}}
|Mutation={{{1|}}}
|MutationLevel={{{2|0}}}
|MutationLevel={{{2|0}}}
|Bonus={{modifier|{{{3|16}}}}} }}<!----
|Bonus={{modifier|{{{3|16}}}}}
|JoinKey={{FULLPAGENAME}} }}<!----


   Start
   Start


--><div class="qud-mutation-entry">[[{{{1|}}}|{{{1|}}}{{#ifeq: {{{2|0}}} | 0 |{{#ifeq: {{#cargo_query:table=Mutations|fields=_pageName=Page|where=_pageName='{{{1|Albino}}}' AND Type LIKE '% defect'|default=NONE}}| NONE ||<b><span style="color:#b1c9c3;">&nbsp;(</span><span style="color:#a64a2e;">D</span><span style="color:#b1c9c3;">)</span></b>}}|{{#ifeq: {{#cargo_query:table=Mutations|fields=Type|where=_pageName='{{{1|Albino}}}' AND Type='Mental'|default=NONE}} | NONE |<b><span style="color:#b1c9c3;">&nbsp;(</span><span style="color:#77bfcf;">{{{2|0}}}</span><span style="color:#b1c9c3;">)</span></b>|{{#vardefine:mod|{{modifier|{{{3|16}}}}}}}{{#ifexpr: {{#var:mod}} > 0|{{#vardefine:color|#00c420}}{{#vardefine:symbol|+}}|{{#ifexpr: {{#var:mod}} < 0|{{#vardefine:color|#d74200}}{{#vardefine:symbol|}}|{{#vardefine:color|#b1c9c3}}{{#vardefine:symbol|+}}}}}}<b><span style="color:#b1c9c3;">&nbsp;(</span><span style="color:#77bfcf;">{{{2|0}}}</span><span style="color:{{#var_final:color}};">{{#var:symbol}}{{#var:mod}}</span><span style="color:#b1c9c3;">)</span></b>}}}}]]</div></includeonly><noinclude>[[Category:Templates]]  
--><div class="qud-mutation-entry">[[{{{1|}}}|{{{1|}}}{{#ifeq: {{{2|0}}} | 0 |{{#ifeq: {{#cargo_query:table=Mutations|fields=_pageName=Page|where=_pageName='{{{1|Albino}}}' AND Type LIKE '% defect'|default=NONE}}| NONE ||<b><span style="color:#b1c9c3;">&nbsp;(</span><span style="color:#a64a2e;">D</span><span style="color:#b1c9c3;">)</span></b>}}|{{#ifeq: {{#cargo_query:table=Mutations|fields=Type|where=_pageName='{{{1|Albino}}}' AND Type='Mental'|default=NONE}} | NONE |<b><span style="color:#b1c9c3;">&nbsp;(</span><span style="color:#77bfcf;">{{{2|0}}}</span><span style="color:#b1c9c3;">)</span></b>|{{#vardefine:mod|{{modifier|{{{3|16}}}}}}}{{#ifexpr: {{#var:mod}} > 0|{{#vardefine:color|#00c420}}{{#vardefine:symbol|+}}|{{#ifexpr: {{#var:mod}} < 0|{{#vardefine:color|#d74200}}{{#vardefine:symbol|}}|{{#vardefine:color|#b1c9c3}}{{#vardefine:symbol|+}}}}}}<b><span style="color:#b1c9c3;">&nbsp;(</span><span style="color:#77bfcf;">{{{2|0}}}</span><span style="color:{{#var_final:color}};">{{#var:symbol}}{{#var:mod}}</span><span style="color:#b1c9c3;">)</span></b>}}}}]]</div></includeonly><noinclude>[[Category:Cargo Store Templates]]  
 
{{doc}}
Template for use in [[Template:Character]] only.
 
The first argument is the mutation name, and the second is the mutation level (defaults to 0).
 
<syntaxhighlight lang="xml">
{{creature mutation|Burrowing Claws|3}}
</syntaxhighlight>
{{creature mutation|Burrowing Claws|3}}
 
If mutation level is 0(or not set), the mutation level will not be shown (used for 1 pt mutations). If the mutation is a defect, a (D) will automatically be added:
<syntaxhighlight lang="xml">
{{creature mutation|Albino}}
</syntaxhighlight>
{{creature mutation|Albino}}
 
This template also takes a third argument, the ego value of a creature. If the mutation is a mental mutation, it will add bonus levels based on the ego modifier.
<syntaxhighlight lang="xml">
{{creature mutation|Psychometry|3|9}}
</syntaxhighlight>
{{creature mutation|Psychometry|3|9}}
 
</noinclude>
</noinclude>

Revision as of 02:19, 16 December 2019

This template defines the table "CreatureMutations". View table.

Template-info.png Documentation

Template for use in Template:Character only.

The first argument is the mutation name, and the second is the mutation level (defaults to 0).

{{creature mutation|Burrowing Claws|3}}
Burrowing Claws (3)

If mutation level is 0(or not set), the mutation level will not be shown (used for 1 pt mutations). If the mutation is a defect, a (D) will automatically be added:

{{creature mutation|Albino}}
Albino (D)

This template also takes a third argument, the ego value of a creature. If the mutation is a mental mutation, it will add bonus levels based on the ego modifier.

{{creature mutation|Psychometry|3|9}}
Psychometry (3-4)