sp_immolation trifft jeden Gegner nur einmal

This commit is contained in:
Enno Rehling 2005-02-13 12:22:53 +00:00
parent 924b1d588a
commit 6e739e2cd7
1 changed files with 16 additions and 6 deletions

View File

@ -634,13 +634,14 @@ int
sp_immolation(fighter * fi, int level, double power, spell * sp) sp_immolation(fighter * fi, int level, double power, spell * sp)
{ {
battle *b = fi->side->battle; battle *b = fi->side->battle;
troop dt;
troop at; troop at;
int minrow = FIGHT_ROW; int minrow = FIGHT_ROW;
int maxrow = AVOID_ROW; int maxrow = AVOID_ROW;
int force, enemies; int force, enemies;
int killed = 0; int killed = 0;
const char *damage; const char *damage;
cvector *fgs;
void **fig;
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));
@ -662,12 +663,21 @@ sp_immolation(fighter * fi, int level, double power, spell * sp)
at.fighter = fi; at.fighter = fi;
at.index = 0; at.index = 0;
while (force && killed < enemies) { fgs = fighters(b, fi, minrow, maxrow, FS_ENEMY);
dt = select_enemy(b, fi, minrow, maxrow, true); for (fig = fgs->begin; fig != fgs->end; ++fig) {
assert(dt.fighter); fighter *df = *fig;
--force; int n = df->alive-df->removed;
killed += terminate(dt, at, AT_COMBATSPELL, damage, false); troop dt;
dt.fighter = df;
while (n!=0) {
dt.index = --n;
killed += terminate(dt, at, AT_COMBATSPELL, damage, false);
if (--force==0) break;
}
if (force==0) break;
} }
cv_kill(fgs);
sprintf(buf, "%d Personen %s getötet", sprintf(buf, "%d Personen %s getötet",
killed, killed == 1 ? "wurde" : "wurden"); killed, killed == 1 ? "wurde" : "wurden");