Template:UnitInfobox: Difference between revisions

From Mechabellum Wiki
(Undo revision 437 by HUBA (talk))
Tag: Undo
mNo edit summary
 
(35 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<div class="infobox" style="max-width: 100%;">
{{#vardefine:names |
<div class="infobox-title">{{PAGENAME}}</div>{{#if:{{{image|}}}|
; 1 Crawler
; 2 Fang
; 3 Marksman
; 4 Arclight
; 5 Wasp
; 6 Mustang
; 7 Sledgehammer
; 8 Steel Ball
; 9 Stormcaller
; 10 Phoenix
; 11 Rhino
; 12 Hacker
; 13 Wraith
; 14 Scorpion
; 15 Vulcan
; 16 Fortress
; 17 Melting Point
; 18 Overlord
; 19 War Factory
}}{{#vardefine:max | 19
}}{{#vardefine:pos | {{#sub:{{#var:names}} | {{#expr: {{#pos:{{#var:names}}|{{PAGENAME}}}} - 3}} | 3}}
}}{{#vardefine:prev | {{#ifexpr: {{#var:pos}} = 1 | {{#var:max}} | {{#expr: {{#var:pos}} - 1}} }}
}}{{#vardefine:next | {{#ifexpr: {{#var:pos}} = {{#var:max}} | 1 | {{#expr: {{#var:pos}} + 1}} }}
}}{{UnitData}}<div class="infobox" style="max-width: 100%;">
{| class="infobox-nav"
|[[{{#sub: {{#explode: {{#var:names}} | ; | {{#var:prev}} }} | 2 }}|<span class="carousel-control-prev-icon"></span>]]
|<div class="infobox-title" {{#ifeq: {{PAGENAME}} | Sledgehammer | style="font-size: 1.75em;" }}>{{PAGENAME}}</div>
| style="text-align:right;" | [[{{#sub: {{#explode: {{#var:names}} | ; | {{#var:next}} }} | 2 }}|<span class="carousel-control-next-icon"></span>]]
|}
{{#if:{{{type|}}}|<p class="text-center h5">{{{type}}}</p>}}
{{#if:{{{image|}}}|
<div class="infobox-image" style="max-width: 100%; overflow: auto; background-color: #0003;">[[File:{{PAGENAME:{{{image}}}}}]]</div>}}
<div class="infobox-image" style="max-width: 100%; overflow: auto; background-color: #0003;">[[File:{{PAGENAME:{{{image}}}}}]]</div>}}
<table class="infobox-table">{{#if:{{{mobility|}}}|<tr>
<table class="infobox-table">
<tr>
     <th>Mobility</th>
     <th>Mobility</th>
     <td>{{{mobility}}}</td>
     <td>{{#var:mobility|Ground}}</td>
</tr>}}{{#if:{{{giant|}}}|<tr>
</tr>
<tr>
     <th>Giant</th>
     <th>Giant</th>
     <td>{{{giant}}}</td>
     <td>{{#var:giant|No}}</td>
</tr>}}{{#if:{{{type|}}}|<tr>
</tr>
    <th>Unit Type</th>
<tr>
    <td>{{{type}}}</td>
</tr>}}{{#if:{{{cost|}}}|<tr>
     <th>Cost</th>
     <th>Cost</th>
     <td>{{{cost}}}</td>
     <td>{{#var:cost|0}}</td>
</tr>}}{{#if:{{{unlockcost|}}}|<tr>
</tr>
{{#ifeq:{{#var:upkeep|0}}|0||
<tr>
    <th>Upkeep</th>
    <td>{{#var:upkeep|Free}}</td>
</tr>
}}
<tr>
     <th>Unlock cost</th>
     <th>Unlock cost</th>
     <td>{{{unlockcost}}}</td>
     <td>{{#var:unlockcost|Free}}</td>
</tr>}}{{#if:{{{units|}}}|<tr>
</tr>
<tr>
     <th>Units</th>
     <th>Units</th>
     <td>{{{units}}}</td>
     <td>{{#var:units|1}}</td>
</tr>
</tr>
</tr>}}{{#if:{{{hp|}}}|<tr>
<tr>
     <th>HP</th>
     <th>HP</th>
     <td>{{{hp}}}</td>
     <td>{{#var:hp|0}}</td>
</tr>
</tr>
</tr>}}{{#if:{{{atk|}}}|<tr>
<tr>
     <th>Attack</th>
     <th>Attack</th>
     <td>{{{atk}}}</td>
     <td>{{#replace:{{#var:atk|0}}|*| &times; }}</td>
</tr>
</tr>
</tr>}}{{#if:{{{target|}}}|<tr>
<tr>
     <th>Target</th>
     <th>Target</th>
     <td>{{{target}}}</td>
     <td>{{#var:target|Ground Only}}</td>
</tr>
</tr>
</tr>}}{{#if:{{{atkint|}}}|<tr>
<tr>
     <th>Attack Interval</th>
     <th>Attack Interval</th>
     <td>{{{atkint}}}</td>
     <td>{{#var:atkint|1}}s</td>
</tr>
</tr>
</tr>}}{{#if:{{{splashdmg|}}}|<tr>
<tr>
     <th>Splash Damage</th>
     <th>Splash Damage</th>
     <td>{{#ifeq:{{{splashdmg}}}|0|No|{{{splashdmg}}} }}</td>
     <td>{{#ifeq:{{#var:splash|0}}|0|No|{{#var:splash}}m }}</td>
</tr>
<tr>
    <th>Burst Damage</th>
    <td>{{#ifexpr: {{#var:burst|0}}<1 | Minimal | {{#var:burst}} }}</td>
</tr>
</tr>
</tr>}}{{#if:{{{range|}}}|<tr>
<tr>
    <th>Max DPS</th>
    <td>{{#var:dps|0}}</td>
</tr>
<tr>
     <th>Range</th>
     <th>Range</th>
     <td>{{{range}}}</td>
     <td>{{#ifeq:{{#var:range|0}}|0|Melee|{{#var:range}}m }}</td>
</tr>
</tr>
</tr>}}{{#if:{{{speed|}}}|<tr>
<tr>
     <th>Speed</th>
     <th>Speed</th>
     <td>{{{speed}}}</td>
     <td>{{#var:speed|0}}m/s</td>
</tr>
</tr>
</tr>}}{{#if:{{{igdesc|}}}|<tr>
{{#if:{{{igdesc|}}}|<tr>
     <td colspan="2">
     <td colspan="2">
         <dt>Description</dt>
         <dt>Description</dt>
Line 55: Line 101:
     </td>
     </td>
</tr>
</tr>
}}</table>
}}
</table>
{{#ifeq:{{#var:cost|0}}|0||
<table class="infobox-table mw-collapsible mw-collapsed">
<caption style="padding:0;"></caption>
<tr style="border-top:1px solid #0002;line-height:1.1">
    <td colspan="2"><small>Values are normalized to the supply cost of the unit to make it easier to compare units.<br>The Splash Index tries to calculate the effectiveness vs spam by multiply attacks with slash area and a penalty for damage below 350.</small>
    </td>
</tr>
<tr>
    <th>Unit Cost</th>
    <td>
{{#var:min_cost}}
{{#ifeq:{{#var:unlockcost}} | 0 || - {{#var:max_cost}} }}
    </td>
</tr>
<tr>
    <th>HP Value</th>
    <td>
{{#ifeq:{{#var:unlockcost}} | 0 || {{#var:min_hp_val}} - }}
{{#var:max_hp_val}}
    </td>
</tr>
<tr>
    <th>Burst Value</th>
    <td>
{{#ifeq:{{#var:unlockcost}} | 0 || {{#var:min_burst_val}} - }}
{{#var:max_burst_val}}
    </td>
</tr>
<tr>
    <th>DPS Value</th>
    <td>
{{#ifeq:{{#var:unlockcost}} | 0 || {{#var:min_dps_val}} - }}
{{#var:max_dps_val}}
    </td>
</tr>
<tr>
    <th>Splash Index</th>
    <td>
{{#var:splash_index}}
    </td>
</tr>
</table>
}}<small class="pull-right">[[Template:UnitData|v{{#var:update}}]]</small>
</div>
</div>
<noinclude>
<noinclude>
Line 61: Line 151:
{
{
"params": {
"params": {
"image": {},
"image": {
"giant": {"autovalue":"No"},
"label": "Image",
"type": {},
"description": "File name",
"cost": {},
"type": "string",
"units": {"autovalue":"1"},
"suggested": true
"hp": {},
},
"atk": {},
"type": {
"target": {"autovalue":"Ground Only"},
"label": "Unit Type",
"atkint": {},
"description": "A short description of the purpose",
"range": {},
"example": "\"Light aircraft\" or \"High-speed anti-unit bot\"",
"speed": {},
"type": "string",
"igdesc": {},
"suggested": true
"mobility": {"autovalue":"Ground"},
},
"unlockcost": {},
"igdesc": {
"splashdmg": {"autovalue":"0"}
"label": "Description",
"description": "The in-game description",
"example": "A high-speed and high HP unit that attacks enemies at close range with a laser beam that gradually grows in size. The bane of all high HP units",
"type": "string",
"suggested": true
}
},
},
"description": "Infobox for all ingame stats for this unit",
"description": "Infobox for all ingame stats for this unit",
"paramOrder": [
"paramOrder": [
"image",
"image",
"mobility",
"giant",
"type",
"type",
"unlockcost",
"cost",
"units",
"hp",
"atk",
"splashdmg",
"target",
"atkint",
"range",
"speed",
"igdesc"
"igdesc"
]
]

Latest revision as of 19:49, 18 January 2024

Error: Unit "UnitInfobox" undefined!

[[|]]
UnitInfobox
[[|]]


Mobility Ground
Giant No
Cost 0
Unlock cost Free
Units 1
HP 0
Attack 0
Target Ground Only
Attack Interval 1s
Splash Damage No
Burst Damage Minimal
Max DPS 0
Range Melee
Speed 0m/s

v0.7.42

Infobox for all ingame stats for this unit

Template parameters

ParameterDescriptionTypeStatus
Imageimage

File name

Stringsuggested
Unit Typetype

A short description of the purpose

Example
"Light aircraft" or "High-speed anti-unit bot"
Stringsuggested
Descriptionigdesc

The in-game description

Example
A high-speed and high HP unit that attacks enemies at close range with a laser beam that gradually grows in size. The bane of all high HP units
Stringsuggested