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,7 +293,25 @@ recruit(unit * u, struct order * ord, request ** recruitorders)
|
||||||
plane * pl;
|
plane * pl;
|
||||||
request *o;
|
request *o;
|
||||||
int recruitcost;
|
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
|
#if GUARD_DISABLES_RECRUIT == 1
|
||||||
/* this is a very special case because the recruiting unit may be empty
|
/* this is a very special case because the recruiting unit may be empty
|
||||||
|
@ -375,10 +393,6 @@ recruit(unit * u, struct order * ord, request ** recruitorders)
|
||||||
else u->race = rc;
|
else u->race = rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
init_tokens(ord);
|
|
||||||
skip_token();
|
|
||||||
n = geti();
|
|
||||||
|
|
||||||
if (has_skill(u, SK_MAGIC)) {
|
if (has_skill(u, SK_MAGIC)) {
|
||||||
/* error158;de;{unit} in {region}: '{command}' - Magier arbeiten
|
/* error158;de;{unit} in {region}: '{command}' - Magier arbeiten
|
||||||
* grundsätzlich nur alleine! */
|
* grundsätzlich nur alleine! */
|
||||||
|
|
|
@ -1812,6 +1812,10 @@ hits(troop at, troop dt, weapon * awp)
|
||||||
if (!df->alive) return 0;
|
if (!df->alive) return 0;
|
||||||
if (getreload(at)) return 0;
|
if (getreload(at)) return 0;
|
||||||
if (dist>1 && (awp == NULL || !fval(awp->type, WTF_MISSILE))) 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) {
|
if (af->person[at.index].flags & FL_STUNNED) {
|
||||||
af->person[at.index].flags &= ~FL_STUNNED;
|
af->person[at.index].flags &= ~FL_STUNNED;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -3791,6 +3795,7 @@ do_battle(void)
|
||||||
int runhp = min(600,(int)(0.9+unit_max_hp(u)*hpflee(u->status)));
|
int runhp = min(600,(int)(0.9+unit_max_hp(u)*hpflee(u->status)));
|
||||||
side *side = fig->side;
|
side *side = fig->side;
|
||||||
if (fval(u->race, RCF_UNDEAD) || old_race(u->race) == RC_SHADOWKNIGHT) continue;
|
if (fval(u->race, RCF_UNDEAD) || old_race(u->race) == RC_SHADOWKNIGHT) continue;
|
||||||
|
|
||||||
if (u->ship) continue;
|
if (u->ship) continue;
|
||||||
dt.fighter = fig;
|
dt.fighter = fig;
|
||||||
#ifndef NO_RUNNING
|
#ifndef NO_RUNNING
|
||||||
|
@ -3799,6 +3804,7 @@ do_battle(void)
|
||||||
#endif
|
#endif
|
||||||
dt.index = fig->alive - fig->removed;
|
dt.index = fig->alive - fig->removed;
|
||||||
while (side->size[SUM_ROW] && dt.index != 0) {
|
while (side->size[SUM_ROW] && dt.index != 0) {
|
||||||
|
double ispaniced = 0.0;
|
||||||
--dt.index;
|
--dt.index;
|
||||||
assert(dt.index>=0 && dt.index<fig->unit->number);
|
assert(dt.index>=0 && dt.index<fig->unit->number);
|
||||||
assert(fig->person[dt.index].hp > 0);
|
assert(fig->person[dt.index].hp > 0);
|
||||||
|
@ -3809,12 +3815,20 @@ do_battle(void)
|
||||||
* - in panik (Zauber)
|
* - in panik (Zauber)
|
||||||
* aber nicht, wenn der Zaubereffekt Held auf dir liegt!
|
* aber nicht, wenn der Zaubereffekt Held auf dir liegt!
|
||||||
*/
|
*/
|
||||||
if ((u->status == ST_FLEE
|
switch (u->status) {
|
||||||
|| (b->turn>1 && fig->person[dt.index].hp <= runhp)
|
case ST_FLEE:
|
||||||
|| (fig->person[dt.index].flags & FL_PANICED))
|
run = true;
|
||||||
&& !(fig->person[dt.index].flags & FL_COURAGE))
|
break;
|
||||||
{
|
default:
|
||||||
double ispaniced = 0.0;
|
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) {
|
if (fig->person[dt.index].flags & FL_PANICED) {
|
||||||
ispaniced = EFFECT_PANIC_SPELL;
|
ispaniced = EFFECT_PANIC_SPELL;
|
||||||
}
|
}
|
||||||
|
@ -3834,7 +3848,6 @@ do_battle(void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(runners > 0) {
|
if(runners > 0) {
|
||||||
sprintf(lbuf, "Flucht: %d aus %s", runners, itoa36(fig->unit->no));
|
sprintf(lbuf, "Flucht: %d aus %s", runners, itoa36(fig->unit->no));
|
||||||
battledebug(lbuf);
|
battledebug(lbuf);
|
||||||
|
|
|
@ -113,6 +113,7 @@ extern "C" {
|
||||||
#define FL_COURAGE 8 /* Helden fliehen nie */
|
#define FL_COURAGE 8 /* Helden fliehen nie */
|
||||||
#define FL_SLEEPING 16
|
#define FL_SLEEPING 16
|
||||||
#define FL_STUNNED 32 /* eine Runde keinen Angriff */
|
#define FL_STUNNED 32 /* eine Runde keinen Angriff */
|
||||||
|
#define FL_HIT 64 /* the person at attacked */
|
||||||
|
|
||||||
/*** fighter::flags ***/
|
/*** fighter::flags ***/
|
||||||
#define FIG_ATTACKED 1
|
#define FIG_ATTACKED 1
|
||||||
|
|
|
@ -14,11 +14,11 @@ SOURCES =
|
||||||
infocmd.c
|
infocmd.c
|
||||||
museum.c
|
museum.c
|
||||||
score.c
|
score.c
|
||||||
victoryconditions.c
|
|
||||||
weather.c
|
weather.c
|
||||||
wormhole.c
|
wormhole.c
|
||||||
xecmd.c
|
xecmd.c
|
||||||
xmas.c
|
xmas.c
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
Library modules : $(SOURCES) ;
|
Library modules : $(SOURCES) ;
|
||||||
|
|
Loading…
Reference in New Issue