Jump to content

Template:Infobox item: Difference between revisions

From Megabonk Wiki
Created page with "<includeonly> {| 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:#FFD47F; background:rgba(255,255,255,.03);" | {{{name|{{PAGENAME}}}}} |- | colspan="2" style="text-align..."
 
No edit summary
 
(5 intermediate revisions by the same user not shown)
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:#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 = &#35;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|}}}]]
|-
|-
! style="width:40%; white-space:nowrap; padding:.4em; background:rgba(255,212,127,.08); border-radius:6px;" | Rarity
! style="width:40%; white-space:nowrap; padding:.4em; background:rgba(255,212,127,.08); border-radius:6px;" | Rarity
| style="padding:.4em;" | {{{rarity|Unspecified}}}
| style="padding:.4em;" | {{#switch: {{{rarity|}}}
  | Default = <span style="color: white; font-weight:bold;">Default</span>
  | Common = <span style="color: green; font-weight:bold;">Common</span>
  | Uncommon = <span style="color: blue; font-weight:bold;">Uncommon</span>
  | Rare = <span style="color: magenta; font-weight:bold;">Rare</span>
  | Epic = <span style="color: purple; font-weight:bold;">Epic</span>
  | Legendary = <span style="color: &#35;FFD700; font-weight:bold;">Legendary</span>
  | #default = {{{rarity|}}}
}}
|-
|-
! style="width:40%; white-space:nowrap; padding:.4em; background:rgba(255,212,127,.08); border-radius:6px;" | Type
! style="width:40%; white-space:nowrap; padding:.4em; background:rgba(255,212,127,.08); border-radius:6px;" | Type
Line 14: Line 22:
! style="white-space:nowrap; padding:.4em; background:rgba(255,212,127,.08); border-radius:6px;" | Effect
! style="white-space:nowrap; padding:.4em; background:rgba(255,212,127,.08); border-radius:6px;" | Effect
| style="padding:.4em;" | {{{effect|No description available.}}}
| style="padding:.4em;" | {{{effect|No description available.}}}
|-
! style="white-space:nowrap; padding:.4em; background:rgba(255,212,127,.08); border-radius:6px;" | Unlock
| style="padding:.4em;" | {{{unlock|Default Item}}}
|-
! style="white-space:nowrap; padding:.4em; background:rgba(255,212,127,.08); border-radius:6px;" | Notes & Synergies
| style="padding:.4em;" | {{{notes|None}}}
|}
|}
</includeonly><noinclude>
</includeonly><noinclude>
== Usage ==
== Usage ==
This template creates an infobox for items in Megabonk.
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.


=== Required Parameters ===
=== Parameters ===
* '''name''': The name of the item.
* '''name''': The name of the item.
* '''rarity''': The item's rarity (e.g., Default, Common, Rare, Epic, Legendary).
* '''rarity''': The item's rarity (Default, Common, Uncommon, Rare, Epic, Legendary).
* '''effect''': The in-game description of the item's effect.
* '''effect''': The in-game description of the item's effect.
* '''unlock''': The condition required to unlock the item. For default items, this can be left as "Default Item".
* '''image''': (Optional) The file name for the item's image.
 
* '''type''': (Optional) The type of item. Defaults to "Item".
=== Optional Parameters ===
* '''image''': The file name for the item's image (e.g., Moldy Cheese.png). Defaults to the page name if not provided.
* '''type''': The type of item. Defaults to "Item".
* '''notes''': Any additional notes or synergies for the item.
 
=== Example for a Default Item (Moldy Cheese) ===
Copy and paste the following code onto an item's page and fill in the details.
<pre>
{{Infobox item
| name    = Moldy Cheese
| image    = Moldy Cheese.png
| rarity  = Default
| type    = Item
| effect  = +40% chance to poison enemies on hit.
| unlock  = Default Item
| notes    = A reliable source of healing, especially effective with builds that kill many enemies quickly.
}}
</pre>


=== Example for an Unlockable Item (Battery) ===
=== Example Usage ===
<pre>
<pre>
{{Infobox item
{{Infobox item
| name    = Battery
| name    = Chonkplate
| image    = Battery.png
| image    = Item_Chonkplate.png
| rarity  = Common
| rarity  = Legendary
| type    = Item
| type    = Item
| effect  = +8% Attack Speed.
| effect  = Grants +20% Lifesteal and allows healing above max HP to create an Overheal shield.
| unlock  = Upgrade ''Cooldown Tome'' to Level 5.
| notes    = None
}}
}}
</pre>
</pre>
</noinclude>

Latest 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.
}}