mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 14:24:43 -04:00
Resolved #491 - Once Honor has been adopted, gain Culture when you kill a barbarian unit
This commit is contained in:
parent
c4e686f514
commit
0ef11e12cd
@ -89,7 +89,7 @@
|
|||||||
{
|
{
|
||||||
name:"Honor",
|
name:"Honor",
|
||||||
era:"Ancient",
|
era:"Ancient",
|
||||||
description:"+25% bonus vs Barbarians",
|
description:"+25% bonus vs Barbarians; gain Culture when you kill a barbarian unit",
|
||||||
policies:[
|
policies:[
|
||||||
{
|
{
|
||||||
name:"Warrior Code",
|
name:"Warrior Code",
|
||||||
|
@ -6620,7 +6620,7 @@
|
|||||||
German:"Ehre"
|
German:"Ehre"
|
||||||
French:"Honneur"
|
French:"Honneur"
|
||||||
}
|
}
|
||||||
"+25% bonus vs Barbarians":{ //it's 33% in the original game
|
"+25% bonus vs Barbarians; gain Culture when you kill a barbarian unit":{ //25% in Vanilla, 33% in G&K
|
||||||
Spanish:"+25% bonus al luchar contra Barbaros"
|
Spanish:"+25% bonus al luchar contra Barbaros"
|
||||||
Italian:"+25% forza contro Barbari"
|
Italian:"+25% forza contro Barbari"
|
||||||
Romanian:"+25% bonus contra Barbarilor"
|
Romanian:"+25% bonus contra Barbarilor"
|
||||||
|
@ -21,8 +21,8 @@ android {
|
|||||||
applicationId "com.unciv.app"
|
applicationId "com.unciv.app"
|
||||||
minSdkVersion 14
|
minSdkVersion 14
|
||||||
targetSdkVersion 28
|
targetSdkVersion 28
|
||||||
versionCode 209
|
versionCode 211
|
||||||
versionName "2.13.9"
|
versionName "2.13.10"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Had to add this crap for Travis to build, it wanted to sign the app
|
// Had to add this crap for Travis to build, it wanted to sign the app
|
||||||
|
@ -17,7 +17,7 @@ class UnCivGame : Game() {
|
|||||||
* This exists so that when debugging we can see the entire map.
|
* This exists so that when debugging we can see the entire map.
|
||||||
* Remember to turn this to false before commit and upload!
|
* Remember to turn this to false before commit and upload!
|
||||||
*/
|
*/
|
||||||
val viewEntireMapForDebug = true
|
val viewEntireMapForDebug = false
|
||||||
|
|
||||||
// For when you need to test something in an advanced game and don't have time to faff around
|
// For when you need to test something in an advanced game and don't have time to faff around
|
||||||
val superchargedForDebug = false
|
val superchargedForDebug = false
|
||||||
|
@ -8,6 +8,7 @@ import com.unciv.logic.civilization.diplomacy.DiplomaticIncidentType
|
|||||||
import com.unciv.logic.map.TileInfo
|
import com.unciv.logic.map.TileInfo
|
||||||
import com.unciv.models.gamebasics.unit.UnitType
|
import com.unciv.models.gamebasics.unit.UnitType
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
import kotlin.math.max
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Damage calculations according to civ v wiki and https://steamcommunity.com/sharedfiles/filedetails/?id=170194443
|
* Damage calculations according to civ v wiki and https://steamcommunity.com/sharedfiles/filedetails/?id=170194443
|
||||||
@ -125,6 +126,18 @@ class Battle(val gameInfo:GameInfo) {
|
|||||||
addXp(defender,2,attacker)
|
addXp(defender,2,attacker)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add culture when defeating a barbarian when Honor policy is adopted (can be either attacker or defender!)
|
||||||
|
fun tryGetCultureFromHonor(civUnit:ICombatant, barbarianUnit:ICombatant){
|
||||||
|
if(barbarianUnit.isDefeated() && barbarianUnit is MapUnitCombatant
|
||||||
|
&& barbarianUnit.getCivInfo().isBarbarianCivilization()
|
||||||
|
&& civUnit.getCivInfo().policies.isAdopted("Honor"))
|
||||||
|
civUnit.getCivInfo().policies.storedCulture +=
|
||||||
|
max(barbarianUnit.unit.baseUnit.strength,barbarianUnit.unit.baseUnit.rangedStrength)
|
||||||
|
}
|
||||||
|
|
||||||
|
tryGetCultureFromHonor(attacker,defender)
|
||||||
|
tryGetCultureFromHonor(defender,attacker)
|
||||||
|
|
||||||
if(defender.isDefeated() && defender is MapUnitCombatant && !defender.getUnitType().isCivilian()
|
if(defender.isDefeated() && defender is MapUnitCombatant && !defender.getUnitType().isCivilian()
|
||||||
&& attacker.getCivInfo().policies.isAdopted("Honor Complete"))
|
&& attacker.getCivInfo().policies.isAdopted("Honor Complete"))
|
||||||
attacker.getCivInfo().gold += defender.unit.baseUnit.getGoldCost(hashSetOf()) / 10
|
attacker.getCivInfo().gold += defender.unit.baseUnit.getGoldCost(hashSetOf()) / 10
|
||||||
|
Loading…
x
Reference in New Issue
Block a user