Updates aus aktueller Version in Dev-Version

This commit is contained in:
Enno Rehling 2001-04-08 17:36:50 +00:00
parent 46a4ef6585
commit b5778f1cfd
11 changed files with 83 additions and 38 deletions

View File

@ -25,6 +25,9 @@ LDFLAGS = $(LIBS)
LIBS = -L$(PUBLISH_DIR) LIBS = -L$(PUBLISH_DIR)
LINTFLAGS = -booltype boolean -boolops +posixlib +matchanyintegral \
-predboolint -retvalint -retvalother -realcompare -exportlocal
ARCHITECTURE = Linux ARCHITECTURE = Linux
## ##
@ -91,6 +94,14 @@ ifeq ($(CONFIG), dmalloc)
LIBS += -ldmalloc LIBS += -ldmalloc
endif endif
# ifeq ($(CONFIG), lint)
# BUILD_DIR = Lint-$(ARCHITECTURE)
# CC = lint
# CFLAGS = -I$(ERESSEA) $(INCLUDES) -booltype boolean -boolops
# LDFLAGS =
# LIBS =
# endif
# #
## Dependencies ## Dependencies
@ -130,10 +141,11 @@ recurse-subdirs-release:: subdirs-release publish-release
recurse-subdirs-profile:: subdirs-profile publish-profile recurse-subdirs-profile:: subdirs-profile publish-profile
recurse-subdirs-dmalloc:: subdirs-dmalloc publish-dmalloc recurse-subdirs-dmalloc:: subdirs-dmalloc publish-dmalloc
recurse-lint:: lint
recurse-clean:: clean recurse-clean:: clean
recurse-depend:: depend recurse-depend:: depend
subdirs-debug subdirs-release subdirs-profile subdirs-dmalloc clean depend:: subdirs-debug subdirs-release subdirs-profile subdirs-dmalloc lint clean depend::
@mkdir -p $(PUBLISH_DIR) @mkdir -p $(PUBLISH_DIR)
@if [ -n "$(SUBDIRS)" ]; then \ @if [ -n "$(SUBDIRS)" ]; then \
for subdir in x-placeholder-dir $(SUBDIRS); do \ for subdir in x-placeholder-dir $(SUBDIRS); do \
@ -153,7 +165,10 @@ publish-dmalloc:: subdirs-dmalloc
publish-debug publish-release publish-profile publish-dmalloc:: $(PUBLISH_DIR)/$(LIBRARY) $(PUBLISH_DIR)/$(BINARY) publish-debug publish-release publish-profile publish-dmalloc:: $(PUBLISH_DIR)/$(LIBRARY) $(PUBLISH_DIR)/$(BINARY)
clean:: $(BUILD_DIR) $(PUBLISH_DIR) clean:: $(BUILD_DIR) $(PUBLISH_DIR)
rm -fr Release-$(ARCHITECTURE)/* Debug-$(ARCHITECTURE)/* Profile-$(ARCHITECTURE)/* Dmalloc-$(ARCHITECTURE)/* rm -fr Release-$(ARCHITECTURE)/* Debug-$(ARCHITECTURE)/* Profile-$(ARCHITECTURE)/* Dmalloc-$(ARCHITECTURE)/* Lint-$(ARCHITECTURE)/*
lint::
$(LINT) -I$(ERESSEA) $(INCLUDES) $(LINTFLAGS) *.c
$(BUILD_DIR) $(PUBLISH_DIR): $(BUILD_DIR) $(PUBLISH_DIR):
@mkdir $@ @mkdir $@
@ -174,3 +189,4 @@ ifeq ($(CONVERT_TRIGGERS), 1)
CFLAGS += -DCONVERT_TRIGGER CFLAGS += -DCONVERT_TRIGGER
INCLUDES += -I. -I$(ERESSEA)/eressea/old INCLUDES += -I. -I$(ERESSEA)/eressea/old
endif endif

View File

@ -364,7 +364,7 @@ live(region * r)
void void
calculate_emigration(region *r) calculate_emigration(region *r)
{ {
direction_t i; direction_t i, j;
int maxpeasants_here; int maxpeasants_here;
int maxpeasants[MAXDIRECTIONS]; int maxpeasants[MAXDIRECTIONS];
double wfactor, gfactor; double wfactor, gfactor;
@ -387,6 +387,7 @@ calculate_emigration(region *r)
if (fval(r, RF_ORCIFIED)==fval(c, RF_ORCIFIED)) { if (fval(r, RF_ORCIFIED)==fval(c, RF_ORCIFIED)) {
if (landregion(rterrain(c)) && landregion(rterrain(r))) { if (landregion(rterrain(c)) && landregion(rterrain(r))) {
int wandering_peasants; int wandering_peasants;
double vfactor;
/* First let's calculate the peasants who wander off to less inhabited /* First let's calculate the peasants who wander off to less inhabited
* regions. wfactor indicates the difference of population denity. * regions. wfactor indicates the difference of population denity.
@ -405,8 +406,25 @@ calculate_emigration(region *r)
gfactor = max(gfactor, 0); gfactor = max(gfactor, 0);
gfactor = min(gfactor, 1); gfactor = min(gfactor, 1);
/* This calculates the influence of volcanos on peasant
* migration. */
if(rterrain(c) != T_VOLCANO) {
vfactor = 0.25;
} else {
vfactor = 1.00;
}
for(j=0; j != MAXDIRECTIONS; j++) {
region *rv = rconnect(c, j);
if(rv && rterrain(rv) == T_VOLCANO) {
vfactor *= 0.5;
break;
}
}
wandering_peasants = (int) (rpeasants(r) * (gfactor + wfactor) wandering_peasants = (int) (rpeasants(r) * (gfactor + wfactor)
* PEASANTSWANDER_WEIGHT / 100.0); * vfactor * PEASANTSWANDER_WEIGHT / 100.0);
r->land->newpeasants -= wandering_peasants; r->land->newpeasants -= wandering_peasants;
c->land->newpeasants += wandering_peasants; c->land->newpeasants += wandering_peasants;

View File

@ -1715,7 +1715,7 @@ report(FILE *F, faction * f)
dh = 0; dh = 0;
for(a=a_find(f->attribs, &at_faction_special); a; a=a->nexttype) { for(a=a_find(f->attribs, &at_faction_special); a; a=a->nexttype) {
dh++; dh++;
if(fspecials[a->data.sa[0]].maxlevel) { if(fspecials[a->data.sa[0]].maxlevel != 100) {
sprintf(buf2, "%s (%d)", fspecials[a->data.sa[0]].name, a->data.sa[1]); sprintf(buf2, "%s (%d)", fspecials[a->data.sa[0]].name, a->data.sa[1]);
} else { } else {
sprintf(buf2, "%s", fspecials[a->data.sa[0]].name); sprintf(buf2, "%s", fspecials[a->data.sa[0]].name);

View File

@ -602,7 +602,8 @@ build(unit * u, const construction * ctype, int completed, int want)
while (type->improvement!=NULL && while (type->improvement!=NULL &&
type->improvement!=type && type->improvement!=type &&
type->maxsize>0 && type->maxsize>0 &&
type->maxsize<=completed) { type->maxsize<=completed)
{
completed -= type->maxsize; completed -= type->maxsize;
type = type->improvement; type = type->improvement;
} }
@ -763,9 +764,17 @@ build_building(unit * u, const building_type * btype, int want)
if (b) built = b->size; if (b) built = b->size;
if (want<=0 || want == INT_MAX) { if (want<=0 || want == INT_MAX) {
if(b == NULL) { if(b == NULL) {
if(btype->maxsize > 0) {
want = btype->maxsize - built; want = btype->maxsize - built;
} else { } else {
want = INT_MAX;
}
} else {
if(b->type->maxsize > 0) {
want = b->type->maxsize - built; want = b->type->maxsize - built;
} else {
want = INT_MAX;
}
} }
} }
built = build(u, btype->construction, built, want); built = build(u, btype->construction, built, want);

View File

@ -1,6 +1,5 @@
/* vi: set ts=2: /* vi: set ts=2:
* *
* $Id: magic.c,v 1.12 2001/03/07 15:00:18 corwin Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000 * Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de) * Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de)
@ -1480,7 +1479,7 @@ regeneration_magiepunkte(void)
if (aura < auramax) { if (aura < auramax) {
struct building * b = inside_building(u); struct building * b = inside_building(u);
const struct building_type * btype = b?b->type:NULL; const struct building_type * btype = b?b->type:NULL;
reg_aura = regeneration(u); reg_aura = (double)regeneration(u);
/* Magierturm erhöht die Regeneration um 50% */ /* Magierturm erhöht die Regeneration um 50% */
if (btype == &bt_magictower) { if (btype == &bt_magictower) {

View File

@ -1,5 +1,6 @@
/* vi: set ts=2: /* vi: set ts=2:
* *
* $Id: movement.c,v 1.17 2001/04/08 17:36:48 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000 * Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de) * Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de)
@ -2125,6 +2126,8 @@ follow(void)
unit * uf = findunit(id); unit * uf = findunit(id);
if (!a) { if (!a) {
a = a_add(&u->attribs, make_follow(uf)); a = a_add(&u->attribs, make_follow(uf));
} else {
a->data.v = uf;
} }
} else if (a) { } else if (a) {
a_remove(&u->attribs, a); a_remove(&u->attribs, a);

View File

@ -1,5 +1,6 @@
/* vi: set ts=2: /* vi: set ts=2:
* *
* $Id: spell.c,v 1.17 2001/04/08 17:36:48 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000 * Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de) * Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de)
@ -3554,7 +3555,7 @@ sp_bloodsacrifice(castorder *co)
return 0; return 0;
} }
get_mage(mage)->spellpoints += aura; change_spellpoints(mage, aura);
use_pooled(mage, mage->region, R_HITPOINTS, damage); use_pooled(mage, mage->region, R_HITPOINTS, damage);
add_message(&mage->faction->msgs, new_message(mage->faction, add_message(&mage->faction->msgs, new_message(mage->faction,

View File

@ -1023,7 +1023,7 @@ show_newspells(void)
* terminieren */ * terminieren */
spellid_t newspellids[] = { spellid_t newspellids[] = {
}; SPL_NOSPELL };
/* die id's der neuen oder veränderten Sprüche werden in newspellids[] /* die id's der neuen oder veränderten Sprüche werden in newspellids[]
* abgelegt */ * abgelegt */
@ -1596,32 +1596,36 @@ stats(void)
static void static void
fix_prices(void) fix_prices(void)
{ {
FILE *fp;
char buf[256];
char *token;
int x, y, p, i;
region *r; region *r;
puts(" - Korrigiere Handelsgüterpreise"); puts(" - Korrigiere Handelsgüterpreise");
fp = fopen("prices.fix", "r"); for(r=regions; r; r=r->next) if(r->land) {
if (fp==NULL) return; int sales = 0, buys = 0;
const luxury_type *sale, *ltype;
while(fgets(buf, 256, fp)!=NULL) { struct demand *dmd;
token = strtok(buf, ":"); /* Name */ for (dmd=r->land->demands;dmd;dmd=dmd->next) {
token = strtok(NULL, ":"); x = atoi(token); if(dmd->value == 0) {
token = strtok(NULL, ":"); y = atoi(token); sales++;
r = findregion(x, y); sale = dmd->type;
assert(r != NULL); } else {
if(r->land) { buys++;
for(i = 0; oldluxurytype[i]!=NULL; i++) { }
token = strtok(NULL, ":"); p = atoi(token); }
r_setdemand(r, oldluxurytype[i], p); if(sales == 0) {
int c = 0;
for(ltype=luxurytypes; ltype; ltype=ltype->next) c++;
c = rand()%c;
for(ltype=luxurytypes; c>0; c--) ltype=ltype->next;
r_setdemand(r, ltype, 0);
sale = ltype;
}
if(buys == 0) {
for(ltype=luxurytypes; ltype; ltype=ltype->next) {
if(ltype != sale) r_setdemand(r, ltype, 1 + rand() % 5);
} }
} }
} }
fclose(fp);
} }
static void static void
@ -2171,6 +2175,7 @@ korrektur(void)
do_once(atoi36("fhrb"), fix_herbs()); do_once(atoi36("fhrb"), fix_herbs());
do_once(atoi36("ftos"), fix_timeouts()); do_once(atoi36("ftos"), fix_timeouts());
do_once(atoi36("gmtst"), test_gmquest()); /* test gm quests */ do_once(atoi36("gmtst"), test_gmquest()); /* test gm quests */
do_once(atoi36("fixsl"), fix_prices());
#ifndef SKILLFIX_SAVE #ifndef SKILLFIX_SAVE
fix_skills(); fix_skills();
#endif #endif

View File

@ -1,6 +1,5 @@
/* vi: set ts=2: /* vi: set ts=2:
* *
* $Id: map_modify.c,v 1.8 2001/04/01 06:58:44 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000 * Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de) * Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de)
@ -1143,10 +1142,7 @@ settg(region *r)
if (tradegood==NULL) tradegood = luxurytypes; if (tradegood==NULL) tradegood = luxurytypes;
for (ltype=luxurytypes; ltype; ltype=ltype->next) { for (ltype=luxurytypes; ltype; ltype=ltype->next) {
struct demand * dmd; if (ltype!=tradegood) r_setdemand(r, ltype, 1 + rand() % 5);
dmd = calloc(sizeof(struct demand), 1);
dmd->type = ltype;
if (ltype!=tradegood) dmd->value = 1 + rand() % 5;
++g; ++g;
} }
r_setdemand(r, tradegood, 0); r_setdemand(r, tradegood, 0);

View File

@ -1,6 +1,5 @@
/* vi: set ts=2: /* vi: set ts=2:
* *
* $Id: mapper.c,v 1.14 2001/04/01 06:58:44 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000 * Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de) * Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de)

View File

@ -1,6 +1,5 @@
/* vi: set ts=2: /* vi: set ts=2:
* *
* $Id: mapper.h,v 1.5 2001/04/01 06:58:44 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000 * Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de) * Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de)