1package com.fs.starfarer.api.impl.campaign.intel.events;
4import java.util.LinkedHashSet;
8import com.fs.starfarer.api.Global;
9import com.fs.starfarer.api.campaign.StarSystemAPI;
10import com.fs.starfarer.api.campaign.econ.MarketAPI;
11import com.fs.starfarer.api.impl.campaign.ids.Factions;
12import com.fs.starfarer.api.impl.campaign.intel.bases.LuddicPathBaseIntel;
13import com.fs.starfarer.api.impl.campaign.intel.bases.LuddicPathBaseManager;
14import com.fs.starfarer.api.impl.campaign.intel.bases.LuddicPathCellsIntel;
15import com.fs.starfarer.api.impl.campaign.rulecmd.HA_CMD;
16import com.fs.starfarer.api.ui.TooltipMakerAPI;
17import com.fs.starfarer.api.ui.TooltipMakerAPI.TooltipCreator;
18import com.fs.starfarer.api.util.Misc;
29 public void createTooltip(TooltipMakerAPI tooltip,
boolean expanded, Object tooltipParam) {
31 tooltip.addPara(
"Use of advanced technology and AI cores attracts the attention of Pathers.", 0f,
32 Misc.getHighlightColor(),
"advanced technology",
"AI cores");
34 Set<LuddicPathBaseIntel> seen =
new LinkedHashSet<LuddicPathBaseIntel>();
35 for (MarketAPI market : Misc.getPlayerMarkets(
false)) {
36 LuddicPathBaseIntel base = LuddicPathCellsIntel.getClosestBase(market);
37 if (base ==
null)
continue;
39 if (seen.contains(base))
continue;
41 LuddicPathCellsIntel cells = LuddicPathCellsIntel.getCellsForMarket(market);
42 if (cells ==
null || cells.isSleeper())
continue;
46 Color h = Misc.getHighlightColor();
48 if (base.isPlayerVisible()) {
49 system =
" located in the " + base.getSystem().getNameWithLowercaseTypeShort() +
"";
51 tooltip.addPara(
"Active Pather cells on some of your colonies are being supported "
52 +
"by a Pather base" + system +
". %s "
53 +
"will reduce the level of Pather fleet actvity.", opad, h,
54 "Dealing with this base");
58 for (MarketAPI market : Misc.getPlayerMarkets(
false)) {
59 LuddicPathCellsIntel cells = LuddicPathCellsIntel.getCellsForMarket(market);
60 if (cells ==
null)
continue;
61 if (cells.getSleeperTimeout() > 0) {
62 tooltip.addPara(
"Pather cells on some of your colonies have been disrupted, reducing "
63 +
"the Pather interest contribution from these colonies to event progress.", opad,
64 Misc.getPositiveHighlightColor(),
"disrupted");
75 return getProgress() != 0 || HA_CMD.playerHasPatherAgreement();
81 return super.getProgressStr();
86 if (HA_CMD.playerHasPatherAgreement())
return Misc.getPositiveHighlightColor();
87 return super.getProgressColor(
intel);
91 if (HA_CMD.playerHasPatherAgreement())
return 0;
108 int reduced = Math.round(adjusted);
109 if (progress > 0 && reduced < 1) reduced = 1;
120 return "Technology and AI core use";
125 for (StarSystemAPI system : Misc.getPlayerSystems(
false)) {
138 public static float getPatherInterest(StarSystemAPI system,
float multIfNoCells,
float multIfSleeper,
float multIfActive) {
139 return getPatherInterest(system, multIfNoCells, multIfSleeper, multIfActive,
false);
141 public static float getPatherInterest(StarSystemAPI system,
float multIfNoCells,
float multIfSleeper,
float multIfActive,
boolean countCellsOnly) {
143 List<MarketAPI> markets = Misc.getMarketsInLocation(system, Factions.PLAYER);
144 for (MarketAPI market : markets) {
146 LuddicPathCellsIntel
intel = LuddicPathCellsIntel.getCellsForMarket(market);
148 mult = multIfNoCells;
149 }
else if (
intel.isSleeper()) {
150 mult = multIfSleeper;
155 float interest = LuddicPathBaseManager.getLuddicPathMarketInterest(market);
156 if (countCellsOnly) interest = 1f;
157 total += (interest * mult);
164 if (HA_CMD.playerHasPatherAgreement())
return 0f;
167 List<MarketAPI> markets = Misc.getMarketsInLocation(system, Factions.PLAYER);
180 for (MarketAPI market : markets) {
181 LuddicPathCellsIntel
intel = LuddicPathCellsIntel.getCellsForMarket(market);
182 if (
intel ==
null)
continue;
185 if (
intel.isSleeper()) {
186 curr += perSleeperBase + market.getSize() * perSleeperSize;
188 curr += perActiveBase + market.getSize() * perActiveSize;
191 float interest = LuddicPathBaseManager.getLuddicPathMarketInterest(market);
192 curr += interest * perPointOfInterest;
199 max = Math.round(max * 100f) / 100f;
static SettingsAPI getSettings()
HostileActivityEventIntel intel
static boolean isPlayerDefeatedPatherExpedition()
static float getPatherInterest(StarSystemAPI system, float multIfNoCells, float multIfSleeper, float multIfActive, boolean countCellsOnly)
float getTotalPatherInterest()
TooltipCreator getTooltip()
StandardLuddicPathActivityCause2(HostileActivityEventIntel intel)
float getMagnitudeContribution(StarSystemAPI system)
Color getProgressColor(BaseEventIntel intel)
static float getPatherInterest(StarSystemAPI system, float multIfNoCells, float multIfSleeper, float multIfActive)
float getFloat(String key)
static String NEGATED_FACTOR_PROGRESS