mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-20 09:17:47 +07:00
Added Bowman as first unique unit!
This commit is contained in:
parent
8116a72fdf
commit
5df93757f2
BIN
android/assets/UnitIcons/Bowman.png
Normal file
BIN
android/assets/UnitIcons/Bowman.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.8 KiB |
@ -49,6 +49,20 @@
|
||||
obsoleteTech:"Machinery",
|
||||
upgradesTo:"Crossbowman"
|
||||
},
|
||||
{
|
||||
name:"Bowman",
|
||||
unitType:"Ranged",
|
||||
movement:2,
|
||||
strength:7,
|
||||
rangedStrength:9,
|
||||
cost: 40,
|
||||
hurryCostModifier:20
|
||||
requiredTech:"Archery",
|
||||
obsoleteTech:"Machinery",
|
||||
replaces:"Archer",
|
||||
uniqueTo:"Babylon"
|
||||
upgradesTo:"Crossbowman"
|
||||
},
|
||||
{
|
||||
name:"Chariot Archer",
|
||||
unitType:"Ranged",
|
||||
|
@ -131,7 +131,7 @@ class Battle(val gameInfo:GameInfo=UnCivGame.Current.gameInfo) {
|
||||
// Remove all national wonders when conquering a city
|
||||
for(building in city.cityConstructions.getBuiltBuildings().filter { it.requiredBuildingInAllCities!=null })
|
||||
city.cityConstructions.builtBuildings.remove(building.name)
|
||||
|
||||
|
||||
(attacker as MapUnitCombatant).unit.moveToTile(city.getCenterTile())
|
||||
city.civInfo.gameInfo.updateTilesToCities()
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import com.unciv.logic.city.CityConstructions
|
||||
import com.unciv.logic.city.IConstruction
|
||||
import com.unciv.logic.civilization.CivilizationInfo
|
||||
import com.unciv.logic.map.MapUnit
|
||||
import com.unciv.models.gamebasics.GameBasics
|
||||
import com.unciv.models.gamebasics.ICivilopedia
|
||||
import com.unciv.models.stats.INamed
|
||||
import com.unciv.ui.utils.tr
|
||||
@ -24,6 +25,8 @@ class Unit : INamed, IConstruction, ICivilopedia {
|
||||
var uniques:HashSet<String>?=null
|
||||
var obsoleteTech:String?=null
|
||||
var upgradesTo:String? = null
|
||||
var replaces:String?=null
|
||||
var uniqueTo:String?=null
|
||||
|
||||
|
||||
override val description: String
|
||||
@ -81,6 +84,8 @@ class Unit : INamed, IConstruction, ICivilopedia {
|
||||
if (unbuildable) return false
|
||||
if (requiredTech!=null && !civInfo.tech.isResearched(requiredTech!!)) return false
|
||||
if (obsoleteTech!=null && civInfo.tech.isResearched(obsoleteTech!!)) return false
|
||||
if(uniqueTo!=null && uniqueTo!=civInfo.civName) return false
|
||||
if(GameBasics.Units.values.any { it.uniqueTo==civInfo.civName && it.replaces==name }) return false
|
||||
if (requiredResource!=null && !civInfo.getCivResources().keys.any { it.name == requiredResource }) return false
|
||||
return true
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user