Documentation

Planet
in package

Table of Contents

Constants

DAMAGE_NEEDED_FOR_DOWNGRADE_CHANCE  = 100
MAX_STOCKPILE  = 600
SQL  = 'game_id = :game_id AND sector_id = :sector_id'
CHANCE_TO_DOWNGRADE  = 15
TIME_ATTACK_NEWS_COOLDOWN  = 3600
TIME_TO_CREDIT_BUST  = 10800

Properties

$SQLID  : array{game_id: int, sector_id: int}
$armour  : int
$bonds  : int
$buildings  : array<int, int>
$CACHE_PLANETS  : array<int, array<int, self>>
$credits  : int
$currentlyBuilding  : array<int, array<string, int>>
$drones  : int
$exists  : bool
$gameID  : int
$hasChanged  : bool
$hasChangedBuildings  : array<int, bool>
$hasChangedFinancial  : bool
$hasChangedStockpile  : bool
$hasChangedWeapons  : array<int, bool>
$hasStoppedBuilding  : array<string|int, int>
$inhabitableTime  : int
$maturity  : int
$mountedWeapons  : array<int, Weapon>
$ownerID  : int
$password  : string
$planetName  : string
$sectorID  : int
$shields  : int
$stockpile  : array<int, int>
$typeID  : int
$typeInfo  : PlanetType

Methods

__sleep()  : mixed
addMountedWeapon()  : void
attackedBy()  : void
bond()  : void
checkBondMaturity()  : void
checkForDowngrade()  : array<int, int>
Returns an array of structure losses due to damage taken.
checkForExcessDefense()  : void
clearCache()  : void
countPlayers()  : int
createPlanet()  : self
creditCurrentAttackersForKill()  : void
decreaseArmour()  : void
decreaseBonds()  : void
decreaseCDs()  : void
decreaseCredits()  : void
decreaseShields()  : void
decreaseStockpile()  : void
destroyBuilding()  : void
exists()  : bool
getAccuracyBonus()  : int
Returns the accuracy bonus for mounted weaons (as a percent)
getArmour()  : int
getAttackHREF()  : string
getBondConfirmationHREF()  : string
getBonds()  : int
getBondTime()  : int
getBuildHREF()  : string
getBuilding()  : int
getBuildings()  : array<int, int>
getBuildRestriction()  : string|false
Returns the reason a build cannot be performed, or false if there is no restriction.
getCancelHREF()  : string
getCDs()  : int
getCombatName()  : string
Returns the name of the planet, intended for combat messages.
getConstructionTime()  : int
getCredits()  : int
getCurrentlyBuilding()  : array<int, array<string, int>>
getDisplayName()  : string
Returns the name of the planet, suitably escaped for HTML display.
getExamineHREF()  : string
getFinancesHREF()  : string
getGalaxy()  : Galaxy
getGalaxyPlanets()  : array<int, self>
getGame()  : Game
getGameID()  : int
getInhabitableTime()  : int
getInterestRate()  : float
getLandHREF()  : string
getLevel()  : float
getMaturity()  : int
getMaxArmour()  : int
getMaxAttackers()  : int
getMaxBuildings()  : mixed
getMaxCDs()  : int
getMaxLanded()  : int
getMaxLevel()  : float
getMaxMountedWeapons()  : int
getMaxShields()  : int
getMountedWeapons()  : array<int, Weapon>
getOtherTraders()  : array<int, Player>
getOwner()  : AbstractPlayer
getOwnerID()  : int
getPassword()  : string
getPlanet()  : self
getPlayers()  : array<int, Player>
getRemainingStockpile()  : int
getSectorID()  : int
getShields()  : int
getStockpile()  : mixed
getStructureTypes()  : mixed
getTurretAccuracy()  : float
Returns the modified accuracy of turrets on this planet.
getTypeDescription()  : string
getTypeID()  : int
getTypeImage()  : string
getTypeName()  : string
getWeapons()  : array<string|int, Weapon>
hasArmour()  : bool
hasBuilding()  : bool
hasCDs()  : bool
hasCurrentlyBuilding()  : bool
Returns true if there is a building in progress
hasEnemyTraders()  : bool
hasFriendlyTraders()  : bool
hasMenuOption()  : bool
Specifies which menu options the planet has.
hasMountedWeapon()  : bool
hasOtherTraders()  : bool
hasOwner()  : bool
hasPlayers()  : bool
hasShields()  : bool
hasStockpile()  : bool
hasStructureType()  : bool
increaseArmour()  : void
increaseBonds()  : void
increaseBuilding()  : void
increaseCDs()  : void
increaseCredits()  : int
Increases planet credits up to the maximum allowed credits.
increaseShields()  : void
increaseStockpile()  : void
isBusted()  : bool
isInhabitable()  : bool
killPlanetByPlayer()  : array{}
moveMountedWeaponDown()  : void
moveMountedWeaponUp()  : void
removeMountedWeapon()  : void
removeOwner()  : void
removePassword()  : void
removePlanet()  : void
savePlanets()  : void
setArmour()  : void
setBonds()  : void
setBuilding()  : void
setCDs()  : void
setCredits()  : void
setMaturity()  : void
setName()  : void
setOwnerID()  : void
setPassword()  : void
setShields()  : void
setStockpile()  : void
setTypeID()  : void
shootPlayers()  : PlanetCombatResults
startBuilding()  : void
stopBuilding()  : bool
takeDamage()  : TakenDamageData
update()  : void
__construct()  : mixed
takeDamageToArmour()  : int
takeDamageToCDs()  : int
takeDamageToShields()  : int
getCompletionModifier()  : float
getConstructionExp()  : int
swapMountedWeapons()  : void

Constants

DAMAGE_NEEDED_FOR_DOWNGRADE_CHANCE

public mixed DAMAGE_NEEDED_FOR_DOWNGRADE_CHANCE = 100

MAX_STOCKPILE

public mixed MAX_STOCKPILE = 600

SQL

public mixed SQL = 'game_id = :game_id AND sector_id = :sector_id'

CHANCE_TO_DOWNGRADE

protected mixed CHANCE_TO_DOWNGRADE = 15

TIME_ATTACK_NEWS_COOLDOWN

protected mixed TIME_ATTACK_NEWS_COOLDOWN = 3600

TIME_TO_CREDIT_BUST

protected mixed TIME_TO_CREDIT_BUST = 10800

Properties

$SQLID read-only

public array{game_id: int, sector_id: int} $SQLID

$buildings

protected array<int, int> $buildings

$CACHE_PLANETS

protected static array<int, array<int, self>> $CACHE_PLANETS = []

$currentlyBuilding

protected array<int, array<string, int>> $currentlyBuilding

$exists

protected bool $exists = false

$gameID read-only

protected int $gameID

$hasChanged

protected bool $hasChanged = false

$hasChangedBuildings

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

$hasChangedFinancial

protected bool $hasChangedFinancial = false

$hasChangedStockpile

protected bool $hasChangedStockpile = false

$hasChangedWeapons

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

$hasStoppedBuilding

protected array<string|int, int> $hasStoppedBuilding = []

$inhabitableTime

protected int $inhabitableTime

$maturity

protected int $maturity

$password

protected string $password

$planetName

protected string $planetName

$sectorID read-only

protected int $sectorID

$stockpile

protected array<int, int> $stockpile

Methods

__sleep()

public __sleep() : mixed

addMountedWeapon()

public addMountedWeapon(Weapon $weapon, int $orderID) : void
Parameters
$weapon : Weapon
$orderID : int

checkBondMaturity()

public checkBondMaturity([bool $partial = false ]) : void
Parameters
$partial : bool = false

checkForDowngrade()

Returns an array of structure losses due to damage taken.

public checkForDowngrade(int $damage) : array<int, int>
Parameters
$damage : int
Return values
array<int, int>

checkForExcessDefense()

public checkForExcessDefense() : void

clearCache()

public static clearCache() : void

countPlayers()

public countPlayers() : int
Return values
int

createPlanet()

public static createPlanet(int $gameID, int $sectorID[, int $typeID = 1 ][, int $inhabitableTime = null ]) : self
Parameters
$gameID : int
$sectorID : int
$typeID : int = 1
$inhabitableTime : int = null
Return values
self

creditCurrentAttackersForKill()

public creditCurrentAttackersForKill() : void

decreaseArmour()

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

decreaseBonds()

public decreaseBonds(int $num) : void
Parameters
$num : int

decreaseCDs()

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

decreaseCredits()

public decreaseCredits(int $num) : void
Parameters
$num : int

decreaseShields()

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

decreaseStockpile()

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

destroyBuilding()

public destroyBuilding(int $buildingTypeID, int $number) : void
Parameters
$buildingTypeID : int
$number : int

exists()

public exists() : bool
Return values
bool

getAccuracyBonus()

Returns the accuracy bonus for mounted weaons (as a percent)

public getAccuracyBonus() : int
Return values
int

getArmour()

public getArmour() : int
Return values
int

getAttackHREF()

public getAttackHREF() : string
Return values
string

getBondConfirmationHREF()

public getBondConfirmationHREF() : string
Return values
string

getBonds()

public getBonds() : int
Return values
int

getBondTime()

public getBondTime() : int
Return values
int

getBuildHREF()

public getBuildHREF(int $structureID) : string
Parameters
$structureID : int
Return values
string

getBuilding()

public getBuilding(int $buildingTypeID) : int
Parameters
$buildingTypeID : int
Return values
int

getBuildings()

public getBuildings() : array<int, int>
Return values
array<int, int>

getBuildRestriction()

Returns the reason a build cannot be performed, or false if there is no restriction.

public getBuildRestriction(AbstractPlayer $constructor, int $constructionID) : string|false
Parameters
$constructor : AbstractPlayer
$constructionID : int
Return values
string|false

getCancelHREF()

public getCancelHREF(int $structureID) : string
Parameters
$structureID : int
Return values
string

getCDs()

public getCDs() : int
Return values
int

getCombatName()

Returns the name of the planet, intended for combat messages.

public getCombatName() : string
Return values
string

getConstructionTime()

public getConstructionTime(int $constructionID) : int
Parameters
$constructionID : int
Return values
int

getCredits()

public getCredits() : int
Return values
int

getCurrentlyBuilding()

public getCurrentlyBuilding() : array<int, array<string, int>>
Return values
array<int, array<string, int>>

getDisplayName()

Returns the name of the planet, suitably escaped for HTML display.

public getDisplayName() : string
Return values
string

getExamineHREF()

public getExamineHREF() : string
Return values
string

getFinancesHREF()

public getFinancesHREF() : string
Return values
string

getGalaxyPlanets()

public static getGalaxyPlanets(int $gameID, int $galaxyID[, bool $forceUpdate = false ]) : array<int, self>
Parameters
$gameID : int
$galaxyID : int
$forceUpdate : bool = false
Return values
array<int, self>

getGameID()

public getGameID() : int
Return values
int

getInhabitableTime()

public getInhabitableTime() : int
Return values
int

getInterestRate()

public getInterestRate() : float
Return values
float

getLandHREF()

public getLandHREF() : string
Return values
string

getLevel()

public getLevel() : float
Return values
float

getMaturity()

public getMaturity() : int
Return values
int

getMaxArmour()

public getMaxArmour() : int
Return values
int

getMaxAttackers()

public getMaxAttackers() : int
Return values
int

getMaxBuildings()

public getMaxBuildings([int $buildingTypeID = null ]) : mixed
Parameters
$buildingTypeID : int = null

getMaxCDs()

public getMaxCDs() : int
Return values
int

getMaxLanded()

public getMaxLanded() : int
Return values
int

getMaxLevel()

public getMaxLevel() : float
Return values
float

getMaxMountedWeapons()

public getMaxMountedWeapons() : int
Return values
int

getMaxShields()

public getMaxShields() : int
Return values
int

getMountedWeapons()

public getMountedWeapons() : array<int, Weapon>
Return values
array<int, Weapon>

getOwnerID()

public getOwnerID() : int
Return values
int

getPassword()

public getPassword() : string
Return values
string

getPlanet()

public static getPlanet(int $gameID, int $sectorID[, bool $forceUpdate = false ][, DatabaseRecord $dbRecord = null ]) : self
Parameters
$gameID : int
$sectorID : int
$forceUpdate : bool = false
$dbRecord : DatabaseRecord = null
Return values
self

getRemainingStockpile()

public getRemainingStockpile(int $id) : int
Parameters
$id : int
Return values
int

getSectorID()

public getSectorID() : int
Return values
int

getShields()

public getShields() : int
Return values
int

getStockpile()

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

getStructureTypes()

public getStructureTypes([int $structureID = null ]) : mixed
Parameters
$structureID : int = null

getTurretAccuracy()

Returns the modified accuracy of turrets on this planet.

public getTurretAccuracy() : float

Only used for display purposes.

Return values
float

getTypeDescription()

public getTypeDescription() : string
Return values
string

getTypeID()

public getTypeID() : int
Return values
int

getTypeImage()

public getTypeImage() : string
Return values
string

getTypeName()

public getTypeName() : string
Return values
string

getWeapons()

public getWeapons() : array<string|int, Weapon>
Return values
array<string|int, Weapon>

hasArmour()

public hasArmour() : bool
Return values
bool

hasBuilding()

public hasBuilding(int $buildingTypeID) : bool
Parameters
$buildingTypeID : int
Return values
bool

hasCDs()

public hasCDs() : bool
Return values
bool

hasCurrentlyBuilding()

Returns true if there is a building in progress

public hasCurrentlyBuilding() : bool
Return values
bool

hasMountedWeapon()

public hasMountedWeapon(int $orderID) : bool
Parameters
$orderID : int
Return values
bool

hasOwner()

public hasOwner() : bool
Return values
bool

hasPlayers()

public hasPlayers() : bool
Return values
bool

hasShields()

public hasShields() : bool
Return values
bool

hasStockpile()

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

hasStructureType()

public hasStructureType(int $structureID) : bool
Parameters
$structureID : int
Return values
bool

increaseArmour()

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

increaseBonds()

public increaseBonds(int $num) : void
Parameters
$num : int

increaseBuilding()

public increaseBuilding(int $buildingTypeID, int $number) : void
Parameters
$buildingTypeID : int
$number : int

increaseCDs()

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

increaseCredits()

Increases planet credits up to the maximum allowed credits.

public increaseCredits(int $num) : int

Returns the amount that was actually added to handle overflow.

Parameters
$num : int
Return values
int

increaseShields()

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

increaseStockpile()

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

isBusted()

public isBusted() : bool
Return values
bool

isInhabitable()

public isInhabitable() : bool
Return values
bool

moveMountedWeaponDown()

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

moveMountedWeaponUp()

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

removeMountedWeapon()

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

removeOwner()

public removeOwner() : void

removePassword()

public removePassword() : void

removePlanet()

public static removePlanet(int $gameID, int $sectorID) : void
Parameters
$gameID : int
$sectorID : int

savePlanets()

public static savePlanets() : void

setArmour()

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

setBonds()

public setBonds(int $num) : void
Parameters
$num : int

setBuilding()

public setBuilding(int $buildingTypeID, int $number) : void
Parameters
$buildingTypeID : int
$number : int

setCDs()

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

setCredits()

public setCredits(int $num) : void
Parameters
$num : int

setMaturity()

public setMaturity(int $num) : void
Parameters
$num : int

setName()

public setName(string $name) : void
Parameters
$name : string

setOwnerID()

public setOwnerID(int $claimerID) : void
Parameters
$claimerID : int

setPassword()

public setPassword(string $password) : void
Parameters
$password : string

setShields()

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

setStockpile()

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

setTypeID()

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

shootPlayers()

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

startBuilding()

public startBuilding(AbstractPlayer $constructor, int $constructionID) : void
Parameters
$constructor : AbstractPlayer
$constructionID : int
Tags
throws
UserError

If the player cannot build the structure.

stopBuilding()

public stopBuilding(int $constructionID) : bool
Parameters
$constructionID : int
Return values
bool

takeDamage()

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

update()

public update() : void

__construct()

protected __construct(int $gameID, int $sectorID[, DatabaseRecord $dbRecord = null ]) : mixed
Parameters
$gameID : int
$sectorID : int
$dbRecord : DatabaseRecord = null

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

getCompletionModifier()

private getCompletionModifier(int $constructionID) : float
Parameters
$constructionID : int
Return values
float

getConstructionExp()

private getConstructionExp(int $constructionID) : int
Parameters
$constructionID : int
Return values
int

swapMountedWeapons()

private swapMountedWeapons(int $orderID1, int $orderID2) : void
Parameters
$orderID1 : int
$orderID2 : int

        
On this page

Search results