Template:UnitInfobox: Difference between revisions
From Mechabellum Wiki
(Undo Undo) Tag: Undo |
(define variables for use in page) |
||
Line 1: | Line 1: | ||
<noinclude> | |||
<!-- define parameter as variable so they can be used later on the page --> | |||
{{#vardefine:atk|{{{atk|0}}} }} | |||
{{#vardefine:hp|{{{hp|0}}} }} | |||
{{#vardefine:mobility|{{{mobility|Ground}}} }} | |||
{{#vardefine:giant|{{{giant|No}}} }} | |||
{{#vardefine:cost|{{{cost|0}}} }} | |||
{{#vardefine:unlockcost|{{{unlockcost|0}}} }} | |||
{{#vardefine:units|{{{units|1}}} }} | |||
{{#vardefine:target|{{{target|Ground Only}}} }} | |||
{{#vardefine:atkint|{{{atkint|1}}} }} | |||
{{#vardefine:splashdmg|{{{splashdmg|0}}} }} | |||
{{#vardefine:range|{{{range|0}}} }} | |||
{{#vardefine:speed|{{{speed|0}}} }} | |||
<!-- calculated variables --> | |||
{{#vardefine:burst|{{#ifexpr: ({{{atk|0}}})<1 | 0 | {{#expr: abs({{{atk|0}}}) * {{{units|1}}} round 0 }} }} }} | |||
{{#vardefine:dps| | |||
{{#ifexpr: ({{{atk|0}}}) < 1 <!-- if melting damage --> | |||
| {{#expr: {{#explode: {{{atk|-0}}} | - | 1 }} * {{{units|1}}} / {{{atkint|1}}} round 0 }} | |||
| {{#expr: abs({{{atk|0}}}) * {{{units|1}}} / {{{atkint|1}}} round 0 }} | |||
}} | |||
}} | |||
</noinclude> | |||
<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> |
Revision as of 18:27, 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
Parameter | Description | Type | Status | |
---|---|---|---|---|
Image | image | File name | String | suggested |
Mobility | mobility | Air or Ground unit, defaults to Ground if not set
| String | suggested |
Giant | giant | Is unit a Giant? No if not set
| String | suggested |
Unit Type | type | A short description of the purpose
| String | suggested |
Unlock Cost | unlockcost | The cost for unlocking the unit. Defaults to 0=Free if not set
| Number | suggested |
Cost | cost | Purchase cost | Number | required |
Units | units | Number of units. Default 1 if not set
| Number | suggested |
HP | hp | Hit Points | Number | required |
Attack | atk | Damage of the unit. Usually a number for the damage of one unit. Can have a range or a multiplier.
| String | required |
Splash Damage | splashdmg | The AOE in meter, Defaults to 0=No if not set
| Number | suggested |
Target | target | Can attack ground and/or air units? Default "Ground Only" if not set
| String | suggested |
Attack Interval | atkint | Time between shots | Number | suggested |
Range | range | Range of the unit. Defaults to 0=Melee if not set
| Number | suggested |
Speed | speed | The Speed in meter per second (m/s) | Number | suggested |
Description | igdesc | The in-game description
| String | suggested |