Starsector API
Loading...
Searching...
No Matches
EventHorizonPlugin.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.campaign.terrain;
2
3import com.fs.starfarer.api.Global;
4import com.fs.starfarer.api.campaign.CampaignEngineLayers;
5import com.fs.starfarer.api.campaign.TerrainAIFlags;
6import com.fs.starfarer.api.combat.ViewportAPI;
7import com.fs.starfarer.api.loading.Description.Type;
8import com.fs.starfarer.api.ui.Alignment;
9import com.fs.starfarer.api.ui.TooltipMakerAPI;
10
12
13 @Override
14 public String getTerrainName() {
15 return "Event Horizon";
16 }
17
18 @Override
19 public void createTooltip(TooltipMakerAPI tooltip, boolean expanded) {
20 float pad = 10f;
21 float small = 5f;
22 tooltip.addTitle("Event Horizon");
23 float nextPad = pad;
24
25 tooltip.addPara(Global.getSettings().getDescription(getTerrainId(), Type.TERRAIN).getText1(), pad);
26
27 if (expanded) {
28 tooltip.addSectionHeading("Travel", Alignment.MID, pad);
29 nextPad = small;
30 }
31 tooltip.addPara("Reduces the combat readiness of " +
32 "all ships near the event horizon at a steady pace.", nextPad);
33 tooltip.addPara("The drive field is also distrupted, making getting away from the event horizon more difficult.", pad);
34
35 if (expanded) {
36 tooltip.addSectionHeading("Combat", Alignment.MID, pad);
37 tooltip.addPara("Reduces the peak performance time of ships and increases the rate of combat readiness degradation in protracted engagements.", small);
38 }
39 }
40
41 @Override
42 public void render(CampaignEngineLayers layer, ViewportAPI viewport) {
43 float alpha = viewport.getAlphaMult();
44 viewport.setAlphaMult(alpha * 0.33f);
45 super.render(layer, viewport);
46 viewport.setAlphaMult(alpha);
47 }
48
49
50 public boolean hasAIFlag(Object flag) {
51 return super.hasAIFlag(flag) || flag == TerrainAIFlags.AVOID_VERY_CAREFULLY;
52 }
53
54
55
56}
static SettingsAPI getSettings()
Definition Global.java:51
void createTooltip(TooltipMakerAPI tooltip, boolean expanded)
void render(CampaignEngineLayers layer, ViewportAPI viewport)
Description getDescription(String id, Type type)