Difference between revisions of "Template:InfoDur"

From Granblue Fantasy Wiki
Jump to navigation Jump to search
 
Line 3: Line 3:
 
*<i>type</i> - Either turns (t) or seconds (s)
 
*<i>type</i> - Either turns (t) or seconds (s)
 
*<i>duration</i> - The number of turns/seconds
 
*<i>duration</i> - The number of turns/seconds
==Usage==
+
== Usage ==
 
<pre>
 
<pre>
 
{{InfoDur|type=|duration=}}
 
{{InfoDur|type=|duration=}}
Line 13: Line 13:
 
{{InfoDur|type=s|duration=180}}
 
{{InfoDur|type=s|duration=180}}
 
</pre>
 
</pre>
</noinclude>{{#if:{{{duration|}}}|{{#switch: {{{type}}}  
+
 
|r|t = {{{duration}}} turn{{plural:{{{duration}}}||s}}
+
== Tests ==
| s = {{{duration}}} sec
+
{|
|}}}}
+
|-
 +
|3t|{{InfoDur|type=t|duration=3}}
 +
|-
 +
|3.5t|{{InfoDur|type=t|duration=3.5}}
 +
|-
 +
|0.5t|{{InfoDur|type=t|duration=0.5}}
 +
|-
 +
|1t|{{InfoDur|type=t|duration=1}}
 +
|-
 +
|1r|{{InfoDur|type=r|duration=1}}
 +
|-
 +
|180s|{{InfoDur|type=s|duration=180}}
 +
|}
 +
</noinclude>{{#if: {{{duration|}}}
 +
| {{#switch: {{{type}}}  
 +
  |r|t = {{
 +
  #vardefine: half_duration | {{#replace:{{{duration}}}|.5|}}
 +
  }}{{
 +
  #ifeq:{{{duration}}}|{{#var:half_duration}}| {{{duration}}} {{plural:{{{duration}}}|turn|turns}}
 +
  | {{
 +
    #ifeq: {{#var:half_duration}}|0
 +
    | {{tt|1=0.5 turns|2=[[Half_Turns|Applied during the attack phase and lasts until the turn ends.]]}}
 +
    | {{tt|1={{{duration}}} turns|2=[[Half_Turns|Applied during the attack phase.]]<br />On the next turn, it'll have {{#var:half_duration}} {{plural:{{#var:half_duration}}|turn|turns}} remaining.}}
 +
    }}
 +
  }}
 +
  |s = {{{duration}}} sec
 +
  |}}
 +
}}

Latest revision as of 21:45, 24 June 2020

InfoDur is a switch that has two parameters:

  • type - Either turns (t) or seconds (s)
  • duration - The number of turns/seconds

Usage

{{InfoDur|type=|duration=}}

<!--8 Turns--> 
{{InfoDur|type=t|duration=8}}

<!--180 Seconds--> 
{{InfoDur|type=s|duration=180}}

Tests

3 turns
3.5 turnsApplied during the attack phase.
On the next turn, it'll have 3 turns remaining.
0.5 turnsApplied during the attack phase and lasts until the turn ends.
1 turn
1 turn
180 sec