Difference between revisions of "Template:Set standing"
From Space Engineers Wiki
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--> | ||
− | + | {{#if: {{{1|}}} | {{#vardefine:faction|{{{1}}}}} | |
− | {{#if: {{{1|}}} | | ||
− | |||
{{#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 = | + | | -2 = {{#vardefine:standing|-2}} |
| hostile | | hostile | ||
− | | -1 = | + | | -1 = {{#vardefine:standing|-1}} |
| neutral | | neutral | ||
− | | 0 = | + | | 0 = {{#vardefine:standing|0}} |
| friendly | | friendly | ||
− | | 1 = | + | | 1 = {{#vardefine:standing|1}} |
| allied | | allied | ||
− | | 2 = :{{# | + | | 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}}}} | ||
}} | }} | ||
− | |||
|}} | |}} | ||
|}} | |}} | ||
|}} | |}} |