Template:AttributeBlock: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
mNo edit summary
(Big update to template, now supports many more fields)
Line 1: Line 1:
<includeonly>{{#if: {{{level|}}} | <div>'''Level''' {{{level}}}</div>}}{{#if: {{{hp|}}} | <div>'''Hit Points''' {{C|{{Icon|HP Icon.png|15}} {{{hp}}}}}</div>}}{{#if: {{{ac|}}} | <div>'''Armour Class''' {{C|{{Icon|Armour Class Icon.png|20}} {{{ac}}}}}</div>}}
<includeonly><table class="bg3wiki-info-blob" style="text-align: center; min-width: {{#if: {{{6|}}} | 420px | 210px}};"><!--
<table class="bg3wiki-info-blob" style="text-align: center; min-width: {{#if: {{{6|}}} | 420px | 210px}};">
 
<tr>
------------
<td>
LEVEL
------------
-->{{#if: {{{level|}}} | <tr><td colspan="100%"><p style="text-align:center;line-height:0.7">Level {{{level}}}</p></td></tr>}}<!--
 
------------
ABILITY SCORES
------------
--><tr>
<td style="width:65px">
[[File:strength icon.png|frameless|40px|center|link=Strength]] [[Strength|STR]]
[[File:strength icon.png|frameless|40px|center|link=Strength]] [[Strength|STR]]
'''{{{1}}}''' {{#ifexpr: {{{1|}}} > 11 | <br><span style="font-size:0.8em">(+{{#expr:floor(({{{1|}}}-10)/2)}})</span> | {{#ifexpr: {{{1|}}} < 10 | <br><span style="font-size:0.8em">({{#expr:floor(({{{1|}}}-10)/2)}})</span> | <br>&nbsp; }} }}
'''{{{1}}}''' {{#ifexpr: {{{1|}}} > 11 | <br><span style="font-size:0.8em">(+{{#expr:floor(({{{1|}}}-10)/2)}})</span> | {{#ifexpr: {{{1|}}} < 10 | <br><span style="font-size:0.8em">({{#expr:floor(({{{1|}}}-10)/2)}})</span> | <br>&nbsp; }} }}
</td>
</td>


<td>
<td style="width:65px">
[[File:dexterity icon.png|frameless|40px|center|link=Dexterity]] [[Dexterity|DEX]]
[[File:dexterity icon.png|frameless|40px|center|link=Dexterity]] [[Dexterity|DEX]]
'''{{{2}}}''' {{#ifexpr: {{{2|}}} > 11 | <br><span style="font-size:0.8em">(+{{#expr:floor(({{{2|}}}-10)/2)}})</span> | {{#ifexpr: {{{2|}}} < 10 | <br><span style="font-size:0.8em">({{#expr:floor(({{{2|}}}-10)/2)}})</span> | <br>&nbsp; }} }}
'''{{{2}}}''' {{#ifexpr: {{{2|}}} > 11 | <br><span style="font-size:0.8em">(+{{#expr:floor(({{{2|}}}-10)/2)}})</span> | {{#ifexpr: {{{2|}}} < 10 | <br><span style="font-size:0.8em">({{#expr:floor(({{{2|}}}-10)/2)}})</span> | <br>&nbsp; }} }}
</td>
</td>


<td>
<td style="width:65px">
[[File:constitution icon.png|frameless|40px|center|link=Constitution]] [[Constitution|CON]]
[[File:constitution icon.png|frameless|40px|center|link=Constitution]] [[Constitution|CON]]
'''{{{3}}}''' {{#ifexpr: {{{3|}}} > 11 | <br><span style="font-size:0.8em">(+{{#expr:floor(({{{3|}}}-10)/2)}})</span> | {{#ifexpr: {{{3|}}} < 10 | <br><span style="font-size:0.8em">({{#expr:floor(({{{3|}}}-10)/2)}})</span> | <br>&nbsp; }} }}
'''{{{3}}}''' {{#ifexpr: {{{3|}}} > 11 | <br><span style="font-size:0.8em">(+{{#expr:floor(({{{3|}}}-10)/2)}})</span> | {{#ifexpr: {{{3|}}} < 10 | <br><span style="font-size:0.8em">({{#expr:floor(({{{3|}}}-10)/2)}})</span> | <br>&nbsp; }} }}
Line 18: Line 26:


{{#if: {{{4|}}} |
{{#if: {{{4|}}} |
<td>
<td style="width:65px">
[[File:intelligence icon.png|frameless|40px|center|link=Intelligence]] [[Intelligence|INT]]
[[File:intelligence icon.png|frameless|40px|center|link=Intelligence]] [[Intelligence|INT]]
'''{{{4}}}''' {{#ifexpr: {{{4|}}} > 11 | <br><span style="font-size:0.8em">(+{{#expr:floor(({{{4|}}}-10)/2)}})</span> | {{#ifexpr: {{{4|}}} < 10 | <br><span style="font-size:0.8em">({{#expr:floor(({{{4|}}}-10)/2)}})</span> | <br>&nbsp; }} }}
'''{{{4}}}''' {{#ifexpr: {{{4|}}} > 11 | <br><span style="font-size:0.8em">(+{{#expr:floor(({{{4|}}}-10)/2)}})</span> | {{#ifexpr: {{{4|}}} < 10 | <br><span style="font-size:0.8em">({{#expr:floor(({{{4|}}}-10)/2)}})</span> | <br>&nbsp; }} }}
Line 25: Line 33:


{{#if: {{{5|}}} |
{{#if: {{{5|}}} |
<td>
<td style="width:65px">
[[File:wisdom icon.png|frameless|40px|center|link=Wisdom]] [[Wisdom|WIS]]
[[File:wisdom icon.png|frameless|40px|center|link=Wisdom]] [[Wisdom|WIS]]
'''{{{5}}}''' {{#ifexpr: {{{5|}}} > 11 | <br><span style="font-size:0.8em">(+{{#expr:floor(({{{5|}}}-10)/2)}})</span> | {{#ifexpr: {{{5|}}} < 10 | <br><span style="font-size:0.8em">({{#expr:floor(({{{5|}}}-10)/2)}})</span> | <br>&nbsp; }} }}
'''{{{5}}}''' {{#ifexpr: {{{5|}}} > 11 | <br><span style="font-size:0.8em">(+{{#expr:floor(({{{5|}}}-10)/2)}})</span> | {{#ifexpr: {{{5|}}} < 10 | <br><span style="font-size:0.8em">({{#expr:floor(({{{5|}}}-10)/2)}})</span> | <br>&nbsp; }} }}
Line 32: Line 40:


{{#if: {{{6|}}} |
{{#if: {{{6|}}} |
<td>
<td style="width:65px">
[[File:charisma icon.png|frameless|40px|center|link=Charisma]] [[Charisma|CHA]]
[[File:charisma icon.png|frameless|40px|center|link=Charisma]] [[Charisma|CHA]]
'''{{{6}}}''' {{#ifexpr: {{{6|}}} > 11 | <br><span style="font-size:0.8em">(+{{#expr:floor(({{{6|}}}-10)/2)}})</span> | {{#ifexpr: {{{6|}}} < 10 | <br><span style="font-size:0.8em">({{#expr:floor(({{{6|}}}-10)/2)}})</span> | <br>&nbsp; }} }}
'''{{{6}}}''' {{#ifexpr: {{{6|}}} > 11 | <br><span style="font-size:0.8em">(+{{#expr:floor(({{{6|}}}-10)/2)}})</span> | {{#ifexpr: {{{6|}}} < 10 | <br><span style="font-size:0.8em">({{#expr:floor(({{{6|}}}-10)/2)}})</span> | <br>&nbsp; }} }}
</td>
</td>
}}
}}
</tr>
</tr><!--
</table></includeonly><noinclude>This template generates an attribute stat block for a creature.
------------
DIVIDING LINE
------------
-->{{#if: {{{race|}}} | <tr><td colspan="100%" style="padding-left:10px;padding-right:10px;"><hr/></td></tr> | {{#if: {{{type|}}} | <tr><td colspan="100%" style="padding-left:10px;padding-right:10px;"><hr/></td></tr> | {{#if: {{{hp|}}} | <tr><td colspan="100%" style="padding-left:10px;padding-right:10px;"><hr/></td></tr> }} | {{#if: {{{ac|}}} | <tr><td colspan="100%" style="padding-left:10px;padding-right:10px;"><hr/></td></tr> | {{#if: {{{ms|}}} | <tr><td colspan="100%" style="padding-left:10px;padding-right:10px;"><hr/></td></tr> | {{#if: {{{size|}}} | <tr><td colspan="100%" style="padding-left:10px;padding-right:10px;"><hr/></td></tr> | {{#if: {{{weight|}}} | <tr><td colspan="100%" style="padding-left:10px;padding-right:10px;"><hr/></td></tr> }} | {{#if: {{{prof|}}} | <tr><td colspan="100%" style="padding-left:10px;padding-right:10px;"><hr/></td></tr> }} | {{#if: {{{init|}}} | <tr><td colspan="100%" style="padding-left:10px;padding-right:10px;"><hr/></td></tr> }} }} }} }} }} }}<!--


------------
RACE
------------
-->{{#if: {{{race|}}} |
<tr style="line-height:0.5;text-align:left;">
<td colspan="{{#if: {{{6|}}} | 3 | 2}}"><p style="margin:0px;">[[File:Creature Race Icon.png|frameless|x24px|link=]] Race</p></td>
<td colspan="{{#if: {{{6|}}} | 3 | 1}}"><p style="margin:0px;">{{{race}}}</td>
</tr>}}<!--
------------
TYPE
------------
-->{{#if: {{{type|}}} |
<tr style="line-height:0.5;text-align:left;">
<td colspan="{{#if: {{{6|}}} | 3 | 2}}"><p style="margin:0px;">[[File:Creature Type Icon.png|frameless|x24px|link=]] Type</p></td>
<td colspan="{{#if: {{{6|}}} | 3 | 1}}"><p style="margin:0px;">{{{type}}}</td>
</tr>}}<!--
------------
HP
------------
-->{{#if: {{{hp|}}} |
<tr style="line-height:0.5;text-align:left;">
<td colspan="{{#if: {{{6|}}} | 3 | 2}}"><p style="margin:0px;">[[File:HP Icon.png|frameless|x24px|link=]] Hit Points</p></td>
<td colspan="{{#if: {{{6|}}} | 3 | 1}}"><p style="margin:0px;">{{{hp}}}</td>
</tr>}}<!--
------------
ARMOUR CLASS
------------
-->{{#if: {{{ac|}}} |
<tr style="line-height:0.5;text-align:left;">
<td colspan="{{#if: {{{6|}}} | 3 | 2}}"><p style="margin:0px;">[[File:Creature AC Icon.png|frameless|x24px|link=]] Armour Class</p></td>
<td colspan="{{#if: {{{6|}}} | 3 | 1}}"><p style="margin:0px;">{{{ac}}}</td>
</tr>}}<!--
------------
MOVEMENT SPEED
------------
-->{{#if: {{{ms|}}} |
<tr style="line-height:0.5;text-align:left;">
<td colspan="{{#if: {{{6|}}} | 3 | 2}}"><p style="margin:0px;">[[File:Creature Speed Icon.png|frameless|x24px|link=]] Movement Speed</p></td>
<td colspan="{{#if: {{{6|}}} | 3 | 1}}"><p style="margin:0px;">{{{ms}}}</td>
</tr>}}<!--
------------
SIZE
------------
-->{{#if: {{{size|}}} |
<tr style="line-height:0.5;text-align:left;">
<td colspan="{{#if: {{{6|}}} | 3 | 2}}"><p style="margin:0px;">[[File:Creature Size Icon.png|frameless|x24px|link=]] Size</p></td>
<td colspan="{{#if: {{{6|}}} | 3 | 1}}"><p style="margin:0px;">{{{size}}}</td>
</tr>}}<!--
------------
WEIGHT
------------
-->{{#if: {{{weight|}}} |
<tr style="line-height:0.5;text-align:left;">
<td colspan="{{#if: {{{6|}}} | 3 | 2}}"><p style="margin:0px;">[[File:Weight Icon.png|frameless|x24px|link=]] Weight</p></td>
<td colspan="{{#if: {{{6|}}} | 3 | 1}}"><p style="margin:0px;">{{{weight}}}</td>
</tr>}}<!--
------------
PROFICIENCY
------------
-->{{#if: {{{prof|}}} |
<tr style="line-height:0.5;text-align:left;">
<td colspan="{{#if: {{{6|}}} | 3 | 2}}"><p style="margin:0px;">[[File:Proficiency Icon.png|frameless|x24px|link=]] Proficiency Bonus</p></td>
<td colspan="{{#if: {{{6|}}} | 3 | 1}}"><p style="margin:0px;">+{{{prof}}}</td>
</tr>}}<!--
------------
INITIATIVE
------------
-->{{#if: {{{init|}}} |
<tr style="line-height:0.5;text-align:left;">
<td colspan="{{#if: {{{6|}}} | 3 | 2}}"><p style="margin:0px;">[[File:Initiative Icon.png|frameless|x24px|link=]] Initiative</p></td>
<td colspan="{{#if: {{{6|}}} | 3 | 1}}"><p style="margin:0px;">{{{init}}}</td>
</tr>}}</table></includeonly><!--
------------
EXAMPLE 1
------------
--><noinclude>This template generates a stat block for a creature.
<hr>
<hr>
Usage:
The first 6 parameters indicate the creature's ability scores (Str/Dex/Con/Int/Wis/Cha).
Of these, the last 3 (Int/Wis/Cha) are optional and can omitted.
The following are optional parameters:
* level - A creature's level.
* race - A creature's race, e.g. Human.
* type - A creature's type, e.g. Undead.
* hp - Hit points.
* ac - Armour Class.
* ms - Movement Speed. Try to include both meters and feet if possible, in that order.
* size - Size class of the creature, e.g. Large.
* weight - Creature weight. Try to include both kg and lbs if possible, in that order.
* prof - Proficiency bonus.
* init - Initiative bonus (or penalty).


Usage:
Here is an example full stat block:


{{C|<nowiki>{{AttributeBlock|15|8|11|9|18|10|level=5|hp=57|ac=12}}</nowiki>}}
{{C|<nowiki>{{AttributeBlock|15|8|11|9|18|10</nowiki>
<br><nowiki>|level=3</nowiki>
<br><nowiki>|race=Skeleton</nowiki>
<br><nowiki>|type=Undead</nowiki>
<br><nowiki>|hp=28</nowiki>
<br><nowiki>|ac=15</nowiki>
<br><nowiki>|ms=10m / 30ft</nowiki>
<br><nowiki>|size=Medium</nowiki>
<br><nowiki>|weight=20kg / 40lbs</nowiki>
<br><nowiki>|prof=2</nowiki>
<br><nowiki>|init=-1</nowiki>
<br><nowiki>}}</nowiki>}}


Result:
Result:


{{AttributeBlock|15|8|11|9|18|10|level=5|hp=57|ac=12}}
{{AttributeBlock|15|8|11|9|18|10
|level=3
|race=Skeleton
|type=Undead
|hp=28
|ac=15
|ms=10m / 30ft
|size=Medium
|weight=20kg / 40lbs
|prof=2
|init=-1
}}


<!-----------
EXAMPLE 2
-------------->
<hr>
<hr>
 
This is an example of using this template to show only attribute scores:
One or both of the '''level''' and '''hp''' parameters are optional and can be omitted, like so:


{{C|<nowiki>{{AttributeBlock|15|8|11|9|18|10}}</nowiki>}}
{{C|<nowiki>{{AttributeBlock|15|8|11|9|18|10}}</nowiki>}}
Line 60: Line 197:
{{AttributeBlock|15|8|11|9|18|10}}
{{AttributeBlock|15|8|11|9|18|10}}


<!-----------
EXAMPLE 3
-------------->
<hr>
<hr>
 
This is an example of using this template to show only physical attributes - useful for Wild Shape stat blocks.
The mental attributes can also be omitted, for use in shapeshifting stat blocks, like so:


{{C|<nowiki>{{AttributeBlock|15|8|11|hp=12}}</nowiki>}}
{{C|<nowiki>{{AttributeBlock|15|8|11|hp=12}}</nowiki>}}

Revision as of 02:55, 19 April 2023

This template generates a stat block for a creature.


Usage:

The first 6 parameters indicate the creature's ability scores (Str/Dex/Con/Int/Wis/Cha).

Of these, the last 3 (Int/Wis/Cha) are optional and can omitted.

The following are optional parameters:

  • level - A creature's level.
  • race - A creature's race, e.g. Human.
  • type - A creature's type, e.g. Undead.
  • hp - Hit points.
  • ac - Armour Class.
  • ms - Movement Speed. Try to include both meters and feet if possible, in that order.
  • size - Size class of the creature, e.g. Large.
  • weight - Creature weight. Try to include both kg and lbs if possible, in that order.
  • prof - Proficiency bonus.
  • init - Initiative bonus (or penalty).

Here is an example full stat block:

{{AttributeBlock|15|8|11|9|18|10
|level=3
|race=Skeleton
|type=Undead
|hp=28
|ac=15
|ms=10m / 30ft
|size=Medium
|weight=20kg / 40lbs
|prof=2
|init=-1
}}

Result:

Level 3

Strength icon.png
STR

15
(+2)

Dexterity icon.png
DEX

8
(-1)

Constitution icon.png
CON

11
 

Intelligence icon.png
INT

9
(-1)

Wisdom icon.png
WIS

18
(+4)

Charisma icon.png
CHA

10
 


Creature Race Icon.png Race

Skeleton

Creature Type Icon.png Type

Undead

HP Icon.png Hit Points

28

Creature AC Icon.png Armour Class

15

Creature Speed Icon.png Movement Speed

10m / 30ft

Creature Size Icon.png Size

Medium

Weight Icon.png Weight

20kg / 40lbs

Proficiency Icon.png Proficiency Bonus

+2

Initiative Icon.png Initiative

-1


This is an example of using this template to show only attribute scores:

{{AttributeBlock|15|8|11|9|18|10}}

Result:

Strength icon.png
STR

15
(+2)

Dexterity icon.png
DEX

8
(-1)

Constitution icon.png
CON

11
 

Intelligence icon.png
INT

9
(-1)

Wisdom icon.png
WIS

18
(+4)

Charisma icon.png
CHA

10
 


This is an example of using this template to show only physical attributes - useful for Wild Shape stat blocks.

{{AttributeBlock|15|8|11|hp=12}}

Result:

Strength icon.png
STR

15
(+2)

Dexterity icon.png
DEX

8
(-1)

Constitution icon.png
CON

11
 


HP Icon.png Hit Points

12