From 5a98c48b343b7d5110ab24129b56905e113dbc55 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 29 Sep 2023 22:47:21 +0300 Subject: [PATCH 55/55] Fake Generalize Bombard Lethal See osdn #48748 Signed-off-by: Marko Lindqvist --- common/actions.c | 21 ++++ common/actions.h | 238 +++++++++++++++++++++++---------------------- doc/README.actions | 13 ++- 3 files changed, 151 insertions(+), 121 deletions(-) diff --git a/common/actions.c b/common/actions.c index 66c178af9d..56ddcebcd6 100644 --- a/common/actions.c +++ b/common/actions.c @@ -1129,6 +1129,16 @@ static void hard_code_actions(void) /* Overwritten by the ruleset's bombard_lethal_max_range */ 1, FALSE); + actions[ACTION_BOMBARD_LETHAL2] = + unit_action_new(ACTION_BOMBARD_LETHAL2, ACTRES_BOMBARD, + FALSE, TRUE, MAK_STAYS, + /* A single domestic unit at the target tile will make + * the action illegal. It must therefore be performed + * from another tile. */ + 1, + /* Overwritten by the ruleset's bombard_lethal_2_max_range */ + 1, + FALSE); actions[ACTION_SPY_NUKE] = unit_action_new(ACTION_SPY_NUKE, ACTRES_SPY_NUKE, FALSE, TRUE, @@ -6541,6 +6551,8 @@ const char *action_ui_name_ruleset_var_name(int act) return "ui_name_bombard_3"; case ACTION_BOMBARD_LETHAL: return "ui_name_bombard_lethal"; + case ACTION_BOMBARD_LETHAL2: + return "ui_name_bombard_lethal_2"; case ACTION_SPY_NUKE: return "ui_name_suitcase_nuke"; case ACTION_SPY_NUKE_ESC: @@ -6830,6 +6842,7 @@ const char *action_ui_name_default(int act) /* TRANS: B_ombard 3 (100% chance of success). */ return N_("B%sombard 3%s"); case ACTION_BOMBARD_LETHAL: + case ACTION_BOMBARD_LETHAL2: /* TRANS: Lethal B_ombard (100% chance of success). */ return N_("Lethal B%sombard%s"); case ACTION_SPY_NUKE: @@ -7133,6 +7146,7 @@ const char *action_min_range_ruleset_var_name(int act) case ACTION_BOMBARD2: case ACTION_BOMBARD3: case ACTION_BOMBARD_LETHAL: + case ACTION_BOMBARD_LETHAL2: case ACTION_SPY_ATTACK: case ACTION_CONQUER_EXTRAS: case ACTION_CONQUER_EXTRAS2: @@ -7394,6 +7408,8 @@ const char *action_max_range_ruleset_var_name(int act) return "bombard_3_max_range"; case ACTION_BOMBARD_LETHAL: return "bombard_lethal_max_range"; + case ACTION_BOMBARD_LETHAL2: + return "bombard_lethal_2_max_range"; case ACTION_NUKE: return "explode_nuclear_max_range"; case ACTION_NUKE_CITY: @@ -7617,6 +7633,7 @@ const char *action_target_kind_ruleset_var_name(int act) case ACTION_BOMBARD2: case ACTION_BOMBARD3: case ACTION_BOMBARD_LETHAL: + case ACTION_BOMBARD_LETHAL2: case ACTION_SPY_ATTACK: case ACTION_CONQUER_EXTRAS: case ACTION_CONQUER_EXTRAS2: @@ -8061,6 +8078,7 @@ const char *action_actor_consuming_always_ruleset_var_name(action_id act) case ACTION_BOMBARD2: case ACTION_BOMBARD3: case ACTION_BOMBARD_LETHAL: + case ACTION_BOMBARD_LETHAL2: case ACTION_SPY_ATTACK: case ACTION_CONQUER_EXTRAS: case ACTION_CONQUER_EXTRAS2: @@ -8133,6 +8151,8 @@ const char *action_blocked_by_ruleset_var_name(const struct action *act) return "bombard_3_blocked_by"; case ACTION_BOMBARD_LETHAL: return "bombard_lethal_blocked_by"; + case ACTION_BOMBARD_LETHAL2: + return "bombard_lethal_2_blocked_by"; case ACTION_NUKE: return "explode_nuclear_blocked_by"; case ACTION_NUKE_CITY: @@ -8305,6 +8325,7 @@ action_post_success_forced_ruleset_var_name(const struct action *act) case ACTION_BOMBARD2: case ACTION_BOMBARD3: case ACTION_BOMBARD_LETHAL: + case ACTION_BOMBARD_LETHAL2: case ACTION_NUKE: case ACTION_NUKE_CITY: case ACTION_NUKE_UNITS: diff --git a/common/actions.h b/common/actions.h index 9c146ece5d..838c5c2c8f 100644 --- a/common/actions.h +++ b/common/actions.h @@ -166,124 +166,126 @@ const char *gen_action_name_update_cb(const char *old_name); #define SPECENUM_VALUE57NAME "Bombard 3" #define SPECENUM_VALUE58 ACTION_BOMBARD_LETHAL #define SPECENUM_VALUE58NAME "Bombard Lethal" -#define SPECENUM_VALUE59 ACTION_FORTIFY -#define SPECENUM_VALUE59NAME "Fortify" -#define SPECENUM_VALUE60 ACTION_CULTIVATE -#define SPECENUM_VALUE60NAME "Cultivate" -#define SPECENUM_VALUE61 ACTION_PLANT -#define SPECENUM_VALUE61NAME "Plant" -#define SPECENUM_VALUE62 ACTION_TRANSFORM_TERRAIN -#define SPECENUM_VALUE62NAME "Transform Terrain" -#define SPECENUM_VALUE63 ACTION_ROAD -#define SPECENUM_VALUE63NAME "Build Road" -#define SPECENUM_VALUE64 ACTION_IRRIGATE -#define SPECENUM_VALUE64NAME "Build Irrigation" -#define SPECENUM_VALUE65 ACTION_MINE -#define SPECENUM_VALUE65NAME "Build Mine" -#define SPECENUM_VALUE66 ACTION_BASE -#define SPECENUM_VALUE66NAME "Build Base" -#define SPECENUM_VALUE67 ACTION_PILLAGE -#define SPECENUM_VALUE67NAME "Pillage" -#define SPECENUM_VALUE68 ACTION_TRANSPORT_BOARD -#define SPECENUM_VALUE68NAME "Transport Board" -#define SPECENUM_VALUE69 ACTION_TRANSPORT_BOARD2 -#define SPECENUM_VALUE69NAME "Transport Board 2" -#define SPECENUM_VALUE70 ACTION_TRANSPORT_BOARD3 -#define SPECENUM_VALUE70NAME "Transport Board_3" -#define SPECENUM_VALUE71 ACTION_TRANSPORT_DEBOARD -#define SPECENUM_VALUE71NAME "Transport Deboard" -#define SPECENUM_VALUE72 ACTION_TRANSPORT_EMBARK -#define SPECENUM_VALUE72NAME "Transport Embark" -#define SPECENUM_VALUE73 ACTION_TRANSPORT_EMBARK2 -#define SPECENUM_VALUE73NAME "Transport Embark 2" -#define SPECENUM_VALUE74 ACTION_TRANSPORT_EMBARK3 -#define SPECENUM_VALUE74NAME "Transport Embark 3" -#define SPECENUM_VALUE75 ACTION_TRANSPORT_EMBARK4 -#define SPECENUM_VALUE75NAME "Transport Embark 4" -#define SPECENUM_VALUE76 ACTION_TRANSPORT_DISEMBARK1 -#define SPECENUM_VALUE76NAME "Transport Disembark" -#define SPECENUM_VALUE77 ACTION_TRANSPORT_DISEMBARK2 -#define SPECENUM_VALUE77NAME "Transport Disembark 2" -#define SPECENUM_VALUE78 ACTION_TRANSPORT_DISEMBARK3 -#define SPECENUM_VALUE78NAME "Transport Disembark 3" -#define SPECENUM_VALUE79 ACTION_TRANSPORT_DISEMBARK4 -#define SPECENUM_VALUE79NAME "Transport Disembark 4" -#define SPECENUM_VALUE80 ACTION_TRANSPORT_LOAD -#define SPECENUM_VALUE80NAME "Transport Load" -#define SPECENUM_VALUE81 ACTION_TRANSPORT_LOAD2 -#define SPECENUM_VALUE81NAME "Transport Load 2" -#define SPECENUM_VALUE82 ACTION_TRANSPORT_LOAD3 -#define SPECENUM_VALUE82NAME "Transport Load 3" -#define SPECENUM_VALUE83 ACTION_TRANSPORT_UNLOAD -#define SPECENUM_VALUE83NAME "Transport Unload" -#define SPECENUM_VALUE84 ACTION_SPY_SPREAD_PLAGUE -#define SPECENUM_VALUE84NAME "Spread Plague" -#define SPECENUM_VALUE85 ACTION_SPY_ATTACK -#define SPECENUM_VALUE85NAME "Spy Attack" -#define SPECENUM_VALUE86 ACTION_CONQUER_EXTRAS -#define SPECENUM_VALUE86NAME "Conquer Extras" -#define SPECENUM_VALUE87 ACTION_CONQUER_EXTRAS2 -#define SPECENUM_VALUE87NAME "Conquer Extras 2" -#define SPECENUM_VALUE88 ACTION_CONQUER_EXTRAS3 -#define SPECENUM_VALUE88NAME "Conquer Extras 3" -#define SPECENUM_VALUE89 ACTION_CONQUER_EXTRAS4 -#define SPECENUM_VALUE89NAME "Conquer Extras 4" -#define SPECENUM_VALUE90 ACTION_HUT_ENTER -#define SPECENUM_VALUE90NAME "Enter Hut" -#define SPECENUM_VALUE91 ACTION_HUT_ENTER2 -#define SPECENUM_VALUE91NAME "Enter Hut 2" -#define SPECENUM_VALUE92 ACTION_HUT_ENTER3 -#define SPECENUM_VALUE92NAME "Enter Hut 3" -#define SPECENUM_VALUE93 ACTION_HUT_ENTER4 -#define SPECENUM_VALUE93NAME "Enter Hut 4" -#define SPECENUM_VALUE94 ACTION_HUT_FRIGHTEN -#define SPECENUM_VALUE94NAME "Frighten Hut" -#define SPECENUM_VALUE95 ACTION_HUT_FRIGHTEN2 -#define SPECENUM_VALUE95NAME "Frighten Hut 2" -#define SPECENUM_VALUE96 ACTION_HUT_FRIGHTEN3 -#define SPECENUM_VALUE96NAME "Frighten Hut 3" -#define SPECENUM_VALUE97 ACTION_HUT_FRIGHTEN4 -#define SPECENUM_VALUE97NAME "Frighten Hut 4" -#define SPECENUM_VALUE98 ACTION_HEAL_UNIT -#define SPECENUM_VALUE98NAME "Heal Unit" -#define SPECENUM_VALUE99 ACTION_HEAL_UNIT2 -#define SPECENUM_VALUE99NAME "Heal Unit 2" -#define SPECENUM_VALUE100 ACTION_PARADROP -#define SPECENUM_VALUE100NAME "Paradrop Unit" -#define SPECENUM_VALUE101 ACTION_PARADROP_CONQUER -#define SPECENUM_VALUE101NAME "Paradrop Unit Conquer" -#define SPECENUM_VALUE102 ACTION_PARADROP_FRIGHTEN -#define SPECENUM_VALUE102NAME "Paradrop Unit Frighten" -#define SPECENUM_VALUE103 ACTION_PARADROP_FRIGHTEN_CONQUER -#define SPECENUM_VALUE103NAME "Paradrop Unit Frighten Conquer" -#define SPECENUM_VALUE104 ACTION_PARADROP_ENTER -#define SPECENUM_VALUE104NAME "Paradrop Unit Enter" -#define SPECENUM_VALUE105 ACTION_PARADROP_ENTER_CONQUER -#define SPECENUM_VALUE105NAME "Paradrop Unit Enter Conquer" -#define SPECENUM_VALUE106 ACTION_WIPE_UNITS -#define SPECENUM_VALUE106NAME "Wipe Units" -#define SPECENUM_VALUE107 ACTION_SPY_ESCAPE -#define SPECENUM_VALUE107NAME "Spy Escape" -#define SPECENUM_VALUE108 ACTION_UNIT_MOVE -#define SPECENUM_VALUE108NAME "Unit Move" -#define SPECENUM_VALUE109 ACTION_UNIT_MOVE2 -#define SPECENUM_VALUE109NAME "Unit Move 2" -#define SPECENUM_VALUE110 ACTION_UNIT_MOVE3 -#define SPECENUM_VALUE110NAME "Unit Move 3" -#define SPECENUM_VALUE111 ACTION_TELEPORT -#define SPECENUM_VALUE111NAME "Teleport" -#define SPECENUM_VALUE112 ACTION_TELEPORT_CONQUER -#define SPECENUM_VALUE112NAME "Teleport Conquer" -#define SPECENUM_VALUE113 ACTION_CLEAN -#define SPECENUM_VALUE113NAME "Clean" -#define SPECENUM_VALUE114 ACTION_USER_ACTION1 -#define SPECENUM_VALUE114NAME "User Action 1" -#define SPECENUM_VALUE115 ACTION_USER_ACTION2 -#define SPECENUM_VALUE115NAME "User Action 2" -#define SPECENUM_VALUE116 ACTION_USER_ACTION3 -#define SPECENUM_VALUE116NAME "User Action 3" -#define SPECENUM_VALUE117 ACTION_USER_ACTION4 -#define SPECENUM_VALUE117NAME "User Action 4" +#define SPECENUM_VALUE59 ACTION_BOMBARD_LETHAL2 +#define SPECENUM_VALUE59NAME "Bombard Lethal 2" +#define SPECENUM_VALUE60 ACTION_FORTIFY +#define SPECENUM_VALUE60NAME "Fortify" +#define SPECENUM_VALUE61 ACTION_CULTIVATE +#define SPECENUM_VALUE61NAME "Cultivate" +#define SPECENUM_VALUE62 ACTION_PLANT +#define SPECENUM_VALUE62NAME "Plant" +#define SPECENUM_VALUE63 ACTION_TRANSFORM_TERRAIN +#define SPECENUM_VALUE63NAME "Transform Terrain" +#define SPECENUM_VALUE64 ACTION_ROAD +#define SPECENUM_VALUE64NAME "Build Road" +#define SPECENUM_VALUE65 ACTION_IRRIGATE +#define SPECENUM_VALUE65NAME "Build Irrigation" +#define SPECENUM_VALUE66 ACTION_MINE +#define SPECENUM_VALUE66NAME "Build Mine" +#define SPECENUM_VALUE67 ACTION_BASE +#define SPECENUM_VALUE67NAME "Build Base" +#define SPECENUM_VALUE68 ACTION_PILLAGE +#define SPECENUM_VALUE68NAME "Pillage" +#define SPECENUM_VALUE69 ACTION_TRANSPORT_BOARD +#define SPECENUM_VALUE69NAME "Transport Board" +#define SPECENUM_VALUE70 ACTION_TRANSPORT_BOARD2 +#define SPECENUM_VALUE70NAME "Transport Board 2" +#define SPECENUM_VALUE71 ACTION_TRANSPORT_BOARD3 +#define SPECENUM_VALUE71NAME "Transport Board_3" +#define SPECENUM_VALUE72 ACTION_TRANSPORT_DEBOARD +#define SPECENUM_VALUE72NAME "Transport Deboard" +#define SPECENUM_VALUE73 ACTION_TRANSPORT_EMBARK +#define SPECENUM_VALUE73NAME "Transport Embark" +#define SPECENUM_VALUE74 ACTION_TRANSPORT_EMBARK2 +#define SPECENUM_VALUE74NAME "Transport Embark 2" +#define SPECENUM_VALUE75 ACTION_TRANSPORT_EMBARK3 +#define SPECENUM_VALUE75NAME "Transport Embark 3" +#define SPECENUM_VALUE76 ACTION_TRANSPORT_EMBARK4 +#define SPECENUM_VALUE76NAME "Transport Embark 4" +#define SPECENUM_VALUE77 ACTION_TRANSPORT_DISEMBARK1 +#define SPECENUM_VALUE77NAME "Transport Disembark" +#define SPECENUM_VALUE78 ACTION_TRANSPORT_DISEMBARK2 +#define SPECENUM_VALUE78NAME "Transport Disembark 2" +#define SPECENUM_VALUE79 ACTION_TRANSPORT_DISEMBARK3 +#define SPECENUM_VALUE79NAME "Transport Disembark 3" +#define SPECENUM_VALUE80 ACTION_TRANSPORT_DISEMBARK4 +#define SPECENUM_VALUE80NAME "Transport Disembark 4" +#define SPECENUM_VALUE81 ACTION_TRANSPORT_LOAD +#define SPECENUM_VALUE81NAME "Transport Load" +#define SPECENUM_VALUE82 ACTION_TRANSPORT_LOAD2 +#define SPECENUM_VALUE82NAME "Transport Load 2" +#define SPECENUM_VALUE83 ACTION_TRANSPORT_LOAD3 +#define SPECENUM_VALUE83NAME "Transport Load 3" +#define SPECENUM_VALUE84 ACTION_TRANSPORT_UNLOAD +#define SPECENUM_VALUE84NAME "Transport Unload" +#define SPECENUM_VALUE85 ACTION_SPY_SPREAD_PLAGUE +#define SPECENUM_VALUE85NAME "Spread Plague" +#define SPECENUM_VALUE86 ACTION_SPY_ATTACK +#define SPECENUM_VALUE86NAME "Spy Attack" +#define SPECENUM_VALUE87 ACTION_CONQUER_EXTRAS +#define SPECENUM_VALUE87NAME "Conquer Extras" +#define SPECENUM_VALUE88 ACTION_CONQUER_EXTRAS2 +#define SPECENUM_VALUE88NAME "Conquer Extras 2" +#define SPECENUM_VALUE89 ACTION_CONQUER_EXTRAS3 +#define SPECENUM_VALUE89NAME "Conquer Extras 3" +#define SPECENUM_VALUE90 ACTION_CONQUER_EXTRAS4 +#define SPECENUM_VALUE90NAME "Conquer Extras 4" +#define SPECENUM_VALUE91 ACTION_HUT_ENTER +#define SPECENUM_VALUE91NAME "Enter Hut" +#define SPECENUM_VALUE92 ACTION_HUT_ENTER2 +#define SPECENUM_VALUE92NAME "Enter Hut 2" +#define SPECENUM_VALUE93 ACTION_HUT_ENTER3 +#define SPECENUM_VALUE93NAME "Enter Hut 3" +#define SPECENUM_VALUE94 ACTION_HUT_ENTER4 +#define SPECENUM_VALUE94NAME "Enter Hut 4" +#define SPECENUM_VALUE95 ACTION_HUT_FRIGHTEN +#define SPECENUM_VALUE95NAME "Frighten Hut" +#define SPECENUM_VALUE96 ACTION_HUT_FRIGHTEN2 +#define SPECENUM_VALUE96NAME "Frighten Hut 2" +#define SPECENUM_VALUE97 ACTION_HUT_FRIGHTEN3 +#define SPECENUM_VALUE97NAME "Frighten Hut 3" +#define SPECENUM_VALUE98 ACTION_HUT_FRIGHTEN4 +#define SPECENUM_VALUE98NAME "Frighten Hut 4" +#define SPECENUM_VALUE99 ACTION_HEAL_UNIT +#define SPECENUM_VALUE99NAME "Heal Unit" +#define SPECENUM_VALUE100 ACTION_HEAL_UNIT2 +#define SPECENUM_VALUE100NAME "Heal Unit 2" +#define SPECENUM_VALUE101 ACTION_PARADROP +#define SPECENUM_VALUE101NAME "Paradrop Unit" +#define SPECENUM_VALUE102 ACTION_PARADROP_CONQUER +#define SPECENUM_VALUE102NAME "Paradrop Unit Conquer" +#define SPECENUM_VALUE103 ACTION_PARADROP_FRIGHTEN +#define SPECENUM_VALUE103NAME "Paradrop Unit Frighten" +#define SPECENUM_VALUE104 ACTION_PARADROP_FRIGHTEN_CONQUER +#define SPECENUM_VALUE104NAME "Paradrop Unit Frighten Conquer" +#define SPECENUM_VALUE105 ACTION_PARADROP_ENTER +#define SPECENUM_VALUE105NAME "Paradrop Unit Enter" +#define SPECENUM_VALUE106 ACTION_PARADROP_ENTER_CONQUER +#define SPECENUM_VALUE106NAME "Paradrop Unit Enter Conquer" +#define SPECENUM_VALUE107 ACTION_WIPE_UNITS +#define SPECENUM_VALUE107NAME "Wipe Units" +#define SPECENUM_VALUE108 ACTION_SPY_ESCAPE +#define SPECENUM_VALUE108NAME "Spy Escape" +#define SPECENUM_VALUE109 ACTION_UNIT_MOVE +#define SPECENUM_VALUE109NAME "Unit Move" +#define SPECENUM_VALUE110 ACTION_UNIT_MOVE2 +#define SPECENUM_VALUE110NAME "Unit Move 2" +#define SPECENUM_VALUE111 ACTION_UNIT_MOVE3 +#define SPECENUM_VALUE111NAME "Unit Move 3" +#define SPECENUM_VALUE112 ACTION_TELEPORT +#define SPECENUM_VALUE112NAME "Teleport" +#define SPECENUM_VALUE113 ACTION_TELEPORT_CONQUER +#define SPECENUM_VALUE113NAME "Teleport Conquer" +#define SPECENUM_VALUE114 ACTION_CLEAN +#define SPECENUM_VALUE114NAME "Clean" +#define SPECENUM_VALUE115 ACTION_USER_ACTION1 +#define SPECENUM_VALUE115NAME "User Action 1" +#define SPECENUM_VALUE116 ACTION_USER_ACTION2 +#define SPECENUM_VALUE116NAME "User Action 2" +#define SPECENUM_VALUE117 ACTION_USER_ACTION3 +#define SPECENUM_VALUE117NAME "User Action 3" +#define SPECENUM_VALUE118 ACTION_USER_ACTION4 +#define SPECENUM_VALUE118NAME "User Action 4" #define SPECENUM_BITVECTOR bv_actions #define SPECENUM_COUNT ACTION_COUNT #define SPECENUM_NAME_UPDATER diff --git a/doc/README.actions b/doc/README.actions index ad47c99979..6b35036566 100644 --- a/doc/README.actions +++ b/doc/README.actions @@ -802,15 +802,22 @@ Actions done by a unit against all units at a tile "Bombard Lethal" - bombard the units (and city) at the tile. * UI name can be set using ui_name_bombard_lethal - * can kill target units * any action listed in bombard_lethal_blocked_by must be impossible - * actor must have a bombard_rate > 0 - * actor must have an attack > 0 * actor must be on a tile next to the target or, if bombard_lethal_max_range allows it, futher away. + * can kill target units + * actor must have a bombard_rate > 0 + * actor must have an attack > 0 * target owner must be at war with actor. (!) * if target tile is fully seen, it must have reachable units +"Bombard Lethal 2" - bombard the units (and city) at the tile. + * UI name can be set using ui_name_bombard_lethal_2 + * any action listed in bombard_lethal_2_blocked_by must be impossible + * actor must be on a tile next to the target or, if + bombard_lethal_2_max_range allows it, futher away. + * See "Bombard Lethal" for everything else. + "Attack" * UI name can be set using ui_name_attack * any action listed in attack_blocked_by must be impossible -- 2.40.1