forked from github/server
rename defence->defense (prefer US spelling).
This commit is contained in:
parent
d8468dc83f
commit
7b682c6a74
14
src/battle.c
14
src/battle.c
|
@ -1138,7 +1138,7 @@ static void demon_dazzle(fighter *af, troop dt) {
|
||||||
if (u_race(af->unit) == get_race(RC_DAEMON)) {
|
if (u_race(af->unit) == get_race(RC_DAEMON)) {
|
||||||
if (!(df->person[dt.index].flags & (FL_COURAGE | FL_DAZZLED))) {
|
if (!(df->person[dt.index].flags & (FL_COURAGE | FL_DAZZLED))) {
|
||||||
df->person[dt.index].flags |= FL_DAZZLED;
|
df->person[dt.index].flags |= FL_DAZZLED;
|
||||||
df->person[dt.index].defence--;
|
df->person[dt.index].defense--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1191,7 +1191,7 @@ static void destroy_items(troop dt) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void calculate_defence_type(troop dt, troop at, int type, bool missile,
|
static void calculate_defense_type(troop dt, troop at, int type, bool missile,
|
||||||
const weapon_type **dwtype, int *defskill) {
|
const weapon_type **dwtype, int *defskill) {
|
||||||
const weapon *weapon;
|
const weapon *weapon;
|
||||||
weapon = select_weapon(dt, false, true); /* missile=true to get the unmodified best weapon she has */
|
weapon = select_weapon(dt, false, true); /* missile=true to get the unmodified best weapon she has */
|
||||||
|
@ -1320,7 +1320,7 @@ terminate(troop dt, troop at, int type, const char *damage_formula, bool missile
|
||||||
++at.fighter->hits;
|
++at.fighter->hits;
|
||||||
|
|
||||||
calculate_attack_type(at, dt, type, missile, &awtype, &attskill, &magic);
|
calculate_attack_type(at, dt, type, missile, &awtype, &attskill, &magic);
|
||||||
calculate_defence_type(at, dt, type, missile, &awtype, &attskill);
|
calculate_defense_type(at, dt, type, missile, &awtype, &attskill);
|
||||||
|
|
||||||
if (is_riding(at) && (awtype == NULL || (fval(awtype, WTF_HORSEBONUS)
|
if (is_riding(at) && (awtype == NULL || (fval(awtype, WTF_HORSEBONUS)
|
||||||
&& !fval(awtype, WTF_MISSILE)))) {
|
&& !fval(awtype, WTF_MISSILE)))) {
|
||||||
|
@ -1946,7 +1946,7 @@ int skilldiff(troop at, troop dt, int dist)
|
||||||
rc_goblin = get_race(RC_GOBLIN);
|
rc_goblin = get_race(RC_GOBLIN);
|
||||||
}
|
}
|
||||||
skdiff += af->person[at.index].attack;
|
skdiff += af->person[at.index].attack;
|
||||||
skdiff -= df->person[dt.index].defence;
|
skdiff -= df->person[dt.index].defense;
|
||||||
|
|
||||||
if (df->person[dt.index].flags & FL_SLEEPING)
|
if (df->person[dt.index].flags & FL_SLEEPING)
|
||||||
skdiff += 2;
|
skdiff += 2;
|
||||||
|
@ -2075,7 +2075,7 @@ void dazzle(battle * b, troop * td)
|
||||||
}
|
}
|
||||||
|
|
||||||
td->fighter->person[td->index].flags |= FL_DAZZLED;
|
td->fighter->person[td->index].flags |= FL_DAZZLED;
|
||||||
td->fighter->person[td->index].defence--;
|
td->fighter->person[td->index].defense--;
|
||||||
}
|
}
|
||||||
|
|
||||||
void damage_building(battle * b, building * bldg, int damage_abs)
|
void damage_building(battle * b, building * bldg, int damage_abs)
|
||||||
|
@ -2241,7 +2241,7 @@ static void attack(battle * b, troop ta, const att * a, int numattack)
|
||||||
td.fighter->person[td.index].attack -= 1;
|
td.fighter->person[td.index].attack -= 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
td.fighter->person[td.index].defence -= 1;
|
td.fighter->person[td.index].defense -= 1;
|
||||||
}
|
}
|
||||||
c--;
|
c--;
|
||||||
}
|
}
|
||||||
|
@ -3184,7 +3184,7 @@ fighter *make_fighter(battle * b, unit * u, side * s1, bool attack)
|
||||||
strongmen = trollbelts(u);
|
strongmen = trollbelts(u);
|
||||||
if (strongmen > fig->unit->number) strongmen = fig->unit->number;
|
if (strongmen > fig->unit->number) strongmen = fig->unit->number;
|
||||||
|
|
||||||
/* Hitpoints, Attack- und Defence-Boni f<>r alle Personen */
|
/* Hitpoints, Attack- und Defense-Boni fuer alle Personen */
|
||||||
for (i = 0; i < fig->alive; i++) {
|
for (i = 0; i < fig->alive; i++) {
|
||||||
assert(i < fig->unit->number);
|
assert(i < fig->unit->number);
|
||||||
fig->person[i].hp = h;
|
fig->person[i].hp = h;
|
||||||
|
|
|
@ -173,7 +173,7 @@ extern "C" {
|
||||||
struct person {
|
struct person {
|
||||||
int hp; /* Trefferpunkte der Personen */
|
int hp; /* Trefferpunkte der Personen */
|
||||||
int attack;
|
int attack;
|
||||||
int defence;
|
int defense;
|
||||||
int damage;
|
int damage;
|
||||||
int flags;
|
int flags;
|
||||||
int speed;
|
int speed;
|
||||||
|
|
|
@ -303,7 +303,7 @@ static void test_building_bonus_respects_size(CuTest * tc)
|
||||||
test_teardown();
|
test_teardown();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_building_defence_bonus(CuTest * tc)
|
static void test_building_defense_bonus(CuTest * tc)
|
||||||
{
|
{
|
||||||
building_type * btype;
|
building_type * btype;
|
||||||
|
|
||||||
|
@ -570,7 +570,7 @@ static void test_battle_skilldiff(CuTest *tc)
|
||||||
CuAssertIntEquals(tc, 0, skilldiff(ta, td, 0));
|
CuAssertIntEquals(tc, 0, skilldiff(ta, td, 0));
|
||||||
|
|
||||||
ta.fighter->person[0].attack = 2;
|
ta.fighter->person[0].attack = 2;
|
||||||
td.fighter->person[0].defence = 1;
|
td.fighter->person[0].defense = 1;
|
||||||
CuAssertIntEquals(tc, 1, skilldiff(ta, td, 0));
|
CuAssertIntEquals(tc, 1, skilldiff(ta, td, 0));
|
||||||
|
|
||||||
td.fighter->person[0].flags |= FL_SLEEPING;
|
td.fighter->person[0].flags |= FL_SLEEPING;
|
||||||
|
@ -888,7 +888,7 @@ CuSuite *get_battle_suite(void)
|
||||||
SUITE_ADD_TEST(suite, test_defenders_get_building_bonus);
|
SUITE_ADD_TEST(suite, test_defenders_get_building_bonus);
|
||||||
SUITE_ADD_TEST(suite, test_attackers_get_no_building_bonus);
|
SUITE_ADD_TEST(suite, test_attackers_get_no_building_bonus);
|
||||||
SUITE_ADD_TEST(suite, test_building_bonus_respects_size);
|
SUITE_ADD_TEST(suite, test_building_bonus_respects_size);
|
||||||
SUITE_ADD_TEST(suite, test_building_defence_bonus);
|
SUITE_ADD_TEST(suite, test_building_defense_bonus);
|
||||||
SUITE_ADD_TEST(suite, test_calculate_armor);
|
SUITE_ADD_TEST(suite, test_calculate_armor);
|
||||||
SUITE_ADD_TEST(suite, test_natural_armor);
|
SUITE_ADD_TEST(suite, test_natural_armor);
|
||||||
SUITE_ADD_TEST(suite, test_magic_resistance);
|
SUITE_ADD_TEST(suite, test_magic_resistance);
|
||||||
|
|
|
@ -956,7 +956,7 @@ int sp_hero(struct castorder * co)
|
||||||
|
|
||||||
if (df) {
|
if (df) {
|
||||||
if (!(df->person[dt.index].flags & FL_COURAGE)) {
|
if (!(df->person[dt.index].flags & FL_COURAGE)) {
|
||||||
df->person[dt.index].defence += df_bonus;
|
df->person[dt.index].defense += df_bonus;
|
||||||
df->person[dt.index].flags = df->person[dt.index].flags | FL_COURAGE;
|
df->person[dt.index].flags = df->person[dt.index].flags | FL_COURAGE;
|
||||||
targets++;
|
targets++;
|
||||||
--force;
|
--force;
|
||||||
|
@ -1005,7 +1005,7 @@ int sp_berserk(struct castorder * co)
|
||||||
if (df) {
|
if (df) {
|
||||||
if (!(df->person[dt.index].flags & FL_COURAGE)) {
|
if (!(df->person[dt.index].flags & FL_COURAGE)) {
|
||||||
df->person[dt.index].attack += at_bonus;
|
df->person[dt.index].attack += at_bonus;
|
||||||
df->person[dt.index].defence -= df_malus;
|
df->person[dt.index].defense -= df_malus;
|
||||||
df->person[dt.index].flags = df->person[dt.index].flags | FL_COURAGE;
|
df->person[dt.index].flags = df->person[dt.index].flags | FL_COURAGE;
|
||||||
targets++;
|
targets++;
|
||||||
--force;
|
--force;
|
||||||
|
@ -1064,7 +1064,7 @@ int sp_frighten(struct castorder * co)
|
||||||
}
|
}
|
||||||
if (!is_magic_resistant(mage, df->unit, 0)) {
|
if (!is_magic_resistant(mage, df->unit, 0)) {
|
||||||
df->person[dt.index].attack -= at_malus;
|
df->person[dt.index].attack -= at_malus;
|
||||||
df->person[dt.index].defence -= df_malus;
|
df->person[dt.index].defense -= df_malus;
|
||||||
targets++;
|
targets++;
|
||||||
}
|
}
|
||||||
--force;
|
--force;
|
||||||
|
@ -1109,7 +1109,7 @@ int sp_tiredsoldiers(struct castorder * co)
|
||||||
if (!(df->person[t.index].flags & FL_TIRED)) {
|
if (!(df->person[t.index].flags & FL_TIRED)) {
|
||||||
if (!is_magic_resistant(mage, df->unit, 0)) {
|
if (!is_magic_resistant(mage, df->unit, 0)) {
|
||||||
df->person[t.index].flags = df->person[t.index].flags | FL_TIRED;
|
df->person[t.index].flags = df->person[t.index].flags | FL_TIRED;
|
||||||
df->person[t.index].defence -= 2;
|
df->person[t.index].defense -= 2;
|
||||||
++n;
|
++n;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue