From f3f93a328f7c076f46be200133af034e42956f6d Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Fri, 26 Oct 2007 22:38:21 +0000 Subject: Adding two new mutations for the heck of it: * MUT_PAWS: "You have soft paws in place of feet." Similar to HOOVES and TALONS - incidentally, I resorted a few mutations for better grouping - but increases stealth. * MUT_EXTRA_EYES: grow up to three extra eyes that increase depth perception and thus accuracy. I'm still looking for a drawback to this mutation (other than looking weird). Also, could be related to ACUTE/BLURRY VISION somehow. Breaks saves, or at least mutations. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2606 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/beam.cc | 2 + crawl-ref/source/debug.cc | 10 +++- crawl-ref/source/effects.cc | 5 +- crawl-ref/source/enum.h | 28 +++++---- crawl-ref/source/fight.cc | 5 +- crawl-ref/source/item_use.cc | 9 +++ crawl-ref/source/itemprop.cc | 8 +++ crawl-ref/source/mutation.cc | 132 +++++++++++++++++++++++++++---------------- crawl-ref/source/output.cc | 22 +++++++- crawl-ref/source/player.cc | 24 +++++++- crawl-ref/source/player.h | 1 + crawl-ref/source/transfor.cc | 15 +---- 12 files changed, 175 insertions(+), 86 deletions(-) diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index c84a1cfc9f..107177c624 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -1221,6 +1221,8 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) break; } // end of switch + pbolt.hit += you.mutation[MUT_EXTRA_EYES] * 2; + if ( wearing_amulet(AMU_INACCURACY) ) { pbolt.hit -= 5; diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc index 6902c614b0..ec4bfd62c0 100644 --- a/crawl-ref/source/debug.cc +++ b/crawl-ref/source/debug.cc @@ -1841,8 +1841,10 @@ static const char *mutation_type_names[] = { "throw frost", "smite", "claws", - "hooves", "fangs", + "hooves", + "talons", + "paws", "breathe poison", "stinger", "big wings", @@ -1850,8 +1852,12 @@ static const char *mutation_type_names[] = { "green marks", "drifting", "saprovorous", - "talons", + "extra eyes", + "", + "", + "", "", + // from here on scales "red scales", "nacreous scales", "grey2 scales", diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc index 05cf9168c3..4a3368b944 100644 --- a/crawl-ref/source/effects.cc +++ b/crawl-ref/source/effects.cc @@ -861,9 +861,8 @@ static int find_acquirement_subtype(object_class_type class_wanted, type_wanted = (coinflip()) ? OBJ_RANDOM : ARM_SHIELD + random2(5); // mutation specific problems (horns allow caps) - if (((you.mutation[MUT_HOOVES] || you.mutation[MUT_TALONS]) - && type_wanted == ARM_BOOTS) - || (you.mutation[MUT_CLAWS] >= 3 && type_wanted == ARM_GLOVES)) + if (type_wanted == ARM_BOOTS && !player_has_feet() + || you.mutation[MUT_CLAWS] >= 3 && type_wanted == ARM_GLOVES) { type_wanted = OBJ_RANDOM; } diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index ce65a8a404..4fd367f028 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -2002,34 +2002,38 @@ enum mutation_type MUT_DRAIN_LIFE, MUT_THROW_FLAMES, // 55 MUT_THROW_FROST, - MUT_SMITE, // 57 - MUT_CLAWS, //jmf: added - MUT_HOOVES, //jmf: etc. - MUT_FANGS, // 60 + MUT_SMITE, + MUT_CLAWS, + MUT_FANGS, // new in 0.3 + // hooves, talons, paws can replace feet + MUT_HOOVES, // 60 + MUT_TALONS, // new in 0.4 + MUT_PAWS, // new in 0.4 MUT_BREATHE_POISON, MUT_STINGER, - MUT_BIG_WINGS, - MUT_BLUE_MARKS, // 64 - decorative, as in "mark of the devil" - MUT_GREEN_MARKS, // 65 + MUT_BIG_WINGS, // 65 + MUT_BLUE_MARKS, // decorative, as in "mark of the devil" + MUT_GREEN_MARKS, MUT_DRIFTING, MUT_SAPROVOROUS, - MUT_TALONS, - MUT_RED_SCALES = 70, // 70 + MUT_EXTRA_EYES, // new in 0.4 -- 70 + // several types of scales (affect AC and sometimes more) + MUT_RED_SCALES = 75, // 75 MUT_NACREOUS_SCALES, MUT_GREY2_SCALES, MUT_METALLIC_SCALES, MUT_BLACK2_SCALES, - MUT_WHITE_SCALES, // 75 + MUT_WHITE_SCALES, // 80 MUT_YELLOW_SCALES, MUT_BROWN_SCALES, MUT_BLUE_SCALES, MUT_PURPLE_SCALES, - MUT_SPECKLED_SCALES, // 80 + MUT_SPECKLED_SCALES, // 85 MUT_ORANGE_SCALES, MUT_INDIGO_SCALES, MUT_RED2_SCALES, MUT_IRIDESCENT_SCALES, - MUT_PATTERNED_SCALES, // 85 + MUT_PATTERNED_SCALES, // 90 NUM_MUTATIONS, RANDOM_MUTATION = 100, diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 9bc54edda8..6eef4bd4b3 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -176,7 +176,8 @@ static int calc_your_to_hit_unarmed(int uattack = UNAT_NO_ATTACK, int your_to_hit; your_to_hit = 13 + you.dex / 2 + you.skills[SK_UNARMED_COMBAT] / 2 - + you.skills[SK_FIGHTING] / 5; + + you.skills[SK_FIGHTING] / 5 + + 2 * you.mutation[MUT_EXTRA_EYES]; if (wearing_amulet(AMU_INACCURACY)) your_to_hit -= 5; @@ -2364,6 +2365,8 @@ int melee_attack::player_to_hit(bool random_factor) if (water_attack) your_to_hit += 5; + your_to_hit += you.mutation[MUT_EXTRA_EYES] * 2; + if (wearing_amulet(AMU_INACCURACY)) your_to_hit -= 5; diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 7748887ade..906d824b9b 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -797,6 +797,13 @@ bool can_wear_armour(const item_def &item, bool verbose, bool ignore_temporary) return (false); } + if (you.mutation[MUT_PAWS]) + { + if (verbose) + mpr("Boots don't fit your paws!"); + return (false); + } + if (you.species == SP_NAGA) { if (verbose) @@ -1701,6 +1708,8 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus, ammoHitBonus = item.plus; ammoDamBonus = item.plus2; + ammoHitBonus += you.mutation[MUT_EXTRA_EYES]; + // CALCULATIONS FOR LAUNCHED WEAPONS if (projected == LRET_LAUNCHED) { diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc index fef0cf534f..0a591f2517 100644 --- a/crawl-ref/source/itemprop.cc +++ b/crawl-ref/source/itemprop.cc @@ -1093,6 +1093,14 @@ bool check_armour_shape( const item_def &item, bool quiet ) return (false); } + if (you.mutation[MUT_PAWS]) + { + if (!quiet) + mpr("Boots don't fit your paws!"); + + return (false); + } + switch (you.species) { case SP_NAGA: diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc index 733bb0bf30..27353bfc20 100644 --- a/crawl-ref/source/mutation.cc +++ b/crawl-ref/source/mutation.cc @@ -265,19 +265,22 @@ const char *mutation_descrip[][3] = { {"You have sharp fingernails.", "You have very sharp fingernails.", "You have claws for hands."}, - {"You have hooves in place of feet.", "", ""}, - - // 60 - leave some space for more demonic powers... - {"You have very sharp teeth.", "You have extremely sharp teeth.", "You have razor-sharp teeth."}, - + + // 60 - leave some space for more demonic powers... + + {"You have hooves in place of feet.", "", ""}, + {"You have talons in place of feet.", "", ""}, + {"You have soft paws in place of feet.", "", ""}, + {"You can exhale a cloud of poison.", "", ""}, {"Your tail ends in a poisonous barb.", "Your tail ends in a sharp poisonous barb.", "Your tail ends in a wicked poisonous barb."}, //jmf: nagas & dracos + // 65 {"Your wings are large and strong.", "", ""}, //jmf: dracos only //jmf: these next two are for evil gods to mark their followers; good gods @@ -287,7 +290,6 @@ const char *mutation_descrip[][3] = { "There are several blue sigils on your hands and arms.", "Your hands, arms and shoulders are covered in intricate, arcane blue writing."}, - // 65 {"There is a green sigil on your chest.", "There are several green sigils on your chest and abdomen.", "Your chest, abdomen and neck are covered in intricate, arcane green writing."}, @@ -299,11 +301,17 @@ const char *mutation_descrip[][3] = { {"You can tolerate rotten meat.", "You can eat rotten meat.", "You thrive on rotten meat."}, - {"You have talons in place of feet.", "", ""}, + // 70 + {"You have a third eye on your forehead.", + "You have two additional eyes on your forehead.", + "You have three additional eyes on your forehead."}, {"", "", ""}, + {"", "", ""}, + {"", "", ""}, + {"", "", ""}, - // 70 + // 75 {"You are partially covered in red scales (AC + 1).", "You are mostly covered in red scales (AC + 2).", "You are covered in red scales (AC + 4)."}, @@ -344,7 +352,7 @@ const char *mutation_descrip[][3] = { "You are mostly covered in purple scales (AC + 4).", "You are completely covered in purple scales (AC + 6)."}, -// 80 + // 85 {"You are partially covered in speckled scales (AC + 1).", "You are mostly covered in speckled scales (AC + 2).", "You are covered in speckled scales (AC + 3)."}, @@ -522,13 +530,15 @@ const char *gain_mutation[][3] = { {"Your fingernails lengthen.", "Your fingernails sharpen.", "Your hands twist into claws."}, - {"Your feet shrivel into cloven hooves.", "", ""}, - - // 60 {"Your teeth lengthen and sharpen.", "Your teeth lengthen and sharpen some more.", "Your teeth are very long and razor-sharp."}, + // 60 + {"Your feet shrivel into cloven hooves.", "", ""}, + {"Your feet stretch and sharpen into talons.", "", ""}, + {"Your feet sprout fur and twist into soft paws.", "", ""}, + {"You taste something nasty.", "You taste something very nasty.", "You taste something extremely nasty."}, @@ -536,12 +546,12 @@ const char *gain_mutation[][3] = { "The barb on your tail looks sharper.", "The barb on your tail looks very sharp."}, + // 65 {"Your wings grow larger and stronger.", "", ""}, {"Your hands itch.", "Your hands and forearms itch.", "Your arms, hands and shoulders itch."}, - // 65 {"Your chest itches.", "Your chest and abdomen itch.", "Your chest, abdomen and neck itch."}, @@ -552,11 +562,17 @@ const char *gain_mutation[][3] = { // saprovorous: can never be gained or lost, only started with {"", "", ""}, - {"Your feet stretch and sharpen into talons.", "", ""}, - + // 70 + {"You sprout an extra eye.", + "You sprout another eye.", + "You sprout another eye."}, + + {"", "", ""}, + {"", "", ""}, + {"", "", ""}, {"", "", ""}, - // 70 + // 75 {"Red scales grow over part of your body.", "Red scales spread over more of your body.", "Red scales cover you completely."}, @@ -588,7 +604,7 @@ const char *gain_mutation[][3] = { "Purple scales spread over more of your body.", "Purple scales cover you completely."}, - // 80 + // 85 {"Speckled scales grow over part of your body.", "Speckled scales spread over more of your body.", "Speckled scales cover you completely."}, @@ -753,20 +769,23 @@ const char *lose_mutation[][3] = { {"Your fingernails shrink to normal size.", "Your fingernails look duller.", "Your hands feel fleshier."}, - {"Your hooves expand and flesh out into feet!", "", ""}, - - // 60 {"Your teeth shrink to normal size.", "Your teeth shrink and become duller.", "Your teeth shrink and become duller."}, - + + // 60 + {"Your hooves expand and flesh out into feet!", "", ""}, + {"Your talons dull and shrink into feet.", "", ""}, + {"Your paws shed and extend into feet.", "", ""}, + {"", "", ""}, {"", "", ""}, + + // 65 {"", "", ""}, {"", "", ""}, - - // 65 {"", "", ""}, + {"Your movements feel completely certain again.", "Your movements feel more certain.", "Your movements feel more certain."}, @@ -774,11 +793,17 @@ const char *lose_mutation[][3] = { // saprovorous: can never be gained or lost, only started with {"", "", ""}, - {"Your talons dull and shrink into feet.", "", ""}, + // 70 + {"Your extra eye disappears.", + "One of your extra eyes disappears.", + "One of your extra eyes disappears."}, {"", "", ""}, - - // 70 + {"", "", ""}, + {"", "", ""}, + {"", "", ""}, + + // 75 {"Your red scales disappear.", "Your red scales recede somewhat.", "Your red scales recede somewhat."}, @@ -812,7 +837,7 @@ const char *lose_mutation[][3] = { {"Your purple scales disappear.", "Your purple scales recede somewhat.", "Your purple scales recede somewhat."}, - // 80 + // 85 {"Your speckled scales disappear.", "Your speckled scales recede somewhat.", "Your speckled scales recede somewhat."}, @@ -836,6 +861,9 @@ const char *lose_mutation[][3] = { "Your patterned scales recede somewhat."}, }; +/* mutation definitions: + first number = probability (0 means it doesn't appear naturally?) + second number = maximum levels */ static const mutation_def mutation_defs[] = { { MUT_TOUGH_SKIN, 10, 3 }, { MUT_STRONG, 8, 14 }, @@ -884,6 +912,7 @@ static const mutation_def mutation_defs[] = { { MUT_MUTATION_RESISTANCE, 4, 3 }, { MUT_FRAIL, 10, 3 }, { MUT_ROBUST, 5, 3 }, + /* Some demonic powers start here: */ { MUT_TORMENT_RESISTANCE, 0, 1 }, { MUT_NEGATIVE_ENERGY_RESISTANCE, 0, 3 }, @@ -901,24 +930,29 @@ static const mutation_def mutation_defs[] = { { MUT_THROW_FLAMES, 0, 1 }, { MUT_THROW_FROST, 0, 1 }, { MUT_SMITE, 0, 1 }, +/* end of demonic powers */ + { MUT_CLAWS, 2, 3 }, - { MUT_HOOVES, 1, 1 }, -// 60 { MUT_FANGS, 1, 3 }, - { MUT_BREATHE_POISON, 0, 1 }, - { MUT_STINGER, 0, 3 }, - { MUT_BIG_WINGS, 0, 3 }, - { MUT_BLUE_MARKS, 0, 3 }, +// 60 + { MUT_HOOVES, 1, 1 }, + { MUT_TALONS, 1, 1 }, + { MUT_PAWS, 1, 1 }, + { MUT_BREATHE_POISON, 0, 1 }, // Naga only + { MUT_STINGER, 0, 3 }, // Naga and Draconian only // 65 + { MUT_BIG_WINGS, 0, 3 }, // Draconian only + { MUT_BLUE_MARKS, 0, 3 }, // used by evil gods to mark followers { MUT_GREEN_MARKS, 0, 3 }, + { MUT_DRIFTING, 3, 3 }, - { MUT_SAPROVOROUS, 0, 3 }, - { MUT_TALONS, 1, 1 }, + { MUT_SAPROVOROUS, 0, 3 }, // species-dependent innate mutation + { MUT_EXTRA_EYES, 1, 3 }, { RANDOM_MUTATION, 0, 3 }, -// 70 +// 75 -- scales of various colours and effects { MUT_RED_SCALES, 2, 3 }, { MUT_NACREOUS_SCALES, 1, 3 }, { MUT_GREY2_SCALES, 2, 3 }, @@ -929,7 +963,7 @@ static const mutation_def mutation_defs[] = { { MUT_BROWN_SCALES, 2, 3 }, { MUT_BLUE_SCALES, 2, 3 }, { MUT_PURPLE_SCALES, 2, 3 }, -// 80 +// 85 { MUT_SPECKLED_SCALES, 2, 3 }, { MUT_ORANGE_SCALES, 2, 3 }, { MUT_INDIGO_SCALES, 2, 3 }, @@ -1318,15 +1352,17 @@ static int calc_mutation_amusement_value(mutation_type which_mutation) case MUT_BLURRY_VISION: case MUT_FRAIL: case MUT_CLAWS: - case MUT_HOOVES: case MUT_FANGS: + case MUT_HOOVES: + case MUT_TALONS: + case MUT_PAWS: case MUT_BREATHE_POISON: case MUT_STINGER: case MUT_BIG_WINGS: case MUT_BLUE_MARKS: case MUT_GREEN_MARKS: case MUT_DRIFTING: - case MUT_TALONS: + case MUT_EXTRA_EYES: amusement *= 2; // funny! break; @@ -1513,17 +1549,8 @@ bool mutate(mutation_type which_mutation, bool failMsg, bool force_mutation, } // putting boots on after they are forced off. -- bwr - if (mutat == MUT_HOOVES - && (you.mutation[MUT_TALONS] || you.species == SP_NAGA - || player_genus(GENPC_DRACONIAN))) - { - return false; - } - - // putting boots on after they are forced off. -- bwr - if (mutat == MUT_TALONS - && (you.mutation[MUT_HOOVES] || you.species == SP_NAGA - || player_genus(GENPC_DRACONIAN))) + if ((mutat == MUT_HOOVES || mutat == MUT_TALONS || mutat == MUT_PAWS) + && !player_has_feet()) { return false; } @@ -1674,6 +1701,7 @@ bool mutate(mutation_type which_mutation, bool failMsg, bool force_mutation, //jmf: like horns case MUT_HOOVES: case MUT_TALONS: + case MUT_PAWS: mpr(gain_mutation[mutat][you.mutation[mutat]], MSGCH_MUTATION); remove_one_equip(EQ_BOOTS); break; @@ -1705,6 +1733,10 @@ bool mutate(mutation_type which_mutation, bool failMsg, bool force_mutation, remove_one_equip(EQ_HELMET); } break; + + case MUT_EXTRA_EYES: + mpr(gain_mutation[mutat][you.mutation[mutat]], MSGCH_MUTATION); + break; case MUT_STRONG_STIFF: if (you.mutation[MUT_FLEXIBLE_WEAK] > 0) diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc index 995039e0e5..b5b14fe1b2 100644 --- a/crawl-ref/source/output.cc +++ b/crawl-ref/source/output.cc @@ -2045,6 +2045,13 @@ std::string status_mut_abilities() text += info; have_any = true; break; + case MUT_FANGS: + if (have_any) + text += ", "; + snprintf(info, INFO_SIZE, "sharp teeth %d", level); + text += info; + have_any = true; + break; case MUT_HOOVES: if (have_any) text += ", "; @@ -2057,11 +2064,10 @@ std::string status_mut_abilities() text += "talons"; have_any = true; break; - case MUT_FANGS: + case MUT_PAWS: if (have_any) text += ", "; - snprintf(info, INFO_SIZE, "sharp teeth %d", level); - text += info; + text += "soft paws"; have_any = true; break; case MUT_BREATHE_POISON: @@ -2097,6 +2103,16 @@ std::string status_mut_abilities() text += info; have_any = true; break; + case MUT_EXTRA_EYES: + if (have_any) + text += ", "; + snprintf(info, INFO_SIZE, "%d extra eye%s", + level, level > 1? "s" : ""); + text += info; + have_any = true; + break; + + // scales -> calculate sum of AC bonus case MUT_RED_SCALES: AC_change += level; if (level == 3) diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 5fa78b1ce5..f067794e77 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -459,6 +459,20 @@ bool you_can_wear(int eq, bool special_armour) return true; } +bool player_has_feet() +{ + if (you.species == SP_NAGA || player_genus(GENPC_DRACONIAN)) + return false; + + if (you.mutation[MUT_HOOVES] || you.mutation[MUT_TALONS] + || you.mutation[MUT_PAWS]) + { + return false; + } + + return true; +} + bool you_tran_can_wear(int eq, bool check_mutation) { // not a transformation, but also temporary -> check first @@ -469,7 +483,8 @@ bool you_tran_can_wear(int eq, bool check_mutation) if (eq == EQ_BOOTS && (player_is_swimming() && you.species == SP_MERFOLK - || (you.mutation[MUT_HOOVES] || you.mutation[MUT_TALONS]))) + || you.mutation[MUT_HOOVES] || you.mutation[MUT_TALONS] + || you.mutation[MUT_PAWS])) { return false; } @@ -3267,7 +3282,12 @@ int check_stealth(void) stealth /= 2; // splashy-splashy } else - stealth -= you.mutation[MUT_HOOVES] * 10; // clippety-clop + { + if (you.mutation[MUT_HOOVES]) + stealth -= 10; // clippety-clop + else if (you.mutation[MUT_PAWS]) + stealth += 10; + } // Radiating silence is the negative complement of shouting all the // time... a sudden change from background noise to no noise is going diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h index 51fbb3da85..055649ff82 100644 --- a/crawl-ref/source/player.h +++ b/crawl-ref/source/player.h @@ -328,6 +328,7 @@ bool player_genus( genus_type which_genus, species_type species = SP_UNKNOWN ); bool you_can_wear( int eq, bool special_armour = false ); +bool player_has_feet(void); bool you_tran_can_wear( int eq, bool check_mutation = false ); /* *********************************************************************** diff --git a/crawl-ref/source/transfor.cc b/crawl-ref/source/transfor.cc index 3070123ac1..f2a495fef1 100644 --- a/crawl-ref/source/transfor.cc +++ b/crawl-ref/source/transfor.cc @@ -605,17 +605,7 @@ bool can_equip( equipment_type use_which, bool ignore_temporary ) if (ignore_temporary || !player_is_shapechanged()) /* or a transformation which doesn't change overall shape */ { - if (use_which == EQ_BOOTS) - { - switch (you.species) - { - case SP_NAGA: - return (false); - default: - break; - } - } - else if (use_which == EQ_HELMET) + if (use_which == EQ_HELMET) { switch (you.species) { @@ -630,8 +620,7 @@ bool can_equip( equipment_type use_which, bool ignore_temporary ) if (use_which == EQ_HELMET && you.mutation[MUT_HORNS]) return (false); - if (use_which == EQ_BOOTS && - (you.mutation[MUT_HOOVES] || you.mutation[MUT_TALONS])) + if (use_which == EQ_BOOTS && !player_has_feet()) return (false); if (use_which == EQ_GLOVES && you.mutation[MUT_CLAWS] >= 3) -- cgit v1.2.3-54-g00ecf