diff options
-rw-r--r-- | crawl-ref/source/acquire.cc | 5 | ||||
-rw-r--r-- | crawl-ref/source/food.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/mutation.cc | 16 | ||||
-rw-r--r-- | crawl-ref/source/output.cc | 3 | ||||
-rw-r--r-- | crawl-ref/source/player.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/tags.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/wiz-you.cc | 2 |
7 files changed, 17 insertions, 21 deletions
diff --git a/crawl-ref/source/acquire.cc b/crawl-ref/source/acquire.cc index fbc0a5a1b4..cd4d9ba8ca 100644 --- a/crawl-ref/source/acquire.cc +++ b/crawl-ref/source/acquire.cc @@ -157,11 +157,8 @@ static armour_type _pick_wearable_armour(const armour_type arm) { // Check for Horns 3 & Antennae 3 - Don't give a cap if those mutation // levels have been reached. - if (player_mutation_level(MUT_HORNS) <= 2 - || player_mutation_level(MUT_ANTENNAE) <= 2) - { + if (you.mutation[MUT_HORNS] <= 2 || you.mutation[MUT_ANTENNAE] <= 2) result = ARM_HAT; - } else result = NUM_ARMOURS; } diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc index f497fe6837..b1dc318f2d 100644 --- a/crawl-ref/source/food.cc +++ b/crawl-ref/source/food.cc @@ -307,7 +307,7 @@ static int _corpse_badness(corpse_effect_type ce, const item_def &item, // themself. int contam = _contamination_ratio(ce); - if (player_mutation_level(MUT_SAPROVOROUS) == 3) + if (you.mutation[MUT_SAPROVOROUS] == 3) contam = -contam; // Arbitrarily lower the value of poisonous chunks: swapping resistances @@ -2447,7 +2447,7 @@ bool drop_spoiled_chunks() } bool rotten = food_is_rotten(item); - if (rotten && !player_mutation_level(MUT_SAPROVOROUS) && !wants_any) + if (rotten && !you.mutation[MUT_SAPROVOROUS] && !wants_any) return drop_item(slot, item.quantity); corpse_effect_type ce = _determine_chunk_effect(mons_corpse_effect( diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc index 49f24fa329..8df9f3427f 100644 --- a/crawl-ref/source/mutation.cc +++ b/crawl-ref/source/mutation.cc @@ -953,7 +953,7 @@ static bool _accept_mutation(mutation_type mutat, bool ignore_rarity = false) const mutation_def& mdef = get_mutation_def(mutat); - if (player_mutation_level(mutat) >= mdef.levels) + if (you.mutation[mutat] >= mdef.levels) return false; if (ignore_rarity) @@ -1536,7 +1536,7 @@ bool mutate(mutation_type which_mutation, const string &reason, bool failMsg, const mutation_def& mdef = get_mutation_def(mutat); - if (player_mutation_level(mutat) >= mdef.levels) + if (you.mutation[mutat] >= mdef.levels) { bool found = false; if (you.species == SP_DEMONSPAWN) @@ -1645,13 +1645,13 @@ bool mutate(mutation_type which_mutation, const string &reason, bool failMsg, case MUT_HOOVES: case MUT_TALONS: // Hooves and talons force boots off at 3. - if (player_mutation_level(mutat) >= 3 && !you.melded[EQ_BOOTS]) + if (you.mutation[mutat] >= 3 && !you.melded[EQ_BOOTS]) remove_one_equip(EQ_BOOTS, false, true); break; case MUT_CLAWS: // Claws force gloves off at 3. - if (player_mutation_level(mutat) >= 3 && !you.melded[EQ_GLOVES]) + if (you.mutation[mutat] >= 3 && !you.melded[EQ_GLOVES]) remove_one_equip(EQ_GLOVES, false, true); break; @@ -1660,7 +1660,7 @@ bool mutate(mutation_type which_mutation, const string &reason, bool failMsg, // Horns & Antennae 3 removes all headgear. Same algorithm as with // glove removal. - if (player_mutation_level(mutat) >= 3 && !you.melded[EQ_HELMET]) + if (you.mutation[mutat] >= 3 && !you.melded[EQ_HELMET]) remove_one_equip(EQ_HELMET, false, true); // Intentional fall-through case MUT_BEAK: @@ -1730,7 +1730,7 @@ static bool _delete_single_mutation_level(mutation_type mutat, const string &reason, bool transient = false) { - if (player_mutation_level(mutat) == 0) + if (you.mutation[mutat] == 0) return false; if (you.innate_mutation[mutat] >= you.mutation[mutat]) @@ -1852,7 +1852,7 @@ bool delete_mutation(mutation_type which_mutation, const string &reason, mutat = static_cast<mutation_type>(random2(NUM_MUTATIONS)); - if (player_mutation_level(mutat) == 0 + if (you.mutation[mutat] == 0 && mutat != MUT_STRONG && mutat != MUT_CLEVER && mutat != MUT_AGILE @@ -2374,7 +2374,7 @@ bool perma_mutate(mutation_type which_mut, int how_much, const string &reason) while (how_much-- > 0) { dprf("Perma Mutate: %d, %d, %d", cap, you.mutation[which_mut], you.innate_mutation[which_mut]); - if (player_mutation_level(which_mut) == cap + if (you.mutation[which_mut] == cap && you.innate_mutation[which_mut] > 0 && you.innate_mutation[which_mut] == cap-1) { diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc index dd91f25ead..a69ceeed15 100644 --- a/crawl-ref/source/output.cc +++ b/crawl-ref/source/output.cc @@ -2683,8 +2683,7 @@ static string _status_mut_abilities(int sw) string current; for (unsigned i = 0; i < NUM_MUTATIONS; ++i) { - mutation_type mut = static_cast<mutation_type>(i); - if (!player_mutation_level(mut)) + if (!you.mutation[i]) continue; int level = player_mutation_level((mutation_type) i); diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index fc5d14e973..e052c6df1a 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -152,7 +152,7 @@ bool check_moveto_cloud(const coord_def& p, const string &move_verb, threshold = threshold * 3 / 2; threshold = threshold * you.time_taken / BASELINE_DELAY; // Do prompt if we'd lose icemail, though. - if (you.hp > threshold && !player_mutation_level(MUT_ICEMAIL)) + if (you.hp > threshold && !you.mutation[MUT_ICEMAIL]) return true; } @@ -6325,7 +6325,7 @@ int player::skill(skill_type sk, int scale, bool real, bool drained) const int player_icemail_armour_class() { - if (!player_mutation_level(MUT_ICEMAIL)) + if (!you.mutation[MUT_ICEMAIL]) return 0; return you.duration[DUR_ICEMAIL_DEPLETED] ? 0 : ICEMAIL_MAX; diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc index 1c92431229..760737843f 100644 --- a/crawl-ref/source/tags.cc +++ b/crawl-ref/source/tags.cc @@ -2550,11 +2550,11 @@ static void tag_read_you(reader &th) // was, so when TAG_MINOR_NO_DEVICE_HEAL was added // these were all moved to only apply to previous // tags. - if (player_mutation_level(MUT_TELEPORT_CONTROL) == 1) + if (you.mutation[MUT_TELEPORT_CONTROL] == 1) you.mutation[MUT_TELEPORT_CONTROL] = 0; if (you.mutation[MUT_TRAMPLE_RESISTANCE] > 0) you.mutation[MUT_TRAMPLE_RESISTANCE] = 0; - if (player_mutation_level(MUT_CLING) == 1) + if (you.mutation[MUT_CLING] == 1) you.mutation[MUT_CLING] = 0; if (you.species == SP_GARGOYLE) { diff --git a/crawl-ref/source/wiz-you.cc b/crawl-ref/source/wiz-you.cc index d96aec19b8..e810a8ae15 100644 --- a/crawl-ref/source/wiz-you.cc +++ b/crawl-ref/source/wiz-you.cc @@ -543,7 +543,7 @@ bool wizard_add_mutation() { const char* msg; - if (player_mutation_level(MUT_MUTATION_RESISTANCE) == 3) + if (you.mutation[MUT_MUTATION_RESISTANCE] == 3) msg = "You are immune to mutations; remove immunity?"; else msg = "You are resistant to mutations; remove resistance?"; |