Starsector API
Loading...
Searching...
No Matches
Cryosanctum.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.campaign.econ.impl;
2
3import com.fs.starfarer.api.impl.campaign.ids.Commodities;
4import com.fs.starfarer.api.impl.campaign.rulecmd.salvage.MarketCMD.RaidDangerLevel;
5import com.fs.starfarer.api.util.Pair;
6
7
8public class Cryosanctum extends BaseIndustry {
9
10 public void apply() {
11 super.apply(false);
12
13 int size = 6;
14
16
17 demand(Commodities.SUPPLIES, size - 3);
18 demand(Commodities.ORGANICS, size - 3);
19
20 supply(Commodities.ORGANS, size);
21
22
23 Pair<String, Integer> deficit = getMaxDeficit(Commodities.ORGANICS, Commodities.SUPPLIES);
24 // that's right.
25 if (deficit.two > 0) deficit.two = -1;
26
27 applyDeficitToProduction(1, deficit, Commodities.ORGANS);
28
29 if (!isFunctional()) {
30 supply.clear();
31 }
32 }
33
34
35 @Override
36 public void unapply() {
37 super.unapply();
38 }
39
40
41 @Override
42 public boolean isAvailableToBuild() {
43 return false;
44 }
45
46 public boolean showWhenUnavailable() {
47 return false;
48 }
49
50
51 @Override
52 public RaidDangerLevel adjustCommodityDangerLevel(String commodityId, RaidDangerLevel level) {
53 return level.next();
54 }
55
56 @Override
57 public RaidDangerLevel adjustItemDangerLevel(String itemId, String data, RaidDangerLevel level) {
58 return level.next();
59 }
60}
Map< String, MutableCommodityQuantity > supply
Map< String, MutableCommodityQuantity > demand
Pair< String, Integer > getMaxDeficit(String ... commodityIds)
void applyDeficitToProduction(int index, Pair< String, Integer > deficit, String ... commodities)
RaidDangerLevel adjustCommodityDangerLevel(String commodityId, RaidDangerLevel level)
RaidDangerLevel adjustItemDangerLevel(String itemId, String data, RaidDangerLevel level)