Class BaseSubmarketPlugin
java.lang.Object
com.fs.starfarer.api.impl.campaign.submarkets.BaseSubmarketPlugin
- All Implemented Interfaces:
SubmarketPlugin
- Direct Known Subclasses:
BlackMarketPlugin
,LocalResourcesSubmarketPlugin
,MilitarySubmarketPlugin
,OpenMarketPlugin
,StoragePlugin
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface com.fs.starfarer.api.campaign.SubmarketPlugin
SubmarketPlugin.DialogOption, SubmarketPlugin.OnClickAction, SubmarketPlugin.PlayerEconomyImpactMode, SubmarketPlugin.TransferAction
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CargoAPI
protected Random
protected MarketAPI
protected float
protected float
protected float
protected SubmarketAPI
static float
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAllCargo
(CargoAPI otherCargo) void
addAndRemoveStockpiledResources
(float amount, boolean withShortageCountering, boolean withDecreaseToLimit, boolean withCargoUpdate) void
addAndRemoveStockpiledResources
(CommodityOnMarketAPI com, float amount, boolean withShortageCountering, boolean withDecreaseToLimit, boolean withCargoUpdate) protected void
addFighters
(int min, int max, int maxTier, WeightedRandomPicker<String> factionPicker) protected void
addFighters
(int min, int max, int maxTier, String factionId) protected void
addHullMods
(int maxTier, int num) protected void
addHullMods
(int maxTier, int num, String factionId) protected FleetMemberAPI
void
addShips
(String factionId, float combat, float freighter, float tanker, float transport, float liner, float utility, Float qualityOverride, float qualityMod, FactionAPI.ShipPickMode modeOverride, FactionDoctrineAPI doctrineOverride) void
addShips
(String factionId, float combat, float freighter, float tanker, float transport, float liner, float utility, Float qualityOverride, float qualityMod, FactionAPI.ShipPickMode modeOverride, FactionDoctrineAPI doctrineOverride, int maxShipSize) protected void
addWeapons
(int min, int max, int maxTier, WeightedRandomPicker<String> factionPicker) protected void
addWeapons
(int min, int max, int maxTier, WeightedRandomPicker<String> factionPicker, boolean withCategories) protected void
addWeapons
(int min, int max, int maxTier, String factionId) protected void
addWeapons
(int min, int max, int maxTier, String factionId, boolean withCategories) void
advance
(float amount) protected boolean
void
createTooltip
(CoreUIAPI ui, TooltipMakerAPI tooltip, boolean expanded) protected void
createTooltipAfterDescription
(TooltipMakerAPI tooltip, boolean expanded) protected boolean
doShortageCountering
(CommodityOnMarketAPI com, float amount, boolean withShortageCountering) getCargo()
getIllegalTransferText
(CargoStackAPI stack, SubmarketPlugin.TransferAction action) getIllegalTransferText
(FleetMemberAPI member, SubmarketPlugin.TransferAction action) float
getName()
float
float
float
int
float
float
Fraction of value that gets used as tariff.float
boolean
void
init
(SubmarketAPI submarket) boolean
boolean
boolean
boolean
isHidden()
boolean
isIllegalOnSubmarket
(CargoStackAPI stack, SubmarketPlugin.TransferAction action) boolean
isIllegalOnSubmarket
(FleetMemberAPI member, SubmarketPlugin.TransferAction action) boolean
isIllegalOnSubmarket
(String commodityId, SubmarketPlugin.TransferAction action) boolean
boolean
boolean
Whether transactions with this submarket affect the market's supply/demand and result in reputation changes for the player.boolean
boolean
protected void
protected void
pruneShips
(float mult) protected void
pruneWeapons
(float keepFraction) protected Object
protected boolean
void
reportPlayerMarketTransaction
(PlayerMarketTransaction transaction) void
void
setMinSWUpdateInterval
(float minCargoUpdateInterval) void
setSinceLastCargoUpdate
(float sinceLastCargoUpdate) void
setSinceSWUpdate
(float sinceSWUpdate) boolean
boolean
boolean
void
-
Field Details
-
TRADE_IMPACT_DAYS
public static float TRADE_IMPACT_DAYS -
market
-
submarket
-
cargo
-
minSWUpdateInterval
protected float minSWUpdateInterval -
sinceSWUpdate
protected float sinceSWUpdate -
sinceLastCargoUpdate
protected float sinceLastCargoUpdate -
itemGenRandom
-
-
Constructor Details
-
BaseSubmarketPlugin
public BaseSubmarketPlugin()
-
-
Method Details
-
init
- Specified by:
init
in interfaceSubmarketPlugin
-
readResolve
-
getName
- Specified by:
getName
in interfaceSubmarketPlugin
-
getCargo
- Specified by:
getCargo
in interfaceSubmarketPlugin
-
getCargoNullOk
- Specified by:
getCargoNullOk
in interfaceSubmarketPlugin
-
setCargo
-
updateCargoPrePlayerInteraction
public void updateCargoPrePlayerInteraction()- Specified by:
updateCargoPrePlayerInteraction
in interfaceSubmarketPlugin
-
advance
public void advance(float amount) - Specified by:
advance
in interfaceSubmarketPlugin
-
okToUpdateShipsAndWeapons
public boolean okToUpdateShipsAndWeapons()- Specified by:
okToUpdateShipsAndWeapons
in interfaceSubmarketPlugin
-
addAllCargo
- Specified by:
addAllCargo
in interfaceSubmarketPlugin
-
getTariff
public float getTariff()Description copied from interface:SubmarketPlugin
Fraction of value that gets used as tariff.- Specified by:
getTariff
in interfaceSubmarketPlugin
- Returns:
-
getBuyVerb
- Specified by:
getBuyVerb
in interfaceSubmarketPlugin
-
getSellVerb
- Specified by:
getSellVerb
in interfaceSubmarketPlugin
-
isFreeTransfer
public boolean isFreeTransfer()- Specified by:
isFreeTransfer
in interfaceSubmarketPlugin
-
isEnabled
- Specified by:
isEnabled
in interfaceSubmarketPlugin
-
getOnClickAction
- Specified by:
getOnClickAction
in interfaceSubmarketPlugin
-
getDialogText
- Specified by:
getDialogText
in interfaceSubmarketPlugin
-
getDialogTextHighlights
- Specified by:
getDialogTextHighlights
in interfaceSubmarketPlugin
-
getDialogOptions
- Specified by:
getDialogOptions
in interfaceSubmarketPlugin
-
getTooltipAppendix
- Specified by:
getTooltipAppendix
in interfaceSubmarketPlugin
-
getTooltipAppendixHighlights
- Specified by:
getTooltipAppendixHighlights
in interfaceSubmarketPlugin
-
getPlayerEconomyImpactMode
- Specified by:
getPlayerEconomyImpactMode
in interfaceSubmarketPlugin
-
getPlayerTradeImpactMult
public float getPlayerTradeImpactMult()- Specified by:
getPlayerTradeImpactMult
in interfaceSubmarketPlugin
-
reportPlayerMarketTransaction
- Specified by:
reportPlayerMarketTransaction
in interfaceSubmarketPlugin
-
isMilitaryMarket
public boolean isMilitaryMarket()- Specified by:
isMilitaryMarket
in interfaceSubmarketPlugin
-
isBlackMarket
public boolean isBlackMarket()- Specified by:
isBlackMarket
in interfaceSubmarketPlugin
-
isOpenMarket
public boolean isOpenMarket()- Specified by:
isOpenMarket
in interfaceSubmarketPlugin
-
isParticipatesInEconomy
public boolean isParticipatesInEconomy()Description copied from interface:SubmarketPlugin
Whether transactions with this submarket affect the market's supply/demand and result in reputation changes for the player.- Specified by:
isParticipatesInEconomy
in interfaceSubmarketPlugin
- Returns:
-
isIllegalOnSubmarket
- Specified by:
isIllegalOnSubmarket
in interfaceSubmarketPlugin
-
isIllegalOnSubmarket
- Specified by:
isIllegalOnSubmarket
in interfaceSubmarketPlugin
-
getIllegalTransferText
- Specified by:
getIllegalTransferText
in interfaceSubmarketPlugin
-
isIllegalOnSubmarket
- Specified by:
isIllegalOnSubmarket
in interfaceSubmarketPlugin
-
getIllegalTransferText
- Specified by:
getIllegalTransferText
in interfaceSubmarketPlugin
-
addFighters
protected void addFighters(int min, int max, int maxTier, WeightedRandomPicker<String> factionPicker) -
addWeapons
-
addWeapons
-
addWeapons
protected void addWeapons(int min, int max, int maxTier, WeightedRandomPicker<String> factionPicker) -
addWeapons
protected void addWeapons(int min, int max, int maxTier, WeightedRandomPicker<String> factionPicker, boolean withCategories) -
pickAndAddWeapons
-
addFighters
-
pruneWeapons
protected void pruneWeapons(float keepFraction) -
addShips
public void addShips(String factionId, float combat, float freighter, float tanker, float transport, float liner, float utility, Float qualityOverride, float qualityMod, FactionAPI.ShipPickMode modeOverride, FactionDoctrineAPI doctrineOverride) -
addShips
public void addShips(String factionId, float combat, float freighter, float tanker, float transport, float liner, float utility, Float qualityOverride, float qualityMod, FactionAPI.ShipPickMode modeOverride, FactionDoctrineAPI doctrineOverride, int maxShipSize) -
addShip
-
pruneShips
protected void pruneShips(float mult) -
addHullMods
protected void addHullMods(int maxTier, int num) -
addHullMods
-
removeModFromCargo
-
cargoAlreadyHasMod
-
getIllegalTransferTextHighlights
public Highlights getIllegalTransferTextHighlights(CargoStackAPI stack, SubmarketPlugin.TransferAction action) - Specified by:
getIllegalTransferTextHighlights
in interfaceSubmarketPlugin
-
getIllegalTransferTextHighlights
public Highlights getIllegalTransferTextHighlights(FleetMemberAPI member, SubmarketPlugin.TransferAction action) - Specified by:
getIllegalTransferTextHighlights
in interfaceSubmarketPlugin
-
getMinSWUpdateInterval
public float getMinSWUpdateInterval() -
setMinSWUpdateInterval
public void setMinSWUpdateInterval(float minCargoUpdateInterval) -
getSinceLastCargoUpdate
public float getSinceLastCargoUpdate() -
setSinceLastCargoUpdate
public void setSinceLastCargoUpdate(float sinceLastCargoUpdate) -
getSinceSWUpdate
public float getSinceSWUpdate() -
setSinceSWUpdate
public void setSinceSWUpdate(float sinceSWUpdate) -
hasCustomTooltip
public boolean hasCustomTooltip()- Specified by:
hasCustomTooltip
in interfaceSubmarketPlugin
-
createTooltip
- Specified by:
createTooltip
in interfaceSubmarketPlugin
-
createTooltipAfterDescription
-
isTooltipExpandable
public boolean isTooltipExpandable()- Specified by:
isTooltipExpandable
in interfaceSubmarketPlugin
-
getTooltipWidth
public float getTooltipWidth()- Specified by:
getTooltipWidth
in interfaceSubmarketPlugin
-
isHidden
public boolean isHidden()- Specified by:
isHidden
in interfaceSubmarketPlugin
-
showInFleetScreen
public boolean showInFleetScreen()- Specified by:
showInFleetScreen
in interfaceSubmarketPlugin
-
showInCargoScreen
public boolean showInCargoScreen()- Specified by:
showInCargoScreen
in interfaceSubmarketPlugin
-
getMarket
-
getSubmarket
- Specified by:
getSubmarket
in interfaceSubmarketPlugin
-
getStockpileLimit
-
getStockpilingAddRateMult
-
shouldHaveCommodity
-
addAndRemoveStockpiledResources
public void addAndRemoveStockpiledResources(float amount, boolean withShortageCountering, boolean withDecreaseToLimit, boolean withCargoUpdate) -
doShortageCountering
protected boolean doShortageCountering(CommodityOnMarketAPI com, float amount, boolean withShortageCountering) -
addAndRemoveStockpiledResources
public void addAndRemoveStockpiledResources(CommodityOnMarketAPI com, float amount, boolean withShortageCountering, boolean withDecreaseToLimit, boolean withCargoUpdate) -
getTariffTextOverride
- Specified by:
getTariffTextOverride
in interfaceSubmarketPlugin
-
getTariffValueOverride
- Specified by:
getTariffValueOverride
in interfaceSubmarketPlugin
-
getTotalTextOverride
- Specified by:
getTotalTextOverride
in interfaceSubmarketPlugin
-
getTotalValueOverride
- Specified by:
getTotalValueOverride
in interfaceSubmarketPlugin
-