Documentation

AbstractShip
in package

Properties and methods for a ship instance.

Does not include the database layer (see Ship).

Table of Contents

Constants

EXP_PER_DAMAGE_FORCE  = 0.075
EXP_PER_DAMAGE_PLANET  = 1.0
EXP_PER_DAMAGE_PLAYER  = 0.375
EXP_PER_DAMAGE_PORT  = 0.15
STARTER_SHIPS  = [RACE_NEUTRAL => SHIP_TYPE_GALACTIC_SEMI, RACE_ALSKANT => SHIP_TYPE_SMALL_TIMER, RACE_CREONTI => SHIP_TYPE_MEDIUM_CARGO_HULK, RACE_HUMAN => SHIP_TYPE_LIGHT_FREIGHTER, RACE_IKTHORNE => SHIP_TYPE_TINY_DELIGHT, RACE_SALVENE => SHIP_TYPE_HATCHLINGS_DUE, RACE_THEVIAN => SHIP_TYPE_SWIFT_VENTURE, RACE_WQHUMAN => SHIP_TYPE_SLIP_FREIGHTER, RACE_NIJARIN => SHIP_TYPE_REDEEMER]

Properties

$cargo  : array<int, int>
$gameID  : int
$hardware  : array<int, int>
$hasChangedCargo  : bool
$hasChangedCloak  : bool
$hasChangedHardware  : array<int, bool>
$hasChangedIllusion  : bool
$hasChangedWeapons  : bool
$illusionShip  : ShipIllusion|false
$isCloaked  : bool
$player  : AbstractPlayer
$shipType  : ShipType
$weapons  : array<int, Weapon>

Methods

__construct()  : mixed
addWeapon()  : Weapon|false
canAttack()  : bool
checkForExcess()  : void
checkForExcessCargo()  : void
checkForExcessHardware()  : void
checkForExcessWeapons()  : void
checkPowerAvailable()  : bool
given power level of new weapon, return whether there is enough power available to install it on this ship
decloak()  : void
decreaseArmour()  : void
decreaseCargo()  : void
decreaseCDs()  : void
decreaseMines()  : void
decreaseSDs()  : void
decreaseShields()  : void
disableIllusion()  : void
enableCloak()  : void
getAccountID()  : int
getArmour()  : int
getArmourHigh()  : int
getArmourLow()  : int
getAttackRating()  : int
getAttackRatingWithMaxCDs()  : int
getCargo()  : mixed
getCargoHolds()  : int
getCDs()  : int
getCDsHigh()  : int
getCDsLow()  : int
getClass()  : ShipClass
getCost()  : int
getCostToUNO()  : int
getCostToUpgrade()  : int
getCostToUpgradeAndUNO()  : int
getDefenseRating()  : int
getDisplayAttackRating()  : int
getDisplayDefenseRating()  : int
getDisplayName()  : string
getEmptyHolds()  : int
getGame()  : Game
getGameID()  : int
getHardpoints()  : int
getHardware()  : mixed
getIllusion()  : ShipIllusion|false
getMaxArmour()  : int
getMaxCargoHolds()  : int
getMaxCDs()  : int
getMaxDefenseRating()  : int
getMaxMines()  : int
getMaxSDs()  : int
getMaxShields()  : int
getMines()  : int
getMR()  : int
Returns the maneuverability rating for this ship.
getName()  : string
getNumWeapons()  : int
getOpenWeaponSlots()  : int
getPlayer()  : AbstractPlayer
getPod()  : void
getPowerUsed()  : int
getRealSpeed()  : float
Returns the ship speed modified by the game speed.
getRefundValue()  : int
Trade-in value of the ship
getRemainingPower()  : int
getSDs()  : int
getShieldHigh()  : int
getShieldLow()  : int
getShields()  : int
getTotalArmourDamage()  : int
getTotalShieldDamage()  : int
getType()  : ShipType
getTypeID()  : int
getUsedHolds()  : int
getWeapons()  : array<int, Weapon>
giveStarterShip()  : void
hasActiveIllusion()  : bool
hasArmour()  : bool
hasCargo()  : bool
hasCDs()  : bool
hasCloak()  : bool
hasDCS()  : bool
hasIllegalGoods()  : bool
hasIllusion()  : bool
hasJump()  : bool
hasMaxArmour()  : bool
hasMaxCargoHolds()  : bool
hasMaxCDs()  : bool
hasMaxHardware()  : bool
hasMaxMines()  : bool
hasMaxSDs()  : bool
hasMaxShields()  : bool
hasMines()  : bool
hasOpenWeaponSlots()  : bool
hasScanner()  : bool
hasSDs()  : bool
hasShields()  : bool
hasWeapons()  : bool
increaseArmour()  : void
increaseCargo()  : void
increaseCDs()  : void
increaseHardware()  : void
increaseMines()  : void
increaseSDs()  : void
increaseShields()  : void
isCloaked()  : bool
isDead()  : bool
isFederal()  : bool
isUnderground()  : bool
moveWeaponDown()  : void
moveWeaponUp()  : void
removeAllCargo()  : void
removeAllHardware()  : void
removeAllWeapons()  : void
removeLastWeapon()  : void
removeWeapon()  : void
setArmour()  : void
setCargo()  : void
setCargoHolds()  : void
setCDs()  : void
setHardware()  : void
setHardwareToMax()  : void
Set all hardware to its maximum value for this ship.
setIllusion()  : void
setMines()  : void
setSDs()  : void
setShields()  : void
setTypeID()  : void
Switch to a new ship, updating player turns accordingly.
setWeaponLocations()  : void
shootForces()  : ForceAttackerCombatResult
shootPlanet()  : PlanetAttackerCombatResult
shootPlayers()  : TraderCombatResult
shootPort()  : PortAttackerCombatResult
takeDamage()  : TakenDamageData
takeDamageFromMines()  : TakenDamageData
update()  : void
getCostToUNOAgainstShip()  : int
regenerateShipType()  : void
takeDamageToArmour()  : int
takeDamageToCDs()  : int
takeDamageToShields()  : int

Constants

EXP_PER_DAMAGE_FORCE

protected mixed EXP_PER_DAMAGE_FORCE = 0.075

EXP_PER_DAMAGE_PLANET

protected mixed EXP_PER_DAMAGE_PLANET = 1.0

EXP_PER_DAMAGE_PLAYER

protected mixed EXP_PER_DAMAGE_PLAYER = 0.375

EXP_PER_DAMAGE_PORT

protected mixed EXP_PER_DAMAGE_PORT = 0.15

STARTER_SHIPS

protected mixed STARTER_SHIPS = [RACE_NEUTRAL => SHIP_TYPE_GALACTIC_SEMI, RACE_ALSKANT => SHIP_TYPE_SMALL_TIMER, RACE_CREONTI => SHIP_TYPE_MEDIUM_CARGO_HULK, RACE_HUMAN => SHIP_TYPE_LIGHT_FREIGHTER, RACE_IKTHORNE => SHIP_TYPE_TINY_DELIGHT, RACE_SALVENE => SHIP_TYPE_HATCHLINGS_DUE, RACE_THEVIAN => SHIP_TYPE_SWIFT_VENTURE, RACE_WQHUMAN => SHIP_TYPE_SLIP_FREIGHTER, RACE_NIJARIN => SHIP_TYPE_REDEEMER]

Properties

$hasChangedCargo

protected bool $hasChangedCargo = false

$hasChangedCloak

protected bool $hasChangedCloak = false

$hasChangedHardware

protected array<int, bool> $hasChangedHardware = []

$hasChangedIllusion

protected bool $hasChangedIllusion = false

$hasChangedWeapons

protected bool $hasChangedWeapons = false

Methods

canAttack()

public canAttack() : bool
Return values
bool

checkForExcessCargo()

public checkForExcessCargo() : void

checkForExcessHardware()

public checkForExcessHardware() : void

checkForExcessWeapons()

public checkForExcessWeapons() : void

checkPowerAvailable()

given power level of new weapon, return whether there is enough power available to install it on this ship

public checkPowerAvailable(int $powerLevel) : bool
Parameters
$powerLevel : int
Return values
bool

decreaseArmour()

public decreaseArmour(int $amount) : void
Parameters
$amount : int

decreaseCargo()

public decreaseCargo(int $goodID, int $amount) : void
Parameters
$goodID : int
$amount : int

decreaseCDs()

public decreaseCDs(int $amount) : void
Parameters
$amount : int

decreaseMines()

public decreaseMines(int $amount) : void
Parameters
$amount : int

decreaseSDs()

public decreaseSDs(int $amount) : void
Parameters
$amount : int

decreaseShields()

public decreaseShields(int $amount) : void
Parameters
$amount : int

getAccountID()

public getAccountID() : int
Return values
int

getArmourHigh()

public getArmourHigh() : int
Return values
int

getArmourLow()

public getArmourLow() : int
Return values
int

getAttackRating()

public getAttackRating() : int
Return values
int

getAttackRatingWithMaxCDs()

public getAttackRatingWithMaxCDs() : int
Return values
int

getCargo()

public getCargo([int $goodID = null ]) : mixed
Parameters
$goodID : int = null

getCargoHolds()

public getCargoHolds() : int
Return values
int

getCDsHigh()

public getCDsHigh() : int
Return values
int

getCostToUNO()

public getCostToUNO() : int
Return values
int

getCostToUpgrade()

public getCostToUpgrade(int $otherShipTypeID) : int
Parameters
$otherShipTypeID : int
Return values
int

getCostToUpgradeAndUNO()

public getCostToUpgradeAndUNO(int $otherShipTypeID) : int
Parameters
$otherShipTypeID : int
Return values
int

getDefenseRating()

public getDefenseRating() : int
Return values
int

getDisplayAttackRating()

public getDisplayAttackRating() : int
Return values
int

getDisplayDefenseRating()

public getDisplayDefenseRating() : int
Return values
int

getDisplayName()

public getDisplayName() : string
Return values
string

getEmptyHolds()

public getEmptyHolds() : int
Return values
int

getHardpoints()

public getHardpoints() : int
Return values
int

getHardware()

public getHardware([int $hardwareTypeID = null ]) : mixed
Parameters
$hardwareTypeID : int = null

getMaxArmour()

public getMaxArmour() : int
Return values
int

getMaxCargoHolds()

public getMaxCargoHolds() : int
Return values
int

getMaxDefenseRating()

public getMaxDefenseRating() : int
Return values
int

getMaxMines()

public getMaxMines() : int
Return values
int

getMaxShields()

public getMaxShields() : int
Return values
int

getMR()

Returns the maneuverability rating for this ship.

public getMR() : int
Return values
int

getName()

public getName() : string
Return values
string

getNumWeapons()

public getNumWeapons() : int
Return values
int

getOpenWeaponSlots()

public getOpenWeaponSlots() : int
Return values
int

getPod()

public getPod([bool $isNewbie = false ]) : void
Parameters
$isNewbie : bool = false

getPowerUsed()

public getPowerUsed() : int
Return values
int

getRealSpeed()

Returns the ship speed modified by the game speed.

public getRealSpeed() : float
Return values
float

getRefundValue()

Trade-in value of the ship

public getRefundValue() : int
Return values
int

getRemainingPower()

public getRemainingPower() : int
Return values
int

getShieldHigh()

public getShieldHigh() : int
Return values
int

getShieldLow()

public getShieldLow() : int
Return values
int

getShields()

public getShields() : int
Return values
int

getTotalArmourDamage()

public getTotalArmourDamage() : int
Return values
int

getTotalShieldDamage()

public getTotalShieldDamage() : int
Return values
int

getUsedHolds()

public getUsedHolds() : int
Return values
int

hasActiveIllusion()

public hasActiveIllusion() : bool
Tags
phpstan-assert-if-true

!false $this->getIllusion()

Return values
bool

hasArmour()

public hasArmour() : bool
Return values
bool

hasCargo()

public hasCargo([int $goodID = null ]) : bool
Parameters
$goodID : int = null
Return values
bool

hasIllegalGoods()

public hasIllegalGoods() : bool
Return values
bool

hasIllusion()

public hasIllusion() : bool
Return values
bool

hasMaxArmour()

public hasMaxArmour() : bool
Return values
bool

hasMaxCargoHolds()

public hasMaxCargoHolds() : bool
Return values
bool

hasMaxCDs()

public hasMaxCDs() : bool
Return values
bool

hasMaxHardware()

public hasMaxHardware(int $hardwareTypeID) : bool
Parameters
$hardwareTypeID : int
Return values
bool

hasMaxMines()

public hasMaxMines() : bool
Return values
bool

hasMaxSDs()

public hasMaxSDs() : bool
Return values
bool

hasMaxShields()

public hasMaxShields() : bool
Return values
bool

hasOpenWeaponSlots()

public hasOpenWeaponSlots() : bool
Return values
bool

hasScanner()

public hasScanner() : bool
Return values
bool

hasShields()

public hasShields() : bool
Return values
bool

hasWeapons()

public hasWeapons() : bool
Return values
bool

increaseArmour()

public increaseArmour(int $amount) : void
Parameters
$amount : int

increaseCargo()

public increaseCargo(int $goodID, int $amount) : void
Parameters
$goodID : int
$amount : int

increaseCDs()

public increaseCDs(int $amount) : void
Parameters
$amount : int

increaseHardware()

public increaseHardware(int $hardwareTypeID, int $amount) : void
Parameters
$hardwareTypeID : int
$amount : int

increaseMines()

public increaseMines(int $amount) : void
Parameters
$amount : int

increaseSDs()

public increaseSDs(int $amount) : void
Parameters
$amount : int

increaseShields()

public increaseShields(int $amount) : void
Parameters
$amount : int

isCloaked()

public isCloaked() : bool
Return values
bool

isFederal()

public isFederal() : bool
Return values
bool

isUnderground()

public isUnderground() : bool
Return values
bool

moveWeaponDown()

public moveWeaponDown(int $orderID) : void
Parameters
$orderID : int

moveWeaponUp()

public moveWeaponUp(int $orderID) : void
Parameters
$orderID : int

removeWeapon()

public removeWeapon(int $orderID) : void
Parameters
$orderID : int

setArmour()

public setArmour(int $amount) : void
Parameters
$amount : int

setCargo()

public setCargo(int $goodID, int $amount) : void
Parameters
$goodID : int
$amount : int

setCargoHolds()

public setCargoHolds(int $amount) : void
Parameters
$amount : int

setCDs()

public setCDs(int $amount) : void
Parameters
$amount : int

setHardware()

public setHardware(int $hardwareTypeID, int $amount) : void
Parameters
$hardwareTypeID : int
$amount : int

setHardwareToMax()

Set all hardware to its maximum value for this ship.

public setHardwareToMax() : void

setIllusion()

public setIllusion(int $shipTypeID, int $attack, int $defense) : void
Parameters
$shipTypeID : int
$attack : int
$defense : int

setMines()

public setMines(int $amount) : void
Parameters
$amount : int

setSDs()

public setSDs(int $amount) : void
Parameters
$amount : int

setShields()

public setShields(int $amount) : void
Parameters
$amount : int

setTypeID()

Switch to a new ship, updating player turns accordingly.

public setTypeID(int $shipTypeID) : void
Parameters
$shipTypeID : int

setWeaponLocations()

public setWeaponLocations(array<int, int> $orderArray) : void
Parameters
$orderArray : array<int, int>

shootForces()

public shootForces(Force $forces) : ForceAttackerCombatResult
Parameters
$forces : Force
Return values
ForceAttackerCombatResult

shootPlanet()

public shootPlanet(Planet $planet) : PlanetAttackerCombatResult
Parameters
$planet : Planet
Return values
PlanetAttackerCombatResult

shootPlayers()

public shootPlayers(array<string|int, AbstractPlayer$targetPlayers) : TraderCombatResult
Parameters
$targetPlayers : array<string|int, AbstractPlayer>
Return values
TraderCombatResult

shootPort()

public shootPort(Port $port) : PortAttackerCombatResult
Parameters
$port : Port
Return values
PortAttackerCombatResult

takeDamage()

public takeDamage(WeaponDamageData $damage) : TakenDamageData
Parameters
$damage : WeaponDamageData
Return values
TakenDamageData

takeDamageFromMines()

public takeDamageFromMines(WeaponDamageData $damage) : TakenDamageData
Parameters
$damage : WeaponDamageData
Return values
TakenDamageData

getCostToUNOAgainstShip()

protected getCostToUNOAgainstShip(int $otherShipTypeID) : int
Parameters
$otherShipTypeID : int
Return values
int

regenerateShipType()

protected regenerateShipType() : void

takeDamageToArmour()

protected takeDamageToArmour(int $damage) : int
Parameters
$damage : int
Return values
int

takeDamageToCDs()

protected takeDamageToCDs(int $damage) : int
Parameters
$damage : int
Return values
int

takeDamageToShields()

protected takeDamageToShields(int $damage) : int
Parameters
$damage : int
Return values
int

        
On this page

Search results