Enno Rehling 2004-08-21 01:55:56 +00:00
parent 8ee6431125
commit 3ca1a267b0
7 changed files with 31 additions and 32 deletions

View File

@ -2941,7 +2941,7 @@ produce(void)
case K_SELL:
/* sell returns true if the sale is not limited
* by the region limit */
limited = !sell(u, &sellorders, ord) & limited;
limited &= !sell(u, &sellorders, ord);
break;
}
}
@ -3027,6 +3027,8 @@ produce(void)
if (sellorders) {
int limit = rpeasants(r) / TRADE_FRACTION;
if (rterrain(r) == T_DESERT && buildingtype_exists(r, bt_find("caravan")))
limit *= 2;
expandselling(r, sellorders, limited?limit:INT_MAX);
}

View File

@ -166,7 +166,6 @@ get_food(region *r)
{
unit *u;
int peasantfood = rpeasants(r)*10;
unit * demon = r->units;
/* 1. Versorgung von eigenen Einheiten. Das vorhandene Silber
* wird zunächst so auf die Einheiten aufgeteilt, dass idealerweise
@ -238,33 +237,27 @@ get_food(region *r)
*/
for (u = r->units; u; u = u->next) {
if (u->race == new_race[RC_DAEMON]) {
unit * donor = r->units;
int hungry = u->number;
while (demon!=NULL && hungry>0) {
while (donor!=NULL && hungry>0) {
/* alwayy start with the first known uint that may have some blood */
static const struct potion_type * pt_blood;
unit * ud = demon;
if (pt_blood==NULL) pt_blood = pt_find("peasantblood");
demon = NULL; /* this will be re-set in the loop */
while (ud!=NULL) {
if (ud->race==new_race[RC_DAEMON]) {
if (get_effect(ud, pt_blood)) {
/* new best guess for first blood-donor: */
if (demon==NULL) demon = ud;
while (donor!=NULL) {
if (donor->race==new_race[RC_DAEMON]) {
if (get_effect(donor, pt_blood)) {
/* if he's in our faction, drain him: */
if (ud->faction==u->faction) break;
if (donor->faction==u->faction) break;
}
}
ud=ud->next;
donor = donor->next;
}
if (ud!=NULL) {
int blut = get_effect(ud, pt_blood);
if (donor != NULL) {
int blut = get_effect(donor, pt_blood);
blut = min(blut, hungry);
change_effect(ud, pt_blood, -blut);
change_effect(donor, pt_blood, -blut);
hungry -= blut;
} else {
break;
/* no more help for us */
}
}
if (r->planep == NULL || !fval(r->planep, PFL_NOFEED)) {
@ -276,7 +269,9 @@ get_food(region *r)
peasantfood = 0;
}
if (hungry > 0) {
hunger(hungry, u); /* nicht gefütterte dämonen hungern */
/* nicht gefütterte dämonen hungern */
if (hunger(hungry, u)) fset(u, UFL_HUNGER);
/* used to be: hunger(hungry, u); */
}
}
}

View File

@ -1690,7 +1690,7 @@ show_allies(const faction * f, const ally * allies)
hh = 0;
scat(factionname(sf->faction));
scat(" (");
if (mode == HELP_ALL) {
if ((mode & HELP_ALL) == HELP_ALL) {
scat("Alles");
} else
for (h = 1; h < HELP_ALL; h *= 2) {

View File

@ -994,6 +994,10 @@ terminate(troop dt, troop at, int type, const char *damage, boolean missile)
boolean magic = false;
int da = dice_rand(damage);
#ifdef SHOW_KILLS
++at.fighter->hits;
#endif
if (fval(au, UFL_WERE)) {
int level = fspecial(du->faction, FS_LYCANTROPE);
da += level;
@ -1189,6 +1193,7 @@ terminate(troop dt, troop at, int type, const char *damage, boolean missile)
}
#ifdef SHOW_KILLS
++at.fighter->kills;
assert(at.fighter->kills>=at.fighter->hits);
#endif
#ifdef SMALL_BATTLE_MESSAGES
@ -1850,9 +1855,6 @@ hits(troop at, troop dt, weapon * awp)
strcat(smallbuf, " und trifft.");
battlerecord(b,smallbuf);
}
#endif
#ifdef SHOW_KILLS
++at.fighter->hits;
#endif
return 1;
}

View File

@ -716,9 +716,9 @@ sp_drainodem(fighter * fi, int level, double power, spell * sp)
assert(dt.fighter);
if (hits(at, dt, NULL)) {
drain_exp(dt.fighter->unit, 90);
drained++;
}
++drained;
killed += terminate(dt, at, AT_COMBATSPELL, damage, false);
}
--force;
}

View File

@ -840,7 +840,7 @@ enum {
#define HELP_GUARD 16 /* Laesst Steuern eintreiben etc. */
#define HELP_FSTEALTH 32 /* Parteitarnung anzeigen. */
#define HELP_TRAVEL 64 /* Laesst Regionen betreten. */
#define HELP_ALL (127-HELP_OBSERVE) /* Alle "positiven" HELPs zusammen */
#define HELP_ALL (127-HELP_TRAVEL-HELP_OBSERVE) /* Alle "positiven" HELPs zusammen */
/* HELP_OBSERVE deaktiviert */
/* ------------------------------------------------------------- */
/* Prototypen */