vulkanänderungen

This commit is contained in:
Enno Rehling 2002-10-13 11:08:04 +00:00
parent 7670865a33
commit 1c079d4f90
6 changed files with 20 additions and 8 deletions

View File

@ -20,7 +20,10 @@
static int
age_reduceproduction(attrib *a)
{
return --a->data.sa[1];
int reduce = 100 - (5 * --a->data.sa[1]);
if (reduce < 10) reduce = 10;
a->data.sa[0] = (short)reduce;
return a->data.sa[1];
}
attrib_type at_reduceproduction = {
@ -37,7 +40,9 @@ attrib *
make_reduceproduction(int percent, int time)
{
attrib * a = a_new(&at_reduceproduction);
a->data.sa[0] = (short)percent;
int reduce = 100 - (5 * time);
if (reduce < 10) reduce = 10;
a->data.sa[0] = (short)reduce;
a->data.sa[1] = (short)time;
return a;
}

View File

@ -1291,9 +1291,11 @@ randomevents(void)
}
/* Vulkane qualmen, brechen aus ... */
for (r = regions; r; r = r->next) {
switch(rterrain(r)) {
if (rterrain(r)==T_VOLCANO_SMOKING && a_find(&r->attribs, &at_reduceproduction)) {
ADDMSG(&r->msgs, msg_message("volcanostopsmoke", "region", r));
rsetterrain(r, T_VOLCANO);
} else switch(rterrain(r)) {
case T_VOLCANO:
if (rand()%100 < 4) {
ADDMSG(&r->msgs, msg_message("volcanostartsmoke", "region", r));

View File

@ -83,6 +83,7 @@ char buf[BUFSIZE + 1];
FILE *logfile;
FILE *updatelog;
const struct race * new_race[MAXRACES];
boolean sqlpatch = false;
race_t
old_race(const struct race * rc)
@ -2055,7 +2056,7 @@ kernel_done(void)
translation_done();
skill_done();
gc_done();
sql_done();
if (sqlstream!=NULL) sql_done();
}
static void
@ -2311,9 +2312,10 @@ kernel_init(void)
srand(time((time_t *) NULL));
else
srand(turn);
if (sqlpatch) {
sprintf(zBuffer, "%s/patch-%d.sql", datapath(), turn);
sql_init(zBuffer);
}
}
/*********************/

View File

@ -1206,4 +1206,5 @@ extern settings global;
extern FILE * updatelog;
extern int produceexp(struct unit * u, skill_t sk, int n);
extern boolean sqlpatch;
#endif

View File

@ -593,6 +593,7 @@ main(int argc, char *argv[])
int i;
char zText[MAX_PATH];
sqlpatch = true;
updatelog = fopen("update.log", "w");
log_open("eressea.log");
printf("\n%s PBEM host\n"

View File

@ -1522,6 +1522,7 @@ main(int argc, char *argv[])
boolean readlog = false;
boolean autoseeding = false;
sqlpatch = false;
setlocale(LC_ALL, "");
fprintf(stderr, " \n Mapper V" VERSION " Hex (" __DATE__ ")\n\n"