Starsector API
|
Public Member Functions | |
void | initFleet (FleetSide side, String shipNamePrefix, FleetGoal goal, boolean useDefaultAI) |
void | initFleet (FleetSide side, String shipNamePrefix, FleetGoal goal, boolean useDefaultAI, int commandRating) |
FleetMemberAPI | addToFleet (FleetSide side, String variantId, FleetMemberType type, boolean isFlagship) |
FleetMemberAPI | addToFleet (FleetSide side, String variantId, FleetMemberType type, String shipName, boolean isFlagship) |
void | defeatOnShipLoss (String shipName) |
void | addBriefingItem (String item) |
void | setFleetTagline (FleetSide side, String tagline) |
void | initMap (float minX, float maxX, float minY, float maxY) |
void | addNebula (float x, float y, float radius) |
void | addObjective (float x, float y, String type, BattleObjectiveAPI.Importance importance) |
void | addObjective (float x, float y, String type) |
void | addPlanet (float x, float y, float radius, String type, float gravity) |
void | addPlanet (float x, float y, float radius, String type, float gravity, boolean backgroundPlanet) |
void | addPlanet (float x, float y, float radius, PlanetAPI planet, float gravity, boolean backgroundPlanet) |
void | setPlanetBgSize (float bgWidth, float bgHeight) |
void | addAsteroidField (float x, float y, float angle, float width, float minSpeed, float maxSpeed, int quantity) |
void | addRingAsteroids (float x, float y, float angle, float width, float minSpeed, float maxSpeed, int quantity) |
int | getFleetPointCost (String id) |
void | addPlugin (EveryFrameCombatPlugin plugin) |
void | setBackgroundSpriteName (String background) |
void | addFleetMember (FleetSide side, FleetMemberAPI member) |
void | setHyperspaceMode (boolean hyperspaceMode) |
void | setNebulaTex (String nebulaTex) |
void | setNebulaMapTex (String nebulaMapTex) |
void | setBackgroundGlowColor (Color backgroundGlowColor) |
void | initFleet (FleetSide side, String shipNamePrefix, FleetGoal goal, boolean useDefaultAI, int commandRating, int allyCommandRating) |
BattleCreationContext | getContext () |
PersonAPI | getDefaultCommander (FleetSide side) |
boolean | hasNebula () |
Used by the MissionDefinition.java script to create the contents of a mission.
Copyright 2012 Fractal Softworks, LLC
Definition at line 21 of file MissionDefinitionAPI.java.
void com.fs.starfarer.api.mission.MissionDefinitionAPI.addAsteroidField | ( | float | x, |
float | y, | ||
float | angle, | ||
float | width, | ||
float | minSpeed, | ||
float | maxSpeed, | ||
int | quantity | ||
) |
Add an asteroid field to the map. An asteroid field is a band of asteroids moving in a direction across the map.
x | x coordinate of any point along the middle of the belt. |
y | y coordinate of any point along the middle of the belt. |
angle | direction, with 0 being to the right and 90 being up. |
width | width of belt in pixels. |
minSpeed | minimum speed of spawned asteroids. |
maxSpeed | maximum speed of spawned asteroids. |
quantity | approximate number of asteroids to keep in play as they're destroyed/move off map. |
void com.fs.starfarer.api.mission.MissionDefinitionAPI.addBriefingItem | ( | String | item | ) |
Adds a line to the bulleted list under "Tactical Objectives" in the mission description.
item | Text, with no leading dash. |
void com.fs.starfarer.api.mission.MissionDefinitionAPI.addFleetMember | ( | FleetSide | side, |
FleetMemberAPI | member | ||
) |
void com.fs.starfarer.api.mission.MissionDefinitionAPI.addNebula | ( | float | x, |
float | y, | ||
float | radius | ||
) |
Adds a circular nebula to the map. The shape is slightly randomized.
x | |
y | |
radius | in pixels. |
void com.fs.starfarer.api.mission.MissionDefinitionAPI.addObjective | ( | float | x, |
float | y, | ||
String | type | ||
) |
Add a battlefield objective to the map.
x | |
y | |
type | one of "comm_relay", "nav_buoy", or "sensor_array". |
void com.fs.starfarer.api.mission.MissionDefinitionAPI.addObjective | ( | float | x, |
float | y, | ||
String | type, | ||
BattleObjectiveAPI.Importance | importance | ||
) |
Add a battlefield objective to the map.
x | |
y | |
type | one of "comm_relay", "nav_buoy", or "sensor_array". |
importance |
void com.fs.starfarer.api.mission.MissionDefinitionAPI.addPlanet | ( | float | x, |
float | y, | ||
float | radius, | ||
PlanetAPI | planet, | ||
float | gravity, | ||
boolean | backgroundPlanet | ||
) |
Bases the look of the planet on the PlanetAPI passed in. The look may have been altered dynamically using PlanetAPI.getSpec(), which would not be reflected by the planet's base type, as defined in planets.json.
x | |
y | |
radius | |
planet | |
gravity | |
backgroundPlanet |
void com.fs.starfarer.api.mission.MissionDefinitionAPI.addPlanet | ( | float | x, |
float | y, | ||
float | radius, | ||
String | type, | ||
float | gravity | ||
) |
Add a planet or star to the map.
x | |
y | |
radius | |
type | available types are defined in data/config/planets.json |
gravity | Equal to maximum speed boost the planet provides to nearby ships. |
void com.fs.starfarer.api.mission.MissionDefinitionAPI.addPlanet | ( | float | x, |
float | y, | ||
float | radius, | ||
String | type, | ||
float | gravity, | ||
boolean | backgroundPlanet | ||
) |
Add a planet or star to the map.
x | |
y | |
radius | |
type | available types are defined in data/config/planets.json |
gravity | Equal to maximum speed boost the planet provides to nearby ships. |
backgroundPlanet | If true, planet is in the "background" and doesn't exert gravity or move relative to the viewport. x and y are then screen coordinates. |
void com.fs.starfarer.api.mission.MissionDefinitionAPI.addPlugin | ( | EveryFrameCombatPlugin | plugin | ) |
void com.fs.starfarer.api.mission.MissionDefinitionAPI.addRingAsteroids | ( | float | x, |
float | y, | ||
float | angle, | ||
float | width, | ||
float | minSpeed, | ||
float | maxSpeed, | ||
int | quantity | ||
) |
FleetMemberAPI com.fs.starfarer.api.mission.MissionDefinitionAPI.addToFleet | ( | FleetSide | side, |
String | variantId, | ||
FleetMemberType | type, | ||
boolean | isFlagship | ||
) |
Add a ship variant to a fleet. The variant ID refers to one of the variants found in data/variants and data/variants/fighters.
side | |
variantId | |
type | |
isFlagship | Set to true for the player's ship, false otherwise. |
FleetMemberAPI com.fs.starfarer.api.mission.MissionDefinitionAPI.addToFleet | ( | FleetSide | side, |
String | variantId, | ||
FleetMemberType | type, | ||
String | shipName, | ||
boolean | isFlagship | ||
) |
Same as the other addToFleet method, except you can specify the ship's name.
side | |
variantId | |
type | |
shipName | Full ship name, including prefix. |
isFlagship | Set to true for the player's ship, false otherwise. |
void com.fs.starfarer.api.mission.MissionDefinitionAPI.defeatOnShipLoss | ( | String | shipName | ) |
Indicates that losing the named ship causes immediate defeat for that side. Ship must have been added with an explicit name.
shipName |
BattleCreationContext com.fs.starfarer.api.mission.MissionDefinitionAPI.getContext | ( | ) |
PersonAPI com.fs.starfarer.api.mission.MissionDefinitionAPI.getDefaultCommander | ( | FleetSide | side | ) |
int com.fs.starfarer.api.mission.MissionDefinitionAPI.getFleetPointCost | ( | String | id | ) |
Returns the fleet point cost of a fighter wing or ship variant.
id |
boolean com.fs.starfarer.api.mission.MissionDefinitionAPI.hasNebula | ( | ) |
void com.fs.starfarer.api.mission.MissionDefinitionAPI.initFleet | ( | FleetSide | side, |
String | shipNamePrefix, | ||
FleetGoal | goal, | ||
boolean | useDefaultAI | ||
) |
Set various parameters for a fleet. Must be called once each for FleetSide.PLAYER and FleetSide.ENEMY. Must be called before any ships are added to the fleet.
side | |
shipNamePrefix | Prepended to any randomly picked ship names. "ISS", "HSS", etc. |
goal | |
useDefaultAI | For now, set true for side = ENEMY and false for side = PLAYER. Later, may supply custom AI. |
void com.fs.starfarer.api.mission.MissionDefinitionAPI.initFleet | ( | FleetSide | side, |
String | shipNamePrefix, | ||
FleetGoal | goal, | ||
boolean | useDefaultAI, | ||
int | commandRating | ||
) |
Set various parameters for a fleet. Must be called once each for FleetSide.PLAYER and FleetSide.ENEMY. Must be called before any ships are added to the fleet.
side | |
shipNamePrefix | Prepended to any randomly picked ship names. "ISS", "HSS", etc. |
goal | |
useDefaultAI | For now, set true for side = ENEMY and false for side = PLAYER. Later, may supply custom AI. |
commandRating | Added to the pool of available command points. |
void com.fs.starfarer.api.mission.MissionDefinitionAPI.initFleet | ( | FleetSide | side, |
String | shipNamePrefix, | ||
FleetGoal | goal, | ||
boolean | useDefaultAI, | ||
int | commandRating, | ||
int | allyCommandRating | ||
) |
void com.fs.starfarer.api.mission.MissionDefinitionAPI.initMap | ( | float | minX, |
float | maxX, | ||
float | minY, | ||
float | maxY | ||
) |
Initialize map with the given size. By convention, 0,0 should be at the center. In other words, -minX = maxX and -minY = maxY.
minX | in pixels. |
maxX | in pixels. |
minY | in pixels. |
maxY | in pixels. |
void com.fs.starfarer.api.mission.MissionDefinitionAPI.setBackgroundGlowColor | ( | Color | backgroundGlowColor | ) |
void com.fs.starfarer.api.mission.MissionDefinitionAPI.setBackgroundSpriteName | ( | String | background | ) |
void com.fs.starfarer.api.mission.MissionDefinitionAPI.setFleetTagline | ( | FleetSide | side, |
String | tagline | ||
) |
Set a small blurb for the fleet that shows up on the mission detail and mission results screens to identify it.
side | |
tagline |
void com.fs.starfarer.api.mission.MissionDefinitionAPI.setHyperspaceMode | ( | boolean | hyperspaceMode | ) |
Make the background animate the same way it does in hyperspace.
hyperspaceMode |
void com.fs.starfarer.api.mission.MissionDefinitionAPI.setNebulaMapTex | ( | String | nebulaMapTex | ) |
void com.fs.starfarer.api.mission.MissionDefinitionAPI.setNebulaTex | ( | String | nebulaTex | ) |
void com.fs.starfarer.api.mission.MissionDefinitionAPI.setPlanetBgSize | ( | float | bgWidth, |
float | bgHeight | ||
) |
Background planets at 0,0 get rendered at the center of the screen when the view is at the center of the map.
The bgWidth and bgHeight determine how much off-center the planet moves at the edges of the map.
bgWidth | |
bgHeight |