public class CoreLifecyclePluginImpl extends BaseModPlugin
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<SectorEntityToken,LocationAPI> |
asteroidList |
protected java.util.Map<SectorEntityToken,LocationAPI> |
junkList |
| Constructor and Description |
|---|
CoreLifecyclePluginImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addBarEvents() |
protected void |
addJunk() |
static void |
addJunk(MarketAPI market) |
static void |
addMissingPeople() |
static void |
addRuinsJunk(SectorEntityToken planet) |
protected void |
addScriptsIfNeeded() |
static void |
addSkillsAndAssignAdmin(MarketAPI market,
PersonAPI admin) |
void |
afterGameSave()
Called after a game is saved.
|
protected void |
assignCustomAdmins() |
void |
beforeGameSave()
Called before a game is saved.
|
void |
configureXStream(com.thoughtworks.xstream.XStream x) |
void |
convertPersonSkillsTo0951a(PersonAPI person) |
void |
convertSkill(java.lang.String from,
java.lang.String to,
PersonAPI person) |
void |
convertTo0951aSkillSystemIfNeeded() |
static void |
createInitialPeople(MarketAPI market,
java.util.Random random) |
static void |
dedupePortraits(java.util.List<PersonAPI> people) |
static void |
econPostSaveRestore() |
protected void |
econPreSaveCleanup() |
static int |
getPortraitCount(java.util.List<PersonAPI> people,
PersonAPI person) |
static boolean |
hasDuplicatePortraits(java.util.List<PersonAPI> people) |
void |
markStoryCriticalMarketsEtc() |
void |
onGameLoad(boolean newGame)
Called after a game has been loaded.
|
void |
onGameSaveFailed()
Called if saving the game failed for some reason, such as running out of memory.
|
void |
onNewGame()
Called when a new game is being created.
|
void |
onNewGameAfterEconomyLoad()
Called after the economy is loaded from economy.json and the initial steps are taken.
|
void |
onNewGameAfterTimePass()
After the new game has stepped through its initial 2 months.
|
PluginPick<ShipAIPlugin> |
pickShipAI(FleetMemberAPI member,
ShipAPI ship)
Called to pick an AI implementation for a specific ship.
|
protected void |
regenAsteroids() |
static void |
regenPortrait(PersonAPI person) |
void |
removeSkill(java.lang.String id,
PersonAPI person) |
protected void |
restoreRemovedEntities() |
void |
tagLuddicShrines() |
protected void |
updateKnownPlanets() |
static void |
verifyFactionData() |
static void |
verifyFactionData(FactionAPI faction) |
onAboutToLinkCodexEntries, onAboutToStartGeneratingCodex, onApplicationLoad, onCodexDataGenerated, onDevModeF8Reload, onEnabled, onNewGameAfterProcGen, pickDroneAI, pickMissileAI, pickWeaponAutofireAIprotected java.util.Map<SectorEntityToken,LocationAPI> asteroidList
protected java.util.Map<SectorEntityToken,LocationAPI> junkList
public CoreLifecyclePluginImpl()
public void onGameLoad(boolean newGame)
BaseModPluginIn here, you should do all kinds of initialization logic, such as adding transient scripts, registering campaign plugins, adding custom sensor ghosts etc.
onGameLoad in interface ModPluginonGameLoad in class BaseModPluginnewGame - if true, a new campaign has just been started. Sector generation logic should only
be executed if this is true.public static void addMissingPeople()
public static void verifyFactionData()
public static void verifyFactionData(FactionAPI faction)
protected void addScriptsIfNeeded()
protected void addBarEvents()
public void onNewGame()
BaseModPluginonNewGame in interface ModPluginonNewGame in class BaseModPluginpublic void onNewGameAfterTimePass()
BaseModPluginonNewGameAfterTimePass in interface ModPluginonNewGameAfterTimePass in class BaseModPluginpublic void onNewGameAfterEconomyLoad()
BaseModPluginonNewGameAfterEconomyLoad in interface ModPluginonNewGameAfterEconomyLoad in class BaseModPluginpublic void markStoryCriticalMarketsEtc()
public void tagLuddicShrines()
protected void updateKnownPlanets()
public static void addRuinsJunk(SectorEntityToken planet)
protected void addJunk()
protected void regenAsteroids()
public void beforeGameSave()
BaseModPluginExample:
while (Global.getSector().getListenerManager().hasListenerOfClass(MyListener.class)){
Global.getSector().getListenerManager().removeListenerOfClass(MyListener.class);
}
beforeGameSave in interface ModPluginbeforeGameSave in class BaseModPluginprotected void econPreSaveCleanup()
public static void econPostSaveRestore()
public void afterGameSave()
BaseModPluginExample:
Global.getSector().getListenerManager().addListener(new MyListener());
afterGameSave in interface ModPluginafterGameSave in class BaseModPluginpublic void onGameSaveFailed()
BaseModPluginonGameSaveFailed in interface ModPluginonGameSaveFailed in class BaseModPluginprotected void restoreRemovedEntities()
public static void createInitialPeople(MarketAPI market, java.util.Random random)
public static void dedupePortraits(java.util.List<PersonAPI> people)
public static void regenPortrait(PersonAPI person)
public static int getPortraitCount(java.util.List<PersonAPI> people, PersonAPI person)
public static boolean hasDuplicatePortraits(java.util.List<PersonAPI> people)
protected void assignCustomAdmins()
public static void addSkillsAndAssignAdmin(MarketAPI market, PersonAPI admin)
public void configureXStream(com.thoughtworks.xstream.XStream x)
configureXStream in interface ModPluginconfigureXStream in class BaseModPluginpublic PluginPick<ShipAIPlugin> pickShipAI(FleetMemberAPI member, ShipAPI ship)
BaseModPluginExample:
if(ship.getVariant().getHullVariantId().equals("myVariantId")){
return new PluginPick(new MyAi(), CampaignPlugin.PickPriority.MOD_GENERAL)
}
return null;
pickShipAI in interface ModPluginpickShipAI in class BaseModPluginmember - fleetMemeber of the ship in question. Can be used to inform your decision if/which AI to chooseship - the ship in questionpublic void convertTo0951aSkillSystemIfNeeded()
public void convertPersonSkillsTo0951a(PersonAPI person)
public void removeSkill(java.lang.String id, PersonAPI person)
public void convertSkill(java.lang.String from, java.lang.String to, PersonAPI person)