Added the amphibious promotion and the marine unit (#3987)

* Technology and construction bars no longer extend past their maximum

* Fixed compile errors

* actually fixed the issue

* Added the marine unit

* Moved amphibious promotion effect to unique

* Added icons for Amphibious promotion and Marine unit

* aaah
This commit is contained in:
Xander Lenstra
2021-05-29 22:42:04 +02:00
committed by GitHub
parent 97a36c3772
commit 432e937474
11 changed files with 443 additions and 409 deletions

View File

@ -118,9 +118,10 @@ object BattleDamage {
modifiers.add("Attacker Bonus", unique.params[0].toInt())
}
if (attacker.unit.isEmbarked() && !attacker.unit.hasUnique("Amphibious"))
if (attacker.unit.isEmbarked() && !attacker.unit.hasUnique("Eliminates combat penalty for attacking from the sea"))
modifiers["Landing"] = -50
if (attacker.isMelee()) {
val numberOfAttackersSurroundingDefender = defender.getTile().neighbors.count {
it.militaryUnit != null
@ -130,7 +131,7 @@ object BattleDamage {
if (numberOfAttackersSurroundingDefender > 1)
modifiers["Flanking"] = 10 * (numberOfAttackersSurroundingDefender - 1) //https://www.carlsguides.com/strategy/civilization5/war/combatbonuses.php
if (attacker.getTile().aerialDistanceTo(defender.getTile()) == 1 && attacker.getTile().isConnectedByRiver(defender.getTile())
&& !attacker.unit.hasUnique("Amphibious")) {
&& !attacker.unit.hasUnique("Eliminates combat penalty for attacking over a river")) {
if (!attacker.getTile().hasConnection(attacker.getCivInfo()) // meaning, the tiles are not road-connected for this civ
|| !defender.getTile().hasConnection(attacker.getCivInfo())
|| !attacker.getCivInfo().tech.roadsConnectAcrossRivers) {