Starsector API
Loading...
Searching...
No Matches
DistressCallIntel.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.campaign.intel.misc;
2
3import java.awt.Color;
4
5import com.fs.starfarer.api.Global;
6import com.fs.starfarer.api.campaign.StarSystemAPI;
7import com.fs.starfarer.api.ui.TooltipMakerAPI;
8import com.fs.starfarer.api.util.Misc;
9
10public class DistressCallIntel extends BreadcrumbIntel {
11
12 protected StarSystemAPI system;
13
14 public DistressCallIntel(StarSystemAPI system) {
15 super(null, system.getCenter());
16 this.system = system;
17 Global.getSector().addScript(this);
18
19 setIcon(Global.getSettings().getSpriteName("intel", "distress_call"));
20 setSound("ui_intel_distress_call");
21 setDuration(60f);
22 setTitle("Distress Call");
23 setText("You receive a distress call from the nearby " + system.getNameWithLowercaseType() + ". " +
24 "There's no additional information, but that's not surprising - " +
25 "a typical fleet doesn't carry the equipment to broadcast a full-fledged data " +
26 "stream into hyperspace.");
27 }
28
29 @Override
30 public void advance(float amount) {
31 super.advance(amount);
32 if (system == Global.getSector().getCurrentLocation()) {
34 }
35 }
36
37
38
39 public void createIntelInfo(TooltipMakerAPI info, ListInfoMode mode) {
40 Color c = getTitleColor(mode);
41 info.addPara(getName(), c, 0f);
42
43 float pad = 3f;
44 float opad = 10f;
45
46 float initPad = pad;
47 if (mode == ListInfoMode.IN_DESC) initPad = opad;
48
49 Color tc = getBulletColorForMode(mode);
50 if (system != null) {
51 bullet(info);
52 info.addPara("Originating in the " + system.getNameWithLowercaseType() + "", tc, initPad);
53 unindent(info);
54 }
55 }
56
57 @Override
58 public void createSmallDescription(TooltipMakerAPI info, float width, float height) {
59 Color h = Misc.getHighlightColor();
60 Color g = Misc.getGrayColor();
61 Color tc = Misc.getTextColor();
62 float pad = 3f;
63 float opad = 10f;
64
65 info.addPara(text, opad);
66
67 float days = getDaysSincePlayerVisible();
68 if (days >= 1) {
69 addDays(info, "ago.", days, tc, opad);
70 }
71
72 if (isEnding()) {
73 info.addPara("You've investigated the system this distress call came from.", opad);
74 }
75 }
76
77 public String getSortString() {
78 return "Distress Call";
79 }
80
81 public String getName() {
82 if (isEnding()) return title + " - Investigated";
83 return title;
84 }
85
86 @Override
87 public boolean shouldRemoveIntel() {
88 if (isEnded()) return true;
89 return super.shouldRemoveIntel();
90 }
91
92
93}
static SettingsAPI getSettings()
Definition Global.java:51
static SectorAPI getSector()
Definition Global.java:59
void addDays(TooltipMakerAPI info, String after, float days)
void createSmallDescription(TooltipMakerAPI info, float width, float height)
void createIntelInfo(TooltipMakerAPI info, ListInfoMode mode)
String getSpriteName(String category, String id)