diff options
author | Stefan O'Rear <stefanor@cox.net> | 2009-11-02 01:15:51 -0800 |
---|---|---|
committer | Stefan O'Rear <stefanor@cox.net> | 2009-11-02 01:16:01 -0800 |
commit | b5cf9fc68435f29c831ebd60b8a2c4cd80f7773f (patch) | |
tree | 7aff6a73e7706874888b738b8a4aa177fa1f1d90 | |
parent | 533471df126b96e8b1a06f0baaedd2f1caf015c0 (diff) | |
download | crawl-ref-b5cf9fc68435f29c831ebd60b8a2c4cd80f7773f.tar.gz crawl-ref-b5cf9fc68435f29c831ebd60b8a2c4cd80f7773f.zip |
Implement conservation mutations for new DS
-rw-r--r-- | crawl-ref/source/enum.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/mutation.cc | 14 | ||||
-rw-r--r-- | crawl-ref/source/ouch.cc | 15 |
3 files changed, 31 insertions, 0 deletions
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index 59e4ec48fe..0b9eb03319 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -2418,6 +2418,8 @@ enum mutation_type MUT_STOCHASTIC_TORMENT_RESISTANCE, MUT_PASSIVE_MAPPING, MUT_ICEMAIL, + MUT_CONSERVE_SCROLLS, + MUT_CONSERVE_POTIONS, NUM_MUTATIONS, RANDOM_MUTATION = 100, diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc index 8ba260a302..959dcddf53 100644 --- a/crawl-ref/source/mutation.cc +++ b/crawl-ref/source/mutation.cc @@ -1218,6 +1218,20 @@ mutation_def mutation_defs[] = { {"", "", ""}, "icemail" }, + + { MUT_CONSERVE_SCROLLS, 0, 1, false, false, + {"You are very good at protecting items from fire.", "", ""}, + {"You feel less concerned about heat.", "", ""}, + {"", "", ""}, + "conserve scrolls", + }, + + { MUT_CONSERVE_POTIONS, 0, 1, false, false, + {"You are very good at protecting items from cold.", "", ""}, + {"You feel less concerned about cold.", "", ""}, + {"", "", ""}, + "conserve scrolls", + }, }; const mutation_def& get_mutation_def(mutation_type mut) diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc index 8a06b6357e..96f806bbfc 100644 --- a/crawl-ref/source/ouch.cc +++ b/crawl-ref/source/ouch.cc @@ -456,6 +456,21 @@ static bool _expose_invent_to_element(beam_type flavour, int strength) continue; } + // These stack with conservation; they're supposed to be good. + if (target_class == OBJ_SCROLLS + && you.mutation[MUT_CONSERVE_SCROLLS] + && !one_chance_in(10)) + { + continue; + } + + if (target_class == OBJ_POTIONS + && you.mutation[MUT_CONSERVE_POTIONS] + && !one_chance_in(10)) + { + continue; + } + // Loop through all items in the stack. for (int j = 0; j < you.inv[i].quantity; ++j) { |