diff options
author | David Lawrence Ramsey <dolorous@users.sourceforge.net> | 2009-10-06 19:10:24 -0500 |
---|---|---|
committer | David Lawrence Ramsey <dolorous@users.sourceforge.net> | 2009-10-06 19:10:24 -0500 |
commit | 26ca2cac760a75dc931ee3a9ad9135f785e111c4 (patch) | |
tree | 28395d1231530aea3146f86a35dacbdd47a5af9c /crawl-ref | |
parent | 2e5693e1512e177ba243407079be050d8000b023 (diff) | |
parent | da8bc0fd337ef1dfa043542c2f760e017324bca5 (diff) | |
download | crawl-ref-26ca2cac760a75dc931ee3a9ad9135f785e111c4.tar.gz crawl-ref-26ca2cac760a75dc931ee3a9ad9135f785e111c4.zip |
Merge branch 'master' of ssh://crawl-ref.git.sourceforge.net/gitroot/crawl-ref/crawl-ref
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/beam.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/cloud.cc | 22 | ||||
-rw-r--r-- | crawl-ref/source/dat/clua/lm_fog.lua | 4 | ||||
-rw-r--r-- | crawl-ref/source/enum.h | 6 | ||||
-rw-r--r-- | crawl-ref/source/items.cc | 22 | ||||
-rw-r--r-- | crawl-ref/source/items.h | 5 | ||||
-rw-r--r-- | crawl-ref/source/monstuff.cc | 14 | ||||
-rw-r--r-- | crawl-ref/source/spells4.cc | 9 | ||||
-rw-r--r-- | crawl-ref/source/view.cc | 4 |
9 files changed, 77 insertions, 11 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/items.cc b/crawl-ref/source/items.cc index 66453cda37..d6bcc32ed1 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -1304,7 +1304,7 @@ unsigned long ident_flags(const item_def &item) return (flags); } -bool items_similar(const item_def &item1, const item_def &item2) +bool items_similar(const item_def &item1, const item_def &item2, bool ignore_ident) { // Base and sub-types must always be the same to stack. if (item1.base_type != item2.base_type || item1.sub_type != item2.sub_type) @@ -1327,7 +1327,7 @@ bool items_similar(const item_def &item1, const item_def &item2) } // Check the ID flags. - if (ident_flags(item1) != ident_flags(item2)) + if (!ignore_ident && ident_flags(item1) != ident_flags(item2)) return (false); // Check the non-ID flags, but ignore dropped, thrown, cosmetic, @@ -1364,7 +1364,7 @@ bool items_similar(const item_def &item1, const item_def &item2) } bool items_stack( const item_def &item1, const item_def &item2, - bool force_merge ) + bool force_merge, bool ignore_ident ) { // Both items must be stackable. if (!force_merge @@ -1373,7 +1373,7 @@ bool items_stack( const item_def &item1, const item_def &item2, return (false); } - return items_similar(item1, item2); + return items_similar(item1, item2, ignore_ident); } void merge_item_stacks(item_def &source, item_def &dest, int quant) @@ -1542,7 +1542,7 @@ int move_item_to_player( int obj, int quant_got, bool quiet, { for (int m = 0; m < ENDOFPACK; m++) { - if (items_stack( you.inv[m], mitm[obj] )) + if (items_stack( you.inv[m], mitm[obj], false, true )) { if (!quiet && partial_pickup) mpr("You can only carry some of what is here."); @@ -1577,6 +1577,18 @@ int move_item_to_player( int obj, int quant_got, bool quiet, "god gift", ""); } + // If only one of the stacks is identified, + // identify the other to a similar extent. + if (ident_flags(mitm[obj]) != ident_flags(you.inv[m])) + { + if (!quiet) + mpr("These items seem quite similar!"); + mitm[obj].flags |= + ident_flags(you.inv[m]) & you.inv[m].flags; + you.inv[m].flags |= + ident_flags(mitm[obj]) & mitm[obj].flags; + } + merge_item_stacks(mitm[obj], you.inv[m], quant_got); inc_inv_item_quantity( m, quant_got ); diff --git a/crawl-ref/source/items.h b/crawl-ref/source/items.h index 81be53d8a9..fc33f88062 100644 --- a/crawl-ref/source/items.h +++ b/crawl-ref/source/items.h @@ -42,9 +42,10 @@ int move_item_to_player( int obj, int quant_got, bool quiet = false, bool ignore_burden = false ); void mark_items_non_pickup_at(const coord_def &pos); bool is_stackable_item( const item_def &item ); -bool items_similar( const item_def &item1, const item_def &item2 ); +bool items_similar( const item_def &item1, const item_def &item2, + bool ignore_ident = false ); bool items_stack( const item_def &item1, const item_def &item2, - bool force_merge = false ); + bool force_merge = false, bool ignore_ident = false ); void merge_item_stacks(item_def &source, item_def &dest, int quant = -1); 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; |