add a modules.icebergs configuration variable.

This commit is contained in:
Enno Rehling 2017-11-05 19:35:06 +01:00
parent 4b1b98f5ec
commit 373d738084
4 changed files with 16 additions and 7 deletions

View File

@ -13,7 +13,10 @@
"game.id" : 2, "game.id" : 2,
"orders.default": "work", "orders.default": "work",
"NewbieImmunity": 8, "NewbieImmunity": 8,
"modules.markets": false,
"modules.astralspace": true,
"modules.wormholes": true, "modules.wormholes": true,
"modules.icebergs": true,
"entertain.base": 0, "entertain.base": 0,
"entertain.perlevel": 20, "entertain.perlevel": 20,
"taxing.perlevel": 20, "taxing.perlevel": 20,

View File

@ -14,7 +14,7 @@
extern "C" { extern "C" {
#endif #endif
enum { typedef enum {
T_OCEAN = 0, T_OCEAN = 0,
T_PLAIN, T_PLAIN,
T_SWAMP, T_SWAMP,
@ -29,8 +29,8 @@ extern "C" {
T_VOLCANO_SMOKING, T_VOLCANO_SMOKING,
T_ICEBERG_SLEEP, T_ICEBERG_SLEEP,
T_ICEBERG, T_ICEBERG,
NOTERRAIN = (terrain_t) - 1 NOTERRAIN = - 1
}; } terrain_t;
extern const struct terrain_type *newterrain(terrain_t t); extern const struct terrain_type *newterrain(terrain_t t);
extern terrain_t oldterrain(const struct terrain_type *terrain); extern terrain_t oldterrain(const struct terrain_type *terrain);

View File

@ -22,7 +22,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <settings.h> #include <settings.h>
#include <util/variant.h> #include <util/variant.h>
typedef short terrain_t;
typedef short item_t; typedef short item_t;
struct attrib; struct attrib;

View File

@ -610,9 +610,14 @@ static void move_icebergs(void)
void create_icebergs(void) void create_icebergs(void)
{ {
region *r; region *r;
const struct terrain_type *t_iceberg, *t_sleep;
t_iceberg = get_terrain("iceberg");
t_sleep = get_terrain("iceberg_sleep");
assert(t_iceberg && t_sleep);
for (r = regions; r; r = r->next) { for (r = regions; r; r = r->next) {
if (r->terrain == newterrain(T_ICEBERG_SLEEP) && chance(0.05)) { if (r->terrain == t_sleep && chance(0.05)) {
bool has_ocean_neighbour = false; bool has_ocean_neighbour = false;
direction_t dir; direction_t dir;
region *rc; region *rc;
@ -629,7 +634,7 @@ void create_icebergs(void)
if (!has_ocean_neighbour) if (!has_ocean_neighbour)
continue; continue;
rsetterrain(r, T_ICEBERG); r->terrain = t_iceberg;
fset(r, RF_SELECT); fset(r, RF_SELECT);
move_iceberg(r); move_iceberg(r);
@ -801,7 +806,9 @@ void randomevents(void)
region *r; region *r;
faction *monsters = get_monsters(); faction *monsters = get_monsters();
if (config_get_int("modules.icebergs", 0)) {
icebergs(); icebergs();
}
godcurse(); godcurse();
orc_growth(); orc_growth();
demon_skillchanges(); demon_skillchanges();