Difference between revisions of "Template:Set standing"

From Space Engineers Wiki
Jump to: navigation, search
Line 3: Line 3:
 
{{#ifeq: {{#titleparts: {{FULLPAGENAME}} | | -1 }} | Embassy |
 
{{#ifeq: {{#titleparts: {{FULLPAGENAME}} | | -1 }} | Embassy |
 
<!-- only work in the Standings page-->
 
<!-- only work in the Standings page-->
Is faction defined?
+
{{#if: {{{1|}}} | {{#vardefine:faction|{{{1}}}}}
{{#if: {{{1|}}} | yes{{#vardefine:faction|{{{1}}}}}
 
:faction:{{#var:faction}}
 
 
{{#if: {{#explode:{{#var:faction}}|:|1}} | | {{#vardefine:faction|Faction:{{#var:faction}}}}}}
 
{{#if: {{#explode:{{#var:faction}}|:|1}} | | {{#vardefine:faction|Faction:{{#var:faction}}}}}}
 
{{#vardefine:standing|0}}
 
{{#vardefine:standing|0}}
 
{{#switch: {{lc:{{{2|}}}}}
 
{{#switch: {{lc:{{{2|}}}}}
 
| war
 
| war
| -2 = :{{#vardefine:standing|-2}}
+
| -2 = {{#vardefine:standing|-2}}
 
| hostile
 
| hostile
| -1 = :{{#vardefine:standing|-1}}
+
| -1 = {{#vardefine:standing|-1}}
 
| neutral
 
| neutral
| 0 = :{{#vardefine:standing|-1}}
+
| 0 = {{#vardefine:standing|0}}
 
| friendly
 
| friendly
| 1 = :{{#vardefine:standing|-1}}
+
| 1 = {{#vardefine:standing|1}}
 
| allied
 
| allied
| 2 = :{{#vardefine:standing|-1}}
+
| 2 = {{#vardefine:standing|2}}
 +
}}
 +
{{#switch: {{#var:standing}}
 +
| -2 = {{#set:war={{#var:faction}}}}
 +
| -1 = {{#set:hostile={{#var:faction}}}}
 +
| 0 = {{#set:neutral={{#var:faction}}}}
 +
| 1 = {{#set:friendly={{#var:faction}}}}
 +
| 2 = {{#set:allied={{#var:faction}}}}
 
}}
 
}}
{{#var:faction}} {{#var:standing}}
 
 
|}}
 
|}}
 
|}}
 
|}}
 
|}}
 
|}}

Revision as of 18:48, 28 March 2014