Attack
extends Missions
in package
Attack Class
Table of Contents
- DEFENSE_MAX_ID = 408
- DEFENSE_MIN_ID = 401
- SHIP_MAX_ID = 215
- SHIP_MIN_ID = 202
- $combat_caps : mixed
- $lang : mixed
- $missionsModel : Missions
- Contains the model
- $objects : mixed
- $pricelist : mixed
- $resource : mixed
- $hyperspace_technology : array<string|int, mixed>
- Contains each player hyperspace technology level
- __construct() : void
- Constructor
- attackMission() : void
- attackMission
- canCompleteMission() : bool
- Check if the mission can be completed
- canStartMission() : bool
- Check if the mission can be started
- loadLang() : void
- Load a language file using CI Library
- makeUpdate() : void
- Update planet resources, ships, and queues
- removeFleet() : void
- removeFleet
- restoreFleet() : void
- restoreFleet
- returnFleet() : void
- returnFleet
- storeResources() : void
- storeResources
- buildReportLink() : string
- buildReportLink
- createNewReportAndSendIt() : void
- Create a new report and attach it to a message
- getCapacity() : int
- Get cargo capacity for each ship
- getPlayerGroup() : PlayerGroup
- getPlayerGroup
- getPlayerGroupFromQuery() : PlayerGroup
- Get player group from query
- getShipType() : mixed|(\Ship|\Defense)
- getShipType
- plunder() : array<string|int, mixed>
- plunder
- setHyperspaceTechLevel() : void
- Set hyperspace technology level
- setObjectsClass() : void
- setObjectsClass
- updateAttackers() : array<string|int, mixed>
- updateAttackers
- updateDebris() : void
- updateDebris
- updateDefenders() : void
- updateDefenders
- updateMoon() : void
- updateMoon
Constants
DEFENSE_MAX_ID
public
mixed
DEFENSE_MAX_ID
= 408
DEFENSE_MIN_ID
public
mixed
DEFENSE_MIN_ID
= 401
SHIP_MAX_ID
public
mixed
SHIP_MAX_ID
= 215
SHIP_MIN_ID
public
mixed
SHIP_MIN_ID
= 202
Properties
$combat_caps
protected
mixed
$combat_caps
$lang
protected
static mixed
$lang
$missionsModel
Contains the model
protected
Missions
$missionsModel
$objects
protected
static mixed
$objects
$pricelist
protected
mixed
$pricelist
$resource
protected
mixed
$resource
$hyperspace_technology
Contains each player hyperspace technology level
private
array<string|int, mixed>
$hyperspace_technology
= []
Methods
__construct()
Constructor
public
__construct() : void
Return values
void —attackMission()
attackMission
public
attackMission(array<string|int, mixed> $fleet_row) : void
Parameters
- $fleet_row : array<string|int, mixed>
-
Fleet row
Return values
void —canCompleteMission()
Check if the mission can be completed
protected
canCompleteMission(array<string|int, mixed> $fleet) : bool
Parameters
- $fleet : array<string|int, mixed>
Return values
bool —canStartMission()
Check if the mission can be started
protected
canStartMission(array<string|int, mixed> $fleet) : bool
Parameters
- $fleet : array<string|int, mixed>
Return values
bool —loadLang()
Load a language file using CI Library
protected
loadLang(string|array<string|int, mixed> $language_file) : void
Parameters
- $language_file : string|array<string|int, mixed>
Return values
void —makeUpdate()
Update planet resources, ships, and queues
protected
makeUpdate(int $galaxy, int $system, int $planet, int $type) : void
Parameters
- $galaxy : int
-
Galaxy
- $system : int
-
System
- $planet : int
-
Planet
- $type : int
-
Planet Type
Return values
void —removeFleet()
removeFleet
protected
removeFleet(int $fleet_id) : void
Parameters
- $fleet_id : int
-
Fleed ID
Return values
void —restoreFleet()
restoreFleet
protected
restoreFleet(array<string|int, mixed> $fleet_row[, bool $start = true ]) : void
Parameters
- $fleet_row : array<string|int, mixed>
-
Fleet row
- $start : bool = true
-
Start
Return values
void —returnFleet()
returnFleet
protected
returnFleet(int $fleet_id) : void
Parameters
- $fleet_id : int
-
Fleed ID
Return values
void —storeResources()
storeResources
protected
storeResources(array<string|int, mixed> $fleet_row[, bool $start = false ]) : void
Parameters
- $fleet_row : array<string|int, mixed>
-
Fleet row
- $start : bool = false
-
Start
Return values
void —buildReportLink()
buildReportLink
private
buildReportLink(string $color, string $rid, mixed $target_planet_name, int $g, int $s, int $p) : string
Parameters
- $color : string
-
Color
- $rid : string
-
Report ID
- $target_planet_name : mixed
- $g : int
-
Galaxy
- $s : int
-
System
- $p : int
-
Planet
Return values
string —createNewReportAndSendIt()
Create a new report and attach it to a message
private
createNewReportAndSendIt(array<string|int, mixed> $fleet_row, Report $report, mixed $target_planet_name) : void
Parameters
- $fleet_row : array<string|int, mixed>
-
Fleet Row
- $report : Report
-
Report
- $target_planet_name : mixed
Return values
void —getCapacity()
Get cargo capacity for each ship
private
getCapacity(PlayerGroup $players) : int
Parameters
- $players : PlayerGroup
-
Players
Return values
int —getPlayerGroup()
getPlayerGroup
private
getPlayerGroup(array<string|int, mixed> $fleet_row) : PlayerGroup
Parameters
- $fleet_row : array<string|int, mixed>
-
Fleet row
Return values
PlayerGroup —getPlayerGroupFromQuery()
Get player group from query
private
getPlayerGroupFromQuery(array<string|int, mixed> $result[, bool $target_user = [] ]) : PlayerGroup
Parameters
- $result : array<string|int, mixed>
-
Result
- $target_user : bool = []
-
Target User
Return values
PlayerGroup —getShipType()
getShipType
private
getShipType(int $id, int $count) : mixed|(\Ship|\Defense)
Parameters
- $id : int
-
Ship ID
- $count : int
-
Ship Count
Return values
mixed|(\Ship|\Defense) —plunder()
plunder
private
plunder(int $capacity, int $metal, int $crystal, int $deuterium) : array<string|int, mixed>
Parameters
- $capacity : int
-
Capacity
- $metal : int
-
Metal
- $crystal : int
-
Crystal
- $deuterium : int
-
Deuterium
Return values
array<string|int, mixed> —setHyperspaceTechLevel()
Set hyperspace technology level
private
setHyperspaceTechLevel(int $user_id, int $level) : void
Parameters
- $user_id : int
- $level : int
Return values
void —setObjectsClass()
setObjectsClass
private
setObjectsClass() : void
Return values
void —updateAttackers()
updateAttackers
private
updateAttackers(Battle $playerGroupBeforeBattle, Battle $playerGroupAfterBattle, array<string|int, mixed> $target_planet) : array<string|int, mixed>
Parameters
- $playerGroupBeforeBattle : Battle
-
Player Group before battle
- $playerGroupAfterBattle : Battle
-
Player Group after battle
- $target_planet : array<string|int, mixed>
-
Target planet
Return values
array<string|int, mixed> —updateDebris()
updateDebris
private
updateDebris(array<string|int, mixed> $fleet_row, Report $report) : void
Parameters
- $fleet_row : array<string|int, mixed>
-
Fleet row
- $report : Report
-
Report
Return values
void —updateDefenders()
updateDefenders
private
updateDefenders(Battle $playerGroupBeforeBattle, Battle $playerGroupAfterBattle, array<string|int, mixed> $target_planet, array<string|int, mixed> $steal) : void
Parameters
- $playerGroupBeforeBattle : Battle
-
Player Group before battle
- $playerGroupAfterBattle : Battle
-
Player Group after battle
- $target_planet : array<string|int, mixed>
-
Target planet
- $steal : array<string|int, mixed>
-
Stealed resources
Return values
void —updateMoon()
updateMoon
private
updateMoon(array<string|int, mixed> $fleet_row, Report $report, int $target_userId) : void
Parameters
- $fleet_row : array<string|int, mixed>
-
Fleet Row
- $report : Report
-
Report
- $target_userId : int
-
Target User ID