Starsector API
Loading...
Searching...
No Matches
NeuralLink.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.campaign.skills;
2
3import java.awt.Color;
4
5import com.fs.starfarer.api.Global;
6import com.fs.starfarer.api.characters.CharacterStatsSkillEffect;
7import com.fs.starfarer.api.characters.DescriptionSkillEffect;
8import com.fs.starfarer.api.characters.MutableCharacterStatsAPI;
9import com.fs.starfarer.api.characters.SkillSpecAPI;
10import com.fs.starfarer.api.impl.campaign.ids.Stats;
11import com.fs.starfarer.api.ui.TooltipMakerAPI;
12import com.fs.starfarer.api.util.Misc;
13
14public class NeuralLink {
15
16 public static class Level0 implements DescriptionSkillEffect {
17 public String getString() {
20 return "\n*Use the \"" + desc + "\" control [" + control + "] to switch between ships.";
21 }
22 public Color[] getHighlightColors() {
23 Color h = Misc.getHighlightColor();
24 h = Misc.getDarkHighlightColor();
25 return new Color[] {h};
26 }
27 public String[] getHighlights() {
30 return new String [] {control};
31 }
32 public Color getTextColor() {
33 return null;
34 }
35 }
36
37
38 public static class Level1 extends BaseSkillEffectDescription implements CharacterStatsSkillEffect {
39
40 public void apply(MutableCharacterStatsAPI stats, String id, float level) {
41 if (stats.isPlayerStats()) {
42 stats.getDynamic().getMod(Stats.HAS_NEURAL_LINK).modifyFlat(id, 1f);
43 }
44 }
45
46 public void unapply(MutableCharacterStatsAPI stats, String id) {
47 if (stats.isPlayerStats()) {
48 stats.getDynamic().getMod(Stats.HAS_NEURAL_LINK).unmodifyFlat(id);
49 }
50 }
51
52 public void createCustomDescription(MutableCharacterStatsAPI stats, SkillSpecAPI skill,
53 TooltipMakerAPI info, float width) {
54 init(stats, skill);
55 String dp = "" + (int)NeuralLinkScript.INSTANT_TRANSFER_DP;
56
57// HullModSpecAPI modSpec = Global.getSettings().getHullModSpec(HullMods.NEURAL_INTERFACE);
58// HullModEffect e = modSpec.getEffect();
59// HullSize size = HullSize.CAPITAL_SHIP;
60// final String [] params = new String [] {
61// e.getDescriptionParam(0, size, null),
62// e.getDescriptionParam(1, size, null),
63// e.getDescriptionParam(2, size, null),
64// e.getDescriptionParam(3, size, null),
65// e.getDescriptionParam(4, size, null),
66// e.getDescriptionParam(5, size, null),
67// e.getDescriptionParam(6, size, null),
68// e.getDescriptionParam(7, size, null),
69// e.getDescriptionParam(8, size, null),
70// e.getDescriptionParam(9, size, null)
71// };
72// info.addPara(modSpec.getDescription(size).replaceAll("\\%", "%%"), 0f, hc, hc, params);
73
74// info.addPara("Allows two ships to benefit from your combat skills at the same time and enables rapid switching between them. If the combined deployment cost "
75// + "is " + dp + " points or below, the neural transfer is instant, otherwise it takes "
76// + "a few seconds.", hc, 0f);
77// info.addPara("Certain skill effects that apply at the start of combat or earlier - such as increasing ammo capacity or combat readiness - "
78// + "only apply to the flagship.", hc, 5f);
79
80
81 info.addPara("Allows two ships to benefit from your combat skills at the same time "
82 + "and enables rapid switching between them.", hc, 0f);
83 info.addPara("The destination ship "
84 + "must not be under the command of an officer or an AI core.", hc, 5f);
85// info.addPara("Certain skill effects that apply at the start of combat or earlier - such as increasing ammo capacity or combat readiness - "
86// + "only apply to the flagship.", hc, 5f);
87 //info.addSpacer(5f);
88 }
89
90 public String getEffectPerLevelDescription() {
91 return null;
92 }
93
94 public ScopeDescription getScopeDescription() {
95 return ScopeDescription.FLEET;
96 }
97 }
98
99}
100
101
102
103
104
static SettingsAPI getSettings()
Definition Global.java:51
void init(MutableCharacterStatsAPI stats, SkillSpecAPI skill)
String getControlDescriptionForEnumName(String name)
String getControlStringForEnumName(String name)