Browse Source

Some more updates to linking strat

master
Khaled Nassar 4 years ago
parent
commit
8370224976
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      strategies/linker.go

+ 6
- 1
strategies/linker.go View File

@@ -158,6 +158,11 @@ func (ls *LinkerStrategy) linkFriendlies(stars []*models.Star, flights []models.
func (ls *LinkerStrategy) sendHomiesBack(stars []*models.Star, flights []models.Flight, links []models.Link) {
for _, s := range stars {
if s.OwnedByMe() && s.Captured() && ls.insufficientShipsForCapturing(s) && s.FlightsAllowed > 0 {

if s.Ships <= 5 {
continue
}

richnessRoundsToCapture := capturingShipThreshold / s.Richness

if richnessRoundsToCapture == 0 {
@@ -169,7 +174,7 @@ func (ls *LinkerStrategy) sendHomiesBack(stars []*models.Star, flights []models.
distanceToOrigin := flightTurnDistance(capturingStar, s)
if distanceToOrigin < timeToCapture {
s.FlightsAllowed--
fmt.Printf("fly %d %d %d\n", s.Idx, capturingStar.Idx, s.Ships)
fmt.Printf("fly %d %d %d\n", s.Idx, capturingStar.Idx, s.Ships - 3)
}
}
}

Loading…
Cancel
Save