85 if (fleet ==
null)
return;
93 boolean needsSync =
false;
94 for (FleetMemberAPI member : fleet.getFleetData().getMembersListCopy()) {
96 member.getBuffManager().removeBuff(buffId);
99 Buff test = member.getBuffManager().getBuff(buffId);
100 if (test instanceof CRRecoveryBuff) {
101 CRRecoveryBuff buff = (CRRecoveryBuff) test;
102 buff.setDur(buffDur);
104 member.getBuffManager().addBuff(
new CRRecoveryBuff(buffId, 0f, buffDur));
178 CampaignFleetAPI fleet =
getFleet();
179 if (fleet ==
null)
return;
181 Color highlight = Misc.getHighlightColor();
182 Color bad = Misc.getNegativeHighlightColor();
189 String preventsRecovery =
"";
191 preventsRecovery =
" Prevents combat readiness recovery while active.";
194 String deactivateCost =
"";
196 deactivateCost =
" The cost is incurred both when activating and deactivating the ability.";
198 preventsRecovery += deactivateCost;
200 if (supplyCost > 0 && fuelCost > 0) {
201 if (prefix ==
null) {
206 tooltip.addPara(prefix +
"onsumes %s fuel and reduces the combat readiness" +
207 " of all ships, costing up to %s supplies to recover." + preventsRecovery, pad,
209 Misc.getRoundedValueMaxOneAfterDecimal(fuelCost),
210 Misc.getRoundedValueMaxOneAfterDecimal(supplyCost));
211 }
else if (supplyCost > 0) {
212 if (prefix ==
null) {
217 tooltip.addPara(prefix +
"educes the combat readiness" +
218 " of all ships, costing up to %s supplies to recover." + preventsRecovery, pad,
220 Misc.getRoundedValueMaxOneAfterDecimal(supplyCost));
221 }
else if (fuelCost > 0) {
222 if (prefix ==
null) {
227 tooltip.addPara(prefix +
"onsumes %s fuel." + preventsRecovery, pad,
229 Misc.getRoundedValueMaxOneAfterDecimal(fuelCost));
232 if (fuelCost > 0 && fuelCost > fleet.getCargo().getFuel()) {
233 tooltip.addPara(
"Not enough fuel.", bad, pad);
239 if (!nonReady.isEmpty()) {
240 tooltip.addPara(
"Some ships don't have enough combat readiness " +
241 "and may suffer damage if the ability is activated:", pad,
242 Misc.getNegativeHighlightColor(),
"may suffer damage");
246 for (FleetMemberAPI member : nonReady) {
248 if (nonReady.size() > max + 1) {
249 tooltip.addPara(BaseIntelPlugin.INDENT +
"... and several other ships", initPad);
254 if (!member.isFighterWing()) {
255 str += member.getShipName() +
", ";
256 str += member.getHullSpec().getHullNameWithDashClass();
258 str += member.getVariant().getFullDesignationWithHullName();
261 tooltip.addPara(BaseIntelPlugin.INDENT + str, initPad);