diff --git a/src/common/kernel/battle.c b/src/common/kernel/battle.c index 811d7fabc..85d41bdc9 100644 --- a/src/common/kernel/battle.c +++ b/src/common/kernel/battle.c @@ -3660,18 +3660,21 @@ init_battle(region * r, battle **bp) unit *u2; fighter *c1, *c2; - if(r->planep && fval(r->planep, PFL_NOATTACK)) { + if (r->planep && fval(r->planep, PFL_NOATTACK)) { cmistake(u, ord, 271, MSG_BATTLE); continue; } + if ((u->race->battle_flags&BF_CANATTACK) == 0) { + ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "race_no_attack", "race", u->race)); + continue; + } /** ** Fehlerbehandlung Angreifer **/ #ifdef DELAYED_OFFENSE if (get_moved(&u->attribs) && !guarded_by(r, u->faction)) { - add_message(&u->faction->msgs, - msg_message("no_attack_after_advance", "unit region command", u, u->region, ord)); + ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "no_attack_after_advance", "")); } #endif if (LongHunger(u)) { diff --git a/src/common/kernel/race.h b/src/common/kernel/race.h index 51869d683..8ac8ba346 100644 --- a/src/common/kernel/race.h +++ b/src/common/kernel/race.h @@ -156,6 +156,7 @@ extern int rc_specialdamage(const race *, const race *, const struct weapon_type #define BF_RES_CUT (1<<3) /* Halber Schaden durch CUT */ #define BF_RES_BASH (1<<4) /* Halber Schaden durch BASH */ #define BF_INV_NONMAGIC (1<<5) /* Immun gegen nichtmagischen Schaden */ +#define BF_CANATTACK (1<<6) /* Kann keine ATTACKIERE Befehle ausfuehren */ extern int unit_old_max_hp(struct unit * u); extern const char * racename(const struct locale *lang, const struct unit *u, const race * rc); diff --git a/src/common/kernel/xmlreader.c b/src/common/kernel/xmlreader.c index 86a5fd3f0..70a9b0011 100644 --- a/src/common/kernel/xmlreader.c +++ b/src/common/kernel/xmlreader.c @@ -1446,6 +1446,7 @@ parse_races(xmlDocPtr doc) if (xml_bvalue(node, "resistbash", false)) rc->battle_flags |= BF_RES_BASH; if (xml_bvalue(node, "resistcut", false)) rc->battle_flags |= BF_RES_CUT; if (xml_bvalue(node, "resistpierce", false)) rc->battle_flags |= BF_RES_PIERCE; + if (xml_bvalue(node, "canattack", true)) rc->battle_flags |= BF_CANATTACK; /* reading eressea/races/race/ai */ xpath->node = node; diff --git a/src/common/spells/spells.c b/src/common/spells/spells.c index 22de5d306..069e25d42 100644 --- a/src/common/spells/spells.c +++ b/src/common/spells/spells.c @@ -2234,14 +2234,10 @@ sp_ironkeeper(castorder *co) unit *mage = co->magician.u; int cast_level = co->level; - /* this does not make sense anymore, iron and laen can appear - * in any region */ - /* if (rterrain(r) != T_MOUNTAIN && rterrain(r) != T_GLACIER) { report_failure(mage, co->order); return 0; } - */ keeper = create_unit(r, mage->faction, 1, new_race[RC_IRONKEEPER], 0, "Bergwächter", mage); diff --git a/src/res/messages.xml b/src/res/messages.xml index 20964599c..59f1dc32a 100644 --- a/src/res/messages.xml +++ b/src/res/messages.xml @@ -6018,6 +6018,17 @@ "'$order($command)' - $unit($unit) marched into $region($region) during the last turn and is too exhausted to attack." "'$order($command)' - $unit($unit) marched into $region($region) during the last turn and is too exhausted to attack." + + + + + + + + "$unit($unit) in $region($region): '$order($command)' - $race($race,0) sind friedliebend und attackieren niemand." + "'$order($command)' - $race($race,0) are peace-loving and will not attack anyone." + "'$order($command)' - $race($race,0) are peace-loving and will not attack anyone." +