Package com.fs.starfarer.api.combat
Interface ArmorGridAPI
public interface ArmorGridAPI
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
Call this to prevent all weapons/engines on the ship from taking damage, ever.int
getAbove()
Number of cells above the center of the ship.float
getArmorFraction
(int cellX, int cellY) 0,0 is lower left corner of the sprite.float
float
getArmorValue
(int cellX, int cellY) 0,0 is lower left corner of the sprite.int
getBelow()
Number of cells below the center of the ship.int[]
getCellAtLocation
(org.lwjgl.util.vector.Vector2f loc) float
Armor cell size, in pixels.float[][]
getGrid()
int
Number of cells left of the center of the ship.org.lwjgl.util.vector.Vector2f
getLocation
(int cellX, int cellY) float
int
Number of cells right of the center of the ship.void
setArmorValue
(int cellX, int cellY, float value)
-
Method Details
-
getArmorRating
float getArmorRating()- Returns:
- Armor value that the player sees in the game, on tooltips and such.
-
getMaxArmorInCell
float getMaxArmorInCell()- Returns:
- Actual per-cell maximum armor value. ~1/15th of the listed armor rating, due to how damage is distributed between cells.
-
getArmorFraction
float getArmorFraction(int cellX, int cellY) 0,0 is lower left corner of the sprite.- Returns:
- Armor value normalized to (0, 1).
-
getArmorValue
float getArmorValue(int cellX, int cellY) 0,0 is lower left corner of the sprite.- Returns:
- Actual non-normalized armor value in cell.
-
setArmorValue
void setArmorValue(int cellX, int cellY, float value) - Parameters:
cellX
-cellY
-value
- actual value, NOT fraction.
-
getGrid
float[][] getGrid() -
getCellSize
float getCellSize()Armor cell size, in pixels. -
getAbove
int getAbove()Number of cells above the center of the ship. Use together with getCellSize() and ShipAPI.getLocation() to determine the cell at a given location.- Returns:
-
getBelow
int getBelow()Number of cells below the center of the ship. Use together with getCellSize() and ShipAPI.getLocation() to determine the cell at a given location.- Returns:
-
getRightOf
int getRightOf()Number of cells right of the center of the ship. Use together with getCellSize() and ShipAPI.getLocation() to determine the cell at a given location.- Returns:
-
getLeftOf
int getLeftOf()Number of cells left of the center of the ship. Use together with getCellSize() and ShipAPI.getLocation() to determine the cell at a given location.- Returns:
-
getCellAtLocation
int[] getCellAtLocation(org.lwjgl.util.vector.Vector2f loc) - Parameters:
loc
- absolute location in engine coordinates.- Returns:
- null if loc is off the grid, array with {int cellX, int cellY} otherwise.
-
getLocation
org.lwjgl.util.vector.Vector2f getLocation(int cellX, int cellY) -
clearComponentMap
void clearComponentMap()Call this to prevent all weapons/engines on the ship from taking damage, ever. -
buildComponentMap
void buildComponentMap()
-