MagicAchievement

open class MagicAchievement

The base class for all achievements. Extend this class to create your own.

First, create an entry in your data/config/magic_achievements.csv file. Set the script column to this class's package and name.

This class is not serialized to the save file.

Author

Wisp

Constructors

Link copied to clipboard
constructor()
Do not use this constructor.

Types

Link copied to clipboard
open class VisualEffectData

Functions

Link copied to clipboard
open fun advanceAfterInterval(amount: Float)
Like regular advance, but NOT CALLED EVERY FRAME.
Link copied to clipboard
open fun advanceInCombat(amount: Float, events: List<InputEventAPI>, isSimulation: Boolean)
Called every frame during combat.
Link copied to clipboard
open fun afterGameSave()
Called each time the game is loaded.
Link copied to clipboard
open fun beforeGameSave()
Called each time the game is saved.
Link copied to clipboard
open fun completeAchievement(completedByPlayer: PersonAPI)
open fun completeAchievement(completedByPlayer: PersonAPI, textPanel: TextPanelAPI)
Call when the achievement is completed.
Link copied to clipboard
open fun createTooltip(tooltipMakerAPI: TooltipMakerAPI, isExpanded: Boolean, width: Float)
Allows full control of the tooltip.
Link copied to clipboard
open fun createTooltipHeader(tooltipMakerAPI: TooltipMakerAPI)
Link copied to clipboard
A map for storing arbitrary data.
Link copied to clipboard
open fun getAdvanceIntervalUtil(): IntervalUtil
Returns the time interval in seconds between each call to advanceAfterInterval.
Link copied to clipboard
Link copied to clipboard
Whether or not to show a progress bar for this achievement.
Link copied to clipboard
open fun getImage(): String
Link copied to clipboard
open fun getModId(): String
Link copied to clipboard
open fun getModName(): String
Link copied to clipboard
open fun getName(): String
Link copied to clipboard
Link copied to clipboard
open fun getScript(): String
Link copied to clipboard
Defined in sounds.json.
Link copied to clipboard
open fun getSpecId(): String
Link copied to clipboard
Link copied to clipboard
open fun getTooltip(): String
Link copied to clipboard
Returns the color of the particle effect for this achievement's rarity.
Link copied to clipboard
open fun hasTooltip(): Boolean
Link copied to clipboard
open fun isComplete(): Boolean
Link copied to clipboard
open fun loadFromJsonObject(jsonObject: JSONObject): Boolean
Sets this achievement's data from the given JSON object.
Link copied to clipboard
open fun onApplicationLoaded(isComplete: Boolean)
Called when Starsector is loaded.
Link copied to clipboard
open fun onCompleted(completedByPlayer: PersonAPI)
Link copied to clipboard
open fun onDestroyed()
Do any cleanup logic here, e.g.
Link copied to clipboard
open fun onSaveGameLoaded(isComplete: Boolean)
Called each time the achievement is loaded, for example when the game is loaded.
Link copied to clipboard
open fun saveChanges()
Call this to save any changes to the achievement (and all others as well).
Link copied to clipboard
open fun setAdvanceIntervalUtil(interval: IntervalUtil)
Sets the time interval between each call to advanceAfterInterval.
Link copied to clipboard
open fun setDescription(description: String)
Link copied to clipboard
open fun setHasProgressBar(hasProgressBar: Boolean)
Link copied to clipboard
open fun setImage(image: String)
Link copied to clipboard
open fun setName(name: String)
Link copied to clipboard
Link copied to clipboard
open fun setScript(script: String)
Link copied to clipboard
Link copied to clipboard
open fun setTooltip(tooltip: String)
Link copied to clipboard
Whether or not to show this achievement in the Intel screen.
Link copied to clipboard
open fun toJsonObject(): JSONObject
Serializes this achievement to a JSON object.
Link copied to clipboard
open fun uncompleteAchievement(clearMemory: Boolean)
Don't use this except for very good reasons, e.g.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Shown if set.
Link copied to clipboard
open var maxProgress: Float
Link copied to clipboard
Link copied to clipboard
open var progress: Float