summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2009-10-07 00:37:00 +0200
committerAdam Borowski <kilobyte@angband.pl>2009-10-07 01:32:20 +0200
commitda8bc0fd337ef1dfa043542c2f760e017324bca5 (patch)
tree58597fca5e851474580658faae3901c0bda3686a
parent36868a5a6d3e63816d9e7a2b0bfc15f8c358883d (diff)
downloadcrawl-ref-da8bc0fd337ef1dfa043542c2f760e017324bca5.tar.gz
crawl-ref-da8bc0fd337ef1dfa043542c2f760e017324bca5.zip
Mutagenic fog. Comes from Evaporate and fog generators. (due)
-rw-r--r--crawl-ref/source/beam.cc2
-rw-r--r--crawl-ref/source/cloud.cc22
-rw-r--r--crawl-ref/source/dat/clua/lm_fog.lua4
-rw-r--r--crawl-ref/source/enum.h6
-rw-r--r--crawl-ref/source/monstuff.cc14
-rw-r--r--crawl-ref/source/spells4.cc9
-rw-r--r--crawl-ref/source/view.cc4
7 files changed, 57 insertions, 4 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index c7940d23af..b02b0cd372 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -3209,6 +3209,7 @@ void bolt::affect_place_explosion_clouds()
case BEAM_POTION_GREY_SMOKE:
case BEAM_POTION_BLUE_SMOKE:
case BEAM_POTION_PURP_SMOKE:
+ case BEAM_POTION_MUTAGENIC:
cl_type = beam2cloud(flavour);
break;
@@ -5993,6 +5994,7 @@ std::string beam_type_name(beam_type type)
case BEAM_POTION_BLUE_SMOKE: return("blue smoke");
case BEAM_POTION_PURP_SMOKE: return("purple smoke");
case BEAM_POTION_RANDOM: return("random potion");
+ case BEAM_POTION_MUTAGENIC: return("mutagenic fog");
case BEAM_VISUAL: return("visual effects");
case BEAM_TORMENT_DAMAGE: return("torment damage");
case BEAM_STEAL_FOOD: return("steal food");
diff --git a/crawl-ref/source/cloud.cc b/crawl-ref/source/cloud.cc
index 096907c532..d2c9f5c30b 100644
--- a/crawl-ref/source/cloud.cc
+++ b/crawl-ref/source/cloud.cc
@@ -24,6 +24,7 @@ REVISION("$Rev$");
#include "stuff.h"
#include "terrain.h"
#include "view.h"
+#include "mutation.h"
static int _actual_spread_rate(cloud_type type, int spread_rate)
{
@@ -405,6 +406,8 @@ cloud_type beam2cloud(beam_type flavour)
return CLOUD_MIASMA;
case BEAM_CHAOS:
return CLOUD_CHAOS;
+ case BEAM_POTION_MUTAGENIC:
+ return CLOUD_MUTAGENIC;
case BEAM_RANDOM:
return CLOUD_RANDOM;
}
@@ -427,6 +430,7 @@ beam_type cloud2beam(cloud_type flavour)
case CLOUD_STEAM: return BEAM_STEAM;
case CLOUD_MIASMA: return BEAM_MIASMA;
case CLOUD_CHAOS: return BEAM_CHAOS;
+ case CLOUD_MUTAGENIC: return BEAM_POTION_MUTAGENIC;
case CLOUD_RANDOM: return BEAM_RANDOM;
}
}
@@ -679,6 +683,20 @@ void in_a_cloud()
ouch(hurted, cl, KILLED_BY_CLOUD, "foul pestilence");
break;
+ case CLOUD_MUTAGENIC:
+ mpr("You are engulfed in a mutagenic fog!");
+
+ if (coinflip()) {
+ mpr("Strange energies course through your body.");
+ if (one_chance_in(3))
+ you.mutate();
+ else
+ {
+ give_bad_mutation();
+ }
+ }
+ break;
+
default:
break;
}
@@ -709,6 +727,8 @@ bool is_damaging_cloud(cloud_type type, bool temp)
return (player_res_steam(false, temp) <= 0);
case CLOUD_MIASMA:
return (player_res_rotting());
+ case CLOUD_MUTAGENIC:
+ return (you.can_mutate());
default:
// Smoke, never harmful.
@@ -761,6 +781,8 @@ std::string cloud_name(cloud_type type)
return "thin mist";
case CLOUD_CHAOS:
return "seething chaos";
+ case CLOUD_MUTAGENIC:
+ return "mutagenic fog";
default:
return "buggy goodness";
}
diff --git a/crawl-ref/source/dat/clua/lm_fog.lua b/crawl-ref/source/dat/clua/lm_fog.lua
index 6fe49c6d66..4f1ad793e1 100644
--- a/crawl-ref/source/dat/clua/lm_fog.lua
+++ b/crawl-ref/source/dat/clua/lm_fog.lua
@@ -21,8 +21,8 @@
--
-- cloud_type: The name of the cloud type to use. Possible cloud types are:
-- flame, noxious fumes, freezing vapour, poison gases,
--- grey smoke, blue smoke, purple smoke, steam,
--- foul pestilence, black smoke, thin mist (the default).
+-- grey smoke, blue smoke, purple smoke, steam,
+-- foul pestilence, black smoke, mutagenic fog, thin mist (the default).
-- walk_dist: The distance to move over the course of one random walk.
-- defaults to 0.
-- pow_min: The minimum "power" (lifetime) of each cloud; defaults to 1.
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index adfef29372..c259776753 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -259,6 +259,7 @@ enum beam_type // beam[].flavour
BEAM_POTION_GREY_SMOKE,
BEAM_POTION_BLUE_SMOKE, // 55
BEAM_POTION_PURP_SMOKE,
+ BEAM_POTION_MUTAGENIC,
BEAM_POTION_RANDOM,
BEAM_LAST_REAL = BEAM_POTION_RANDOM,
@@ -266,9 +267,9 @@ enum beam_type // beam[].flavour
// For getting the visual effect of a beam.
BEAM_VISUAL,
- BEAM_TORMENT_DAMAGE, // Pseudo-beam for damage flavour.
+ BEAM_TORMENT_DAMAGE, // 60: Pseudo-beam for damage flavour.
BEAM_FIRST_PSEUDO = BEAM_TORMENT_DAMAGE,
- BEAM_STEAL_FOOD, // 60: Pseudo-beam for harpies stealing food.
+ BEAM_STEAL_FOOD, // Pseudo-beam for harpies stealing food.
NUM_BEAMS
};
@@ -432,6 +433,7 @@ enum cloud_type
CLOUD_MIASMA,
CLOUD_MIST,
CLOUD_CHAOS,
+ CLOUD_MUTAGENIC,
CLOUD_RANDOM = 98,
CLOUD_DEBUGGING = 99 // 99: used once as 'nonexistent cloud' {dlb}
};
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index a33935676a..bb2c797f5b 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -9404,6 +9404,20 @@ static void _mons_in_cloud(monsters *monster)
hurted += (10 * random2avg(12, 3)) / speed; // 3
break;
+ case CLOUD_MUTAGENIC:
+ simple_monster_message(monster, " is engulfed in a mutagenic fog!");
+
+ // Will only polymorph a monster if they're not magic immune, can
+ // mutate, aren't res asphyx, and pass the same check as meph cloud.
+ if (monster->can_mutate() && !mons_immune_magic(monster)
+ && 1 + random2(27) >= monster->hit_dice
+ && !mons_res_asphyx(monster))
+ {
+ if (monster->mutate())
+ wake = true;
+ }
+ break;
+
default: // 'harmless' clouds -- colored smoke, etc {dlb}.
return;
}
diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc
index 397474f187..6c3652c025 100644
--- a/crawl-ref/source/spells4.cc
+++ b/crawl-ref/source/spells4.cc
@@ -1131,6 +1131,15 @@ bool cast_evaporate(int pow, bolt& beem, int pot_idx)
break;
case POT_MUTATION:
+ // Maybe we'll get a mutagenic cloud.
+ if (coinflip())
+ {
+ beem.effect_known = true;
+ tracer_flavour = beem.flavour = BEAM_POTION_MUTAGENIC;
+ break;
+ }
+ // if not, deliberate fall through for something random
+
case POT_GAIN_STRENGTH:
case POT_GAIN_DEXTERITY:
case POT_GAIN_INTELLIGENCE:
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index f939f4a6a2..c41dc758ef 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -1701,6 +1701,10 @@ inline static void _update_cloud_grid(int cloudno)
which_colour = ETC_RANDOM;
break;
+ case CLOUD_MUTAGENIC:
+ which_colour = ETC_MUTAGENIC;
+ break;
+
default:
which_colour = LIGHTGREY;
break;