From dea58872adf42144fad9d1dbdeb5f09cf4433402 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Mon, 10 Sep 2007 09:59:37 +0000 Subject: Applying several patches by dolorous: * 1789774: intrinsic mutations for undead * 1790380: kobold special handling of disease * 1790723: missing periods * 1791092: Xom potion handling It's arguable whether we want such fine distinction between races. As David pointed out, small things of lesser importance might clutter the mutations screen. For now, I think transparency is good. And if it seems to much, we could remove a few. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2064 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/beam.cc | 2 +- crawl-ref/source/it_use2.cc | 19 +++++++------------ crawl-ref/source/mutation.cc | 23 ++++++++++++----------- crawl-ref/source/newgame.cc | 5 +++++ crawl-ref/source/player.cc | 35 +++++++++++++++++++++++------------ crawl-ref/source/player.h | 6 +++--- crawl-ref/source/spl-cast.cc | 6 ------ 7 files changed, 51 insertions(+), 45 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 383afd6370..de7c3b96d9 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -3248,7 +3248,7 @@ static int affect_player( bolt &beam ) break; // banishment to the abyss case BEAM_PAIN: // pain - if (you.is_undead || you.mutation[MUT_TORMENT_RESISTANCE]) + if (player_res_torment()) { mpr("You are unaffected."); break; diff --git a/crawl-ref/source/it_use2.cc b/crawl-ref/source/it_use2.cc index 588ea89aed..c6cac55f36 100644 --- a/crawl-ref/source/it_use2.cc +++ b/crawl-ref/source/it_use2.cc @@ -167,8 +167,8 @@ bool potion_effect( potion_type pot_eff, int pow ) break; case POT_SLOWING: - slow_player( (10 + random2(pow)) / factor ); - xom_is_stimulated(64 / factor); + if (slow_player((10 + random2(pow)) / factor)) + xom_is_stimulated(64 / factor); break; case POT_PARALYSIS: @@ -177,8 +177,8 @@ bool potion_effect( potion_type pot_eff, int pow ) break; case POT_CONFUSION: - confuse_player( (3 + random2(8)) / factor ); - xom_is_stimulated(128 / factor); + if (confuse_player((3 + random2(8)) / factor)) + xom_is_stimulated(128 / factor); break; case POT_INVISIBILITY: @@ -214,19 +214,14 @@ bool potion_effect( potion_type pot_eff, int pow ) case POT_DEGENERATION: mpr("There was something very wrong with that liquid!"); - lose_stat(STAT_RANDOM, 1 + random2avg(4, 2)); - xom_is_stimulated(64); + if (lose_stat(STAT_RANDOM, 1 + random2avg(4, 2))) + xom_is_stimulated(64); break; // Don't generate randomly - should be rare and interesting case POT_DECAY: - if (you.is_undead) - mpr( "You feel terrible." ); - else - { - rot_player( 10 + random2(10) ); + if (rot_player(10 + random2(10))) xom_is_stimulated(64); - } break; case POT_WATER: diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc index 85d98eed44..55d3cab856 100644 --- a/crawl-ref/source/mutation.cc +++ b/crawl-ref/source/mutation.cc @@ -402,8 +402,8 @@ const char *gain_mutation[][3] = { {"You feel weaker.", "You feel weaker.", "You feel weaker."}, - {"You feel less intelligent.", "You feel less intelligent", - "You feel less intelligent"}, + {"You feel less intelligent.", "You feel less intelligent.", + "You feel less intelligent."}, // 20 {"You feel clumsy.", "You feel clumsy.", "You feel clumsy."}, @@ -967,7 +967,7 @@ formatted_string describe_mutations() result += troll_claw_descrip[you.mutation[MUT_CLAWS]]; result += EOL; result += "You preferably eat rotten meat." EOL; - result += "You resist negative energy." EOL; + result += "You heal slowly." EOL; have_any = true; break; @@ -1007,7 +1007,7 @@ formatted_string describe_mutations() result += " strongly"; result += " in touch with the powers of death." EOL; - result += "You resist negative energy." EOL; + result += "Your flesh is vulnerable to fire." EOL; if (you.experience_level > 12) result += "You can restore your body by infusing magical energy." EOL; @@ -1089,6 +1089,7 @@ formatted_string describe_mutations() case SP_KOBOLD: result += "You can eat rotten meat." EOL; + result += "You recuperate from illness quickly." EOL; have_any = true; break; @@ -1106,16 +1107,16 @@ formatted_string describe_mutations() result += (you.experience_level > 25) ? " strongly" : ""; result += " in touch with the powers of death." EOL; - result += "You mostly resist negative energy." EOL; + result += "You are quite resistant to negative energy." EOL; result += "You can see invisible." EOL; result += ""; } - result += ""; - if (you.hunger_state < HS_HUNGRY) - result += "You do not regenerate." EOL; - else - result += "You regenerate slowly." EOL; - result += ""; + if (you.hunger_state == HS_FULL) + result += "Your natural rate of healing is unusually fast." EOL; + else if (you.hunger_state == HS_HUNGRY) + result += "You heal slowly." EOL; + else if (you.hunger_state < HS_HUNGRY) + result += "You do not heal." EOL; have_any = true; break; diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc index 52be813fc8..699e1ad6a7 100644 --- a/crawl-ref/source/newgame.cc +++ b/crawl-ref/source/newgame.cc @@ -1925,15 +1925,19 @@ static void give_basic_mutations(species_type speci) 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_NEGATIVE_ENERGY_RESISTANCE] = 3; break; case SP_GNOME: you.mutation[MUT_MAPPING] = 2; 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_NEGATIVE_ENERGY_RESISTANCE] = 3; you.mutation[MUT_CARNIVOROUS] = 3; break; case SP_TROLL: @@ -1946,6 +1950,7 @@ static void give_basic_mutations(species_type speci) case SP_VAMPIRE: you.mutation[MUT_FANGS] = 3; you.mutation[MUT_SLOW_METABOLISM] = 1; + you.mutation[MUT_TORMENT_RESISTANCE] = 1; you.mutation[MUT_POISON_RESISTANCE] = 1; break; default: diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 42b1138904..145a490d7f 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -1229,7 +1229,7 @@ bool player_control_teleport(bool calc_unid) { int player_res_torment(bool) { - return (you.is_undead || you.mutation[MUT_TORMENT_RESISTANCE]); + return (you.mutation[MUT_TORMENT_RESISTANCE]); } // funny that no races are susceptible to poisons {dlb} @@ -1472,8 +1472,6 @@ int player_prot_life(bool calc_unid) { pl += 2; } - else if (you.is_undead && you.species != SP_VAMPIRE) - pl += 3; switch (you.attribute[ATTR_TRANSFORMATION]) { @@ -1496,7 +1494,7 @@ int player_prot_life(bool calc_unid) // randart wpns pl += scan_randarts(RAP_NEGATIVE_ENERGY, calc_unid); - // demonic power + // undead/demonic power pl += you.mutation[MUT_NEGATIVE_ENERGY_RESISTANCE]; if (pl > 3) @@ -3352,7 +3350,7 @@ void display_char_status() } if (you.disease || you.species == SP_VAMPIRE && you.hunger_state < HS_HUNGRY) - mpr("You do not regenerate."); + mpr("You do not heal."); // prints a contamination message contaminate_player( 0, true ); @@ -4520,15 +4518,15 @@ void reduce_poison_player( int amount ) } } -void confuse_player( int amount, bool resistable ) +bool confuse_player( int amount, bool resistable ) { if (amount <= 0) - return; + return false; if (resistable && wearing_amulet(AMU_CLARITY)) { mpr( "You feel momentarily confused." ); - return; + return false; } const int old_value = you.duration[DUR_CONF]; @@ -4545,6 +4543,7 @@ void confuse_player( int amount, bool resistable ) xom_is_stimulated(you.duration[DUR_CONF] - old_value); } + return true; } void reduce_confuse_player( int amount ) @@ -4561,13 +4560,16 @@ void reduce_confuse_player( int amount ) } } -void slow_player( int amount ) +bool slow_player( int amount ) { if (amount <= 0) - return; + return false; if (wearing_amulet( AMU_RESIST_SLOW )) + { mpr("You feel momentarily lethargic."); + return false; + } else if (you.duration[DUR_SLOW] >= 100) mpr( "You already are as slow as you could be." ); else @@ -4583,6 +4585,7 @@ void slow_player( int amount ) you.duration[DUR_SLOW] = 100; learned_something_new(TUT_YOU_ENCHANTED); } + return true; } void dec_slow_player( void ) @@ -4667,6 +4670,7 @@ void dec_disease_player( void ) { you.disease--; + // kobolds and regenerators recuperate quickly if (you.disease > 5 && (you.species == SP_KOBOLD || you.duration[ DUR_REGENERATION ] @@ -4680,10 +4684,16 @@ void dec_disease_player( void ) } } -void rot_player( int amount ) +bool rot_player( int amount ) { if (amount <= 0) - return; + return false; + + if (you.is_undead) + { + mpr( "You feel terrible." ); + return false; + } if (you.rotting < 40) { @@ -4694,6 +4704,7 @@ void rot_player( int amount ) you.rotting += amount; } + return true; } diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h index fa566a5d9b..7a87e5d676 100644 --- a/crawl-ref/source/player.h +++ b/crawl-ref/source/player.h @@ -394,10 +394,10 @@ void contaminate_player(int change, bool statusOnly = false); bool poison_player( int amount, bool force = false ); void reduce_poison_player( int amount ); -void confuse_player( int amount, bool resistable = true ); +bool confuse_player( int amount, bool resistable = true ); void reduce_confuse_player( int amount ); -void slow_player( int amount ); +bool slow_player( int amount ); void dec_slow_player(); void haste_player( int amount ); @@ -407,7 +407,7 @@ void dec_haste_player(); bool disease_player( int amount ); void dec_disease_player(); -void rot_player( int amount ); +bool rot_player( int amount ); bool player_has_spell( int spell ); size_type player_size( int psize = PSIZE_TORSO, bool base = false ); diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index e9fd5b564e..5030564ed4 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -2705,12 +2705,6 @@ static void miscast_necromancy(int severity, const char* cause) break; case 3: - if (you.is_undead) - { - mpr("You feel terrible."); - break; - } - rot_player( random2avg(7, 2) + 1 ); break; -- cgit v1.2.3-54-g00ecf