From a1dd87704d101b2e7b240c22fd7aea3d9d6e27aa Mon Sep 17 00:00:00 2001 From: dolorous Date: Wed, 19 Nov 2008 01:46:28 +0000 Subject: Turn kenkus' hardcoded pecking attack and inability to wear helmets into an intrinsic beak mutation (assuming, of course, that the beak is what makes helmets unwearable). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7493 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/describe.cc | 3 +-- crawl-ref/source/enum.h | 33 +++++++++++++++++---------------- crawl-ref/source/fight.cc | 4 ++-- crawl-ref/source/item_use.cc | 5 ++--- crawl-ref/source/itemprop.cc | 8 ++++---- crawl-ref/source/mutation.cc | 34 ++++++++++++++++++++++------------ crawl-ref/source/newgame.cc | 1 + crawl-ref/source/output.cc | 4 +++- crawl-ref/source/player.cc | 9 ++++++--- crawl-ref/source/transfor.cc | 21 ++++----------------- 10 files changed, 62 insertions(+), 60 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index 6e1b25077c..5805aa6113 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -3232,8 +3232,7 @@ std::string get_skill_description(int skill, bool need_title) { unarmed_attacks.push_back("bite other creatures"); } - - if (you.species == SP_KENKU) + else if (player_mutation_level(MUT_BEAK)) unarmed_attacks.push_back("peck at monsters with your beak"); if (player_mutation_level(MUT_HORNS)) diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index 23d4e15c44..876a16b3ba 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -2172,45 +2172,46 @@ enum mutation_type MUT_BREATHE_FLAMES, // 30 MUT_BLINK, MUT_HORNS, + MUT_BEAK, MUT_STRONG_STIFF, - MUT_FLEXIBLE_WEAK, - MUT_SCREAM, // 35 + MUT_FLEXIBLE_WEAK, // 35 + MUT_SCREAM, MUT_CLARITY, MUT_BERSERK, MUT_DETERIORATION, - MUT_BLURRY_VISION, - MUT_MUTATION_RESISTANCE, // 40 + MUT_BLURRY_VISION, // 40 + MUT_MUTATION_RESISTANCE, MUT_FRAIL, MUT_ROBUST, MUT_TORMENT_RESISTANCE, - MUT_NEGATIVE_ENERGY_RESISTANCE, - MUT_SUMMON_MINOR_DEMONS, // 45 + MUT_NEGATIVE_ENERGY_RESISTANCE, // 45 + MUT_SUMMON_MINOR_DEMONS, MUT_SUMMON_DEMONS, MUT_HURL_HELLFIRE, MUT_CALL_TORMENT, - MUT_RAISE_DEAD, - MUT_CONTROL_DEMONS, // 50 + MUT_RAISE_DEAD, // 50 + MUT_CONTROL_DEMONS, MUT_PANDEMONIUM, MUT_DEATH_STRENGTH, MUT_CHANNEL_HELL, - MUT_DRAIN_LIFE, - MUT_THROW_FLAMES, // 55 + MUT_DRAIN_LIFE, // 55 + MUT_THROW_FLAMES, MUT_THROW_FROST, MUT_SMITE, MUT_CLAWS, - MUT_FANGS, // new in 0.3 + MUT_FANGS, // new in 0.3 -- 60 // hooves and talons can replace feet - MUT_HOOVES, // 60 + MUT_HOOVES, MUT_TALONS, // new in 0.4 MUT_BREATHE_POISON, MUT_STINGER, - MUT_BIG_WINGS, - MUT_BLUE_MARKS, // 65, decorative, as in "mark of the devil" + MUT_BIG_WINGS, // 65 + MUT_BLUE_MARKS, // decorative, as in "mark of the devil" MUT_GREEN_MARKS, MUT_SAPROVOROUS, MUT_SHAGGY_FUR, // new in 0.4 - MUT_HIGH_MAGIC, // new in 0.4 - MUT_LOW_MAGIC, // new in 0.4 -- 70 + MUT_HIGH_MAGIC, // new in 0.4 -- 70 + MUT_LOW_MAGIC, // new in 0.4 // several types of scales (affect AC and sometimes more) MUT_RED_SCALES = 75, // 75 diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 794e264666..619217047d 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -941,7 +941,7 @@ bool melee_attack::player_aux_unarmed() if (uattack != UNAT_HEADBUTT) { if (!player_mutation_level(MUT_HORNS) - && you.species != SP_KENKU + && !player_mutation_level(MUT_BEAK) || !one_chance_in(3)) { continue; @@ -957,7 +957,7 @@ bool melee_attack::player_aux_unarmed() continue; } - if (you.species == SP_KENKU + if (player_mutation_level(MUT_BEAK) && (!player_mutation_level(MUT_HORNS) || coinflip())) { unarmed_attack = "peck"; diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 56f17edf77..a37d5f9681 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -962,11 +962,10 @@ bool can_wear_armour(const item_def &item, bool verbose, bool ignore_temporary) return (false); } - if (you.species == SP_KENKU - && (ignore_temporary || !player_is_shapechanged())) + if (player_mutation_level(MUT_BEAK)) { if (verbose) - mpr("That helmet does not fit your head!"); + mpr("You can't wear that with your beak!"); return (false); } diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc index 1a417abe2a..915223cf6d 100644 --- a/crawl-ref/source/itemprop.cc +++ b/crawl-ref/source/itemprop.cc @@ -1236,18 +1236,18 @@ bool check_armour_shape( const item_def &item, bool quiet ) if (!is_hard_helmet(item)) break; - if (you.species == SP_KENKU) + if (player_mutation_level(MUT_HORNS)) { if (!quiet) - mpr( "That helmet does not fit your head!" ); + mpr( "You can't wear that with your horns!" ); return (false); } - if (player_mutation_level(MUT_HORNS)) + if (player_mutation_level(MUT_BEAK)) { if (!quiet) - mpr( "You can't wear that with your horns!" ); + mpr( "You can't wear that with your beak!" ); return (false); } diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc index b50c788020..8b592d471f 100644 --- a/crawl-ref/source/mutation.cc +++ b/crawl-ref/source/mutation.cc @@ -185,6 +185,8 @@ const char *mutation_descrip[][3] = { "You have a pair of horns on your head.", "You have a pair of large horns on your head."}, + {"You have a beak for a mouth.", "", ""}, + {"Your muscles are strong (Str +1), but stiff (Dex -1).", "Your muscles are very strong (Str +2), but stiff (Dex -2).", "Your muscles are extremely strong (Str +3), but stiff (Dex -3)."}, @@ -479,6 +481,8 @@ const char *gain_mutation[][3] = { "The horns on your head grow some more.", "The horns on your head grow some more."}, + {"Your mouth lengthens and hardens into a beak!", "", ""}, + {"Your muscles feel sore.", "Your muscles feel sore.", "Your muscles feel sore."}, @@ -717,6 +721,8 @@ const char *lose_mutation[][3] = { "The horns on your head shrink a bit.", "The horns on your head shrink a bit."}, + {"Your beak shortens and softens into a mouth.", "", ""}, + {"Your muscles feel loose.", "Your muscles feel loose.", "Your muscles feel loose."}, @@ -902,14 +908,15 @@ static mutation_def mutation_defs[] = { { MUT_BREATHE_FLAMES, 4, 3, false, false }, { MUT_BLINK, 3, 3, false, false }, { MUT_HORNS, 7, 3, false, true }, + { MUT_BEAK, 1, 1, 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_BLURRY_VISION, 10, 3, true, false }, { MUT_MUTATION_RESISTANCE, 4, 3, false, false }, { MUT_FRAIL, 10, 3, true, true }, { MUT_ROBUST, 5, 3, false, true }, @@ -921,8 +928,8 @@ static mutation_def mutation_defs[] = { { 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_RAISE_DEAD, 0, 1, false, false }, { MUT_CONTROL_DEMONS, 0, 1, false, false }, { MUT_PANDEMONIUM, 0, 1, false, false }, { MUT_DEATH_STRENGTH, 0, 1, false, false }, @@ -934,8 +941,8 @@ static mutation_def mutation_defs[] = { // end of demonic powers { MUT_CLAWS, 2, 3, false, true }, - { MUT_FANGS, 1, 3, false, true }, // 60 + { MUT_FANGS, 1, 3, false, true }, { MUT_HOOVES, 1, 1, false, true }, { MUT_TALONS, 1, 1, false, true }, @@ -955,13 +962,12 @@ static mutation_def mutation_defs[] = { { MUT_SHAGGY_FUR, 2, 3, false, true }, - { MUT_HIGH_MAGIC, 1, 3, false, false }, // 70 + { MUT_HIGH_MAGIC, 1, 3, false, 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, true }, @@ -1113,15 +1119,14 @@ formatted_string describe_mutations() break; case SP_KENKU: - result += "You cannot wear helmets." EOL; if (you.experience_level > 4) { result += "You can fly"; if (you.experience_level > 14) result += " continuously"; result += "." EOL; + have_any = true; } - have_any = true; break; case SP_MUMMY: @@ -1581,6 +1586,7 @@ static int calc_mutation_amusement_value(mutation_type which_mutation) case MUT_BREATHE_FLAMES: case MUT_BLINK: case MUT_HORNS: + case MUT_BEAK: case MUT_SCREAM: case MUT_BERSERK: case MUT_DETERIORATION: @@ -1887,6 +1893,13 @@ bool mutate(mutation_type which_mutation, bool failMsg, return (false); } + // No fangs with beaks, or vice versa. + if ((mutat == MUT_FANGS && you.mutation[MUT_BEAK] > 0) + || (mutat == MUT_BEAK && you.mutation[MUT_FANGS] > 0)) + { + return (false); + } + // Putting boots on after they are forced off. -- bwr if ((mutat == MUT_HOOVES || mutat == MUT_TALONS) && !player_has_feet()) @@ -1894,10 +1907,6 @@ bool mutate(mutation_type which_mutation, bool failMsg, 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); @@ -2067,9 +2076,10 @@ bool mutate(mutation_type which_mutation, bool failMsg, break; case MUT_HORNS: + case MUT_BEAK: mpr(gain_mutation[mutat][you.mutation[mutat]], MSGCH_MUTATION); - // Horns force hard helmets off. + // Horns and beaks force hard helmets off. if (you.equip[EQ_HELMET] != -1 && is_hard_helmet(you.inv[you.equip[EQ_HELMET]]) && you_tran_can_wear(EQ_HELMET)) diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc index c7a44f359a..a477165ac6 100644 --- a/crawl-ref/source/newgame.cc +++ b/crawl-ref/source/newgame.cc @@ -2793,6 +2793,7 @@ void give_basic_mutations(species_type speci) you.mutation[MUT_CARNIVOROUS] = 3; break; case SP_KENKU: + you.mutation[MUT_BEAK] = 1; you.mutation[MUT_TALONS] = 1; break; case SP_TROLL: diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc index 2dbc1a9649..a35276a8a9 100644 --- a/crawl-ref/source/output.cc +++ b/crawl-ref/source/output.cc @@ -2345,7 +2345,6 @@ std::string _status_mut_abilities() break; case SP_KENKU: - mutations.push_back("cannot wear helmets"); if (you.experience_level > 4) { std::string help = "able to fly"; @@ -2558,6 +2557,9 @@ std::string _status_mut_abilities() snprintf(info, INFO_SIZE, "horns %d", level); current = info; break; + case MUT_BEAK: + current = "beak"; + break; case MUT_STRONG_STIFF: Str_change += level; Dex_change -= level; diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 02c7bf7abe..9cd7f6bb30 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -568,12 +568,15 @@ bool you_can_wear(int eq, bool special_armour) if (you.species == SP_KENKU && (eq == EQ_HELMET || eq == EQ_BOOTS)) return (false); - if (player_mutation_level(MUT_HORNS) && eq == EQ_HELMET) - return (special_armour); - if (you.species == SP_GHOUL && eq == EQ_GLOVES) return (false); + if (eq == EQ_HELMET + && (player_mutation_level(MUT_HORNS) || player_mutation_level(MUT_BEAK))) + { + return (special_armour); + } + // Else, no problems. return (true); } diff --git a/crawl-ref/source/transfor.cc b/crawl-ref/source/transfor.cc index 3340c16434..f677f4830a 100644 --- a/crawl-ref/source/transfor.cc +++ b/crawl-ref/source/transfor.cc @@ -881,25 +881,12 @@ void untransform(void) // cases to handle a large number of things (see wear_armour()) -- bwr bool can_equip( equipment_type use_which, bool ignore_temporary ) { - // if more cases are added to this if must also change in - // item_use for naga barding - if (ignore_temporary || !player_is_shapechanged()) - /* or a transformation which doesn't change overall shape */ + if (use_which == EQ_HELMET + && (player_mutation_level(MUT_HORNS) + || player_mutation_level(MUT_BEAK))) { - if (use_which == EQ_HELMET) - { - switch (you.species) - { - case SP_KENKU: - return (false); - default: - break; - } - } - } - - if (use_which == EQ_HELMET && player_mutation_level(MUT_HORNS)) return (false); + } if (use_which == EQ_BOOTS && !player_has_feet()) return (false); -- cgit v1.2.3-54-g00ecf