diff --git a/src/common/gamecode/monster.c b/src/common/gamecode/monster.c index 2f79020e7..64e697edd 100644 --- a/src/common/gamecode/monster.c +++ b/src/common/gamecode/monster.c @@ -947,6 +947,19 @@ plan_monsters(void) } } } + + if (long_order==NULL) { + /* Einheiten, die Waffenlosen Kampf lernen könnten, lernen es um + * zu bewachen: */ + if (u->race->bonus[SK_WEAPONLESS] != -99) { + if (eff_skill(u, SK_WEAPONLESS, u->region) < 1) { + sprintf(buf, "%s %s", locale_string(f->locale, keywords[K_STUDY]), + skillname(SK_WEAPONLESS, f->locale)); + long_order = parse_order(buf, f->locale); + } + } + } + if (long_order==NULL) { /* Ab hier noch nicht generalisierte Spezialbehandlungen. */ diff --git a/src/common/gamecode/spy.c b/src/common/gamecode/spy.c index d494ceb90..b4608341b 100644 --- a/src/common/gamecode/spy.c +++ b/src/common/gamecode/spy.c @@ -96,11 +96,9 @@ spy_cmd(unit * u, struct order * ord) observe = eff_skill(target, SK_OBSERVATION, r) - (effskill(u, SK_STEALTH) + eff_skill(u, SK_SPY, r)/2); -#if NEWATSROI == 0 - if (invisible(u) >= u->number && get_item(target, I_AMULET_OF_TRUE_SEEING) == 0) { + if (invisible(u, target) >= u->number) { observe = min(observe, 0); } -#endif /* Anschließend wird - unabhängig vom Erfolg - gewürfelt, ob der * Spionageversuch bemerkt wurde. Die Wahrscheinlich dafür ist (100 - diff --git a/src/common/gamecode/study.c b/src/common/gamecode/study.c index 7c2530583..f74d4aa03 100644 --- a/src/common/gamecode/study.c +++ b/src/common/gamecode/study.c @@ -677,7 +677,7 @@ learn(void) of all units in the region, to be able to make it cumulative with with an academy */ - if(buildingtype_exists(r, bt_find("artacademy"))) { + if (buildingtype_exists(r, bt_find("artacademy"))) { days *= 2; } diff --git a/src/common/kernel/battle.c b/src/common/kernel/battle.c index ba8cc4fa2..31f13382a 100644 --- a/src/common/kernel/battle.c +++ b/src/common/kernel/battle.c @@ -240,7 +240,7 @@ armedmen(const unit * u) int n = 0; if (!(urace(u)->flags & RCF_NOWEAPONS)) { if ((urace(u)->ec_flags & CANGUARD) || effskill(u, SK_WEAPONLESS)>=1) { - /* kann ohne waffen bewachen: fuer untote und drachen */ + /* kann ohne waffen bewachen: fuer drachen */ n = u->number; } else { /* alle Waffen werden gezaehlt, und dann wird auf die Anzahl diff --git a/src/common/kernel/build.c b/src/common/kernel/build.c index 483b22045..62073b534 100644 --- a/src/common/kernel/build.c +++ b/src/common/kernel/build.c @@ -98,11 +98,7 @@ slipthru(const region * r, const unit * u, const building * b) for (u2 = r->units; u2; u2 = u2->next) if (usiege(u2) == b) { -#if NEWATSROI == 0 - if (invisible(u) >= u->number && - !get_item(u2, I_AMULET_OF_TRUE_SEEING)) - continue; -#endif + if (invisible(u, u2) >= u->number) continue; o = eff_skill(u2, SK_OBSERVATION, r); diff --git a/src/common/kernel/eressea.c b/src/common/kernel/eressea.c index 6bd6bd978..af7381eab 100644 --- a/src/common/kernel/eressea.c +++ b/src/common/kernel/eressea.c @@ -1085,11 +1085,7 @@ cansee(const faction * f, const region * r, const unit * u, int modifier) break; } -#if NEWATSROI == 0 - if (invisible(u) >= u->number - && !get_item(u2, I_AMULET_OF_TRUE_SEEING)) - continue; -#endif + if (invisible(u, u2) >= u->number) continue; o = eff_skill(u2, SK_OBSERVATION, r); #ifdef NIGHTEYES @@ -1132,11 +1128,7 @@ cansee_durchgezogen(const faction * f, const region * r, const unit * u, int mod if (u2->faction == f) { int o; -#if NEWATSROI == 0 - if (invisible(u) >= u->number - && !get_item(u2, I_AMULET_OF_TRUE_SEEING)) - continue; -#endif + if (invisible(u, u2) >= u->number) continue; o = eff_skill(u2, SK_OBSERVATION, r); diff --git a/src/common/kernel/movement.c b/src/common/kernel/movement.c index e304cbb10..2e524366c 100644 --- a/src/common/kernel/movement.c +++ b/src/common/kernel/movement.c @@ -793,8 +793,7 @@ bewegung_blockiert_von(unit * reisender, region * r) for (u=r->units;u && !contact;u=u->next) { if (getguard(u) & GUARD_TRAVELTHRU) { int sk = eff_skill(u, SK_OBSERVATION, r); - if (invisible(reisender) >= reisender->number && - !get_item(u, I_AMULET_OF_TRUE_SEEING)) continue; + if (invisible(reisender, u) >= reisender->number) continue; if (u->faction==reisender->faction) contact = true; else if (ucontact(u, reisender)) contact = true; else if (alliedunit(u, reisender->faction, HELP_GUARD)) contact = true; diff --git a/src/common/kernel/spell.c b/src/common/kernel/spell.c index d4935c282..1752f80e8 100644 --- a/src/common/kernel/spell.c +++ b/src/common/kernel/spell.c @@ -4950,7 +4950,7 @@ sp_raisepeasants(castorder *co) bauern = (int)min(rpeasants(r), power*250); rsetpeasants(r, rpeasants(r) - bauern); - u2 = create_unit(r,mage->faction, bauern, new_race[RC_PEASANT], 0,"Wilder Bauernmob",mage); + u2 = create_unit(r, mage->faction, bauern, new_race[RC_PEASANT], 0, "Wilder Bauernmob", mage); set_string(&u2->name, "Erzürnte Bauern"); fset(u2, UFL_LOCKED); diff --git a/src/common/kernel/unit.c b/src/common/kernel/unit.c index 4db9795e2..e621b8b4d 100644 --- a/src/common/kernel/unit.c +++ b/src/common/kernel/unit.c @@ -1110,14 +1110,20 @@ eff_skill_study(const unit * u, skill_t sk, const region * r) } int -invisible(const unit *u) +invisible(const unit *target, const unit * viewer) { #if NEWATSROI == 1 return 0; #else - return get_item(u, I_RING_OF_INVISIBILITY) - + 100 * get_item(u, I_SPHERE_OF_INVISIBILITY); - + if (viewer->faction==target->faction) return 0; + else { + int hidden = get_item(target, I_RING_OF_INVISIBILITY) + 100 * get_item(target, I_SPHERE_OF_INVISIBILITY); + if (hidden) { + hidden = min(hidden, target->number); + hidden -= get_item(viewer, I_AMULET_OF_TRUE_SEEING); + } + return hidden; + } #endif } diff --git a/src/common/kernel/unit.h b/src/common/kernel/unit.h index c5f5392ac..19687a809 100644 --- a/src/common/kernel/unit.h +++ b/src/common/kernel/unit.h @@ -217,7 +217,7 @@ extern void set_number(struct unit * u, int count); extern boolean learn_skill(struct unit * u, skill_t sk, double chance); -extern int invisible(const unit *u); +extern int invisible(const struct unit *target, const struct unit * viewer); #ifdef __cplusplus } diff --git a/src/res/races.xml b/src/res/races.xml index db09d3911..4206150fe 100644 --- a/src/res/races.xml +++ b/src/res/races.xml @@ -565,11 +565,11 @@ - + - + @@ -611,7 +611,7 @@ - + @@ -648,7 +648,7 @@ - + @@ -663,12 +663,12 @@ - + - + @@ -681,7 +681,7 @@ - + @@ -695,7 +695,7 @@ - + @@ -716,7 +716,7 @@ - + @@ -967,11 +967,11 @@ - + - + @@ -979,7 +979,7 @@ - + @@ -993,7 +993,7 @@ - + @@ -1011,7 +1011,7 @@ - + @@ -1029,7 +1029,7 @@ - + @@ -1045,7 +1045,7 @@ - + @@ -1060,7 +1060,7 @@ - + @@ -1075,7 +1075,7 @@ - + @@ -1122,7 +1122,7 @@ - + @@ -1282,7 +1282,7 @@ - + @@ -1319,7 +1319,7 @@ - + @@ -1330,7 +1330,7 @@ - + @@ -1380,7 +1380,7 @@ - + @@ -1392,7 +1392,7 @@ - + @@ -1410,7 +1410,7 @@