diff --git a/src/common/gamecode/creport.c b/src/common/gamecode/creport.c index b007d4bad..65c757a7d 100644 --- a/src/common/gamecode/creport.c +++ b/src/common/gamecode/creport.c @@ -664,6 +664,8 @@ cr_output_unit(FILE * F, const region * r, static const curse_type * itemcloak_ct = 0; static boolean init = false; + if (fval(u->race, RCF_INVISIBLE)) return; + if (!init) { init = true; itemcloak_ct = ct_find("itemcloak"); diff --git a/src/common/gamecode/report.c b/src/common/gamecode/report.c index 3ac4546b2..eefd8be1e 100644 --- a/src/common/gamecode/report.c +++ b/src/common/gamecode/report.c @@ -659,7 +659,7 @@ rpunit(FILE * F, const faction * f, const unit * u, int indent, int mode) boolean isbattle = (boolean)(mode == see_battle); char buf[8192]; - if (u->race == new_race[RC_SPELL]) return; + if (fval(u->race, RCF_INVISIBLE)) return; { rnl(F); @@ -1181,7 +1181,7 @@ statistics(FILE * F, const region * r, const faction * f) /* count */ for (u = r->units; u; u = u->next) { - if (u->faction == f && u->race != new_race[RC_SPELL]) { + if (u->faction == f && !fval(u->race, RCF_INVISIBLE)) { for (itm=u->items;itm;itm=itm->next) { i_change(&items, itm->type, itm->number); } @@ -1391,7 +1391,7 @@ report_template(const char * filename, report_context * ctx, const char * charse if (sr->modeunits; u; u = u->next) { - if (u->faction == f && u->race != new_race[RC_SPELL]) { + if (u->faction == f && !fval(u->race, RCF_INVISIBLE)) { order * ord; if (!dh) { rps_nowrap(F, ""); diff --git a/src/common/kernel/eressea.c b/src/common/kernel/eressea.c index 22b0545f9..2abe4c585 100644 --- a/src/common/kernel/eressea.c +++ b/src/common/kernel/eressea.c @@ -1040,7 +1040,7 @@ cansee(const faction * f, const region * r, const unit * u, int modifier) if (u->faction == f || omniscient(f)) { return true; - } else if (u->race == new_race[RC_SPELL]) { + } else if (fval(u->race, RCF_INVISIBLE)) { return false; } else if (u->number == 0) { attrib *a = a_find(u->attribs, &at_creator); @@ -1091,7 +1091,7 @@ boolean cansee_unit(const unit * u, const unit * target, int modifier) /* target->region kann != u->region sein, wenn es um durchreisen geht */ { - if (target->race == new_race[RC_SPELL] || target->number == 0) return false; + if (fval(target->race, RCF_INVISIBLE) || target->number == 0) return false; else if (target->faction == u->faction) return true; else { int n, rings, o; @@ -1131,7 +1131,7 @@ cansee_durchgezogen(const faction * f, const region * r, const unit * u, int mod int n; unit *u2; - if (u->race == new_race[RC_SPELL] || u->number == 0) return false; + if (fval(u->race, RCF_INVISIBLE) || u->number == 0) return false; else if (u->faction == f) return true; else { int rings; diff --git a/src/common/kernel/race.h b/src/common/kernel/race.h index 3692effdb..cd3a1f9ca 100644 --- a/src/common/kernel/race.h +++ b/src/common/kernel/race.h @@ -133,6 +133,7 @@ extern int rc_specialdamage(const race *, const race *, const struct weapon_type #define RCF_COASTAL (1<<22) /* kann in Landregionen an der Küste sein */ #define RCF_UNARMEDGUARD (1<<23) /* kann ohne Waffen bewachen */ #define RCF_CANSAIL (1<<24) /* Einheit darf Schiffe betreten */ +#define RCF_INVISIBLE (1<<25) /* not visible in any report */ /* Economic flags */ #define NOGIVE (1<<0) /* gibt niemals nix */ diff --git a/src/common/kernel/xmlreader.c b/src/common/kernel/xmlreader.c index 4a51feb4c..1de6b4a54 100644 --- a/src/common/kernel/xmlreader.c +++ b/src/common/kernel/xmlreader.c @@ -1473,6 +1473,7 @@ parse_races(xmlDocPtr doc) if (xml_bvalue(node, "cansail", true)) rc->flags |= RCF_CANSAIL; if (xml_bvalue(node, "cannotmove", false)) rc->flags |= RCF_CANNOTMOVE; if (xml_bvalue(node, "fly", false)) rc->flags |= RCF_FLY; + if (xml_bvalue(node, "invisible", false)) rc->flags |= RCF_INVISIBLE; if (xml_bvalue(node, "coastal", false)) rc->flags |= RCF_COASTAL; if (xml_bvalue(node, "unarmedguard", false)) rc->flags |= RCF_UNARMEDGUARD; if (xml_bvalue(node, "swim", false)) rc->flags |= RCF_SWIM; diff --git a/src/res/races.xml b/src/res/races.xml index 2865fbf44..99680d0a3 100644 --- a/src/res/races.xml +++ b/src/res/races.xml @@ -679,7 +679,7 @@ - +