Skip to content

Commit 98b3a1f

Browse files
committed
Added List bases to show all pirate and pather bases
1 parent 092cae6 commit 98b3a1f

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

src/main/java/org/lazywizard/console/BaseCommand.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.fs.starfarer.api.campaign.SectorEntityToken;
66
import com.fs.starfarer.api.campaign.econ.MarketAPI;
77
import com.fs.starfarer.api.combat.CombatEngineAPI;
8+
import org.jetbrains.annotations.NotNull;
89
import org.jetbrains.annotations.Nullable;
910

1011
/**
@@ -196,5 +197,6 @@ public MarketAPI getMarket()
196197
*
197198
* @since 2.0
198199
*/
200+
CommandResult runCommand(@NotNull String args, @NotNull CommandContext context);
199201
CommandResult runCommand(String args, CommandContext context);
200202
}

src/main/java/org/lazywizard/console/commands/List_.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@
44
import com.fs.starfarer.api.ModSpecAPI;
55
import com.fs.starfarer.api.SettingsAPI;
66
import com.fs.starfarer.api.campaign.*;
7+
import com.fs.starfarer.api.campaign.comm.IntelInfoPlugin;
78
import com.fs.starfarer.api.campaign.econ.MarketAPI;
89
import com.fs.starfarer.api.characters.OfficerDataAPI;
910
import com.fs.starfarer.api.characters.PersonAPI;
1011
import com.fs.starfarer.api.impl.campaign.ids.Tags;
12+
import com.fs.starfarer.api.impl.campaign.intel.bases.LuddicPathBaseIntel;
13+
import com.fs.starfarer.api.impl.campaign.intel.bases.PirateBaseIntel;
1114
import com.fs.starfarer.api.loading.IndustrySpecAPI;
1215
import com.fs.starfarer.api.util.Misc;
1316
import com.fs.starfarer.api.util.Pair;
@@ -258,6 +261,32 @@ public CommandResult runCommand(String args, CommandContext context)
258261
ids.add(faction.getId() + " (" + faction.getDisplayNameLong() + ")");
259262
}
260263
break;
264+
case "bases":
265+
newLinePerItem = true;
266+
ids = new ArrayList<>();
267+
for (IntelInfoPlugin tmpIntel : sector.getIntelManager().getIntel(PirateBaseIntel.class))
268+
{
269+
final PirateBaseIntel intel = (PirateBaseIntel) tmpIntel;
270+
ids.add("Pirate Base:\n - Intel: " + intel.getSmallDescriptionTitle() +
271+
"\n - Location: " + intel.getMarket().getName() + " in the " +
272+
intel.getSystem().getName() + "\n - Target: " + intel.getTarget().getName());
273+
}
274+
for (IntelInfoPlugin tmpIntel : sector.getIntelManager().getIntel(LuddicPathBaseIntel.class))
275+
{
276+
final LuddicPathBaseIntel intel = (LuddicPathBaseIntel) tmpIntel;
277+
ids.add("Luddic Path Base:\n - Intel: " + intel.getSmallDescriptionTitle() +
278+
"\n - Location: " + intel.getMarket().getName() + " in the " +
279+
intel.getSystem().getName());
280+
}
281+
/*for (IntelInfoPlugin tmpIntel : sector.getIntelManager().getIntel(PirateActivityIntel.class))
282+
{
283+
final PirateActivityIntel intel = (PirateActivityIntel) tmpIntel;
284+
ids.add(intel.getSmallDescriptionTitle() +
285+
"\n - Source: " + intel.getSource().getMarket().getName() +
286+
"\n - Location: " + intel.getSource().getName() +
287+
"\n - Target: " + intel.getSystem().getName());
288+
}*/
289+
break;
261290
case "planets":
262291
newLinePerItem = true;
263292
param = "planets in current system";

src/main/mod/data/console/commands.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ InfiniteFlux,org.lazywizard.console.commands.InfiniteFlux,"core,combat",infinite
5656
InfiniteSupplies,org.lazywizard.console.commands.InfiniteSupplies,"core,campaign",infinitesupplies (no arguments),"Toggles infinite supplies for your fleet. Buying/selling and quest rewards still function normally."
5757
Jump,org.lazywizard.console.commands.Jump,"core,campaign",jump <system>,"Teleports your fleet to the specified system. You will be brought to that system's star (if it has one). If you want to travel to a specific token you should chain 'goto' after this command. The argument 'home' will function identically to the 'home' command."
5858
Kill,org.lazywizard.console.commands.Kill,"core,campaign,combat",kill (no arguments),"Kills the target of the currently piloted ship. If used in the campaign, enters a mode where any fleet you click on is instantly destroyed (press escape to cancel). Kills in campaign mode are not credited to the player."
59-
List,org.lazywizard.console.commands.List_,"core,campaign",list ships|variants|wings|weapons|items|specials|factions|systems|planets|stations|markets|conditions|industries|officers|aliases|commands|mods [optionalStartsWithFilter],"Lists all internal IDs of a specific category for use with this mod's commands. Results can be further refined by adding a second argument to restrict results to IDs that start with the entered filter.\nValid categories: ships, variants, wings, weapons, items, specials, factions, systems, planets, stations, markets, conditions, industries, officers, aliases, commands, mods"
59+
List,org.lazywizard.console.commands.List_,"core,campaign",list ships|variants|wings|weapons|items|specials|factions|bases|systems|planets|stations|markets|conditions|industries|officers|aliases|commands|mods [optionalStartsWithFilter],"Lists all internal IDs of a specific category for use with this mod's commands. Results can be further refined by adding a second argument to restrict results to IDs that start with the entered filter.\nValid categories: ships, variants, wings, weapons, items, specials, factions, bases, systems, planets, stations, markets, conditions, industries, officers, aliases, commands, mods"
6060
ModInfo,org.lazywizard.console.commands.ModInfo,"core,console",modinfo <modId>,"Shows information about a mod, such as what you'd find in its mod_info.json, whether it is enabled or not, and what ships, wings and weapons it adds."
6161
NoCooldown,org.lazywizard.console.commands.NoCooldown,"core,combat",nocooldown [optionalTarget],"Toggles ship system and weapon cooldowns. Valid arguments are PLAYER, FLEET, ENEMY, ALL. Target defaults to PLAYER if no argument is entered."
6262
Nuke,org.lazywizard.console.commands.Nuke,"core,combat",nuke (no arguments),"Destroys all enemies on the battle map. All kills will be credited to the player."

0 commit comments

Comments
 (0)