From 9e183e4393a46503033e46479d7b6f326c4ed9d3 Mon Sep 17 00:00:00 2001 From: Christian Schlittchen Date: Sat, 15 Dec 2001 11:54:33 +0000 Subject: [PATCH] - Hack in Mapper zum 'Verarmen' von Regionen: Tag->Modify->Peasants --- src/common/kernel/region.c | 12 ++++++++++++ src/common/kernel/region.h | 2 +- src/mapper/mapper.c | 9 +++++++-- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/common/kernel/region.c b/src/common/kernel/region.c index 7a85dd447..dbf2d08d9 100644 --- a/src/common/kernel/region.c +++ b/src/common/kernel/region.c @@ -563,6 +563,18 @@ r_isforest(const region * r) return false; } +boolean +r_issea(const region * r) +{ + direction_t d; + + for(d=0; d < MAXDIRECTIONS; d++) { + region *rc = rconnect(r,d); + if(rc && rterrain(rc) == T_OCEAN) return false; + } + return true; +} + boolean r_isglacier(const region * r) { diff --git a/src/common/kernel/region.h b/src/common/kernel/region.h index 9b6b4104c..adbab9dcb 100644 --- a/src/common/kernel/region.h +++ b/src/common/kernel/region.h @@ -192,7 +192,7 @@ void rsetlaen(struct region * r, int value); #define rsetherbs(r, value) ((r)->land?((r)->land->herbs=(short)(value)):(value),0) extern boolean r_isforest(const struct region * r); - +extern boolean r_issea(const struct region * r); extern boolean r_isglacier(const struct region * r); #define rterrain(r) (terrain_t)((r)?(r)->terrain:T_FIREWALL) diff --git a/src/mapper/mapper.c b/src/mapper/mapper.c index 95226b32c..9ead61537 100644 --- a/src/mapper/mapper.c +++ b/src/mapper/mapper.c @@ -494,6 +494,7 @@ modify_block(void) region *r; tagregion *t; char *name; + int div; win = openwin(70, 4, "< Tag-Regionen modifizieren >"); wmove(win, 1, 2); @@ -517,7 +518,10 @@ modify_block(void) } break; case 'n': - name = my_input(win, 2, 2, "Name: ", NULL); + name = my_input(win, 2, 2, "Name: ", NULL); + break; + case 'p': + div = atoi(my_input(win, 2, 2, "Divisor: ", "1")); break; } @@ -529,7 +533,8 @@ modify_block(void) rsetname(r, name); break; case 'p': - rsetpeasants(r, production(r)*3+rand()%(production(r)*3)); + rsetpeasants(r, (production(r)*3+rand()%(production(r)*3))/div); + rsetmoney(r, (production(r)*10+rand()%(production(r)*10))/div); break; case 'h': rsethorses(r, rand()%(production(r) / 10));