mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-09 07:18:57 +07:00
Fixed bug where submarines could not attack embarked units (#4459)
* Fixed bug where submarines could not attack embarked units * Implemented requested changes * Fixed typo
This commit is contained in:
@ -1004,7 +1004,8 @@
|
||||
"cost": 325,
|
||||
"requiredTech": "Refrigeration",
|
||||
"upgradesTo": "Nuclear Submarine",
|
||||
"uniques": ["+[75]% Strength when attacking", "Invisible to others", "Can only attack [Water] units", "Can attack submarines", "Can enter ice tiles"],
|
||||
"uniques": ["+[75]% Strength when attacking", "Invisible to others", "Can only attack [Water] tiles",
|
||||
"Can attack submarines", "Can enter ice tiles"],
|
||||
"attackSound": "torpedo"
|
||||
},
|
||||
{
|
||||
@ -1364,8 +1365,9 @@
|
||||
"rangedStrength": 85,
|
||||
"cost": 425,
|
||||
"requiredTech": "Telecommunications",
|
||||
"uniques": ["+[75]% Strength when attacking", "Invisible to others", "Can only attack [Water] units",
|
||||
"Can attack submarines", "Can enter ice tiles", "[+1] Visibility Range", "Can carry [2] [Missile] units"],
|
||||
"uniques": ["+[75]% Strength when attacking", "Invisible to others",
|
||||
"Can only attack [Water] tiles", "Can attack submarines", "Can enter ice tiles",
|
||||
"[+1] Visibility Range", "Can carry [2] [Missile] units"],
|
||||
"attackSound": "torpedo"
|
||||
},
|
||||
{
|
||||
|
@ -98,7 +98,13 @@ object BattleHelper {
|
||||
|
||||
if (combatant is MapUnitCombatant &&
|
||||
combatant.unit.hasUnique("Can only attack [] units") &&
|
||||
combatant.unit.getMatchingUniques("Can only attack [] units").none { tileCombatant.matchesCategory(it.params[0]) })
|
||||
combatant.unit.getMatchingUniques("Can only attack [] units").none { tileCombatant.matchesCategory(it.params[0]) }
|
||||
)
|
||||
return false
|
||||
if (combatant is MapUnitCombatant &&
|
||||
combatant.unit.hasUnique("Can only attack [] tiles") &&
|
||||
combatant.unit.getMatchingUniques("Can only attack [] tiles").none { tile.matchesFilter(it.params[0]) }
|
||||
)
|
||||
return false
|
||||
|
||||
//only submarine and destroyer can attack submarine
|
||||
|
Reference in New Issue
Block a user