Difference between revisions of "Template:Set standing"

From Space Engineers Wiki
Jump to: navigation, search
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#ifeq: {{NAMESPACE}} | Faction | {{Factionheader}}
+
{{#ifeq: {{NAMESPACE}} | Faction |
 
<!-- only work in the faction namespace -->
 
<!-- only work in the faction namespace -->
{{#ifeq: {{#titleparts: {{FULLPAGENAME}} | | -1 }} | Standings |
+
{{#ifeq: {{#titleparts: {{FULLPAGENAME}} | | -1 }} | Embassy |
 
<!-- only work in the Standings page-->
 
<!-- only work in the Standings page-->
 
{{#if: {{{1|}}} | {{#vardefine:faction|{{{1}}}}}
 
{{#if: {{{1|}}} | {{#vardefine:faction|{{{1}}}}}
{{#var:faction}}{{#if: {{#explode:{{#var:faction}}|:|1}} | {{#vardefine:faction|{{#explode:{{#var:faction}}|:|1}}}}|}}
+
{{#if: {{#explode:{{#var:faction}}|:|1}} | | {{#vardefine:faction|Faction:{{#var:faction}}}}}}
{{#var:faction}}
+
{{#vardefine:standing|0}}
|}}|}}|}}
+
{{#switch: {{lc:{{{2|}}}}}
 +
| war
 +
| -2 = {{#vardefine:standing|-2}}
 +
| hostile
 +
| -1 = {{#vardefine:standing|-1}}
 +
| neutral
 +
| 0 = {{#vardefine:standing|0}}
 +
| friendly
 +
| 1 = {{#vardefine:standing|1}}
 +
| allied
 +
| 2 = {{#vardefine:standing|2}}
 +
}}
 +
*{{#var:faction}} {{#switch: {{#var:standing}}
 +
| -2 = War{{#set:war={{#var:faction}}}}
 +
| -1 = Hostile{{#set:hostile={{#var:faction}}}}
 +
| 0 = Neutral {{#set:neutral={{#var:faction}}}}
 +
| 1 = Friendly {{#set:friendly={{#var:faction}}}}
 +
| 2 = Allied {{#set:allied={{#var:faction}}}}
 +
}}
 +
|}}
 +
|}}
 +
|}}<noinclude>Sets standing of faction to specified faction <pre> {{set standing|target faction|standing}}
 +
target faction is the faction page name of the faction you want to change standings with
 +
 
 +
standing is one of the following: War, Hostile, Neutral, Friendly, Allied
 +
 
 +
This template only works on Faction Embassy pages.</pre>[[Category:Templates]]</noinclude>

Latest revision as of 05:04, 3 April 2014

Sets standing of faction to specified faction
 {{set standing|target faction|standing}}
target faction is the faction page name of the faction you want to change standings with

standing is one of the following: War, Hostile, Neutral, Friendly, Allied

This template only works on Faction Embassy pages.