Skip to content

Commit

Permalink
fix formulas
Browse files Browse the repository at this point in the history
  • Loading branch information
alaingilbert committed Sep 11, 2018
1 parent 8262870 commit 9f68879
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
12 changes: 6 additions & 6 deletions base.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ func (b BaseShip) GetName() string {
}

// GetStructuralIntegrity ...
func (b BaseShip) GetStructuralIntegrity() int {
return b.StructuralIntegrity
func (b BaseShip) GetStructuralIntegrity(researches Researches) int {
return int(float64(b.StructuralIntegrity) * (1 + float64(researches.ArmourTechnology)*0.1))
}

// GetShieldPower ...
func (b BaseShip) GetShieldPower() int {
return b.ShieldPower
func (b BaseShip) GetShieldPower(researches Researches) int {
return int(float64(b.ShieldPower) * (1 + float64(researches.ShieldingTechnology)*0.1))
}

// GetWeaponPower ...
func (b BaseShip) GetWeaponPower() int {
return b.WeaponPower
func (b BaseShip) GetWeaponPower(researches Researches) int {
return int(float64(b.WeaponPower) * (1 + float64(researches.WeaponsTechnology)*0.1))
}

// GetCargoCapacity ...
Expand Down
12 changes: 6 additions & 6 deletions baseDefense.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ func (b BaseDefense) GetName() string {
}

// GetStructuralIntegrity ...
func (b BaseDefense) GetStructuralIntegrity() int {
return b.StructuralIntegrity
func (b BaseDefense) GetStructuralIntegrity(researches Researches) int {
return int(float64(b.StructuralIntegrity) * (1 + float64(researches.ArmourTechnology)*0.1))
}

// GetShieldPower ...
func (b BaseDefense) GetShieldPower() int {
return b.ShieldPower
func (b BaseDefense) GetShieldPower(researches Researches) int {
return int(float64(b.ShieldPower) * (1 + float64(researches.ShieldingTechnology)*0.1))
}

// GetWeaponPower ...
func (b BaseDefense) GetWeaponPower() int {
return b.WeaponPower
func (b BaseDefense) GetWeaponPower(researches Researches) int {
return int(float64(b.WeaponPower) * (1 + float64(researches.WeaponsTechnology)*0.1))
}

// GetRapidfireFrom ...
Expand Down
12 changes: 6 additions & 6 deletions ogame.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ type Ship interface {
GetRequirements() map[ID]int
IsAvailable(ResourcesBuildings, Facilities, Researches, int) bool
GetPrice(int) Resources
GetStructuralIntegrity() int
GetShieldPower() int
GetWeaponPower() int
GetStructuralIntegrity(Researches) int
GetShieldPower(Researches) int
GetWeaponPower(Researches) int
GetCargoCapacity() int
GetBaseSpeed() int
GetSpeed(researches Researches) int
Expand All @@ -220,9 +220,9 @@ type Defense interface {
GetPrice(int) Resources
GetRequirements() map[ID]int
IsAvailable(ResourcesBuildings, Facilities, Researches, int) bool
GetStructuralIntegrity() int
GetShieldPower() int
GetWeaponPower() int
GetStructuralIntegrity(Researches) int
GetShieldPower(Researches) int
GetWeaponPower(Researches) int
GetRapidfireFrom() map[ID]int
ConstructionTime(nbr, universeSpeed int, facilities Facilities) time.Duration
}
Expand Down

0 comments on commit 9f68879

Please sign in to comment.