55 stats.getDynamic().getMod(Stats.HRS_SENSOR_RANGE_MOD).modifyFlat(
id, (Float) mag.get(hullSize));
57 boolean sMod = isSMod(stats);
59 float mag = ((Float) combatMag.get(hullSize)).intValue();
60 stats.getSightRadiusMod().modifyFlat(
id, mag);
65 if (index == 0)
return "" + ((Float) combatMag.get(HullSize.FRIGATE)).intValue();
66 if (index == 1)
return "" + ((Float) combatMag.get(HullSize.DESTROYER)).intValue();
67 if (index == 2)
return "" + ((Float) combatMag.get(HullSize.CRUISER)).intValue();
68 if (index == 3)
return "" + ((Float) combatMag.get(HullSize.CAPITAL_SHIP)).intValue();
91 float modifier = getAdjustedHRSModifier(fleet,
null, 0f);
93 fleet.getSensorRangeMod().unmodifyFlat(MOD_KEY);
95 fleet.getSensorRangeMod().modifyFlat(MOD_KEY, modifier,
"Ships with high resolution sensors");
108 Color h = Misc.getHighlightColor();
109 Color bad = Misc.getNegativeHighlightColor();
111 tooltip.addPara(
"A ship with high resolution sensors increases the fleet's sensor range by %s/%s/%s/%s," +
112 " depending on hull size. " +
113 "Each additional ship with high resolution sensors provides diminishing returns. " +
114 "The higher the highest sensor range increase from a single ship in the fleet, the later diminishing returns kick in.",
116 "" + ((Float) mag.get(HullSize.FRIGATE)).intValue(),
117 "" + ((Float) mag.get(HullSize.DESTROYER)).intValue(),
118 "" + ((Float) mag.get(HullSize.CRUISER)).intValue(),
119 "" + ((Float) mag.get(HullSize.CAPITAL_SHIP)).intValue()
122 if (isForModSpec || ship ==
null)
return;
126 float fleetMod = getAdjustedHRSModifier(fleet,
null, 0f);
127 float currShipMod = (Float) mag.get(hullSize);
129 float fleetModWithOneMore = getAdjustedHRSModifier(fleet,
null, currShipMod);
130 float fleetModWithoutThisShip = getAdjustedHRSModifier(fleet, ship.getFleetMemberId(), 0f);
132 tooltip.addPara(
"The total sensor strength increase for your fleet is %s.", opad, h,
133 "" + (
int)Math.round(fleetMod));
135 float cr = ship.getCurrentCR();
136 for (FleetMemberAPI member :
Global.
getSector().getPlayerFleet().getFleetData().getMembersListCopy()) {
137 if (member.getId().equals(ship.getFleetMemberId())) {
138 cr = member.getRepairTracker().getCR();
143 LabelAPI label = tooltip.addPara(
"This ship's combat readiness is below %s " +
144 "and its high resolution sensors can not be utilized. Bringing this ship into readiness " +
145 "would increase the fleetwide bonus to %s.",
147 "" + (
int) Math.round(MIN_CR * 100f) +
"%",
148 "" + (int)Math.round(fleetModWithOneMore));
149 label.setHighlightColors(bad, h);
150 label.setHighlight(
"" + (
int) Math.round(MIN_CR * 100f) +
"%",
"" + (int)Math.round(fleetModWithOneMore));
152 if (fleetMod > currShipMod) {
153 tooltip.addPara(
"Removing this ship would decrease it to %s. Adding another ship of the same type " +
154 "would increase it to %s.", opad, h,
155 "" + (
int)Math.round(fleetModWithoutThisShip),
156 "" + (int)Math.round(fleetModWithOneMore));
158 tooltip.addPara(
"Adding another ship of the same type " +
159 "would increase it to %s.", opad, h,
160 "" + (
int)Math.round(fleetModWithOneMore));
168 for (FleetMemberAPI member : fleet.getFleetData().getMembersListCopy()) {
169 if (member.isMothballed())
continue;
170 if (member.getRepairTracker().getCR() < MIN_CR)
continue;
172 if (member.getId().equals(skipId)) {
175 float v = member.getStats().getDynamic().getMod(Stats.HRS_SENSOR_RANGE_MOD).computeEffective(0f);
176 if (v <= 0)
continue;
178 if (v > max) max = v;
181 if (add > max) max = add;
184 if (max <= 0)
return 0f;
185 float units = total / max;
186 if (units <= 1)
return max;
187 float mult = Misc.logOfBase(2.5f, units) + 1f;
188 float result = total * mult / units;
192 result = Math.round(result * 100f) / 100f;
193 result = Math.max(result, 1f);