Blueprint
A physical instance of a design. A blueprint belongs to one ship and holds all the information about the internals of that particular ship.
Members
-
double
currentHP
— The current hp of the ship.
-
double
shipEffectiveness
— The effectiveness of the ship as a whole.
-
uint
destroyedHexes
— The amount of hexes that have been destroyed.
-
const Design@
design
— The design that this particular blueprint is based on.
-
vec2i
repairingHex
— The hexagon that is currently being repaired.
-
uint
statusID
— An ID that increments whenever a change to the blueprint occurs.
-
bool
delta
— Flag for whether the blueprint should be delta synced.
Methods
-
float
tick(
Object&
arg0,
double
arg1
)
-
void
destroy(
Object&
arg0
)
-
void
ownerChange(
Object&
arg0,
Empire@
arg1,
Empire@
arg2
)
-
HexStatus@
getHexStatus(
uint
x,
uint
y
)
-
SysStatus@
getSysStatus(
uint
index
)
-
SysStatus@
getSysStatus(
uint
x,
uint
y
)
-
bool
hasTagActive(
SubsystemTag
tag
)
-
double
getTagEfficiency(
SubsystemTag
tag,
bool
ignoreInactive = true
)
-
double
getEfficiencySum(
SubsystemVariable
var,
SubsystemTag
tag = ST_NULL,
bool
ignoreInactive = true
)
-
double
getEfficiencyFactor(
SubsystemVariable
var,
SubsystemTag
tag = ST_NULL,
bool
ignoreInactive = true
)
-
vec3d
getOptimalFacing(
SubsystemVariable
var,
SubsystemTag
tag = ST_NULL,
bool
ignoreInactive = true
)
-
Object@
getCombatTarget(
)
-
const HexStatus@
getHexStatus(
uint
index
) const
-
const HexStatus@
getHexStatus(
uint
x,
uint
y
) const
-
const SysStatus@
getSysStatus(
uint
index
) const
-
const SysStatus@
getSysStatus(
uint
x,
uint
y
) const
-
bool
canTarget(
Object&
obj,
Object&
target
)
-
bool
doesAutoTarget(
Object&
obj,
Object&
target
)
-
void
save(
Object&
obj,
SaveFile&
file
)
-
void
load(
Object&
obj,
SaveFile&
file
)
-
void
target(
Object&
obj,
Object&
target,
uint
flags = 0
)
-
void
target(
Object&
obj,
uint
efftrIndex,
Object&
target,
uint
flags = 0
)
-
void
target(
Object&
obj,
const Subsystem@
sys,
Object&
target,
uint
flags = 0
)
-
void
clearTracking(
Object&
obj
)
-
void
sendDetails(
Object&
obj,
Message&
msg
) const
-
void
recvDetails(
Object&
obj,
Message&
msg
)
-
bool
sendDelta(
Object&
obj,
Message&
msg
) const
-
void
recvDelta(
Object&
obj,
Message&
msg
)
-
void
create(
Object&
obj,
const Design@
design
)
-
void
start(
Object&
obj,
bool
fromRetrofit = false
)
-
void
retrofit(
Object&
obj,
const Design@
toDesign
)
-
any@
getHookData(
uint
index
)
-
int
integer(
const Subsystem@
sys,
uint
num
)
-
double
decimal(
const Subsystem@
sys,
uint
num
)
-
bool
boolean(
const Subsystem@
sys,
uint
num
)
-
void
damage(
Object&
obj,
DamageEvent&
evt,
vec2d&
direction
)
-
void
damage(
Object&
obj,
DamageEvent&
evt,
double
position,
vec2d&
direction
)
-
void
damage(
Object&
obj,
DamageEvent&
evt,
vec2u&
position
)
-
double
repair(
Object&
obj,
double
amount
)
-
double
repair(
Object&
obj,
vec2u&
position,
double
amount
)
float
tick(
Object&
arg0,
double
arg1
)
Tick function to handle the blueprint, should be called from the object script handler's tick.
-
Object&
arg0 — Object this blueprint is for.
-
double
arg1 — Time passed since last tick.
Returns
float
: Suggestion for the amount of time to wait until the next tick.
HexStatus@
getHexStatus(
uint
x,
uint
y
)
-
uint
x — X coordinate of the hex.
-
uint
y — Y coordinate of the hex.
Returns
HexStatus@
: Current status of the hex on this blueprint.
SysStatus@
getSysStatus(
uint
index
)
-
uint
index — Index of the subsystem
Returns
SysStatus@
: Current status of the subsystem.
SysStatus@
getSysStatus(
uint
x,
uint
y
)
-
uint
x — X coordinate of the hex.
-
uint
y — Y coordinate of the hex.
Returns
SysStatus@
: Current status of the subsystem the hex belongs to.
double
getTagEfficiency(
SubsystemTag
tag,
bool
ignoreInactive = true
)
Calculate the total efficiency of subsystems with a particular tag.
-
SubsystemTag
tag — Tag to check for.
-
bool
ignoreInactive — Whether to ignore remaining efficiency on subsystems that are disabled.
Returns
double
: Total efficiency.
vec3d
getOptimalFacing(
SubsystemVariable
var,
SubsystemTag
tag = ST_NULL,
bool
ignoreInactive = true
)
Calculate the optimal facing so that effectors in this blueprint can fire with optimal value for the passed variable.
-
SubsystemVariable
var — Variable to use.
-
SubsystemTag
tag — Tag to filter subsystems by.
-
bool
ignoreInactive — Whether to ignore remaining efficiency on subsystems that are disabled.
Returns
vec3d
: Optimal facing.
Object@
getCombatTarget(
)
Find a target this ship is firing on.
const HexStatus@
getHexStatus(
uint
x,
uint
y
) const
-
uint
x — X coordinate of the hex.
-
uint
y — Y coordinate of the hex.
Returns
const HexStatus@
: Current status of the hex on this blueprint.
const SysStatus@
getSysStatus(
uint
x,
uint
y
) const
-
uint
x — X coordinate of the hex.
-
uint
y — Y coordinate of the hex.
Returns
const SysStatus@
: Current status of the subsystem the hex belongs to.
bool
canTarget(
Object&
obj,
Object&
target
)
Check whether the effectors in this blueprint can target an object.
-
Object&
obj — Object this blueprint is for.
-
Object&
target — Object to check targeting for.
Returns
bool
: Whether the object can be targeted.
bool
doesAutoTarget(
Object&
obj,
Object&
target
)
Check whether the effectors in this blueprint can auto-target an object.
-
Object&
obj — Object this blueprint is for.
-
Object&
target — Object to check auto-targeting for.
Returns
bool
: Whether the object can be auto-targeted.
void
target(
Object&
obj,
Object&
target,
uint
flags = 0
)
Set all effectors in this blueprint to target a particular object.
-
Object&
obj — Object this blueprint is for.
-
Object&
target — Object to target with all effectors.
-
uint
flags — Flags for the effector target.
void
target(
Object&
obj,
uint
efftrIndex,
Object&
target,
uint
flags = 0
)
Set an effector in this blueprint to target a particular object.
-
Object&
obj — Object this blueprint is for.
-
uint
efftrIndex — Index of the effector to target for.
-
Object&
target — Object to target with the effector.
-
uint
flags — Flags for the effector target.
bool
sendDelta(
Object&
obj,
Message&
msg
) const
For networking: sends a delta of this blueprint through the message.
-
Object&
obj — Object this blueprint is for.
-
Message&
msg — Message to add delta to.
Returns
bool
: Whether a delta was needed/written.
void
start(
Object&
obj,
bool
fromRetrofit = false
)
Start the blueprint's effects.
-
Object&
obj — Object this blueprint is for.
-
bool
fromRetrofit — Whether this was started from a retrofit event.
any@
getHookData(
uint
index
)
Get data storage for a hook index.
Returns
any@
: Data for that hook.
void
damage(
Object&
obj,
DamageEvent&
evt,
double
position,
vec2d&
direction
)
Handle damage to the blueprint from a particular direction.
-
Object&
obj — Object the blueprint is for.
-
DamageEvent&
evt — Event relating information about the damage dealt.
-
double
position — Position between 0 and 1 on the side that is hit.
-
vec2d&
direction — Direction vector towards the object of the damage.
double
repair(
Object&
obj,
double
amount
)
Add generic repair to the blueprint.
-
Object&
obj — Object the blueprint is for.
-
double
amount — Amount of hp to repair.
Returns
double
: Amount of repair that was left over after this call.
double
repair(
Object&
obj,
vec2u&
position,
double
amount
)
Add repair to a particular hex on the blueprint.
-
Object&
obj — Object the blueprint is for.
-
vec2u&
position — Position on the blueprint to repair.
-
double
amount — Amount of hp to repair.
Returns
double
: Amount of repair that was left over after this call.