From 05430b0f3a78b75cc4f358def690165661202327 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 17 Dec 2022 17:16:48 +0200 Subject: [PATCH 18/18] Change occurrences of "defence" to "defense" See osdn #45309 Signed-off-by: Marko Lindqvist --- ai/default/aiair.c | 6 +++--- ai/default/aiunit.c | 12 ++++++------ ai/default/daimilitary.c | 10 +++++----- ai/default/daimilitary.h | 4 ++-- data/alien/units.ruleset | 2 +- data/civ1/units.ruleset | 2 +- data/civ2/units.ruleset | 2 +- data/civ2civ3/units.ruleset | 2 +- data/classic/units.ruleset | 2 +- data/experimental/units.ruleset | 2 +- data/multiplayer/units.ruleset | 2 +- data/ruledit/comments.txt | 2 +- data/sandbox/units.ruleset | 2 +- data/stub/units.ruleset | 2 +- data/webperimental/units.ruleset | 2 +- server/advisors/advdata.c | 4 ++-- server/diplomats.c | 4 ++-- 17 files changed, 31 insertions(+), 31 deletions(-) diff --git a/ai/default/aiair.c b/ai/default/aiair.c index e7efdd4fc5..193580ed0b 100644 --- a/ai/default/aiair.c +++ b/ai/default/aiair.c @@ -167,7 +167,7 @@ static int dai_evaluate_tile_for_air_attack(struct unit *punit, /* unit costs in shields */ int balanced_cost, unit_cost, victim_cost = 0; /* unit stats */ - int unit_attack, victim_defence; + int unit_attack, victim_defense; /* final answer */ int profit; /* time spent in the air */ @@ -201,13 +201,13 @@ static int dai_evaluate_tile_for_air_attack(struct unit *punit, unit_attack = (int) (PROB_MULTIPLIER * unit_win_chance(punit, pdefender)); - victim_defence = PROB_MULTIPLIER - unit_attack; + victim_defense = PROB_MULTIPLIER - unit_attack; balanced_cost = build_cost_balanced(unit_type_get(punit)); sortie_time = (unit_has_type_flag(punit, UTYF_ONEATTACK) ? 1 : 0); - profit = kill_desire(victim_cost, unit_attack, unit_cost, victim_defence, 1) + profit = kill_desire(victim_cost, unit_attack, unit_cost, victim_defense, 1) - SHIELD_WEIGHTING + 2 * TRADE_WEIGHTING; if (profit > 0) { profit = military_amortize(unit_owner(punit), diff --git a/ai/default/aiunit.c b/ai/default/aiunit.c index ff7a52e9ac..6e0b007c91 100644 --- a/ai/default/aiunit.c +++ b/ai/default/aiunit.c @@ -270,20 +270,20 @@ static int unit_att_rating_squared(const struct unit *punit) } /**************************************************************************** - Defence rating of this particular unit against this attacker. + Defense rating of this particular unit against this attacker. ****************************************************************************/ static int unit_def_rating(const struct unit *attacker, const struct unit *defender) { struct unit_type *def_type = unit_type_get(defender); - + return (get_total_defense_power(attacker, defender) * (attacker->id != 0 ? defender->hp : def_type->hp) * def_type->firepower / POWER_DIVIDER); } /**************************************************************************** - Square of the previous function - used in actual computations. + Square of unit_def_rating() - used in actual computations. ****************************************************************************/ static int unit_def_rating_squared(const struct unit *attacker, const struct unit *defender) @@ -294,7 +294,7 @@ static int unit_def_rating_squared(const struct unit *attacker, } /************************************************************************** - Defence rating of def_type unit against att_type unit, squared. + Defense rating of def_type unit against att_type unit, squared. See get_virtual_defense_power for the arguments att_type, def_type, x, y, fortified and veteran. **************************************************************************/ @@ -700,7 +700,7 @@ static bool unit_role_defender(const struct unit_type *punittype) We do not consider units with higher movement than us, or units that are native to terrains or extras not native to us, as potential charges. Nor - do we attempt to bodyguard units with higher defence than us, or military + do we attempt to bodyguard units with higher defense than us, or military units with lower attack than us that are not transports. ****************************************************************************/ adv_want look_for_charge(struct ai_type *ait, struct player *pplayer, @@ -1143,7 +1143,7 @@ int find_something_to_kill(struct ai_type *ait, struct player *pplayer, bool unhap = FALSE; /* Do we make unhappy citizen. */ bool harbor = FALSE; /* Do we have access to sea? */ bool go_by_boat; /* Whether we need a boat or not. */ - int vulnerability; /* Enemy defence rating. */ + int vulnerability; /* Enemy defense rating. */ int benefit; /* Benefit from killing the target. */ struct unit *pdefender; /* Enemy city defender. */ int move_time; /* Turns needed to target. */ diff --git a/ai/default/daimilitary.c b/ai/default/daimilitary.c index 7b4740901d..9e1bc69bdd 100644 --- a/ai/default/daimilitary.c +++ b/ai/default/daimilitary.c @@ -200,7 +200,7 @@ static struct unit_type *dai_choose_bodyguard(struct ai_type *ait, /* Now find best */ if (can_city_build_unit_now(pcity, putype)) { - const int desire = dai_unit_defence_desirability(ait, putype); + const int desire = dai_unit_defense_desirability(ait, putype); if (desire > best || (desire == best && utype_build_shield_cost(putype) <= @@ -451,7 +451,7 @@ static void dai_reevaluate_building(struct city *pcity, adv_want *value, cities. Danger is a weight on how much power enemy units nearby have, which is - compared to our defence. + compared to our defense. Urgency is the number of hostile units that can attack us in three turns. @@ -662,7 +662,7 @@ static unsigned int assess_danger(struct ai_type *ait, struct city *pcity) How much we would want that unit to defend a city? (Do not use this function to find bodyguards for ships or air units.) **************************************************************************/ -int dai_unit_defence_desirability(struct ai_type *ait, +int dai_unit_defense_desirability(struct ai_type *ait, const struct unit_type *punittype) { int desire = punittype->hp; @@ -763,7 +763,7 @@ bool dai_process_defender_want(struct ai_type *ait, struct player *pplayer, continue; } - desire = dai_unit_defence_desirability(ait, punittype); + desire = dai_unit_defense_desirability(ait, punittype); if (!utype_has_role(punittype, L_DEFEND_GOOD)) { desire /= 2; /* Not good, just ok */ @@ -1194,7 +1194,7 @@ static struct adv_choice *kill_something_with(struct ai_type *ait, struct player fc_assert_ret_val(is_military_unit(myunit) && !utype_fuel(unit_type_get(myunit)), choice); if (city_data->danger != 0 && assess_defense(ait, pcity) == 0) { - /* Defence comes first! */ + /* Defense comes first! */ goto cleanup; } diff --git a/ai/default/daimilitary.h b/ai/default/daimilitary.h index 70d53221e1..49e9d0dd64 100644 --- a/ai/default/daimilitary.h +++ b/ai/default/daimilitary.h @@ -37,7 +37,7 @@ int assess_defense_quadratic(struct ai_type *ait, struct city *pcity); int assess_defense_unit(struct ai_type *ait, struct city *pcity, struct unit *punit, bool igwall); int assess_defense(struct ai_type *ait, struct city *pcity); -int dai_unit_defence_desirability(struct ai_type *ait, +int dai_unit_defense_desirability(struct ai_type *ait, const struct unit_type *punittype); int dai_unit_attack_desirability(struct ai_type *ait, const struct unit_type *punittype); @@ -45,4 +45,4 @@ bool dai_process_defender_want(struct ai_type *ait, struct player *pplayer, struct city *pcity, unsigned int danger, struct adv_choice *choice, adv_want extra_want); -#endif /* FC__DAIMILITARY_H */ +#endif /* FC__DAIMILITARY_H */ diff --git a/data/alien/units.ruleset b/data/alien/units.ruleset index 4d6bc3801b..ef66a10f52 100644 --- a/data/alien/units.ruleset +++ b/data/alien/units.ruleset @@ -70,7 +70,7 @@ veteran_move_bonus = 0, 0, 0 ; The number can be variable, up to 32 ; When adding new classes, remember to check effects.ruleset also. ; Eg. if you divide class 'Land' to two separate classes, you may -; want add effect giving City Walls defence bonus against new class +; want add effect giving City Walls defense bonus against new class ; too. ; ; The actual tag used (the * in [unitclass_*]) does not matter, except diff --git a/data/civ1/units.ruleset b/data/civ1/units.ruleset index 6c895912ee..7c9e38ff43 100644 --- a/data/civ1/units.ruleset +++ b/data/civ1/units.ruleset @@ -64,7 +64,7 @@ veteran_move_bonus = 0, 0 ; The number can be variable, up to 32 ; When adding new classes, remember to check effects.ruleset also. ; Eg. if you divide class 'Land' to two separate classes, you may -; want add effect giving City Walls defence bonus against new class +; want add effect giving City Walls defense bonus against new class ; too. ; ; The actual tag used (the * in [unitclass_*]) does not matter, except diff --git a/data/civ2/units.ruleset b/data/civ2/units.ruleset index 4894e4feb7..2001a82bac 100644 --- a/data/civ2/units.ruleset +++ b/data/civ2/units.ruleset @@ -77,7 +77,7 @@ veteran_move_bonus = 0, 0 ; The number can be variable, up to 32 ; When adding new classes, remember to check effects.ruleset also. ; Eg. if you divide class 'Land' to two separate classes, you may -; want add effect giving City Walls defence bonus against new class +; want add effect giving City Walls defense bonus against new class ; too. ; ; The actual tag used (the * in [unitclass_*]) does not matter, except diff --git a/data/civ2civ3/units.ruleset b/data/civ2civ3/units.ruleset index f619155690..61b1604402 100644 --- a/data/civ2civ3/units.ruleset +++ b/data/civ2civ3/units.ruleset @@ -82,7 +82,7 @@ veteran_move_bonus = 0, 0, 0, 0 ; The number can be variable, up to 32 ; When adding new classes, remember to check effects.ruleset also. ; Eg. if you divide class 'Land' to two separate classes, you may -; want add effect giving City Walls defence bonus against new class +; want add effect giving City Walls defense bonus against new class ; too. ; ; The actual tag used (the * in [unitclass_*]) does not matter, except diff --git a/data/classic/units.ruleset b/data/classic/units.ruleset index 6cec6bd1ef..14e1424ea8 100644 --- a/data/classic/units.ruleset +++ b/data/classic/units.ruleset @@ -80,7 +80,7 @@ veteran_move_bonus = 0, 0, 0, 0 ; The number can be variable, up to 32 ; When adding new classes, remember to check effects.ruleset also. ; Eg. if you divide class 'Land' to two separate classes, you may -; want add effect giving City Walls defence bonus against new class +; want add effect giving City Walls defense bonus against new class ; too. ; ; The actual tag used (the * in [unitclass_*]) does not matter, except diff --git a/data/experimental/units.ruleset b/data/experimental/units.ruleset index 67aadf5f26..3d019315b6 100644 --- a/data/experimental/units.ruleset +++ b/data/experimental/units.ruleset @@ -84,7 +84,7 @@ veteran_move_bonus = 0, 0, 0, 0 ; The number can be variable, up to 32 ; When adding new classes, remember to check effects.ruleset also. ; Eg. if you divide class 'Land' to two separate classes, you may -; want add effect giving City Walls defence bonus against new class +; want add effect giving City Walls defense bonus against new class ; too. ; ; The actual tag used (the * in [unitclass_*]) does not matter, except diff --git a/data/multiplayer/units.ruleset b/data/multiplayer/units.ruleset index eecae1f1d5..397bee3f9f 100644 --- a/data/multiplayer/units.ruleset +++ b/data/multiplayer/units.ruleset @@ -79,7 +79,7 @@ veteran_move_bonus = 0, 0, 0, 0 ; The number can be variable, up to 32 ; When adding new classes, remember to check effects.ruleset also. ; Eg. if you divide class 'Land' to two separate classes, you may -; want add effect giving City Walls defence bonus against new class +; want add effect giving City Walls defense bonus against new class ; too. ; ; The actual tag used (the * in [unitclass_*]) does not matter, except diff --git a/data/ruledit/comments.txt b/data/ruledit/comments.txt index 413874a7b2..39b5e6b665 100644 --- a/data/ruledit/comments.txt +++ b/data/ruledit/comments.txt @@ -240,7 +240,7 @@ uclasses = "\ ; The number can be variable, up to 32\n\ ; When adding new classes, remember to check effects.ruleset also.\n\ ; Eg. if you divide class \'Land\' to two separate classes, you may\n\ -; want add effect giving City Walls defence bonus against new class\n\ +; want add effect giving City Walls defense bonus against new class\n\ ; too.\n\ ;\n\ ; The actual tag used (the * in [unitclass_*]) does not matter, except\n\ diff --git a/data/sandbox/units.ruleset b/data/sandbox/units.ruleset index 8df769dce9..27cf8233d0 100644 --- a/data/sandbox/units.ruleset +++ b/data/sandbox/units.ruleset @@ -88,7 +88,7 @@ veteran_move_bonus = 0, 0, 0, 0 ; The number can be variable, up to 32 ; When adding new classes, remember to check effects.ruleset also. ; Eg. if you divide class 'Land' to two separate classes, you may -; want add effect giving City Walls defence bonus against new class +; want add effect giving City Walls defense bonus against new class ; too. ; ; The actual tag used (the * in [unitclass_*]) does not matter, except diff --git a/data/stub/units.ruleset b/data/stub/units.ruleset index 4e78afc1cf..482691fca2 100644 --- a/data/stub/units.ruleset +++ b/data/stub/units.ruleset @@ -52,7 +52,7 @@ veteran_move_bonus = 0 ; The number can be variable, up to 32 ; When adding new classes, remember to check effects.ruleset also. ; Eg. if you divide class 'Land' to two separate classes, you may -; want add effect giving City Walls defence bonus against new class +; want add effect giving City Walls defense bonus against new class ; too. ; ; The actual tag used (the * in [unitclass_*]) does not matter, except diff --git a/data/webperimental/units.ruleset b/data/webperimental/units.ruleset index ea27627ef9..c4987b923b 100644 --- a/data/webperimental/units.ruleset +++ b/data/webperimental/units.ruleset @@ -86,7 +86,7 @@ veteran_move_bonus = 0, 0, 0, 0 ; The number can be variable, up to 32 ; When adding new classes, remember to check effects.ruleset also. ; Eg. if you divide class 'Land' to two separate classes, you may -; want add effect giving City Walls defence bonus against new class +; want add effect giving City Walls defense bonus against new class ; too. ; ; The actual tag used (the * in [unitclass_*]) does not matter, except diff --git a/server/advisors/advdata.c b/server/advisors/advdata.c index f4d8860103..c2bebbdc43 100644 --- a/server/advisors/advdata.c +++ b/server/advisors/advdata.c @@ -251,7 +251,7 @@ bool is_adv_data_phase_open(struct player *pplayer) because we are omniscient and don't care about such trivialities as who can see what. - FIXME: We should try to find the lowest common defence strength of our + FIXME: We should try to find the lowest common defense strength of our defending units, and ignore enemy units that are incapable of harming us, instead of just checking attack strength > 1. **************************************************************************/ @@ -343,7 +343,7 @@ bool adv_data_phase_init(struct player *pplayer, bool is_new_phase) continue; } - /* If our enemy builds missiles, worry about missile defence. */ + /* If our enemy builds missiles, worry about missile defense. */ if (utype_is_consumed_by_action(action_by_number(ACTION_ATTACK), unit_type_get(punit)) && unit_type_get(punit)->attack_strength > 1) { diff --git a/server/diplomats.c b/server/diplomats.c index c604eac399..8117a11137 100644 --- a/server/diplomats.c +++ b/server/diplomats.c @@ -1300,7 +1300,7 @@ bool spy_steal_gold(struct player *act_player, struct unit *act_unit, log_debug("steal gold: unit: %d", act_unit->id); - /* Battle all units capable of diplomatic defence. */ + /* Battle all units capable of diplomatic defense. */ if (!diplomat_infiltrate_tile(act_player, tgt_player, paction, act_unit, NULL, tgt_tile)) { @@ -1431,7 +1431,7 @@ bool spy_steal_some_maps(struct player *act_player, struct unit *act_unit, log_debug("steal some maps: unit: %d", act_unit->id); - /* Battle all units capable of diplomatic defence. */ + /* Battle all units capable of diplomatic defense. */ if (!diplomat_infiltrate_tile(act_player, tgt_player, paction, act_unit, NULL, tgt_tile)) { -- 2.35.1