Template:Infobox creature: Difference between revisions

From Baldur's Gate 3 Wiki
Jump to navigation Jump to search
(Remove wrapping div because we modify PortableInfobox to do this properly.)
(Improve handling of unspecified ability stat parameters.)
(One intermediate revision by the same user not shown)
Line 17: Line 17:
{{#lvardef: wis_mod | {{#ifexpr: {{{wis}}} > 11 | + }}{{#expr: floor({{{wis}}} / 2) - 5 }} }}
{{#lvardef: wis_mod | {{#ifexpr: {{{wis}}} > 11 | + }}{{#expr: floor({{{wis}}} / 2) - 5 }} }}
{{#lvardef: cha_mod | {{#ifexpr: {{{cha}}} > 11 | + }}{{#expr: floor({{{cha}}} / 2) - 5 }} }}
{{#lvardef: cha_mod | {{#ifexpr: {{{cha}}} > 11 | + }}{{#expr: floor({{{cha}}} / 2) - 5 }} }}
<!-- Initiative -->
{{#lvardef: initiative | {{{initiative | {{#if: {{{dex|}}} | {{#lvar:dex_mod}} }} }}} }}


<!-- Proficiency bonus -->
<!-- Proficiency bonus -->
Line 56: Line 59:


<!-- Explorer ability scores -->
<!-- Explorer ability scores -->
{{#lvardef: e_str | {{{e str | {{{str}}} }}} }}
{{#lvardef: e_str | {{{e str | {{{str|}}} }}} }}
{{#lvardef: e_dex | {{{e dex | {{{dex}}} }}} }}
{{#lvardef: e_dex | {{{e dex | {{{dex|}}} }}} }}
{{#lvardef: e_con | {{{e con | {{{con}}} }}} }}
{{#lvardef: e_con | {{{e con | {{{con|}}} }}} }}
{{#lvardef: e_int | {{{e int | {{{int}}} }}} }}
{{#lvardef: e_int | {{{e int | {{{int|}}} }}} }}
{{#lvardef: e_wis | {{{e wis | {{{wis}}} }}} }}
{{#lvardef: e_wis | {{{e wis | {{{wis|}}} }}} }}
{{#lvardef: e_cha | {{{e cha | {{{cha}}} }}} }}
{{#lvardef: e_cha | {{{e cha | {{{cha|}}} }}} }}


<!-- Explorer ability score modifiers -->
<!-- Explorer ability score modifiers -->
Line 71: Line 74:
{{#lvardef: e_cha_mod | {{#ifexpr: {{#lvar:e_cha}} > 11 | + }}{{#expr: floor({{#lvar:e_cha}} / 2) - 5 }} }}
{{#lvardef: e_cha_mod | {{#ifexpr: {{#lvar:e_cha}} > 11 | + }}{{#expr: floor({{#lvar:e_cha}} / 2) - 5 }} }}


{{#lvardef: e_initiative | {{{e initiative | {{#lvar:e_dex_mod}} }}} }}
<!-- Explorer initiative -->
{{#lvardef: e_initiative | {{{e initiative | {{#if: {{#lvar:e_dex}} | {{#lvar:e_dex_mod}} }} }}} }}


<!-- Explorer level -->
<!-- Explorer level -->
Line 128: Line 132:


<!-- Tactician ability scores -->
<!-- Tactician ability scores -->
{{#lvardef: t_str | {{{t str | {{{str}}} }}} }}
{{#lvardef: t_str | {{{t str | {{{str|}}} }}} }}
{{#lvardef: t_dex | {{{t dex | {{{dex}}} }}} }}
{{#lvardef: t_dex | {{{t dex | {{{dex|}}} }}} }}
{{#lvardef: t_con | {{{t con | {{{con}}} }}} }}
{{#lvardef: t_con | {{{t con | {{{con|}}} }}} }}
{{#lvardef: t_int | {{{t int | {{{int}}} }}} }}
{{#lvardef: t_int | {{{t int | {{{int|}}} }}} }}
{{#lvardef: t_wis | {{{t wis | {{{wis}}} }}} }}
{{#lvardef: t_wis | {{{t wis | {{{wis|}}} }}} }}
{{#lvardef: t_cha | {{{t cha | {{{cha}}} }}} }}
{{#lvardef: t_cha | {{{t cha | {{{cha|}}} }}} }}


<!-- Tactician ability score modifiers -->
<!-- Tactician ability score modifiers -->
Line 143: Line 147:
{{#lvardef: t_cha_mod | {{#ifexpr: {{#lvar:t_cha}} > 11 | + }}{{#expr: floor({{#lvar:t_cha}} / 2) - 5 }} }}
{{#lvardef: t_cha_mod | {{#ifexpr: {{#lvar:t_cha}} > 11 | + }}{{#expr: floor({{#lvar:t_cha}} / 2) - 5 }} }}


{{#lvardef: t_initiative | {{{t initiative | {{#lvar:t_dex_mod}} }}} }}
<!-- Tactician initiative -->
{{#lvardef: t_initiative | {{{t initiative | {{#if: {{#lvar:t_dex}} | {{#lvar:t_dex_mod}} }} }}} }}


<!-- Tactician level -->
<!-- Tactician level -->
Line 215: Line 220:
{{#lvardef: h_cha_mod | {{#ifexpr: {{#lvar:h_cha}} > 11 | + }}{{#expr: floor({{#lvar:h_cha}} / 2) - 5 }} }}
{{#lvardef: h_cha_mod | {{#ifexpr: {{#lvar:h_cha}} > 11 | + }}{{#expr: floor({{#lvar:h_cha}} / 2) - 5 }} }}


{{#lvardef: h_initiative | {{{h initiative | {{#lvar:t_initiative}} }}} }}
<!-- Honour initiative -->
{{#lvardef: h_initiative | {{{h initiative | {{#if: {{#lvar:h_dex}} | {{#lvar:t_initiative}} }} }}} }}


<!-- Honour level -->
<!-- Honour level -->
Line 277: Line 283:
| hp = {{{hp|}}}
| hp = {{{hp|}}}
| ac = {{{ac|}}}
| ac = {{{ac|}}}
| initiative = {{{initiative|{{#lvar:dex_mod}}}}}
| initiative = {{#lvar:initiative}}
| prof bonus = {{#lvar:prof_bonus}}
| prof bonus = {{#lvar:prof_bonus}}
| movement m = {{{movement m|}}}
| movement m = {{{movement m|}}}

Revision as of 23:18, 1 June 2024

This is the main creature infobox template. It does a bunch of processing on its parameters before passing on all the results to Template:Infobox creature/internal for displaying.

List of helper sub-templates:

Usage tips:

  • To override stats for Explorer, Tactician, or Honour mode, use parameters starting with e, t, or h, respectively. E.g. use t hp to specify the HP value for Tactician difficulty. Explorer and Tactician fall back to Balanced (default) stats when a stat isn't overridden; Honour falls abck to Tactician stats.
  • The passives list may contain elements of the format Passive name @ Item name to specify the item that grants the passive. This will make that item's icon be used if the passive itself doesn't have an icon.
  • The image property may contain a <gallery>...</gallery>.
  • The provided image will be automatically set as the page image (as if using Template:PageSeo), unless it's a gallery. If it's a gallery, you can use the page image property instead to set the page image.

Example use:

{{Infobox creature
| name = Test
| title = Title
| image =
<gallery>
Steel Watcher Ranged.png|Ranged
Steel Watcher Model.png|Model
</gallery>
| full name = Duke Wellington
| va = Keanu Reeves
| role = Mascot
| faction = Gondor
| family = The Reeves'
| hometown = The Shire

| size = Smol
| type = Mammal
| race = Cat
| class = Felinid
| background = Outlander

| level = 10
| hp = 10
| ac = 10
| initiative = +5
| prof bonus = +4
| movement m = 9
| weight kg = 600

| str = 11
| dex = 12
| con = 13
| int = 14
| wis = 15
| cha = 16

| dex save prof = yes
| con save prof = yes

| resistances = fire resistant, cold resistant, lightning vulnerable
| conditions = Aura of Protection, Aura of Hate
| passives = Agile Chassis, Cull the Weak (Drider)

| e level = 8
| e hp = 8
| e ac = 8
| e initiative = +4
| e prof bonus = +3

| e str = 10
| e dex = 11
| e con = 12
| e int = 13
| e wis = 14
| e cha = 15

| e resistances = cold resistant
| e conditions = Aura of Protection
| e passives = Agile Chassis

| t level = 12
| t hp = 12
| t ac = 12
| t initiative = +6
| t prof bonus = +5
| t movement m = 12
| t weight kg = 800

| t str = 13
| t dex = 14
| t con = 15
| t int = 16
| t wis = 17
| t cha = 18

| t resistances = fire immune, cold resistant, slashing immune nm, piercing immune nm, bludgeoning immune nm
| t conditions = Aura of Protection, Aura of Hate, Unstoppable
| t passives = Agile Chassis, Cull the Weak (Drider), Adamantine Shield @ Adamantine Shield

| h level = 14
| h hp = 14
| h ac = 14
| h initiative = +7
| h prof bonus = +6

| h str = 14
| h dex = 15
| h con = 16
| h int = 17
| h wis = 18
| h cha = 19

| h resistances = fire immune, cold immune, slashing immune nm, piercing immune nm, bludgeoning immune nm
| h conditions = Aura of Protection, Aura of Hate, Unstoppable, Legendary Resistance: Incapacitation
| h passives = Agile Chassis, Cull the Weak (Drider), Adamantine Shield @ Adamantine Shield, Fast Hands
}}