forked from github/server
1. Wer auf KÄMPFE FLIEHE steht, rennt immer davon. 2. Jede andere Person die noch nicht getroffen worden ist, bleibt in der Kampfregion stehen. Als Treffer gilt jeder Angriff, auch wenn der Schlag in der Rüstung hängen blieb o.ä. Ausserdem: Monster dürfen Fremdrassen rekrutieren. Wird z.Z. jedoch nicht genutzt, ausser von Testskripten.
This commit is contained in:
parent
ff472696b2
commit
d1a300d7aa
|
@ -293,13 +293,31 @@ recruit(unit * u, struct order * ord, request ** recruitorders)
|
|||
plane * pl;
|
||||
request *o;
|
||||
int recruitcost;
|
||||
const struct race * rc = u->faction->race;
|
||||
const faction * f = u->faction;
|
||||
const struct race * rc = f->race;
|
||||
|
||||
init_tokens(ord);
|
||||
skip_token();
|
||||
n = geti();
|
||||
if (f->no==MONSTER_FACTION) {
|
||||
/* Monster dürfen REKRUTIERE 15 dracoid machen */
|
||||
const char * str = getstrtoken();
|
||||
if (str!=NULL && *str) {
|
||||
for (rc = races;rc;rc=rc->next) {
|
||||
if (strncasecmp(LOC(f->locale, rc->_name[0]), str, strlen(str))==0)
|
||||
break;
|
||||
if (strncasecmp(LOC(f->locale, rc->_name[1]), str, strlen(str))==0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (rc==NULL) rc = f->race;
|
||||
}
|
||||
|
||||
#if GUARD_DISABLES_RECRUIT == 1
|
||||
/* this is a very special case because the recruiting unit may be empty
|
||||
* at this point and we have to look at the creating unit instead. This
|
||||
* is done in cansee, which is called indirectly by is_guarded(). */
|
||||
if(is_guarded(r, u, GUARD_RECRUIT)) {
|
||||
if (is_guarded(r, u, GUARD_RECRUIT)) {
|
||||
cmistake(u, ord, 70, MSG_EVENT);
|
||||
return;
|
||||
}
|
||||
|
@ -375,10 +393,6 @@ recruit(unit * u, struct order * ord, request ** recruitorders)
|
|||
else u->race = rc;
|
||||
}
|
||||
|
||||
init_tokens(ord);
|
||||
skip_token();
|
||||
n = geti();
|
||||
|
||||
if (has_skill(u, SK_MAGIC)) {
|
||||
/* error158;de;{unit} in {region}: '{command}' - Magier arbeiten
|
||||
* grundsätzlich nur alleine! */
|
||||
|
|
|
@ -1812,6 +1812,10 @@ hits(troop at, troop dt, weapon * awp)
|
|||
if (!df->alive) return 0;
|
||||
if (getreload(at)) return 0;
|
||||
if (dist>1 && (awp == NULL || !fval(awp->type, WTF_MISSILE))) return 0;
|
||||
|
||||
/* mark this person as hit. */
|
||||
af->person[dt.index].flags |= FL_HIT;
|
||||
|
||||
if (af->person[at.index].flags & FL_STUNNED) {
|
||||
af->person[at.index].flags &= ~FL_STUNNED;
|
||||
return 0;
|
||||
|
@ -3791,6 +3795,7 @@ do_battle(void)
|
|||
int runhp = min(600,(int)(0.9+unit_max_hp(u)*hpflee(u->status)));
|
||||
side *side = fig->side;
|
||||
if (fval(u->race, RCF_UNDEAD) || old_race(u->race) == RC_SHADOWKNIGHT) continue;
|
||||
|
||||
if (u->ship) continue;
|
||||
dt.fighter = fig;
|
||||
#ifndef NO_RUNNING
|
||||
|
@ -3799,6 +3804,7 @@ do_battle(void)
|
|||
#endif
|
||||
dt.index = fig->alive - fig->removed;
|
||||
while (side->size[SUM_ROW] && dt.index != 0) {
|
||||
double ispaniced = 0.0;
|
||||
--dt.index;
|
||||
assert(dt.index>=0 && dt.index<fig->unit->number);
|
||||
assert(fig->person[dt.index].hp > 0);
|
||||
|
@ -3809,12 +3815,20 @@ do_battle(void)
|
|||
* - in panik (Zauber)
|
||||
* aber nicht, wenn der Zaubereffekt Held auf dir liegt!
|
||||
*/
|
||||
if ((u->status == ST_FLEE
|
||||
|| (b->turn>1 && fig->person[dt.index].hp <= runhp)
|
||||
|| (fig->person[dt.index].flags & FL_PANICED))
|
||||
&& !(fig->person[dt.index].flags & FL_COURAGE))
|
||||
{
|
||||
double ispaniced = 0.0;
|
||||
switch (u->status) {
|
||||
case ST_FLEE:
|
||||
run = true;
|
||||
break;
|
||||
default:
|
||||
if ((fig->person[dt.index].flags & FL_HIT) == 0) continue;
|
||||
if (b->turn<=1) continue;
|
||||
if (fig->person[dt.index].hp <= runhp) break;
|
||||
if (fig->person[dt.index].flags & FL_PANICED) {
|
||||
if ((fig->person[dt.index].flags & FL_COURAGE)==0) break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (fig->person[dt.index].flags & FL_PANICED) {
|
||||
ispaniced = EFFECT_PANIC_SPELL;
|
||||
}
|
||||
|
@ -3834,7 +3848,6 @@ do_battle(void)
|
|||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
if(runners > 0) {
|
||||
sprintf(lbuf, "Flucht: %d aus %s", runners, itoa36(fig->unit->no));
|
||||
battledebug(lbuf);
|
||||
|
|
|
@ -113,6 +113,7 @@ extern "C" {
|
|||
#define FL_COURAGE 8 /* Helden fliehen nie */
|
||||
#define FL_SLEEPING 16
|
||||
#define FL_STUNNED 32 /* eine Runde keinen Angriff */
|
||||
#define FL_HIT 64 /* the person at attacked */
|
||||
|
||||
/*** fighter::flags ***/
|
||||
#define FIG_ATTACKED 1
|
||||
|
|
|
@ -14,11 +14,11 @@ SOURCES =
|
|||
infocmd.c
|
||||
museum.c
|
||||
score.c
|
||||
victoryconditions.c
|
||||
weather.c
|
||||
wormhole.c
|
||||
xecmd.c
|
||||
xmas.c
|
||||
;
|
||||
|
||||
|
||||
Library modules : $(SOURCES) ;
|
||||
|
|
Loading…
Reference in New Issue