Difference between revisions of "Template:Trading Value Table Row"

From RimWorld Wiki
Jump to navigation Jump to search
m
(trying to condense everything)
Line 1: Line 1:
 
<includeonly>
 
<includeonly>
 +
{{#vardefine:material | {{SUBPAGENAME}} }}
 +
{{#ifeq: {{#var:material}} | Wood
 +
  | {{#vardefine:stuff | Woody }}
 +
  | {{#vardefine:stuff | {{Q | {{#var:material}} | Kind}} }}
 +
}}
 +
{{#if: {{#pos: {{Q | {{{?Name}}} | Stuff Tags}} | {{#var:stuff}} }}
 +
 +
{{#vardefine:sellable | false }}
  
{{#vardefine:material | {{SUBPAGENAME}} }}
+
{{#ifeq: {{{?Type}}} | Structure | |
 +
{{#ifeq: {{{?Type}}} | Production | |
 +
{{#ifeq: {{{?Type}}} | Buildings | |
 +
{{#ifeq: {{{?Type}}} | Security | |
 +
{{#ifeq: {{{?Type}}} | Misc | |
 +
{{#ifeq: {{{?Type}}} | Miscellaneous | |
 +
{{#ifeq: {{{?Type}}} | Floor | |
 +
{{#ifeq: {{{?Type}}} | Temperature | |
 +
{{#ifeq: {{{?Type}}} | Power | |
 +
{{#ifeq: {{{?Type}}} | Ship | |
 +
  {{#ifeq: {{{?Name}}} | Peg leg | |
 +
  {{#ifeq: {{{?Name}}} | Wooden foot | |
 +
  {{#ifeq: {{{?Name}}} | Wooden hand | |
 +
  {{#ifeq: {{{?Name}}} | Torch lamp | |
 +
    {{#vardefine:sellable | true }}
 +
  }} }} }} }}
 +
}} }} }} }} }} }} }} }} }} }}
  
 
{{#ifeq: {{{?Type}}} | Furniture | {{#vardefine:multiplier | 0.7}} {{#vardefine:skill | [[Construction]]}} | {{#vardefine:multiplier | 1}} {{#vardefine:skill | -}} }}
 
{{#ifeq: {{{?Type}}} | Furniture | {{#vardefine:multiplier | 0.7}} {{#vardefine:skill | [[Construction]]}} | {{#vardefine:multiplier | 1}} {{#vardefine:skill | -}} }}
Line 57: Line 81:
 
| {{ticks/seconds|{{#expr:{{formatnum:{{Q|{{{?Name}}}|Work To Make}}|R}}*{{#var:workfactor}}/({{#var:multiplier}}*{{Market Value Calculator|{{{?Name}}}|{{#var:material}}}})round2}}}}
 
| {{ticks/seconds|{{#expr:{{formatnum:{{Q|{{{?Name}}}|Work To Make}}|R}}*{{#var:workfactor}}/({{#var:multiplier}}*{{Market Value Calculator|{{{?Name}}}|{{#var:material}}}})round2}}}}
 
| {{#expr:{{Q|{{{?Name}}}|Resource 1 Amount}}/({{#var:multiplier}}*{{Market Value Calculator|{{{?Name}}}|{{#var:material}}}})round2}}
 
| {{#expr:{{Q|{{{?Name}}}|Resource 1 Amount}}/({{#var:multiplier}}*{{Market Value Calculator|{{{?Name}}}|{{#var:material}}}})round2}}
| {{#ifeq: {{{?Sellable}}} | true | [[File:check.png|16px]] | [[File:ex.png|16px]] }}
+
| {{#ifeq: {{{#var:sellable}}} | true | [[File:check.png|16px]] | [[File:ex.png|16px]] }}
 
|-
 
|-
  
 +
}}
 
</includeonly>
 
</includeonly>
  
 
<noinclude>
 
<noinclude>
 
{{documentation}}
 
{{documentation}}
 +
<nowiki>
 +
{{#vardefine:material | {{SUBPAGENAME}} }}
 +
 +
{{#ifeq: {{{?Type}}} | Furniture | {{#vardefine:multiplier | 0.7}} {{#vardefine:skill | [[Construction]]}} | {{#vardefine:multiplier | 1}} {{#vardefine:skill | -}} }}
 +
{{#ifeq: {{{?Type}}} | Art | {{#vardefine:multiplier | 1.1}} {{#vardefine:skill | [[Skills#Artistic|Artistic]]}} }}
 +
{{#ifeq: {{{?Type}}} | Medical Items | {{#vardefine:skill | [[Crafting]]}} }}
 +
{{#ifeq: {{{?Type}}} | Gear | {{#vardefine:multiplier | 0.7}} {{#vardefine:skill | [[Crafting]]}} }}
 +
{{#ifeq: {{{?Type}}} | Equipment | {{#vardefine:multiplier | 0.2}} {{#vardefine:skill | [[Crafting]]}} }}
 +
{{#ifeq: {{{?Type}}} | Crafted Resources | {{#vardefine:multiplier | 0.6}} {{#vardefine:skill | [[Crafting]]}} }}
 +
{{#ifeq: {{{?Type}}} | Floor | {{#vardefine:skill | [[Construction]]}} }}
 +
{{#ifeq: {{{?Type}}} | Buildings | {{#vardefine:skill | [[Construction]]}} }}
 +
{{#ifeq: {{{?Type}}} | Structure | {{#vardefine:skill | [[Construction]]}} }}
 +
{{#ifeq: {{{?Type}}} | Misc | {{#vardefine:skill | [[Construction]]}} }}
 +
{{#ifeq: {{{?Type}}} | Security | {{#vardefine:skill | [[Construction]]}} }}
 +
{{#ifeq: {{{?Type}}} | Temperature | {{#vardefine:skill | [[Construction]]}} }}
 +
{{#ifeq: {{{?Type}}} | Production | {{#vardefine:skill | [[Construction]]}} }}
 +
{{#ifeq: {{{?Type}}} | Power| {{#vardefine:skill | [[Construction]]}} }}
 +
{{#ifeq: {{{?Type}}} | Ship| {{#vardefine:skill | [[Construction]]}} }}
 +
 +
{{#vardefine:amount | {{#expr:
 +
  {{#ifeq: {{{?Stuff}}} | true
 +
    | {{Q|{{{?Name}}}|Resource 1 Amount}}
 +
    | {{#ifeq: {{Q|{{{?Name}}}|Resource 1}}|{{#var:material}}|{{Q|{{{?Name}}}|Resource 1 Amount}}|0}}
 +
  }}
 +
  * {{#ifeq: {{#var:material}} | Gold | 10
 +
      | {{#ifeq: {{#var:material}} | Silver | 10 | 1 }}
 +
    }}
 +
  + {{#ifeq: {{Q|{{{?Name}}}|Resource 2}}|{{#var:material}}|{{Q|{{{?Name}}}|Resource 2 Amount}}|0}}
 +
  + {{#ifeq: {{Q|{{{?Name}}}|Resource 3}}|{{#var:material}}|{{Q|{{{?Name}}}|Resource 3 Amount}}|0}}
 +
  + {{#ifeq: {{Q|{{{?Name}}}|Resource 4}}|{{#var:material}}|{{Q|{{{?Name}}}|Resource 4 Amount}}|0}}
 +
  + {{#ifeq: {{Q|{{{?Name}}}|Resource 5}}|{{#var:material}}|{{Q|{{{?Name}}}|Resource 5 Amount}}|0}}
 +
  + {{#ifeq: {{Q|{{{?Name}}}|Resource 6}}|{{#var:material}}|{{Q|{{{?Name}}}|Resource 6 Amount}}|0}}
 +
}} }}
 +
 +
{{#vardefine:others |
 +
  {{#ifeq: {{Q|{{{?Name}}}|Resource 1}} | Stuff
 +
    | {{#ifeq: {{{?Stuff}}} | true || {{Q|{{{?Name}}}|Resource 1 Amount || {{Icon Small|Stuff}} }} }}
 +
    | {{#ifeq: {{Q|{{{?Name}}}|Resource 1}} | {{#var:material}} ||{{Q|{{{?Name}}}| Resource 1 Amount || {{Icon Small|{{Q|{{{?Name}}}|Resource 1}} }} }} }}
 +
  }}<!---
 +
  --->{{#if: {{Q|{{{?Name}}}|Resource 2}} | {{#ifeq: {{Q|{{{?Name}}}|Resource 2}} | {{#var:material}} || &nbsp;{{Q|{{{?Name}}}| Resource 2 Amount || {{Icon Small|{{Q|{{{?Name}}}|Resource 2}} }} }} }} }}<!---
 +
  --->{{#if: {{Q|{{{?Name}}}|Resource 3}} | {{#ifeq: {{Q|{{{?Name}}}|Resource 3}} | {{#var:material}} || &nbsp;{{Q|{{{?Name}}}| Resource 3 Amount || {{Icon Small|{{Q|{{{?Name}}}|Resource 3}} }} }} }} }}<!---
 +
  --->{{#if: {{Q|{{{?Name}}}|Resource 4}} | {{#ifeq: {{Q|{{{?Name}}}|Resource 4}} | {{#var:material}} || &nbsp;{{Q|{{{?Name}}}| Resource 4 Amount || {{Icon Small|{{Q|{{{?Name}}}|Resource 4}} }} }} }} }}<!---
 +
  --->{{#if: {{Q|{{{?Name}}}|Resource 5}} | {{#ifeq: {{Q|{{{?Name}}}|Resource 5}} | {{#var:material}} || &nbsp;{{Q|{{{?Name}}}| Resource 5 Amount || {{Icon Small|{{Q|{{{?Name}}}|Resource 5}} }} }} }} }}<!---
 +
  --->{{#if: {{Q|{{{?Name}}}|Resource 6}} | {{#ifeq: {{Q|{{{?Name}}}|Resource 6}} | {{#var:material}} || &nbsp;{{Q|{{{?Name}}}| Resource 6 Amount || {{Icon Small|{{Q|{{{?Name}}}|Resource 6}} }} }} }} }}
 +
}}
 +
 +
{{#vardefine:workfactor | {{#if: {{Q|{{#var:material}}|Work To Build Factor}} | {{Q|{{#var:material}}|Work To Build Factor}} | 1 }} }}
 +
 +
! style="text-align: left" | [[{{{?Name}}}]] {{#ifeq: {{Q|{{{?Name}}}|From DLC}} | Royalty (DLC) |{{RoyaltyIcon}} }}{{#ifeq: {{Q|{{{?Name}}}|From DLC}} | Ideology (DLC) |{{IdeologyIcon}} }}
 +
| {{#var:amount}} {{Icon Small|{{#var:material}}}} {{#ifeq: {{{?Stuff}}} | true | ({{Q|{{{?Name}}}|Resource 1 Amount}} {{Icon Small|Stuff}}) }}
 +
| {{#ifeq: {{#var:others}} || - | {{#var:others}} }}
 +
| {{ticks/minutes|{{Q|{{{?Name}}}|Work To Make}}*{{#var:workfactor}} }}
 +
| {{#var:skill}}
 +
| {{#ifeq: {{{?Stuff}}} | true | {{Market Value Calculator|{{{?Name}}}|{{#var:material}}}} | {{Q|{{{?Name}}}|Market Value Base}} }} {{Icon Small|silver}}
 +
| {{#var:multiplier}}
 +
| {{ticks/seconds|{{#expr:{{formatnum:{{Q|{{{?Name}}}|Work To Make}}|R}}*{{#var:workfactor}}/({{#var:multiplier}}*{{Market Value Calculator|{{{?Name}}}|{{#var:material}}}})round2}}}}
 +
| {{#expr:{{Q|{{{?Name}}}|Resource 1 Amount}}/({{#var:multiplier}}*{{Market Value Calculator|{{{?Name}}}|{{#var:material}}}})round2}}
 +
| {{#ifeq: {{{?Sellable}}} | true | [[File:check.png|16px]] | [[File:ex.png|16px]] }}
 +
|-
 +
</nowiki>
 
</noinclude>
 
</noinclude>

Revision as of 08:49, 19 September 2021


{{#vardefine:material | {{SUBPAGENAME}} }} {{#ifeq: {{{?Type}}} | Furniture | {{#vardefine:multiplier | 0.7}} {{#vardefine:skill | [[Construction]]}} | {{#vardefine:multiplier | 1}} {{#vardefine:skill | -}} }} {{#ifeq: {{{?Type}}} | Art | {{#vardefine:multiplier | 1.1}} {{#vardefine:skill | [[Skills#Artistic|Artistic]]}} }} {{#ifeq: {{{?Type}}} | Medical Items | {{#vardefine:skill | [[Crafting]]}} }} {{#ifeq: {{{?Type}}} | Gear | {{#vardefine:multiplier | 0.7}} {{#vardefine:skill | [[Crafting]]}} }} {{#ifeq: {{{?Type}}} | Equipment | {{#vardefine:multiplier | 0.2}} {{#vardefine:skill | [[Crafting]]}} }} {{#ifeq: {{{?Type}}} | Crafted Resources | {{#vardefine:multiplier | 0.6}} {{#vardefine:skill | [[Crafting]]}} }} {{#ifeq: {{{?Type}}} | Floor | {{#vardefine:skill | [[Construction]]}} }} {{#ifeq: {{{?Type}}} | Buildings | {{#vardefine:skill | [[Construction]]}} }} {{#ifeq: {{{?Type}}} | Structure | {{#vardefine:skill | [[Construction]]}} }} {{#ifeq: {{{?Type}}} | Misc | {{#vardefine:skill | [[Construction]]}} }} {{#ifeq: {{{?Type}}} | Security | {{#vardefine:skill | [[Construction]]}} }} {{#ifeq: {{{?Type}}} | Temperature | {{#vardefine:skill | [[Construction]]}} }} {{#ifeq: {{{?Type}}} | Production | {{#vardefine:skill | [[Construction]]}} }} {{#ifeq: {{{?Type}}} | Power| {{#vardefine:skill | [[Construction]]}} }} {{#ifeq: {{{?Type}}} | Ship| {{#vardefine:skill | [[Construction]]}} }} {{#vardefine:amount | {{#expr: {{#ifeq: {{{?Stuff}}} | true | {{Q|{{{?Name}}}|Resource 1 Amount}} | {{#ifeq: {{Q|{{{?Name}}}|Resource 1}}|{{#var:material}}|{{Q|{{{?Name}}}|Resource 1 Amount}}|0}} }} * {{#ifeq: {{#var:material}} | Gold | 10 | {{#ifeq: {{#var:material}} | Silver | 10 | 1 }} }} + {{#ifeq: {{Q|{{{?Name}}}|Resource 2}}|{{#var:material}}|{{Q|{{{?Name}}}|Resource 2 Amount}}|0}} + {{#ifeq: {{Q|{{{?Name}}}|Resource 3}}|{{#var:material}}|{{Q|{{{?Name}}}|Resource 3 Amount}}|0}} + {{#ifeq: {{Q|{{{?Name}}}|Resource 4}}|{{#var:material}}|{{Q|{{{?Name}}}|Resource 4 Amount}}|0}} + {{#ifeq: {{Q|{{{?Name}}}|Resource 5}}|{{#var:material}}|{{Q|{{{?Name}}}|Resource 5 Amount}}|0}} + {{#ifeq: {{Q|{{{?Name}}}|Resource 6}}|{{#var:material}}|{{Q|{{{?Name}}}|Resource 6 Amount}}|0}} }} }} {{#vardefine:others | {{#ifeq: {{Q|{{{?Name}}}|Resource 1}} | Stuff | {{#ifeq: {{{?Stuff}}} | true || {{Q|{{{?Name}}}|Resource 1 Amount || {{Icon Small|Stuff}} }} }} | {{#ifeq: {{Q|{{{?Name}}}|Resource 1}} | {{#var:material}} ||{{Q|{{{?Name}}}| Resource 1 Amount || {{Icon Small|{{Q|{{{?Name}}}|Resource 1}} }} }} }} }}<!--- --->{{#if: {{Q|{{{?Name}}}|Resource 2}} | {{#ifeq: {{Q|{{{?Name}}}|Resource 2}} | {{#var:material}} ||  {{Q|{{{?Name}}}| Resource 2 Amount || {{Icon Small|{{Q|{{{?Name}}}|Resource 2}} }} }} }} }}<!--- --->{{#if: {{Q|{{{?Name}}}|Resource 3}} | {{#ifeq: {{Q|{{{?Name}}}|Resource 3}} | {{#var:material}} ||  {{Q|{{{?Name}}}| Resource 3 Amount || {{Icon Small|{{Q|{{{?Name}}}|Resource 3}} }} }} }} }}<!--- --->{{#if: {{Q|{{{?Name}}}|Resource 4}} | {{#ifeq: {{Q|{{{?Name}}}|Resource 4}} | {{#var:material}} ||  {{Q|{{{?Name}}}| Resource 4 Amount || {{Icon Small|{{Q|{{{?Name}}}|Resource 4}} }} }} }} }}<!--- --->{{#if: {{Q|{{{?Name}}}|Resource 5}} | {{#ifeq: {{Q|{{{?Name}}}|Resource 5}} | {{#var:material}} ||  {{Q|{{{?Name}}}| Resource 5 Amount || {{Icon Small|{{Q|{{{?Name}}}|Resource 5}} }} }} }} }}<!--- --->{{#if: {{Q|{{{?Name}}}|Resource 6}} | {{#ifeq: {{Q|{{{?Name}}}|Resource 6}} | {{#var:material}} ||  {{Q|{{{?Name}}}| Resource 6 Amount || {{Icon Small|{{Q|{{{?Name}}}|Resource 6}} }} }} }} }} }} {{#vardefine:workfactor | {{#if: {{Q|{{#var:material}}|Work To Build Factor}} | {{Q|{{#var:material}}|Work To Build Factor}} | 1 }} }} ! style="text-align: left" | [[{{{?Name}}}]] {{#ifeq: {{Q|{{{?Name}}}|From DLC}} | Royalty (DLC) |{{RoyaltyIcon}} }}{{#ifeq: {{Q|{{{?Name}}}|From DLC}} | Ideology (DLC) |{{IdeologyIcon}} }} | {{#var:amount}} {{Icon Small|{{#var:material}}}} {{#ifeq: {{{?Stuff}}} | true | ({{Q|{{{?Name}}}|Resource 1 Amount}} {{Icon Small|Stuff}}) }} | {{#ifeq: {{#var:others}} || - | {{#var:others}} }} | {{ticks/minutes|{{Q|{{{?Name}}}|Work To Make}}*{{#var:workfactor}} }} | {{#var:skill}} | {{#ifeq: {{{?Stuff}}} | true | {{Market Value Calculator|{{{?Name}}}|{{#var:material}}}} | {{Q|{{{?Name}}}|Market Value Base}} }} {{Icon Small|silver}} | {{#var:multiplier}} | {{ticks/seconds|{{#expr:{{formatnum:{{Q|{{{?Name}}}|Work To Make}}|R}}*{{#var:workfactor}}/({{#var:multiplier}}*{{Market Value Calculator|{{{?Name}}}|{{#var:material}}}})round2}}}} | {{#expr:{{Q|{{{?Name}}}|Resource 1 Amount}}/({{#var:multiplier}}*{{Market Value Calculator|{{{?Name}}}|{{#var:material}}}})round2}} | {{#ifeq: {{{?Sellable}}} | true | [[File:check.png|16px]] | [[File:ex.png|16px]] }} |-