Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase Powerhouse pop effect #586

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,18 @@ object AirlineBaseSpecialization extends Enumeration {
override val label = "Powerhouse"
override val free = true
override val scaleRequirement : Int = 14
val populationBoost = 30000
private[this] val minIncomeBoost = 3000 //should at least boost income by $3000
private[this] val percentageBoost = 20 //20% if lower than minIncomeBoost then minIncomeBoost
private[this] val minPopulationBoost = 200_000 // for income richCountryThreshold and above countries
private[this] val maxPopulationBoost = 1_000_000 // for income 0 countries
private[this] val richCountryThreshold = 50_000

def incomeLevelBoost(airport : Airport) = {
Computation.computeIncomeLevelBoostFromPercentage(airport.baseIncome, minIncomeBoost, percentageBoost)
}
def populationBoost(airport : Airport) = {
Math.max(Math.floor(maxPopulationBoost - airport.baseIncome * ((maxPopulationBoost - minPopulationBoost) / richCountryThreshold)), minPopulationBoost)
}
override def descriptions(airport : Airport) = {
List(s"Increase population by $populationBoost", s"Increase income level by ${incomeLevelBoost(airport)}")
}
Expand Down Expand Up @@ -164,4 +169,4 @@ object BaseSpecializationType extends Enumeration {
type SpecializationType = Value
val FLIGHT_TYPE, DELEGATE, BRANDING, LOYALTY, NEGOTIATION, AIRPORT_POWER = Value
val COOLDOWN = 100 //change every 100 cycles
}
}
2 changes: 1 addition & 1 deletion airline-data/src/main/scala/com/patson/model/Airport.scala
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ case class Airport(iata : String, icao : String, name : String, latitude : Doubl
val powerHouseSpec = spec.asInstanceOf[PowerhouseSpecialization]
val boost = boostType match {
case AirportBoostType.INCOME => powerHouseSpec.incomeLevelBoost(Airport.this)
case AirportBoostType.POPULATION => powerHouseSpec.populationBoost
case AirportBoostType.POPULATION => powerHouseSpec.populationBoost(Airport.this)
case _ => 0
}

Expand Down