Result
{# Perform initial lookup based on input values #}
{% CommodityTypeLookup1 = {CHART(name="CommodityModifier", filter="{$Commodity_Type_1}", filter_cols="1", cols="2")} %}
{% CommodityTypeLookup2 = {CHART(name="CommodityModifier", filter="{$Commodity_Type_2}", filter_cols="1", cols="2")} %}
{% RarityLookup1 = {CHART(name="RarityModifier", filter="{$Rarity}", filter_cols="1", cols="2")} %}
{# ensure inputs don't conflict and try not add upon themselves (i.e. "Agriculture + Agriculture = -4 modifier") which for whatever reason, doesn't quite work as intended... #}
{%if Commodity_Type_2 == "None"%}{% CommodityTypeLookup2 = 0 %}{%end%}
{%if Commodity_Type_2 == "None"%}{% Commodity_Type_2 = " " %}{%end%}
{%if Commodity_Type_2 == Commodity_Type_1%}{% Commodity_Type_2 = " " %}{%end%}
{%if Commodity_Type_2 == Commodity_Type_1%}{% CommodityTypeLookup2 = 0 %}{%end%}
{# Finalize Price Modifier Here after above logic has been applied #}
{% priceModifier = {{$CommodityTypeLookup1}+{$CommodityTypeLookup2}+{$RarityLookup1}} %}
{# Lookup Price Here #}
{% priceTotal = {CHART(name="PriceTable", filter_exact="{$priceModifier}", filter_cols="1", cols="2")} %}
{# Print results here #}
Commodity Calculation
Commodity | Price Modifier | Price Per Unit |
---|---|---|
{$Rarity} {$Commodity_Type_1} {$Commodity_Type_2} | {$priceModifier} | {$priceTotal} |
Subcharts
CommodityModifier (d20)
d20 | Type | Price Modifier |
---|---|---|
1 |
Agricultural |
-2 |
2 |
Alien |
+2 |
3 |
Astronautic |
+1 |
4 |
Biotech |
+1 |
5 |
Consumer |
0 |
6 |
Cultural |
0 |
7 |
Livestock |
0 |
8 |
Low Tech |
-1 |
9 |
Luxury |
+2 |
10 |
Maltech |
+4 |
11 |
Medical |
+2 |
12 |
Military |
+1 |
13 |
Mineral |
-1 |
14 |
Postech |
0 |
15 |
Pretech |
+3 |
16 |
Religious |
0 |
17 |
Sapient |
+2 |
18 |
Survival |
0 |
19 |
Tool |
+1 |
20 |
Vehicle |
+1 |
RarityModifier (1d3)
1d3 | Result | Modifier |
---|---|---|
1 |
Rare |
1 |
2 |
Normal |
0 |
3 |
Common |
-1 |
PriceTable (d16)
d16 | Mod Total | Unit Price |
---|---|---|
1 |
-7 |
25 |
2 |
-6 |
50 |
3 |
-5 |
100 |
4 |
-4 |
250 |
5 |
-3 |
500 |
6 |
-2 |
1000 |
7 |
-1 |
2000 |
8 |
0 |
5000 |
9 |
1 |
10000 |
10 |
2 |
25000 |
11 |
3 |
50000 |
12 |
4 |
100000 |
13 |
5 |
200000 |
14 |
6 |
400000 |
15 |
7 |
800000 |
16 |
8 |
1600000 |