From Brotato Wiki

No edit summary
(Docs: Add "wantedtags" to main example)
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<includeonly>
<includeonly>
<div class="itembox" style="float:right;width:90%;max-width:400px;">
<div class="itembox" style="{{#ifeq:{{{nofloat|}}}|1|<!--no float (for docs) -->float:none;|float:right;}}<!--
-->width:90%;max-width:400px;">
<div class="itemboxheader">
<div class="itemboxheader">
<div style="float:left">
<div style="float:left">
Line 8: Line 9:
<div class="bold" style="margin-top:0px!important;font-size:22px;">{{{name}}}</div>
<div class="bold" style="margin-top:0px!important;font-size:22px;">{{{name}}}</div>
<div style="width:100%;justify-content:space-between!important;display:flex;flex-direction: row!important;font-size:17px;">
<div style="width:100%;justify-content:space-between!important;display:flex;flex-direction: row!important;font-size:17px;">
<div style="color:rgb(234,226,176)">[[Characters|Character]]</div>
<div style="color:rgb(234,226,176)">Character</div>
</div>
</div>
</div>
</div>
Line 15: Line 16:
{{#if:{{{stats|}}}|
{{#if:{{{stats|}}}|
<div class="line"></div>
<div class="line"></div>
<div class="stats-container">
<div class="stats-container" style="padding: 10px 0;">
<div style="font-weight:bold; color:rgb(234,226,176);">Stats</div>
<div style="font-weight:bold; color:rgb(234,226,176);">Stats</div>
{{{stats}}}
<div>{{{stats}}}</div>
</div>
|}}
{{#if:{{{unlockedby|}}}|
<div class="line" style="opacity: 0.5"></div>
<div class="stats-container" style="padding: 10px 0;">
<div style="width: 30%; float: left; font-weight:bold; color:rgb(234,226,176);">Unlocked By</div>
<div>{{{unlockedby}}}</div>
</div>
|}}
{{#if:{{{unlocks|}}}|
<div class="line" style="opacity: 0.5"></div>
<div class="stats-container" style="padding: 10px 0;">
<div style="width: 30%; float: left; font-weight:bold; color:rgb(234,226,176);">Unlocks</div>
<div>
<!-- Item or weapon -->
{{#switch: {{lc:{{{unlocktype}}}}}
| item    = {{Iconbox|{{{unlocks}}}|rarity={{Item Data|{{{unlocks}}}|rarity}}|nobr=1|size=30px}}
| weapon  = {{Iconbox|{{{unlocks}}}|rarity={{Weapon Data|{{{unlocks}}}|rarity}}|nobr=1|size=30px}}
| #default = Error: "unlocktype" was not specified, or was not either "weapon" or "item" (provided: "{{{unlocktype}}}")<!--
-->}}
</div>
</div>
|}}
{{#if:{{{wantedtags|}}}|
<div class="line" style="opacity: 0.5"></div>
<div class="stats-container" style="padding: 10px 0;">
<div style="width: 30%; float: left; font-weight:bold; color:rgb(234,226,176);">[[Items#Item_Tags|Item Tags]]</div>
<div>{{{wantedtags}}}</div>
</div>
</div>
|}}
|}}
Line 24: Line 53:
<noinclude>
<noinclude>
== Usage ==
== Usage ==
This template can \\n //n be used by entering the following onto a relevant page. Do not use this on your user page. It is reserved for content pages.
Shows an infobox for a [[Characters|Character]]. Accepts custom data, but should ideally be used with [[Template:Character_Data]].
 
Note: The helper template [[Template:Infobox_Character_Helper]] (<code><nowiki>{{Infobox_Character_Helper}}</nowiki></code>) can be used on individual character pages, and automatically populates the data for you.
 
=== With Character_Data ===
 
This uses [[Template:Character_Data|Character_Data]], and is the recommended approach.
 
<pre>
{{Infobox Character
|name      = Bull
|stats      = {{Character Data|Bull|stats}}
|unlockedby = {{Character Data|Bull|unlockedby}}
|unlocks    = {{Character Data|Bull|unlocks}}
|unlocktype = {{Character Data|Bull|unlocktype}}
|wantedtags = {{Character Data|Bull|wantedtags}}
}}
</pre>
 
'''Result:'''
 
{{Infobox Character
|name      = Bull
|stats      = {{Character Data|Bull|stats}}
|unlockedby = {{Character Data|Bull|unlockedby}}
|unlocks    = {{Character Data|Bull|unlocks}}
|unlocktype = {{Character Data|Bull|unlocktype}}
|wantedtags = {{Character Data|Bull|wantedtags}}
|nofloat    = 1
}}
 
=== Custom Text ===
 
<pre>{{Infobox Character
<pre>{{Infobox Character
|name=Lucky
|name       = Tree
|stats='''+8''' Max HP<br>
|stats     = {{Color|green|+10}} Good vibes
'''+4%'''Dodge<br>
|unlockedby = Go on a walk somewhere nice
|wantedtags = [[Exploration]]
}}
}}
</pre>
</pre>


==Example==
'''Result:'''


<pre>
{{Infobox Character
{{Infobox Character
|name=Lucky
|name       = Tree
|stats=<span style="color:rgb(0,255,0);">+100</span> [[Luck]]<br>
|stats     = {{Color|green|+10}} Good vibes
All <span style="color:rgb(0,255,0);">Luck</span> modifications are <br>
|unlockedby = Go on a walk somewhere nice
increased by <span style="color:rgb(0,255,0);">25%</span><br>
|wantedtags = [[Exploration]]
<span style="color:rgb(0,255,0);">+75%</span> chance to deal <span style="color:rgb(0,255,0);">1</span>(15% Luck)<br>
|nofloat    = 1
damage to a random enemy<br>
when you pick up material<br>
<span style="color:rgb(244,0,0);">-60%</span> Attack Speed
<span style="color:rgb(244,0,0);">-50%</span> XP Gain
}}</pre>
results in...
{{Infobox Character
|name=Lucky
|stats=<span style="color:rgb(0,255,0);">+100</span> [[Luck]]<br>
All <span style="color:rgb(0,255,0);">Luck</span> modifications are <br>
increased by <span style="color:rgb(0,255,0);">25%</span><br>
<span style="color:rgb(0,255,0);">+75%</span> chance to deal <span style="color:rgb(0,255,0);">1</span>(15% Luck)<br>
damage to a random enemy<br>
when you pick up material<br>
<span style="color:rgb(244,0,0);">-60%</span> Attack Speed
<span style="color:rgb(244,0,0);">-50%</span> XP Gain
}}
}}
</noinclude>
</noinclude>

Latest revision as of 03:07, 9 November 2022


Usage

Shows an infobox for a Character. Accepts custom data, but should ideally be used with Template:Character_Data.

Note: The helper template Template:Infobox_Character_Helper ({{Infobox_Character_Helper}}) can be used on individual character pages, and automatically populates the data for you.

With Character_Data

This uses Character_Data, and is the recommended approach.

{{Infobox Character 
|name       = Bull
|stats      = {{Character Data|Bull|stats}}
|unlockedby = {{Character Data|Bull|unlockedby}}
|unlocks    = {{Character Data|Bull|unlocks}}
|unlocktype = {{Character Data|Bull|unlocktype}}
|wantedtags = {{Character Data|Bull|wantedtags}}
}}

Result:


Bull
Bull
Character
Stats
+20 Max HP
+15 HP Regeneration
+10 Armor
HP Regeneration modifications are increased by 50%
You explode for 30 (300%Melee Damage.png 300%Ranged Damage.png 300%Elemental Damage.png) damage when you take damage
This explosion has a 1.5x crit multiplier
You can't equip weapons
Unlocked By
Win a run in Danger 1
Unlocks
Gnome
  Gnome


Custom Text

{{Infobox Character
|name       = Tree
|stats      = {{Color|green|+10}} Good vibes
|unlockedby = Go on a walk somewhere nice
|wantedtags = [[Exploration]]
}}

Result:


Tree
Tree
Character
Stats
+10 Good vibes
Unlocked By
Go on a walk somewhere nice