Template:Weapon type page: Difference between revisions

Jump to navigation Jump to search
Simplify by using MediaWiki's builtin dd/dt/dl syntax.
No edit summary
(Simplify by using MediaWiki's builtin dd/dt/dl syntax.)
(48 intermediate revisions by 9 users not shown)
Line 1: Line 1:
<includeonly>{{WeaponType|{{{type}}}}} are a type of {{{category}}}, {{{handedness}}}, {{{melee or ranged}}} [[Weapons|Weapon]]Following are some base attributes common to most {{{type}}}, although special or magical variants may be significantly different.  For the most common, nonmagical kind of this weapon, see [[{{{example}}}]].  Further down below, you can find a list of all {{{type}}} in the game.
<includeonly>{{#switch: {{{this is an example|}}}
| yes =
| #default =
  {{PageSeo
  | title = {{{type}}}
  | description = {{{type}}} are a type of {{{handedness}}} {{{category}}} {{{melee or ranged}}} weapon in Baldur's Gate 3Learn more about their properties and see the list of all {{{type}}} in the game.
  }}
}}


<h2>Properties</h2>
{{WeaponType|{{{type}}}}} are a type of {{{handedness}}} {{{category}}} {{{melee or ranged}}} [[Weapons|weapon]]. Following are some base attributes common to most {{lc:{{{type}}} }}, although special or magical variants may be significantly different.  For the most common, nonmagical kind of this weapon, see [[{{{example}}}]].  Further down below, you can find a list of all {{lc:{{{type}}} }} in the game.


{{#if: {{{versatile damage|}}} |
<h2> Properties </h2>
One-handed damage:
 
}}{{DamageInfo
<div class="bg3wiki-property-list">
| {{{damage}}}
; {{#if: {{{versatile damage|}}} | One-handed damage | Damage }}
| {{{damage type}}}
: {{DamageInfo
| modifier = {{#if: {{{finesse|}}} | finesse | {{{melee or ranged}}} }}
    | {{{damage}}}
}}{{#if: {{{versatile damage|}}} |
    | {{{damage type}}}
Two-handed damage:
    | modifier = {{#if: {{{finesse|}}} | finesse | {{{melee or ranged}}} }}
{{DamageInfo | {{{versatile damage}}} | {{{damage type}}} | modifier = {{#if: {{{finesse|}}} | finesse | {{{melee or ranged}}} }} }}
    }}<!-- (prevent <dd> from being broken up)
-->{{#if: {{{versatile damage|}}} |
; Two-handed damage
: {{DamageInfo
    | {{{versatile damage}}}
    | {{{damage type}}}
    | modifier = {{#if: {{{finesse|}}} | finesse | {{{melee or ranged}}} }}
    }}
}}
}}
 
; Details
{{#if:{{{range m|}}}{{{range ft|}}}|
: {{#switch:{{{handedness|}}}
* {{Range|m={{{range m}}}|ft={{{range ft}}}}}
    | one-handed = {{One-Handed}}
|{{#if:{{{reach|}}}
    | two-handed = {{Two-Handed}}
|* {{Range|reach}}
    | versatile = {{Versatile}}
|* {{Range|melee}}
    }}
}}}}
{{#if: {{{range m|}}} {{{range ft|}}}
* {{#switch:{{{handedness|}}}
| : {{Range|m={{{range m}}}|ft={{{range ft}}}}}
| one-handed = {{One-Handed}}
| : {{#if:{{{range|}}}
| two-handed = {{Two-Handed}}
      | {{Range|{{{range}}}}}
| versatile = {{Versatile}}
      | {{#ifeq: {{{melee or ranged|}}} | ranged
|}}{{#if:{{{ammunition|}}}|
        | {{Range|ranged}}
* {{Ammunition}}
        | {{#if:{{{reach|}}}
}}{{#if:{{{finesse|}}}|
          | {{Range|reach}}
* {{Finesse}}
          | {{Range|melee}}
}}{{#if:{{{heavy|}}}|
          }}
* {{Heavy}}
        }}
}}{{#if:{{{light|}}}|
      }}
* {{Light}}
}} {{#if: {{{finesse|}}} | : {{Finesse}}
}}{{#if:{{{loading|}}}|
}} {{#if: {{{light|}}} | : {{Light}}
* {{Loading}}
}} {{#if: {{{reach|}}} | : {{Reach}}
}}{{#if:{{{reach|}}}|
}} {{#if: {{{thrown|}}} | : {{Thrown}}
* {{Reach}}
}} {{#if: {{{can't dual wield|}}} | : {{Can't Dual Wield}}
}}{{#if:{{{thrown|}}}|
}} {{#if: {{{dippable|}}} | : {{Dippable}}
* {{Thrown}}
}}{{#if:{{{can't dual wield|}}}|
* {{Can't Dual Wield}}
}}{{#if:{{{dippable|}}}|
* {{Dippable}}
}}
}}
</div>


<h3> Actions </h3>
=== Actions ===


{{WeaponProficiencyUnlocks}}
{{WeaponProficiencyUnlocks}}


{{{actions}}}
{{#if: {{{weapon actions|}}}
| {{#invoke: ParseList | main | {{{weapon actions}}} | useTemplate = WeaponAction | type = htmlList }}
| {{{actions}}}
}}
 
<h2> List of {{lc:{{{type}}} }}</h2>


<h2> List of {{{type}}} </h2>
{{#switch: {{{this is an example|}}}
| yes = ''Omitted because this is an example''
| #default =
{{WeaponsTableHeader}}
{{#cargo_query: tables = weapons
| fields = _pageName=page, name, uid, icon, rarity, enchantment, damage, damage_type, extra_damage, extra_damage_type, extra_damage_2, extra_damage_2_type, weight_kg, weight_lb, price, passives, passives_main_hand, passives_off_hand, special, special_weapon_actions
| order by = rarity_order, name
| where = type="{{{type}}}" AND legacy IS NULL
| default = {{WeaponsTableEmpty}}
| format = template
| template = WeaponsTableRow
| named args = yes
}}
{{WeaponsTableFooter}}
}}


<h2>Legacy content</h2>
{{#switch: {{{this is an example|}}}
| yes = ''Omitted because this is an example''
| #default =
<ul>
{{#cargo_query: tables = weapons
{{#cargo_query: tables = weapons
| fields =
| fields = _pageName=page, name, uid, legacy
  CONCAT('<div style="text-align: center;">',
        '[[File:', image, '|frameless|100px|link=', name, ']] <br>',
        '[[', name, '{{!}}{', '{RarityColor{{!}}', rarity, '{{!}}', name, '}', '}]]',
        '</div>'
        ) = Weapon,
  enchantment = Enchantment,
  damage = Damage,
  CONCAT(weight_kg, '{{nbts}}kg / ', weight_lb, '{{nbts}}lb') = Weight,
  price = Price,
  special = Special
| order by = rarity_order, name
| order by = rarity_order, name
| where = type = "{{{type}}}" and name != ""
| where = type="{{{type}}}" AND (legacy="unobtainable" OR legacy="inaccessible")
| format = table
| default = ''(None)''
| format = template
| template = Legacy item entry
| order by = legacy
| named args = yes
| more results text =
}}
</ul>
}}
}}


[[Category:Weapon Types]] [[Category:{{{category|simple}}} Weapon Types]]</includeonly><noinclude><!--
{{#switch: {{{this is an example|}}}
| yes =
| #default = [[Category:Equipment]] [[Category:Weapon Types]] [[Category:{{{category|simple}}} Weapon Types]]
}}</includeonly><noinclude><!--


     ==== Documentation follows ====
     ==== Documentation follows ====
Line 80: Line 114:
<pre>
<pre>
{{WeaponTypePage
{{WeaponTypePage
| <!-- See here for tips on how to use this template: https://bg3.wiki/wiki/Template:WeaponTypePage -->
<!-- See here for tips on how to use this template: https://bg3.wiki/wiki/Template:WeaponTypePage -->
| type = Longswords
| type = Longswords
| example = Longsword
| example = Longsword
Line 92: Line 126:
| light = yes
| light = yes
| dippable = yes
| dippable = yes
| actions =
| weapon actions = Pommel Strike, Lacerate
* {{Pommel Strike}}
* {{Lacerate}}
}}
}}
</pre>
</pre>
Line 100: Line 132:
Note that the template even adds the page to the correct categories.  And for the same reason, it shouldn't be invoked here for the purpose of showing how the results look; that would result in this template page being added to the categories to which the weapon type pages are added.
Note that the template even adds the page to the correct categories.  And for the same reason, it shouldn't be invoked here for the purpose of showing how the results look; that would result in this template page being added to the categories to which the weapon type pages are added.


[[Category:Page Generating Templates]]
[[Category:Page generating templates]]
 
Examples follow. __NOTOC__
 
= Daggers =
 
{{WeaponTypePage
| type = Daggers
| example = Dagger
| category = simple
| handedness = one-handed
| melee or ranged = melee
| damage = 1d4
| damage type = Piercing
| finesse = yes
| light = yes
| dippable = yes
| weapon actions = Piercing Strike
| this is an example = yes
}}
 
= Longbows =
 
{{WeaponTypePage
| type = Longbows
| example = Longbow
| category = martial
| handedness = two-handed
| melee or ranged = ranged
| damage = 1d8
| damage type = Piercing
| dippable = yes
| weapon actions = Hamstring Shot, Brace (Ranged)
| this is an example = yes
}}
 
= Longswords =


{{#cargo_declare:
{{WeaponTypePage
_table = weapon_types
| type = Longswords
| name = String (unique)
| example = Longsword
| category = martial
| handedness = versatile
| melee or ranged = melee
| damage = 1d8
| damage type = Slashing
| versatile damage = 1d10
| dippable = yes
| weapon actions = Pommel Strike, Lacerate
| this is an example = yes
}}
 
----
 
{{#cargo_declare: _table = weapon_types
| name = String (unique, mandatory)
| category = String (allowed values = simple, martial)
| category = String (allowed values = simple, martial)
| handedness = String (allowed values = one-handed, two-handed, versatile)
| handedness = String (allowed values = one-handed, two-handed, versatile)
Line 114: Line 197:
| light = Boolean
| light = Boolean
| dippable = Boolean
| dippable = Boolean
| actions = Wikitext
| weapon_actions = List (,) of String
}}
}}
</noinclude><includeonly>{{#cargo_store: _table = weapon_types
</noinclude><includeonly>{{#switch: {{{this is an example|}}}
| name = {{PAGENAME}}
| yes =
| #default = {{#cargo_store: _table = weapon_types
| name = {{#titleparts: {{PAGENAME}} }}
| finesse = {{IfEmpty | {{{finesse|}}} | no}}
| finesse = {{IfEmpty | {{{finesse|}}} | no}}
| light = {{IfEmpty | {{{light|}}} | no}}
| light = {{IfEmpty | {{{light|}}} | no}}
| dippable = {{IfEmpty | {{{dippable|}}} | no}}
| dippable = {{IfEmpty | {{{dippable|}}} | no}}
}}
}}</includeonly>
}}</includeonly>

Navigation menu