Difference between revisions of "Template:Planet Calculate Influence"
From Australis Ultima 30k
m |
|||
Line 143: | Line 143: | ||
{{#arraydefine:arrallsum|{{#sub:{{#var:allsum}}|1}}|$}} | {{#arraydefine:arrallsum|{{#sub:{{#var:allsum}}|1}}|$}} | ||
<!--{{#arrayprint:arrallsum}}for error checking --> | <!--{{#arrayprint:arrallsum}}for error checking --> | ||
+ | <!--------------------------------------------------------> | ||
+ | <!-- The below goes through the total array and compares | ||
+ | each of the current influence totals to find the highest | ||
+ | and second highest. --> | ||
+ | <!--------------------------------------------------------> | ||
+ | {{#vardefine:highfaction|0@0}} | ||
+ | {{#vardefine:2ndhighfaction|0@0}} | ||
+ | {{#vardefine:arrallsz|{{#arraysize:arrallsum}}}} | ||
+ | {{#vardefine: iaas | 0 }} | ||
+ | {{#while: | ||
+ | | {{#ifexpr: {{#var:iaas}}<{{#var:arrallsz}} | true }} | ||
+ | |{{#ifexpr:{{#explode:{{#var:highfaction}}|@|1}}>{{#explode:{{#arrayindex:arrallsum|{{#var:iaas}}}}|@|1}} | ||
+ | |{{#ifexpr:{{#explode:{{#var:2ndhighfaction}}|@|1}}>{{#explode:{{#arrayindex:arrallsum|{{#var:iaas}}}}|@|1}} | ||
+ | | | ||
+ | |{{#vardefine:2ndhighfaction|{{#arrayindex:arrallsum|{{#var:iaas}}}}}} | ||
+ | }} | ||
+ | |{{#vardefine:2ndhighfaction|{{#var:highfaction}}}}{{#vardefine:highfaction|{{#arrayindex:arrallsum|{{#var:iaas}}}}}} | ||
+ | }} | ||
+ | {{#vardefine:iaas | {{#expr:{{#var:iaas}}+1}}}} | ||
+ | }} | ||
+ | <!--2nd highest faction:{{#var:2ndhighfaction}}for error checking --> | ||
+ | <!--Highest faction: {{#var:highfaction}}for error checking --> | ||
+ | <!--------------------------------------------------------> | ||
+ | <!--The 2nd highest and highest faction are now compared to check | ||
+ | if highest is the value required away from the 2nd highest to | ||
+ | have control of the planet. --> | ||
+ | <!--------------------------------------------------------> | ||
+ | {| class="" style="width:290px; background-color:;float:left;" | ||
+ | |- | ||
+ | !colspan="2" scope="col"| Influence Summary | ||
+ | |- | ||
+ | ! scope="col"|Faction | ||
+ | ! scope="col"|Influence | ||
+ | {{ #vardefine: if | 0 }} | ||
+ | {{#while: | ||
+ | | {{ #ifexpr: {{ #var: if }} < {{#var:arrallsz}} | true }} | ||
+ | |{{!-}} | ||
+ | {{!}}style="text-align:center;"{{!}}{{#explode:{{#arrayindex:arrallsum|{{#var:if}}}}|@|0}} | ||
+ | {{!}}style="text-align:center;"{{!}}{{#explode:{{#arrayindex:arrallsum|{{#var:if}}}}|@|1}} | ||
+ | {{!-}} | ||
+ | {{ #vardefine: if | {{ #expr: {{ #var: if }} + 1 }} }} | ||
+ | }} | ||
+ | |} | ||
<!--------------------------------------> | <!--------------------------------------> | ||
<!--Display Controlling Factions Image--> | <!--Display Controlling Factions Image--> |
Revision as of 16:07, 7 September 2014
Influence Summary | |
---|---|
Faction | Influence |
Unresolved | 90 |
Traitor | 667 |
Loyalist | 598 |
Imperial | 51 |
Xenos | 16 |
Secessionist | 77 |
Orks | 10 |
Traitors | 5 |
Inconclusive | 5 |
none | 5 |
Enter Here | 5 |
Undecided | 20 |
Alpha Legion | 5 |
Loyalists | 5 |
Antigones mob Traitor | 5 |
Iron Hands Loyalist | 5 |
Eisens arme Hunde Loyalist | 5 |
Loyalisy | 1 |
Synod | 7 |