001package com.fs.starfarer.api.impl.campaign.skills; 002 003import java.awt.Color; 004 005import com.fs.starfarer.api.Global; 006import com.fs.starfarer.api.characters.CharacterStatsSkillEffect; 007import com.fs.starfarer.api.characters.DescriptionSkillEffect; 008import com.fs.starfarer.api.characters.MutableCharacterStatsAPI; 009import com.fs.starfarer.api.characters.SkillSpecAPI; 010import com.fs.starfarer.api.impl.campaign.ids.Stats; 011import com.fs.starfarer.api.ui.TooltipMakerAPI; 012import com.fs.starfarer.api.util.Misc; 013 014public class NeuralLink { 015 016 public static class Level0 implements DescriptionSkillEffect { 017 public String getString() { 018 String control = Global.getSettings().getControlStringForEnumName(NeuralLinkScript.TRANSFER_CONTROL); 019 String desc = Global.getSettings().getControlDescriptionForEnumName(NeuralLinkScript.TRANSFER_CONTROL); 020 return "\n*Use the \"" + desc + "\" control [" + control + "] to switch between ships."; 021 } 022 public Color[] getHighlightColors() { 023 Color h = Misc.getHighlightColor(); 024 h = Misc.getDarkHighlightColor(); 025 return new Color[] {h}; 026 } 027 public String[] getHighlights() { 028 String control = Global.getSettings().getControlStringForEnumName(NeuralLinkScript.TRANSFER_CONTROL); 029 String desc = Global.getSettings().getControlDescriptionForEnumName(NeuralLinkScript.TRANSFER_CONTROL); 030 return new String [] {control}; 031 } 032 public Color getTextColor() { 033 return null; 034 } 035 } 036 037 038 public static class Level1 extends BaseSkillEffectDescription implements CharacterStatsSkillEffect { 039 040 public void apply(MutableCharacterStatsAPI stats, String id, float level) { 041 if (stats.isPlayerStats()) { 042 stats.getDynamic().getMod(Stats.HAS_NEURAL_LINK).modifyFlat(id, 1f); 043 } 044 } 045 046 public void unapply(MutableCharacterStatsAPI stats, String id) { 047 if (stats.isPlayerStats()) { 048 stats.getDynamic().getMod(Stats.HAS_NEURAL_LINK).unmodifyFlat(id); 049 } 050 } 051 052 public void createCustomDescription(MutableCharacterStatsAPI stats, SkillSpecAPI skill, 053 TooltipMakerAPI info, float width) { 054 init(stats, skill); 055 String dp = "" + (int)NeuralLinkScript.INSTANT_TRANSFER_DP; 056 057// HullModSpecAPI modSpec = Global.getSettings().getHullModSpec(HullMods.NEURAL_INTERFACE); 058// HullModEffect e = modSpec.getEffect(); 059// HullSize size = HullSize.CAPITAL_SHIP; 060// final String [] params = new String [] { 061// e.getDescriptionParam(0, size, null), 062// e.getDescriptionParam(1, size, null), 063// e.getDescriptionParam(2, size, null), 064// e.getDescriptionParam(3, size, null), 065// e.getDescriptionParam(4, size, null), 066// e.getDescriptionParam(5, size, null), 067// e.getDescriptionParam(6, size, null), 068// e.getDescriptionParam(7, size, null), 069// e.getDescriptionParam(8, size, null), 070// e.getDescriptionParam(9, size, null) 071// }; 072// info.addPara(modSpec.getDescription(size).replaceAll("\\%", "%%"), 0f, hc, hc, params); 073 074// 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 " 075// + "is " + dp + " points or below, the neural transfer is instant, otherwise it takes " 076// + "a few seconds.", hc, 0f); 077// info.addPara("Certain skill effects that apply at the start of combat or earlier - such as increasing ammo capacity or combat readiness - " 078// + "only apply to the flagship.", hc, 5f); 079 080 081 info.addPara("Allows two ships to benefit from your combat skills at the same time " 082 + "and enables rapid switching between them.", hc, 0f); 083 info.addPara("The destination ship " 084 + "must not be under the command of an officer or an AI core.", hc, 5f); 085// info.addPara("Certain skill effects that apply at the start of combat or earlier - such as increasing ammo capacity or combat readiness - " 086// + "only apply to the flagship.", hc, 5f); 087 //info.addSpacer(5f); 088 } 089 090 public String getEffectPerLevelDescription() { 091 return null; 092 } 093 094 public ScopeDescription getScopeDescription() { 095 return ScopeDescription.FLEET; 096 } 097 } 098 099} 100 101 102 103 104