Difference between revisions of "Template:Elemental Rumble"

From Dungeon Defenders 2 Wiki
Jump to: navigation, search
(Testing and formatting rotating weekly element)
(Added next weeks element)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<noinclude>
 
<noinclude>
This template displays a different image each week, rotating through 4 images based on the current ISO week number (168-hour cycles). To use it, simply type:
 
  
<code><nowiki>{{WeeklyImageRotation}}</nowiki></code>
+
'''Current date/time:''' {{#time:Y-m-d H:i:s}}  <br>
 +
'''Current ISO week number:''' {{#time:W}}  <br>
 +
'''Day of year:''' {{#time:z}} <br>
 +
'''Day of week (1 = Monday):''' {{#time:N}}  <br>
  
The rotation order is:
+
This template displays the weekly element that's on rotation for Elemental Rumble based on the ISO week number (168-hour cycle).
  
 +
Usage:
 +
<code><nowiki>{{Elemental Rumble}}</nowiki></code>
 +
 +
Rotation schedule:
 
* Week 1 → [[File:Water Week.gif|150px]]
 
* Week 1 → [[File:Water Week.gif|150px]]
 
* Week 2 → [[File:Storm Week.gif|150px]]
 
* Week 2 → [[File:Storm Week.gif|150px]]
 
* Week 3 → [[File:Earth Week.gif|150px]]
 
* Week 3 → [[File:Earth Week.gif|150px]]
 
* Week 4 → [[File:Fire Week.gif|150px]]
 
* Week 4 → [[File:Fire Week.gif|150px]]
* Then loops back to Week 1
 
 
</noinclude>
 
<includeonly>
 
<!-- Weekly Image Rotator (changes every 7 days based on ISO week number) -->
 
{{#switch: {{#expr: {{#time:W}} mod 4 }}
 
| 0 = [[File:Water Week.gif|300px]]
 
| 1 = [[File:Storm Week.gif|300px]]
 
| 2 = [[File:Earth Week.gif|300px]]
 
| 3 = [[File:Fire Week.gif|300px]]
 
}}
 
</includeonly>
 
  
<noinclude>
 
 
== Example ==
 
== Example ==
  
{| style="width:100%; text-align:center;"
+
{| class="wikitable" style="width:100%; text-align:center;"
 
! style="width: 50%; font-size: 120%;" | Wiki Text
 
! style="width: 50%; font-size: 120%;" | Wiki Text
 
! style="width: 50%; font-size: 120%;" | Result
 
! style="width: 50%; font-size: 120%;" | Result
 
|-
 
|-
| <code><nowiki>{{WeeklyImageRotation}}</nowiki></code>
+
| <code><nowiki>{{Elemental Rumble}}</nowiki></code>
| {{WeeklyImageRotation}}
+
| {{Elemental Rumble}}
 
|}
 
|}
  
 
</noinclude>
 
</noinclude>
 +
 +
<includeonly>
 +
<!-- Elemental Rumble Weekly Rotation (ISO week mod 4 with +3 offset) -->
 +
<div style="text-align:center;">
 +
 +
{| class="wikitable" style="width:100%;"
 +
! style="width: 50%; font-size: 150%;" | Current Weekly Element:
 +
! style="width: 50%; font-size: 150%;" | Next Weekly Element:
 +
|-
 +
| {{#switch: {{#expr: ({{#time:W}} + 3) mod 4 }}
 +
  | 0 = [[File:Water Week.gif|300px]]
 +
  | 1 = [[File:Storm Week.gif|300px]]
 +
  | 2 = [[File:Earth Week.gif|300px]]
 +
  | 3 = [[File:Fire Week.gif|300px]]
 +
  | #default = [[File:Water Week.gif|300px]]
 +
  }}
 +
| {{#switch: {{#expr: ({{#time:W}} + 4) mod 4 }}
 +
  | 0 = [[File:Water Week.gif|300px]]
 +
  | 1 = [[File:Storm Week.gif|300px]]
 +
  | 2 = [[File:Earth Week.gif|300px]]
 +
  | 3 = [[File:Fire Week.gif|300px]]
 +
  | #default = [[File:Water Week.gif|300px]]
 +
  }}
 +
|}
 +
 +
</div>
 +
</includeonly>

Latest revision as of 16:05, 2 April 2025


Current date/time: 2025-04-13 18:20:02
Current ISO week number: 15
Day of year: 102
Day of week (1 = Monday): 7

This template displays the weekly element that's on rotation for Elemental Rumble based on the ISO week number (168-hour cycle).

Usage: {{Elemental Rumble}}

Rotation schedule:

  • Week 1 → Water Week.gif
  • Week 2 → Storm Week.gif
  • Week 3 → Earth Week.gif
  • Week 4 → Fire Week.gif

Example

Wiki Text Result
{{Elemental Rumble}}


Current Weekly Element: Next Weekly Element:
Earth Week.gif Fire Week.gif