Template:UnitInfobox: Difference between revisions

From Mechabellum Wiki
m (test)
(remove noinclude and space)
Line 1: Line 1:
<!-- define parameter as variable so they can be used later on the page -->
<!-- define parameter as variable so they can be used later on the page  
{{#vardefine:atk|{{{atk|0}}} }}
-->{{#vardefine:atk|{{{atk|0}}}  
{{#vardefine:hp|{{{hp|0}}} }}
}}{{#vardefine:hp|{{{hp|0}}}  
{{#vardefine:mobility|{{{mobility|Ground}}} }}
}}{{#vardefine:mobility|{{{mobility|Ground}}}  
{{#vardefine:giant|{{{giant|No}}} }}
}}{{#vardefine:giant|{{{giant|No}}}  
{{#vardefine:cost|{{{cost|0}}} }}
}}{{#vardefine:cost|{{{cost|0}}}  
{{#vardefine:unlockcost|{{{unlockcost|0}}} }}
}}{{#vardefine:unlockcost|{{{unlockcost|0}}}  
{{#vardefine:units|{{{units|1}}} }}
}}{{#vardefine:units|{{{units|1}}}  
{{#vardefine:target|{{{target|Ground Only}}} }}
}}{{#vardefine:target|{{{target|Ground Only}}}  
{{#vardefine:atkint|{{{atkint|1}}} }}
}}{{#vardefine:atkint|{{{atkint|1}}}  
{{#vardefine:splashdmg|{{{splashdmg|0}}} }}
}}{{#vardefine:splashdmg|{{{splashdmg|0}}}  
{{#vardefine:range|{{{range|0}}} }}
}}{{#vardefine:range|{{{range|0}}}  
{{#vardefine:speed|{{{speed|0}}} }}
}}{{#vardefine:speed|{{{speed|0}}}  
<!-- calculated variables -->
}}<!-- calculated variables  
{{#vardefine:burst|{{#ifexpr: ({{{atk|0}}})<1 | 0 | {{#expr: abs({{{atk|0}}}) * {{{units|1}}} round 0 }} }} }}
-->{{#vardefine:burst|{{#ifexpr: ({{{atk|0}}})<1 | 0 | {{#expr: abs({{{atk|0}}}) * {{{units|1}}} round 0 }} }}  
{{#vardefine:dps|
}}{{#vardefine:dps|
   {{#ifexpr: ({{{atk|0}}}) < 1 <!-- if melting damage -->
   {{#ifexpr: ({{{atk|0}}}) < 1 <!-- if melting damage -->
     | {{#expr: {{#explode: {{{atk|-0}}} | - | 1 }} * {{{units|1}}} / {{{atkint|1}}} round 0 }}   
     | {{#expr: {{#explode: {{{atk|-0}}} | - | 1 }} * {{{units|1}}} / {{{atkint|1}}} round 0 }}   
     | {{#expr: abs({{{atk|0}}}) * {{{units|1}}} / {{{atkint|1}}} round 0 }}  
     | {{#expr: abs({{{atk|0}}}) * {{{units|1}}} / {{{atkint|1}}} round 0 }}  
   }}
   }}
}}
}}<!-- end vardefine
<div class="infobox" style="max-width: 100%;">
--><div class="infobox" style="max-width: 100%;">
<div class="infobox-title">{{PAGENAME}}</div>
<div class="infobox-title">{{PAGENAME}}</div>
{{#if:{{{type|}}}|<p class="text-center h5">{{{type}}}</p>}}
{{#if:{{{type|}}}|<p class="text-center h5">{{{type}}}</p>}}

Revision as of 18:40, 4 June 2023

UnitInfobox


Mobility Ground
Giant No
Unlock cost Free
Units 1
Target Ground Only
Splash Damage No
Burst Damage Minimal
Max DPS 0
Range Melee

Infobox for all ingame stats for this unit

Template parameters

ParameterDescriptionTypeStatus
Imageimage

File name

Stringsuggested
Mobilitymobility

Air or Ground unit, defaults to Ground if not set

Suggested values
Ground Air
Default
Ground
Auto value
Ground
Stringsuggested
Giantgiant

Is unit a Giant? No if not set

Suggested values
Yes No
Default
No
Auto value
No
Stringsuggested
Unit Typetype

A short description of the purpose

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

The cost for unlocking the unit. Defaults to 0=Free if not set

Default
Free
Auto value
0
Numbersuggested
Costcost

Purchase cost

Numberrequired
Unitsunits

Number of units. Default 1 if not set

Default
1
Auto value
1
Numbersuggested
HPhp

Hit Points

Numberrequired
Attackatk

Damage of the unit. Usually a number for the damage of one unit. Can have a range or a multiplier.

Example
"9001" or "1 - 1000" or "555 * 4"
Stringrequired
Splash Damagesplashdmg

The AOE in meter, Defaults to 0=No if not set

Default
No
Auto value
0
Numbersuggested
Targettarget

Can attack ground and/or air units? Default "Ground Only" if not set

Suggested values
Ground Only Air Only Ground & Air
Default
Ground Only
Auto value
Ground Only
Stringsuggested
Attack Intervalatkint

Time between shots

Numbersuggested
Rangerange

Range of the unit. Defaults to 0=Melee if not set

Default
Melee
Auto value
0
Numbersuggested
Speedspeed

The Speed in meter per second (m/s)

Numbersuggested
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