From b5cf9fc68435f29c831ebd60b8a2c4cd80f7773f Mon Sep 17 00:00:00 2001 From: Stefan O'Rear Date: Mon, 2 Nov 2009 01:15:51 -0800 Subject: Implement conservation mutations for new DS --- crawl-ref/source/enum.h | 2 ++ crawl-ref/source/mutation.cc | 14 ++++++++++++++ crawl-ref/source/ouch.cc | 15 +++++++++++++++ 3 files changed, 31 insertions(+) (limited to 'crawl-ref') 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) { -- cgit v1.2.3-54-g00ecf