Great person uniques can be added to any modded unit

This commit is contained in:
Yair Morgenstern 2020-05-30 23:11:49 +03:00
parent 40325a38b4
commit 58059fc59b

View file

@ -283,7 +283,7 @@ object UnitActions {
private fun addGreatPersonActions(unit: MapUnit, actionList: ArrayList<UnitAction>, tile: TileInfo) {
if (unit.name == "Great Scientist" && !unit.isEmbarked()) {
if (unit.hasUnique("Can hurry technology research") && !unit.isEmbarked()) {
actionList += UnitAction(
type = UnitActionType.HurryResearch,
uncivSound = UncivSound.Chimes,
@ -305,7 +305,7 @@ object UnitActions {
}.takeIf { unit.currentMovement > 0 })
}
if (unit.name == "Great Engineer" && !unit.isEmbarked()) {
if (unit.hasUnique("Can speed up construction of a wonder") && !unit.isEmbarked()) {
val canHurryWonder = if (unit.currentMovement == 0f || !tile.isCityCenter()) false
else {
val currentConstruction = tile.getCity()!!.cityConstructions.getCurrentConstruction()
@ -325,7 +325,8 @@ object UnitActions {
}.takeIf { canHurryWonder })
}
if (unit.name == "Great Merchant" && !unit.isEmbarked()) {
if (unit.hasUnique("Can undertake a trade mission with City-State, giving a large sum of gold and [30] Influence")
&& !unit.isEmbarked()) {
val canConductTradeMission = tile.owningCity?.civInfo?.isCityState() == true
&& tile.owningCity?.civInfo?.isAtWarWith(unit.civInfo) == false
&& unit.currentMovement > 0