From f28f52e22aa8b5fc79b02dd871950fbbb5e943a7 Mon Sep 17 00:00:00 2001 From: Sveinung Kvilhaugsvik Date: Tue, 18 May 2021 08:29:30 +0200 Subject: [PATCH] "Non Lethal To Target Unit" action sub result. See osdn #42310 --- client/helpdata.c | 9 +++++++-- common/fc_types.h | 3 +++ doc/README.actions | 9 ++++++--- server/ruleset.c | 8 ++++++++ 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/client/helpdata.c b/client/helpdata.c index 1787438425..670965b294 100644 --- a/client/helpdata.c +++ b/client/helpdata.c @@ -2713,8 +2713,7 @@ char *helptext_unit(char *buf, size_t bufsz, struct player *pplayer, utype->bombard_rate); cat_snprintf(buf, bufsz, /* TRANS: talking about bombard */ - _(" %s These attacks will only damage (never kill)" - " defenders, but damage all" + _(" %s Will damage all" " defenders on a tile, and have no risk for the" " attacker.\n"), BULLET); break; @@ -2972,6 +2971,12 @@ char *helptext_unit(char *buf, size_t bufsz, struct player *pplayer, " can't survive on its own at the target tile.\n"), BULLET, utype_name_translation(utype)); } + if (BV_ISSET(paction->sub_results, ACT_SUB_RES_NON_LETHAL)) { + cat_snprintf(buf, bufsz, + /* TRANS: talking about non lethal attacks */ + _(" %s These attacks will only damage (never kill)" + " defenders.\n"), BULLET); + } i = 0; action_iterate(blocker_id) { diff --git a/common/fc_types.h b/common/fc_types.h index fa3c97bcfb..363f19afb7 100644 --- a/common/fc_types.h +++ b/common/fc_types.h @@ -313,6 +313,9 @@ enum output_type_id { * target tile. */ #define SPECENUM_VALUE2 ACT_SUB_RES_MAY_EMBARK #define SPECENUM_VALUE2NAME "Unit May Embark" +/* Target units won't be killed by this action. */ +#define SPECENUM_VALUE3 ACT_SUB_RES_NON_LETHAL +#define SPECENUM_VALUE3NAME "Non Lethal To Target Unit" #define SPECENUM_BITVECTOR bv_action_sub_results #define SPECENUM_COUNT ACT_SUB_RES_COUNT #include "specenum_gen.h" diff --git a/doc/README.actions b/doc/README.actions index 6981a0f97f..55f8ca726f 100644 --- a/doc/README.actions +++ b/doc/README.actions @@ -704,8 +704,9 @@ Actions done by a unit against all units at a tile * target must be foreign. (!) * target cannot be transporting other units. (!) -"Bombard" - bombard the units (and city) at the tile without killing them. +"Bombard" - bombard the units (and city) at the tile. * UI name can be set using ui_name_bombard + * can't kill target units * any action listed in bombard_blocked_by must be impossible * actor must have a bombard_rate > 0 * actor must have an attack > 0 @@ -714,16 +715,18 @@ Actions done by a unit against all units at a tile * target can't be in a city the actor player isn't at war with. * target owner must be at war with actor. (!) -"Bombard 2" - bombard the units (and city) at the tile without killing them. +"Bombard 2" - bombard the units (and city) at the tile. * UI name can be set using ui_name_bombard_2 + * can't kill target units * any action listed in bombard_2_blocked_by must be impossible * actor must be on a tile next to the target or, if bombard_2_max_range allows it, futher away. * A copy of "Bombard". * See "Bombard" for everything else. -"Bombard 3" - bombard the units (and city) at the tile without killing them. +"Bombard 3" - bombard the units (and city) at the tile. * UI name can be set using ui_name_bombard_3 + * can't kill target units * any action listed in bombard_3_blocked_by must be impossible * actor must be on a tile next to the target or, if bombard_3_max_range allows it, futher away. diff --git a/server/ruleset.c b/server/ruleset.c index 73fda09f4b..a771072dd3 100644 --- a/server/ruleset.c +++ b/server/ruleset.c @@ -6799,6 +6799,14 @@ static bool load_ruleset_game(struct section_file *file, bool act, /* Embark actions will always embark, not maybe embark. */ } action_iterate_end; + + /* Non Lethal bombard */ + BV_SET(action_by_number(ACTION_BOMBARD)->sub_results, + ACT_SUB_RES_NON_LETHAL); + BV_SET(action_by_number(ACTION_BOMBARD2)->sub_results, + ACT_SUB_RES_NON_LETHAL); + BV_SET(action_by_number(ACTION_BOMBARD3)->sub_results, + ACT_SUB_RES_NON_LETHAL); } if (ok) { -- 2.30.2