mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-11 00:08:58 +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,
|
"cost": 325,
|
||||||
"requiredTech": "Refrigeration",
|
"requiredTech": "Refrigeration",
|
||||||
"upgradesTo": "Nuclear Submarine",
|
"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"
|
"attackSound": "torpedo"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -1364,8 +1365,9 @@
|
|||||||
"rangedStrength": 85,
|
"rangedStrength": 85,
|
||||||
"cost": 425,
|
"cost": 425,
|
||||||
"requiredTech": "Telecommunications",
|
"requiredTech": "Telecommunications",
|
||||||
"uniques": ["+[75]% Strength when attacking", "Invisible to others", "Can only attack [Water] units",
|
"uniques": ["+[75]% Strength when attacking", "Invisible to others",
|
||||||
"Can attack submarines", "Can enter ice tiles", "[+1] Visibility Range", "Can carry [2] [Missile] units"],
|
"Can only attack [Water] tiles", "Can attack submarines", "Can enter ice tiles",
|
||||||
|
"[+1] Visibility Range", "Can carry [2] [Missile] units"],
|
||||||
"attackSound": "torpedo"
|
"attackSound": "torpedo"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -98,8 +98,14 @@ object BattleHelper {
|
|||||||
|
|
||||||
if (combatant is MapUnitCombatant &&
|
if (combatant is MapUnitCombatant &&
|
||||||
combatant.unit.hasUnique("Can only attack [] units") &&
|
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
|
)
|
||||||
|
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
|
//only submarine and destroyer can attack submarine
|
||||||
//garrisoned submarine can be attacked by anyone, or the city will be in invincible
|
//garrisoned submarine can be attacked by anyone, or the city will be in invincible
|
||||||
|
Reference in New Issue
Block a user