MagicSubsystem

abstract class MagicSubsystem

Constructors

Link copied to clipboard
constructor(ship: ShipAPI)

Types

Link copied to clipboard
enum State

Functions

Link copied to clipboard
open fun activate()
Handles activation of the subsystem, including setting the state, increasing flux, and taking charges.
Link copied to clipboard
open fun advance(amount: Float, isPaused: Boolean)
Runs every frame while the game is not paused.
Link copied to clipboard
open fun advanceInternal(amount: Float)
Called every frame that the combat engine is not paused.
Link copied to clipboard
open fun calcMaxCharges(): Int
Uses system stats to calculate the actual max charges based on scaleSystemStat
Link copied to clipboard
open fun calcRange(): Int
Uses system stats to calculate the actual base range based on scaleSystemStat
Link copied to clipboard
open fun canActivate(): Boolean
Returns whether the subsystem can be activated.
Link copied to clipboard
Returns whether the subsystem can be activated.
Link copied to clipboard
open fun canAssignKey(): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun drawHUDBar(viewport: ViewportAPI, rootLoc: Vector2f, barLoc: Vector2f, displayAdditionalInfo: Boolean, longestNameWidth: Float)
Draws the subsystem info on the HUD.
Link copied to clipboard
Link copied to clipboard
open fun getAmmoText(): String
This prints beneath the subsystem bar.
Link copied to clipboard
If getKey returns a non-null non-empty string, retrieves the index for its value from getKeyIndex Otherwise uses getKeyIndex to retrieve the key from the getKeyForIndex method
Link copied to clipboard
open fun getBarFill(): Float
How full the status bar will appear.
Link copied to clipboard
open fun getBarLocationForBarNum(baseBarLoc: Vector2f, barNum: Int): Vector2f
Link copied to clipboard
How long the subsystem is active for.
Link copied to clipboard
How long the subsystem takes to gain a charge.
Link copied to clipboard
How long the subsystem is in State.COOLDOWN for.
Link copied to clipboard
How long the subsystem is in State.IN for.
Link copied to clipboard
How long the subsystem is in State.OUT for.
Link copied to clipboard
open fun getBriefText(): String
A short description of what your subsystem does.
Link copied to clipboard
open fun getCharges(): Int
Link copied to clipboard
abstract fun getDisplayText(): String
This is appended to the key used to activate the subsystem.
Link copied to clipboard
open fun getEffectLevel(): Float
Calculates how "effective" the system is based on its state and the time remaining in that state.
Link copied to clipboard
Color of the text to the right of the status bar.
Link copied to clipboard
Some extra info that displays to the right of the status bar.
Link copied to clipboard
Flux cost on activation.
Link copied to clipboard
Flux cost while active.
Link copied to clipboard
Flux cost on activation as percent of base flux capacity of the ship.
Link copied to clipboard
Flux cost on activation as percent of base flux capacity of the ship.
Link copied to clipboard
open fun getHUDColor(): Color
The color to display all the info about the system in
Link copied to clipboard
open fun getKey(): String
Link copied to clipboard
open fun getKeyIndex(): Int
The automatically-assigned key index when a subsystem is added to a ship.
Link copied to clipboard
open fun getKeyText(): String
The displayed key text to activate the system.
Link copied to clipboard
open fun getNumHUDBars(): Int
Number of "bar heights" that the subsystem needs.
Link copied to clipboard
open fun getOrder(): Int
How "important" this system is.
Link copied to clipboard
Link copied to clipboard
Returns ratio of how "complete" the state is.
Link copied to clipboard
open fun getStateText(): String
Prints to the left of the status bar.
Link copied to clipboard
How much the subsystem is affected by ship system stats like Systems Expertise.
Link copied to clipboard
open fun hasCharges(): Boolean
Base amount of charges unaffected by any stats.
Link copied to clipboard
open fun isActive(): Boolean
Link copied to clipboard
open fun isCooldown(): Boolean
Link copied to clipboard
Set flux cost on activation to be hard flux.
Link copied to clipboard
Set flux cost while active to be hard flux.
Link copied to clipboard
open fun isIn(): Boolean
Link copied to clipboard
open fun isKeyDown(): Boolean
Player ship only.
Link copied to clipboard
open fun isOff(): Boolean
Link copied to clipboard
open fun isOn(): Boolean
Link copied to clipboard
open fun isOut(): Boolean
Link copied to clipboard
open fun isReady(): Boolean
Link copied to clipboard
open fun isToggle(): Boolean
Link copied to clipboard
open fun onActivate()
Runs when the key is pressed to activate the subsystem, or the AI activates it.
Link copied to clipboard
open fun onFinished()
When state is set to COOLDOWN.
Link copied to clipboard
open fun onShipDeath()
Called when the ship dies while system is active (IN, ACTIVE, OUT states)
Link copied to clipboard
Called when the state is switched to something else.
Link copied to clipboard
open fun renderWorld(viewport: ViewportAPI)
Renders onto the world viewport.
Link copied to clipboard
The subsystem will show "NO TARGET" on the HUD if no target is selected.
Link copied to clipboard
open fun setCharges(charges: Int)
Link copied to clipboard
open fun setKey(key: String)
Link copied to clipboard
open fun setKeyIndex(keyIndex: Int)
Link copied to clipboard
open fun setState(newState: MagicSubsystem.State)
Called to set the state of the system.
Link copied to clipboard
abstract fun shouldActivateAI(amount: Float): Boolean
Link copied to clipboard
The subsystem will show "NO TARGET" on the HUD if a friendly target is selected.
Link copied to clipboard

Properties

Link copied to clipboard
Link copied to clipboard
open var BLANK_KEY: String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open var inDuration: Float
Link copied to clipboard
open var outDuration: Float
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard