Skip to content

Commit

Permalink
monir stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Bertie690 committed Sep 18, 2024
1 parent 2abbefe commit cf8259b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 4 additions & 2 deletions cs/fleet.go
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ func (fleet *Fleet) moveFleet(rules *Rules, mapObjectGetter mapObjectGetter, pla
return &fleetMoveInterrupted{reason: fleetMoveInterruptedEngineFailure}
}

// get the cost for the fleet
// get the fuel cost for the fleet
fuelCost := fleet.GetFuelCost(player, wp1.WarpSpeed, dist)
var fuelGenerated int = 0
if fuelCost > fleet.Fuel {
Expand Down Expand Up @@ -1179,14 +1179,16 @@ func (fleet *Fleet) getEstimatedRange(player *Player, warpSpeed int, cargoCapaci
return int(float64(fleet.Fuel) / float64(fuelCost) * 1000)
}

// Get the amount of fuel this ship will generate at a given warp
// Fuel Generation Math:
// F = 0 if the engine is running above the highest warp at which it travels for free (i.e. it is using fuel)
// F = D if the engine is running at the highest warp at which it travels for free
// F = 3D if the engine is running 1 warp factor below the highest warp at which it travels for free
// F = 6D if the engine is running 2 warp factors below the highest warp at which it travels for free
// F = 10D if the engine is running 3 or more warp factors below the highest warp at which it travels for free
// Note that the fuel generated is per engine, not per ship; i.e.; a ship with 2, 3, or 4 engines
// produces (or uses) 2, 3, or 4 times as much fuel as a single engine ship.

// Get the amount of fuel this fleet will generate at a given warp
func (fleet *Fleet) getFuelGeneration(warpSpeed int, distance float64) int {
fuelGenerated := 0.0
for _, token := range fleet.Tokens {
Expand Down
3 changes: 1 addition & 2 deletions cs/turn.go
Original file line number Diff line number Diff line change
Expand Up @@ -957,9 +957,8 @@ func (t *turn) moveFleet(fleet *Fleet) {
return
}

// remove the previous waypoint, it's been processed already
// tack on the current waypoint if repeating orders
if fleet.RepeatOrders && !wp0.PartiallyComplete {
// if we are supposed to repeat orders,
wp0.processed = false
wp0.WaitAtWaypoint = false
wp0.PartiallyComplete = false
Expand Down

0 comments on commit cf8259b

Please sign in to comment.