Feature/missile non lethality#43
Conversation
changed default setting for patch_cruise_missile_ignores_lethal_bombard_abilities = false.
comment-only update on ToC-12
Updated comment for patch_cruise_missile_ignores_lethal_bombard_abilities in config file, for a better description of feature.
|
This doesn't quite work. Your edit to Another issue is that much of the code you've inserted won't run because it's part of the regular bombard logic which is not used for cruise missiles. Cruise missiles have their own mostly separate code path. When To make cruise missiles respect lethal bombard abilities, this should be all you need:
Do you have the Ghidra project? I forget who I've sent it to. If not, you won't be able to bring up |
In Default (vanilla) Civ 3, if you set a unit as being a 'Cruise Missile', it will ALWAYS have lethal land/sea bombard, regardless of the Lethal Bombard Flags in the editor. So it's impossible to make a Cruise missile non-lethal. In the attached example, this Cruise Missile will always be land/sea Lethal, just based on its Cruise Missile flag, even though Lethal Land/Sea Bombardment isn't set.


This feature (maybe even bug fix) makes the Lethal Land Bombardment and Lethal Sea Bombardment flags actually matter for Cruise Missiles (just like they matter for all other units).
Config setting is "patch_cruise_missile_ignores_lethal_bombard_abilities" and I believe should be defaulted to FALSE, just in case a modder is unaware of the feature/bug fix. They can turn it on manually by setting this config value to TRUE.
If testing, don't forget to set this config setting to True first!
The code changes are highlighted in comments are "ToC-12" "ToC-13" or "ToC-13A".
ToC-12: Base code to ensure Lethal bombard settings in the editor matter for Cruise Missiles
ToC-13: AI adjustment to ensure AI does not waste missiles on 0 defense units that are out in the open (on a tile by themselves). Seems this is Civ 3 vanilla hardcoded, that missile units cannot kill 0 defense units (ex. workers) that are out the open. So this stops AI from attempting to fire missiles at such targets.
ToC-13A: Adjustment to small bug found when creating ToC-12 that allowed first missile attack to skip a declaration of war. this ensures that the warning pop up still occurs if attempting to bombard a previously allied civ with a missile, so that you must declare war first before engaging in bombard attack (Hidden Nationality ability still allows skipping of war declaration like in vanilla civ 3).
Missile Lethality functionality Tested and regression tested with vanilla civ 3 and the Tides of Crimson mod, works in game.