In @Wolfdog 's Expanded Warfare mod there is a Missile Destroyer upgrade to the Vanilla Destroyer unit. Unfortunately, since it's a Naval Melee unit you can't execute long range attacks. It has to pull alongside it's opponent to attack. It's easy enough to give it a ranged attack, but that creates other issues.
The problem is if you give it a ranged attack and it's ranged strength is higher than it's melee strength, the game treats it as a ranged unit and you lose the ability to capture cities, but you can still range attack land units, cities, and naval units. Conversely, if it's melee strength is higher than it's ranged strength, the game treats it as a melee unit, but you still lose the ability to capture cities. You'll also be unable to range attack land units, though you can still range attack cities and naval units.
I found, however, that in the second scenario where the melee attack is higher, simply attaching the "CLASS_IMMORTAL" tag to the unit will again grant the ability to capture cities and still be able to execute ranged attacks against other naval units and cities themselves. However, it's still unable to range attack land units. This is mirrored by the Persian Immortal's inability to range attack naval units.
I was mostly satisfied with this solution as it seemed to work well enough - except for the land unit attacks, but still wanted to ask if anyone might have an idea for a work-a-round to accomplish this.
The problem is if you give it a ranged attack and it's ranged strength is higher than it's melee strength, the game treats it as a ranged unit and you lose the ability to capture cities, but you can still range attack land units, cities, and naval units. Conversely, if it's melee strength is higher than it's ranged strength, the game treats it as a melee unit, but you still lose the ability to capture cities. You'll also be unable to range attack land units, though you can still range attack cities and naval units.
I found, however, that in the second scenario where the melee attack is higher, simply attaching the "CLASS_IMMORTAL" tag to the unit will again grant the ability to capture cities and still be able to execute ranged attacks against other naval units and cities themselves. However, it's still unable to range attack land units. This is mirrored by the Persian Immortal's inability to range attack naval units.
I was mostly satisfied with this solution as it seemed to work well enough - except for the land unit attacks, but still wanted to ask if anyone might have an idea for a work-a-round to accomplish this.