diff --git a/src/common/gamecode/economy.c b/src/common/gamecode/economy.c index 5218d2f53..4faf3f15a 100644 --- a/src/common/gamecode/economy.c +++ b/src/common/gamecode/economy.c @@ -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! */ diff --git a/src/common/kernel/battle.c b/src/common/kernel/battle.c index 3db6901e8..ff96764a2 100644 --- a/src/common/kernel/battle.c +++ b/src/common/kernel/battle.c @@ -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.indexunit->number); assert(fig->person[dt.index].hp > 0); @@ -3809,30 +3815,37 @@ 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; - if (fig->person[dt.index].flags & FL_PANICED) { - ispaniced = EFFECT_PANIC_SPELL; - } - if (chance(min(fleechance(u)+ispaniced, 0.90))) { - ++runners; - flee(dt); -#ifdef SMALL_BATTLE_MESSAGES - if (b->small) { - sprintf(smallbuf, "%s/%d gelingt es, vom Schlachtfeld zu entkommen.", - unitname(fig->unit), dt.index); - battlerecord(b, smallbuf); + 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; } - } else if (b->small) { - sprintf(smallbuf, "%s/%d versucht zu fliehen, wird jedoch aufgehalten.", + continue; + } + + if (fig->person[dt.index].flags & FL_PANICED) { + ispaniced = EFFECT_PANIC_SPELL; + } + if (chance(min(fleechance(u)+ispaniced, 0.90))) { + ++runners; + flee(dt); +#ifdef SMALL_BATTLE_MESSAGES + if (b->small) { + sprintf(smallbuf, "%s/%d gelingt es, vom Schlachtfeld zu entkommen.", unitname(fig->unit), dt.index); battlerecord(b, smallbuf); -#endif } + } else if (b->small) { + sprintf(smallbuf, "%s/%d versucht zu fliehen, wird jedoch aufgehalten.", + unitname(fig->unit), dt.index); + battlerecord(b, smallbuf); +#endif } } if(runners > 0) { diff --git a/src/common/kernel/battle.h b/src/common/kernel/battle.h index 8f6029f96..0045e256b 100644 --- a/src/common/kernel/battle.h +++ b/src/common/kernel/battle.h @@ -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 diff --git a/src/common/modules/Jamfile b/src/common/modules/Jamfile index 4538c85ee..ab60e7509 100644 --- a/src/common/modules/Jamfile +++ b/src/common/modules/Jamfile @@ -14,11 +14,11 @@ SOURCES = infocmd.c museum.c score.c - victoryconditions.c weather.c wormhole.c xecmd.c xmas.c ; + Library modules : $(SOURCES) ;