Template:Infobox creature: Difference between revisions

From Baldur's Gate 3 Wiki
Jump to navigation Jump to search
(Code cleanup using new templates.)
(Code cleanup, fix level display (don't display hidden level).)
Line 14: Line 14:


<!-- Ability score modifiers -->
<!-- Ability score modifiers -->
{{#lvardef: str_mod | {{plus if pos | {{#expr: floor({{{str}}} / 2) - 5 }} }} }}
{{#lvardef: str_mod | {{plus if pos | floor({{{str}}} / 2) - 5 }} }}
{{#lvardef: dex_mod | {{plus if pos | {{#expr: floor({{{dex}}} / 2) - 5 }} }} }}
{{#lvardef: dex_mod | {{plus if pos | floor({{{dex}}} / 2) - 5 }} }}
{{#lvardef: con_mod | {{plus if pos | {{#expr: floor({{{con}}} / 2) - 5 }} }} }}
{{#lvardef: con_mod | {{plus if pos | floor({{{con}}} / 2) - 5 }} }}
{{#lvardef: int_mod | {{plus if pos | {{#expr: floor({{{int}}} / 2) - 5 }} }} }}
{{#lvardef: int_mod | {{plus if pos | floor({{{int}}} / 2) - 5 }} }}
{{#lvardef: wis_mod | {{plus if pos | {{#expr: floor({{{wis}}} / 2) - 5 }} }} }}
{{#lvardef: wis_mod | {{plus if pos | floor({{{wis}}} / 2) - 5 }} }}
{{#lvardef: cha_mod | {{plus if pos | {{#expr: floor({{{cha}}} / 2) - 5 }} }} }}
{{#lvardef: cha_mod | {{plus if pos | floor({{{cha}}} / 2) - 5 }} }}


<!-- Initiative bonus -->
<!-- Initiative bonus -->
Line 25: Line 25:
   {{{initiative |
   {{{initiative |
     {{#if: {{{dex|}}} |
     {{#if: {{{dex|}}} |
       {{#expr: {{#lvar:dex_mod}} + {{{extra init|0}}} }}
       {{#lvar:dex_mod}} + {{{extra init|0}}}
     }}
     }}
   }}}
   }}}
Line 76: Line 76:


<!-- Explorer ability score modifiers -->
<!-- Explorer ability score modifiers -->
{{#lvardef: e_str_mod | {{plus if pos | {{#expr: floor({{#lvar:e_str}} / 2) - 5 }} }} }}
{{#lvardef: e_str_mod | {{plus if pos | floor({{#lvar:e_str}} / 2) - 5 }} }}
{{#lvardef: e_dex_mod | {{plus if pos | {{#expr: floor({{#lvar:e_dex}} / 2) - 5 }} }} }}
{{#lvardef: e_dex_mod | {{plus if pos | floor({{#lvar:e_dex}} / 2) - 5 }} }}
{{#lvardef: e_con_mod | {{plus if pos | {{#expr: floor({{#lvar:e_con}} / 2) - 5 }} }} }}
{{#lvardef: e_con_mod | {{plus if pos | floor({{#lvar:e_con}} / 2) - 5 }} }}
{{#lvardef: e_int_mod | {{plus if pos | {{#expr: floor({{#lvar:e_int}} / 2) - 5 }} }} }}
{{#lvardef: e_int_mod | {{plus if pos | floor({{#lvar:e_int}} / 2) - 5 }} }}
{{#lvardef: e_wis_mod | {{plus if pos | {{#expr: floor({{#lvar:e_wis}} / 2) - 5 }} }} }}
{{#lvardef: e_wis_mod | {{plus if pos | floor({{#lvar:e_wis}} / 2) - 5 }} }}
{{#lvardef: e_cha_mod | {{plus if pos | {{#expr: floor({{#lvar:e_cha}} / 2) - 5 }} }} }}
{{#lvardef: e_cha_mod | {{plus if pos | floor({{#lvar:e_cha}} / 2) - 5 }} }}


<!-- Explorer initiative bonus -->
<!-- Explorer initiative bonus -->
Line 89: Line 89:
     {{{initiative |
     {{{initiative |
       {{#if: {{#lvar:e_dex}} |
       {{#if: {{#lvar:e_dex}} |
         {{#expr: {{#lvar:e_dex_mod}} + {{#lvar:e_extra_init|0}} }}
         {{#lvar:e_dex_mod}} + {{#lvar:e_extra_init|0}}
       }}
       }}
     }}}
     }}}
Line 158: Line 158:


<!-- Tactician ability score modifiers -->
<!-- Tactician ability score modifiers -->
{{#lvardef: t_str_mod | {{plus if pos | {{#expr: floor({{#lvar:t_str}} / 2) - 5 }} }} }}
{{#lvardef: t_str_mod | {{plus if pos | floor({{#lvar:t_str}} / 2) - 5 }} }}
{{#lvardef: t_dex_mod | {{plus if pos | {{#expr: floor({{#lvar:t_dex}} / 2) - 5 }} }} }}
{{#lvardef: t_dex_mod | {{plus if pos | floor({{#lvar:t_dex}} / 2) - 5 }} }}
{{#lvardef: t_con_mod | {{plus if pos | {{#expr: floor({{#lvar:t_con}} / 2) - 5 }} }} }}
{{#lvardef: t_con_mod | {{plus if pos | floor({{#lvar:t_con}} / 2) - 5 }} }}
{{#lvardef: t_int_mod | {{plus if pos | {{#expr: floor({{#lvar:t_int}} / 2) - 5 }} }} }}
{{#lvardef: t_int_mod | {{plus if pos | floor({{#lvar:t_int}} / 2) - 5 }} }}
{{#lvardef: t_wis_mod | {{plus if pos | {{#expr: floor({{#lvar:t_wis}} / 2) - 5 }} }} }}
{{#lvardef: t_wis_mod | {{plus if pos | floor({{#lvar:t_wis}} / 2) - 5 }} }}
{{#lvardef: t_cha_mod | {{plus if pos | {{#expr: floor({{#lvar:t_cha}} / 2) - 5 }} }} }}
{{#lvardef: t_cha_mod | {{plus if pos | floor({{#lvar:t_cha}} / 2) - 5 }} }}


<!-- Tactician initiative bonus -->
<!-- Tactician initiative bonus -->
Line 171: Line 171:
     {{{initiative |
     {{{initiative |
       {{#if: {{#lvar:t_dex}} |
       {{#if: {{#lvar:t_dex}} |
         {{#expr: {{#lvar:t_dex_mod}} + {{#lvar:t_extra_init|0}} }}
         {{#lvar:t_dex_mod}} + {{#lvar:t_extra_init|0}}
       }}
       }}
     }}}
     }}}
Line 240: Line 240:


<!-- Honour ability score modifiers -->
<!-- Honour ability score modifiers -->
{{#lvardef: h_str_mod | {{#ifexpr: {{#lvar:h_str}} > 11 | + }}{{#expr: floor({{#lvar:h_str}} / 2) - 5 }} }}
{{#lvardef: h_str_mod | {{plus if pos | floor({{#lvar:h_str}} / 2) - 5 }} }}
{{#lvardef: h_dex_mod | {{#ifexpr: {{#lvar:h_dex}} > 11 | + }}{{#expr: floor({{#lvar:h_dex}} / 2) - 5 }} }}
{{#lvardef: h_dex_mod | {{plus if pos | floor({{#lvar:h_dex}} / 2) - 5 }} }}
{{#lvardef: h_con_mod | {{#ifexpr: {{#lvar:h_con}} > 11 | + }}{{#expr: floor({{#lvar:h_con}} / 2) - 5 }} }}
{{#lvardef: h_con_mod | {{plus if pos | floor({{#lvar:h_con}} / 2) - 5 }} }}
{{#lvardef: h_int_mod | {{#ifexpr: {{#lvar:h_int}} > 11 | + }}{{#expr: floor({{#lvar:h_int}} / 2) - 5 }} }}
{{#lvardef: h_int_mod | {{plus if pos | floor({{#lvar:h_int}} / 2) - 5 }} }}
{{#lvardef: h_wis_mod | {{#ifexpr: {{#lvar:h_wis}} > 11 | + }}{{#expr: floor({{#lvar:h_wis}} / 2) - 5 }} }}
{{#lvardef: h_wis_mod | {{plus if pos | floor({{#lvar:h_wis}} / 2) - 5 }} }}
{{#lvardef: h_cha_mod | {{#ifexpr: {{#lvar:h_cha}} > 11 | + }}{{#expr: floor({{#lvar:h_cha}} / 2) - 5 }} }}
{{#lvardef: h_cha_mod | {{plus if pos | floor({{#lvar:h_cha}} / 2) - 5 }} }}


<!-- Honour initiative bonus -->
<!-- Honour initiative bonus -->
Line 254: Line 254:
       {{{initiative |
       {{{initiative |
         {{#if: {{#lvar:h_dex}} |
         {{#if: {{#lvar:h_dex}} |
           {{#expr: {{#lvar:h_dex_mod}} + {{#lvar:h_extra_init|0}} }}
           {{#lvar:h_dex_mod}} + {{#lvar:h_extra_init|0}}
         }}
         }}
       }}}
       }}}
Line 324: Line 324:
| background = {{{background|}}}
| background = {{{background|}}}


| level = {{#lvar:level}}
| level = {{{level|}}}
| hp = {{{hp|}}}
| hp = {{{hp|}}}
| ac = {{{ac|}}}
| ac = {{{ac|}}}
Line 367: Line 367:
| passives = {{{passives|}}}
| passives = {{{passives|}}}


| e level = {{#lvar:e_level}}
| e level = {{{e level | {{{level|}}} }}}
| e hp = {{#lvar:e_hp}}
| e hp = {{#lvar:e_hp}}
| e ac = {{#lvar:e_ac}}
| e ac = {{#lvar:e_ac}}
Line 410: Line 410:
| e passives = {{#lvar:e_passives}}
| e passives = {{#lvar:e_passives}}


| t level = {{#lvar:t_level}}
| t level = {{{t level | {{{level|}}} }}}
| t hp = {{#lvar:t_hp}}
| t hp = {{#lvar:t_hp}}
| t ac = {{#lvar:t_ac}}
| t ac = {{#lvar:t_ac}}
Line 453: Line 453:
| t passives = {{#lvar:t_passives}}
| t passives = {{#lvar:t_passives}}


| h level = {{#lvar:h_level}}
| h level = {{{h level | {{{t level | {{{level|}}} }}} }}}
| h hp = {{#lvar:h_hp}}
| h hp = {{#lvar:h_hp}}
| h ac = {{#lvar:h_ac}}
| h ac = {{#lvar:h_ac}}

Revision as of 18:20, 7 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
}}