Starsector API
Loading...
Searching...
No Matches
HypershuntIntel.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.campaign.intel.misc;
2
3import java.util.Set;
4
5import java.awt.Color;
6
7import com.fs.starfarer.api.Global;
8import com.fs.starfarer.api.campaign.SectorEntityToken;
9import com.fs.starfarer.api.campaign.SpecialItemSpecAPI;
10import com.fs.starfarer.api.campaign.TextPanelAPI;
11import com.fs.starfarer.api.campaign.comm.IntelInfoPlugin;
12import com.fs.starfarer.api.impl.campaign.econ.impl.ItemEffectsRepo;
13import com.fs.starfarer.api.impl.campaign.ids.Commodities;
14import com.fs.starfarer.api.impl.campaign.ids.Items;
15import com.fs.starfarer.api.ui.SectorMapAPI;
16import com.fs.starfarer.api.ui.TooltipMakerAPI;
17import com.fs.starfarer.api.util.Misc;
18
19public class HypershuntIntel extends MapMarkerIntel {
20
22
23 //String icon = Global.getSettings().getSpriteName("intel", "hypershunt");
24 String title = entity.getName();
25
26 String text = null;
27// if (entity.getStarSystem() != null) {
28// text = "Located in the " + entity.getStarSystem().getNameWithLowercaseTypeShort();
29// }
30 setSound("ui_discovered_entity");
31
33 //setWithTimestamp(false);
34
35 init(entity, title, text, null, true, textPanel);
36 }
37
38 @Override
39 public String getIcon() {
40 return Global.getSettings().getSpriteName("intel", "hypershunt");
41 }
42
43 @Override
44 protected boolean withTextInDesc() {
45 return false;
46 }
47
48 @Override
49 protected void addExtraBulletPoints(TooltipMakerAPI info, Color tc, float initPad, ListInfoMode mode) {
50 if (entity.getMemoryWithoutUpdate().getBoolean("$usable")) {
51 info.addPara("Active", tc, initPad);
52 } else {
53 info.addPara("Inactive", tc, initPad);
54 }
55 }
56
57 public boolean defendersDefeated() {
58 return entity.getMemoryWithoutUpdate().getBoolean("$defenderFleetDefeated");
59 }
60
61 @Override
62 protected void addPostDescriptionSection(TooltipMakerAPI info, float width, float height, float opad) {
63 //if (!entity.getMemoryWithoutUpdate().getBoolean("$hasDefenders")) {
64 if (defendersDefeated()) {
66 info.addPara("Allows colonies within %s light-years to build %s additional industry, "
67 + "provided they have a %s installed and have a steady supply of transplutonics.",
68 opad, Misc.getHighlightColor(),
71 spec.getName());
72
73 if (!entity.getMemoryWithoutUpdate().getBoolean("$usable")) {
74 // these must match the quantities specified in the rule "cTap_infoText"
75 int crew = 1000;
76 int metals = 20000;
77 int transplutonics = 5000;
78 info.showCost("Resources required to activate", false, (int)((width - opad) / 3f),
80 new String [] {Commodities.CREW, Commodities.METALS, Commodities.RARE_METALS},
81 new int [] {crew, metals, transplutonics}, new boolean [] {false, false, false});
82 }
83 }
84 }
85
88 if (((HypershuntIntel)intel).getEntity() == entity) return (HypershuntIntel)intel;
89 }
90 return null;
91 }
92
93 @Override
94 public Set<String> getIntelTags(SectorMapAPI map) {
95 Set<String> tags = super.getIntelTags(map);
96 //tags.add(Tags.INTEL_);
97 return tags;
98 }
99
100
101}
102
103
104
105
static SettingsAPI getSettings()
Definition Global.java:57
static SectorAPI getSector()
Definition Global.java:65
void addExtraBulletPoints(TooltipMakerAPI info, Color tc, float initPad, ListInfoMode mode)
static HypershuntIntel getHypershuntIntel(SectorEntityToken entity)
HypershuntIntel(SectorEntityToken entity, TextPanelAPI textPanel)
void addPostDescriptionSection(TooltipMakerAPI info, float width, float height, float opad)
void init(SectorEntityToken entity, String title, String text, String icon, boolean withDesc)
static Color getBasePlayerColor()
Definition Misc.java:833
static Color getHighlightColor()
Definition Misc.java:792
static Color getDarkPlayerColor()
Definition Misc.java:836
SpecialItemSpecAPI getSpecialItemSpec(String itemId)
String getSpriteName(String category, String id)
LabelAPI addPara(String format, float pad, Color hl, String... highlights)
void showCost(String title, boolean withAvailable, float widthOverride, Color color, Color dark, float pad, String[] res, int[] quantities, boolean[] consumed)