Class CoreLifecyclePluginImpl
java.lang.Object
com.fs.starfarer.api.BaseModPlugin
com.fs.starfarer.api.impl.campaign.CoreLifecyclePluginImpl
- All Implemented Interfaces:
ModPlugin
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<SectorEntityToken,
LocationAPI> protected Map<SectorEntityToken,
LocationAPI> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
addJunk()
static void
static void
static void
addRuinsJunk
(SectorEntityToken planet) protected void
static void
addSkillsAndAssignAdmin
(MarketAPI market, PersonAPI admin) void
Called after a game is saved.protected void
void
Called before a game is saved.void
configureXStream
(com.thoughtworks.xstream.XStream x) void
convertPersonSkillsTo0951a
(PersonAPI person) void
convertSkill
(String from, String to, PersonAPI person) void
static void
createInitialPeople
(MarketAPI market, Random random) static void
dedupePortraits
(List<PersonAPI> people) static void
protected void
static int
getPortraitCount
(List<PersonAPI> people, PersonAPI person) static boolean
hasDuplicatePortraits
(List<PersonAPI> people) void
void
onGameLoad
(boolean newGame) Called after a game has been loaded.void
Called if saving the game failed for some reason, such as running out of memory.void
Called when a new game is being created.void
Called after the economy is loaded from economy.json and the initial steps are taken.void
After the new game has stepped through its initial 2 months.pickShipAI
(FleetMemberAPI member, ShipAPI ship) Called to pick an AI implementation for a specific ship.protected void
static void
regenPortrait
(PersonAPI person) void
removeSkill
(String id, PersonAPI person) protected void
void
protected void
static void
static void
verifyFactionData
(FactionAPI faction) Methods inherited from class com.fs.starfarer.api.BaseModPlugin
onAboutToLinkCodexEntries, onAboutToStartGeneratingCodex, onApplicationLoad, onCodexDataGenerated, onDevModeF8Reload, onEnabled, onNewGameAfterProcGen, pickDroneAI, pickMissileAI, pickWeaponAutofireAI
-
Field Details
-
asteroidList
-
junkList
-
-
Constructor Details
-
CoreLifecyclePluginImpl
public CoreLifecyclePluginImpl()
-
-
Method Details
-
onGameLoad
public void onGameLoad(boolean newGame) Description copied from interface:ModPlugin
Called after a game has been loaded. Also called when a new game is created, after the onNewGame() plugins for all the mods have been called.- Specified by:
onGameLoad
in interfaceModPlugin
- Overrides:
onGameLoad
in classBaseModPlugin
-
addMissingPeople
public static void addMissingPeople() -
verifyFactionData
public static void verifyFactionData() -
verifyFactionData
-
addScriptsIfNeeded
protected void addScriptsIfNeeded() -
addBarEvents
protected void addBarEvents() -
onNewGame
public void onNewGame()Description copied from interface:ModPlugin
Called when a new game is being created. This is the preferred way to generate the contents of the Sector, and is meant to replace generators.csv (which remains used for backwards compatibility).- Specified by:
onNewGame
in interfaceModPlugin
- Overrides:
onNewGame
in classBaseModPlugin
-
onNewGameAfterTimePass
public void onNewGameAfterTimePass()Description copied from interface:ModPlugin
After the new game has stepped through its initial 2 months.- Specified by:
onNewGameAfterTimePass
in interfaceModPlugin
- Overrides:
onNewGameAfterTimePass
in classBaseModPlugin
-
onNewGameAfterEconomyLoad
public void onNewGameAfterEconomyLoad()Description copied from interface:ModPlugin
Called after the economy is loaded from economy.json and the initial steps are taken. At this point, calling get getMarket() on entities will return the proper market. The sequence of calls is: onNewGame(); // can add markets to the economy here programmatically //load economy and step it onNewGameAfterEconomyLoad();- Specified by:
onNewGameAfterEconomyLoad
in interfaceModPlugin
- Overrides:
onNewGameAfterEconomyLoad
in classBaseModPlugin
-
markStoryCriticalMarketsEtc
public void markStoryCriticalMarketsEtc() -
tagLuddicShrines
public void tagLuddicShrines() -
updateKnownPlanets
protected void updateKnownPlanets() -
addJunk
-
addRuinsJunk
-
addJunk
protected void addJunk() -
regenAsteroids
protected void regenAsteroids() -
beforeGameSave
public void beforeGameSave()Description copied from interface:ModPlugin
Called before a game is saved.- Specified by:
beforeGameSave
in interfaceModPlugin
- Overrides:
beforeGameSave
in classBaseModPlugin
-
econPreSaveCleanup
protected void econPreSaveCleanup() -
econPostSaveRestore
public static void econPostSaveRestore() -
afterGameSave
public void afterGameSave()Description copied from interface:ModPlugin
Called after a game is saved.- Specified by:
afterGameSave
in interfaceModPlugin
- Overrides:
afterGameSave
in classBaseModPlugin
-
onGameSaveFailed
public void onGameSaveFailed()Description copied from interface:ModPlugin
Called if saving the game failed for some reason, such as running out of memory.- Specified by:
onGameSaveFailed
in interfaceModPlugin
- Overrides:
onGameSaveFailed
in classBaseModPlugin
-
restoreRemovedEntities
protected void restoreRemovedEntities() -
createInitialPeople
-
dedupePortraits
-
regenPortrait
-
getPortraitCount
-
hasDuplicatePortraits
-
assignCustomAdmins
protected void assignCustomAdmins() -
addSkillsAndAssignAdmin
-
configureXStream
public void configureXStream(com.thoughtworks.xstream.XStream x) - Specified by:
configureXStream
in interfaceModPlugin
- Overrides:
configureXStream
in classBaseModPlugin
-
pickShipAI
Description copied from interface:ModPlugin
Called to pick an AI implementation for a specific ship. Here instead of in CampaignPlugin to support custom AI for missions.- Specified by:
pickShipAI
in interfaceModPlugin
- Overrides:
pickShipAI
in classBaseModPlugin
- Parameters:
member
- Can be null.ship
- Can not be null. Could be a ship or a fighter.- Returns:
- null, or a custom AI implementation.
-
convertTo0951aSkillSystemIfNeeded
public void convertTo0951aSkillSystemIfNeeded() -
convertPersonSkillsTo0951a
-
removeSkill
-
convertSkill
-