Template:UnitData: Difference between revisions
From Mechabellum Wiki
(remove noinclude) |
(test vardef and single value) |
||
Line 1: | Line 1: | ||
{{#vardefine:update | 0.7.6 | {{#vardefine:update | 0.7.6 | ||
}}{{#vardefine: | }}{{#vardefine:row | {{#switch: {{{1|{{PAGENAME}}}}} | ||
<!-- Edit the following data. Don't change names and order! --> | <!-- Edit the following data. Don't change names and order! --> | ||
| #default = HP ; Speed ; Attack ; Interval ; Range ; Splash ; Target ; Units ; Giant ; Mobility ; Cost ; Unlock Cost | | #default = HP ; Speed ; Attack ; Interval ; Range ; Splash ; Target ; Units ; Giant ; Mobility ; Cost ; Unlock Cost | ||
Line 21: | Line 20: | ||
| Phoenix = 1623 ; 16 ; 3267 ; 3.2 ; 120 ; 0 ; Air & Ground ; 2 ; No ; Air ; 200 ; 50 | | Phoenix = 1623 ; 16 ; 3267 ; 3.2 ; 120 ; 0 ; Air & Ground ; 2 ; No ; Air ; 200 ; 50 | ||
<!-- ----------------------------- end data ----------------------------- --> | <!-- ----------------------------- end data ----------------------------- --> | ||
}} | |||
}}{{#iferror: {{#expr: {{#sub:{{#var:row}}|-1}} }} | |||
| Error: Unit "{{{1|{{PAGENAME}}}}}" undefined! | |||
| <!-- no error - --> | |||
{{#iferror: {{#expr: {{#sub:{{#var:row}}|-1}} }} | {{#if:{{{2|}}} | ||
| | |<!-- return val --> {{#switch: {{{2}}} | ||
| <!-- no error - | | #default = | ||
{{# | | hp = {{#explode: {{#var:row}} | ; | 0 }} | ||
| speed = {{#explode: {{#var:row}} | ; | 1 }} | |||
| atk = {{#explode: {{#var:row}} | ; | 2 }} | |||
| atkint = {{#explode: {{#var:row}} | ; | 3 }} | |||
| range = {{#explode: {{#var:row}} | ; | 4 }} | |||
| splash = {{#explode: {{#var:row}} | ; | 5 }} | |||
| target = {{#explode: {{#var:row}} | ; | 6 }} | |||
| units = {{#explode: {{#var:row}} | ; | 7 }} | |||
| giant = {{#explode: {{#var:row}} | ; | 8 }} | |||
| mobility = {{#explode: {{#var:row}} | ; | 9 }} | |||
| cost = {{#explode: {{#var:row}} | ; | 10 }} | |||
| unlockcost = {{#explode: {{#var:row}} | ; | 11 }} | |||
| | |||
| {{# | |||
}} | }} | ||
|<!-- else vardefine -->{{#vardefine:hp | {{#explode: {{#var:row}} | ; | 0 }} | |||
}}{{#vardefine:speed | {{#explode: {{#var:row}} | ; | 1 }} | |||
}}{{#vardefine:atk | {{#explode: {{#var:row}} | ; | 2 }} | |||
}}{{#vardefine:atkint | {{#explode: {{#var:row}} | ; | 3 }} | |||
}}{{# | }}{{#vardefine:range | {{#explode: {{#var:row}} | ; | 4 }} | ||
}}{{#vardefine:splash | {{#explode: {{#var:row}} | ; | 5 }} | |||
}}{{#vardefine:target | {{#explode: {{#var:row}} | ; | 6 }} | |||
}}{{#vardefine:units | {{#explode: {{#var:row}} | ; | 7 }} | |||
}}{{#vardefine:giant | {{#explode: {{#var:row}} | ; | 8 }} | |||
}}{{#vardefine:mobility | {{#explode: {{#var:row}} | ; | 9 }} | |||
}}{{#vardefine:cost | {{#explode: {{#var:row}} | ; | 10 }} | |||
}}{{#vardefine:unlockcost | {{#explode: {{#var:row}} | ; | 11 }} | |||
}}<!-- calculated variables | |||
-->{{#vardefine:burst|{{#ifexpr: ({{#var:atk|0}})<1 | 0 | {{#expr: abs({{#var:atk|0}}) * {{#var:units|1}} round 0 }} }} | |||
}}{{#vardefine:dps| | |||
{{#ifexpr: ({{#var:atk|0}}) < 1 <!-- if melting damage --> | |||
| {{#expr: {{#explode: {{#var:atk|-0}} | - | 1 }} * {{#var:units|1}} / {{#var:atkint|1}} round 0 }} | |||
| {{#expr: abs({{#var:atk|0}}) * {{#var:units|1}} / {{#var:atkint|1}} round 0 }} | |||
}} | |||
}}<!-- end vardefine --> | |||
}}{{# | }} | ||
}} |
Revision as of 14:40, 8 June 2023
Error: Unit "UnitData" undefined!