- FLIEHEnde oder NICHT kaempfende Einheiten koennen keine Beute mehr machen.
- Es gibt fuer select_enemy() u.a. jetzt eine Option, die ohne Beruecksichtigung des Advancements zu berechnen, wie fuer die o.g. Beuteverteilung benoetigt.
This commit is contained in:
Enno Rehling 2004-09-11 17:29:13 +00:00
parent 736739ca42
commit f68f9af5c5
9 changed files with 130 additions and 118 deletions

View File

@ -164,7 +164,7 @@ attack_firesword(const troop * at, int *casualties, int row)
int force = 1+rand()%10; int force = 1+rand()%10;
if (row==FIGHT_ROW) { if (row==FIGHT_ROW) {
enemies = count_enemies(fi->side->battle, fi->side, minrow, maxrow); enemies = count_enemies(fi->side->battle, fi->side, minrow, maxrow, true);
} }
if (!enemies) { if (!enemies) {
if (casualties) *casualties = 0; if (casualties) *casualties = 0;
@ -184,7 +184,7 @@ attack_firesword(const troop * at, int *casualties, int row)
} }
do { do {
dt = select_enemy(fi->side->battle, fi, minrow, maxrow); dt = select_enemy(fi->side->battle, fi, minrow, maxrow, true);
assert(dt.fighter); assert(dt.fighter);
--force; --force;
killed += terminate(dt, *at, AT_SPELL, damage, 1); killed += terminate(dt, *at, AT_SPELL, damage, 1);
@ -231,7 +231,7 @@ attack_catapult(const troop * at, int * casualties, int row)
minrow = FIGHT_ROW; minrow = FIGHT_ROW;
maxrow = FIGHT_ROW; maxrow = FIGHT_ROW;
n = min(CATAPULT_ATTACKS, count_enemies(b, af->side, minrow, maxrow)); n = min(CATAPULT_ATTACKS, count_enemies(b, af->side, minrow, maxrow, true));
#if CATAPULT_AMMUNITION #if CATAPULT_AMMUNITION
new_use_pooled(au, &rt_catapultammo, GET_SLACK|GET_RESERVE|GET_POOLED_SLACK, 1); new_use_pooled(au, &rt_catapultammo, GET_SLACK|GET_RESERVE|GET_POOLED_SLACK, 1);
@ -239,7 +239,7 @@ attack_catapult(const troop * at, int * casualties, int row)
while (--n >= 0) { while (--n >= 0) {
/* Select defender */ /* Select defender */
dt = select_enemy(b, af, minrow, maxrow); dt = select_enemy(b, af, minrow, maxrow, true);
if (!dt.fighter) if (!dt.fighter)
break; break;

View File

@ -1261,14 +1261,16 @@ terminate(troop dt, troop at, int type, const char *damage, boolean missile)
} }
static int static int
count_side(const side * s, int minrow, int maxrow) count_side(const side * s, int minrow, int maxrow, boolean advance)
{ {
void **fi; void **fi;
int people = 0; int people = 0;
int unitrow[NUMROWS]; int unitrow[NUMROWS];
int i; int i;
for (i=0;i!=NUMROWS;++i) unitrow[i] = -1; if (advance) {
for (i=0;i!=NUMROWS;++i) unitrow[i] = -1;
}
for (fi = s->fighters.begin; fi != s->fighters.end; ++fi) { for (fi = s->fighters.begin; fi != s->fighters.end; ++fi) {
const fighter *fig = *fi; const fighter *fig = *fi;
@ -1276,11 +1278,12 @@ count_side(const side * s, int minrow, int maxrow)
if (fig->alive - fig->removed <= 0) continue; if (fig->alive - fig->removed <= 0) continue;
row = statusrow(fig->status); row = statusrow(fig->status);
if (unitrow[row] == -1) { if (advance) {
unitrow[row] = get_unitrow(fig); if (unitrow[row] == -1) {
unitrow[row] = get_unitrow(fig);
}
row = unitrow[row];
} }
row = unitrow[row];
if (row >= minrow && row <= maxrow) { if (row >= minrow && row <= maxrow) {
people += fig->alive - fig->removed; people += fig->alive - fig->removed;
} }
@ -1290,7 +1293,7 @@ count_side(const side * s, int minrow, int maxrow)
/* new implementation of count_enemies ignores mask, since it was never used */ /* new implementation of count_enemies ignores mask, since it was never used */
int int
count_enemies(battle * b, side * as, int minrow, int maxrow) count_enemies(battle * b, side * as, int minrow, int maxrow, boolean advance)
{ {
int i = 0; int i = 0;
void **si; void **si;
@ -1300,14 +1303,14 @@ count_enemies(battle * b, side * as, int minrow, int maxrow)
for (si = b->sides.begin; si != b->sides.end; ++si) { for (si = b->sides.begin; si != b->sides.end; ++si) {
side *side = *si; side *side = *si;
if (as==NULL || enemy(side, as)) { if (as==NULL || enemy(side, as)) {
i += count_side(side, minrow, maxrow); i += count_side(side, minrow, maxrow, advance);
} }
} }
return i; return i;
} }
troop troop
select_enemy(battle * b, fighter * af, int minrow, int maxrow) select_enemy(battle * b, fighter * af, int minrow, int maxrow, boolean advance)
{ {
side *as = af->side; side *as = af->side;
int si; int si;
@ -1321,7 +1324,7 @@ select_enemy(battle * b, fighter * af, int minrow, int maxrow)
} }
minrow = max(minrow, FIGHT_ROW); minrow = max(minrow, FIGHT_ROW);
enemies = count_enemies(b, as, minrow, maxrow); enemies = count_enemies(b, as, minrow, maxrow, advance);
/* Niemand ist in der angegebenen Entfernung? */ /* Niemand ist in der angegebenen Entfernung? */
if (enemies<=0) return no_troop; if (enemies<=0) return no_troop;
@ -1330,19 +1333,24 @@ select_enemy(battle * b, fighter * af, int minrow, int maxrow)
for (si=0;as->enemies[si];++si) { for (si=0;as->enemies[si];++si) {
side *ds = as->enemies[si]; side *ds = as->enemies[si];
void ** fi; void ** fi;
int ui, unitrow[NUMROWS]; int unitrow[NUMROWS];
for (ui=0;ui!=NUMROWS;++ui) unitrow[ui] = -1; if (advance) {
int ui;
for (ui=0;ui!=NUMROWS;++ui) unitrow[ui] = -1;
}
for (fi=ds->fighters.begin;fi!=ds->fighters.end;++fi) { for (fi=ds->fighters.begin;fi!=ds->fighters.end;++fi) {
fighter * df = *fi; fighter * df = *fi;
int dr; int dr;
ui = statusrow(df->status); dr = statusrow(df->status);
if (unitrow[ui]<0) { if (advance) {
unitrow[ui] = get_unitrow(df); if (unitrow[dr]<0) {
unitrow[dr] = get_unitrow(df);
}
dr = unitrow[dr];
} }
dr = unitrow[ui];
if (dr < minrow || dr > maxrow) continue; if (dr < minrow || dr > maxrow) continue;
if (df->alive - df->removed > enemies) { if (df->alive - df->removed > enemies) {
@ -1386,7 +1394,7 @@ select_opponent(battle * b, troop at, int minrow, int maxrow)
} }
} }
#endif #endif
dt = select_enemy(b, at.fighter, minrow, maxrow); dt = select_enemy(b, at.fighter, minrow, maxrow, true);
#ifdef FIXED_OPPONENTS #ifdef FIXED_OPPONENTS
if (dt.fighter!=NULL) { if (dt.fighter!=NULL) {
fighter * df = dt.fighter; fighter * df = dt.fighter;
@ -2162,34 +2170,34 @@ attack(battle *b, troop ta, const att *a, int numattack)
void void
do_attack(fighter * af) do_attack(fighter * af)
{ {
troop ta; troop ta;
unit *au = af->unit; unit *au = af->unit;
side *side = af->side; side *side = af->side;
battle *b = side->battle; battle *b = side->battle;
ta.fighter = af; ta.fighter = af;
assert(au && au->number); assert(au && au->number);
/* Da das Zuschlagen auf Einheiten und nicht auf den einzelnen /* Da das Zuschlagen auf Einheiten und nicht auf den einzelnen
* Kämpfern beruht, darf die Reihenfolge und Größe der Einheit keine * Kämpfern beruht, darf die Reihenfolge und Größe der Einheit keine
* Rolle spielen, Das tut sie nur dann, wenn jeder, der am Anfang der * Rolle spielen, Das tut sie nur dann, wenn jeder, der am Anfang der
* Runde lebte, auch zuschlagen darf. Ansonsten ist der, der zufällig * Runde lebte, auch zuschlagen darf. Ansonsten ist der, der zufällig
* mit einer großen Einheit zuerst drankommt, extrem bevorteilt. */ * mit einer großen Einheit zuerst drankommt, extrem bevorteilt. */
ta.index = af->fighting; ta.index = af->fighting;
while (ta.index--) { while (ta.index--) {
/* Wir suchen eine beliebige Feind-Einheit aus. An der können /* Wir suchen eine beliebige Feind-Einheit aus. An der können
* wir feststellen, ob noch jemand da ist. */ * wir feststellen, ob noch jemand da ist. */
int enemies = count_enemies(b, af->side, FIGHT_ROW, LAST_ROW); int enemies = count_enemies(b, af->side, FIGHT_ROW, LAST_ROW, true);
int apr, attacks = attacks_per_round(ta); int apr, attacks = attacks_per_round(ta);
if (!enemies) break; if (!enemies) break;
for (apr=0;apr!=attacks;++apr) { for (apr=0;apr!=attacks;++apr) {
int a; int a;
for (a=0; a!=10 && au->race->attack[a].type!=AT_NONE; ++a) { for (a=0; a!=10 && au->race->attack[a].type!=AT_NONE; ++a) {
if (apr>0) { if (apr>0) {
/* Wenn die Waffe nachladen muss, oder es sich nicht um einen /* Wenn die Waffe nachladen muss, oder es sich nicht um einen
* Waffen-Angriff handelt, dann gilt der Speed nicht. */ * Waffen-Angriff handelt, dann gilt der Speed nicht. */
if (au->race->attack[a].type!=AT_STANDARD) continue; if (au->race->attack[a].type!=AT_STANDARD) continue;
else { else {
weapon * wp = preferred_weapon(ta, true); weapon * wp = preferred_weapon(ta, true);
@ -2197,9 +2205,9 @@ do_attack(fighter * af)
} }
} }
attack(b, ta, &(au->race->attack[a]), apr); attack(b, ta, &(au->race->attack[a]), apr);
} }
} }
} }
} }
void void
@ -2286,42 +2294,46 @@ make_side(battle * b, const faction * f, const group * g, boolean stealth, const
void void
loot_items(fighter * corpse) loot_items(fighter * corpse)
{ {
unit * u = corpse->unit; unit * u = corpse->unit;
item * itm = u->items; item * itm = u->items;
battle * b = corpse->side->battle; battle * b = corpse->side->battle;
u->items = NULL; u->items = NULL;
while (itm) { while (itm) {
int i; int i;
if (itm->number) { if (itm->number) {
for (i = 10; i != 0; i--) { for (i = 10; i != 0; --i) {
int loot = itm->number / i; int loot = itm->number / i;
itm->number -= loot; /* Looten tun hier immer nur die Gegner. Das ist als Ausgleich für die
/* Looten tun hier immer nur die Gegner. Das * neue Loot-regel (nur ganz tote Einheiten) fair.
* ist als Ausgleich für die neue Loot-regel * zusätzlich looten auch geflohene, aber nach anderen Regeln.
* (nur ganz tote Einheiten) fair. */
* zusätzlich looten auch geflohene, aber if (loot>0) {
* nach anderen Regeln. int maxrow = BEHIND_ROW;
*/ int lootchance = 50 + b->keeploot;
if (loot>0 && (itm->type->flags & (ITF_CURSED|ITF_NOTLOST)
|| rand()%100 >= 50 - corpse->side->battle->keeploot)) { if (itm->type->flags & (ITF_CURSED|ITF_NOTLOST)) maxrow = LAST_ROW;
fighter *fig = select_enemy(b, corpse, FIGHT_ROW, LAST_ROW).fighter; itm->number -= loot;
if (fig) {
item * l = fig->loot; if (maxrow == LAST_ROW || rand() % 100 < lootchance) {
while (l && l->type!=itm->type) l=l->next; fighter *fig = select_enemy(b, corpse, FIGHT_ROW, maxrow, false).fighter;
if (!l) { if (fig) {
l = calloc(sizeof(item), 1); item * l = fig->loot;
l->next = fig->loot; while (l && l->type!=itm->type) l=l->next;
fig->loot = l; if (!l) {
l->type = itm->type; l = calloc(sizeof(item), 1);
} l->next = fig->loot;
l->number += loot; fig->loot = l;
} l->type = itm->type;
} }
} l->number += loot;
} }
itm = itm->next; }
} }
}
}
itm = itm->next;
}
} }
#ifndef NO_RUNNING #ifndef NO_RUNNING

View File

@ -210,8 +210,8 @@ extern "C" {
/* for combar spells and special attacks */ /* for combar spells and special attacks */
extern int damage_unit(struct unit *u, const char *dam, boolean armor, boolean magic); extern int damage_unit(struct unit *u, const char *dam, boolean armor, boolean magic);
extern troop select_enemy(struct battle * b, struct fighter * af, int minrow, int maxrow); extern troop select_enemy(struct battle * b, struct fighter * af, int minrow, int maxrow, boolean advance);
extern int count_enemies(struct battle * b, struct side * as, int minrow, int maxrow); extern int count_enemies(struct battle * b, struct side * as, int minrow, int maxrow, boolean advance);
extern boolean terminate(troop dt, troop at, int type, const char *damage, boolean missile); extern boolean terminate(troop dt, troop at, int type, const char *damage, boolean missile);
extern void battlemsg(battle * b, struct unit * u, const char * s); extern void battlemsg(battle * b, struct unit * u, const char * s);
extern void battlerecord(battle * b, const char *s); extern void battlerecord(battle * b, const char *s);

View File

@ -141,7 +141,7 @@ sp_kampfzauber(fighter * fi, int level, double power, spell * sp)
sprintf(buf, "%s zaubert %s", unitname(fi->unit), sprintf(buf, "%s zaubert %s", unitname(fi->unit),
spell_name(sp, default_locale)); spell_name(sp, default_locale));
enemies = count_enemies(b, fi->side, minrow, maxrow); enemies = count_enemies(b, fi->side, minrow, maxrow, true);
if (enemies==0) { if (enemies==0) {
m = msg_message("battle::out_of_range", "mage spell", fi->unit, sp); m = msg_message("battle::out_of_range", "mage spell", fi->unit, sp);
message_all(b, m); message_all(b, m);
@ -150,7 +150,7 @@ sp_kampfzauber(fighter * fi, int level, double power, spell * sp)
} }
while (force>0 && killed < enemies) { while (force>0 && killed < enemies) {
dt = select_enemy(b, fi, minrow, maxrow); dt = select_enemy(b, fi, minrow, maxrow, true);
assert(dt.fighter); assert(dt.fighter);
--force; --force;
killed += terminate(dt, at, AT_COMBATSPELL, damage, false); killed += terminate(dt, at, AT_COMBATSPELL, damage, false);
@ -181,7 +181,7 @@ sp_versteinern(fighter * fi, int level, double power, spell * sp)
force = lovar(get_force(power, 0)); force = lovar(get_force(power, 0));
enemies = count_enemies(b, fi->side, minrow, maxrow); enemies = count_enemies(b, fi->side, minrow, maxrow, true);
if (!enemies) { if (!enemies) {
scat(", aber niemand war in Reichweite."); scat(", aber niemand war in Reichweite.");
battlerecord(b, buf); battlerecord(b, buf);
@ -191,7 +191,7 @@ sp_versteinern(fighter * fi, int level, double power, spell * sp)
battlerecord(b, buf); battlerecord(b, buf);
while (force && stoned < enemies) { while (force && stoned < enemies) {
troop dt = select_enemy(b, fi, minrow, maxrow); troop dt = select_enemy(b, fi, minrow, maxrow, true);
fighter * df = dt.fighter; fighter * df = dt.fighter;
unit * du = df->unit; unit * du = df->unit;
if (is_magic_resistant(mage, du, 0) == false) { if (is_magic_resistant(mage, du, 0) == false) {
@ -240,7 +240,7 @@ sp_stun(fighter * fi, int level, double power, spell * sp)
assert(0); assert(0);
} }
enemies = count_enemies(b, fi->side, minrow, maxrow); enemies = count_enemies(b, fi->side, minrow, maxrow, true);
if (!enemies) { if (!enemies) {
scat(", aber niemand war in Reichweite."); scat(", aber niemand war in Reichweite.");
battlerecord(b, buf); battlerecord(b, buf);
@ -251,7 +251,7 @@ sp_stun(fighter * fi, int level, double power, spell * sp)
stunned = 0; stunned = 0;
while (force && stunned < enemies) { while (force && stunned < enemies) {
troop dt = select_enemy(b, fi, minrow, maxrow); troop dt = select_enemy(b, fi, minrow, maxrow, true);
fighter * df = dt.fighter; fighter * df = dt.fighter;
unit * du = df->unit; unit * du = df->unit;
@ -296,7 +296,7 @@ sp_combatrosthauch(fighter * fi, int level, double power, spell * sp)
force = lovar(power * 15); force = lovar(power * 15);
enemies = count_enemies(b, fi->side, minrow, maxrow); enemies = count_enemies(b, fi->side, minrow, maxrow, true);
if (!enemies) { if (!enemies) {
battlemsg(b, fi->unit, msgt[0]); battlemsg(b, fi->unit, msgt[0]);
return 0; return 0;
@ -383,7 +383,7 @@ sp_sleep(fighter * fi, int level, double power, spell * sp)
sprintf(buf, "%s zaubert %s", unitname(mage), sprintf(buf, "%s zaubert %s", unitname(mage),
spell_name(sp, default_locale)); spell_name(sp, default_locale));
force = lovar(power * 25); force = lovar(power * 25);
enemies = count_enemies(b, fi->side, minrow, maxrow); enemies = count_enemies(b, fi->side, minrow, maxrow, true);
if (!enemies) { if (!enemies) {
scat(", aber niemand war in Reichweite."); scat(", aber niemand war in Reichweite.");
@ -394,7 +394,7 @@ sp_sleep(fighter * fi, int level, double power, spell * sp)
battlerecord(b, buf); battlerecord(b, buf);
while (force && enemies) { while (force && enemies) {
dt = select_enemy(b, fi, minrow, maxrow); dt = select_enemy(b, fi, minrow, maxrow, true);
assert(dt.fighter); assert(dt.fighter);
du = dt.fighter->unit; du = dt.fighter->unit;
if (is_magic_resistant(mage, du, 0) == false) { if (is_magic_resistant(mage, du, 0) == false) {
@ -530,7 +530,7 @@ sp_mindblast(fighter * fi, int level, double power, spell * sp)
spell_name(sp, default_locale)); spell_name(sp, default_locale));
force = lovar(power * 25); force = lovar(power * 25);
enemies = count_enemies(b, fi->side, minrow, maxrow); enemies = count_enemies(b, fi->side, minrow, maxrow, true);
if (!enemies) { if (!enemies) {
scat(", aber niemand war in Reichweite."); scat(", aber niemand war in Reichweite.");
battlerecord(b, buf); battlerecord(b, buf);
@ -540,7 +540,7 @@ sp_mindblast(fighter * fi, int level, double power, spell * sp)
battlerecord(b, buf); battlerecord(b, buf);
while (force && enemies) { while (force && enemies) {
dt = select_enemy(b, fi, minrow, maxrow); dt = select_enemy(b, fi, minrow, maxrow, true);
assert(dt.fighter); assert(dt.fighter);
du = dt.fighter->unit; du = dt.fighter->unit;
if (humanoidrace(du->race) && !is_magic_resistant(mage, du, 0)) { if (humanoidrace(du->race) && !is_magic_resistant(mage, du, 0)) {
@ -600,7 +600,7 @@ sp_dragonodem(fighter * fi, int level, double power, spell * sp)
/* Jungdrache 3->54, Drache 6->216, Wyrm 12->864 Treffer */ /* Jungdrache 3->54, Drache 6->216, Wyrm 12->864 Treffer */
force = lovar(get_force(level,6)); force = lovar(get_force(level,6));
enemies = count_enemies(b, fi->side, minrow, maxrow); enemies = count_enemies(b, fi->side, minrow, maxrow, true);
if (!enemies) { if (!enemies) {
scat(", aber niemand war in Reichweite."); scat(", aber niemand war in Reichweite.");
@ -614,7 +614,7 @@ sp_dragonodem(fighter * fi, int level, double power, spell * sp)
at.index = 0; at.index = 0;
while (force && killed < enemies) { while (force && killed < enemies) {
dt = select_enemy(b, fi, minrow, maxrow); dt = select_enemy(b, fi, minrow, maxrow, true);
assert(dt.fighter); assert(dt.fighter);
--force; --force;
killed += terminate(dt, at, AT_COMBATSPELL, damage, false); killed += terminate(dt, at, AT_COMBATSPELL, damage, false);
@ -649,7 +649,7 @@ sp_immolation(fighter * fi, int level, double power, spell * sp)
/* Betrifft alle Gegner */ /* Betrifft alle Gegner */
force = 99999; force = 99999;
enemies = count_enemies(b, fi->side, minrow, maxrow); enemies = count_enemies(b, fi->side, minrow, maxrow, true);
if (!enemies) { if (!enemies) {
scat(", aber niemand war in Reichweite."); scat(", aber niemand war in Reichweite.");
@ -663,7 +663,7 @@ sp_immolation(fighter * fi, int level, double power, spell * sp)
at.index = 0; at.index = 0;
while (force && killed < enemies) { while (force && killed < enemies) {
dt = select_enemy(b, fi, minrow, maxrow); dt = select_enemy(b, fi, minrow, maxrow, true);
assert(dt.fighter); assert(dt.fighter);
--force; --force;
killed += terminate(dt, at, AT_COMBATSPELL, damage, false); killed += terminate(dt, at, AT_COMBATSPELL, damage, false);
@ -698,7 +698,7 @@ sp_drainodem(fighter * fi, int level, double power, spell * sp)
/* Jungdrache 3->54, Drache 6->216, Wyrm 12->864 Treffer */ /* Jungdrache 3->54, Drache 6->216, Wyrm 12->864 Treffer */
force = lovar(get_force(level,6)); force = lovar(get_force(level,6));
enemies = count_enemies(b, fi->side, minrow, maxrow); enemies = count_enemies(b, fi->side, minrow, maxrow, true);
if (!enemies) { if (!enemies) {
scat(", aber niemand war in Reichweite."); scat(", aber niemand war in Reichweite.");
@ -712,7 +712,7 @@ sp_drainodem(fighter * fi, int level, double power, spell * sp)
at.index = 0; at.index = 0;
while (force && drained < enemies) { while (force && drained < enemies) {
dt = select_enemy(b, fi, minrow, maxrow); dt = select_enemy(b, fi, minrow, maxrow, true);
assert(dt.fighter); assert(dt.fighter);
if (hits(at, dt, NULL)) { if (hits(at, dt, NULL)) {
drain_exp(dt.fighter->unit, 90); drain_exp(dt.fighter->unit, 90);
@ -906,7 +906,7 @@ sp_chaosrow(fighter * fi, int level, double power, spell * sp)
break; break;
} }
enemies = count_enemies(b, fi->side, minrow, maxrow); enemies = count_enemies(b, fi->side, minrow, maxrow, true);
if (!enemies) { if (!enemies) {
scat(", aber niemand war in Reichweite."); scat(", aber niemand war in Reichweite.");
battlerecord(b, buf); battlerecord(b, buf);
@ -1004,7 +1004,7 @@ sp_flee(fighter * fi, int level, double power, spell * sp)
force = (int)get_force(power,10); force = (int)get_force(power,10);
} }
if (!count_enemies(b, fi->side, minrow, maxrow)) { if (!count_enemies(b, fi->side, minrow, maxrow, true)) {
scat(", aber es gab niemanden mehr, der beeinflusst werden konnte."); scat(", aber es gab niemanden mehr, der beeinflusst werden konnte.");
battlerecord(b, buf); battlerecord(b, buf);
return 0; return 0;
@ -1183,7 +1183,7 @@ sp_frighten(fighter * fi, int level, double power, spell * sp)
sprintf(buf, "%s zaubert %s", unitname(mage), sprintf(buf, "%s zaubert %s", unitname(mage),
spell_name(sp, default_locale)); spell_name(sp, default_locale));
enemies = count_enemies(b, fi->side, minrow, maxrow); enemies = count_enemies(b, fi->side, minrow, maxrow, true);
if (!enemies) { if (!enemies) {
scat(", aber niemand war in Reichweite."); scat(", aber niemand war in Reichweite.");
battlerecord(b, buf); battlerecord(b, buf);
@ -1193,7 +1193,7 @@ sp_frighten(fighter * fi, int level, double power, spell * sp)
battlerecord(b, buf); battlerecord(b, buf);
while (force && enemies) { while (force && enemies) {
troop dt = select_enemy(b, fi, minrow, maxrow); troop dt = select_enemy(b, fi, minrow, maxrow, true);
fighter *df = dt.fighter; fighter *df = dt.fighter;
--enemies; --enemies;
@ -1232,14 +1232,14 @@ sp_tiredsoldiers(fighter * fi, int level, double power, spell * sp)
sprintf(buf, "%s zaubert %s", unitname(mage), sprintf(buf, "%s zaubert %s", unitname(mage),
spell_name(sp, default_locale)); spell_name(sp, default_locale));
if (!count_enemies(b, fi->side, FIGHT_ROW, BEHIND_ROW)) { if (!count_enemies(b, fi->side, FIGHT_ROW, BEHIND_ROW, true)) {
scat(", aber niemand war in Reichweite."); scat(", aber niemand war in Reichweite.");
battlerecord(b, buf); battlerecord(b, buf);
return 0; return 0;
} }
while (force) { while (force) {
troop t = select_enemy(b, fi, FIGHT_ROW, BEHIND_ROW); troop t = select_enemy(b, fi, FIGHT_ROW, BEHIND_ROW, true);
fighter *df = t.fighter; fighter *df = t.fighter;
if (!df) if (!df)
@ -1292,7 +1292,7 @@ sp_windshield(fighter * fi, int level, double power, spell * sp)
force = (int)power; force = (int)power;
at_malus = 2; at_malus = 2;
} }
enemies = count_enemies(b, fi->side, minrow, maxrow); enemies = count_enemies(b, fi->side, minrow, maxrow, true);
if (!enemies) { if (!enemies) {
scat(", aber niemand war in Reichweite."); scat(", aber niemand war in Reichweite.");
battlerecord(b, buf); battlerecord(b, buf);
@ -1300,7 +1300,7 @@ sp_windshield(fighter * fi, int level, double power, spell * sp)
} }
while (force && enemies) { while (force && enemies) {
troop dt = select_enemy(b, fi, minrow, maxrow); troop dt = select_enemy(b, fi, minrow, maxrow, true);
fighter *df = dt.fighter; fighter *df = dt.fighter;
--enemies; --enemies;

View File

@ -73,10 +73,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "eressea-lua", "eressea\eres
{4C837BEC-A428-4287-84B3-8F8F9DE7FA00} = {4C837BEC-A428-4287-84B3-8F8F9DE7FA00} {4C837BEC-A428-4287-84B3-8F8F9DE7FA00} = {4C837BEC-A428-4287-84B3-8F8F9DE7FA00}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxmapper", "wxmapper\wxmapper.vcproj", "{552164AD-D42D-4088-A59E-CB5CF77BA528}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Global Global
GlobalSection(SolutionConfiguration) = preSolution GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug Debug = Debug
@ -129,10 +125,6 @@ Global
{749A2F7C-B9C3-4CEB-B1B2-1D4587E68719}.Debug.Build.0 = Debug|Win32 {749A2F7C-B9C3-4CEB-B1B2-1D4587E68719}.Debug.Build.0 = Debug|Win32
{749A2F7C-B9C3-4CEB-B1B2-1D4587E68719}.Release.ActiveCfg = Release|Win32 {749A2F7C-B9C3-4CEB-B1B2-1D4587E68719}.Release.ActiveCfg = Release|Win32
{749A2F7C-B9C3-4CEB-B1B2-1D4587E68719}.Release.Build.0 = Release|Win32 {749A2F7C-B9C3-4CEB-B1B2-1D4587E68719}.Release.Build.0 = Release|Win32
{552164AD-D42D-4088-A59E-CB5CF77BA528}.Debug.ActiveCfg = Debug|Win32
{552164AD-D42D-4088-A59E-CB5CF77BA528}.Debug.Build.0 = Debug|Win32
{552164AD-D42D-4088-A59E-CB5CF77BA528}.Release.ActiveCfg = Release|Win32
{552164AD-D42D-4088-A59E-CB5CF77BA528}.Release.Build.0 = Release|Win32
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection EndGlobalSection

View File

@ -11,8 +11,10 @@
// lua includes // lua includes
#include <lua.hpp> #include <lua.hpp>
#include <luabind/luabind.hpp> #include <luabind/luabind.hpp>
#include <luabind/operator.hpp>
#include <luabind/iterator_policy.hpp> #include <luabind/iterator_policy.hpp>
#ifdef HAVE_LUABIND_B7
# include <luabind/operator.hpp>
#endif
// util includes // util includes
#include <util/base36.h> #include <util/base36.h>

View File

@ -18,8 +18,10 @@
// lua includes // lua includes
#include <lua.hpp> #include <lua.hpp>
#include <luabind/luabind.hpp> #include <luabind/luabind.hpp>
#include <luabind/operator.hpp>
#include <luabind/iterator_policy.hpp> #include <luabind/iterator_policy.hpp>
#ifdef HAVE_LUABIND_B7
# include <luabind/operator.hpp>
#endif
#include <ostream> #include <ostream>
using namespace luabind; using namespace luabind;

View File

@ -12,8 +12,10 @@
// lua includes // lua includes
#include <lua.hpp> #include <lua.hpp>
#include <luabind/luabind.hpp> #include <luabind/luabind.hpp>
#include <luabind/operator.hpp>
#include <luabind/iterator_policy.hpp> #include <luabind/iterator_policy.hpp>
#ifdef HAVE_LUABIND_B7
# include <luabind/operator.hpp>
#endif
#include <ostream> #include <ostream>
using namespace luabind; using namespace luabind;

View File

@ -28,8 +28,10 @@
// lua includes // lua includes
#include <lua.hpp> #include <lua.hpp>
#include <luabind/luabind.hpp> #include <luabind/luabind.hpp>
#include <luabind/operator.hpp>
#include <luabind/iterator_policy.hpp> #include <luabind/iterator_policy.hpp>
#ifdef HAVE_LUABIND_B7
# include <luabind/operator.hpp>
#endif
#include <ostream> #include <ostream>
#include <string> #include <string>