Add stormy level flag

Which makes clouds create lightning bolts at random.
This flag is used on the plane of air.

Breaks saves and bones.
This commit is contained in:
Pasi Kallinen
2023-03-17 20:13:29 +02:00
parent 4799fc937a
commit aa83dadc1e
6 changed files with 8 additions and 4 deletions

View File

@@ -6,7 +6,7 @@
--
des.level_init({ style = "solidfill", fg = " " });
des.level_flags("mazelevel", "noteleport", "hardfloor", "shortsighted")
des.level_flags("mazelevel", "noteleport", "hardfloor", "shortsighted", "stormy")
-- The following messages are somewhat obtuse, to make then
-- equally meaningful if the player can see or not.
des.message("What a strange feeling!")

View File

@@ -615,6 +615,7 @@ Set flags for this level.
| nomongen | Prevents random monster generation.
| nodeathdrops | Prevents killed monsters from dropping corpses or random death drops.
| fumaroles | Lava emits poison gas clouds at random.
| stormy | Clouds create lightning bolts at random.
|===
Example:

View File

@@ -17,7 +17,7 @@
* Incrementing EDITLEVEL can be used to force invalidation of old bones
* and save files.
*/
#define EDITLEVEL 79
#define EDITLEVEL 80
/*
* Development status possibilities.

View File

@@ -393,6 +393,7 @@ struct levelflags {
Bitfield(deathdrops, 1); /* monsters may drop corpses/death drops */
Bitfield(noautosearch, 1); /* automatic searching disabled */
Bitfield(fumaroles, 1); /* lava emits poison gas at random */
Bitfield(stormy, 1); /* clouds create lightning bolts at random */
schar temperature; /* +1 == hot, -1 == cold */
};

View File

@@ -3749,6 +3749,8 @@ lspo_level_flags(lua_State *L)
gl.level.flags.noautosearch = 1;
else if (!strcmpi(s, "fumaroles"))
gl.level.flags.fumaroles = 1;
else if (!strcmpi(s, "stormy"))
gl.level.flags.stormy = 1;
else {
char buf[BUFSZ];
Sprintf(buf, "Unknown level flag %s", s);

View File

@@ -1706,8 +1706,8 @@ do_storms(void)
int dirx, diry;
int count;
/* no lightning if not the air level or too often, even then */
if (!Is_airlevel(&u.uz) || rn2(8))
/* no lightning if not stormy level or too often, even then */
if (!gl.level.flags.stormy || rn2(8))
return;
/* the number of strikes is 8-log2(nstrike) */