mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-22 20:49:36 +07:00
Add Big Ben.
This commit is contained in:
parent
2db30a247a
commit
70241ac25b
@ -215,6 +215,7 @@ All the following are from [the Noun Project](https://thenounproject.com) licenc
|
||||
* [Christ the redeemer](https://thenounproject.com/term/christ-the-redeemer/56112/) By Stefan Spieler for Cristo Redentor
|
||||
* [St. Petersburg](https://thenounproject.com/search/?q=kremlin&i=1569704) By Carpe Diem for Kremlin
|
||||
* [Neuschwanstein](https://thenounproject.com/search/?q=Neuschwanstein&i=2107683) By Vectors Market
|
||||
* [BugBen](https://thenounproject.com/search/?q=Big%20Ben&i=443690) By Ben Davis, RO
|
||||
|
||||
### Information Era
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 959 KiB After Width: | Height: | Size: 972 KiB |
@ -572,6 +572,14 @@
|
||||
requiredBuilding:"Bank",
|
||||
requiredTech:"Electricity"
|
||||
},
|
||||
{
|
||||
name:"Big Ben",
|
||||
culture:1,
|
||||
gold:4,
|
||||
isWonder:true,
|
||||
uniques:["-15% to purchasing items in cities"],
|
||||
requiredTech:"Industrialization"
|
||||
},
|
||||
|
||||
// Modern Era
|
||||
|
||||
|
@ -36,7 +36,7 @@ class NextTurnAutomation{
|
||||
for (city in civInfo.cities.sortedByDescending{ it.population.population }) {
|
||||
val construction = city.cityConstructions.getCurrentConstruction()
|
||||
if (construction.canBePurchased()
|
||||
&& city.civInfo.gold / 3 >= construction.getGoldCost(civInfo.policies.getAdoptedPolicies()) ) {
|
||||
&& city.civInfo.gold / 3 >= construction.getGoldCost(civInfo) ) {
|
||||
city.cityConstructions.purchaseBuilding(construction.name)
|
||||
}
|
||||
}
|
||||
|
@ -153,7 +153,7 @@ class Battle(val gameInfo:GameInfo) {
|
||||
|
||||
if(defender.isDefeated() && defender is MapUnitCombatant && !defender.getUnitType().isCivilian()
|
||||
&& attacker.getCivInfo().policies.isAdopted("Honor Complete"))
|
||||
attacker.getCivInfo().gold += defender.unit.baseUnit.getGoldCost(hashSetOf()) / 10
|
||||
attacker.getCivInfo().gold += defender.unit.baseUnit.getGoldCost(attacker.getCivInfo(), true) / 10
|
||||
|
||||
if(attacker is MapUnitCombatant && attacker.unit.action!=null && attacker.unit.action!!.startsWith("moveTo"))
|
||||
attacker.unit.action=null
|
||||
|
@ -196,7 +196,7 @@ class CityConstructions {
|
||||
}
|
||||
|
||||
fun purchaseBuilding(buildingName: String) {
|
||||
cityInfo.civInfo.gold -= getConstruction(buildingName).getGoldCost(cityInfo.civInfo.policies.adoptedPolicies)
|
||||
cityInfo.civInfo.gold -= getConstruction(buildingName).getGoldCost(cityInfo.civInfo)
|
||||
getConstruction(buildingName).postBuildEvent(this)
|
||||
if (currentConstruction == buildingName) {
|
||||
currentConstruction = ""
|
||||
|
@ -1,11 +1,12 @@
|
||||
package com.unciv.logic.city
|
||||
|
||||
import com.unciv.logic.civilization.CivilizationInfo
|
||||
import com.unciv.models.gamebasics.ICivilopedia
|
||||
import com.unciv.models.stats.INamed
|
||||
|
||||
interface IConstruction : INamed, ICivilopedia {
|
||||
fun getProductionCost(adoptedPolicies: HashSet<String>): Int
|
||||
fun getGoldCost(adoptedPolicies: HashSet<String>): Int
|
||||
fun getGoldCost(civInfo: CivilizationInfo, baseCost: Boolean = false): Int
|
||||
fun isBuildable(construction: CityConstructions): Boolean
|
||||
fun shouldBeDisplayed(construction: CityConstructions): Boolean
|
||||
fun postBuildEvent(construction: CityConstructions) // Yes I'm hilarious.
|
||||
@ -48,7 +49,7 @@ open class SpecialConstruction(override var name: String, override val descripti
|
||||
throw Exception("Impossible!")
|
||||
}
|
||||
|
||||
override fun getGoldCost(adoptedPolicies: HashSet<String>): Int {
|
||||
override fun getGoldCost(civInfo: CivilizationInfo, baseCost: Boolean): Int {
|
||||
throw Exception("Impossible!")
|
||||
}
|
||||
|
||||
|
@ -169,12 +169,19 @@ class Building : NamedStats(), IConstruction{
|
||||
else cost
|
||||
}
|
||||
|
||||
override fun getGoldCost(adoptedPolicies: HashSet<String>): Int {
|
||||
override fun getGoldCost(civInfo: CivilizationInfo, baseCost: Boolean): Int {
|
||||
// https://forums.civfanatics.com/threads/rush-buying-formula.393892/
|
||||
var cost = Math.pow((30 * getProductionCost(adoptedPolicies)).toDouble(), 0.75) * (1 + hurryCostModifier / 100)
|
||||
if (adoptedPolicies.contains("Mercantilism")) cost *= 0.75
|
||||
if (adoptedPolicies.contains("Patronage")
|
||||
&& listOf("Monument", "Temple", "Opera House", "Museum").contains(name) ) cost *= 0.5
|
||||
var cost: Double
|
||||
if (baseCost) {
|
||||
cost = Math.pow((30 * getProductionCost(hashSetOf())).toDouble(), 0.75) * (1 + hurryCostModifier / 100)
|
||||
} else {
|
||||
cost = Math.pow((30 * getProductionCost(civInfo.policies.adoptedPolicies)).toDouble(), 0.75) * (1 + hurryCostModifier / 100)
|
||||
if (civInfo.policies.adoptedPolicies.contains("Mercantilism")) cost *= 0.75
|
||||
if (civInfo.getBuildingUniques().contains("-15% to purchasing items in cities")) cost *= 0.85
|
||||
if (civInfo.policies.adoptedPolicies.contains("Patronage")
|
||||
&& listOf("Monument", "Temple", "Opera House", "Museum").contains(name)) cost *= 0.5
|
||||
}
|
||||
|
||||
return (cost / 10).toInt() * 10
|
||||
}
|
||||
|
||||
|
@ -99,10 +99,13 @@ class BaseUnit : INamed, IConstruction, ICivilopedia {
|
||||
|
||||
fun getBaseGoldCost() = Math.pow((30 * cost).toDouble(), 0.75) * (1 + hurryCostModifier / 100)
|
||||
|
||||
override fun getGoldCost(adoptedPolicies: HashSet<String>): Int {
|
||||
override fun getGoldCost(civInfo: CivilizationInfo, baseCost: Boolean): Int {
|
||||
var cost = getBaseGoldCost()
|
||||
if(adoptedPolicies.contains("Mercantilism")) cost *= 0.75
|
||||
if(adoptedPolicies.contains("Militarism")) cost *= 0.66f
|
||||
if (!baseCost) {
|
||||
if(civInfo.policies.adoptedPolicies.contains("Mercantilism")) cost *= 0.75
|
||||
if(civInfo.policies.adoptedPolicies.contains("Militarism")) cost *= 0.66f
|
||||
if (civInfo.getBuildingUniques().contains("-15% to purchasing items in cities")) cost *= 0.85
|
||||
}
|
||||
return (cost / 10).toInt() * 10 // rounded down o nearest ten
|
||||
}
|
||||
|
||||
|
@ -139,7 +139,7 @@ class ConstructionsTable(val cityScreen: CityScreen) : Table(CameraStageBaseScre
|
||||
row()
|
||||
val purchaseConstructionButton: TextButton
|
||||
if (construction.canBePurchased()) {
|
||||
val buildingGoldCost = construction.getGoldCost(city.civInfo.policies.getAdoptedPolicies())
|
||||
val buildingGoldCost = construction.getGoldCost(city.civInfo)
|
||||
purchaseConstructionButton = TextButton("Buy for [$buildingGoldCost] gold".tr(), CameraStageBaseScreen.skin)
|
||||
purchaseConstructionButton.onClick("coin") {
|
||||
YesNoPopupTable("Would you like to purchase [${construction.name}] for [$buildingGoldCost] gold?".tr(), {
|
||||
|
Loading…
Reference in New Issue
Block a user