Port
in package
uses
RaceID
Table of Contents
Constants
- CLAIM_PAYOUT = 0.5
- DAMAGE_NEEDED_FOR_ALIGNMENT_CHANGE = 300
- KILLER_RELATIONS_LOSS = 45
- RAZE_PAYOUT = 0.75
- SQL = 'sector_id = :sector_id AND game_id = :game_id'
- BASE_CDS = 725
- BASE_DEFENCES = 500
- BASE_PAYOUT = 0.85
- BASE_REFRESH_PER_HOUR = ['1' => 150, '2' => 110, '3' => 70]
- CDS_PER_LEVEL = 100
- CDS_PER_TEN_MIL_CREDITS = 25
- CHANCE_TO_DOWNGRADE = 1
- DAMAGE_NEEDED_FOR_DOWNGRADE_CHANCE = 325
- DEFENCES_PER_LEVEL = 700
- DEFENCES_PER_TEN_MIL_CREDITS = 250
- GOODS_TRADED_MONEY_MULTIPLIER = 50
- MAX_FEDS_BONUS = 4000
- REFRESH_PER_GOOD = 0.9
- TIME_FEDS_STAY = 1800
- TIME_TO_CREDIT_RAID = 10800
Properties
- $SQLID : array{sector_id: int, game_id: int}
- $armour : int
- $attackStarted : int
- $CACHE_CACHED_PORTS : array<int, array<int, array<int, self|false>>>
- $CACHE_PORTS : array<int, array<int, self>>
- $cachedTime : int
- $cachedVersion : bool
- $cacheIsValid : bool
- $combatDrones : int
- $credits : int
- $experience : int
- $gameID : int
- $goodAmounts : array<int, int>
- $goodAmountsChanged : array<int, bool>
- $goodDistances : array<int, int>
- $goodTransactions : array<int, TransactionType>
- $goodTransactionsChanged : array<int, bool>
- $hasChanged : bool
- $isNew : bool
- $level : int
- $raceID : int
- $reinforceTime : int
- $sectorID : int
- $shields : int
- $upgrade : int
Methods
- __sleep() : mixed
- __wakeup() : mixed
- addCachePort() : void
- addCachePorts() : bool
- addPortGood() : void
- Add good with given ID to the port, with transaction $type as either "Buy" or "Sell", meaning the player buys or sells.
- attackedBy() : void
- buyGoods() : void
- calculateExperiencePercent() : float
- Return the fraction of max exp earned.
- canBeDestroyed() : bool
- Can ports be destroyed after a successful port raid?
- checkDefenses() : void
- checkForDowngrade() : int
- Returns the number of port level downgrades due to damage taken.
- checkForUpgrade() : int
- claimPort() : int
- Claim port for your race after a successful port raid.
- clearCache() : void
- createPort() : self
- decreaseArmour() : void
- decreaseCDs() : void
- decreaseCredits() : void
- decreaseGood() : void
- decreaseGoodAmount() : void
- decreaseLevel() : void
- decreaseShields() : void
- decreaseUpgrade() : void
- destroyPort() : int
- Permanently destroy the port after a successful port raid.
- exists() : bool
- getAllGoodIDs() : array<string|int, int>
- getArmour() : int
- getAttackersToCredit() : array<string|int, Player>
- getAttackHREF() : string
- getAttackStarted() : int
- getBaseExperience() : float
- getBuyGoodIDs() : array<string|int, int>
- Get IDs of goods that can be bought from the port by the trader
- getCachedPort() : self
- getCachedTime() : int
- getCDs() : int
- getCredits() : int
- getCreditsPercent() : float
- getDisplayName() : string
- getExperience() : int
- getGalaxyPorts() : array<int, self>
- getGame() : Game
- getGameID() : int
- getGoodAmount() : int
- getGoodDistance() : int
- getGoodTransaction() : TransactionType
- Returns the transaction type for this good (Buy or Sell).
- getGoodTransactions() : array<int, TransactionType>
- getIdealPrice() : int
- getLevel() : int
- getLootGoodHREF() : string
- getMaxLevel() : int
- getMaxLevelByGame() : int
- getNumWeapons() : int
- getOfferPrice() : int
- getPayoutHREF() : string
- getPort() : self
- getRaceID() : int
- getRaceName() : string
- getRaidWarningHREF() : string
- getReinforcePercent() : float
- getReinforceTime() : int
- getSector() : Sector
- getSectorID() : int
- getSellGoodIDs() : array<string|int, int>
- Get IDs of goods that can be sold to the port by the trader
- getShields() : int
- getTradeRestriction() : string|false
- getUpgrade() : int
- getUpgradePercent() : float
- getUpgradeRequirement() : int
- getVisibleGoodsBought() : array<int, TradeGood>
- Get goods that can be bought by $player from the port
- getVisibleGoodsSold() : array<int, TradeGood>
- Get goods that can be sold by $player to the port
- getWeapons() : array<string|int, Weapon>
- hasArmour() : bool
- hasCDs() : bool
- hasGood() : bool
- hasShields() : bool
- idealPrice() : int
- Generic ideal price calculation, given all parameters as input.
- increaseCredits() : void
- increaseExperience() : void
- increaseGoodAmount() : void
- increaseLevel() : void
- increaseUpgrade() : void
- isBusted() : bool
- isCachedVersion() : bool
- isCreditedAttacker() : bool
- Identifies if the given $player is a credited attacker of this port.
- isUnderAttack() : bool
- killPortByPlayer() : array{}
- lootPort() : int
- Get a fraction of the credits stored in the port for looting after a successful port raid.
- razePort() : int
- Get a reduced fraction of the credits stored in the port for razing after a successful port raid.
- removePort() : void
- removePortGood() : void
- Remove good with given ID from the port.
- savePorts() : void
- sellGoods() : void
- setArmour() : void
- setCDs() : void
- setCredits() : void
- setCreditsToDefault() : void
- setExperience() : void
- setLevel() : void
- setPortGoods() : bool
- Manually set port goods.
- setRaceID() : void
- setReinforceTime() : void
- setShields() : void
- setUpgrade() : void
- shootPlayers() : PortCombatResults
- stealGoods() : void
- takeDamage() : TakenDamageData
- update() : void
- updateSectorPlayersCache() : void
- upgradeToLevel() : void
- This function should only be used in universe creation to set ports to a specific level.
- __construct() : mixed
- creditCurrentAttackersForKill() : void
- doDowngrade() : void
- doUpgrade() : void
- getGoodClassAtLevel() : int
- Returns the good class associated with the given level.
- payout() : bool
- refreshGoods() : void
- Adds extra stock to goods in the tier above a good that was traded
- selectAndAddGood() : TradeGood
- selectAndRemoveGood() : void
- setCachedTime() : void
- takeDamageToArmour() : int
- takeDamageToCDs() : int
- takeDamageToShields() : int
- tradeGoods() : void
- getGoods() : void
- getVisibleGoods() : array<int, TradeGood>
- restockGood() : void
- Used for the automatic resupplying of all goods over time
- setAttackStarted() : void
- setGoodAmount() : void
- updateAttackStarted() : void
Constants
CLAIM_PAYOUT
public
mixed
CLAIM_PAYOUT
= 0.5
DAMAGE_NEEDED_FOR_ALIGNMENT_CHANGE
public
mixed
DAMAGE_NEEDED_FOR_ALIGNMENT_CHANGE
= 300
KILLER_RELATIONS_LOSS
public
mixed
KILLER_RELATIONS_LOSS
= 45
RAZE_PAYOUT
public
mixed
RAZE_PAYOUT
= 0.75
SQL
public
mixed
SQL
= 'sector_id = :sector_id AND game_id = :game_id'
BASE_CDS
protected
mixed
BASE_CDS
= 725
BASE_DEFENCES
protected
mixed
BASE_DEFENCES
= 500
BASE_PAYOUT
protected
mixed
BASE_PAYOUT
= 0.85
BASE_REFRESH_PER_HOUR
protected
mixed
BASE_REFRESH_PER_HOUR
= ['1' => 150, '2' => 110, '3' => 70]
CDS_PER_LEVEL
protected
mixed
CDS_PER_LEVEL
= 100
CDS_PER_TEN_MIL_CREDITS
protected
mixed
CDS_PER_TEN_MIL_CREDITS
= 25
CHANCE_TO_DOWNGRADE
protected
mixed
CHANCE_TO_DOWNGRADE
= 1
DAMAGE_NEEDED_FOR_DOWNGRADE_CHANCE
protected
mixed
DAMAGE_NEEDED_FOR_DOWNGRADE_CHANCE
= 325
DEFENCES_PER_LEVEL
protected
mixed
DEFENCES_PER_LEVEL
= 700
DEFENCES_PER_TEN_MIL_CREDITS
protected
mixed
DEFENCES_PER_TEN_MIL_CREDITS
= 250
GOODS_TRADED_MONEY_MULTIPLIER
protected
mixed
GOODS_TRADED_MONEY_MULTIPLIER
= 50
MAX_FEDS_BONUS
protected
mixed
MAX_FEDS_BONUS
= 4000
REFRESH_PER_GOOD
protected
mixed
REFRESH_PER_GOOD
= 0.9
TIME_FEDS_STAY
protected
mixed
TIME_FEDS_STAY
= 1800
TIME_TO_CREDIT_RAID
protected
mixed
TIME_TO_CREDIT_RAID
= 10800
Properties
$SQLID read-only
public
array{sector_id: int, game_id: int}
$SQLID
$armour
protected
int
$armour
$attackStarted
protected
int
$attackStarted
$CACHE_CACHED_PORTS
protected
static array<int, array<int, array<int, self|false>>>
$CACHE_CACHED_PORTS
= []
$CACHE_PORTS
protected
static array<int, array<int, self>>
$CACHE_PORTS
= []
$cachedTime
protected
int
$cachedTime
$cachedVersion
protected
bool
$cachedVersion
= false
$cacheIsValid
protected
bool
$cacheIsValid
= true
$combatDrones
protected
int
$combatDrones
$credits
protected
int
$credits
$experience
protected
int
$experience
$gameID read-only
protected
int
$gameID
$goodAmounts
protected
array<int, int>
$goodAmounts
$goodAmountsChanged
protected
array<int, bool>
$goodAmountsChanged
= []
$goodDistances
protected
array<int, int>
$goodDistances
$goodTransactions
protected
array<int, TransactionType>
$goodTransactions
$goodTransactionsChanged
protected
array<int, bool>
$goodTransactionsChanged
= []
$hasChanged
protected
bool
$hasChanged
= false
$isNew
protected
bool
$isNew
= false
$level
protected
int
$level
$raceID
protected
int
$raceID
$reinforceTime
protected
int
$reinforceTime
$sectorID read-only
protected
int
$sectorID
$shields
protected
int
$shields
$upgrade
protected
int
$upgrade
Methods
__sleep()
public
__sleep() : mixed
__wakeup()
public
__wakeup() : mixed
addCachePort()
public
addCachePort(int $accountID) : void
Parameters
- $accountID : int
addCachePorts()
public
addCachePorts(array<string|int, int> $accountIDs) : bool
Parameters
- $accountIDs : array<string|int, int>
Return values
booladdPortGood()
Add good with given ID to the port, with transaction $type as either "Buy" or "Sell", meaning the player buys or sells.
public
addPortGood(int $goodID, TransactionType $type) : void
If the port already has this transaction, do nothing.
NOTE: make sure to adjust the port level appropriately if calling this function directly.
Parameters
- $goodID : int
- $type : TransactionType
attackedBy()
public
attackedBy(AbstractPlayer $trigger, array<string|int, AbstractPlayer> $attackers) : void
Parameters
- $trigger : AbstractPlayer
- $attackers : array<string|int, AbstractPlayer>
buyGoods()
public
buyGoods(TradeGood $good, int $goodsTraded, int $idealPrice, int $bargainPrice, int $exp) : void
Parameters
- $good : TradeGood
- $goodsTraded : int
- $idealPrice : int
- $bargainPrice : int
- $exp : int
calculateExperiencePercent()
Return the fraction of max exp earned.
public
calculateExperiencePercent(int $idealPrice, int $bargainPrice, TransactionType $transactionType) : float
Parameters
- $idealPrice : int
- $bargainPrice : int
- $transactionType : TransactionType
Return values
floatcanBeDestroyed()
Can ports be destroyed after a successful port raid?
public
canBeDestroyed() : bool
Return values
boolcheckDefenses()
public
checkDefenses() : void
checkForDowngrade()
Returns the number of port level downgrades due to damage taken.
public
checkForDowngrade(int $damage) : int
Parameters
- $damage : int
Return values
intcheckForUpgrade()
public
checkForUpgrade() : int
Return values
intclaimPort()
Claim port for your race after a successful port raid.
public
claimPort(AbstractPlayer $killer) : int
Parameters
- $killer : AbstractPlayer
Return values
intclearCache()
public
static clearCache() : void
createPort()
public
static createPort(int $gameID, int $sectorID) : self
Parameters
- $gameID : int
- $sectorID : int
Return values
selfdecreaseArmour()
public
decreaseArmour(int $number) : void
Parameters
- $number : int
decreaseCDs()
public
decreaseCDs(int $number) : void
Parameters
- $number : int
decreaseCredits()
public
decreaseCredits(int $credits) : void
Parameters
- $credits : int
decreaseGood()
public
decreaseGood(TradeGood $good, int $amount, bool $doRefresh) : void
Parameters
- $good : TradeGood
- $amount : int
- $doRefresh : bool
decreaseGoodAmount()
public
decreaseGoodAmount(int $goodID, int $amount) : void
Parameters
- $goodID : int
- $amount : int
decreaseLevel()
public
decreaseLevel(int $level) : void
Parameters
- $level : int
decreaseShields()
public
decreaseShields(int $number) : void
Parameters
- $number : int
decreaseUpgrade()
public
decreaseUpgrade(int $upgrade) : void
Parameters
- $upgrade : int
destroyPort()
Permanently destroy the port after a successful port raid.
public
destroyPort(AbstractPlayer $killer) : int
Parameters
- $killer : AbstractPlayer
Return values
intexists()
public
exists() : bool
Return values
boolgetAllGoodIDs()
public
getAllGoodIDs() : array<string|int, int>
Return values
array<string|int, int>getArmour()
public
getArmour() : int
Return values
intgetAttackersToCredit()
public
getAttackersToCredit() : array<string|int, Player>
Return values
array<string|int, Player>getAttackHREF()
public
getAttackHREF() : string
Return values
stringgetAttackStarted()
public
getAttackStarted() : int
Return values
intgetBaseExperience()
public
static getBaseExperience(int $cargo, int $distance) : float
Parameters
- $cargo : int
- $distance : int
Return values
floatgetBuyGoodIDs()
Get IDs of goods that can be bought from the port by the trader
public
getBuyGoodIDs() : array<string|int, int>
Return values
array<string|int, int>getCachedPort()
public
static getCachedPort(int $gameID, int $sectorID, int $accountID[, bool $forceUpdate = false ]) : self
Parameters
- $gameID : int
- $sectorID : int
- $accountID : int
- $forceUpdate : bool = false
Tags
Return values
selfgetCachedTime()
public
getCachedTime() : int
Return values
intgetCDs()
public
getCDs() : int
Return values
intgetCredits()
public
getCredits() : int
Return values
intgetCreditsPercent()
public
getCreditsPercent() : float
Return values
floatgetDisplayName()
public
getDisplayName() : string
Return values
stringgetExperience()
public
getExperience() : int
Return values
intgetGalaxyPorts()
public
static getGalaxyPorts(int $gameID, int $galaxyID[, bool $forceUpdate = false ]) : array<int, self>
Parameters
- $gameID : int
- $galaxyID : int
- $forceUpdate : bool = false
Return values
array<int, self>getGame()
public
getGame() : Game
Return values
GamegetGameID()
public
getGameID() : int
Return values
intgetGoodAmount()
public
getGoodAmount(int $goodID) : int
Parameters
- $goodID : int
Return values
intgetGoodDistance()
public
getGoodDistance(int $goodID) : int
Parameters
- $goodID : int
Return values
intgetGoodTransaction()
Returns the transaction type for this good (Buy or Sell).
public
getGoodTransaction(int $goodID) : TransactionType
Note: this is the player's transaction, not the port's.
Parameters
- $goodID : int
Return values
TransactionTypegetGoodTransactions()
public
getGoodTransactions() : array<int, TransactionType>
Return values
array<int, TransactionType>getIdealPrice()
public
getIdealPrice(int $goodID, TransactionType $transactionType, int $numGoods, int $relations) : int
Parameters
- $goodID : int
- $transactionType : TransactionType
- $numGoods : int
- $relations : int
Return values
intgetLevel()
public
getLevel() : int
Return values
intgetLootGoodHREF()
public
getLootGoodHREF(int $boughtGoodID) : string
Parameters
- $boughtGoodID : int
Return values
stringgetMaxLevel()
public
getMaxLevel() : int
Return values
intgetMaxLevelByGame()
public
static getMaxLevelByGame(int $gameID) : int
Parameters
- $gameID : int
Return values
intgetNumWeapons()
public
getNumWeapons() : int
Return values
intgetOfferPrice()
public
getOfferPrice(int $idealPrice, int $relations, TransactionType $transactionType) : int
Parameters
- $idealPrice : int
- $relations : int
- $transactionType : TransactionType
Return values
intgetPayoutHREF()
public
getPayoutHREF(PortPayoutType $payoutType) : string
Parameters
- $payoutType : PortPayoutType
Return values
stringgetPort()
public
static getPort(int $gameID, int $sectorID[, bool $forceUpdate = false ][, DatabaseRecord|null $dbRecord = null ]) : self
Parameters
- $gameID : int
- $sectorID : int
- $forceUpdate : bool = false
- $dbRecord : DatabaseRecord|null = null
Return values
selfgetRaceID()
public
getRaceID() : int
Return values
intgetRaceName()
public
getRaceName() : string
Return values
stringgetRaidWarningHREF()
public
getRaidWarningHREF() : string
Return values
stringgetReinforcePercent()
public
getReinforcePercent() : float
Return values
floatgetReinforceTime()
public
getReinforceTime() : int
Return values
intgetSector()
public
getSector() : Sector
Return values
SectorgetSectorID()
public
getSectorID() : int
Return values
intgetSellGoodIDs()
Get IDs of goods that can be sold to the port by the trader
public
getSellGoodIDs() : array<string|int, int>
Return values
array<string|int, int>getShields()
public
getShields() : int
Return values
intgetTradeRestriction()
public
getTradeRestriction(AbstractPlayer $player) : string|false
Parameters
- $player : AbstractPlayer
Return values
string|falsegetUpgrade()
public
getUpgrade() : int
Return values
intgetUpgradePercent()
public
getUpgradePercent() : float
Return values
floatgetUpgradeRequirement()
public
getUpgradeRequirement() : int
Return values
intgetVisibleGoodsBought()
Get goods that can be bought by $player from the port
public
getVisibleGoodsBought([AbstractPlayer|null $player = null ]) : array<int, TradeGood>
Parameters
- $player : AbstractPlayer|null = null
Return values
array<int, TradeGood>getVisibleGoodsSold()
Get goods that can be sold by $player to the port
public
getVisibleGoodsSold([AbstractPlayer|null $player = null ]) : array<int, TradeGood>
Parameters
- $player : AbstractPlayer|null = null
Return values
array<int, TradeGood>getWeapons()
public
getWeapons() : array<string|int, Weapon>
Return values
array<string|int, Weapon>hasArmour()
public
hasArmour() : bool
Return values
boolhasCDs()
public
hasCDs() : bool
Return values
boolhasGood()
public
hasGood(int $goodID[, TransactionType|null $type = null ]) : bool
Parameters
- $goodID : int
- $type : TransactionType|null = null
Return values
boolhasShields()
public
hasShields() : bool
Return values
boolidealPrice()
Generic ideal price calculation, given all parameters as input.
public
static idealPrice(int $goodID, TransactionType $transactionType, int $numGoods, int $relations, int $supply, int $dist) : int
Parameters
- $goodID : int
- $transactionType : TransactionType
- $numGoods : int
- $relations : int
- $supply : int
- $dist : int
Return values
intincreaseCredits()
public
increaseCredits(int $credits) : void
Parameters
- $credits : int
increaseExperience()
public
increaseExperience(int $experience) : void
Parameters
- $experience : int
increaseGoodAmount()
public
increaseGoodAmount(int $goodID, int $amount) : void
Parameters
- $goodID : int
- $amount : int
increaseLevel()
public
increaseLevel(int $level) : void
Parameters
- $level : int
increaseUpgrade()
public
increaseUpgrade(int $upgrade) : void
Parameters
- $upgrade : int
isBusted()
public
isBusted() : bool
Return values
boolisCachedVersion()
public
isCachedVersion() : bool
Return values
boolisCreditedAttacker()
Identifies if the given $player is a credited attacker of this port.
public
isCreditedAttacker(AbstractPlayer $player) : bool
Parameters
- $player : AbstractPlayer
Return values
boolisUnderAttack()
public
isUnderAttack() : bool
Return values
boolkillPortByPlayer()
public
killPortByPlayer(AbstractPlayer $killer) : array{}
Parameters
- $killer : AbstractPlayer
Return values
array{}lootPort()
Get a fraction of the credits stored in the port for looting after a successful port raid.
public
lootPort(AbstractPlayer $killer) : int
Parameters
- $killer : AbstractPlayer
Return values
intrazePort()
Get a reduced fraction of the credits stored in the port for razing after a successful port raid.
public
razePort(AbstractPlayer $killer) : int
Parameters
- $killer : AbstractPlayer
Return values
intremovePort()
public
static removePort(int $gameID, int $sectorID) : void
Parameters
- $gameID : int
- $sectorID : int
removePortGood()
Remove good with given ID from the port.
public
removePortGood(int $goodID) : void
If the port does not have this good, do nothing.
NOTE: make sure to adjust the port level appropriately if calling this function directly.
Parameters
- $goodID : int
savePorts()
public
static savePorts() : void
sellGoods()
public
sellGoods(TradeGood $good, int $goodsTraded, int $exp) : void
Parameters
- $good : TradeGood
- $goodsTraded : int
- $exp : int
setArmour()
public
setArmour(int $armour) : void
Parameters
- $armour : int
setCDs()
public
setCDs(int $combatDrones) : void
Parameters
- $combatDrones : int
setCredits()
public
setCredits(int $credits) : void
Parameters
- $credits : int
setCreditsToDefault()
public
setCreditsToDefault() : void
setExperience()
public
setExperience(int $experience) : void
Parameters
- $experience : int
setLevel()
public
setLevel(int $level) : void
Parameters
- $level : int
setPortGoods()
Manually set port goods.
public
setPortGoods(array<int, TransactionType> $goodTransactions) : bool
Only modifies goods that need to change. Returns false on invalid input.
Parameters
- $goodTransactions : array<int, TransactionType>
Return values
boolsetRaceID()
public
setRaceID(int $raceID) : void
Parameters
- $raceID : int
setReinforceTime()
public
setReinforceTime(int $reinforceTime) : void
Parameters
- $reinforceTime : int
setShields()
public
setShields(int $shields) : void
Parameters
- $shields : int
setUpgrade()
public
setUpgrade(int $upgrade) : void
Parameters
- $upgrade : int
shootPlayers()
public
shootPlayers(array<string|int, mixed> $targetPlayers) : PortCombatResults
Parameters
- $targetPlayers : array<string|int, mixed>
Return values
PortCombatResultsstealGoods()
public
stealGoods(TradeGood $good, int $goodsTraded) : void
Parameters
- $good : TradeGood
- $goodsTraded : int
takeDamage()
public
takeDamage(WeaponDamageData $damage) : TakenDamageData
Parameters
- $damage : WeaponDamageData
Return values
TakenDamageDataupdate()
public
update() : void
updateSectorPlayersCache()
public
updateSectorPlayersCache() : void
upgradeToLevel()
This function should only be used in universe creation to set ports to a specific level.
public
upgradeToLevel(int $level) : void
Parameters
- $level : int
__construct()
protected
__construct(int $gameID, int $sectorID[, DatabaseRecord|null $dbRecord = null ]) : mixed
Parameters
- $gameID : int
- $sectorID : int
- $dbRecord : DatabaseRecord|null = null
creditCurrentAttackersForKill()
protected
creditCurrentAttackersForKill() : void
doDowngrade()
protected
doDowngrade() : void
doUpgrade()
protected
doUpgrade() : void
getGoodClassAtLevel()
Returns the good class associated with the given level.
protected
getGoodClassAtLevel([int|null $level = null ]) : int
If no level specified, will use the current port level. This is useful for determining what trade goods to add/remove.
Parameters
- $level : int|null = null
Return values
intpayout()
protected
payout(AbstractPlayer $killer, int $credits, string $payoutType) : bool
Parameters
- $killer : AbstractPlayer
- $credits : int
- $payoutType : string
Return values
boolrefreshGoods()
Adds extra stock to goods in the tier above a good that was traded
protected
refreshGoods(int $classTraded, int $amountTraded) : void
Parameters
- $classTraded : int
- $amountTraded : int
selectAndAddGood()
protected
selectAndAddGood(int $goodClass) : TradeGood
Parameters
- $goodClass : int
Return values
TradeGoodselectAndRemoveGood()
protected
selectAndRemoveGood(int $goodClass) : void
Parameters
- $goodClass : int
setCachedTime()
protected
setCachedTime(int $cachedTime) : void
Parameters
- $cachedTime : int
takeDamageToArmour()
protected
takeDamageToArmour(int $damage) : int
Parameters
- $damage : int
Return values
inttakeDamageToCDs()
protected
takeDamageToCDs(int $damage) : int
Parameters
- $damage : int
Return values
inttakeDamageToShields()
protected
takeDamageToShields(int $damage) : int
Parameters
- $damage : int
Return values
inttradeGoods()
protected
tradeGoods(TradeGood $good, int $goodsTraded, int $exp) : void
Parameters
- $good : TradeGood
- $goodsTraded : int
- $exp : int
getGoods()
private
getGoods() : void
getVisibleGoods()
private
getVisibleGoods(array<string|int, int> $goodIDs[, AbstractPlayer|null $player = null ]) : array<int, TradeGood>
Parameters
- $goodIDs : array<string|int, int>
- $player : AbstractPlayer|null = null
Return values
array<int, TradeGood>restockGood()
Used for the automatic resupplying of all goods over time
private
restockGood(int $goodID, int $secondsSinceLastUpdate) : void
Parameters
- $goodID : int
- $secondsSinceLastUpdate : int
setAttackStarted()
private
setAttackStarted(int $time) : void
Parameters
- $time : int
setGoodAmount()
private
setGoodAmount(int $goodID, int $amount[, bool $doUpdate = true ]) : void
Parameters
- $goodID : int
- $amount : int
- $doUpdate : bool = true
updateAttackStarted()
private
updateAttackStarted() : void