"Blick in die Realität mit falschem Namen"
- make invisible races disappear from the CR.
This commit is contained in:
Enno Rehling 2008-02-04 18:33:53 +00:00
parent 16c3b68114
commit 16d55c2eaf
6 changed files with 11 additions and 7 deletions

View file

@ -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");

View file

@ -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->mode<see_unit) continue;
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)) {
order * ord;
if (!dh) {
rps_nowrap(F, "");

View file

@ -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;

View file

@ -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 */

View file

@ -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;

View file

@ -679,7 +679,7 @@
<skill name="weaponsmithing" modifier="14"/>
<attack type="4" damage="2d8+4"/>
</race>
<race name="spell" magres="0.000000" maxaura="1.000000" regaura="0.100000" recruitcost="0" weight="0" capacity="0" speed="0.000000" hp="1" damage="1d4" unarmedattack="-2" unarmeddefense="-2" canlearn="no" noheal="yes" noweapons="yes" illusionary="yes" fly="yes" swim="yes" walk="yes">
<race name="spell" magres="0.000000" maxaura="1.000000" regaura="0.100000" recruitcost="0" weight="0" capacity="0" speed="0.000000" hp="1" damage="1d4" unarmedattack="-2" unarmeddefense="-2" canlearn="no" noheal="yes" noweapons="yes" illusionary="yes" invisible="yes" fly="yes" swim="yes" walk="yes">
<ai splitsize="1"/>
<attack type="1" damage="1d4"/>
</race>