- sp_mindblast hatte auf Einheiten ohne Talente unproportionierte Auswirkungen (tausende von Toten)
This commit is contained in:
Enno Rehling 2004-05-22 16:26:03 +00:00
parent 75ea8e150b
commit 4f14c6fbfb
1 changed files with 57 additions and 72 deletions

View File

@ -514,84 +514,69 @@ random_skill(unit *u)
int int
sp_mindblast(fighter * fi, int level, double power, spell * sp) sp_mindblast(fighter * fi, int level, double power, spell * sp)
{ {
battle *b = fi->side->battle; battle *b = fi->side->battle;
unit *mage = fi->unit; unit *mage = fi->unit;
troop dt; troop dt;
unit *du; unit *du;
skill_t sk; skill_t sk;
int killed = 0; int killed = 0;
int force, enemies; int force, enemies;
int k = 0; int k = 0;
int minrow = FIGHT_ROW; int minrow = FIGHT_ROW;
int maxrow = BEHIND_ROW; int maxrow = BEHIND_ROW;
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);
if (!enemies) { if (!enemies) {
scat(", aber niemand war in Reichweite."); scat(", aber niemand war in Reichweite.");
battlerecord(b, buf); battlerecord(b, buf);
return 0; return 0;
} }
scat(":"); scat(":");
battlerecord(b, buf); battlerecord(b, buf);
do { do {
dt = select_enemy(b, fi, minrow, maxrow); dt = select_enemy(b, fi, minrow, maxrow);
assert(dt.fighter); assert(dt.fighter);
du = dt.fighter->unit; du = dt.fighter->unit;
if (humanoidrace(du->race) && is_magic_resistant(mage, du, 0) == false) { if (humanoidrace(du->race) && !is_magic_resistant(mage, du, 0)) {
sk = random_skill(du); sk = random_skill(du);
if (sk != NOSKILL) { if (sk != NOSKILL) {
/* Skill abziehen */ skill * sv = get_skill(du, sk);
int n = 30+rand()%61; int n = 1 + rand() % 3;
skill * sv = get_skill(du, sk); /* Skill abziehen */
while (n>0) { reduce_skill(du, sv, n);
if (n>=30*du->number) { } else {
reduce_skill(du, sv, 1); /* Keine Skills mehr, Einheit töten */
n-=30; rmtroop(dt);
} else { ++killed;
if (rand()%(30*du->number)<n) reduce_skill(du, sv, 1); }
n = 0; --enemies;
} ++k;
} }
--enemies; --force;
} else { } while (force && enemies);
troop t;
/* Keine Skills mehr, Einheit töten */
t.fighter = dt.fighter;
t.index = 0;
while(dt.fighter->alive - dt.fighter->removed) {
rmtroop(t);
enemies--;
killed++;
}
}
k++;
}
--force;
} while (force && enemies);
sprintf(buf, "%d Krieger %s Erinnerungen", sprintf(buf, "%d Krieger %s Erinnerungen", k, k == 1 ? "verliert" : "verlieren");
k, k == 1 ? "verliert" : "verlieren");
if (killed > 0) { if (killed > 0) {
scat(", "); scat(", ");
icat(killed); icat(killed);
scat(" Krieger "); scat(" Krieger ");
if (killed == 1) { if (killed == 1) {
scat("wurde"); scat("wurde");
} else { } else {
scat("wurden"); scat("wurden");
} }
scat(" getötet"); scat(" getötet");
} }
scat("."); scat(".");
battlerecord(b, buf); battlerecord(b, buf);
return level; return level;
} }
int int