Difference between revisions of "Template:Gacha infobox"

1,353 bytes added ,  01:13, 15 July 2018
no edit summary
Line 1: Line 1:
<includeonly>{{#if: {{NAMESPACE}} | <!-- don't create subobj within namespace --> |
<includeonly>{{#if: {{NAMESPACE}} | <!-- don't create subobj within namespace --> |
{{#vardefine:is active|}}{{#if:{{{duration|}}}|{{#vardefine:duration array|{{{duration|}}}}}{{#vardefine:duration loop|1}}{{#vardefine:duration loop|1}}{{#while:|{{#var:duration loop}}|
{{#vardefine:is active|}}{#vardefine:is active|
{{#vardefine:duration array piece|{{#sub:{{#var:duration array}}|0|{{#pos:{{#var:duration array}}|;}}}}}}{{#vardefine:duration array piece start|{{#explode:{{#explode:{{#var:duration array piece}}|!|1}}|->|0}}}}{{#vardefine:duration array piece end|{{#explode:{{#explode:{{#var:duration array piece}}|!|1}}|->|1}}}}
}}{{#if:{{{duration|}}}|
{{#ifexpr:{{#time: U|now}}>={{#time: U|{{#replace:{{#var:duration array piece start|0}}|@|}}}} and {{#time: U|now}}<={{#time: U|{{#replace:{{#var:duration array piece end|0}}|@|}}}}|{{#vardefine:is active|true}}|}}
  {{#vardefine:duration array|{{{duration|}}}
{{#if:{{#pos:{{#var:duration array}}|;}}||{{#vardefine:duration loop|}}}}{{#vardefine:duration array|{{#sub:{{#var:duration array}}|{{#expr:{{#pos:{{#var:duration array}}|;}}+1}}}}}}
}}{{#vardefine:duration loop|1
}}{{#while:|{{#var:duration loop}}|
{{#vardefine:duration array piece|
  {{#sub:{{#var:duration array}}|0|{{#pos:{{#var:duration array}}|;}}}}
}}{{#if:{{#var:duration array|}}|
{{#if:{{#pos:{{#var:duration array}}|!}}|
  {{#vardefine:duration array piece name|
    {{#explode:{{#var:duration array piece}}|!|0}}
  }}{{#vardefine:duration array piece start|
    {{#explode:
      {{#explode:{{#var:duration array piece}}|!|1
    }}|->|0}}
  }}{{#vardefine:duration array piece end|
    {{#explode:
      {{#explode:{{#var:duration array piece}}|!|1
    }}|->|1}}
  }}
  |{{#vardefine:duration array piece name|Duration
  }}{{#vardefine:duration array piece start|
    {{#explode:{{#var:duration array piece}}|->|0}}
  }}{{#vardefine:duration array piece end|
    {{#explode:{{#var:duration array piece}}|->|1}}
  }}{{#if:{{#var:duration array piece start|}}||{{#vardefine:duration array piece start|{{#time:c|December 2nd, 2018}}}}
  }}{{#if:{{#var:duration array piece end|}}||{{#vardefine:duration array piece end|{{#time:c|December 31st, 3000}}}}
  }}
}}{{#vardefine:duration array piece start|{{#replace:{{#var:duration array piece start}}|@|}}
  }}{{#vardefine:duration array piece end|{{#replace:{{#var:duration array piece end}}|@|}}
}}{{#if:{{#var:duration}}|
  {{#vardefine:duration|{{#var:duration}};{{#var:duration array piece name}}!{{#replace:{{#time:c|{{#var:duration array piece start}}}}|+00:00|+09:00}}->{{#replace:{{#time:c|{{#var:duration array piece end}}}}|+00:00|+09:00}}}}
  |{{#vardefine:duration|{{#var:duration array piece name}}!{{#replace:{{#time:c|{{#var:duration array piece start}}}}|+00:00|+09:00}}->{{#replace:{{#time:c|{{#var:duration array piece end}}}}|+00:00|+09:00}}}}
}}{{#ifexpr:{{#time: U|now}} >= {{#time:U|{{#var:duration array piece start}}}} and {{#time: U|now}} <= {{#time: U|{{#var:duration array piece end}}}}|
  {{#vardefine:is active|true}}
}}}}{{#if:{{#pos:{{#var:duration array}}|;}}||
  {{#vardefine:duration loop|}}
}}{{#vardefine:duration array|
  {{#sub:{{#var:duration array}}|{{#expr:{{#pos:{{#var:duration array}}|;}}+1}}}}
}}
}}}}{{#subobject:gacha{{#vardefineecho:gachanumber|{{#expr:{{#var:gachanumber|-1}}+1}}}}
}}}}{{#subobject:gacha{{#vardefineecho:gachanumber|{{#expr:{{#var:gachanumber|-1}}+1}}}}
| Has game context = Gacha
| Has game context = Gacha
Line 11: Line 47:
| Has news link = {{{news link|}}}
| Has news link = {{{news link|}}}
| Has banner image = {{{banner image|}}}
| Has banner image = {{{banner image|}}}
| Has duration date = {{{duration|}}}
| Has duration date = {{#var:duration|{{{duration|}}}}}
| Has gacha type = {{{type|New}}}
| Has gacha type = {{{type|New}}}
| Revolves around units = {{{units|}}}
| Revolves around units = {{{units|}}}