forked from github/server
Falsche Zählung der Toten.
This commit is contained in:
parent
f042c6fef9
commit
f896b56031
|
@ -2295,7 +2295,7 @@ aftermath(battle * b)
|
||||||
for (fi = fighters->begin; fi != fighters->end; ++fi) {
|
for (fi = fighters->begin; fi != fighters->end; ++fi) {
|
||||||
fighter *df = *fi;
|
fighter *df = *fi;
|
||||||
unit *du = df->unit;
|
unit *du = df->unit;
|
||||||
int dead;
|
int dead = du->number - df->alive - df->run.number;
|
||||||
const attrib *a;
|
const attrib *a;
|
||||||
int pr_mercy = 0;
|
int pr_mercy = 0;
|
||||||
|
|
||||||
|
@ -2305,38 +2305,41 @@ aftermath(battle * b)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dead = du->number - df->alive;
|
|
||||||
dead -= df->run.number;
|
|
||||||
#ifdef TROLLSAVE
|
#ifdef TROLLSAVE
|
||||||
/* Trolle können regenerieren */
|
/* Trolle können regenerieren */
|
||||||
if (df->alive > 0 && dead && old_race(du->race) == RC_TROLL)
|
if (df->alive > 0 && dead && old_race(du->race) == RC_TROLL) {
|
||||||
for (i = 0; i != dead; ++i) {
|
for (i = 0; i != dead; ++i) {
|
||||||
if (chance(TROLL_REGENERATION)) {
|
if (chance(TROLL_REGENERATION)) {
|
||||||
++df->alive;
|
++df->alive;
|
||||||
++df->side->alive;
|
++df->side->alive;
|
||||||
++df->side->battle->alive;
|
++df->side->battle->alive;
|
||||||
|
++trollsave[df->side->index];
|
||||||
|
--dead;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
trollsave[df->side->index] += dead - du->number + df->alive;
|
}
|
||||||
#endif
|
#endif
|
||||||
/* Regeneration durch PR_MERCY */
|
/* Regeneration durch PR_MERCY */
|
||||||
if (dead && pr_mercy)
|
if (dead>0 && pr_mercy) {
|
||||||
for (i = 0; i != dead; ++i)
|
for (i = 0; i != dead; ++i) {
|
||||||
if (rand()%100 < pr_mercy) {
|
if (rand()%100 < pr_mercy) {
|
||||||
++df->alive;
|
++df->alive;
|
||||||
++df->side->alive;
|
++df->side->alive;
|
||||||
++df->side->battle->alive;
|
++df->side->battle->alive;
|
||||||
}
|
--dead;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Tote, die wiederbelebt werde können */
|
/* Tote, die wiederbelebt werde können */
|
||||||
if (playerrace(df->unit->race)) {
|
if (playerrace(df->unit->race)) {
|
||||||
df->side->casualties += dead;
|
df->side->casualties += dead;
|
||||||
}
|
}
|
||||||
#ifdef SHOW_KILLS
|
#ifdef SHOW_KILLS
|
||||||
if (df->hits + df->kills) {
|
if (df->hits + df->kills) {
|
||||||
struct message * m = new_message(du->faction, "killsandhits%u:unit%i:hits%i:kills", du, df->hits, df->kills);
|
struct message * m = new_message(du->faction, "killsandhits%u:unit%i:hits%i:kills", du, df->hits, df->kills);
|
||||||
message_faction(b, du->faction, m);
|
message_faction(b, du->faction, m);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2376,7 +2379,7 @@ aftermath(battle * b)
|
||||||
int dead = du->number - df->alive - df->run.number;
|
int dead = du->number - df->alive - df->run.number;
|
||||||
int sum_hp = 0;
|
int sum_hp = 0;
|
||||||
int n;
|
int n;
|
||||||
snumber +=du->number;
|
snumber += du->number;
|
||||||
if (relevant && df->action_counter >= du->number) {
|
if (relevant && df->action_counter >= du->number) {
|
||||||
ship * sh = du->ship?du->ship:leftship(du);
|
ship * sh = du->ship?du->ship:leftship(du);
|
||||||
|
|
||||||
|
|
|
@ -1705,100 +1705,101 @@ sp_healing(fighter * fi, int level, double power, spell * sp)
|
||||||
int
|
int
|
||||||
sp_undeadhero(fighter * fi, int level, double power, spell * sp)
|
sp_undeadhero(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;
|
||||||
region *r = b->region;
|
region *r = b->region;
|
||||||
int minrow = FIGHT_ROW;
|
int minrow = FIGHT_ROW;
|
||||||
int maxrow = AVOID_ROW;
|
int maxrow = AVOID_ROW;
|
||||||
cvector *fgs;
|
cvector *fgs;
|
||||||
void **fig;
|
void **fig;
|
||||||
int n, j, undead = 0;
|
int n, j, undead = 0;
|
||||||
int k = (int)get_force(power,0);
|
int k = (int)get_force(power,0);
|
||||||
double c = 0.50 + 0.02 * power;
|
double c = 0.50 + 0.02 * power;
|
||||||
|
|
||||||
/* Liste aus allen Kämpfern */
|
/* Liste aus allen Kämpfern */
|
||||||
fgs = fighters(b, fi, minrow, maxrow, FS_ENEMY | FS_HELP );
|
fgs = fighters(b, fi, minrow, maxrow, FS_ENEMY | FS_HELP );
|
||||||
v_scramble(fgs->begin, fgs->end);
|
v_scramble(fgs->begin, fgs->end);
|
||||||
|
|
||||||
for (fig = fgs->begin; fig != fgs->end; ++fig) {
|
for (fig = fgs->begin; fig != fgs->end; ++fig) {
|
||||||
fighter *df = *fig;
|
fighter *df = *fig;
|
||||||
unit *du = df->unit;
|
unit *du = df->unit;
|
||||||
|
|
||||||
if (!k)
|
if (!k)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* keine Monster */
|
/* keine Monster */
|
||||||
if (!playerrace(du->race))
|
if (!playerrace(du->race))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (df->alive + df->run.number < du->number) {
|
if (df->alive + df->run.number < du->number) {
|
||||||
j = 0;
|
j = 0;
|
||||||
|
|
||||||
/* Wieviele Untote können wir aus dieser Einheit wecken? */
|
/* Wieviele Untote können wir aus dieser Einheit wecken? */
|
||||||
for (n = df->alive + df->run.number; n <= du->number; n++) {
|
for (n = df->alive + df->run.number; n <= du->number; n++) {
|
||||||
if (!k) break;
|
if (!k) break;
|
||||||
|
|
||||||
if (chance(c)) {
|
if (chance(c)) {
|
||||||
undead++;
|
undead++;
|
||||||
j++;
|
j++;
|
||||||
--df->side->casualties;
|
--df->side->casualties;
|
||||||
--k;
|
++df->side->alive;
|
||||||
}
|
--k;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (j > 0) {
|
if (j > 0) {
|
||||||
int hp = unit_max_hp(du);
|
int hp = unit_max_hp(du);
|
||||||
if (j == du->number) {
|
if (j == du->number) {
|
||||||
/* Einheit war vollständig tot und konnte vollständig zu
|
/* Einheit war vollständig tot und konnte vollständig zu
|
||||||
* Untoten gemacht werden */
|
* Untoten gemacht werden */
|
||||||
int nr;
|
int nr;
|
||||||
|
|
||||||
du->race = new_race[RC_UNDEAD];
|
du->race = new_race[RC_UNDEAD];
|
||||||
setguard(du, GUARD_NONE);
|
setguard(du, GUARD_NONE);
|
||||||
u_setfaction(du,mage->faction);
|
u_setfaction(du,mage->faction);
|
||||||
if (fval(mage, UFL_PARTEITARNUNG))
|
if (fval(mage, UFL_PARTEITARNUNG))
|
||||||
fset(du, UFL_PARTEITARNUNG);
|
fset(du, UFL_PARTEITARNUNG);
|
||||||
df->alive = du->number;
|
df->alive = du->number;
|
||||||
/* den Toten wieder volle Hitpoints geben */
|
/* den Toten wieder volle Hitpoints geben */
|
||||||
for (nr = 0; nr != df->alive; ++nr) {
|
for (nr = 0; nr != df->alive; ++nr) {
|
||||||
df->person[nr].hp = hp;
|
df->person[nr].hp = hp;
|
||||||
}
|
}
|
||||||
/* vereinfachtes loot */
|
/* vereinfachtes loot */
|
||||||
change_money(mage, get_money(du));
|
change_money(mage, get_money(du));
|
||||||
set_money(du, 0);
|
set_money(du, 0);
|
||||||
} else {
|
} else {
|
||||||
unit *u;
|
unit *u;
|
||||||
u = createunit(r, mage->faction, 0, new_race[RC_UNDEAD]);
|
u = createunit(r, mage->faction, 0, new_race[RC_UNDEAD]);
|
||||||
transfermen(du, u, j);
|
transfermen(du, u, j);
|
||||||
sprintf(buf, "%s", du->name);
|
sprintf(buf, "%s", du->name);
|
||||||
set_string(&u->name, buf);
|
set_string(&u->name, buf);
|
||||||
sprintf(buf, "%s", du->display);
|
sprintf(buf, "%s", du->display);
|
||||||
set_string(&u->display, buf);
|
set_string(&u->display, buf);
|
||||||
u->status = du->status;
|
u->status = du->status;
|
||||||
setguard(u, GUARD_NONE);
|
setguard(u, GUARD_NONE);
|
||||||
if (fval(mage, UFL_PARTEITARNUNG))
|
if (fval(mage, UFL_PARTEITARNUNG))
|
||||||
fset(u, UFL_PARTEITARNUNG);
|
fset(u, UFL_PARTEITARNUNG);
|
||||||
set_string(&u->lastorder, du->lastorder);
|
set_string(&u->lastorder, du->lastorder);
|
||||||
/* den Toten volle Hitpoints geben */
|
/* den Toten volle Hitpoints geben */
|
||||||
u->hp = u->number * unit_max_hp(u);
|
u->hp = u->number * unit_max_hp(u);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cv_kill(fgs);
|
cv_kill(fgs);
|
||||||
|
|
||||||
if (undead == 0) {
|
if (undead == 0) {
|
||||||
sprintf(buf, "%s kann keinen Untoten rufen.", unitname(mage));
|
sprintf(buf, "%s kann keinen Untoten rufen.", unitname(mage));
|
||||||
level = 0;
|
level = 0;
|
||||||
} else if (undead == 1) {
|
} else if (undead == 1) {
|
||||||
sprintf(buf, "%s erweckt einen Untoten.", unitname(mage));
|
sprintf(buf, "%s erweckt einen Untoten.", unitname(mage));
|
||||||
level = 1;
|
level = 1;
|
||||||
} else {
|
} else {
|
||||||
sprintf(buf, "%s erweckt %d Untote.", unitname(mage), undead);
|
sprintf(buf, "%s erweckt %d Untote.", unitname(mage), undead);
|
||||||
}
|
}
|
||||||
|
|
||||||
battlerecord(b, buf);
|
battlerecord(b, buf);
|
||||||
return level;
|
return level;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue