Skip to content

Commit d061028

Browse files
committed
updating fleetController.php and adding some other game plan thoughts.
1 parent 5e8f060 commit d061028

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

LOGIC.md

+30
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,33 @@ Commands that simply read data from the system will return the data immediately.
1515
The original bnt performed system updates server side by executing the scheduler via cron. The plan for bnt2 is to still use cron (or a cron-like service) to add a system update commands to the queue - which would then be executed by the queue runner.
1616
This again removes the threat of some race conditions and also allows for dealing with the possibility of heavy system load.
1717

18+
## Ship numbers
19+
20+
- hull: is the size of the hull dictating cargo capacity but also target size
21+
- engines: motive forces for the ship aids in both defensive and offensive capabilities as well.
22+
- power: provides energy for engines, weapons, shields and cloak - too low and these dependent systems will suffer and perform at a degraded level
23+
- computer: enhances offensive capabilities and sensor analysis
24+
- sensors: provides scanning information and potentially sees past adversarial cloaks
25+
- weapons: primary offensive capabilities - directly affects damage inflicted
26+
- shields: regenerative defensive system - regenerates between combat sessions
27+
- armour: ablative defensive system - must be repaired to restore damage
28+
- cloak: a system that hides the ship from others
29+
30+
## Planet numbers
31+
32+
- planets with no player_id are unowned and can be claimed by players
33+
- shields and weapons are similar to the values for ships but can be much larger (in theory)
34+
- commodity quantities, production facilities are stored in the production table
35+
36+
### Combat
37+
38+
- offensive and defensive are both a function of computer, engines, hull, sensors and cloak
39+
- offensive is modified by weapons
40+
- defensive is modified by shields and armour
41+
- damage inflicted is a direct function of weapons, modified by computer and sensors.
42+
- damage sustained is opponent's inflicted damage, modified by shields and armour.
43+
- damage is applied first to shields and then to armour.
44+
- if armour is reduced to zero, the ship is destroyed.
45+
- when a ship is destroyed, if the fleet's cargo capacity is reduced below the current cargo carried, random cargo is jettisoned until the capacity limit is met.
46+
- jettisoned cargo may be salvaged by the attacker
47+
- if there are defender aligned fleets or planets in the same sector as the combat - they join as defenders in the combat.

src/Controller/fleetController.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function update(string $id): void
9595
Flight::status(404,'Fleet not found');
9696
}
9797
if($this->target->getOwnerID() == Flight::get('current_player_id')) {
98-
//Flight::dump($this->request->data);
98+
//player owns this fleet
9999
if(isset($this->request->data['sector_id']) && $this->request->data['sector_id'] != $this->target->sector->id) {
100100
//use warp link to another sector TODO: ->Q
101101
if (in_array($this->request->data['sector_id'],array_column($this->target->sector->link, 'destination_id'))) {
@@ -144,6 +144,9 @@ public function update(string $id): void
144144
} elseif(isset($this->request->data['purchase'])) {
145145
//buy commodity from port and add it to the fleet
146146
//TODO: lots (credits for one)
147+
//is there an appropriate port in the same sector as the fleet?
148+
//is there available commodity for sale?
149+
//
147150
} else {
148151
Flight::status(422,'No recognized operation');
149152
}

0 commit comments

Comments
 (0)