Jump to content

Template:Infobox item: Difference between revisions

From Megabonk Wiki
No edit summary
No edit summary
Line 2: Line 2:
{| class="infobox" style="width:240px; float:right; margin:0 0 12px 12px; background:rgba(255,255,255,.03); border:1px solid rgba(255,255,255,.08); border-radius:12px; overflow:hidden; box-shadow:0 4px 14px rgba(0,0,0,.14); font-size:90%; text-align:left; line-height:1.45;"
{| class="infobox" style="width:240px; float:right; margin:0 0 12px 12px; background:rgba(255,255,255,.03); border:1px solid rgba(255,255,255,.08); border-radius:12px; overflow:hidden; box-shadow:0 4px 14px rgba(0,0,0,.14); font-size:90%; text-align:left; line-height:1.45;"
|-
|-
! colspan="2" style="text-align:center; font-size:1.15em; padding:.45em; color:{{#switch: {{{rarity|}}} | Default = white | Common = green | Uncommon = blue | Rare = magenta | Epic = purple | Legendary = #FFD700 | #default = #FFD47F }}; background:rgba(255,255,255,.03);" | {{{name|{{PAGENAME}}}}}
! colspan="2" style="text-align:center; font-size:1.15em; padding:.45em; color:{{#switch: {{{rarity|}}} | Default = white | Common = green | Uncommon = blue | Rare = magenta | Epic = purple | Legendary = #FFD700 | #default = #FFD47F }}; background:rgba(255,255,255,.03);" | {{{name|{{PAGENAME}}}}}
|-
|-
| colspan="2" style="text-align:center; padding:.3em;" | [[File:{{{image|{{PAGENAME}}.png}}}|96px|center|{{{name|}}}]]
| colspan="2" style="text-align:center; padding:.3em;" | [[File:{{{image|{{PAGENAME}}.png}}}|96px|center|{{{name|}}}]]
Line 13: Line 13:
   | Rare = <span style="color: magenta; font-weight:bold;">Rare</span>
   | Rare = <span style="color: magenta; font-weight:bold;">Rare</span>
   | Epic = <span style="color: purple; font-weight:bold;">Epic</span>
   | Epic = <span style="color: purple; font-weight:bold;">Epic</span>
   | Legendary = <span style="color: #FFD700; font-weight:bold;">Legendary</span>
   | Legendary = <span style="color: &#35;FFD700; font-weight:bold;">Legendary</span>
   | #default = {{{rarity|}}}
   | #default = {{{rarity|}}}
}}
}}
Line 37: Line 37:
<pre>
<pre>
{{Infobox item
{{Infobox item
| name    = Boss Buster
| name    = Chonkplate
| image    = Boss Buster.png
| image    = Item_Chonkplate.png
| rarity  = Common
| rarity  = Legendary
| type    = Item
| type    = Item
| effect  = +15% more damage to Elites and Bosses.
| effect  = Grants +20% Lifesteal and allows healing above max HP to create an Overheal shield.
}}
}}
</pre>
</pre>
</noinclude>
</includeonly>

Revision as of 16:01, 4 October 2025

Usage

This template creates a lean infobox for items in Megabonk. It automatically colors both the item's name and its rarity text based on the rarity value.

Parameters

  • name: The name of the item.
  • rarity: The item's rarity (Default, Common, Uncommon, Rare, Epic, Legendary).
  • effect: The in-game description of the item's effect.
  • image: (Optional) The file name for the item's image.
  • type: (Optional) The type of item. Defaults to "Item".

Example Usage

{{Infobox item
| name     = Chonkplate
| image    = Item_Chonkplate.png
| rarity   = Legendary
| type     = Item
| effect   = Grants +20% Lifesteal and allows healing above max HP to create an Overheal shield.
}}

</includeonly>