Documentation

EnhancedWeaponEvent
in package

Defines enhanced weapon sale events for weapon shops.

Table of Contents

Constants

DURATION  = 21600
GRACE_PERIOD  = 3600

Properties

$expires  : int
$gameID  : int
$locationTypeID  : int
$sectorID  : int
$weapon  : Weapon
$weaponTypeID  : int

Methods

getDurationRemainingPercent()  : float
Returns the amount of time left in the event as a percent of the total duration of the event.
getExpireTime()  : int
getLatestEvent()  : self
Get the most recent event.
getSectorID()  : int
getShopEvents()  : array<string|int, self>
Return all the valid events for the given location in a sector.
getWeapon()  : Weapon
__construct()  : mixed
createEvent()  : self
Create a new event.
getEventFromDatabase()  : self
Convenience function to instantiate an event from a query result.

Constants

Properties

Methods

getDurationRemainingPercent()

Returns the amount of time left in the event as a percent of the total duration of the event.

public getDurationRemainingPercent() : float
Return values
float

getLatestEvent()

Get the most recent event.

public static getLatestEvent(int $gameID) : self

This function also does the work of cleaning up expired events and creating new ones when necessary.

Parameters
$gameID : int
Return values
self

getShopEvents()

Return all the valid events for the given location in a sector.

public static getShopEvents(int $gameID, int $sectorID, int $locationID) : array<string|int, self>
Parameters
$gameID : int
$sectorID : int
$locationID : int
Return values
array<string|int, self>

__construct()

protected __construct(int $gameID, int $weaponTypeID, int $locationTypeID, int $sectorID, int $expires, bool $bonusAccuracy, bool $bonusDamage) : mixed
Parameters
$gameID : int
$weaponTypeID : int
$locationTypeID : int
$sectorID : int
$expires : int
$bonusAccuracy : bool
$bonusDamage : bool

createEvent()

Create a new event.

private static createEvent(int $gameID) : self

Events are generated randomly across all weapon types available in the game, and then randomly across locations that offer that weapon type.

Parameters
$gameID : int
Return values
self

        
On this page

Search results