Magic Achievement Manager
Manages and tracks achievements.
An achievement is made from a spec, which is used to create the achievement class with the code to detect the achievement conditions.
To add an achievement, add it to the magic_achievements.csv file in your mod's data/config folder. Alternatively, call addAchievementSpecs in your mod plugin's onGameLoad() method.
Then, create a class that extends MagicAchievement and implement the detection logic. You will need to call setComplete() and then saveChanges() to complete the achievement.
Functions
Link copied to clipboard
Use this to create achievements that are not defined in magic_achievements.csv.
Link copied to clipboard
Calls all achievements' afterGameSave() method.
Link copied to clipboard
Link copied to clipboard
Calls all achievements' beforeGameSave() method.
Link copied to clipboard
Link copied to clipboard
open fun generateAchievementsFromSpec(specs: Map<String, MagicAchievementSpec>): Map<String, MagicAchievement>
Creates achievements from the given specs, creates the script instances from the class name, and returns them.
Link copied to clipboard
Link copied to clipboard
Reads achievement specs from CSV files in mods and returns them.
Link copied to clipboard
Loads achievements (so that any that track stuff outside the campaign are started).
Link copied to clipboard
(Re)loads achievements (so that any that track stuff outside the campaign are started).
Link copied to clipboard
You shouldn't need to call this.
Link copied to clipboard
Unloads all current achievements from the sector and reloads them from files.
Link copied to clipboard
Link copied to clipboard
Resets the achievement passed in to the spec.
Link copied to clipboard
Sets whether achievements are enabled or not.
Properties
Link copied to clipboard
Link copied to clipboard
Set of achievement IDs that have thrown an error in their advanceInCombat method.
Link copied to clipboard
Set of achievement IDs that have thrown an error in their advance method.
Link copied to clipboard
Loaded once at launch and not again.
Link copied to clipboard