Template:RitsuTest: Difference between revisions

From Elwiki
No edit summary
No edit summary
Line 157: Line 157:
             <!-- check if the second passive exists. if so, generate another variable that multiplies them together -->
             <!-- check if the second passive exists. if so, generate another variable that multiplies them together -->
             {{#if: {{{passive2|}}}  
             {{#if: {{{passive2|}}}  
                 | {{#vardefine: @@@@_passive1_passive2{{#var:suffix}} | {{#expr: {{#var:@@@@_passive1{{#var:suffix}} }} * {{#arrayindex:passive1|{{#var:number}} }} round2 }} }}
                 | {{#vardefine: @@@@_passive1_passive2{{#var:suffix}} | {{#expr: {{#var:@@@@_passive1{{#var:suffix}} }} * {{#arrayindex:passive2|{{#var:number}} }} round2 }} }}
             }}
             }}
             {{#if: {{{heavy|}}}  
             {{#if: {{{heavy|}}}  
                 | {{#vardefine: @@@@_passive1_heavy{{#var:suffix}} | {{#expr: {{#var:@@@@_passive1{{#var:suffix}} }} * 1.44 round2 }} }}
                 | {{#vardefine: @@@@_passive1_heavy{{#var:suffix}} | {{#expr: {{#var:@@@@_passive1{{#var:suffix}} }} * 1.44 round2 }} }}
                 {{#if: {{{passive2|}}}
                 {{#if: {{{passive2|}}}
                     | {{#vardefine: @@@@_passive1_passive2_heavy{{#var:suffix}} | {{#expr: {{#var:@@@@_passive1_heavy{{#var:suffix}} }} * {{#arrayindex:passive1|{{#var:number}} }} round2 }} }}
                     | {{#vardefine: @@@@_passive1_passive2_heavy{{#var:suffix}} | {{#expr: {{#var:@@@@_passive1_heavy{{#var:suffix}} }} * {{#arrayindex:passive2|{{#var:number}} }} round2 }} }}
                 }}
                 }}
             }}
             }}
Line 168: Line 168:
                 | {{#vardefine: @@@@_passive1_empowered{{#var:suffix}} | {{#expr: {{#var:@@@@_passive1{{#var:suffix}} }} * {{#var:empowered}} round2 }} }}
                 | {{#vardefine: @@@@_passive1_empowered{{#var:suffix}} | {{#expr: {{#var:@@@@_passive1{{#var:suffix}} }} * {{#var:empowered}} round2 }} }}
                 {{#if: {{{passive2|}}}
                 {{#if: {{{passive2|}}}
                     | {{#vardefine: @@@@_passive1_passive2_empowered{{#var:suffix}} | {{#expr: {{#var:@@@@_passive1_empowered{{#var:suffix}} }} * {{#arrayindex:passive1|{{#var:number}} }} round2 }} }}
                     | {{#vardefine: @@@@_passive1_passive2_empowered{{#var:suffix}} | {{#expr: {{#var:@@@@_passive1_empowered{{#var:suffix}} }} * {{#arrayindex:passive2|{{#var:number}} }} round2 }} }}
                 }}
                 }}
             }}
             }}
Line 174: Line 174:
                 | {{#vardefine: @@@@_passive1_enhanced{{#var:suffix}} | {{#expr: {{#var:@@@@_passive1{{#var:suffix}} }} * 0.8 round2 }} }}
                 | {{#vardefine: @@@@_passive1_enhanced{{#var:suffix}} | {{#expr: {{#var:@@@@_passive1{{#var:suffix}} }} * 0.8 round2 }} }}
                 {{#if: {{{passive2|}}}
                 {{#if: {{{passive2|}}}
                     | {{#vardefine: @@@@_passive1_passive2_enhanced{{#var:suffix}} | {{#expr: {{#var:@@@@_passive1_enhanced{{#var:suffix}} }} * {{#arrayindex:passive1|{{#var:number}} }} round2 }} }}
                     | {{#vardefine: @@@@_passive1_passive2_enhanced{{#var:suffix}} | {{#expr: {{#var:@@@@_passive1_enhanced{{#var:suffix}} }} * {{#arrayindex:passive2|{{#var:number}} }} round2 }} }}
                 }}
                 }}
             }}
             }}
Line 180: Line 180:
                 | {{#vardefine: @@@@_passive1_useful{{#var:suffix}} | {{#expr: {{#var:@@@@_useful{{#var:suffix}} }} * {{#arrayindex:passive1|{{#var:number}} }} round2 }} }}
                 | {{#vardefine: @@@@_passive1_useful{{#var:suffix}} | {{#expr: {{#var:@@@@_useful{{#var:suffix}} }} * {{#arrayindex:passive1|{{#var:number}} }} round2 }} }}
                 {{#if: {{{passive2|}}}
                 {{#if: {{{passive2|}}}
                     | {{#vardefine: @@@@_passive1_passive2_useful{{#var:suffix}} | {{#expr: {{#var:@@@@_passive1_useful{{#var:suffix}} }} * {{#arrayindex:passive1|{{#var:number}} }} round2 }} }}
                     | {{#vardefine: @@@@_passive1_passive2_useful{{#var:suffix}} | {{#expr: {{#var:@@@@_passive1_useful{{#var:suffix}} }} * {{#arrayindex:passive2|{{#var:number}} }} round2 }} }}
                 }}
                 }}
             }}
             }}
Line 186: Line 186:
             <!-- considering passive 2 exists -->
             <!-- considering passive 2 exists -->
             {{#if: {{{passive2|}}}
             {{#if: {{{passive2|}}}
                 | {{#vardefine: @@@@_passive2{{#var:suffix}} | {{#expr: {{#var:@@@@{{#var:suffix}} }} * {{#arrayindex:passive1|{{#var:number}} }} round2 }} }}
                 | {{#vardefine: @@@@_passive2{{#var:suffix}} | {{#expr: {{#var:@@@@{{#var:suffix}} }} * {{#arrayindex:passive2|{{#var:number}} }} round2 }} }}
                 {{#if: {{{heavy|}}}  
                 {{#if: {{{heavy|}}}  
                     | {{#vardefine: @@@@_passive2_heavy{{#var:suffix}} | {{#expr: {{#var:@@@@_passive2{{#var:suffix}} }} * 1.44 round2 }} }}
                     | {{#vardefine: @@@@_passive2_heavy{{#var:suffix}} | {{#expr: {{#var:@@@@_passive2{{#var:suffix}} }} * 1.44 round2 }} }}
Line 197: Line 197:
                 }}
                 }}
                 {{#if: {{{hits_useful1|}}}  
                 {{#if: {{{hits_useful1|}}}  
                     | {{#vardefine: @@@@_passive2_useful{{#var:suffix}} | {{#expr: {{#var:@@@@_useful{{#var:suffix}} }} * {{#arrayindex:passive1|{{#var:number}} }} round2 }} }}
                     | {{#vardefine: @@@@_passive2_useful{{#var:suffix}} | {{#expr: {{#var:@@@@_useful{{#var:suffix}} }} * {{#arrayindex:passive2|{{#var:number}} }} round2 }} }}
                 }}
                 }}
             }}
             }}
Line 203: Line 203:
     }}
     }}


     <!-- formatting -->
     <!-- formatting - list all values -->


     {{#ifeq: {{{format|}}}|false||
     {{#ifeq: {{{format|}}}|false||
Line 233: Line 233:
}}
}}


 
<!-- formatting - write to actual variables -->
 
<!-- formatting----------------------
-------------------------------------
-------------------------------------
------------------------------------>
{{#ifeq: {{{format|}}}|false||
{{#ifeq: {{{format|}}}|false||
     {{#arrayprint:elements||@@@@|<nowiki/>
     {{#arrayprint:elements||@@@@|<nowiki/>
     {{#vardefine: @@@@ | {{formatnum:{{#var:@@@@}} }}% }}
     {{#vardefine: @@@@ | {{formatnum:{{#var:@@@@}} }}% }}

Revision as of 23:16, 16 March 2022

Information: If you want to test this template, please use Sandbox.
The documentation does not exist, you can click here to create.