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: case K_SELL:
/* sell returns true if the sale is not limited /* sell returns true if the sale is not limited
* by the region limit */ * by the region limit */
limited = !sell(u, &sellorders, ord) & limited; limited &= !sell(u, &sellorders, ord);
break; break;
} }
} }
@ -3027,6 +3027,8 @@ produce(void)
if (sellorders) { if (sellorders) {
int limit = rpeasants(r) / TRADE_FRACTION; 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); expandselling(r, sellorders, limited?limit:INT_MAX);
} }

View File

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

View File

@ -994,7 +994,11 @@ terminate(troop dt, troop at, int type, const char *damage, boolean missile)
boolean magic = false; boolean magic = false;
int da = dice_rand(damage); int da = dice_rand(damage);
if(fval(au, UFL_WERE)) { #ifdef SHOW_KILLS
++at.fighter->hits;
#endif
if (fval(au, UFL_WERE)) {
int level = fspecial(du->faction, FS_LYCANTROPE); int level = fspecial(du->faction, FS_LYCANTROPE);
da += level; da += level;
} }
@ -1188,13 +1192,14 @@ terminate(troop dt, troop at, int type, const char *damage, boolean missile)
return false; return false;
} }
#ifdef SHOW_KILLS #ifdef SHOW_KILLS
++at.fighter->kills; ++at.fighter->kills;
assert(at.fighter->kills>=at.fighter->hits);
#endif #endif
#ifdef SMALL_BATTLE_MESSAGES #ifdef SMALL_BATTLE_MESSAGES
if (b->small) { if (b->small) {
strcat(smallbuf, ", die tödlich ist"); strcat(smallbuf, ", die tödlich ist");
} }
#endif #endif
/* Sieben Leben */ /* Sieben Leben */
@ -1850,9 +1855,6 @@ hits(troop at, troop dt, weapon * awp)
strcat(smallbuf, " und trifft."); strcat(smallbuf, " und trifft.");
battlerecord(b,smallbuf); battlerecord(b,smallbuf);
} }
#endif
#ifdef SHOW_KILLS
++at.fighter->hits;
#endif #endif
return 1; return 1;
} }

View File

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

View File

@ -840,7 +840,7 @@ enum {
#define HELP_GUARD 16 /* Laesst Steuern eintreiben etc. */ #define HELP_GUARD 16 /* Laesst Steuern eintreiben etc. */
#define HELP_FSTEALTH 32 /* Parteitarnung anzeigen. */ #define HELP_FSTEALTH 32 /* Parteitarnung anzeigen. */
#define HELP_TRAVEL 64 /* Laesst Regionen betreten. */ #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 */ /* HELP_OBSERVE deaktiviert */
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
/* Prototypen */ /* Prototypen */

View File

@ -511,7 +511,7 @@ travel_route(const unit * u, region * r, region_list * route)
/* kein travelthru in der letzten region! */ /* kein travelthru in der letzten region! */
while (route) { while (route) {
travelthru(u, r); travelthru(u, r);
r = route->data; r = route->data;
route = route->next; route = route->next;
} }
} }