Add Amphibious penalty to Land attacking into Water and vice versa (#6127)

* Add Amphibious penalty to Land attacking into Water and vice versa

* Replace Landing with Amphibious in all translation files

* Fix trailing whitespace

* Revert translation files

* Change working of Amphibious
Set penalty to Landing and Boarding

* Type-ify Unique and add Depreciated
Add Promotion to Melee Naval
Add exception that Landing penalty is NOT against cities

* Fix Vanilla

* Rename to Landing Party
Icon doesn't work

* Properly regenerated game.atlas/game.png

Co-authored-by: itanasi <spellman23@gmail.com>
This commit is contained in:
itanasi 2022-02-14 10:21:53 -08:00 committed by GitHub
parent bce65a96f6
commit 9d1f463310
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 686 additions and 672 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

View File

@ -138,7 +138,7 @@
{
"name": "Amphibious",
"prerequisites": ["Shock I", "Drill I"],
"uniques": ["Eliminates combat penalty for attacking over a river", "Eliminates combat penalty for attacking from the sea"],
"uniques": ["Eliminates combat penalty for attacking over a river", "Eliminates combat penalty for attacking across a coast"],
"unitTypes": ["Sword","Gunpowder"]
},
{
@ -227,6 +227,11 @@
"uniques": ["[+20]% Strength <vs cities>", "Earn [33]% of the damage done to [City] units as [Gold]"],
"unitTypes": ["Melee Water"]
},
{
"name": "Landing Party",
"uniques": ["Eliminates combat penalty for attacking across a coast"],
"unitTypes": ["Melee Water"]
},
// Water Ranged
{

View File

@ -138,7 +138,7 @@
{
"name": "Amphibious",
"prerequisites": ["Shock I", "Drill I"],
"uniques": ["Eliminates combat penalty for attacking over a river", "Eliminates combat penalty for attacking from the sea"],
"uniques": ["Eliminates combat penalty for attacking over a river", "Eliminates combat penalty for attacking across a coast"],
"unitTypes": ["Sword","Gunpowder"]
},
{
@ -227,6 +227,11 @@
"uniques": ["[+20]% Strength <vs cities>", "Earn [33]% of the damage done to [City] units as [Gold]"],
"unitTypes": ["Melee Water"]
},
{
"name": "Landing Party",
"uniques": ["Eliminates combat penalty for attacking across a coast"],
"unitTypes": ["Melee Water"]
},
// Water Ranged
{

View File

@ -883,6 +883,7 @@ defence vs ranged =
Attacker Bonus =
Defender Bonus =
Landing =
Boarding =
Flanking =
vs [unitType] =
Terrain =

View File

@ -129,10 +129,20 @@ object BattleDamage {
if (attacker is MapUnitCombatant) {
modifiers.add(getTileSpecificModifiers(attacker, defender.getTile()))
if (attacker.unit.isEmbarked() && !attacker.unit.hasUnique("Eliminates combat penalty for attacking from the sea"))
// Depreciated Version
if (attacker.unit.isEmbarked() && !attacker.unit.hasUnique(UniqueType.AttackFromSea))
modifiers["Landing"] = -50
if (attacker.unit.isEmbarked() && !attacker.unit.hasUnique(UniqueType.AttackAcrossCoast))
modifiers["Landing"] = -50
// Land Melee Unit attacking to Water
if (!attacker.unit.isEmbarked() && attacker.isMelee() && defender.getTile().isWater
&& !attacker.unit.hasUnique(UniqueType.AttackAcrossCoast))
modifiers["Boarding"] = -50
// Naval Unit Melee attacking to Land (not City) unit
if (attacker.unit.type.isWaterUnit() && attacker.isMelee() && !defender.getTile().isWater
&& !attacker.unit.hasUnique(UniqueType.AttackAcrossCoast) && !defender.isCity())
modifiers["Landing"] = -50
if (attacker.isMelee()) {
val numberOfAttackersSurroundingDefender = defender.getTile().neighbors.count {

View File

@ -415,6 +415,9 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
NormalVisionWhenEmbarked("Normal vision when embarked", UniqueTarget.Unit, UniqueTarget.Global),
DefenceBonusWhenEmbarked("Defense bonus when embarked", UniqueTarget.Unit, UniqueTarget.Global),
DefenceBonusWhenEmbarkedCivwide("Embarked units can defend themselves", UniqueTarget.Global),
@Deprecated("as of 3.19.8", ReplaceWith("Eliminates combat penalty for attacking across a coast"))
AttackFromSea("Eliminates combat penalty for attacking from the sea", UniqueTarget.Unit),
AttackAcrossCoast("Eliminates combat penalty for attacking across a coast", UniqueTarget.Unit),
SixTilesAlwaysVisible("6 tiles in every direction always visible", UniqueTarget.Unit),

View File

@ -883,6 +883,9 @@ Example: "All adjacent units heal [20] HP when healing"
Applicable to: Unit
#### Eliminates combat penalty for attacking across a coast
Applicable to: Unit
#### 6 tiles in every direction always visible
Applicable to: Unit
@ -1567,6 +1570,7 @@ Applicable to: Conditional
- "[stats] with [resource]" - Deprecated as of 3.19.7, replace with "[stats] <with [resource]>"
- "Not displayed as an available construction unless [buildingName] is built" - Deprecated as of 3.16.11, replace with "Not displayed as an available construction without [buildingName]"
- "[stats] once [tech] is discovered" - Deprecated as of 3.17.10 - removed 3.18.19, replace with "[stats] <after discovering [tech]>"
- "Eliminates combat penalty for attacking from the sea" - Deprecated as of 3.19.8, replace with "Eliminates combat penalty for attacking across a coast"
- "[amount]% Bonus XP gain" - Deprecated as of 3.18.12, replace with "[amount]% XP gained from combat"
- "Cannot enter ocean tiles until Astronomy" - Deprecated as of 3.18.6, replace with "Cannot enter ocean tiles <before discovering [Astronomy]>"
- "+[amount]% Strength when attacking" - Deprecated as of 3.17.5 - removed 3.18.5, replace with "[+amount]% Strength <when attacking>"