Editing Template:Trading Value Table Row

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
 
<includeonly>
 
<includeonly>
{{#vardefine:productAmount | {{#if: {{{?Pa}}} | {{{?Pa}}} | 1}} }}
+
{{#vardefine:productAmount | {{#if: {{Q|{{{?Name}}}|Product Amount}} | {{Q|{{{?Name}}}|Product Amount}} | 1 }} }}
  
{{#vardefine:R1a | {{#expr: {{#if: {{{?R1a}}} | {{{?R1a}}} | 0}} / {{#var:productAmount}} }} }}
+
{{#vardefine:R1 | {{Q|{{{?Name}}}|Resource 1}} }}
{{#vardefine:R2a | {{#expr: {{#if: {{{?R2a}}} | {{{?R2a}}} | 0}} / {{#var:productAmount}} }} }}
+
{{#vardefine:R1a | {{#expr: {{Q|{{{?Name}}}|Resource 1 Amount}} / {{#var:productAmount}} }} }}
{{#vardefine:R3a | {{#expr: {{#if: {{{?R3a}}} | {{{?R3a}}} | 0}} / {{#var:productAmount}} }} }}
+
{{#vardefine:R2 | {{Q|{{{?Name}}}|Resource 2}} }}
{{#vardefine:R4a | {{#expr: {{#if: {{{?R4a}}} | {{{?R4a}}} | 0}} / {{#var:productAmount}} }} }}
+
{{#vardefine:R2a | {{#expr: {{Q|{{{?Name}}}|Resource 2 Amount}} / {{#var:productAmount}} }} }}
{{#vardefine:R5a | {{#expr: {{#if: {{{?R5a}}} | {{{?R5a}}} | 0}} / {{#var:productAmount}} }} }}
+
{{#vardefine:R3 | {{Q|{{{?Name}}}|Resource 3}} }}
{{#vardefine:R6a | {{#expr: {{#if: {{{?R6a}}} | {{{?R6a}}} | 0}} / {{#var:productAmount}} }} }}
+
{{#vardefine:R3a | {{#expr: {{Q|{{{?Name}}}|Resource 3 Amount}} / {{#var:productAmount}} }} }}
 +
{{#vardefine:R4 | {{Q|{{{?Name}}}|Resource 4}} }}
 +
{{#vardefine:R4a | {{#expr: {{Q|{{{?Name}}}|Resource 4 Amount}} / {{#var:productAmount}} }} }}
 +
{{#vardefine:R5 | {{Q|{{{?Name}}}|Resource 5}} }}
 +
{{#vardefine:R5a | {{#expr: {{Q|{{{?Name}}}|Resource 5 Amount}} / {{#var:productAmount}} }} }}
 +
{{#vardefine:R6 | {{Q|{{{?Name}}}|Resource 6}} }}
 +
{{#vardefine:R6a | {{#expr: {{Q|{{{?Name}}}|Resource 6 Amount}} / {{#var:productAmount}} }} }}
  
{{#vardefine:isstuff | {{#ifeq: {{{?R1}}} | Stuff | {{#ifeq: {{#var:stuffcat}} | no stuff category | | true}} }} }}
+
{{#vardefine:isstuff | {{#ifeq: {{#var:R1}} | Stuff | {{#ifeq: {{#var:stuffcat}} | no stuff category | | true }} }} }}
  
 
{{#vardefine:skill |
 
{{#vardefine:skill |
   {{#if: {{{?S1}}}
+
   {{#if: {{{?Skill 1}}}
     | [[{{ucfirst:{{{?S1}}}}}]] {{{?S1l}}} {{#if: {{{?S2}}} | + [[{{ucfirst:{{{?S2}}}}}]] {{{?S2l}}} }}
+
     | {{ucfirst:[[{{{?Skill 1}}}]]}} {{{?Skill 1 Level}}} {{#if: {{{?Skill 2}}} | + {{ucfirst:[[{{{?Skill 2}}}]]}} {{{?Skill 2 Level}}} }}
 
     | {{#switch: {{{?Name}}}
 
     | {{#switch: {{{?Name}}}
 
       | Peg leg | Wooden foot | Wooden hand = [[Medical]]
 
       | Peg leg | Wooden foot | Wooden hand = [[Medical]]
Line 21: Line 27:
 
         | Medicine, Medical Item = [[Crafting]] 4 + [[Skills#Intellectual|Intellectual]] 4
 
         | Medicine, Medical Item = [[Crafting]] 4 + [[Skills#Intellectual|Intellectual]] 4
 
         | Furniture | Structure | Production | Buildings | Building | Security | Misc | Floor | Temperature | Power | Ship = [[Construction]]
 
         | Furniture | Structure | Production | Buildings | Building | Security | Misc | Floor | Temperature | Power | Ship = [[Construction]]
         | #default = {{#switch: {{{?Type2}}}
+
         | #default = {{#switch: {{Q|{{{?Name}}}|Type2}}
 
           | Hard Drug | Medical Drug = [[Skills#Intellectual|Intellectual]]
 
           | Hard Drug | Medical Drug = [[Skills#Intellectual|Intellectual]]
 
           | Social Drug = [[Cooking]]
 
           | Social Drug = [[Cooking]]
 
           | #default = –
 
           | #default = –
 
}} }} }} }} }}
 
}} }} }} }} }}
 +
 +
{{#vardefine:multiplier | {{#switch: {{{?Type}}}
 +
  | Art = 1.1
 +
  | Furniture = 0.7
 +
  | Equipment = 0.2
 +
  | #default = 1
 +
}} }}
 +
 +
{{#vardefine:sellable | {{#switch: {{{?Type}}}
 +
  | Structure | Production | Buildings | Building | Security | Misc | Floor | Temperature | Power | Ship =false
 +
  | #default = {{#switch: {{{?Name}}}
 +
    | Peg leg | Wooden foot | Wooden hand | Torch lamp = false
 +
    | #default = true
 +
}} }} }}
  
 
{{#vardefine:amount | {{#expr:
 
{{#vardefine:amount | {{#expr:
 
   {{#if: {{#var:isstuff}}
 
   {{#if: {{#var:isstuff}}
 
     | {{#var:R1a}}
 
     | {{#var:R1a}}
     | {{#ifeq: {{{?R1}}} | {{#var:material}} | {{#var:R1a}} | 0}}
+
     | {{#ifeq: {{#var:R1}} | {{#var:material}} | {{#var:R1a}} | 0}}
 
   }} * {{#var:volume}}
 
   }} * {{#var:volume}}
   + {{#ifeq: {{{?R2}}} | {{#var:material}} | {{#var:R2a}} | 0}}
+
   + {{#ifeq: {{#var:R2}} | {{#var:material}} | {{#var:R2a}} | 0 }}
   + {{#ifeq: {{{?R3}}} | {{#var:material}} | {{#var:R3a}} | 0}}
+
   + {{#ifeq: {{#var:R3}} | {{#var:material}} | {{#var:R3a}} | 0 }}
   + {{#ifeq: {{{?R4}}} | {{#var:material}} | {{#var:R4a}} | 0}}
+
   + {{#ifeq: {{#var:R4}} | {{#var:material}} | {{#var:R4a}} | 0 }}
   + {{#ifeq: {{{?R5}}} | {{#var:material}} | {{#var:R5a}} | 0}}
+
   + {{#ifeq: {{#var:R5}} | {{#var:material}} | {{#var:R5a}} | 0 }}
   + {{#ifeq: {{{?R6}}} | {{#var:material}} | {{#var:R6a}} | 0}}
+
   + {{#ifeq: {{#var:R6}} | {{#var:material}} | {{#var:R6a}} | 0 }}
 
   round 1}}
 
   round 1}}
 
}}
 
}}
  
 
{{#vardefine:others |
 
{{#vardefine:others |
   {{#ifeq: {{{?R1}}} | Stuff
+
   {{#ifeq: {{#var:R1}} | Stuff
 
     | {{#if: {{#var:isstuff}} || {{#var:R1a}} {{Icon Small|Stuff}} }}
 
     | {{#if: {{#var:isstuff}} || {{#var:R1a}} {{Icon Small|Stuff}} }}
     | {{#ifeq: {{{?R1}}} | {{#var:material}} || {{#var:R1a}} {{Icon Small|{{{?R1}}} }} }}
+
     | {{#ifeq: {{#var:R1}} | {{#var:material}} || {{#var:R1a}} {{Icon Small|{{#var:R1}} }} }}
 
   }}<!--
 
   }}<!--
-->{{#if: {{{?R2}}} | {{#ifeq: {{{?R2}}} | {{#var:material}} || &nbsp;{{#expr: {{#var:R2a}} round 1}} {{Icon Small|{{{?R2}}} }} }} }}<!--
+
-->{{#if: {{#var:R2}} | {{#ifeq: {{#var:R2}} | {{#var:material}} || &nbsp;{{#expr: {{#var:R2a}} round 1}} {{Icon Small|{{#var:R2}} }} }} }}<!--
-->{{#if: {{{?R3}}} | {{#ifeq: {{{?R3}}} | {{#var:material}} || &nbsp;{{#expr: {{#var:R3a}} round 1}} {{Icon Small|{{{?R3}}} }} }} }}<!--
+
-->{{#if: {{#var:R3}} | {{#ifeq: {{#var:R3}} | {{#var:material}} || &nbsp;{{#expr: {{#var:R3a}} round 1}} {{Icon Small|{{#var:R3}} }} }} }}<!--
-->{{#if: {{{?R4}}} | {{#ifeq: {{{?R4}}} | {{#var:material}} || &nbsp;{{#expr: {{#var:R4a}} round 1}} {{Icon Small|{{{?R4}}} }} }} }}<!--
+
-->{{#if: {{#var:R4}} | {{#ifeq: {{#var:R4}} | {{#var:material}} || &nbsp;{{#expr: {{#var:R4a}} round 1}} {{Icon Small|{{#var:R4}} }} }} }}<!--
-->{{#if: {{{?R5}}} | {{#ifeq: {{{?R5}}} | {{#var:material}} || &nbsp;{{#expr: {{#var:R5a}} round 1}} {{Icon Small|{{{?R5}}} }} }} }}<!--
+
-->{{#if: {{#var:R5}} | {{#ifeq: {{#var:R5}} | {{#var:material}} || &nbsp;{{#expr: {{#var:R5a}} round 1}} {{Icon Small|{{#var:R5}} }} }} }}<!--
-->{{#if: {{{?R6}}} | {{#ifeq: {{{?R6}}} | {{#var:material}} || &nbsp;{{#expr: {{#var:R6a}} round 1}} {{Icon Small|{{{?R6}}} }} }} }}
+
-->{{#if: {{#var:R6}} | {{#ifeq: {{#var:R6}} | {{#var:material}} || &nbsp;{{#expr: {{#var:R6a}} round 1}} {{Icon Small|{{#var:R6}} }} }} }}
 
}}
 
}}
  
 +
{{#vardefine:work | {{#switch: {{{?Type}}}
 +
  | Furniture | Structure | Production | Buildings | Building | Security | Misc | Floor | Temperature | Power | Ship = {{#expr: {{formatnum:{{Q|{{{?Name}}}|Work To Make}}|R}} * {{#var:buildfactor}} + {{#var:buildoffset}} round 0}}
 +
  | #default = {{#expr: {{formatnum:{{Q|{{{?Name}}}|Work To Make}}|R}} * {{#var:makefactor}} / {{#var:productAmount}} round 0}}
 +
}} }}
  
{{#vardefine:work
+
{{#vardefine:value | {{formatnum: {{#ifeq: {{#var:R1}} | Stuff | {{#if: {{#var:isstuff}} | {{Market Value Calculator|{{{?Name}}}|{{#var:material}}}} | {{Market Value Calculator|{{{?Name}}}|wood}} }} | {{Q|{{{?Name}}}|Market Value Base}} }} |R}} }}
  | {{#switch: {{Q|{{{?Name}}}|Production Facility 1}}
+
{{#vardefine:note | {{#ifeq: {{#var:R1}} | Stuff | {{#if: {{#var:isstuff}} | | &nbsp;<abbr title="This value depends on the material and might therefore not be correct."><sup>[Note]</sup></abbr> }} }} }}
    | Large mech gestator | Mech gestator | War queen = false
 
    | #default = {{#switch: {{{?Type}}}
 
      | Furniture | Structure | Production | Buildings | Building | Security | Misc | Floor | Temperature | Power | Ship = {{#expr: {{formatnum:{{{?Work}}}|R}} * {{#var:buildfactor}} + {{#var:buildoffset}} round 0}}
 
      | #default = {{#expr: {{formatnum:{{{?Work}}}|R}} * {{#var:makefactor}} / {{#var:productAmount}} round 0}}
 
}} }} }}
 
 
 
{{#vardefine:value | {{formatnum: {{#ifeq: {{{?R1}}} | Stuff | {{#if: {{#var:isstuff}} | {{Market Value Calculator|{{{?Name}}}|{{#var:material}}}} | {{Market Value Calculator|{{{?Name}}}|wood}} }} | {{{?Value}}} }} |R}} }}
 
 
 
{{#vardefine:note | {{#ifeq: {{{?R1}}} | Stuff | {{#if: {{#var:isstuff}} | | &nbsp;<abbr title="This value depends on the material and might therefore not be correct."><sup>[Note]</sup></abbr> }} }} }}
 
 
 
{{#ifeq: {{#vardefineecho:sellable | {{#switch: {{{?Type}}}
 
    | Structure | Production | Buildings | Building | Security | Misc | Floor | Temperature | Power | Ship = false
 
    | #default = {{#switch: {{{?Name}}}
 
      | Peg leg | Wooden foot | Wooden hand | Torch lamp = false
 
      | #default = true
 
  }} }} }} | true |
 
 
 
  {{#vardefine:multiplier | {{#switch: {{{?Type}}}
 
    | Art = 1.1
 
    | Furniture = 0.7
 
    | Equipment = 0.2
 
    | #default = 1
 
  }} }}
 
 
 
  {{#vardefine:resourceCost | {{#expr:
 
    {{#if: {{#var:isstuff}} | {{#var:materialValue}} | {{Q|{{{?R1}}}|Market Value Base|1}} * {{#switch: {{Q|{{{?R1}}}|Type}} | Art = 1.1 | Furniture = 0.7 | Equipment = 0.2 | #default = 1}} }} * {{#var:R1a}}
 
    + {{Q|{{{?R2}}}|Market Value Base|0}} * {{#var:R2a}} * {{#switch: {{Q|{{{?R1}}}|Type}} | Art = 1.1 | Furniture = 0.7 | Equipment = 0.2 | #default = 1}}
 
    + {{Q|{{{?R3}}}|Market Value Base|0}} * {{#var:R3a}} * {{#switch: {{Q|{{{?R1}}}|Type}} | Art = 1.1 | Furniture = 0.7 | Equipment = 0.2 | #default = 1}}
 
    + {{Q|{{{?R4}}}|Market Value Base|0}} * {{#var:R4a}} * {{#switch: {{Q|{{{?R1}}}|Type}} | Art = 1.1 | Furniture = 0.7 | Equipment = 0.2 | #default = 1}}
 
    + {{Q|{{{?R5}}}|Market Value Base|0}} * {{#var:R5a}} * {{#switch: {{Q|{{{?R1}}}|Type}} | Art = 1.1 | Furniture = 0.7 | Equipment = 0.2 | #default = 1}}
 
    + {{Q|{{{?R6}}}|Market Value Base|0}} * {{#var:R6a}} * {{#switch: {{Q|{{{?R1}}}|Type}} | Art = 1.1 | Furniture = 0.7 | Equipment = 0.2 | #default = 1}}
 
  }} }}
 
}}
 
  
! style="text-align: left" | {{DLC Icons|{{{?Name}}}}}
+
! style="text-align: left" | [[{{{?Name}}}]] {{#switch: {{Q|{{{?Name}}}|From DLC}} | Royalty (DLC) = {{RoyaltyIcon}} | Ideology (DLC) = {{IdeologyIcon}} }}
| {{formatnum: {{#var:amount}} }} [[{{#show: {{#var:material}}| ?image | link = none }}|16px|{{#var:material}}|link={{#var:material}}]] {{#if: {{#var:isstuff}} | ({{formatnum: {{#expr: {{#var:R1a}} * {{#var:volume}} }} }} [[{{#show: Stuff| ?image | link = none }}|16px|Stuff|link=Stuff]]) }}
+
| {{formatnum: {{#var:amount}} }} {{Icon Small|{{#var:material}} }} {{#if: {{#var:isstuff}} | ({{formatnum: {{#expr: {{#var:R1a}} * {{#var:volume}} }} }} {{Icon Small|Stuff}}) }}
 
| {{#ifeq: {{#var:others}} || – | {{#var:others}} }}
 
| {{#ifeq: {{#var:others}} || – | {{#var:others}} }}
| {{#ifeq: {{#var:work}} | false | – | {{Align Ticks| {{#var:work}} }} }}
+
| {{ticks | {{#var:work}} }}
 
| {{#var:skill}}
 
| {{#var:skill}}
| {{Align Silver| {{#var:value}} }} [[{{#show: Silver| ?image | link = none }}|16px|Silver|link=Silver]]{{#var:note}}
+
| {{formatnum: {{#var:value}} }} {{Icon Small|silver}}{{#var:note}}
 
| {{#ifeq: {{#var:sellable}} | true | {{#var:multiplier}} | – }}
 
| {{#ifeq: {{#var:sellable}} | true | {{#var:multiplier}} | – }}
| {{#ifeq: {{#var:sellable}} | true | {{#expr: {{#var:multiplier}}*{{#var:value}}/{{#var:resourceCost}} round 2}}{{#var:note}} | – }}
+
| {{#ifeq: {{#var:sellable}} | true | {{ticks | {{#expr: {{#var:work}}/({{#var:multiplier}}*{{#var:value}})round2}} }}{{#var:note}} | – }}
 +
| {{#ifeq: {{#var:sellable}} | true | {{#expr: ({{#var:multiplier}}*{{#var:value}})/{{#var:amount}}round2}} {{Icon Small|silver}}{{#var:note}} | – }}
 
|-
 
|-
  
 
</includeonly><noinclude>{{Documentation}}{{Trading Value Table|Psychoid leaves}}{{Trading Value Table|Neutroamine}}{{Trading Value Table|Wort}}{{Trading Value Table|Hops}}</noinclude>
 
</includeonly><noinclude>{{Documentation}}{{Trading Value Table|Psychoid leaves}}{{Trading Value Table|Neutroamine}}{{Trading Value Table|Wort}}{{Trading Value Table|Hops}}</noinclude>

Please note that all contributions to RimWorld Wiki are considered to be released under the CC BY-SA 3.0 (see RimWorld Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)