From 2378bc10a9455290b456f99b0bfd745d276fd7f6 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 17 Dec 2022 17:10:28 +0200 Subject: [PATCH 33/33] 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/goldkeep/units.ruleset | 2 +- data/granularity/units.ruleset | 2 +- data/multiplayer/units.ruleset | 2 +- data/ruledit/comments-3.2.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 ++-- 18 files changed, 32 insertions(+), 32 deletions(-) diff --git a/ai/default/aiair.c b/ai/default/aiair.c index 36c657ab3f..760b28cea5 100644 --- a/ai/default/aiair.c +++ b/ai/default/aiair.c @@ -167,7 +167,7 @@ static adv_want 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 */ adv_want profit; /* time spent in the air */ @@ -202,7 +202,7 @@ static adv_want dai_evaluate_tile_for_air_attack(struct unit *punit, unit_attack = (int) (PROB_MULTIPLIER * unit_win_chance(punit, pdefender, NULL)); - victim_defence = PROB_MULTIPLIER - unit_attack; + victim_defense = PROB_MULTIPLIER - unit_attack; balanced_cost = build_cost_balanced(unit_type_get(punit)); @@ -214,7 +214,7 @@ static adv_want dai_evaluate_tile_for_air_attack(struct unit *punit, dst_tile, dst_tile) >= MAX_MOVE_FRAGS ? 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 2491ec7912..50ec081a88 100644 --- a/ai/default/aiunit.c +++ b/ai/default/aiunit.c @@ -272,20 +272,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) { const 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 the unit_def_rating() - used in actual computations. **************************************************************************/ static int unit_def_rating_squared(const struct unit *attacker, const struct unit *defender) @@ -296,7 +296,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. **************************************************************************/ @@ -701,7 +701,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, @@ -1145,7 +1145,7 @@ adv_want 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 19a536464a..1cd8509dab 100644 --- a/ai/default/daimilitary.c +++ b/ai/default/daimilitary.c @@ -205,7 +205,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(pcity, NULL, putype) <= @@ -461,7 +461,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. @@ -750,7 +750,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; @@ -853,7 +853,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 */ @@ -1307,7 +1307,7 @@ static struct adv_choice *kill_something_with(struct ai_type *ait, 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 3db2e1e15d..9ccdcf6b31 100644 --- a/ai/default/daimilitary.h +++ b/ai/default/daimilitary.h @@ -49,7 +49,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); @@ -57,4 +57,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 c1af20794c..b0dc2ec4db 100644 --- a/data/alien/units.ruleset +++ b/data/alien/units.ruleset @@ -76,7 +76,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 a552335b0c..92c040d458 100644 --- a/data/civ1/units.ruleset +++ b/data/civ1/units.ruleset @@ -72,7 +72,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 2a1e6860d7..d2482974ee 100644 --- a/data/civ2/units.ruleset +++ b/data/civ2/units.ruleset @@ -80,7 +80,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 a266f05d86..89805b8dc1 100644 --- a/data/civ2civ3/units.ruleset +++ b/data/civ2civ3/units.ruleset @@ -89,7 +89,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 7e08c8bdc0..1833be1b54 100644 --- a/data/classic/units.ruleset +++ b/data/classic/units.ruleset @@ -87,7 +87,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/goldkeep/units.ruleset b/data/goldkeep/units.ruleset index 5042d13616..d539ddc524 100644 --- a/data/goldkeep/units.ruleset +++ b/data/goldkeep/units.ruleset @@ -91,7 +91,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/granularity/units.ruleset b/data/granularity/units.ruleset index 2fcf31dc97..0d38fe768b 100644 --- a/data/granularity/units.ruleset +++ b/data/granularity/units.ruleset @@ -70,7 +70,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/multiplayer/units.ruleset b/data/multiplayer/units.ruleset index 8fbd1e02ee..3cccb20a41 100644 --- a/data/multiplayer/units.ruleset +++ b/data/multiplayer/units.ruleset @@ -87,7 +87,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-3.2.txt b/data/ruledit/comments-3.2.txt index 50f5b2c960..353ff73809 100644 --- a/data/ruledit/comments-3.2.txt +++ b/data/ruledit/comments-3.2.txt @@ -245,7 +245,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 5dd188eda0..d99dc56b5e 100644 --- a/data/sandbox/units.ruleset +++ b/data/sandbox/units.ruleset @@ -99,7 +99,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 c84e4c7b2b..98b3d8cb0a 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 16f205a944..7d04463656 100644 --- a/data/webperimental/units.ruleset +++ b/data/webperimental/units.ruleset @@ -94,7 +94,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 18f75f69a1..4e59cbc4a8 100644 --- a/server/advisors/advdata.c +++ b/server/advisors/advdata.c @@ -255,7 +255,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. **************************************************************************/ @@ -368,7 +368,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_can_do_action(unit_type_get(punit), ACTION_SUICIDE_ATTACK) && unit_type_get(punit)->attack_strength > 1) { adv->threats.suicide_attack = TRUE; diff --git a/server/diplomats.c b/server/diplomats.c index 4cb7fbd6c5..30c3aeaa3e 100644 --- a/server/diplomats.c +++ b/server/diplomats.c @@ -1591,7 +1591,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, @@ -1728,7 +1728,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