Skip to content

Commit

Permalink
different techs improve speed differently
Browse files Browse the repository at this point in the history
  • Loading branch information
alaingilbert committed Sep 3, 2018
1 parent 8569e51 commit f319155
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions base.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,19 @@ func (b BaseShip) GetSpeed(techs Researches) int {
if techDriveLvl < minLvl {
techDriveLvl = minLvl
}
return int(float64(b.BaseSpeed) + (float64(b.BaseSpeed)*0.1)*float64(techDriveLvl))
} else if minLvl, ok := b.Requirements[ImpulseDrive.ID]; ok {
techDriveLvl = techs.ImpulseDrive
if techDriveLvl < minLvl {
techDriveLvl = minLvl
}
return int(float64(b.BaseSpeed) + (float64(b.BaseSpeed)*0.2)*float64(techDriveLvl))
} else if minLvl, ok := b.Requirements[HyperspaceDrive.ID]; ok {
techDriveLvl = techs.HyperspaceDrive
if techDriveLvl < minLvl {
techDriveLvl = minLvl
}
return int(float64(b.BaseSpeed) + (float64(b.BaseSpeed)*0.3)*float64(techDriveLvl))
}
return int(float64(b.BaseSpeed) + (float64(b.BaseSpeed)*0.2)*float64(techDriveLvl))
}
Expand Down

0 comments on commit f319155

Please sign in to comment.