From 400f2b68e5b68aae60af8465a9f5a5f07b05e714 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Tue, 15 Apr 2008 18:40:14 +0000 Subject: Allow vampires to mutate when Satiated or higher, and make non-physical mutations only apply at these hunger levels, too. Differentiated mutations into physical (affecting a character's appearance and stuff: scales, hooves, wings, ...) and internal (resistances etc.). I guess this is what people usually refer to as "cosmetic", which I think is an inaccurate description since it makes it sound like they were completely superficial and had no real effect. Here's a list of arbitrarily chosen "physical" mutations: * tough skin, all scales, and fur * strong/clever/agile, and weak/dopey/clumsy * deformed * strong but stiff, and flexible but weak * frail, and robust * claws, fangs, hooves, talons, and horns * stinger, wings * blue/green marks Mutations currently not applying are still listed on the 'A' screen, though in darkgrey and in (brackets). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4246 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/abl-show.cc | 62 +++---- crawl-ref/source/acr.cc | 10 +- crawl-ref/source/beam.cc | 13 +- crawl-ref/source/chardump.cc | 2 - crawl-ref/source/clua.cc | 2 +- crawl-ref/source/debug.cc | 13 +- crawl-ref/source/decks.cc | 1 + crawl-ref/source/delay.cc | 11 +- crawl-ref/source/describe.cc | 8 +- crawl-ref/source/effects.cc | 16 +- crawl-ref/source/fight.cc | 35 ++-- crawl-ref/source/food.cc | 36 ++--- crawl-ref/source/invent.cc | 2 +- crawl-ref/source/it_use2.cc | 23 +-- crawl-ref/source/it_use3.cc | 52 +++--- crawl-ref/source/item_use.cc | 14 +- crawl-ref/source/itemprop.cc | 212 ++++++++++++------------ crawl-ref/source/monstuff.cc | 2 +- crawl-ref/source/mutation.cc | 373 ++++++++++++++++++++++++------------------- crawl-ref/source/mutation.h | 3 + crawl-ref/source/newgame.cc | 34 ++-- crawl-ref/source/output.cc | 13 +- crawl-ref/source/player.cc | 199 ++++++++++++----------- crawl-ref/source/player.h | 2 + crawl-ref/source/shopping.cc | 48 +++--- crawl-ref/source/skills2.cc | 61 +++---- crawl-ref/source/spells4.cc | 3 +- crawl-ref/source/spl-book.cc | 6 +- crawl-ref/source/spl-cast.cc | 2 +- crawl-ref/source/stuff.cc | 10 +- crawl-ref/source/tags.cc | 2 +- crawl-ref/source/tile1.cc | 2 +- crawl-ref/source/tile2.cc | 11 +- crawl-ref/source/transfor.cc | 2 +- crawl-ref/source/view.cc | 12 +- 35 files changed, 700 insertions(+), 597 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc index 5647cde72c..7128a544a9 100644 --- a/crawl-ref/source/abl-show.cc +++ b/crawl-ref/source/abl-show.cc @@ -482,7 +482,7 @@ static talent _get_talent(ability_type ability, bool check_confused) // begin species abilities - some are mutagenic, too {dlb} case ABIL_SPIT_POISON: failure = ((you.species == SP_NAGA) ? 20 : 40) - - 10 * you.mutation[MUT_SPIT_POISON] + - 10 * player_mutation_level(MUT_SPIT_POISON) - you.experience_level; break; @@ -491,12 +491,13 @@ static talent _get_talent(ability_type ability, bool check_confused) break; case ABIL_MAPPING: - failure = 40 - 10 * you.mutation[MUT_MAPPING] - you.experience_level; + failure = 40 - 10 * player_mutation_level(MUT_MAPPING) + - you.experience_level; break; case ABIL_BREATHE_FIRE: failure = ((you.species == SP_RED_DRACONIAN) ? 30 : 50) - - 10 * you.mutation[MUT_BREATHE_FLAMES] + - 10 * player_mutation_level(MUT_BREATHE_FLAMES) - you.experience_level; if (you.attribute[ATTR_TRANSFORMATION] == TRAN_DRAGON) @@ -572,11 +573,12 @@ static talent _get_talent(ability_type ability, bool check_confused) break; case ABIL_BLINK: - failure = 30 - (10 * you.mutation[MUT_BLINK]) - you.experience_level; + failure = 30 - (10 * player_mutation_level(MUT_BLINK)) + - you.experience_level; break; case ABIL_TELEPORTATION: - failure = ((you.mutation[MUT_TELEPORT_AT_WILL] > 1) ? 30 : 50) + failure = ((player_mutation_level(MUT_TELEPORT_AT_WILL) > 1) ? 30 : 50) - you.experience_level; break; // end demonic powers {dlb} @@ -1050,7 +1052,7 @@ static bool _do_ability(const ability_def& abil) zapping( ZAP_SPIT_POISON, you.experience_level - + you.mutation[MUT_SPIT_POISON] * 5 + + player_mutation_level(MUT_SPIT_POISON) * 5 + (you.species == SP_NAGA) * 10, beam ); @@ -1060,7 +1062,8 @@ static bool _do_ability(const ability_def& abil) case ABIL_EVOKE_MAPPING: // randarts case ABIL_MAPPING: // Gnome + sense surrounds mut - if (abil.ability == ABIL_MAPPING && you.mutation[MUT_MAPPING] < 3 + if (abil.ability == ABIL_MAPPING + && player_mutation_level(MUT_MAPPING) < 3 && (you.level_type == LEVEL_PANDEMONIUM || you.level_type == LEVEL_LABYRINTH)) { @@ -1073,7 +1076,7 @@ static bool _do_ability(const ability_def& abil) if ( magic_mapping( 3 + roll_dice( 2, (abil.ability == ABIL_EVOKE_MAPPING) ? power : - power + you.mutation[MUT_MAPPING] * 10), + power + player_mutation_level(MUT_MAPPING) * 10), 40 + roll_dice( 2, power), true) ) { mpr("You sense your surroundings."); @@ -1087,7 +1090,7 @@ static bool _do_ability(const ability_def& abil) case ABIL_EVOKE_TELEPORTATION: // ring of teleportation case ABIL_TELEPORTATION: // teleport mut - if (you.mutation[MUT_TELEPORT_AT_WILL] == 3) + if (player_mutation_level(MUT_TELEPORT_AT_WILL) == 3) you_teleport_now( true, true ); // instant and to new area of Abyss else you_teleport(); @@ -1119,7 +1122,7 @@ static bool _do_ability(const ability_def& abil) { case ABIL_BREATHE_FIRE: power = you.experience_level; - power += you.mutation[MUT_BREATHE_FLAMES] * 4; + power += player_mutation_level(MUT_BREATHE_FLAMES) * 4; if (you.attribute[ATTR_TRANSFORMATION] == TRAN_DRAGON) power += 12; @@ -1987,10 +1990,10 @@ std::vector your_talents( bool check_confused ) if (you.species == SP_NAGA) { - _add_talent(talents, you.mutation[MUT_BREATHE_POISON] ? + _add_talent(talents, player_mutation_level(MUT_BREATHE_POISON) ? ABIL_BREATHE_POISON : ABIL_SPIT_POISON, check_confused); } - else if (you.mutation[MUT_SPIT_POISON]) + else if (player_mutation_level(MUT_SPIT_POISON)) _add_talent(talents, ABIL_SPIT_POISON, check_confused ); if (player_genus(GENPC_DRACONIAN)) @@ -2026,54 +2029,57 @@ std::vector your_talents( bool check_confused ) //jmf: "upgrade" for draconians -- expensive flight if (you.species == SP_KENKU && you.experience_level >= 5) _add_talent(talents, ABIL_FLY, check_confused ); - else if (player_genus(GENPC_DRACONIAN) && you.mutation[MUT_BIG_WINGS]) + else if (player_genus(GENPC_DRACONIAN) + && player_mutation_level(MUT_BIG_WINGS)) + { _add_talent(talents, ABIL_FLY_II, check_confused ); + } } // Mutations - if (you.mutation[MUT_MAPPING]) + if (player_mutation_level(MUT_MAPPING)) _add_talent(talents, ABIL_MAPPING, check_confused ); - if (you.mutation[MUT_SUMMON_MINOR_DEMONS]) + if (player_mutation_level(MUT_SUMMON_MINOR_DEMONS)) _add_talent(talents, ABIL_SUMMON_MINOR_DEMON, check_confused ); - if (you.mutation[MUT_SUMMON_DEMONS]) + if (player_mutation_level(MUT_SUMMON_DEMONS)) _add_talent(talents, ABIL_SUMMON_DEMONS, check_confused ); - if (you.mutation[MUT_HURL_HELLFIRE]) + if (player_mutation_level(MUT_HURL_HELLFIRE)) _add_talent(talents, ABIL_HELLFIRE, check_confused ); - if (you.mutation[MUT_CALL_TORMENT]) + if (player_mutation_level(MUT_CALL_TORMENT)) _add_talent(talents, ABIL_TORMENT, check_confused ); - if (you.mutation[MUT_RAISE_DEAD]) + if (player_mutation_level(MUT_RAISE_DEAD)) _add_talent(talents, ABIL_RAISE_DEAD, check_confused ); - if (you.mutation[MUT_CONTROL_DEMONS]) + if (player_mutation_level(MUT_CONTROL_DEMONS)) _add_talent(talents, ABIL_CONTROL_DEMON, check_confused ); - if (you.mutation[MUT_PANDEMONIUM]) + if (player_mutation_level(MUT_PANDEMONIUM)) _add_talent(talents, ABIL_TO_PANDEMONIUM, check_confused ); - if (you.mutation[MUT_CHANNEL_HELL]) + if (player_mutation_level(MUT_CHANNEL_HELL)) _add_talent(talents, ABIL_CHANNELING, check_confused ); - if (you.mutation[MUT_THROW_FLAMES]) + if (player_mutation_level(MUT_THROW_FLAMES)) _add_talent(talents, ABIL_THROW_FLAME, check_confused ); - if (you.mutation[MUT_THROW_FROST]) + if (player_mutation_level(MUT_THROW_FROST)) _add_talent(talents, ABIL_THROW_FROST, check_confused ); - if (you.mutation[MUT_SMITE]) + if (player_mutation_level(MUT_SMITE)) _add_talent(talents, ABIL_BOLT_OF_DRAINING, check_confused ); if (you.duration[DUR_TRANSFORMATION]) _add_talent(talents, ABIL_END_TRANSFORMATION, check_confused ); - if (you.mutation[MUT_BLINK]) + if (player_mutation_level(MUT_BLINK)) _add_talent(talents, ABIL_BLINK, check_confused ); - if (you.mutation[MUT_TELEPORT_AT_WILL]) + if (player_mutation_level(MUT_TELEPORT_AT_WILL)) _add_talent(talents, ABIL_TELEPORTATION, check_confused ); // Religious abilities @@ -2111,7 +2117,7 @@ std::vector your_talents( bool check_confused ) _add_talent(talents, ABIL_BREATHE_HELLFIRE, check_confused ); } else if (you.attribute[ATTR_TRANSFORMATION] == TRAN_DRAGON - || you.mutation[MUT_BREATHE_FLAMES]) + || player_mutation_level(MUT_BREATHE_FLAMES)) { _add_talent(talents, ABIL_BREATHE_FIRE, check_confused ); } diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 9233f47165..d7e90007bf 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -2807,9 +2807,9 @@ static void _decrement_durations() { const int chance = 10 + - you.mutation[MUT_BERSERK] * 25 + - (wearing_amulet( AMU_RAGE ) ? 10 : 0) + - (player_has_spell( SPELL_BERSERKER_RAGE ) ? 5 : 0); + player_mutation_level(MUT_BERSERK) * 25 + + (wearing_amulet( AMU_RAGE ) ? 10 : 0) + + (player_has_spell( SPELL_BERSERKER_RAGE ) ? 5 : 0); // Note the beauty of Trog! They get an extra save that's at // the very least 20% and goes up to 100%. @@ -3054,8 +3054,8 @@ static void _world_reacts() run_environment_effects(); - if ( !you.cannot_act() && !you.mutation[MUT_BLURRY_VISION] && - random2(50) < you.skills[SK_TRAPS_DOORS] ) + if ( !you.cannot_act() && !player_mutation_level(MUT_BLURRY_VISION) + && random2(50) < you.skills[SK_TRAPS_DOORS] ) { search_around(false); // check nonadjacent squares too } diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 2942a6de1b..6355144665 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -3217,9 +3217,11 @@ static int _affect_player( bolt &beam ) if (you.duration[DUR_DEFLECT_MISSILES]) beamHit = random2(beamHit * 2) / 3; - else if (you.duration[DUR_REPEL_MISSILES] || - you.mutation[MUT_REPULSION_FIELD] == 3) + else if (you.duration[DUR_REPEL_MISSILES] + || player_mutation_level(MUT_REPULSION_FIELD) == 3) + { beamHit -= random2(beamHit / 2); + } if (!test_beam_hit(beamHit, dodge)) { @@ -3262,10 +3264,11 @@ static int _affect_player( bolt &beam ) if (you.duration[DUR_DEFLECT_MISSILES]) beamHit = random2(beamHit / 2); - else if (you.duration[DUR_REPEL_MISSILES] || - you.mutation[MUT_REPULSION_FIELD] == 3) + else if (you.duration[DUR_REPEL_MISSILES] + || player_mutation_level(MUT_REPULSION_FIELD) == 3) + { beamHit = random2(beamHit); - + } // miss message if (!test_beam_hit(beamHit, dodge)) diff --git a/crawl-ref/source/chardump.cc b/crawl-ref/source/chardump.cc index 02647c1a94..666ce9b8cb 100644 --- a/crawl-ref/source/chardump.cc +++ b/crawl-ref/source/chardump.cc @@ -1097,10 +1097,8 @@ static void sdump_mutations(dump_params &par) int xz = 0; for (int xy = 0; xy < NUM_MUTATIONS; ++xy) - { if (you.mutation[xy] > 0) xz++; - } if (xz > 0) { diff --git a/crawl-ref/source/clua.cc b/crawl-ref/source/clua.cc index 2ed6af6dd4..4bd14e1708 100644 --- a/crawl-ref/source/clua.cc +++ b/crawl-ref/source/clua.cc @@ -745,7 +745,7 @@ LUARET1(you_res_statdrain, number, player_sust_abil(false)) LUARET1(you_res_mutation, number, wearing_amulet(AMU_RESIST_MUTATION, false)) LUARET1(you_res_slowing, number, wearing_amulet(AMU_RESIST_SLOW, false)) LUARET1(you_gourmand, boolean, wearing_amulet(AMU_THE_GOURMAND, false)) -LUARET1(you_saprovorous, number, you.mutation[MUT_SAPROVOROUS]) +LUARET1(you_saprovorous, number, player_mutation_level(MUT_SAPROVOROUS)) LUARET1(you_levitating, boolean, you.flight_mode() == FL_LEVITATE) LUARET1(you_flying, boolean, you.flight_mode() == FL_FLY) LUARET1(you_transform, string, transform_name()) diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc index 75c5944b4f..f70889b35e 100644 --- a/crawl-ref/source/debug.cc +++ b/crawl-ref/source/debug.cc @@ -2320,8 +2320,8 @@ bool debug_add_mutation(void) return (false); } - if (you.mutation[MUT_MUTATION_RESISTANCE] > 0 && - !crawl_state.is_replaying_keys()) + if (player_mutation_level(MUT_MUTATION_RESISTANCE) > 0 + && !crawl_state.is_replaying_keys()) { const char* msg; @@ -2339,7 +2339,7 @@ bool debug_add_mutation(void) bool force = yesno("Force mutation to happen?", true, 'n'); - if (you.mutation[MUT_MUTATION_RESISTANCE] == 3 && !force) + if (player_mutation_level(MUT_MUTATION_RESISTANCE) == 3 && !force) { mpr("Can't mutate when immune to mutations without forcing it."); crawl_state.cancel_cmd_repeat(); @@ -2357,13 +2357,16 @@ bool debug_add_mutation(void) if (strcasecmp(specs, "any") == 0) { - int old_resist = you.mutation[MUT_MUTATION_RESISTANCE]; + int old_resist = player_mutation_level(MUT_MUTATION_RESISTANCE); success = mutate(RANDOM_MUTATION, true, force); - if (old_resist < you.mutation[MUT_MUTATION_RESISTANCE] && !force) + if (old_resist < player_mutation_level(MUT_MUTATION_RESISTANCE) + && !force) + { crawl_state.cancel_cmd_repeat("Your mutation resistance has " "increased."); + } return (success); } diff --git a/crawl-ref/source/decks.cc b/crawl-ref/source/decks.cc index e14fb359e8..b95b8c68fe 100644 --- a/crawl-ref/source/decks.cc +++ b/crawl-ref/source/decks.cc @@ -2006,6 +2006,7 @@ bool _has_bad_mutation() for ( unsigned int i = 0; i < ARRAYSIZE(bad_mutations); ++i ) if (you.mutation[bad_mutations[i]] > you.demon_pow[bad_mutations[i]]) return true; + return false; } diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index f04237ba07..7f3a44eb77 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -610,7 +610,7 @@ void handle_delay( void ) if (mitm[ delay.parm1 ].sub_type == CORPSE_SKELETON) { mpr("The corpse rots away into a skeleton!"); - if (you.mutation[MUT_SAPROVOROUS] == 3) + if (player_mutation_level(MUT_SAPROVOROUS) == 3) xom_check_corpse_waste(); else xom_is_stimulated(32); @@ -626,7 +626,7 @@ void handle_delay( void ) delay.parm2 = 99; // don't give the message twice if (you.is_undead != US_UNDEAD - && you.mutation[MUT_SAPROVOROUS] < 3) + && player_mutation_level(MUT_SAPROVOROUS) < 3) { xom_check_corpse_waste(); } @@ -886,7 +886,7 @@ static void finish_delay(const delay_queue_item &delay) ? "bottling its blood" : "butchering"); - if (you.mutation[MUT_SAPROVOROUS] == 3) + if (player_mutation_level(MUT_SAPROVOROUS) == 3) xom_check_corpse_waste(); else xom_is_stimulated(64); @@ -901,7 +901,8 @@ static void finish_delay(const delay_queue_item &delay) else { mprf("You finish %s the corpse into pieces.", - (you.has_usable_claws() || you.mutation[MUT_FANGS] == 3) ? + (you.has_usable_claws() + || player_mutation_level(MUT_FANGS) == 3) ? "ripping" : "chopping"); if (is_good_god(you.religion) && is_player_same_species(item.plus)) @@ -1052,7 +1053,7 @@ static void armour_wear_effects(const int item_slot) { case SPARM_RUNNING: mprf("You feel quick%s.", - (you.species == SP_NAGA || you.mutation[MUT_HOOVES]) + (you.species == SP_NAGA || player_mutation_level(MUT_HOOVES)) ? "" : " on your feet"); break; diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index 6265445d16..aa4530e46a 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -658,7 +658,7 @@ static std::string _describe_demon(const monsters &mons) break; case 2: description << " It smells like rotting flesh" - << (you.mutation[MUT_SAPROVOROUS] == 3 ? + << (player_mutation_level(MUT_SAPROVOROUS) == 3 ? " - yum!" : "."); break; } @@ -1594,7 +1594,7 @@ std::string get_item_description( const item_def &item, bool verbose, { if (food_is_rotten(item)) { - if (you.mutation[MUT_SAPROVOROUS] == 3) + if (player_mutation_level(MUT_SAPROVOROUS) == 3) description << "It looks nice and ripe."; else if (you.is_undead != US_UNDEAD) { @@ -1603,7 +1603,7 @@ std::string get_item_description( const item_def &item, bool verbose, "Eating it would probably be unwise."; } } - else if (you.mutation[MUT_SAPROVOROUS] < 3) + else if (player_mutation_level(MUT_SAPROVOROUS) < 3) description << "It looks rather unpleasant."; description << "$"; @@ -2091,7 +2091,7 @@ void describe_monsters(monsters& mons) case MONS_ROTTING_DEVIL: if (player_can_smell()) { - if (you.mutation[MUT_SAPROVOROUS] == 3) + if (player_mutation_level(MUT_SAPROVOROUS) == 3) description << "It smells great!"; else description << "It stinks."; diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc index dfb511fa63..c93291bf89 100644 --- a/crawl-ref/source/effects.cc +++ b/crawl-ref/source/effects.cc @@ -815,7 +815,7 @@ static int find_acquirement_subtype(object_class_type class_wanted, // about special cases for carnivorous races (e.g. kobolds) type_wanted = FOOD_MEAT_RATION; - if (you.mutation[MUT_HERBIVOROUS]) + if (player_mutation_level(MUT_HERBIVOROUS)) type_wanted = FOOD_BREAD_RATION; // If we have some regular rations, then we're probably more @@ -1022,6 +1022,8 @@ static int find_acquirement_subtype(object_class_type class_wanted, // Do this here, before acquirement()'s call to can_wear_armour(), // so that caps will be just as common as helmets for those // that can't wear helmets. + // We could use player_mutation_level for the horns, but let's just + // check for the mutation directly to avoid acquirement fiddles. if (type_wanted == ARM_HELMET && ((you.species >= SP_OGRE && you.species <= SP_OGRE_MAGE) || player_genus(GENPC_DRACONIAN) @@ -2284,7 +2286,9 @@ static void rot_inventory_food(long time_delta) if (player_can_smell() && you.species != SP_TROLL) { int temp_rand = 0; // Grr. - int level = (you.species == SP_VAMPIRE) ? 1 : you.mutation[MUT_SAPROVOROUS]; + int level = player_mutation_level(MUT_SAPROVOROUS); + if (!level && you.species == SP_VAMPIRE) + level = 1; switch (level) { @@ -2388,8 +2392,8 @@ void handle_time( long time_delta ) } // Adjust the player's stats if s/he has the deterioration mutation - if (you.mutation[MUT_DETERIORATION] - && random2(200) <= you.mutation[MUT_DETERIORATION] * 5 - 2) + if (player_mutation_level(MUT_DETERIORATION) + && random2(200) <= player_mutation_level(MUT_DETERIORATION) * 5 - 2) { lose_stat(STAT_RANDOM, 1, false, "deterioration mutation"); } @@ -2568,8 +2572,8 @@ void handle_time( long time_delta ) // jmf: moved huge thing to religion.cc handle_god_time(); - if (you.mutation[MUT_SCREAM] - && (random2(100) <= 2 + you.mutation[MUT_SCREAM] * 3) ) + if (player_mutation_level(MUT_SCREAM) + && (random2(100) <= 2 + player_mutation_level(MUT_SCREAM) * 3) ) { yell(true); } diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 38d5ae0717..80e10471de 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -802,16 +802,16 @@ bool melee_attack::player_aux_unarmed() else uattack = (coinflip() ? UNAT_HEADBUTT : UNAT_KICK); - if (you.mutation[MUT_FANGS] + if (player_mutation_level(MUT_FANGS) || you.attribute[ATTR_TRANSFORMATION] == TRAN_DRAGON) { uattack = UNAT_BITE; } if ((you.attribute[ATTR_TRANSFORMATION] == TRAN_DRAGON - || player_genus(GENPC_DRACONIAN) - || (you.species == SP_MERFOLK && player_is_swimming()) - || you.mutation[ MUT_STINGER ]) + || player_genus(GENPC_DRACONIAN) + || (you.species == SP_MERFOLK && player_is_swimming()) + || player_mutation_level( MUT_STINGER )) && one_chance_in(3)) { uattack = UNAT_TAILSLAP; @@ -838,7 +838,8 @@ bool melee_attack::player_aux_unarmed() { if (uattack != UNAT_KICK) //jmf: hooves mutation { - if (!you.mutation[MUT_HOOVES] && !you.mutation[MUT_TALONS] + if (!player_mutation_level(MUT_HOOVES) + && !player_mutation_level(MUT_TALONS) || coinflip()) { continue; @@ -855,7 +856,7 @@ bool melee_attack::player_aux_unarmed() } // Kenku have large taloned feet that do good damage. - const bool clawed_kick = you.mutation[MUT_TALONS]; + const bool clawed_kick = player_mutation_level(MUT_TALONS); if (clawed_kick) { @@ -865,15 +866,16 @@ bool melee_attack::player_aux_unarmed() else unarmed_attack = "kick"; - aux_damage = (you.mutation[MUT_HOOVES] ? 10 - : clawed_kick ? 8 : 5); + aux_damage = (player_mutation_level(MUT_HOOVES) ? 10 + : clawed_kick ? 8 : 5); break; } case 1: if (uattack != UNAT_HEADBUTT) { - if ((!you.mutation[MUT_HORNS] && you.species != SP_KENKU) + if ((!player_mutation_level(MUT_HORNS) + && you.species != SP_KENKU) || !one_chance_in(3)) { continue; @@ -892,7 +894,7 @@ bool melee_attack::player_aux_unarmed() unarmed_attack = (you.species == SP_KENKU) ? "peck" : "headbutt"; - aux_damage = 5 + you.mutation[MUT_HORNS] * 3; + aux_damage = 5 + player_mutation_level(MUT_HORNS) * 3; // minotaurs used to get +5 damage here, now they get // +6 because of the horns. @@ -918,7 +920,7 @@ bool melee_attack::player_aux_unarmed() // not draconian, and not wet merfolk if ((!player_genus(GENPC_DRACONIAN) && (!(you.species == SP_MERFOLK && player_is_swimming())) - && !you.mutation[ MUT_STINGER ]) + && !player_mutation_level( MUT_STINGER )) || (!one_chance_in(4))) { @@ -936,9 +938,9 @@ bool melee_attack::player_aux_unarmed() unarmed_attack = "tail-slap"; aux_damage = 6; - if (you.mutation[ MUT_STINGER ] > 0) + if (player_mutation_level( MUT_STINGER ) > 0) { - aux_damage += (you.mutation[ MUT_STINGER ] * 2 - 1); + aux_damage += (player_mutation_level( MUT_STINGER ) * 2 - 1); damage_brand = SPWPN_VENOM; } @@ -998,7 +1000,7 @@ bool melee_attack::player_aux_unarmed() if (uattack != UNAT_BITE) continue; - if (!you.mutation[MUT_FANGS]) + if (!player_mutation_level(MUT_FANGS)) continue; if (you.species != SP_VAMPIRE && one_chance_in(5) @@ -1009,7 +1011,8 @@ bool melee_attack::player_aux_unarmed() unarmed_attack = "bite"; simple_miss_message = true; - aux_damage += you.mutation[MUT_FANGS] * 2; + // TODO: Maybe unarmed combat factor in + aux_damage += player_mutation_level(MUT_FANGS) * 2; if (you.species == SP_VAMPIRE) { @@ -2973,7 +2976,7 @@ int melee_attack::player_calc_base_unarmed_damage() else if (you.species == SP_GHOUL) damage += 2; - damage += (you.mutation[ MUT_CLAWS ] * 2); + damage += player_mutation_level(MUT_CLAWS) * 2; } if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT) diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc index 3f7e4b5da1..4e0efe99ab 100644 --- a/crawl-ref/source/food.cc +++ b/crawl-ref/source/food.cc @@ -223,7 +223,7 @@ bool butchery(int which_corpse) // Xom probably likes this, occasionally // Vampires' fangs are optimised for biting, not for tearing flesh. // Other species with this mutation still might benefit from this. - bool teeth_butcher = (you.mutation[MUT_FANGS] == 3 + bool teeth_butcher = (player_mutation_level(MUT_FANGS) == 3 && you.species != SP_VAMPIRE); bool barehand_butcher = (transform_can_butcher_barehanded(transform) @@ -233,8 +233,8 @@ bool butchery(int which_corpse) && !item_cursed(you.inv[you.equip[EQ_GLOVES]])); bool can_butcher = teeth_butcher || barehand_butcher - || you.equip[EQ_WEAPON] != -1 - && can_cut_meat(you.inv[you.equip[EQ_WEAPON]]); + || you.equip[EQ_WEAPON] != -1 + && can_cut_meat(you.inv[you.equip[EQ_WEAPON]]); if (igrd[you.x_pos][you.y_pos] == NON_ITEM) { @@ -742,7 +742,7 @@ static void describe_food_change(int food_increment) static bool prompt_eat_chunk(const item_def &item, bool rotten) { - if (rotten && !you.mutation[MUT_SAPROVOROUS] + if (rotten && !player_mutation_level(MUT_SAPROVOROUS) && !yesno("Are you sure you want to eat this rotten meat?", false, 'n')) { @@ -947,7 +947,7 @@ void chunk_nutrition_message(int nutrition) static int apply_herbivore_chunk_effects(int nutrition) { - int how_herbivorous = you.mutation[MUT_HERBIVOROUS]; + int how_herbivorous = player_mutation_level(MUT_HERBIVOROUS); while (how_herbivorous--) nutrition = nutrition * 80 / 100; @@ -996,7 +996,7 @@ static void eat_chunk( int chunk_effect, bool cannibal, int mon_intel ) { bool likes_chunks = (you.omnivorous() || - you.mutation[MUT_CARNIVOROUS]); + player_mutation_level(MUT_CARNIVOROUS)); int nutrition = chunk_nutrition(likes_chunks); int hp_amt = 0; bool suppress_msg = false; // do we display the chunk nutrition message? @@ -1039,7 +1039,7 @@ static void eat_chunk( int chunk_effect, bool cannibal, int mon_intel ) case CE_ROTTEN: case CE_CONTAMINATED: - if (you.mutation[MUT_SAPROVOROUS] == 3) + if (player_mutation_level(MUT_SAPROVOROUS) == 3) { mprf("This %sflesh tastes delicious!", (chunk_effect == CE_ROTTEN) ? "rotting " : ""); @@ -1059,7 +1059,7 @@ static void eat_chunk( int chunk_effect, bool cannibal, int mon_intel ) case CE_CLEAN: { - if (you.mutation[MUT_SAPROVOROUS] == 3) + if (player_mutation_level(MUT_SAPROVOROUS) == 3) { mpr("This raw flesh tastes good."); @@ -1093,8 +1093,8 @@ static void eating(unsigned char item_class, int item_type) { int temp_rand; // probability determination {dlb} int food_value = 0; - int how_herbivorous = you.mutation[MUT_HERBIVOROUS]; - int how_carnivorous = you.mutation[MUT_CARNIVOROUS]; + int how_herbivorous = player_mutation_level(MUT_HERBIVOROUS); + int how_carnivorous = player_mutation_level(MUT_CARNIVOROUS); int carnivore_modifier = 0; int herbivore_modifier = 0; @@ -1388,16 +1388,16 @@ bool can_ingest(int what_isit, int kindof_thing, bool suppress_msg, bool reqid, return (false); } - bool ur_carnivorous = (you.mutation[MUT_CARNIVOROUS] == 3); + bool ur_carnivorous = (player_mutation_level(MUT_CARNIVOROUS) == 3); - bool ur_herbivorous = (you.mutation[MUT_HERBIVOROUS] == 3); + bool ur_herbivorous = (player_mutation_level(MUT_HERBIVOROUS) == 3); // ur_chunkslover not defined in terms of ur_carnivorous because // a player could be one and not the other IMHO - 13mar2000 {dlb} bool ur_chunkslover = ( (check_hunger? you.hunger_state <= HS_HUNGRY : true) || you.omnivorous() - || you.mutation[MUT_CARNIVOROUS]); + || player_mutation_level(MUT_CARNIVOROUS)); switch (what_isit) { @@ -1568,13 +1568,13 @@ static int determine_chunk_effect(int which_chunk_type, bool rotten_chunk) case CE_CONTAMINATED: if (you.attribute[ATTR_TRANSFORMATION] == TRAN_LICH - && you.mutation[MUT_SAPROVOROUS] < 3) + && player_mutation_level(MUT_SAPROVOROUS) < 3) { this_chunk_effect = CE_CLEAN; } else { - switch (you.mutation[MUT_SAPROVOROUS]) + switch (player_mutation_level(MUT_SAPROVOROUS)) { case 1: if (!one_chance_in(15)) @@ -1624,13 +1624,13 @@ static int determine_chunk_effect(int which_chunk_type, bool rotten_chunk) if (this_chunk_effect == CE_ROTTEN) { if (you.attribute[ATTR_TRANSFORMATION] == TRAN_LICH - && you.mutation[MUT_SAPROVOROUS] < 3) + && player_mutation_level(MUT_SAPROVOROUS) < 3) { this_chunk_effect = CE_CLEAN; } else { - switch (you.mutation[MUT_SAPROVOROUS]) + switch (player_mutation_level(MUT_SAPROVOROUS)) { case 1: if (!one_chance_in(5)) @@ -1655,7 +1655,7 @@ static int determine_chunk_effect(int which_chunk_type, bool rotten_chunk) if (wearing_amulet(AMU_THE_GOURMAND) && random2(GOURMAND_MAX) < you.duration[DUR_GOURMAND]) { - if (you.mutation[MUT_SAPROVOROUS] == 3) + if (player_mutation_level(MUT_SAPROVOROUS) == 3) { // [dshaligram] Level 3 saprovores relish contaminated meat. if (this_chunk_effect == CE_CLEAN) diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc index 31c979aa22..f3f65cdea3 100644 --- a/crawl-ref/source/invent.cc +++ b/crawl-ref/source/invent.cc @@ -160,7 +160,7 @@ const int InvEntry::item_freshness() const int freshness = item->special; - if (freshness >= 100 || you.mutation[MUT_SAPROVOROUS]) + if (freshness >= 100 || player_mutation_level(MUT_SAPROVOROUS)) freshness -= 300; // Ensure that chunk freshness is never zero, since zero means diff --git a/crawl-ref/source/it_use2.cc b/crawl-ref/source/it_use2.cc index f9914847e3..3245babafb 100644 --- a/crawl-ref/source/it_use2.cc +++ b/crawl-ref/source/it_use2.cc @@ -96,7 +96,7 @@ bool potion_effect( potion_type pot_eff, int pow, bool was_known ) mpr("Yummy - fresh blood!"); else // coagulated mpr("This tastes delicious!"); - + lessen_hunger(1000, true); // healing depends on hunger @@ -116,7 +116,7 @@ bool potion_effect( potion_type pot_eff, int pow, bool was_known ) } else { - if (you.omnivorous() || you.mutation[MUT_CARNIVOROUS]) + if (you.omnivorous() || player_mutation_level(MUT_CARNIVOROUS)) { // Likes it mpr("This tastes like blood."); @@ -125,7 +125,7 @@ bool potion_effect( potion_type pot_eff, int pow, bool was_known ) else { mpr("Blech - this tastes like blood!"); - if (!you.mutation[MUT_HERBIVOROUS] && one_chance_in(3)) + if (!player_mutation_level(MUT_HERBIVOROUS) && one_chance_in(3)) lessen_hunger(100, true); else { @@ -144,7 +144,7 @@ bool potion_effect( potion_type pot_eff, int pow, bool was_known ) case POT_MIGHT: { const bool were_mighty = (you.duration[DUR_MIGHT] > 0); - + mprf(MSGCH_DURATION, "You feel %s all of a sudden.", were_mighty ? "mightier" : "very mighty"); @@ -155,7 +155,7 @@ bool potion_effect( potion_type pot_eff, int pow, bool was_known ) // conceivable max gain of +184 {dlb} you.duration[DUR_MIGHT] += (35 + random2(pow)) / factor; - + // files.cc permits values up to 215, but ... {dlb} if (you.duration[DUR_MIGHT] > 80) you.duration[DUR_MIGHT] = 80; @@ -206,7 +206,7 @@ bool potion_effect( potion_type pot_eff, int pow, bool was_known ) mprf("That liquid tasted %s nasty...", (pot_eff == POT_POISON) ? "very" : "extremely" ); - poison_player( ((pot_eff == POT_POISON) ? 1 + random2avg(5, 2) + poison_player( ((pot_eff == POT_POISON) ? 1 + random2avg(5, 2) : 3 + random2avg(13, 2)) ); xom_is_stimulated(128); } @@ -247,7 +247,8 @@ bool potion_effect( potion_type pot_eff, int pow, bool was_known ) break; case POT_PORRIDGE: // oatmeal - always gluggy white/grey? - if (you.species == SP_VAMPIRE || you.mutation[MUT_CARNIVOROUS] == 3) + if (you.species == SP_VAMPIRE + || player_mutation_level(MUT_CARNIVOROUS) == 3) { mpr("Blech - that potion was really gluggy!"); } @@ -353,19 +354,19 @@ bool potion_effect( potion_type pot_eff, int pow, bool was_known ) mpr("You feel extremely strange."); for (int i = 0; i < 3; i++) mutate(RANDOM_MUTATION, false); - + learned_something_new(TUT_YOU_MUTATED); did_god_conduct(DID_DELIBERATE_MUTATING, 10, was_known); did_god_conduct(DID_STIMULANTS, 4 + random2(4), was_known); break; - + case POT_RESISTANCE: mpr("You feel protected."); you.duration[DUR_RESIST_FIRE] += (random2(pow) + 10) / factor; you.duration[DUR_RESIST_COLD] += (random2(pow) + 10) / factor; you.duration[DUR_RESIST_POISON] += (random2(pow) + 10) / factor; you.duration[DUR_INSULATION] += (random2(pow) + 10) / factor; - + // Just one point of contamination. These potions are really rare, // and contamination is nastier. contaminate_player(1, was_known); @@ -384,7 +385,7 @@ bool unwield_item(bool showMsgs) const int unw = you.equip[EQ_WEAPON]; if ( unw == -1 ) return (false); - + if (!safe_to_remove_or_wear(you.inv[unw], true)) return (false); diff --git a/crawl-ref/source/it_use3.cc b/crawl-ref/source/it_use3.cc index 3ce951dc19..fa6ee7194a 100644 --- a/crawl-ref/source/it_use3.cc +++ b/crawl-ref/source/it_use3.cc @@ -76,7 +76,7 @@ void special_wielded() case SPWLD_NOISE: { makes_noise = (one_chance_in(20) && !silenced(you.x_pos, you.y_pos)); - + if (makes_noise) { std::string msg; @@ -101,14 +101,14 @@ void special_wielded() msg = replace_all(msg, "@your_weapon@", "your @weapon@"); } } - + // set appropriate channel (will usually be TALK) msg_channel_type channel = MSGCH_TALK; // disallow anything with VISUAL in it; if (msg != "" && msg.find("VISUAL") != std::string::npos) msg = ""; - + if (msg != "") { std::string param = ""; @@ -138,7 +138,7 @@ void special_wielded() msg = msg.substr(pos + 1); } } - + if (msg == "") // give default noises { if (you.special_wield == SPWLD_SING) @@ -149,7 +149,7 @@ void special_wielded() msg = "You hear a strange noise."; } } - + // replace weapon references msg = replace_all(msg, "@The_weapon@", "The @weapon@"); msg = replace_all(msg, "@the_weapon@", "the @weapon@"); @@ -159,8 +159,8 @@ void special_wielded() } // makes_noise break; - } - + } + case SPWLD_CURSE: if (one_chance_in(30)) curse_an_item(false); @@ -388,7 +388,7 @@ static bool evoke_sceptre_of_asmodeus() summon_any_demon(DEMON_COMMON)); const bool good_summon = (create_monster( mtype, 6, BEH_HOSTILE, - you.x_pos, you.y_pos, + you.x_pos, you.y_pos, MHITYOU, MONS_PROGRAM_BUG) != -1); if (good_summon) @@ -462,7 +462,7 @@ bool evoke_wielded() switch (wpn.special) { case SPWPN_STAFF_OF_DISPATER: - if (you.duration[DUR_DEATHS_DOOR] || !enough_hp(11, true) + if (you.duration[DUR_DEATHS_DOOR] || !enough_hp(11, true) || !enough_mp(5, true)) { break; @@ -490,7 +490,7 @@ bool evoke_wielded() break; case SPWPN_STAFF_OF_OLGREB: - if (!enough_mp( 4, true ) + if (!enough_mp( 4, true ) || you.skills[SK_EVOCATIONS] < random2(6)) { break; @@ -525,7 +525,7 @@ bool evoke_wielded() if (one_chance_in(3)) { - miscast_effect( SPTYP_DIVINATION, random2(9), + miscast_effect( SPTYP_DIVINATION, random2(9), random2(70), 100, "the Staff of Wucad Mu" ); } break; @@ -553,7 +553,7 @@ bool evoke_wielded() } else if (wpn.sub_type == STAFF_CHANNELING) { - if (you.magic_points < you.max_magic_points + if (you.magic_points < you.max_magic_points && you.skills[SK_EVOCATIONS] + 10 >= random2(40)) { mpr("You channel some magical energy."); @@ -569,7 +569,7 @@ bool evoke_wielded() mprf("You are wielding %s.", wpn.name(DESC_NOCAP_A).c_str()); - + more(); you.wield_change = true; @@ -584,7 +584,7 @@ bool evoke_wielded() case OBJ_MISCELLANY: did_work = true; // easier to do it this way for misc items - + if ( is_deck(wpn) ) { evoke_deck(wpn); @@ -687,19 +687,19 @@ bool evoke_wielded() static bool efreet_flask(void) { const beh_type behaviour = - ((you.skills[SK_EVOCATIONS] / 3 + 10 > random2(20)) + ((you.skills[SK_EVOCATIONS] / 3 + 10 > random2(20)) ? BEH_FRIENDLY : BEH_HOSTILE); mpr("You open the flask..."); - const int efreet = create_monster( MONS_EFREET, 0, behaviour, + const int efreet = create_monster( MONS_EFREET, 0, behaviour, you.x_pos, you.y_pos, MHITYOU, MONS_PROGRAM_BUG, false, false, true ); if (efreet != -1) { monsters *mon = &menv[efreet]; - + mpr( "...and a huge efreet comes out." ); player_angers_monster(mon); mpr( (mon->attitude == ATT_FRIENDLY)? @@ -709,7 +709,7 @@ static bool efreet_flask(void) else canned_msg(MSG_NOTHING_HAPPENS); - dec_inv_item_quantity( you.equip[EQ_WEAPON], 1 ); + dec_inv_item_quantity( you.equip[EQ_WEAPON], 1 ); return (true); } // end efreet_flask() @@ -804,8 +804,8 @@ static bool disc_of_storms(void) void tome_of_power(int slot) { - int powc = 5 + you.skills[SK_EVOCATIONS] - + roll_dice( 5, you.skills[SK_EVOCATIONS] ); + int powc = 5 + you.skills[SK_EVOCATIONS] + + roll_dice( 5, you.skills[SK_EVOCATIONS] ); msg::stream << "The book opens to a page covered in " << weird_writing() << '.' << std::endl; @@ -817,15 +817,15 @@ void tome_of_power(int slot) set_ident_flags( you.inv[slot], ISFLAG_KNOW_TYPE ); - if (you.mutation[MUT_BLURRY_VISION] > 0 - && random2(4) < you.mutation[MUT_BLURRY_VISION]) + if (player_mutation_level(MUT_BLURRY_VISION) > 0 + && random2(4) < player_mutation_level(MUT_BLURRY_VISION)) { mpr("The page is too blurry for you to read."); return; } mpr("You find yourself reciting the magical words!"); - exercise( SK_EVOCATIONS, 1 ); + exercise( SK_EVOCATIONS, 1 ); if ( random2(50) < 7 ) { @@ -891,7 +891,7 @@ void tome_of_power(int slot) viewwindow(1, false); int temp_rand = random2(23) + random2(you.skills[SK_EVOCATIONS] / 3); - + if (temp_rand > 25) temp_rand = 25; @@ -964,7 +964,7 @@ static bool box_of_beasts() (temp_rand == 6) ? MONS_YAK : (temp_rand == 7) ? MONS_BUTTERFLY : (temp_rand == 8) ? MONS_HELL_HOUND : - (temp_rand == 9) ? MONS_BROWN_SNAKE + (temp_rand == 9) ? MONS_BROWN_SNAKE : MONS_GIANT_LIZARD); beh_type beh = (one_chance_in(you.skills[SK_EVOCATIONS] + 5) @@ -1023,7 +1023,7 @@ static bool ball_of_energy(void) proportional = you.magic_points * 100; proportional /= you.max_magic_points; - if (random2avg(77 - you.skills[SK_EVOCATIONS] * 2, 4) > proportional + if (random2avg(77 - you.skills[SK_EVOCATIONS] * 2, 4) > proportional || one_chance_in(25)) { mpr( "You feel your power drain away!" ); diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 7cdc352c9c..83df88075c 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -865,14 +865,14 @@ bool can_wear_armour(const item_def &item, bool verbose, bool ignore_temporary) if (sub_type == ARM_BOOTS) { - if (you.mutation[MUT_HOOVES]) + if (player_mutation_level(MUT_HOOVES)) { if (verbose) mpr("You can't wear boots with hooves!"); return (false); } - if (you.mutation[MUT_TALONS]) + if (player_mutation_level(MUT_TALONS)) { if (verbose) mpr("Boots don't fit your talons!"); @@ -915,7 +915,7 @@ bool can_wear_armour(const item_def &item, bool verbose, bool ignore_temporary) if (!is_hard_helmet( item )) return (true); - if (you.mutation[MUT_HORNS]) + if (player_mutation_level(MUT_HORNS)) { if (verbose) mpr("You can't wear that with your horns!"); @@ -4076,10 +4076,10 @@ void read_scroll( int slot ) you.turn_is_over = true; // imperfect vision prevents players from reading actual content {dlb}: - if (you.mutation[MUT_BLURRY_VISION] - && random2(5) < you.mutation[MUT_BLURRY_VISION]) + if (player_mutation_level(MUT_BLURRY_VISION) + && random2(5) < player_mutation_level(MUT_BLURRY_VISION)) { - mpr((you.mutation[MUT_BLURRY_VISION] == 3 && one_chance_in(3)) + mpr((player_mutation_level(MUT_BLURRY_VISION) == 3 && one_chance_in(3)) ? "This scroll appears to be blank." : "The writing blurs in front of your eyes."); return; @@ -4120,7 +4120,7 @@ void read_scroll( int slot ) case SCR_PAPER: // remember paper scrolls handled as special case above, too: mpr("This scroll appears to be blank."); - if (you.mutation[MUT_BLURRY_VISION] == 3) + if (player_mutation_level(MUT_BLURRY_VISION) == 3) id_the_scroll = false; break; diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc index 4f99b634f0..db1e52e118 100644 --- a/crawl-ref/source/itemprop.cc +++ b/crawl-ref/source/itemprop.cc @@ -19,7 +19,7 @@ #include #ifdef DOS -#include + #include #endif #include "externs.h" @@ -42,7 +42,7 @@ // XXX: name strings in most of the following are currently unused! -struct armour_def +struct armour_def { armour_type id; const char *name; @@ -56,98 +56,98 @@ struct armour_def size_type fit_max; }; -// Note: the Little-Giant range is used to make armours which are very +// Note: the Little-Giant range is used to make armours which are very // flexible and adjustable and can be worn by any player character... // providing they also pass the shape test, of course. static int Armour_index[NUM_ARMOURS]; -static armour_def Armour_prop[NUM_ARMOURS] = +static armour_def Armour_prop[NUM_ARMOURS] = { - { ARM_ANIMAL_SKIN, "animal skin", 2, 0, 100, + { ARM_ANIMAL_SKIN, "animal skin", 2, 0, 100, true, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_GIANT }, - { ARM_ROBE, "robe", 2, 0, 60, + { ARM_ROBE, "robe", 2, 0, 60, true, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_BIG }, - { ARM_LEATHER_ARMOUR, "leather armour", 3, -1, 150, + { ARM_LEATHER_ARMOUR, "leather armour", 3, -1, 150, true, EQ_BODY_ARMOUR, SIZE_SMALL, SIZE_MEDIUM }, - { ARM_RING_MAIL, "ring mail", 4, -2, 250, + { ARM_RING_MAIL, "ring mail", 4, -2, 250, false, EQ_BODY_ARMOUR, SIZE_SMALL, SIZE_MEDIUM }, - { ARM_SCALE_MAIL, "scale mail", 5, -3, 350, + { ARM_SCALE_MAIL, "scale mail", 5, -3, 350, false, EQ_BODY_ARMOUR, SIZE_SMALL, SIZE_MEDIUM }, - { ARM_CHAIN_MAIL, "chain mail", 6, -4, 400, + { ARM_CHAIN_MAIL, "chain mail", 6, -4, 400, false, EQ_BODY_ARMOUR, SIZE_SMALL, SIZE_MEDIUM }, - { ARM_BANDED_MAIL, "banded mail", 7, -5, 500, + { ARM_BANDED_MAIL, "banded mail", 7, -5, 500, false, EQ_BODY_ARMOUR, SIZE_MEDIUM, SIZE_MEDIUM }, - { ARM_SPLINT_MAIL, "splint mail", 8, -5, 550, + { ARM_SPLINT_MAIL, "splint mail", 8, -5, 550, false, EQ_BODY_ARMOUR, SIZE_MEDIUM, SIZE_MEDIUM }, - { ARM_PLATE_MAIL, "plate mail", 10, -6, 650, + { ARM_PLATE_MAIL, "plate mail", 10, -6, 650, false, EQ_BODY_ARMOUR, SIZE_MEDIUM, SIZE_MEDIUM }, - { ARM_CRYSTAL_PLATE_MAIL, "crystal plate mail", 14, -8, 1200, + { ARM_CRYSTAL_PLATE_MAIL, "crystal plate mail", 14, -8, 1200, false, EQ_BODY_ARMOUR, SIZE_MEDIUM, SIZE_MEDIUM }, - { ARM_TROLL_HIDE, "troll hide", 2, -1, 220, + { ARM_TROLL_HIDE, "troll hide", 2, -1, 220, true, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_GIANT }, - { ARM_TROLL_LEATHER_ARMOUR, "troll leather armour", 4, -1, 220, + { ARM_TROLL_LEATHER_ARMOUR, "troll leather armour", 4, -1, 220, true, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_GIANT }, - { ARM_STEAM_DRAGON_HIDE, "steam dragon hide", 2, 0, 120, + { ARM_STEAM_DRAGON_HIDE, "steam dragon hide", 2, 0, 120, true, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_GIANT }, - { ARM_STEAM_DRAGON_ARMOUR, "steam dragon armour", 4, 0, 120, + { ARM_STEAM_DRAGON_ARMOUR, "steam dragon armour", 4, 0, 120, true, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_GIANT }, - { ARM_MOTTLED_DRAGON_HIDE, "mottled dragon hide", 3, -1, 150, + { ARM_MOTTLED_DRAGON_HIDE, "mottled dragon hide", 3, -1, 150, true, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_GIANT }, - { ARM_MOTTLED_DRAGON_ARMOUR,"mottled dragon armour", 5, -1, 150, + { ARM_MOTTLED_DRAGON_ARMOUR,"mottled dragon armour", 5, -1, 150, true, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_GIANT }, - { ARM_SWAMP_DRAGON_HIDE, "swamp dragon hide", 3, -2, 200, + { ARM_SWAMP_DRAGON_HIDE, "swamp dragon hide", 3, -2, 200, false, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_GIANT }, - { ARM_SWAMP_DRAGON_ARMOUR, "swamp dragon armour", 7, -2, 200, + { ARM_SWAMP_DRAGON_ARMOUR, "swamp dragon armour", 7, -2, 200, false, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_GIANT }, - { ARM_DRAGON_HIDE, "dragon hide", 3, -3, 350, + { ARM_DRAGON_HIDE, "dragon hide", 3, -3, 350, false, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_GIANT }, - { ARM_DRAGON_ARMOUR, "dragon armour", 8, -3, 350, + { ARM_DRAGON_ARMOUR, "dragon armour", 8, -3, 350, false, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_GIANT }, - { ARM_ICE_DRAGON_HIDE, "ice dragon hide", 4, -3, 350, + { ARM_ICE_DRAGON_HIDE, "ice dragon hide", 4, -3, 350, false, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_GIANT }, - { ARM_ICE_DRAGON_ARMOUR, "ice dragon armour", 9, -3, 350, + { ARM_ICE_DRAGON_ARMOUR, "ice dragon armour", 9, -3, 350, false, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_GIANT }, - { ARM_STORM_DRAGON_HIDE, "storm dragon hide", 4, -4, 600, + { ARM_STORM_DRAGON_HIDE, "storm dragon hide", 4, -4, 600, false, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_GIANT }, - { ARM_STORM_DRAGON_ARMOUR, "storm dragon armour", 10, -5, 600, + { ARM_STORM_DRAGON_ARMOUR, "storm dragon armour", 10, -5, 600, false, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_GIANT }, - { ARM_GOLD_DRAGON_HIDE, "gold dragon hide", 5, -5, 1100, + { ARM_GOLD_DRAGON_HIDE, "gold dragon hide", 5, -5, 1100, false, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_GIANT }, - { ARM_GOLD_DRAGON_ARMOUR, "gold dragon armour", 13, -9, 1100, + { ARM_GOLD_DRAGON_ARMOUR, "gold dragon armour", 13, -9, 1100, false, EQ_BODY_ARMOUR, SIZE_LITTLE, SIZE_GIANT }, - { ARM_CLOAK, "cloak", 1, 0, 40, + { ARM_CLOAK, "cloak", 1, 0, 40, true, EQ_CLOAK, SIZE_LITTLE, SIZE_BIG }, - { ARM_GLOVES, "gloves", 1, 0, 20, + { ARM_GLOVES, "gloves", 1, 0, 20, true, EQ_GLOVES, SIZE_SMALL, SIZE_MEDIUM }, - { ARM_HELMET, "helmet", 1, 0, 80, + { ARM_HELMET, "helmet", 1, 0, 80, false, EQ_HELMET, SIZE_SMALL, SIZE_MEDIUM }, - { ARM_CAP, "cap", 0, 0, 40, + { ARM_CAP, "cap", 0, 0, 40, true, EQ_HELMET, SIZE_LITTLE, SIZE_LARGE }, - { ARM_WIZARD_HAT, "wizard hat", 0, 0, 40, + { ARM_WIZARD_HAT, "wizard hat", 0, 0, 40, true, EQ_HELMET, SIZE_LITTLE, SIZE_LARGE }, // Note that barding size is compared against torso so it currently // needs to fit medium, but that doesn't matter as much as race // and shapeshift status. - { ARM_BOOTS, "boots", 1, 0, 30, + { ARM_BOOTS, "boots", 1, 0, 30, true, EQ_BOOTS, SIZE_SMALL, SIZE_MEDIUM }, - { ARM_CENTAUR_BARDING, "centaur barding", 4, -2, 100, + { ARM_CENTAUR_BARDING, "centaur barding", 4, -2, 100, true, EQ_BOOTS, SIZE_MEDIUM, SIZE_MEDIUM }, - { ARM_NAGA_BARDING, "naga barding", 4, -2, 100, + { ARM_NAGA_BARDING, "naga barding", 4, -2, 100, true, EQ_BOOTS, SIZE_MEDIUM, SIZE_MEDIUM }, // Note: shields use ac-value as sh-value, EV pen is used for heavy_shield - { ARM_BUCKLER, "buckler", 3, 0, 90, + { ARM_BUCKLER, "buckler", 3, 0, 90, true, EQ_SHIELD, SIZE_LITTLE, SIZE_MEDIUM }, - { ARM_SHIELD, "shield", 5, -1, 150, + { ARM_SHIELD, "shield", 5, -1, 150, false, EQ_SHIELD, SIZE_SMALL, SIZE_BIG }, - { ARM_LARGE_SHIELD, "large shield", 7, -2, 230, + { ARM_LARGE_SHIELD, "large shield", 7, -2, 230, false, EQ_SHIELD, SIZE_MEDIUM, SIZE_GIANT }, }; @@ -178,37 +178,37 @@ static weapon_def Weapon_prop[NUM_WEAPONS] = { WPN_WHIP, "whip", 4, 2, 13, 30, 2, SK_MACES_FLAILS, HANDS_ONE, SIZE_MEDIUM, MI_NONE, false, DAMV_SLASHING, 0 }, - { WPN_CLUB, "club", 5, 3, 13, 50, 7, + { WPN_CLUB, "club", 5, 3, 13, 50, 7, SK_MACES_FLAILS, HANDS_ONE, SIZE_SMALL, MI_NONE, true, DAMV_CRUSHING, 0 }, - { WPN_HAMMER, "hammer", 7, 3, 13, 90, 7, + { WPN_HAMMER, "hammer", 7, 3, 13, 90, 7, SK_MACES_FLAILS, HANDS_ONE, SIZE_SMALL, MI_NONE, false, DAMV_CRUSHING, 0 }, - { WPN_MACE, "mace", 8, 3, 14, 120, 8, + { WPN_MACE, "mace", 8, 3, 14, 120, 8, SK_MACES_FLAILS, HANDS_ONE, SIZE_SMALL, MI_NONE, false, DAMV_CRUSHING, 10 }, - { WPN_FLAIL, "flail", 9, 2, 15, 130, 8, + { WPN_FLAIL, "flail", 9, 2, 15, 130, 8, SK_MACES_FLAILS, HANDS_ONE, SIZE_SMALL, MI_NONE, false, DAMV_CRUSHING, 10 }, - { WPN_ANCUS, "ancus", 9, 2, 14, 120, 8, + { WPN_ANCUS, "ancus", 9, 2, 14, 120, 8, SK_MACES_FLAILS, HANDS_ONE, SIZE_MEDIUM, MI_NONE, false, DAMV_CRUSHING, 10 }, - { WPN_MORNINGSTAR, "morningstar", 10, -1, 15, 140, 8, + { WPN_MORNINGSTAR, "morningstar", 10, -1, 15, 140, 8, SK_MACES_FLAILS, HANDS_ONE, SIZE_MEDIUM, MI_NONE, false, DAMV_PIERCING | DAM_BLUDGEON, 10 }, { WPN_DEMON_WHIP, "demon whip", 10, 1, 13, 30, 2, SK_MACES_FLAILS, HANDS_ONE, SIZE_MEDIUM, MI_NONE, false, DAMV_SLASHING, 2 }, - { WPN_SPIKED_FLAIL, "spiked flail", 12, -2, 16, 190, 8, + { WPN_SPIKED_FLAIL, "spiked flail", 12, -2, 16, 190, 8, SK_MACES_FLAILS, HANDS_ONE, SIZE_MEDIUM, MI_NONE, false, DAMV_PIERCING | DAM_BLUDGEON, 10 }, - { WPN_EVENINGSTAR, "eveningstar", 12, -1, 15, 180, 8, + { WPN_EVENINGSTAR, "eveningstar", 12, -1, 15, 180, 8, SK_MACES_FLAILS, HANDS_ONE, SIZE_MEDIUM, MI_NONE, false, DAMV_PIERCING | DAM_BLUDGEON, 2 }, - { WPN_DIRE_FLAIL, "dire flail", 13, -3, 14, 240, 9, + { WPN_DIRE_FLAIL, "dire flail", 13, -3, 14, 240, 9, SK_MACES_FLAILS, HANDS_DOUBLE, SIZE_MEDIUM, MI_NONE, false, DAMV_PIERCING | DAM_BLUDGEON, 10 }, - { WPN_GREAT_MACE, "great mace", 16, -4, 18, 270, 9, + { WPN_GREAT_MACE, "great mace", 16, -4, 18, 270, 9, SK_MACES_FLAILS, HANDS_TWO, SIZE_LARGE, MI_NONE, false, DAMV_CRUSHING, 10 }, { WPN_GIANT_CLUB, "giant club", 18, -6, 19, 330, 10, @@ -265,19 +265,19 @@ static weapon_def Weapon_prop[NUM_WEAPONS] = DAMV_SLICING, 2 }, // Axes - { WPN_HAND_AXE, "hand axe", 7, 3, 13, 80, 6, + { WPN_HAND_AXE, "hand axe", 7, 3, 13, 80, 6, SK_AXES, HANDS_ONE, SIZE_SMALL, MI_NONE, true, DAMV_CHOPPING, 10 }, - { WPN_WAR_AXE, "war axe", 11, 0, 16, 180, 7, + { WPN_WAR_AXE, "war axe", 11, 0, 16, 180, 7, SK_AXES, HANDS_ONE, SIZE_MEDIUM, MI_NONE, false, DAMV_CHOPPING, 10 }, - { WPN_BROAD_AXE, "broad axe", 14, -2, 17, 230, 8, + { WPN_BROAD_AXE, "broad axe", 14, -2, 17, 230, 8, SK_AXES, HANDS_HALF, SIZE_MEDIUM, MI_NONE, false, DAMV_CHOPPING, 10 }, - { WPN_BATTLEAXE, "battleaxe", 17, -4, 18, 250, 8, + { WPN_BATTLEAXE, "battleaxe", 17, -4, 18, 250, 8, SK_AXES, HANDS_TWO, SIZE_LARGE, MI_NONE, false, DAMV_CHOPPING, 10 }, - { WPN_EXECUTIONERS_AXE, "executioner\'s axe", 20, -6, 20, 280, 9, + { WPN_EXECUTIONERS_AXE, "executioner\'s axe", 20, -6, 20, 280, 9, SK_AXES, HANDS_TWO, SIZE_LARGE, MI_NONE, false, DAMV_CHOPPING, 2 }, @@ -311,8 +311,8 @@ static weapon_def Weapon_prop[NUM_WEAPONS] = SK_STAVES, HANDS_DOUBLE, SIZE_LARGE, MI_NONE, false, DAMV_SLICING, 2 }, - // Range weapons - // Notes: + // Range weapons + // Notes: // - HANDS_HALF means a reloading time penalty if using shield // - damage field is used for bonus strength damage (string tension) // - slings get a bonus from dex, not str (as tension is meaningless) @@ -347,7 +347,7 @@ struct missile_def }; static int Missile_index[NUM_MISSILES]; -static missile_def Missile_prop[NUM_MISSILES] = +static missile_def Missile_prop[NUM_MISSILES] = { { MI_NEEDLE, "needle", 0, 1, false }, { MI_STONE, "stone", 4, 2, true }, @@ -357,10 +357,10 @@ static missile_def Missile_prop[NUM_MISSILES] = { MI_LARGE_ROCK, "large rock", 20, 600, true }, { MI_SLING_BULLET, "sling bullet", 6, 4, false }, { MI_JAVELIN, "javelin", 10, 80, true }, - { MI_THROWING_NET, "throwing net", 0, 30, true }, + { MI_THROWING_NET, "throwing net", 0, 30, true }, }; -struct food_def +struct food_def { int id; const char *name; @@ -372,12 +372,12 @@ struct food_def }; // NOTE: Any food with special random messages or side effects -// currently only takes one turn to eat (except ghouls and chunks)... -// if this changes then those items will have to have special code -// (like ghoul chunks) to guarantee that the special thing is only +// currently only takes one turn to eat (except ghouls and chunks)... +// if this changes then those items will have to have special code +// (like ghoul chunks) to guarantee that the special thing is only // done once. See the ghoul eating code over in food.cc. static int Food_index[NUM_FOODS]; -static food_def Food_prop[NUM_FOODS] = +static food_def Food_prop[NUM_FOODS] = { { FOOD_MEAT_RATION, "meat ration", 5000, 500, -1500, 80, 4 }, { FOOD_SAUSAGE, "sausage", 1500, 150, -400, 40, 1 }, @@ -431,8 +431,8 @@ void init_properties() } -// Some convenient functions to hide the bit operations and create -// an interface layer between the code and the data in case this +// Some convenient functions to hide the bit operations and create +// an interface layer between the code and the data in case this // gets changed again. -- bwr // @@ -474,7 +474,7 @@ void do_curse_item( item_def &item ) } xom_is_stimulated(amusement); } - + item.flags |= ISFLAG_CURSED; } @@ -518,7 +518,7 @@ bool item_is_critical(const item_def &item) { if (!is_valid_item(item)) return (false); - + if (item.base_type == OBJ_ORBS) return (true); @@ -1009,7 +1009,7 @@ bool armour_not_shiny( const item_def &item ) switch (item.sub_type) { - case ARM_ROBE: + case ARM_ROBE: case ARM_CLOAK: case ARM_GLOVES: case ARM_BOOTS: @@ -1076,14 +1076,14 @@ bool check_jewellery_size( const item_def &item, size_type size ) { ASSERT( item.base_type == OBJ_JEWELLERY ); - // Currently assuming amulets are always wearable (only needs - // to be held over head or heart... giants can strap it on with - // a bit of binder twine). However, rings need to actually fit + // Currently assuming amulets are always wearable (only needs + // to be held over head or heart... giants can strap it on with + // a bit of binder twine). However, rings need to actually fit // around the ring finger to work, and so the big cannot use them. return (size <= SIZE_LARGE || jewellery_is_amulet( item )); } -// Returns the basic light status of an armour, ignoring things like the +// Returns the basic light status of an armour, ignoring things like the // elven bonus... you probably want is_light_armour() most times. bool base_armour_is_light( const item_def &item ) { @@ -1131,7 +1131,7 @@ bool check_armour_shape( const item_def &item, bool quiet ) { case EQ_BOOTS: - if (you.mutation[MUT_HOOVES]) + if (player_mutation_level(MUT_HOOVES)) { if (!quiet) mpr("You can't wear boots with hooves!"); @@ -1139,7 +1139,7 @@ bool check_armour_shape( const item_def &item, bool quiet ) return (false); } - if (you.mutation[MUT_TALONS]) + if (player_mutation_level(MUT_TALONS)) { if (!quiet) mpr("Boots don't fit your talons!"); @@ -1203,7 +1203,7 @@ bool check_armour_shape( const item_def &item, bool quiet ) return (false); } - if (you.mutation[MUT_HORNS]) + if (player_mutation_level(MUT_HORNS)) { if (!quiet) mpr( "You can't wear that with your horns!" ); @@ -1261,7 +1261,7 @@ bool check_armour_shape( const item_def &item, bool quiet ) } } - // Note: This need to be checked after all the special cases + // Note: This need to be checked after all the special cases // above, and in addition to shapechanged or not. This is // a simple check against the armour types that are forced off. @@ -1780,7 +1780,7 @@ int fit_weapon_wieldable_size( const item_def &item, size_type size ) return ((fit < -2) ? fit + 2 : (fit > 1) ? fit - 1 : 0); } -// Returns number of sizes away from being throwable... the window +// Returns number of sizes away from being throwable... the window // is currently [size - 5, size - 1]. int fit_item_throwable_size( const item_def &item, size_type size ) { @@ -1821,8 +1821,8 @@ bool check_weapon_shape( const item_def &item, bool quiet, bool check_id ) { const int brand = get_weapon_brand( item ); - if ((!check_id || item_type_known( item )) - && ((item.base_type == OBJ_WEAPONS + if ((!check_id || item_type_known( item )) + && ((item.base_type == OBJ_WEAPONS && item.sub_type == WPN_BLESSED_BLADE) || brand == SPWPN_HOLY_WRATH) && (you.is_undead || you.species == SP_DEMONSPAWN)) @@ -1867,7 +1867,7 @@ int get_inv_hand_tool( void ) if (tool == -1 || !is_tool( you.inv[tool] )) return (-1); - if (you.inv[tool].base_type == OBJ_WEAPONS + if (you.inv[tool].base_type == OBJ_WEAPONS || you.inv[tool].base_type == OBJ_STAVES) { // assuring that bad "shape" weapons aren't in hand @@ -1882,7 +1882,7 @@ int get_inv_hand_tool( void ) } // Returns the you.inv[] index of the thing in our hand... this is provided -// as a service to specify that both of the above are irrelevant. +// as a service to specify that both of the above are irrelevant. // Do not use this for low level functions dealing with wielding directly. int get_inv_in_hand( void ) { @@ -2012,7 +2012,7 @@ int ring_has_pluses( const item_def &item ) case RING_INTELLIGENCE: case RING_DEXTERITY: return (1); - + default: break; } @@ -2042,10 +2042,10 @@ int food_value( const item_def &item ) { ASSERT( is_valid_item( item ) && item.base_type == OBJ_FOOD ); - const int herb = you.mutation[MUT_HERBIVOROUS]; + const int herb = player_mutation_level(MUT_HERBIVOROUS); // XXX: this needs to be better merged with the mutation system - const int carn = you.mutation[MUT_CARNIVOROUS]; + const int carn = player_mutation_level(MUT_CARNIVOROUS); const food_def &food = Food_prop[ Food_index[item.sub_type] ]; @@ -2080,11 +2080,11 @@ bool food_is_rotten( const item_def &item ) // returns true if item counts as a tool for tool size comparisons and msgs bool is_tool( const item_def &item ) { - // Currently using OBJ_WEAPONS instead of can_cut_meat() as almost + // Currently using OBJ_WEAPONS instead of can_cut_meat() as almost // any weapon might be an evocable artefact. return (item.base_type == OBJ_WEAPONS || item.base_type == OBJ_STAVES - || (item.base_type == OBJ_MISCELLANY + || (item.base_type == OBJ_MISCELLANY && item.sub_type != MISC_RUNE_OF_ZOT)); } @@ -2162,7 +2162,7 @@ bool gives_ability( const item_def &item ) { return false; } - + if (item.sub_type == RING_TELEPORTATION || item.sub_type == RING_LEVITATION || item.sub_type == RING_INVISIBILITY) @@ -2176,7 +2176,7 @@ bool gives_ability( const item_def &item ) item_def *amul = you.slot_item(EQ_AMULET); if (!amul || (*amul).slot != item.slot) return false; - + if (item.sub_type == AMU_RAGE) return true; } @@ -2187,7 +2187,7 @@ bool gives_ability( const item_def &item ) const equipment_type eq = get_armour_slot(item); if (eq == EQ_NONE) return false; - + // unworn armour item_def *arm = you.slot_item(eq); if (!arm || (*arm).slot != item.slot) @@ -2197,7 +2197,7 @@ bool gives_ability( const item_def &item ) default: return false; } - + if (!is_random_artefact(item)) return false; @@ -2207,7 +2207,7 @@ bool gives_ability( const item_def &item ) if (randart_wpn_property( item, static_cast(rap) )) return true; } - + return false; } @@ -2272,7 +2272,7 @@ bool gives_resistance( const item_def &item ) if (!arm || (*arm).slot != item.slot) return false; break; - + const int ego = get_armour_ego_type( item ); if (ego >= SPARM_FIRE_RESISTANCE && ego <= SPARM_SEE_INVISIBLE || ego == SPARM_RESISTANCE || ego == SPARM_POSITIVE_ENERGY) @@ -2286,7 +2286,7 @@ bool gives_resistance( const item_def &item ) item_def *weap = you.slot_item(EQ_WEAPON); if (!weap || (*weap).slot != item.slot) return false; - + if (item.sub_type >= STAFF_FIRE && item.sub_type <= STAFF_POISON || item.sub_type == STAFF_AIR) { @@ -2306,7 +2306,7 @@ bool gives_resistance( const item_def &item ) { if (rap == RAP_MAGIC || rap >= RAP_INVISIBLE && rap != RAP_CAN_TELEPORT) continue; - + if (randart_wpn_property( item, static_cast(rap) )) return true; } @@ -2340,7 +2340,7 @@ int item_mass( const item_def &item ) case OBJ_MISSILES: unit_mass = Missile_prop[ Missile_index[item.sub_type] ].mass; break; - + case OBJ_FOOD: unit_mass = Food_prop[ Food_index[item.sub_type] ].mass; break; @@ -2389,15 +2389,15 @@ int item_mass( const item_def &item ) } switch (item.sub_type) { - case MISC_BOTTLED_EFREET: + case MISC_BOTTLED_EFREET: case MISC_CRYSTAL_BALL_OF_SEEING: case MISC_CRYSTAL_BALL_OF_ENERGY: - case MISC_CRYSTAL_BALL_OF_FIXATION: - unit_mass = 150; + case MISC_CRYSTAL_BALL_OF_FIXATION: + unit_mass = 150; break; - default: - unit_mass = 100; + default: + unit_mass = 100; break; } break; @@ -2418,7 +2418,7 @@ int item_mass( const item_def &item ) return ((unit_mass > 0) ? unit_mass : 0); } -// Note that this function, an item sizes in general aren't quite on the +// Note that this function, an item sizes in general aren't quite on the // same scale as PCs and monsters. size_type item_size( const item_def &item ) { @@ -2433,7 +2433,7 @@ size_type item_size( const item_def &item ) case OBJ_ARMOUR: size = SIZE_MEDIUM; - + switch (item.sub_type) { case ARM_GLOVES: @@ -2526,8 +2526,8 @@ bool is_shield_incompatible(const item_def &weapon, const item_def *shield) return (false); hands_reqd_type hand = hands_reqd(weapon, player_size()); - return hand == HANDS_TWO - && !item_is_rod(weapon) + return hand == HANDS_TWO + && !item_is_rod(weapon) && !is_range_weapon(weapon); } diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index b09a07272c..a2f51d20d9 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -913,7 +913,7 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent) // Divine health and mp restoration doesn't happen when killing // born-friendly monsters. The mutation still applies, however. - if (you.mutation[MUT_DEATH_STRENGTH] + if (player_mutation_level(MUT_DEATH_STRENGTH) || (!created_friendly && gives_xp && (you.religion == GOD_MAKHLEB || you.religion == GOD_SHINING_ONE diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc index c5e5087588..de7afd5ffb 100644 --- a/crawl-ref/source/mutation.cc +++ b/crawl-ref/source/mutation.cc @@ -119,7 +119,7 @@ const char *mutation_descrip[][3] = { {"You are surrounded by a mild repulsion field (ev + 1).", "You are surrounded by a moderate repulsion field (ev + 3).", "You are surrounded by a strong repulsion field (ev + 5; repel missiles)."}, - + {"Your system is immune to poisons.", "Your system is immune to poisons.", "Your system is immune to poisons."}, // 10 @@ -298,12 +298,12 @@ const char *mutation_descrip[][3] = { "Your chest, abdomen and neck are covered in intricate, arcane green writing."}, {"You can tolerate rotten meat.", "You can eat rotten meat.", - "You thrive on rotten meat."}, + "You thrive on rotten meat."}, {"You are covered in fur.", "You are covered in thick fur.", "Your thick and shaggy fur keeps you warm."}, - + {"You have an increased reservoir of magic (+10 percent mp).", "You have a strongly increased reservoir of magic (+20 percent mp).", "You have an extremely increased reservoir of magic (+30 percent mp)."}, @@ -561,16 +561,16 @@ const char *gain_mutation[][3] = { {"Your chest itches.", "Your chest and abdomen itch.", "Your chest, abdomen and neck itch."}, - // saprovorous: can never be gained or lost, only started with + // saprovorous: can never be gained or lost, only started with {"", "", ""}, - + {"Fur sprouts all over your body.", "Your fur grows into a thick mane.", "Your thick fur grows shaggy and warm."}, {"You feel more energetic.", "You feel more energetic.", "You feel more energetic."}, - + // 70 {"You feel less energetic.", "You feel less energetic.", "You feel less energetic."}, @@ -792,7 +792,7 @@ const char *lose_mutation[][3] = { // 65 {"", "", ""}, {"", "", ""}, - + // saprovorous: can never be gained or lost, only started with {"", "", ""}, @@ -871,119 +871,127 @@ const char *lose_mutation[][3] = { }; /* mutation definitions: - first number = probability (0 means it doesn't appear naturally?) - second number = maximum levels */ + first number = probability (0 means it doesn't appear naturally?) + second number = maximum levels + first boolean = is mutation mostly bad? + second boolean = is mutation physical, i.e. external only? +*/ static mutation_def mutation_defs[] = { - { MUT_TOUGH_SKIN, 10, 3, false }, - { MUT_STRONG, 8, 14, false }, - { MUT_CLEVER, 8, 14, false }, - { MUT_AGILE, 8, 14, false }, - { MUT_GREEN_SCALES, 2, 3, false }, - { MUT_BLACK_SCALES, 1, 3, false }, - { MUT_GREY_SCALES, 2, 3, false }, - { MUT_BONEY_PLATES, 1, 3, false }, - { MUT_REPULSION_FIELD, 1, 3, false }, - { MUT_POISON_RESISTANCE, 4, 1, false }, + { MUT_TOUGH_SKIN, 10, 3, false, true }, + { MUT_STRONG, 8, 14, false, true }, + { MUT_CLEVER, 8, 14, false, true }, + { MUT_AGILE, 8, 14, false, true }, + { MUT_GREEN_SCALES, 2, 3, false, true }, + { MUT_BLACK_SCALES, 1, 3, false, true }, + { MUT_GREY_SCALES, 2, 3, false, true }, + { MUT_BONEY_PLATES, 1, 3, false, true }, + { MUT_REPULSION_FIELD, 1, 3, false, false }, + { MUT_POISON_RESISTANCE, 4, 1, false, false }, // 10 - { MUT_CARNIVOROUS, 5, 3, false }, - { MUT_HERBIVOROUS, 5, 3, true }, - { MUT_HEAT_RESISTANCE, 4, 3, false }, - { MUT_COLD_RESISTANCE, 4, 3, false }, - { MUT_SHOCK_RESISTANCE, 2, 1, false }, - { MUT_REGENERATION, 3, 3, false }, - { MUT_FAST_METABOLISM, 10, 3, true }, - { MUT_SLOW_METABOLISM, 7, 3, false }, - { MUT_WEAK, 10, 14, true }, - { MUT_DOPEY, 10, 14, true }, + { MUT_CARNIVOROUS, 5, 3, false, false }, + { MUT_HERBIVOROUS, 5, 3, true, false }, + { MUT_HEAT_RESISTANCE, 4, 3, false, false }, + { MUT_COLD_RESISTANCE, 4, 3, false, false }, + { MUT_SHOCK_RESISTANCE, 2, 1, false, false }, + { MUT_REGENERATION, 3, 3, false, false }, + { MUT_FAST_METABOLISM, 10, 3, true, false }, + { MUT_SLOW_METABOLISM, 7, 3, false, false }, + { MUT_WEAK, 10, 14, true, true }, + { MUT_DOPEY, 10, 14, true, true }, // 20 - { MUT_CLUMSY, 10, 14, true }, - { MUT_TELEPORT_CONTROL, 2, 1, false }, - { MUT_TELEPORT, 3, 3, true }, - { MUT_MAGIC_RESISTANCE, 5, 3, false }, - { MUT_FAST, 1, 3, false }, - { MUT_ACUTE_VISION, 2, 1, false }, - { MUT_DEFORMED, 8, 3, true }, - { MUT_TELEPORT_AT_WILL, 2, 3, false }, - { MUT_SPIT_POISON, 8, 3, false }, - { MUT_MAPPING, 3, 3, false }, + { MUT_CLUMSY, 10, 14, true, true }, + { MUT_TELEPORT_CONTROL, 2, 1, false, false }, + { MUT_TELEPORT, 3, 3, true, false }, + { MUT_MAGIC_RESISTANCE, 5, 3, false, false }, + { MUT_FAST, 1, 3, false, false }, + { MUT_ACUTE_VISION, 2, 1, false, false }, + { MUT_DEFORMED, 8, 3, true, true }, + { MUT_TELEPORT_AT_WILL, 2, 3, false, false }, + { MUT_SPIT_POISON, 8, 3, false, false }, + { MUT_MAPPING, 3, 3, false, false }, // 30 - { MUT_BREATHE_FLAMES, 4, 3, false }, - { MUT_BLINK, 3, 3, false }, - { MUT_HORNS, 7, 3, false }, - { MUT_STRONG_STIFF, 10, 3, false }, - { MUT_FLEXIBLE_WEAK, 10, 3, false }, - { MUT_SCREAM, 6, 3, true }, - { MUT_CLARITY, 6, 1, false }, - { MUT_BERSERK, 7, 3, true }, - { MUT_DETERIORATION, 10, 3, true }, - { MUT_BLURRY_VISION, 10, 3, true }, + { MUT_BREATHE_FLAMES, 4, 3, false, false }, + { MUT_BLINK, 3, 3, false, false }, + { MUT_HORNS, 7, 3, false, true }, + { MUT_STRONG_STIFF, 10, 3, false, true }, + { MUT_FLEXIBLE_WEAK, 10, 3, false, true }, + { MUT_SCREAM, 6, 3, true, false }, + { MUT_CLARITY, 6, 1, false, false }, + { MUT_BERSERK, 7, 3, true, false }, + { MUT_DETERIORATION, 10, 3, true, false }, + { MUT_BLURRY_VISION, 10, 3, true, false }, // 40 - { MUT_MUTATION_RESISTANCE, 4, 3, false }, - { MUT_FRAIL, 10, 3, true }, - { MUT_ROBUST, 5, 3, false }, - + { MUT_MUTATION_RESISTANCE, 4, 3, false, false }, + { MUT_FRAIL, 10, 3, true, true }, + { MUT_ROBUST, 5, 3, false, true }, + /* Some demonic powers start here: */ - { MUT_TORMENT_RESISTANCE, 0, 1, false }, - { MUT_NEGATIVE_ENERGY_RESISTANCE, 0, 3, false }, - { MUT_SUMMON_MINOR_DEMONS, 0, 1, false }, - { MUT_SUMMON_DEMONS, 0, 1, false }, - { MUT_HURL_HELLFIRE, 0, 1, false }, - { MUT_CALL_TORMENT, 0, 1, false }, - { MUT_RAISE_DEAD, 0, 1, false }, + { MUT_TORMENT_RESISTANCE, 0, 1, false, false }, + { MUT_NEGATIVE_ENERGY_RESISTANCE, 0, 3, false, false }, + { MUT_SUMMON_MINOR_DEMONS, 0, 1, false, false }, + { MUT_SUMMON_DEMONS, 0, 1, false, false }, + { MUT_HURL_HELLFIRE, 0, 1, false, false }, + { MUT_CALL_TORMENT, 0, 1, false, false }, + { MUT_RAISE_DEAD, 0, 1, false, false }, // 50 - { MUT_CONTROL_DEMONS, 0, 1, false }, - { MUT_PANDEMONIUM, 0, 1, false }, - { MUT_DEATH_STRENGTH, 0, 1, false }, - { MUT_CHANNEL_HELL, 0, 1, false }, - { MUT_DRAIN_LIFE, 0, 1, false }, - { MUT_THROW_FLAMES, 0, 1, false }, - { MUT_THROW_FROST, 0, 1, false }, - { MUT_SMITE, 0, 1, false }, + { MUT_CONTROL_DEMONS, 0, 1, false, false }, + { MUT_PANDEMONIUM, 0, 1, false, false }, + { MUT_DEATH_STRENGTH, 0, 1, false, false }, + { MUT_CHANNEL_HELL, 0, 1, false, false }, + { MUT_DRAIN_LIFE, 0, 1, false, false }, + { MUT_THROW_FLAMES, 0, 1, false, false }, + { MUT_THROW_FROST, 0, 1, false, false }, + { MUT_SMITE, 0, 1, false, false }, /* end of demonic powers */ - { MUT_CLAWS, 2, 3, false }, - { MUT_FANGS, 1, 3, false }, + { MUT_CLAWS, 2, 3, false, true }, + { MUT_FANGS, 1, 3, false, true }, // 60 - { MUT_HOOVES, 1, 1, false }, - { MUT_TALONS, 1, 1, false }, - - { MUT_BREATHE_POISON, 0, 1, false }, // Naga only - { MUT_STINGER, 0, 3, false }, // Naga and Draconian only - { MUT_BIG_WINGS, 0, 1, false }, // Draconian only + { MUT_HOOVES, 1, 1, false, true }, + { MUT_TALONS, 1, 1, false, true }, + + // Naga only + { MUT_BREATHE_POISON, 0, 1, false, false }, + // Naga and Draconian only + { MUT_STINGER, 0, 3, false, true }, + // Draconian only + { MUT_BIG_WINGS, 0, 1, false, true }, // 65 - { MUT_BLUE_MARKS, 0, 3, false }, // used by evil gods to mark followers - { MUT_GREEN_MARKS, 0, 3, false }, + // used by evil gods to mark followers (currently UNUSED) + { MUT_BLUE_MARKS, 0, 3, false, true }, + { MUT_GREEN_MARKS, 0, 3, false, true }, + + // species-dependent innate mutation + { MUT_SAPROVOROUS, 0, 3, false, false }, - { MUT_SAPROVOROUS, 0, 3, false }, // species-dependent innate mutation + { MUT_SHAGGY_FUR, 2, 3, false, true }, - { MUT_SHAGGY_FUR, 2, 3, false }, - - { MUT_HIGH_MAGIC, 1, 3, false }, + { MUT_HIGH_MAGIC, 1, 3, false, false }, // 70 - { MUT_LOW_MAGIC, 9, 3, true }, - { RANDOM_MUTATION, 0, 3, false }, - { RANDOM_MUTATION, 0, 3, false }, - { RANDOM_MUTATION, 0, 3, false }, - { RANDOM_MUTATION, 0, 3, false }, + { MUT_LOW_MAGIC, 9, 3, true, false }, + { RANDOM_MUTATION, 0, 3, false, false }, + { RANDOM_MUTATION, 0, 3, false, false }, + { RANDOM_MUTATION, 0, 3, false, false }, + { RANDOM_MUTATION, 0, 3, false, false }, // 75 -- scales of various colours and effects - { MUT_RED_SCALES, 2, 3, false }, - { MUT_NACREOUS_SCALES, 1, 3, false }, - { MUT_GREY2_SCALES, 2, 3, false }, - { MUT_METALLIC_SCALES, 1, 3, false }, - { MUT_BLACK2_SCALES, 2, 3, false }, - { MUT_WHITE_SCALES, 2, 3, false }, - { MUT_YELLOW_SCALES, 2, 3, false }, - { MUT_BROWN_SCALES, 2, 3, false }, - { MUT_BLUE_SCALES, 2, 3, false }, - { MUT_PURPLE_SCALES, 2, 3, false }, + { MUT_RED_SCALES, 2, 3, false, true }, + { MUT_NACREOUS_SCALES, 1, 3, false, true }, + { MUT_GREY2_SCALES, 2, 3, false, true }, + { MUT_METALLIC_SCALES, 1, 3, false, true }, + { MUT_BLACK2_SCALES, 2, 3, false, true }, + { MUT_WHITE_SCALES, 2, 3, false, true }, + { MUT_YELLOW_SCALES, 2, 3, false, true }, + { MUT_BROWN_SCALES, 2, 3, false, true }, + { MUT_BLUE_SCALES, 2, 3, false, true }, + { MUT_PURPLE_SCALES, 2, 3, false, true }, // 85 - { MUT_SPECKLED_SCALES, 2, 3, false }, - { MUT_ORANGE_SCALES, 2, 3, false }, - { MUT_INDIGO_SCALES, 2, 3, false }, - { MUT_RED2_SCALES, 1, 3, false }, - { MUT_IRIDESCENT_SCALES, 1, 3, false }, - { MUT_PATTERNED_SCALES, 1, 3, false } + { MUT_SPECKLED_SCALES, 2, 3, false, true }, + { MUT_ORANGE_SCALES, 2, 3, false, true }, + { MUT_INDIGO_SCALES, 2, 3, false, true }, + { MUT_RED2_SCALES, 1, 3, false, true }, + { MUT_IRIDESCENT_SCALES, 1, 3, false, true }, + { MUT_PATTERNED_SCALES, 1, 3, false, true } }; COMPILE_CHECK(ARRAYSIZE(mutation_defs) == NUM_MUTATIONS, c1); @@ -1007,6 +1015,24 @@ void fixup_mutations() mutation_defs[MUT_BIG_WINGS].rarity = 1; } +bool mutation_is_active(mutation_type mut) +{ + // for all species except vampires their mutations always apply + if (you.species != SP_VAMPIRE) + return true; + + // innate mutations are always active + if (you.demon_pow[mut]) + return true; + + // ... as do mutations for non-thirsty vampires + if (you.hunger_state >= HS_SATIATED) + return true; + + // for thirsty (or worse) vampires, only physical mutations are active + return (mutation_defs[mut].physical); +} + formatted_string describe_mutations() { std::string result; @@ -1040,12 +1066,15 @@ formatted_string describe_mutations() result += ""; result += EOL; result += "You cannot wear boots." EOL; - + // breathe poison replaces spit poison: if (!you.mutation[MUT_BREATHE_POISON]) result += "You can spit poison." EOL; else - result += "You can exhale a cloud of poison." EOL ""; + { + result += "You can exhale a cloud of poison." + EOL ""; + } // slowness can be overridden if ( you.mutation[MUT_FAST] ) @@ -1212,11 +1241,11 @@ formatted_string describe_mutations() result += "Your natural rate of healing is unusually fast." EOL; have_any = true; break; - + default: break; } //end switch - innate abilities - + // a bit more stuff if ( (you.species >= SP_OGRE && you.species <= SP_OGRE_MAGE) || player_genus(GENPC_DRACONIAN) || @@ -1225,7 +1254,7 @@ formatted_string describe_mutations() result += "Your body does not fit into most forms of armour." EOL; have_any = true; } - + result += ""; if ( beogh_water_walk() ) @@ -1244,10 +1273,12 @@ formatted_string describe_mutations() { have_any = true; - // this is already handled above: + // these are already handled above: if (you.species == SP_NAGA && (i == MUT_BREATHE_POISON || i == MUT_FAST || i == MUT_DEFORMED)) + { continue; + } if (you.species == SP_TROLL && i == MUT_CLAWS) continue; if (you.species == SP_CENTAUR && i == MUT_DEFORMED) @@ -1272,7 +1303,7 @@ formatted_string describe_mutations() result += '<'; result += colourname; result += '>'; - + result += mutation_name(static_cast(i)); result += "("; + result += mutation_name(static_cast(i)); + + if (is_greyed_out) + result += ")"; result += EOL; } } @@ -1340,7 +1382,7 @@ static int calc_mutation_amusement_value(mutation_type which_mutation) case MUT_MUTATION_RESISTANCE: amusement /= 2; // not funny break; - + case MUT_CARNIVOROUS: case MUT_HERBIVOROUS: case MUT_FAST_METABOLISM: @@ -1402,7 +1444,7 @@ static bool is_good_mutation( mutation_type which_mutation ) case MUT_STINGER: case MUT_FANGS: return true; - + default: return false; } @@ -1415,7 +1457,7 @@ static bool accept_mutation( mutation_type mutat, bool ignore_rarity = false ) if ( ignore_rarity ) return (true); - + const int rarity = mutation_defs[mutat].rarity + you.demon_pow[mutat]; // low rarity means unlikely to choose it return (rarity > random2(10)); @@ -1446,7 +1488,7 @@ static mutation_type get_random_xom_mutation() } } while ( !accept_mutation(mutat) ); - + return (mutat); } @@ -1463,7 +1505,7 @@ static mutation_type get_random_mutation(bool prefer_good, const mutation_type curr = static_cast(i); if (!accept_mutation(curr, true)) continue; - + const bool weighted = mutation_defs[i].bad != prefer_good; int weight = mutation_defs[i].rarity; if (weighted) @@ -1485,9 +1527,13 @@ bool mutate(mutation_type which_mutation, bool failMsg, bool force_mutation, if (demonspawn) force_mutation = true; + bool rotting = you.is_undead; + if (you.species == SP_VAMPIRE && you.hunger_state >= HS_SATIATED) + rotting = false; + // Undead bodies don't mutate, they fall apart. -- bwr // except for demonspawn (or other permamutations) in lichform -- haranp - if (you.is_undead && !demonspawn) + if (rotting && !demonspawn) { if (!wearing_amulet(AMU_RESIST_MUTATION)? !one_chance_in(3) : one_chance_in(10)) @@ -1516,8 +1562,9 @@ bool mutate(mutation_type which_mutation, bool failMsg, bool force_mutation, { if (wearing_amulet(AMU_RESIST_MUTATION) && !one_chance_in(10) || you.religion == GOD_ZIN && you.piety > random2(MAX_PIETY) - || you.mutation[MUT_MUTATION_RESISTANCE] == 3 - || you.mutation[MUT_MUTATION_RESISTANCE] && !one_chance_in(3)) + || player_mutation_level(MUT_MUTATION_RESISTANCE) == 3 + || player_mutation_level(MUT_MUTATION_RESISTANCE) + && !one_chance_in(3)) { if (failMsg) mpr("You feel odd for a moment.", MSGCH_MUTATION); @@ -1558,10 +1605,10 @@ bool mutate(mutation_type which_mutation, bool failMsg, bool force_mutation, if ((mutat = get_random_mutation(true, 500)) == NUM_MUTATIONS) return (false); } - else if (you.mutation[mutat] >= 3 && - mutat != MUT_STRONG && mutat != MUT_CLEVER && - mutat != MUT_AGILE && mutat != MUT_WEAK && - mutat != MUT_DOPEY && mutat != MUT_CLUMSY) + else if (you.mutation[mutat] >= 3 + && mutat != MUT_STRONG && mutat != MUT_CLEVER + && mutat != MUT_AGILE && mutat != MUT_WEAK + && mutat != MUT_DOPEY && mutat != MUT_CLUMSY) { return false; } @@ -1575,9 +1622,9 @@ bool mutate(mutation_type which_mutation, bool failMsg, bool force_mutation, // These can be forced by demonspawn if ((mutat == MUT_TOUGH_SKIN - || (mutat >= MUT_GREEN_SCALES && mutat <= MUT_BONEY_PLATES) - || (mutat >= MUT_RED_SCALES && mutat <= MUT_PATTERNED_SCALES)) - && body_covered() >= 3 && !force_mutation) + || mutat >= MUT_GREEN_SCALES && mutat <= MUT_BONEY_PLATES + || mutat >= MUT_RED_SCALES && mutat <= MUT_PATTERNED_SCALES) + && body_covered() >= 3 && !force_mutation) { return false; } @@ -1594,10 +1641,8 @@ bool mutate(mutation_type which_mutation, bool failMsg, bool force_mutation, // breathe poison replaces spit poison (so it takes the slot) for (int i = 0; i < 52; i++) - { if (you.ability_letter_table[i] == ABIL_SPIT_POISON) you.ability_letter_table[i] = ABIL_BREATHE_POISON; - } } } } @@ -1610,7 +1655,7 @@ bool mutate(mutation_type which_mutation, bool failMsg, bool force_mutation, } if (mutat == MUT_SLOW_METABOLISM && you.mutation[MUT_REGENERATION] > 0) - return false; /* if you have a slow metabolism, no regen */ + return false; /* if you have regen, no slow metabolism */ // This one can be forced by demonspawn if (mutat == MUT_ACUTE_VISION @@ -1622,7 +1667,7 @@ bool mutate(mutation_type which_mutation, bool failMsg, bool force_mutation, if (mutat == MUT_BLURRY_VISION && you.mutation[MUT_ACUTE_VISION] > 0) return false; /* blurred vision/see invis */ - //jmf: added some checks for new mutations + // only Nagas and Draconians can get this one if (mutat == MUT_STINGER && !(you.species == SP_NAGA || player_genus(GENPC_DRACONIAN))) { @@ -1636,27 +1681,37 @@ bool mutate(mutation_type which_mutation, bool failMsg, bool force_mutation, return false; } + // no fangs sprouting from Kenkus' beaks if (mutat == MUT_FANGS && you.species == SP_KENKU) return false; + // already innate if (mutat == MUT_BREATHE_POISON && you.species != SP_NAGA) return false; + // only Draconians can get wings if (mutat == MUT_BIG_WINGS && !player_genus(GENPC_DRACONIAN)) return false; + // Vampires' hunger rate depends on their blood level. + if ((mutat == MUT_SLOW_METABOLISM || mutat == MUT_FAST_METABOLISM) + && you.species == SP_VAMPIRE) + { + return false; + } + if (you.mutation[mutat] >= mutation_defs[mutat].levels) return false; // find where these things are actually changed // -- do not globally force redraw {dlb} - you.redraw_hit_points = 1; + you.redraw_hit_points = 1; you.redraw_magic_points = 1; you.redraw_armour_class = 1; - you.redraw_evasion = 1; - you.redraw_experience = 1; - you.redraw_gold = 1; - //you.redraw_hunger = 1; + you.redraw_evasion = 1; +// you.redraw_experience = 1; +// you.redraw_gold = 1; +// you.redraw_hunger = 1; switch (mutat) { @@ -1804,12 +1859,11 @@ bool mutate(mutation_type which_mutation, bool failMsg, bool force_mutation, mpr(gain_mutation[mutat][you.mutation[mutat]], MSGCH_MUTATION); // horns force hard helmets off - if (you.equip[EQ_HELMET] != -1 && - !is_hard_helmet( you.inv[you.equip[EQ_HELMET]] )) + if (you.equip[EQ_HELMET] != -1 + && !is_hard_helmet( you.inv[you.equip[EQ_HELMET]] )) { break; } - remove_one_equip(EQ_HELMET); } break; @@ -1820,7 +1874,7 @@ bool mutate(mutation_type which_mutation, bool failMsg, bool force_mutation, delete_mutation(MUT_FLEXIBLE_WEAK); return true; } - modify_stat(STAT_STRENGTH, 1, true, "gaining a mutation"); + modify_stat(STAT_STRENGTH, 1, true, "gaining a mutation"); modify_stat(STAT_DEXTERITY, -1, true, "gaining a mutation"); mpr(gain_mutation[mutat][0], MSGCH_MUTATION); break; @@ -1943,15 +1997,13 @@ int how_mutated(void) if (you.mutation[i] && you.demon_pow[i] < you.mutation[i]) { // these allow for 14 levels: - if (i == MUT_STRONG || i == MUT_CLEVER || i == MUT_AGILE - || i == MUT_WEAK || i == MUT_DOPEY || i == MUT_CLUMSY) + if (i == MUT_STRONG || i == MUT_CLEVER || i == MUT_AGILE + || i == MUT_WEAK || i == MUT_DOPEY || i == MUT_CLUMSY) { j += (you.mutation[i] / 5 + 1); } - else - { + else j += you.mutation[i]; - } } } @@ -1969,7 +2021,7 @@ int count_mutations() for (int i = 0; i < NUM_MUTATIONS; i++) if (you.mutation[i] && you.demon_pow[i] < you.mutation[i]) count++; - + return count; } @@ -1979,8 +2031,9 @@ bool delete_mutation(mutation_type which_mutation, bool force, bool good) int i; if (!force - && (you.mutation[MUT_MUTATION_RESISTANCE] > 1 - && (you.mutation[MUT_MUTATION_RESISTANCE] == 3 || coinflip()))) + && ( player_mutation_level(MUT_MUTATION_RESISTANCE) > 1 + && (player_mutation_level(MUT_MUTATION_RESISTANCE) == 3 + || coinflip()) ) ) { mpr("You feel rather odd for a moment.", MSGCH_MUTATION); return false; @@ -1996,7 +2049,7 @@ bool delete_mutation(mutation_type which_mutation, bool force, bool good) } while ((you.mutation[mutat] == 0 && (mutat != MUT_STRONG && mutat != MUT_CLEVER - && mutat != MUT_AGILE) + && mutat != MUT_AGILE) && (mutat != MUT_WEAK && mutat != MUT_DOPEY && mutat != MUT_CLUMSY)) || random2(10) >= mutation_defs[mutat].rarity @@ -2126,14 +2179,14 @@ bool delete_mutation(mutation_type which_mutation, bool force, bool good) } // find where these things are actually altered - /// -- do not globally force redraw {dlb} - you.redraw_hit_points = 1; + // -- do not globally force redraw {dlb} + you.redraw_hit_points = 1; you.redraw_magic_points = 1; you.redraw_armour_class = 1; - you.redraw_evasion = 1; - you.redraw_experience = 1; - you.redraw_gold = 1; - //you.redraw_hunger = 1; + you.redraw_evasion = 1; +// you.redraw_experience = 1; +// you.redraw_gold = 1; +// you.redraw_hunger = 1; if (you.mutation[mutat] > 0) you.mutation[mutat]--; @@ -2190,7 +2243,7 @@ const char *mutation_name(mutation_type which_mutat, int level) || which_mutat == MUT_AGILE || which_mutat == MUT_WEAK || which_mutat == MUT_DOPEY || which_mutat == MUT_CLUMSY) { - snprintf( mut_string, sizeof( mut_string ), "%s%d).", + snprintf( mut_string, sizeof( mut_string ), "%s%d).", mutation_descrip[ which_mutat ][0], level ); return (mut_string); @@ -2213,7 +2266,7 @@ void demonspawn(void) mpr("Your demonic ancestry asserts itself...", MSGCH_INTRINSIC_GAIN); // Merged the demonspawn lists into a single loop. Now a high level - // character can potentially get mutations from the low level list if + // character can potentially get mutations from the low level list if // its having trouble with the high level list. do { @@ -2529,7 +2582,7 @@ bool perma_mutate(mutation_type which_mut, int how_much) how_much = std::min(static_cast(how_much), mutation_defs[which_mut].levels); - + if (mutate(which_mut, false, true, true)) levels++; @@ -2566,6 +2619,6 @@ bool give_bad_mutation(bool forceMutation, bool failMsg) const bool result = mutate(which_bad_one, failMsg, forceMutation); if (result) learned_something_new(TUT_YOU_MUTATED); - + return (result); } // end give_bad_mutation() diff --git a/crawl-ref/source/mutation.h b/crawl-ref/source/mutation.h index 3bfc01fa02..12aaee7d80 100644 --- a/crawl-ref/source/mutation.h +++ b/crawl-ref/source/mutation.h @@ -25,6 +25,8 @@ struct mutation_def bool bad; // A mutation that's more bad than good. Xom uses // this to decide which mutations to hand out as // rewards. + bool physical; // A mutation affecting a character's outward + // appearance. }; void fixup_mutations(); @@ -43,6 +45,7 @@ bool mutate(mutation_type which_mutation, bool failMsg = true, * *********************************************************************** */ void display_mutations(); +bool mutation_is_active(mutation_type mut); formatted_string describe_mutations(); diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc index 1ac798b66e..71220abc0d 100644 --- a/crawl-ref/source/newgame.cc +++ b/crawl-ref/source/newgame.cc @@ -2282,7 +2282,7 @@ static void _give_basic_mutations(species_type speci) break; case SP_OGRE: you.mutation[MUT_FAST_METABOLISM] = 1; - you.mutation[MUT_SAPROVOROUS] = 1; + you.mutation[MUT_SAPROVOROUS] = 1; break; case SP_OGRE_MAGE: you.mutation[MUT_FAST_METABOLISM] = 1; @@ -2294,26 +2294,26 @@ static void _give_basic_mutations(species_type speci) you.mutation[MUT_HORNS] = 2; break; case SP_SPRIGGAN: - you.mutation[MUT_ACUTE_VISION] = 1; - you.mutation[MUT_FAST] = 3; - you.mutation[MUT_HERBIVOROUS] = 3; + you.mutation[MUT_ACUTE_VISION] = 1; + you.mutation[MUT_FAST] = 3; + you.mutation[MUT_HERBIVOROUS] = 3; you.mutation[MUT_SLOW_METABOLISM] = 3; break; case SP_CENTAUR: - you.mutation[MUT_FAST] = 2; - you.mutation[MUT_DEFORMED] = 1; + you.mutation[MUT_FAST] = 2; + you.mutation[MUT_DEFORMED] = 1; you.mutation[MUT_FAST_METABOLISM] = 2; - you.mutation[MUT_HOOVES] = 1; + you.mutation[MUT_HOOVES] = 1; break; case SP_NAGA: - you.mutation[MUT_ACUTE_VISION] = 1; + you.mutation[MUT_ACUTE_VISION] = 1; you.mutation[MUT_POISON_RESISTANCE] = 1; - you.mutation[MUT_DEFORMED] = 1; + you.mutation[MUT_DEFORMED] = 1; break; case SP_MUMMY: you.mutation[MUT_TORMENT_RESISTANCE] = 1; - you.mutation[MUT_POISON_RESISTANCE] = 1; - you.mutation[MUT_COLD_RESISTANCE] = 1; + you.mutation[MUT_POISON_RESISTANCE] = 1; + you.mutation[MUT_COLD_RESISTANCE] = 1; you.mutation[MUT_NEGATIVE_ENERGY_RESISTANCE] = 3; break; case SP_GNOME: @@ -2321,8 +2321,8 @@ static void _give_basic_mutations(species_type speci) break; case SP_GHOUL: you.mutation[MUT_TORMENT_RESISTANCE] = 1; - you.mutation[MUT_POISON_RESISTANCE] = 1; - you.mutation[MUT_COLD_RESISTANCE] = 1; + you.mutation[MUT_POISON_RESISTANCE] = 1; + you.mutation[MUT_COLD_RESISTANCE] = 1; you.mutation[MUT_NEGATIVE_ENERGY_RESISTANCE] = 3; you.mutation[MUT_SAPROVOROUS] = 3; you.mutation[MUT_CARNIVOROUS] = 3; @@ -2331,17 +2331,17 @@ static void _give_basic_mutations(species_type speci) you.mutation[MUT_TALONS] = 1; break; case SP_TROLL: - you.mutation[MUT_REGENERATION] = 2; + you.mutation[MUT_REGENERATION] = 2; you.mutation[MUT_FAST_METABOLISM] = 3; - you.mutation[MUT_SAPROVOROUS] = 2; - you.mutation[MUT_SHAGGY_FUR] = 1; + you.mutation[MUT_SAPROVOROUS] = 2; + you.mutation[MUT_SHAGGY_FUR] = 1; break; case SP_KOBOLD: you.mutation[MUT_SAPROVOROUS] = 2; you.mutation[MUT_CARNIVOROUS] = 3; break; case SP_VAMPIRE: - you.mutation[MUT_FANGS] = 3; + you.mutation[MUT_FANGS] = 3; you.mutation[MUT_ACUTE_VISION] = 1; break; default: diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc index c44d516731..2d7f249a61 100644 --- a/crawl-ref/source/output.cc +++ b/crawl-ref/source/output.cc @@ -1525,7 +1525,7 @@ std::vector get_full_detail(bool calc_unid, long sc) _determine_color_string(rcorr), itosym1(rcorr)); cols.add_formatted(2, buf, false); - int saplevel = you.mutation[MUT_SAPROVOROUS]; + int saplevel = player_mutation_level(MUT_SAPROVOROUS); const char* pregourmand; const char* postgourmand; if ( wearing_amulet(AMU_THE_GOURMAND, calc_unid) ) @@ -1833,7 +1833,7 @@ std::vector _get_overview_screen_results() const int rsust = player_sust_abil(calc_unid); const int rmuta = wearing_amulet(AMU_RESIST_MUTATION, calc_unid) || you.religion == GOD_ZIN && you.piety >= 150 - || you.mutation[MUT_MUTATION_RESISTANCE] == 3; + || player_mutation_level(MUT_MUTATION_RESISTANCE) == 3; const int rslow = wearing_amulet(AMU_RESIST_SLOW, calc_unid); @@ -1857,7 +1857,7 @@ std::vector _get_overview_screen_results() _determine_color_string(rslow), itosym1(rslow)); cols.add_formatted(0, buf, false); - int saplevel = you.mutation[MUT_SAPROVOROUS]; + int saplevel = player_mutation_level(MUT_SAPROVOROUS); const char* pregourmand; const char* postgourmand; if ( wearing_amulet(AMU_THE_GOURMAND, calc_unid) ) @@ -2233,7 +2233,7 @@ std::string _status_mut_abilities() case SP_NAGA: // breathe poison replaces spit poison: - if (!you.mutation[MUT_BREATHE_POISON]) + if (!player_mutation_level(MUT_BREATHE_POISON)) text += "spit poison"; else text += "breathe poison"; @@ -2360,11 +2360,10 @@ std::string _status_mut_abilities() for (unsigned i = 0; i < NUM_MUTATIONS; i++) { - if (!you.mutation[i]) + int level = player_mutation_level((mutation_type) i); + if (!level) continue; - int level = you.mutation[ i ]; - switch(i) { case MUT_TOUGH_SKIN: diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index c0241995eb..d268662df3 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -152,8 +152,8 @@ bool move_player_to_grid( int x, int y, bool stepped, bool allow_shift, if (new_grid == DNGN_UNDISCOVERED_TRAP) { const int skill = 4 + you.skills[SK_TRAPS_DOORS] - + you.mutation[MUT_ACUTE_VISION] - - 2 * you.mutation[MUT_BLURRY_VISION]; + + player_mutation_level(MUT_ACUTE_VISION) + - 2 * player_mutation_level(MUT_BLURRY_VISION); if (random2( skill ) > 6) { @@ -619,7 +619,7 @@ bool you_can_wear(int eq, bool special_armour) if (you.species == SP_KENKU && (eq == EQ_HELMET || eq == EQ_BOOTS)) return false; - if (you.mutation[MUT_HORNS] && eq == EQ_HELMET) + if (player_mutation_level(MUT_HORNS) && eq == EQ_HELMET) return (special_armour); if (you.species == SP_GHOUL && eq == EQ_GLOVES) @@ -634,7 +634,7 @@ bool player_has_feet() if (you.species == SP_NAGA || player_genus(GENPC_DRACONIAN)) return false; - if (you.mutation[MUT_HOOVES] || you.mutation[MUT_TALONS]) + if (player_mutation_level(MUT_HOOVES) || player_mutation_level(MUT_TALONS)) return false; return true; @@ -649,8 +649,9 @@ bool you_tran_can_wear(int eq, bool check_mutation) return false; if (eq == EQ_BOOTS - && (player_is_swimming() && you.species == SP_MERFOLK - || you.mutation[MUT_HOOVES] || you.mutation[MUT_TALONS])) + && ( player_is_swimming() && you.species == SP_MERFOLK + || player_mutation_level(MUT_HOOVES) + || player_mutation_level(MUT_TALONS) )) { return false; } @@ -926,7 +927,7 @@ int player_teleport(bool calc_unid) tp += 8 * player_equip( EQ_RINGS, RING_TELEPORTATION, calc_unid ); /* mutations */ - tp += you.mutation[MUT_TELEPORT] * 3; + tp += player_mutation_level(MUT_TELEPORT) * 3; /* randart weapons only */ if (you.equip[EQ_WEAPON] != -1 @@ -959,7 +960,7 @@ int player_regen(void) rr += 30; /* fast heal mutation */ - rr += you.mutation[MUT_REGENERATION] * 20; + rr += player_mutation_level(MUT_REGENERATION) * 20; /* ghouls heal slowly */ // dematerialized people heal slowly @@ -1058,11 +1059,11 @@ int player_hunger_rate(void) } else { - hunger += you.mutation[MUT_FAST_METABOLISM]; + hunger += player_mutation_level(MUT_FAST_METABOLISM); - if (you.mutation[MUT_SLOW_METABOLISM] > 2) + if (player_mutation_level(MUT_SLOW_METABOLISM) > 2) hunger -= 2; - else if (you.mutation[MUT_SLOW_METABOLISM] > 0) + else if (player_mutation_level(MUT_SLOW_METABOLISM) > 0) hunger--; } @@ -1186,7 +1187,7 @@ int player_res_magic(void) rm += 2 * you.skills[SK_ENCHANTMENTS]; /* Mutations */ - rm += 30 * you.mutation[MUT_MAGIC_RESISTANCE]; + rm += 30 * player_mutation_level(MUT_MAGIC_RESISTANCE); /* transformations */ if (you.attribute[ATTR_TRANSFORMATION] == TRAN_LICH) @@ -1246,7 +1247,7 @@ int player_res_fire(bool calc_unid, bool temp) rf--; // mutations: - rf += you.mutation[MUT_HEAT_RESISTANCE]; + rf += player_mutation_level(MUT_HEAT_RESISTANCE); // spells: if (temp) @@ -1324,9 +1325,9 @@ int player_res_cold(bool calc_unid) rc++; // mutations: - rc += you.mutation[MUT_COLD_RESISTANCE]; + rc += player_mutation_level(MUT_COLD_RESISTANCE); - if (you.mutation[MUT_SHAGGY_FUR] == 3) + if (player_mutation_level(MUT_SHAGGY_FUR) == 3) rc++; if (you.duration[DUR_FIRE_SHIELD]) @@ -1366,7 +1367,7 @@ int player_res_acid(bool consider_unidentified_gear) && you.experience_level >= 7) res += 2; - res += you.mutation[MUT_YELLOW_SCALES] * 2 / 3; + res += player_mutation_level(MUT_YELLOW_SCALES) * 2 / 3; } if (wearing_amulet(AMU_RESIST_CORROSION, consider_unidentified_gear)) @@ -1418,7 +1419,7 @@ int player_res_electricity(bool calc_unid) re++; // mutations: - if (you.mutation[MUT_SHOCK_RESISTANCE]) + if (player_mutation_level(MUT_SHOCK_RESISTANCE)) re++; // transformations: @@ -1458,14 +1459,14 @@ bool player_control_teleport(bool calc_unid) { return ( you.duration[DUR_CONTROL_TELEPORT] || player_equip(EQ_RINGS, RING_TELEPORT_CONTROL, calc_unid) - || you.mutation[MUT_TELEPORT_CONTROL] ); + || player_mutation_level(MUT_TELEPORT_CONTROL) ); } int player_res_torment(bool) { - return (you.mutation[MUT_TORMENT_RESISTANCE] || - you.attribute[ATTR_TRANSFORMATION] == TRAN_LICH || - you.species == SP_VAMPIRE && you.hunger_state == HS_STARVING); + return (player_mutation_level(MUT_TORMENT_RESISTANCE) + || you.attribute[ATTR_TRANSFORMATION] == TRAN_LICH + || you.species == SP_VAMPIRE && you.hunger_state == HS_STARVING); } // funny that no races are susceptible to poisons {dlb} @@ -1503,7 +1504,7 @@ int player_res_poison(bool calc_unid, bool temp) rp += scan_randarts(RAP_POISON, calc_unid); // mutations: - rp += you.mutation[MUT_POISON_RESISTANCE]; + rp += player_mutation_level(MUT_POISON_RESISTANCE); if (temp) { @@ -1759,7 +1760,7 @@ int player_prot_life(bool calc_unid, bool temp) pl += scan_randarts(RAP_NEGATIVE_ENERGY, calc_unid); // undead/demonic power - pl += you.mutation[MUT_NEGATIVE_ENERGY_RESISTANCE]; + pl += player_mutation_level(MUT_NEGATIVE_ENERGY_RESISTANCE); if (pl > 3) pl = 3; @@ -1773,8 +1774,8 @@ int player_ghost_base_movement_speed() { int speed = you.species == SP_NAGA? 8 : 10; - if (you.mutation[MUT_FAST]) - speed += you.mutation[MUT_FAST] + 1; + if (player_mutation_level(MUT_FAST)) + speed += player_mutation_level(MUT_FAST) + 1; if (player_equip_ego_type( EQ_BOOTS, SPARM_RUNNING )) speed += 2; @@ -1834,9 +1835,11 @@ int player_movement_speed(void) mv -= (you.flight_mode() == FL_FLY ? 4 : 2); /* Mutations: -2, -3, -4, unless innate and shapechanged */ - if (you.mutation[MUT_FAST] > 0 && - (!you.demon_pow[MUT_FAST] || !player_is_shapechanged())) - mv -= (you.mutation[MUT_FAST] + 1); + if (player_mutation_level(MUT_FAST) > 0 + && (!you.demon_pow[MUT_FAST] || !player_is_shapechanged()) ) + { + mv -= (player_mutation_level(MUT_FAST) + 1); + } // Burden if (you.burden_state == BS_ENCUMBERED) @@ -1968,7 +1971,7 @@ int player_AC(void) // The deformed don't fit into body armour very well // (this includes nagas and centaurs) - if (i == EQ_BODY_ARMOUR && you.mutation[MUT_DEFORMED]) + if (i == EQ_BODY_ARMOUR && player_mutation_level(MUT_DEFORMED)) AC -= ac_value / 2; } @@ -2039,62 +2042,62 @@ int player_AC(void) // mutations: // these give: +1, +2, +3 - AC += 100 * you.mutation[MUT_TOUGH_SKIN]; - AC += 100 * you.mutation[MUT_GREY_SCALES]; - AC += 100 * you.mutation[MUT_SPECKLED_SCALES]; - AC += 100 * you.mutation[MUT_IRIDESCENT_SCALES]; - AC += 100 * you.mutation[MUT_PATTERNED_SCALES]; - AC += 100 * you.mutation[MUT_BLUE_SCALES]; - AC += 100 * you.mutation[MUT_SHAGGY_FUR]; + AC += 100 * player_mutation_level(MUT_TOUGH_SKIN); + AC += 100 * player_mutation_level(MUT_GREY_SCALES); + AC += 100 * player_mutation_level(MUT_SPECKLED_SCALES); + AC += 100 * player_mutation_level(MUT_IRIDESCENT_SCALES); + AC += 100 * player_mutation_level(MUT_PATTERNED_SCALES); + AC += 100 * player_mutation_level(MUT_BLUE_SCALES); + AC += 100 * player_mutation_level(MUT_SHAGGY_FUR); // these gives: +1, +3, +5 - if (you.mutation[MUT_GREEN_SCALES] > 0) - AC += (you.mutation[MUT_GREEN_SCALES] * 200) - 100; - if (you.mutation[MUT_NACREOUS_SCALES] > 0) - AC += (you.mutation[MUT_NACREOUS_SCALES] * 200) - 100; - if (you.mutation[MUT_BLACK2_SCALES] > 0) - AC += (you.mutation[MUT_BLACK2_SCALES] * 200) - 100; - if (you.mutation[MUT_WHITE_SCALES] > 0) - AC += (you.mutation[MUT_WHITE_SCALES] * 200) - 100; + if (player_mutation_level(MUT_GREEN_SCALES) > 0) + AC += (player_mutation_level(MUT_GREEN_SCALES) * 200) - 100; + if (player_mutation_level(MUT_NACREOUS_SCALES) > 0) + AC += (player_mutation_level(MUT_NACREOUS_SCALES) * 200) - 100; + if (player_mutation_level(MUT_BLACK2_SCALES) > 0) + AC += (player_mutation_level(MUT_BLACK2_SCALES) * 200) - 100; + if (player_mutation_level(MUT_WHITE_SCALES) > 0) + AC += (player_mutation_level(MUT_WHITE_SCALES) * 200) - 100; // these give: +2, +4, +6 - AC += you.mutation[MUT_GREY2_SCALES] * 200; - AC += you.mutation[MUT_YELLOW_SCALES] * 200; - AC += you.mutation[MUT_PURPLE_SCALES] * 200; + AC += player_mutation_level(MUT_GREY2_SCALES) * 200; + AC += player_mutation_level(MUT_YELLOW_SCALES) * 200; + AC += player_mutation_level(MUT_PURPLE_SCALES) * 200; // black gives: +3, +6, +9 - AC += you.mutation[MUT_BLACK_SCALES] * 300; + AC += player_mutation_level(MUT_BLACK_SCALES) * 300; // boney plates give: +2, +3, +4 - if (you.mutation[MUT_BONEY_PLATES] > 0) - AC += 100 * (you.mutation[MUT_BONEY_PLATES] + 1); + if (player_mutation_level(MUT_BONEY_PLATES) > 0) + AC += 100 * (player_mutation_level(MUT_BONEY_PLATES) + 1); // red gives +1, +2, +4 - AC += 100 * (you.mutation[MUT_RED_SCALES] - + (you.mutation[MUT_RED_SCALES] == 3)); + AC += 100 * (player_mutation_level(MUT_RED_SCALES) + + (player_mutation_level(MUT_RED_SCALES) == 3)); // indigo gives: +2, +3, +5 - if (you.mutation[MUT_INDIGO_SCALES] > 0) + if (player_mutation_level(MUT_INDIGO_SCALES) > 0) { - AC += 100 * (1 + you.mutation[MUT_INDIGO_SCALES] - + (you.mutation[MUT_INDIGO_SCALES] == 3)); + AC += 100 * (1 + player_mutation_level(MUT_INDIGO_SCALES) + + (player_mutation_level(MUT_INDIGO_SCALES) == 3)); } // brown gives: +2, +4, +5 - AC += 100 * ((you.mutation[MUT_BROWN_SCALES] * 2) - - (you.mutation[MUT_BROWN_SCALES] == 3)); + AC += 100 * ((player_mutation_level(MUT_BROWN_SCALES) * 2) + - (player_mutation_level(MUT_BROWN_SCALES) == 3)); // orange gives: +1, +3, +4 - AC += 100 * (you.mutation[MUT_ORANGE_SCALES] - + (you.mutation[MUT_ORANGE_SCALES] > 1)); + AC += 100 * (player_mutation_level(MUT_ORANGE_SCALES) + + (player_mutation_level(MUT_ORANGE_SCALES) > 1)); // knobbly red gives: +2, +5, +7 - AC += 100 * ((you.mutation[MUT_RED2_SCALES] * 2) - + (you.mutation[MUT_RED2_SCALES] > 1)); + AC += 100 * ((player_mutation_level(MUT_RED2_SCALES) * 2) + + (player_mutation_level(MUT_RED2_SCALES) > 1)); // metallic gives +3, +7, +10 - AC += 100 * (you.mutation[MUT_METALLIC_SCALES] * 3 - + (you.mutation[MUT_METALLIC_SCALES] > 1)); + AC += 100 * (player_mutation_level(MUT_METALLIC_SCALES) * 3 + + (player_mutation_level(MUT_METALLIC_SCALES) > 1)); } else { @@ -2222,8 +2225,8 @@ int player_evasion() if (you.paralysed()) { ev = 2 + size_factor; - if (you.mutation[MUT_REPULSION_FIELD] > 0) - ev += (you.mutation[MUT_REPULSION_FIELD] * 2) - 1; + if (player_mutation_level(MUT_REPULSION_FIELD) > 0) + ev += (player_mutation_level(MUT_REPULSION_FIELD) * 2) - 1; return ((ev < 1) ? 1 : ev); } @@ -2301,8 +2304,8 @@ int player_evasion() if (player_equip_ego_type( EQ_BODY_ARMOUR, SPARM_PONDEROUSNESS )) ev -= 2; - if (you.mutation[MUT_REPULSION_FIELD] > 0) - ev += (you.mutation[MUT_REPULSION_FIELD] * 2) - 1; + if (player_mutation_level(MUT_REPULSION_FIELD) > 0) + ev += (player_mutation_level(MUT_REPULSION_FIELD) * 2) - 1; // transformation penalties/bonuses not covered by size alone: switch (you.attribute[ATTR_TRANSFORMATION]) @@ -2365,7 +2368,7 @@ int old_player_evasion(void) // We return 2 here to give the player some chance of not being hit, // repulsion fields still work while paralysed if (you.duration[DUR_PARALYSIS]) - return (2 + you.mutation[MUT_REPULSION_FIELD] * 2); + return (2 + player_mutation_level(MUT_REPULSION_FIELD) * 2); if (you.species == SP_CENTAUR) ev -= 3; @@ -2408,8 +2411,8 @@ int old_player_evasion(void) if (emod > 0) ev += emod; - if (you.mutation[MUT_REPULSION_FIELD] > 0) - ev += (you.mutation[MUT_REPULSION_FIELD] * 2) - 1; + if (player_mutation_level(MUT_REPULSION_FIELD) > 0) + ev += (player_mutation_level(MUT_REPULSION_FIELD) * 2) - 1; switch (you.attribute[ATTR_TRANSFORMATION]) { @@ -2531,8 +2534,8 @@ int player_see_invis(bool calc_unid) /* armour: (checks head armour only) */ si += player_equip_ego_type( EQ_HELMET, SPARM_SEE_INVISIBLE ); - if (you.mutation[MUT_ACUTE_VISION] > 0) - si += you.mutation[MUT_ACUTE_VISION]; + if (player_mutation_level(MUT_ACUTE_VISION) > 0) + si += player_mutation_level(MUT_ACUTE_VISION); //jmf: added see_invisible spell if (you.duration[DUR_SEE_INVISIBLE] > 0) @@ -3574,7 +3577,7 @@ int check_stealth(void) else if ( !player_can_swim() ) stealth /= 2; // splashy-splashy } - else if (you.mutation[MUT_HOOVES]) + else if (player_mutation_level(MUT_HOOVES)) stealth -= 10; // clippety-clop // Radiating silence is the negative complement of shouting all the @@ -4135,7 +4138,7 @@ bool player_item_conserve(bool calc_unid) int player_mental_clarity(bool calc_unid) { const int ret = 3 * player_equip(EQ_AMULET, AMU_CLARITY, calc_unid) - + you.mutation[ MUT_CLARITY ]; + + player_mutation_level(MUT_CLARITY); return ((ret > 3) ? 3 : ret); } @@ -4151,7 +4154,7 @@ bool wearing_amulet(char amulet, bool calc_unid) return true; } - if (amulet == AMU_CLARITY && you.mutation[MUT_CLARITY]) + if (amulet == AMU_CLARITY && player_mutation_level(MUT_CLARITY)) return true; if (amulet == AMU_RESIST_CORROSION || amulet == AMU_CONSERVATION) @@ -5101,7 +5104,7 @@ void dec_disease_player( void ) if (you.disease > 5 && (you.species == SP_KOBOLD || you.duration[ DUR_REGENERATION ] - || you.mutation[ MUT_REGENERATION ] == 3)) + || player_mutation_level(MUT_REGENERATION) == 3)) { you.disease -= 2; } @@ -5165,8 +5168,10 @@ static int _strength_modifier() result += scan_randarts(RAP_STRENGTH); // mutations - result += you.mutation[MUT_STRONG] - you.mutation[MUT_WEAK]; - result += you.mutation[MUT_STRONG_STIFF]-you.mutation[MUT_FLEXIBLE_WEAK]; + result += player_mutation_level(MUT_STRONG) + - player_mutation_level(MUT_WEAK); + result += player_mutation_level(MUT_STRONG_STIFF) + - player_mutation_level(MUT_FLEXIBLE_WEAK); // transformations switch ( you.attribute[ATTR_TRANSFORMATION] ) @@ -5195,19 +5200,22 @@ static int _dex_modifier() result += scan_randarts(RAP_DEXTERITY); // mutations - result += you.mutation[MUT_AGILE] - you.mutation[MUT_CLUMSY]; - result += you.mutation[MUT_FLEXIBLE_WEAK]-you.mutation[MUT_STRONG_STIFF]; - result -= you.mutation[MUT_BLACK_SCALES]; - result -= you.mutation[MUT_BONEY_PLATES]; + result += player_mutation_level(MUT_AGILE) + - player_mutation_level(MUT_CLUMSY); + result += player_mutation_level(MUT_FLEXIBLE_WEAK) + - player_mutation_level(MUT_STRONG_STIFF); + result -= player_mutation_level(MUT_BLACK_SCALES); + result -= player_mutation_level(MUT_BONEY_PLATES); + const int grey2_modifier[] = { 0, -1, -1, -2 }; const int metallic_modifier[] = { 0, -2, -3, -4 }; const int yellow_modifier[] = { 0, 0, -1, -2 }; const int red2_modifier[] = { 0, 0, -1, -2 }; - result -= grey2_modifier[you.mutation[MUT_GREY2_SCALES]]; - result -= metallic_modifier[you.mutation[MUT_METALLIC_SCALES]]; - result -= yellow_modifier[you.mutation[MUT_YELLOW_SCALES]]; - result -= red2_modifier[you.mutation[MUT_RED2_SCALES]]; + result -= grey2_modifier[player_mutation_level(MUT_GREY2_SCALES)]; + result -= metallic_modifier[player_mutation_level(MUT_METALLIC_SCALES)]; + result -= yellow_modifier[player_mutation_level(MUT_YELLOW_SCALES)]; + result -= red2_modifier[player_mutation_level(MUT_RED2_SCALES)]; // transformations switch ( you.attribute[ATTR_TRANSFORMATION] ) @@ -5235,7 +5243,9 @@ static int _int_modifier() result += scan_randarts(RAP_INTELLIGENCE); // mutations - result += you.mutation[MUT_CLEVER] - you.mutation[MUT_DOPEY]; + result += player_mutation_level(MUT_CLEVER) + - player_mutation_level(MUT_DOPEY); + return result; } @@ -5722,11 +5732,12 @@ std::string player::shout_verb() const case TRAN_AIR: return "__NONE"; default: // depends on SCREAM mutation - if (you.mutation[MUT_SCREAM] <= 1) + int level = player_mutation_level(MUT_SCREAM); + if ( level <= 1) return "shout"; - else if (you.mutation[MUT_SCREAM] == 2) + else if (level == 2) return "yell"; - else + else // level == 3 return "scream"; } } @@ -6100,6 +6111,14 @@ mon_holy_type player::holiness() const return (MH_NATURAL); } +int player_mutation_level(mutation_type mut) +{ + if (!mutation_is_active(mut)) + return 0; + + return (you.mutation[mut]); +} + int player::res_fire() const { return (player_res_fire()); diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h index 2a31244d4e..3fa3ebec74 100644 --- a/crawl-ref/source/player.h +++ b/crawl-ref/source/player.h @@ -174,6 +174,8 @@ bool player_can_smell(); bool player_can_swim(); bool player_likes_water(bool permanently = false); +int player_mutation_level(mutation_type mut); + /* *********************************************************************** * called from: fight - files - ouch * *********************************************************************** */ diff --git a/crawl-ref/source/shopping.cc b/crawl-ref/source/shopping.cc index 34b45840f7..29ea04bea8 100644 --- a/crawl-ref/source/shopping.cc +++ b/crawl-ref/source/shopping.cc @@ -55,7 +55,7 @@ static void _shop_print( const char *shoppy, int line ) static void _shop_more() { - cgotoxy(70, 2, GOTO_MSG); + cgotoxy(65, 2, GOTO_MSG); cprintf("-more-"); get_ch(); return; @@ -125,7 +125,7 @@ static void _list_shop_keys(const std::string &purchasable) static std::vector _shop_get_stock(int shopidx) { std::vector result; - + int itty = igrd[0][5 + shopidx]; while ( itty != NON_ITEM ) @@ -144,7 +144,7 @@ static int _shop_get_item_value(const item_def& item, int greed, bool id) result *= 8; result /= 10; } - + if (result < 1) result = 1; @@ -190,14 +190,14 @@ static void _in_a_shop( int shopidx ) const std::string hello = "Welcome to " + shop_name(shop.x, shop.y) + "!"; _shop_print(hello.c_str(), 1); - _shop_more(); - + _shop_more(); + const bool id_stock = shoptype_identifies_stock(shop.type); - + while ( true ) { StashTrack.get_shop(shop.x, shop.y).reset(); - + std::vector stock = _shop_get_stock(shopidx); clrscr(); @@ -207,10 +207,10 @@ static void _in_a_shop( int shopidx ) _shop_more(); return; } - + const std::string purchasable = _shop_print_stock(stock, shop); _list_shop_keys(purchasable); - + snprintf( info, INFO_SIZE, "You have %d gold piece%s.", you.gold, (you.gold == 1) ? "" : "s" ); textcolor(YELLOW); @@ -220,11 +220,11 @@ static void _in_a_shop( int shopidx ) purchasable.length()? "purchase" : "do"); textcolor(CYAN); _shop_print(info, 1); - + textcolor(LIGHTGREY); int ft = get_ch(); - + if ( ft == '\\' ) check_item_knowledge(); else if (ft == 'x' || ft == ESCAPE) @@ -290,7 +290,7 @@ static void _in_a_shop( int shopidx ) } item_def& item = mitm[stock[ft]]; - + const int gp_value = _shop_get_item_value(item, shop.greed, id_stock); if (gp_value > you.gold) { @@ -353,7 +353,7 @@ static void _purchase( int shop, int item_got, int cost, bool id ) } } // end purchase() -// This probably still needs some work. Rings used to be the only +// This probably still needs some work. Rings used to be the only // artefacts which had a change in price, and that value corresponds // to returning 50 from this function. Good artefacts will probably // be returning just over 30 right now. Note that this isn't used @@ -370,9 +370,9 @@ int randart_value( const item_def &item ) // Brands are already accounted for via existing ego checks // This should probably be more complex... but this isn't so bad: - ret += 3 * prop[ RAP_AC ] + 3 * prop[ RAP_EVASION ] - + 3 * prop[ RAP_ACCURACY ] + 3 * prop[ RAP_DAMAGE ] - + 6 * prop[ RAP_STRENGTH ] + 6 * prop[ RAP_INTELLIGENCE ] + ret += 3 * prop[ RAP_AC ] + 3 * prop[ RAP_EVASION ] + + 3 * prop[ RAP_ACCURACY ] + 3 * prop[ RAP_DAMAGE ] + + 6 * prop[ RAP_STRENGTH ] + 6 * prop[ RAP_INTELLIGENCE ] + 6 * prop[ RAP_DEXTERITY ]; // These resistances have meaningful levels @@ -757,10 +757,10 @@ unsigned int item_value( item_def item, bool ident ) { if (item_type_known(item)) valued += (7 * randart_value( item )); - else + else valued += 50; } - else if (item_type_known(item) + else if (item_type_known(item) && get_equip_desc(item) != 0) { valued += 20; @@ -1078,7 +1078,7 @@ unsigned int item_value( item_def item, bool ident ) case WAND_POLYMORPH_OTHER: valued += 90; break; - + case WAND_CONFUSION: case WAND_SLOWING: valued += 70; @@ -1288,9 +1288,9 @@ unsigned int item_value( item_def item, bool ident ) valued += 50; else { - if (item_ident( item, ISFLAG_KNOW_PLUSES ) + if (item_ident( item, ISFLAG_KNOW_PLUSES ) && (item.sub_type == RING_PROTECTION - || item.sub_type == RING_STRENGTH + || item.sub_type == RING_STRENGTH || item.sub_type == RING_EVASION || item.sub_type == RING_DEXTERITY || item.sub_type == RING_INTELLIGENCE @@ -1449,7 +1449,7 @@ unsigned int item_value( item_def item, bool ident ) case OBJ_STAVES: if (!item_type_known(item)) valued = 120; - else if (item.sub_type == STAFF_SMITING + else if (item.sub_type == STAFF_SMITING || item.sub_type == STAFF_STRIKING || item.sub_type == STAFF_WARDING || item.sub_type == STAFF_DISCOVERY) @@ -1460,7 +1460,7 @@ unsigned int item_value( item_def item, bool ident ) valued = 250; if (item_is_rod( item ) && item_ident( item, ISFLAG_KNOW_PLUSES )) - valued += 50 * (item.plus2 / ROD_CHARGE_MULT); + valued += 50 * (item.plus2 / ROD_CHARGE_MULT); break; @@ -1555,7 +1555,7 @@ std::string shop_name(int sx, int sy) || shop_type == SHOP_WEAPON_ANTIQUE) ? "Weapon" : (shop_type == SHOP_ARMOUR || shop_type == SHOP_ARMOUR_ANTIQUE) ? "Armour" : - + (shop_type == SHOP_JEWELLERY) ? "Jewellery" : (shop_type == SHOP_WAND) ? "Magical Wand" : (shop_type == SHOP_BOOK) ? "Book" : diff --git a/crawl-ref/source/skills2.cc b/crawl-ref/source/skills2.cc index b339e762ed..01a120a906 100644 --- a/crawl-ref/source/skills2.cc +++ b/crawl-ref/source/skills2.cc @@ -27,7 +27,7 @@ #include #ifdef DOS -#include + #include #endif #include "externs.h" @@ -1680,7 +1680,7 @@ static const skill_type skill_display_order[] = SK_BOWS, SK_CROSSBOWS, SK_THROWING, SK_SLINGS, SK_DARTS, SK_BLANK_LINE, - + SK_ARMOUR, SK_DODGING, SK_STEALTH, SK_STABBING, SK_SHIELDS, SK_TRAPS_DOORS, SK_BLANK_LINE, @@ -1714,10 +1714,10 @@ static void display_skill_table(bool show_aptitudes) #if DEBUG_DIAGNOSTICS cprintf( "You have %d points of unallocated experience " - " (cost lvl %d; total %d)." EOL EOL, + " (cost lvl %d; total %d)." EOL EOL, you.exp_available, you.skill_cost_level, you.total_skill_points ); #else - cprintf(" You have %s unallocated experience." EOL EOL, + cprintf(" You have %s unallocated experience." EOL EOL, you.exp_available == 0? "no" : make_stringf("%d point%s of", you.exp_available, @@ -1774,7 +1774,7 @@ static void display_skill_table(bool show_aptitudes) #endif cprintf( " %c %-14s Skill %2d", - (you.skills[x] == 0) ? ' ' : + (you.skills[x] == 0) ? ' ' : (you.practise_skill[x]) ? '+' : '-', skill_name(x), you.skills[x] ); @@ -1877,21 +1877,21 @@ void show_skills() break; menu_letter lcount = 'a'; // toggle skill practise - + for (int i = 0; i < ndisplayed_skills; i++) { const skill_type x = skill_display_order[i]; if (x == SK_BLANK_LINE || x == SK_COLUMN_BREAK) continue; - + if (you.skills[x] == 0) continue; - + if (keyin == lcount) { you.practise_skill[x] = !you.practise_skill[x]; break; - } + } ++lcount; } } @@ -1916,7 +1916,7 @@ std::string skill_title( unsigned char best_skill, unsigned char skill_lev, int species, int str, int dex, int god ) { // paranoia - if (best_skill == SK_UNUSED_1 + if (best_skill == SK_UNUSED_1 || (best_skill > SK_UNARMED_COMBAT && best_skill < SK_SPELLCASTING) || best_skill >= NUM_SKILLS) { @@ -1938,9 +1938,9 @@ std::string skill_title( unsigned char best_skill, unsigned char skill_lev, // translate skill level into skill ranking {dlb}: // increment rank by one to "skip" skill name in array {dlb}: const int skill_rank = ((skill_lev <= 7) ? 1 : - (skill_lev <= 14) ? 2 : + (skill_lev <= 14) ? 2 : (skill_lev <= 20) ? 3 : - (skill_lev <= 26) ? 4 + (skill_lev <= 26) ? 4 /* level 27 */ : 5); std::string result; @@ -1961,7 +1961,7 @@ std::string skill_title( unsigned char best_skill, unsigned char skill_lev, case SK_INVOCATIONS: if (god == GOD_NO_GOD) result = "Godless"; - else + else result = skills[best_skill][skill_rank]; break; @@ -1970,7 +1970,7 @@ std::string skill_title( unsigned char best_skill, unsigned char skill_lev, break; } } - + const std::string::size_type where = result.find("%s"); if ( where != std::string::npos ) { @@ -1997,7 +1997,7 @@ skill_type best_skill( int min_skill, int max_skill, int excl_skill ) for (int i = min_skill; i <= max_skill; i++) // careful!!! { if (i == excl_skill - || i == SK_UNUSED_1 + || i == SK_UNUSED_1 || (i > SK_UNARMED_COMBAT && i < SK_SPELLCASTING)) { continue; @@ -2010,7 +2010,7 @@ skill_type best_skill( int min_skill, int max_skill, int excl_skill ) best_position = you.skill_order[i]; } - else if (you.skills[i] == best_skill_level + else if (you.skills[i] == best_skill_level && you.skill_order[i] < best_position) { ret = i; @@ -2024,25 +2024,25 @@ skill_type best_skill( int min_skill, int max_skill, int excl_skill ) // Calculate the skill_order array from scratch. // // The skill order array is used for breaking ties in best_skill. -// This is done by ranking each skill by the order in which it +// This is done by ranking each skill by the order in which it // has attained its current level (the values are the number of -// skills at or above that level when the current skill reached it). +// skills at or above that level when the current skill reached it). // // In this way, the skill which has been at a level for the longest // is judged to be the best skill (thus, nicknames are sticky)... -// other skills will have to attain the next level higher to be +// other skills will have to attain the next level higher to be // considered a better skill (thus, the first skill to reach level 27 -// becomes the characters final nickname). +// becomes the characters final nickname). // // As for other uses of best_skill: this method is still appropriate // in that there is no additional advantage anywhere else in the game -// for partial skill levels. Besides, its probably best if the player +// for partial skill levels. Besides, its probably best if the player // isn't able to micromanage at that level. -- bwr void init_skill_order( void ) { for (int i = SK_FIGHTING; i < NUM_SKILLS; i++) { - if (i == SK_UNUSED_1 + if (i == SK_UNUSED_1 || (i > SK_UNARMED_COMBAT && i < SK_SPELLCASTING)) { you.skill_order[i] = MAX_SKILL_ORDER; @@ -2057,7 +2057,7 @@ void init_skill_order( void ) for (int j = SK_FIGHTING; j < NUM_SKILLS; j++) { if (i == j - || j == SK_UNUSED_1 + || j == SK_UNUSED_1 || (j > SK_UNARMED_COMBAT && j < SK_SPELLCASTING)) { continue; @@ -2067,7 +2067,7 @@ void init_skill_order( void ) const unsigned int j_points = (you.skill_points[j] * 100) / j_diff; if (you.skills[j] == you.skills[i] - && (j_points > i_points + && (j_points > i_points || (j_points == i_points && j > i))) { you.skill_order[i]++; @@ -2111,7 +2111,8 @@ int calc_hp(bool real_hp) } // frail and robust mutations - hitp *= (10 + you.mutation[MUT_ROBUST] - you.mutation[MUT_FRAIL]); + hitp *= (10 + player_mutation_level(MUT_ROBUST) + - player_mutation_level(MUT_FRAIL)); hitp /= 10; you.hp_max = hitp; @@ -2132,18 +2133,18 @@ int calc_mp(bool real_mp) int spell_extra = (you.experience_level * you.skills[SK_SPELLCASTING]) / 4; int invoc_extra = (you.experience_level * you.skills[SK_INVOCATIONS]) / 6; - if (spell_extra > invoc_extra) + if (spell_extra > invoc_extra) enp += spell_extra; else enp += invoc_extra; - you.max_magic_points = stepdown_value( enp, 9, 18, 45, 100 ); + you.max_magic_points = stepdown_value( enp, 9, 18, 45, 100 ); // this is our "rotted" base (applied after scaling): you.max_magic_points += (you.base_magic_points - 5000); // Yes, we really do want this duplication... this is so the stepdown - // doesn't truncate before we apply the rotted base. We're doing this + // doesn't truncate before we apply the rotted base. We're doing this // the nice way. -- bwr if (you.max_magic_points > 50) you.max_magic_points = 50; @@ -2153,8 +2154,8 @@ int calc_mp(bool real_mp) you.max_magic_points += player_magical_power(); // analogous to ROBUST/FRAIL - you.max_magic_points *= - (10 + you.mutation[MUT_HIGH_MAGIC] - you.mutation[MUT_LOW_MAGIC]); + you.max_magic_points *= (10 + player_mutation_level(MUT_HIGH_MAGIC) + - player_mutation_level(MUT_LOW_MAGIC)); you.max_magic_points /= 10; if (you.max_magic_points > 50) diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc index 1e52124d7c..0b0e4a782c 100644 --- a/crawl-ref/source/spells4.cc +++ b/crawl-ref/source/spells4.cc @@ -1026,7 +1026,8 @@ void cast_ignite_poison(int pow) } // player is poisonous - if (you.mutation[MUT_SPIT_POISON] || you.mutation[MUT_STINGER] + if (player_mutation_level(MUT_SPIT_POISON) + || player_mutation_level(MUT_STINGER) || you.attribute[ATTR_TRANSFORMATION] == TRAN_SPIDER // poison attack || (!player_is_shapechanged() && (you.species == SP_GREEN_DRACONIAN // poison breath diff --git a/crawl-ref/source/spl-book.cc b/crawl-ref/source/spl-book.cc index ff1482983a..a9f27709e7 100644 --- a/crawl-ref/source/spl-book.cc +++ b/crawl-ref/source/spl-book.cc @@ -21,7 +21,7 @@ #include #ifdef DOS -#include + #include #endif #include "externs.h" @@ -1325,8 +1325,8 @@ bool learn_spell(int book) return (false); } - if (you.mutation[MUT_BLURRY_VISION] > 0 - && random2(4) < you.mutation[MUT_BLURRY_VISION]) + if (player_mutation_level(MUT_BLURRY_VISION) > 0 + && random2(4) < player_mutation_level(MUT_BLURRY_VISION)) { mpr("The writing blurs into unreadable gibberish."); you.turn_is_over = true; diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index de5204436c..1209155e8c 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -3255,7 +3255,7 @@ static void _miscast_earth(int severity, const char* cause) case 9: mprf("Your %s warm.", (you.species == SP_NAGA) ? "underbelly feels" : - (you.mutation[MUT_HOOVES]) ? "hooves feel" + (player_mutation_level(MUT_HOOVES)) ? "hooves feel" : "feet feel"); break; } diff --git a/crawl-ref/source/stuff.cc b/crawl-ref/source/stuff.cc index 8b8e4da889..923e415e78 100644 --- a/crawl-ref/source/stuff.cc +++ b/crawl-ref/source/stuff.cc @@ -50,13 +50,13 @@ #endif #ifdef DOS -#include + #include #endif #ifdef UNIX -#ifndef USE_TILE -#include "libunix.h" -#endif + #ifndef USE_TILE + #include "libunix.h" + #endif #endif #include "branch.h" @@ -816,7 +816,7 @@ void canned_msg(canned_message_type which_message) { case MSG_SOMETHING_APPEARS: mprf("Something appears %s!", - (you.species == SP_NAGA || you.mutation[MUT_HOOVES]) + (you.species == SP_NAGA || player_mutation_level(MUT_HOOVES)) ? "before you" : "at your feet"); break; case MSG_NOTHING_HAPPENS: diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc index a3b05febff..2121d9a2eb 100644 --- a/crawl-ref/source/tags.cc +++ b/crawl-ref/source/tags.cc @@ -1340,7 +1340,7 @@ static void tag_read_you(reader &th, char minorVersion) count_s = unmarshallShort(th); for (j = 0; j < count_s; ++j) { - you.mutation[j] = unmarshallByte(th); + you.mutation[j] = unmarshallByte(th); you.demon_pow[j] = unmarshallByte(th); } diff --git a/crawl-ref/source/tile1.cc b/crawl-ref/source/tile1.cc index 0abd629892..cb08b5ae26 100644 --- a/crawl-ref/source/tile1.cc +++ b/crawl-ref/source/tile1.cc @@ -2374,7 +2374,7 @@ void tilep_race_default(int race, int gender, int level, int *parts) case SP_MOTTLED_DRACONIAN: case SP_PALE_DRACONIAN: hair = 0; - if (you.mutation[MUT_BIG_WINGS]) + if (player_mutation_level(MUT_BIG_WINGS)) parts[TILEP_PART_DRCWING] = 1 + draconian_color(race, level); result = TILEP_BASE_DRACONIAN + draconian_color(race, level)*2; diff --git a/crawl-ref/source/tile2.cc b/crawl-ref/source/tile2.cc index 75f8f07ddc..f05ddd7b5d 100644 --- a/crawl-ref/source/tile2.cc +++ b/crawl-ref/source/tile2.cc @@ -22,6 +22,7 @@ #include "itemprop.h" #include "it_use2.h" #include "place.h" +#include "player.h" #include "stuff.h" #include "tiles.h" #include "tilecount-w2d.h" @@ -1391,9 +1392,9 @@ static bool _draw_doll(img_type img, dolls_data *doll, bool force_redraw = false else parts2[i] = tilep_equ_helm(you.inv[item]); - if (parts2[i] == 0 && you.mutation[MUT_HORNS] > 0) + if (parts2[i] == 0 && player_mutation_level(MUT_HORNS) > 0) { - switch (you.mutation[MUT_HORNS]) + switch (player_mutation_level(MUT_HORNS)) { case 1: parts2[i] = TILEP_HELM_HORNS1; @@ -1416,7 +1417,7 @@ static bool _draw_doll(img_type img, dolls_data *doll, bool force_redraw = false else parts2[i] = tilep_equ_boots(you.inv[item]); - if (parts2[i] == 0 && you.mutation[MUT_HOOVES]) + if (parts2[i] == 0 && player_mutation_level(MUT_HOOVES)) parts2[i] = TILEP_BOOTS_HOOVES; break; @@ -1430,8 +1431,8 @@ static bool _draw_doll(img_type img, dolls_data *doll, bool force_redraw = false // There is player_has_claws() but it is not equivalent. // Claws appear if they're big enough to not wear gloves // or on races that have claws. - if (parts2[i] == 0 && (you.mutation[MUT_CLAWS] >= 3 || - you.species == SP_TROLL || you.species == SP_GHOUL)) + if (parts2[i] == 0 && (player_mutation_level(MUT_CLAWS) >= 3 + || you.species == SP_TROLL || you.species == SP_GHOUL)) { parts2[i] = TILEP_ARM_CLAWS; } diff --git a/crawl-ref/source/transfor.cc b/crawl-ref/source/transfor.cc index d825d88c6f..0bcc023131 100644 --- a/crawl-ref/source/transfor.cc +++ b/crawl-ref/source/transfor.cc @@ -630,7 +630,7 @@ bool can_equip( equipment_type use_which, bool ignore_temporary ) } } - if (use_which == EQ_HELMET && you.mutation[MUT_HORNS]) + if (use_which == EQ_HELMET && player_mutation_level(MUT_HORNS)) return (false); if (use_which == EQ_BOOTS && !player_has_feet()) diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index c44d007c07..ae09d2ca8e 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -3532,8 +3532,10 @@ bool magic_mapping(int map_radius, int proportion, bool suppress_msg, } if (grid_is_opaque( grd[i + k][j + l] ) - && grd[i + k][j + l] != DNGN_CLOSED_DOOR) + && grd[i + k][j + l] != DNGN_CLOSED_DOOR) + { empty_count--; + } } } @@ -3544,9 +3546,9 @@ bool magic_mapping(int map_radius, int proportion, bool suppress_msg, // Hack to give demonspawn Pandemonium mutation the ability // to detect exits magically. - if ((you.mutation[MUT_PANDEMONIUM] > 1 - && grd[i][j] == DNGN_EXIT_PANDEMONIUM) - || wizard_map) + if (wizard_map + || player_mutation_level(MUT_PANDEMONIUM) > 1 + && grd[i][j] == DNGN_EXIT_PANDEMONIUM) { set_terrain_seen( i, j ); } @@ -4842,9 +4844,11 @@ void viewwindow(bool draw_it, bool do_updates) // alter colour if flashing the characters vision if (flash_colour && buffy[bufcount]) + { buffy[bufcount + 1] = see_grid(gc.x, gc.y)? real_colour(flash_colour) : DARKGREY; + } bufcount += 2; } -- cgit v1.2.3-54-g00ecf