Skip to content

Commit

Permalink
Run Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
frakern committed May 24, 2023
1 parent 6e6bef9 commit bef2fa7
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 38 deletions.
19 changes: 9 additions & 10 deletions src/starpocalypse/StarpocalypseMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ public void afterGameSave() {
if (ConfigHelper.isUninstall()) {
SharedData.getData().getPlayerActivityTracker().advance(0);
showUninstalledDialog();
}
else {
} else {
salvageMultiplier();
}
}
Expand Down Expand Up @@ -95,9 +94,7 @@ private void addDmodsToStartingFleet() {
private void addGroundDefenses(MarketListener listener) {
if (settings.optBoolean("addGroundDefenses", true)) {
log.info("Enabling ground defenses adder");
listener.add(
new GroundDefenseAdder(settings.optInt("sizeHeavyBatteries", 5))
);
listener.add(new GroundDefenseAdder(settings.optInt("sizeHeavyBatteries", 5)));
}
}

Expand All @@ -119,11 +116,13 @@ private void addPatrolHqs(MarketListener listener) {
private void addStations(MarketListener listener) {
if (settings.optBoolean("addStations", true)) {
log.info("Enabling station adder");
listener.add(new StationAdder(
settings.optInt("sizeForOrbitalStation", 5),
settings.optInt("sizeForBattleStation", 6),
settings.optInt("sizeForStarFortress", 7)
));
listener.add(
new StationAdder(
settings.optInt("sizeForOrbitalStation", 5),
settings.optInt("sizeForBattleStation", 6),
settings.optInt("sizeForStarFortress", 7)
)
);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/starpocalypse/market/GroundDefenseAdder.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class GroundDefenseAdder extends MarketChanger {

public GroundDefenseAdder(int sizeHeavyBatteries) {
this.sizeHeavyBatteries = sizeHeavyBatteries;
this.blockingIndustries = new String[] {Industries.GROUNDDEFENSES, Industries.HEAVYBATTERIES};
this.blockingIndustries = new String[] { Industries.GROUNDDEFENSES, Industries.HEAVYBATTERIES };
}

@Override
Expand Down
3 changes: 1 addition & 2 deletions src/starpocalypse/market/MarketHelper.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package starpocalypse.market;

import com.fs.starfarer.api.campaign.econ.MarketAPI;
import lombok.extern.log4j.Log4j;

import java.util.Objects;
import lombok.extern.log4j.Log4j;

@Log4j
public class MarketHelper {
Expand Down
8 changes: 3 additions & 5 deletions src/starpocalypse/market/StationAdder.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ protected boolean canChange(MarketAPI market) {
protected void changeImpl(MarketAPI market) {
String factionId = market.getFactionId();
String stationType = factionStations.get(factionId);
switch(stationType) {
switch (stationType) {
case "high":
stationType = "_high";
break;
Expand All @@ -53,11 +53,9 @@ protected void changeImpl(MarketAPI market) {
}
if (market.getSize() >= this.sizeForStarFortress) {
helper.addMissing(market, "starfortress" + stationType, false, stationDatabase.getAll());
}
else if (market.getSize() >= this.sizeForBattleStation) {
} else if (market.getSize() >= this.sizeForBattleStation) {
helper.addMissing(market, "battlestation" + stationType, false, stationDatabase.getAll());
}
else if (market.getSize() >= this.sizeForOrbitalStation) {
} else if (market.getSize() >= this.sizeForOrbitalStation) {
helper.addMissing(market, "orbitalstation" + stationType, false, stationDatabase.getAll());
}
}
Expand Down
1 change: 0 additions & 1 deletion src/starpocalypse/salvage/DerelictModifyingScript.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import com.fs.starfarer.api.impl.campaign.ids.MemFlags;
import com.fs.starfarer.api.impl.campaign.ids.Tags;
import com.fs.starfarer.api.impl.campaign.rulecmd.salvage.special.ShipRecoverySpecial;

import java.util.List;

public class DerelictModifyingScript implements EveryFrameScript {
Expand Down
11 changes: 5 additions & 6 deletions src/starpocalypse/salvage/StarpocalypseCampaignPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,13 @@ public PluginPick<InteractionDialogPlugin> pickInteractionDialogPlugin(SectorEnt
if (interactionTarget instanceof CampaignFleetAPI) {
if (ConfigHelper.hasNexerelin()) {
return new PluginPick<InteractionDialogPlugin>(
new StarpocalypseNexFleetInteractionDialogPlugin(),
PickPriority.MOD_SET
new StarpocalypseNexFleetInteractionDialogPlugin(),
PickPriority.MOD_SET
);
}
else {
} else {
return new PluginPick<InteractionDialogPlugin>(
new StarpocalypseFleetInteractionDialogPlugin(),
PickPriority.MOD_SET
new StarpocalypseFleetInteractionDialogPlugin(),
PickPriority.MOD_SET
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
import com.fs.starfarer.api.campaign.CampaignFleetAPI;
import com.fs.starfarer.api.fleet.FleetMemberAPI;
import com.fs.starfarer.api.impl.campaign.FleetEncounterContext;
import starpocalypse.helper.ConfigHelper;

import java.util.LinkedList;
import java.util.List;
import starpocalypse.helper.ConfigHelper;

public class StarpocalypseFleetEncounterContext extends FleetEncounterContext {

Expand All @@ -31,7 +30,7 @@ public List<FleetMemberAPI> getRecoverableShips(
if (!ConfigHelper.isStingyRecoveriesIncludePlayerShips()) {
// Fleet snapshot before battle.
List<FleetMemberAPI> playerFleet = Global.getSector().getPlayerFleet().getFleetData().getSnapshot();
for (FleetMemberAPI ship: recoverableShips) {
for (FleetMemberAPI ship : recoverableShips) {
if (playerFleet.contains(ship)) {
playerShips.add(ship);
recoverableShips.remove(ship);
Expand All @@ -49,4 +48,4 @@ public List<FleetMemberAPI> getStoryRecoverableShips() {
int cutOff = Math.min(23, allShips.size());
return allShips.subList(0, cutOff);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
import com.fs.starfarer.api.campaign.CampaignFleetAPI;
import com.fs.starfarer.api.fleet.FleetMemberAPI;
import exerelin.campaign.battle.NexFleetEncounterContext;
import starpocalypse.helper.ConfigHelper;

import java.util.LinkedList;
import java.util.List;
import starpocalypse.helper.ConfigHelper;

public class StarpocalypseNexFleetEncounterContext extends NexFleetEncounterContext {

Expand All @@ -31,7 +30,7 @@ public List<FleetMemberAPI> getRecoverableShips(
if (!ConfigHelper.isStingyRecoveriesIncludePlayerShips()) {
// Fleet snapshot before battle.
List<FleetMemberAPI> playerFleet = Global.getSector().getPlayerFleet().getFleetData().getSnapshot();
for (FleetMemberAPI ship: recoverableShips) {
for (FleetMemberAPI ship : recoverableShips) {
if (playerFleet.contains(ship)) {
playerShips.add(ship);
recoverableShips.remove(ship);
Expand Down
15 changes: 9 additions & 6 deletions src/starpocalypse/submarket/RegulatedBlackMarket.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@
import com.fs.starfarer.api.impl.campaign.ids.HullMods;
import com.fs.starfarer.api.impl.campaign.submarkets.BlackMarketPlugin;
import com.fs.starfarer.api.ui.TooltipMakerAPI;
import java.util.Objects;
import starpocalypse.config.SimpleMap;
import starpocalypse.helper.CargoUtils;
import starpocalypse.helper.ConfigHelper;
import starpocalypse.helper.SubmarketUtils;

import java.util.Objects;

public class RegulatedBlackMarket extends BlackMarketPlugin {

private String location;
Expand Down Expand Up @@ -145,7 +144,6 @@ public void updateCargoPrePlayerInteraction() {
}
}


private String getHullName(FleetMemberAPI ship) {
ShipHullSpecAPI hullSpec = ship.getHullSpec().getBaseHull();
if (hullSpec == null) {
Expand All @@ -159,7 +157,9 @@ private boolean isAlwaysLegal(String name) {
}

private boolean isCivilian(ShipVariantAPI variant) {
return variant.hasHullMod(HullMods.CIVGRADE) || variant.getHints().contains(ShipHullSpecAPI.ShipTypeHints.CIVILIAN);
return (
variant.hasHullMod(HullMods.CIVGRADE) || variant.getHints().contains(ShipHullSpecAPI.ShipTypeHints.CIVILIAN)
);
}

private boolean isSignificant(String commodityId) {
Expand Down Expand Up @@ -222,7 +222,11 @@ private void removeItems(CargoAPI cargo) {
private void removeShips(FleetDataAPI ships) {
for (FleetMemberAPI member : ships.getMembersListCopy()) {
if (isIllegalOnSubmarket(member, TransferAction.PLAYER_BUY)) {
log.info(location + ": Removing from black market due to high stability " + member.getHullSpec().getHullName());
log.info(
location +
": Removing from black market due to high stability " +
member.getHullSpec().getHullName()
);
ships.removeFleetMember(member);
}
}
Expand All @@ -232,5 +236,4 @@ private void removeShips(FleetDataAPI ships) {
public String getTariffTextOverride() {
return "Bribes";
}

}

0 comments on commit bef2fa7

Please sign in to comment.