forked from github/server
vulkanänderungen
This commit is contained in:
parent
7670865a33
commit
1c079d4f90
|
@ -20,7 +20,10 @@
|
||||||
static int
|
static int
|
||||||
age_reduceproduction(attrib *a)
|
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 = {
|
attrib_type at_reduceproduction = {
|
||||||
|
@ -37,7 +40,9 @@ attrib *
|
||||||
make_reduceproduction(int percent, int time)
|
make_reduceproduction(int percent, int time)
|
||||||
{
|
{
|
||||||
attrib * a = a_new(&at_reduceproduction);
|
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;
|
a->data.sa[1] = (short)time;
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1291,9 +1291,11 @@ randomevents(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Vulkane qualmen, brechen aus ... */
|
/* Vulkane qualmen, brechen aus ... */
|
||||||
|
|
||||||
for (r = regions; r; r = r->next) {
|
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:
|
case T_VOLCANO:
|
||||||
if (rand()%100 < 4) {
|
if (rand()%100 < 4) {
|
||||||
ADDMSG(&r->msgs, msg_message("volcanostartsmoke", "region", r));
|
ADDMSG(&r->msgs, msg_message("volcanostartsmoke", "region", r));
|
||||||
|
|
|
@ -83,6 +83,7 @@ char buf[BUFSIZE + 1];
|
||||||
FILE *logfile;
|
FILE *logfile;
|
||||||
FILE *updatelog;
|
FILE *updatelog;
|
||||||
const struct race * new_race[MAXRACES];
|
const struct race * new_race[MAXRACES];
|
||||||
|
boolean sqlpatch = false;
|
||||||
|
|
||||||
race_t
|
race_t
|
||||||
old_race(const struct race * rc)
|
old_race(const struct race * rc)
|
||||||
|
@ -2055,7 +2056,7 @@ kernel_done(void)
|
||||||
translation_done();
|
translation_done();
|
||||||
skill_done();
|
skill_done();
|
||||||
gc_done();
|
gc_done();
|
||||||
sql_done();
|
if (sqlstream!=NULL) sql_done();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -2311,9 +2312,10 @@ kernel_init(void)
|
||||||
srand(time((time_t *) NULL));
|
srand(time((time_t *) NULL));
|
||||||
else
|
else
|
||||||
srand(turn);
|
srand(turn);
|
||||||
|
if (sqlpatch) {
|
||||||
sprintf(zBuffer, "%s/patch-%d.sql", datapath(), turn);
|
sprintf(zBuffer, "%s/patch-%d.sql", datapath(), turn);
|
||||||
sql_init(zBuffer);
|
sql_init(zBuffer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************/
|
/*********************/
|
||||||
|
|
|
@ -1206,4 +1206,5 @@ extern settings global;
|
||||||
extern FILE * updatelog;
|
extern FILE * updatelog;
|
||||||
extern int produceexp(struct unit * u, skill_t sk, int n);
|
extern int produceexp(struct unit * u, skill_t sk, int n);
|
||||||
|
|
||||||
|
extern boolean sqlpatch;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -593,6 +593,7 @@ main(int argc, char *argv[])
|
||||||
int i;
|
int i;
|
||||||
char zText[MAX_PATH];
|
char zText[MAX_PATH];
|
||||||
|
|
||||||
|
sqlpatch = true;
|
||||||
updatelog = fopen("update.log", "w");
|
updatelog = fopen("update.log", "w");
|
||||||
log_open("eressea.log");
|
log_open("eressea.log");
|
||||||
printf("\n%s PBEM host\n"
|
printf("\n%s PBEM host\n"
|
||||||
|
|
|
@ -1522,6 +1522,7 @@ main(int argc, char *argv[])
|
||||||
boolean readlog = false;
|
boolean readlog = false;
|
||||||
boolean autoseeding = false;
|
boolean autoseeding = false;
|
||||||
|
|
||||||
|
sqlpatch = false;
|
||||||
setlocale(LC_ALL, "");
|
setlocale(LC_ALL, "");
|
||||||
|
|
||||||
fprintf(stderr, "\n Mapper V" VERSION " Hex (" __DATE__ ")\n\n"
|
fprintf(stderr, "\n Mapper V" VERSION " Hex (" __DATE__ ")\n\n"
|
||||||
|
|
Loading…
Reference in New Issue