From a5f6b9ec2ffcbdebca189f4fed30b8f1e24727dc Mon Sep 17 00:00:00 2001 From: dshaligram Date: Sun, 21 Oct 2007 13:05:22 +0000 Subject: [1800206] Ghoul food cleanup (dolorous). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2504 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/clua.cc | 2 + crawl-ref/source/debug.cc | 2 +- crawl-ref/source/delay.cc | 6 +- crawl-ref/source/describe.cc | 17 ++-- crawl-ref/source/enum.h | 1 + crawl-ref/source/externs.h | 2 + crawl-ref/source/food.cc | 190 ++++++++++++++++++++------------------ crawl-ref/source/invent.cc | 8 +- crawl-ref/source/it_use2.cc | 3 +- crawl-ref/source/items.cc | 67 +++++++------- crawl-ref/source/lua/eat.lua | 6 +- crawl-ref/source/lua/safechnk.lua | 8 +- crawl-ref/source/mutation.cc | 23 +++-- crawl-ref/source/newgame.cc | 7 ++ crawl-ref/source/output.cc | 77 ++------------- crawl-ref/source/player.cc | 5 + 16 files changed, 189 insertions(+), 235 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/clua.cc b/crawl-ref/source/clua.cc index 1381c92314..67428db271 100644 --- a/crawl-ref/source/clua.cc +++ b/crawl-ref/source/clua.cc @@ -728,6 +728,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_levitating, boolean, you.flies() == FL_LEVITATE) LUARET1(you_flying, boolean, you.flies() == FL_FLY) LUARET1(you_transform, string, transform_name()) @@ -807,6 +808,7 @@ static const struct luaL_reg you_lib[] = { "res_statdrain", you_res_statdrain }, { "res_mutation", you_res_mutation }, { "res_slowing", you_res_slowing }, + { "saprovorous", you_saprovorous }, { "gourmand", you_gourmand }, { "levitating", you_levitating }, { "flying", you_flying }, diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc index 598702147d..4c9299e011 100644 --- a/crawl-ref/source/debug.cc +++ b/crawl-ref/source/debug.cc @@ -1846,7 +1846,7 @@ static const char *mutation_type_names[] = { "blue marks", "green marks", "drifting", - "", + "saprovorous", "", "", "red scales", diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index 4506a1e7f9..0d55a0893b 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -374,7 +374,7 @@ void handle_delay( void ) if (mitm[ delay.parm1 ].sub_type == CORPSE_SKELETON) { mpr("The corpse rots away into a skeleton!"); - if (you.species == SP_GHOUL) + if (you.mutation[MUT_SAPROVOROUS] == 3) xom_check_corpse_waste(); else xom_is_stimulated(32); @@ -391,7 +391,7 @@ void handle_delay( void ) if (you.species != SP_VAMPIRE && you.is_undead != US_UNDEAD - && you.species != SP_GHOUL) + && you.mutation[MUT_SAPROVOROUS] < 3) { xom_check_corpse_waste(); } @@ -624,7 +624,7 @@ static void finish_delay(const delay_queue_item &delay) mpr("The corpse rots away into a skeleton just before you " "finish butchering it!"); - if (you.species == SP_GHOUL) + if (you.mutation[MUT_SAPROVOROUS] == 3) xom_check_corpse_waste(); else xom_is_stimulated(64); diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index 04622dd58b..29561c65f3 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -678,7 +678,7 @@ static std::string describe_demon(const monsters &mons) break; case 1: description += " It smells like rotting flesh"; - if (you.species == SP_GHOUL) + if (you.mutation[MUT_SAPROVOROUS] == 3) description += " - yum!"; else description += "."; @@ -2184,12 +2184,12 @@ static std::string describe_food( const item_def &item ) description += "Don't tell me you don't know what that is! "; break; case FOOD_CHUNK: - if (you.species != SP_GHOUL) + if (you.mutation[MUT_SAPROVOROUS] < 3) description += "It looks rather unpleasant. "; if (item.special < 100) { - if (you.species == SP_GHOUL) + if (you.mutation[MUT_SAPROVOROUS] == 3) description += "It looks nice and ripe. "; else if (you.is_undead != US_UNDEAD) { @@ -3663,10 +3663,13 @@ void describe_monsters(monsters& mons) break; case MONS_ROTTING_DEVIL: - if (you.species == SP_GHOUL) - description << "It smells great!"; - else if (player_can_smell()) - description << "It stinks."; + if (player_can_smell()) + { + if (you.mutation[MUT_SAPROVOROUS] == 3) + description << "It smells great!"; + else + description << "It stinks."; + } break; case MONS_SWAMP_DRAKE: diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index 0f19033534..98d7caf2e0 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -2012,6 +2012,7 @@ enum mutation_type MUT_BLUE_MARKS, // 64 - decorative, as in "mark of the devil" MUT_GREEN_MARKS, // 65 MUT_DRIFTING, + MUT_SAPROVOROUS, MUT_RED_SCALES = 70, // 70 MUT_NACREOUS_SCALES, MUT_GREY2_SCALES, diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h index 081a65fd4d..c42e4cd503 100644 --- a/crawl-ref/source/externs.h +++ b/crawl-ref/source/externs.h @@ -809,6 +809,8 @@ public: bool confusable() const; bool slowable() const; + bool omnivorous() const; + flight_type flies() const; bool paralysed() const; diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc index ec62aa9370..160a9c7448 100644 --- a/crawl-ref/source/food.cc +++ b/crawl-ref/source/food.cc @@ -54,7 +54,6 @@ static int determine_chunk_effect(int which_chunk_type, bool rotten_chunk); static void eat_chunk( int chunk_effect ); -static void ghoul_consume_flesh(int chunk_type); static void eating(unsigned char item_class, int item_type); static void describe_food_change(int hunger_increment); static bool food_change(bool suppress_message); @@ -624,9 +623,7 @@ static void describe_food_change(int food_increment) static bool prompt_eat_chunk(const item_def &item, bool rotten) { - if (rotten && you.species != SP_GHOUL && you.species != SP_KOBOLD - && you.species != SP_TROLL && you.species != SP_OGRE - && you.species != SP_HILL_ORC + if (rotten && !you.mutation[MUT_SAPROVOROUS] && !yesno("Are you sure you want to eat this rotten meat?", false, 'n')) { @@ -869,87 +866,93 @@ static void say_chunk_flavour(bool likes_chunks) static void eat_chunk( int chunk_effect ) { - bool likes_chunks = (you.species == SP_OGRE || you.species == SP_TROLL || - you.mutation[MUT_CARNIVOROUS] > 0); + bool likes_chunks = (you.omnivorous() || + you.mutation[MUT_CARNIVOROUS]); + int nutrition = chunk_nutrition(likes_chunks); + int hp_amt = 0; + bool suppress_msg = false; // do we display the chunk nutrition message? + bool do_eat = false; if (you.species == SP_GHOUL) { - ghoul_consume_flesh(chunk_effect); - start_delay( DELAY_EAT, 2 ); - lessen_hunger( CHUNK_BASE_NUTRITION, true ); + nutrition = CHUNK_BASE_NUTRITION; + hp_amt = 1 + random2(5) + random2(1 + you.experience_level); + suppress_msg = true; } - else + + switch (chunk_effect) { - switch (chunk_effect) - { - case CE_MUTAGEN_RANDOM: - mpr("This meat tastes really weird."); - mutate(RANDOM_MUTATION); - xom_is_stimulated(100); - break; + case CE_MUTAGEN_RANDOM: + mpr("This meat tastes really weird."); + mutate(RANDOM_MUTATION); + xom_is_stimulated(100); + break; - case CE_MUTAGEN_BAD: - mpr("This meat tastes *really* weird."); - give_bad_mutation(); - xom_is_stimulated(random2(200)); - break; + case CE_MUTAGEN_BAD: + mpr("This meat tastes *really* weird."); + give_bad_mutation(); + xom_is_stimulated(random2(200)); + break; - case CE_HCL: - rot_player( 10 + random2(10) ); - if (disease_player( 50 + random2(100) )) - xom_is_stimulated(random2(100)); - break; + case CE_HCL: + rot_player( 10 + random2(10) ); + if (disease_player( 50 + random2(100) )) + xom_is_stimulated(random2(100)); + break; - case CE_POISONOUS: - mpr("Yeeuch - this meat is poisonous!"); - if (poison_player( 3 + random2(4) )) - xom_is_stimulated(random2(128)); - break; + case CE_POISONOUS: + mpr("Yeeuch - this meat is poisonous!"); + if (poison_player( 3 + random2(4) )) + xom_is_stimulated(random2(128)); + break; - case CE_ROTTEN: - case CE_CONTAMINATED: + case CE_ROTTEN: + case CE_CONTAMINATED: + if (you.mutation[MUT_SAPROVOROUS] == 3) + { + mprf("This %sflesh tastes delicious!", + (chunk_effect == CE_ROTTEN) ? "rotting " : ""); + + if (you.species == SP_GHOUL) + heal_from_food(hp_amt, 0, !one_chance_in(4), + one_chance_in(5)); + + do_eat = true; + } + else + { mpr("There is something wrong with this meat."); if (disease_player( 50 + random2(100) )) xom_is_stimulated(random2(100)); - break; + } + break; - // note that this is the only case that takes time and forces redraw - case CE_CLEAN: + case CE_CLEAN: + { + if (you.mutation[MUT_SAPROVOROUS] == 3) { - say_chunk_flavour(likes_chunks); - const int nutrition = chunk_nutrition(likes_chunks); - start_delay( DELAY_EAT, 2, nutrition ); - lessen_hunger( nutrition, true ); - break; - } - } - } + mpr("This raw flesh tastes good."); - return; -} // end eat_chunk() + if (you.species == SP_GHOUL) + heal_from_food((!one_chance_in(5)) ? hp_amt : 0, 0, + !one_chance_in(3), false); + } + else + say_chunk_flavour(likes_chunks); -static void ghoul_consume_flesh(int chunk_type) -{ - int hp_amt = 1 + random2(5) + random2(1 + you.experience_level); + do_eat = true; + break; + } + } - if (chunk_type != CE_ROTTEN && chunk_type != CE_CONTAMINATED) + if (do_eat) { - mpr("This raw flesh tastes good."); - - heal_from_food((!one_chance_in(5)) ? hp_amt : 0, 0, - !one_chance_in(3), false); + start_delay( DELAY_EAT, 2, (suppress_msg) ? 0 : nutrition ); + lessen_hunger( nutrition, true ); } - else - { - if (chunk_type == CE_ROTTEN) - mpr("This rotting flesh tastes delicious!"); - else // CE_CONTAMINATED - mpr("This flesh tastes delicious!"); - heal_from_food(hp_amt, 0, - !one_chance_in(4), one_chance_in(5)); - } -} // end ghoul_consume_flesh() + return; +} // end eat_chunk() static void eating(unsigned char item_class, int item_type) { @@ -1257,8 +1260,7 @@ bool can_ingest(int what_isit, int kindof_thing, bool suppress_msg, bool reqid, bool ur_chunkslover = ( (check_hunger? you.hunger_state <= HS_HUNGRY : true) || wearing_amulet(AMU_THE_GOURMAND, !reqid) - || you.species == SP_OGRE - || you.species == SP_TROLL + || you.omnivorous() || you.mutation[MUT_CARNIVOROUS]); switch (what_isit) @@ -1412,27 +1414,28 @@ static int determine_chunk_effect(int which_chunk_type, bool rotten_chunk) break; case CE_CONTAMINATED: - if (you.attribute[ATTR_TRANSFORMATION] == TRAN_LICH) + if (you.attribute[ATTR_TRANSFORMATION] == TRAN_LICH + && you.mutation[MUT_SAPROVOROUS] < 3) + { this_chunk_effect = CE_CLEAN; + } else { - switch (you.species) + switch (you.mutation[MUT_SAPROVOROUS]) { - case SP_GHOUL: - // Doing this here causes a odd message later. -- bwr - // this_chunk_effect = CE_ROTTEN; + case 1: + if (!one_chance_in(15)) + this_chunk_effect = CE_CLEAN; break; - case SP_KOBOLD: - case SP_TROLL: + case 2: if (!one_chance_in(45)) this_chunk_effect = CE_CLEAN; break; - case SP_HILL_ORC: - case SP_OGRE: - if (!one_chance_in(15)) - this_chunk_effect = CE_CLEAN; + case 3: + // Doing this here causes a odd message later. -- bwr + // this_chunk_effect = CE_ROTTEN; break; default: @@ -1467,38 +1470,41 @@ static int determine_chunk_effect(int which_chunk_type, bool rotten_chunk) // one last chance for some species to safely eat rotten food {dlb}: if (this_chunk_effect == CE_ROTTEN) { - if (you.attribute[ATTR_TRANSFORMATION] == TRAN_LICH) + if (you.attribute[ATTR_TRANSFORMATION] == TRAN_LICH + && you.mutation[MUT_SAPROVOROUS] < 3) + { this_chunk_effect = CE_CLEAN; + } else { - switch (you.species) + switch (you.mutation[MUT_SAPROVOROUS]) { - case SP_KOBOLD: - case SP_TROLL: - if (!one_chance_in(15)) + case 1: + if (!one_chance_in(5)) this_chunk_effect = CE_CLEAN; break; - case SP_HILL_ORC: - case SP_OGRE: - if (!one_chance_in(5)) + + case 2: + if (!one_chance_in(15)) this_chunk_effect = CE_CLEAN; break; + default: break; } } } - // the amulet of the gourmad will permit consumption of - // contaminated meat as though it were "clean" meat - ghouls get - // rotting meat effect from clean chunks, since they love rotting - // meat. + // The amulet of the gourmand will permit consumption of + // contaminated meat as though it were "clean" meat - level 3 + // saprovores get rotting meat effect from clean chunks, since they + // love rotting meat. if (wearing_amulet(AMU_THE_GOURMAND) && random2(GOURMAND_MAX) < you.duration[DUR_GOURMAND]) { - if (you.species == SP_GHOUL) + if (you.mutation[MUT_SAPROVOROUS] == 3) { - // [dshaligram] Ghouls relish contaminated meat. + // [dshaligram] Level 3 saprovores relish contaminated meat. if (this_chunk_effect == CE_CLEAN) this_chunk_effect = CE_CONTAMINATED; } diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc index 7d539a1fac..bc48e94588 100644 --- a/crawl-ref/source/invent.cc +++ b/crawl-ref/source/invent.cc @@ -156,13 +156,9 @@ const int InvEntry::item_freshness() const return 0; int freshness = item->special; - - if (freshness >= 100 || you.species == SP_TROLL || you.species == SP_KOBOLD - || you.species == SP_GHOUL || you.species == SP_OGRE - || you.species == SP_HILL_ORC) - { + + if (freshness >= 100 || you.mutation[MUT_SAPROVOROUS]) freshness -= 300; - } // Ensure that chunk freshness is never zero, since zero means // that the item isn't a chunk. diff --git a/crawl-ref/source/it_use2.cc b/crawl-ref/source/it_use2.cc index 34a5c335f1..4826d4103a 100644 --- a/crawl-ref/source/it_use2.cc +++ b/crawl-ref/source/it_use2.cc @@ -325,8 +325,7 @@ bool potion_effect( potion_type pot_eff, int pow ) } else { - bool likes_blood = (you.species == SP_OGRE - || you.species == SP_TROLL + bool likes_blood = (you.omnivorous() || you.mutation[MUT_CARNIVOROUS]); if (likes_blood) diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index 443ed566eb..a172aa1938 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -2744,42 +2744,43 @@ void handle_time( long time_delta ) //mv: messages when chunks/corpses become rotten if (new_rotting_item) { - switch (you.species) - { // XXX: should probably still notice? - case SP_MUMMY: // no smell - case SP_TROLL: // stupid, living in mess - doesn't care about it - break; - - case SP_GHOUL: //likes it - temp_rand = random2(8); - mpr( ((temp_rand < 5) ? "You smell something rotten." : - (temp_rand == 5) ? "The smell of rotting flesh makes you hungry." : - (temp_rand == 6) ? "You smell decay. Yum-yum." - : "Wow! There is something tasty in your inventory."), - MSGCH_ROTTEN_MEAT ); - break; + // Races that can't smell don't care, and trolls are stupid and + // don't care. + if (player_can_smell() && you.species != SP_TROLL) + { + switch (you.mutation[MUT_SAPROVOROUS]) + { + // level 1 and level 2 saprovores aren't so touchy + case 1: + case 2: + temp_rand = random2(8); + mpr( ((temp_rand < 5) ? "You smell something rotten." : + (temp_rand == 5) ? "You smell rotting flesh." : + (temp_rand == 6) ? "You smell decay." + : "There is something rotten in your inventory."), + MSGCH_ROTTEN_MEAT ); + break; - case SP_KOBOLD: //mv: IMO these race aren't so "touchy" - case SP_OGRE: - case SP_MINOTAUR: - case SP_HILL_ORC: - temp_rand = random2(8); - mpr( ((temp_rand < 5) ? "You smell something rotten." : - (temp_rand == 5) ? "You smell rotting flesh." : - (temp_rand == 6) ? "You smell decay." - : "There is something rotten in your inventory."), - MSGCH_ROTTEN_MEAT ); - break; + // level 3 saprovores like it + case 3: + temp_rand = random2(8); + mpr( ((temp_rand < 5) ? "You smell something rotten." : + (temp_rand == 5) ? "The smell of rotting flesh makes you hungry." : + (temp_rand == 6) ? "You smell decay. Yum-yum." + : "Wow! There is something tasty in your inventory."), + MSGCH_ROTTEN_MEAT ); + break; - default: - temp_rand = random2(8); - mpr( ((temp_rand < 5) ? "You smell something rotten." : - (temp_rand == 5) ? "The smell of rotting flesh makes you sick." : - (temp_rand == 6) ? "You smell decay. Yuck!" - : "Ugh! There is something really disgusting in your inventory."), - MSGCH_ROTTEN_MEAT ); - break; + default: + temp_rand = random2(8); + mpr( ((temp_rand < 5) ? "You smell something rotten." : + (temp_rand == 5) ? "The smell of rotting flesh makes you sick." : + (temp_rand == 6) ? "You smell decay. Yuck!" + : "Ugh! There is something really disgusting in your inventory."), + MSGCH_ROTTEN_MEAT ); + break; + } } learned_something_new(TUT_ROTTEN_FOOD); } diff --git a/crawl-ref/source/lua/eat.lua b/crawl-ref/source/lua/eat.lua index 5a4b11d658..d07cf97fa9 100644 --- a/crawl-ref/source/lua/eat.lua +++ b/crawl-ref/source/lua/eat.lua @@ -31,11 +31,7 @@ function chunk_maybe_safe(chunk) local race = you.race() if rot then - return race == "Ghoul" - or race == "Kobold" - or race == "Troll" - or race == "Hill Orc" - or race == "Ogre" + return you.saprovorous() > 0 end return true diff --git a/crawl-ref/source/lua/safechnk.lua b/crawl-ref/source/lua/safechnk.lua index 0fc5fe7c9d..447981f141 100644 --- a/crawl-ref/source/lua/safechnk.lua +++ b/crawl-ref/source/lua/safechnk.lua @@ -17,12 +17,8 @@ --------------------------------------------------------------------------- function sc_safechunk(rot, race, mon) - if race == "Ghoul" then - return true - end - if rot then - if race ~= "Kobold" and race ~= "Troll" then + if you.saprovorous() < 2 then return false end end @@ -32,7 +28,7 @@ function sc_safechunk(rot, race, mon) end if sc_hcl[mon] or sc_mut[mon] then - return false + return race == "Ghoul" end -- Only contaminated and clean chunks remain, in theory. We'll accept diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc index c72d79e58d..407dd5855d 100644 --- a/crawl-ref/source/mutation.cc +++ b/crawl-ref/source/mutation.cc @@ -282,7 +282,10 @@ const char *mutation_descrip[][3] = { {"You occasionally drift when moving.", "You sometimes drift when moving.", "You frequently drift when moving."}, - {"", "", ""}, + + {"You can tolerate rotten meat.", "You can eat rotten meat.", + "You thrive on rotten meat."}, + {"", "", ""}, {"", "", ""}, @@ -531,6 +534,8 @@ const char *gain_mutation[][3] = { {"Your movements feel uncertain.", "Your movements feel even more uncertain.", "Your movements feel even more uncertain."}, + + // saprovorous: can never be gained or lost, only started with {"", "", ""}, {"", "", ""}, {"", "", ""}, @@ -741,7 +746,10 @@ const char *lose_mutation[][3] = { {"", "", ""}, {"", "", ""}, + + // saprovorous: can never be gained or lost, only started with {"", "", ""}, + {"", "", ""}, // 65 @@ -889,10 +897,10 @@ static const mutation_def mutation_defs[] = { { MUT_GREEN_MARKS, 0, 3 }, { MUT_DRIFTING, 3, 3 }, - // Three placeholders: - { RANDOM_MUTATION, 0, 3 }, + { MUT_SAPROVOROUS, 0, 3 }, { RANDOM_MUTATION, 0, 3 }, { RANDOM_MUTATION, 0, 3 }, + // 70 { MUT_RED_SCALES, 2, 3 }, { MUT_NACREOUS_SCALES, 1, 3 }, @@ -979,7 +987,6 @@ formatted_string describe_mutations() if ( you.mutation[MUT_CLAWS] ) result += ""; result += EOL; - result += "You can eat rotten meat." EOL; have_any = true; break; @@ -987,7 +994,6 @@ formatted_string describe_mutations() result += "Your body is rotting away." EOL; result += troll_claw_descrip[you.mutation[MUT_CLAWS]]; result += EOL; - result += "You preferably eat rotten meat." EOL; result += "You heal slowly." EOL; have_any = true; break; @@ -1109,17 +1115,10 @@ formatted_string describe_mutations() break; case SP_KOBOLD: - result += "You can eat rotten meat." EOL; result += "You recuperate from illness quickly." EOL; have_any = true; break; - case SP_HILL_ORC: - case SP_OGRE: - result += "You can tolerate rotten meat." EOL; - have_any = true; - break; - case SP_VAMPIRE: if (you.hunger_state >= HS_SATIATED) { diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc index 0903200fed..8717e8df44 100644 --- a/crawl-ref/source/newgame.cc +++ b/crawl-ref/source/newgame.cc @@ -1880,8 +1880,12 @@ static void give_basic_mutations(species_type speci) // for the fast/slow metabolism when we get around to it. switch ( speci ) { + case SP_HILL_ORC: + you.mutation[MUT_SAPROVOROUS] = 1; + break; case SP_OGRE: you.mutation[MUT_FAST_METABOLISM] = 1; + you.mutation[MUT_SAPROVOROUS] = 1; break; case SP_OGRE_MAGE: you.mutation[MUT_FAST_METABOLISM] = 1; @@ -1926,13 +1930,16 @@ static void give_basic_mutations(species_type speci) 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; break; case SP_TROLL: you.mutation[MUT_REGENERATION] = 2; you.mutation[MUT_FAST_METABOLISM] = 3; + you.mutation[MUT_SAPROVOROUS] = 2; break; case SP_KOBOLD: + you.mutation[MUT_SAPROVOROUS] = 2; you.mutation[MUT_CARNIVOROUS] = 3; break; case SP_VAMPIRE: diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc index b5d219a19f..32c2572f9d 100644 --- a/crawl-ref/source/output.cc +++ b/crawl-ref/source/output.cc @@ -917,30 +917,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 = 0; - switch (you.species) - { - case SP_GHOUL: - saplevel = 3; - snprintf(buf, sizeof buf, "%sSaprovore : %s", - determine_color_string(3), itosym3(3) ); - break; - - case SP_KOBOLD: - case SP_TROLL: - saplevel = 2; - snprintf(buf, sizeof buf, "%sSaprovore : %s", - determine_color_string(2), itosym3(2) ); - break; - - case SP_HILL_ORC: - case SP_OGRE: - saplevel = 1; - break; - default: - saplevel = 0; - break; - } + int saplevel = you.mutation[MUT_SAPROVOROUS]; const char* pregourmand; const char* postgourmand; if ( wearing_amulet(AMU_THE_GOURMAND, calc_unid) ) @@ -1171,30 +1148,7 @@ void print_overview_screen() determine_color_string(rslow), itosym1(rslow)); cols.add_formatted(0, buf, false); - int saplevel = 0; - switch (you.species) - { - case SP_GHOUL: - saplevel = 3; - snprintf(buf, sizeof buf, "%sSaprovore : %s", - determine_color_string(3), itosym3(3) ); - break; - - case SP_KOBOLD: - case SP_TROLL: - saplevel = 2; - snprintf(buf, sizeof buf, "%sSaprovore : %s", - determine_color_string(2), itosym3(2) ); - break; - - case SP_HILL_ORC: - case SP_OGRE: - saplevel = 1; - break; - default: - saplevel = 0; - break; - } + int saplevel = you.mutation[MUT_SAPROVOROUS]; const char* pregourmand; const char* postgourmand; if ( wearing_amulet(AMU_THE_GOURMAND, calc_unid) ) @@ -1598,16 +1552,6 @@ std::string status_mut_abilities() have_any = true; break; - case SP_TROLL: - text += "saprovore 2"; - have_any = true; - break; - - case SP_GHOUL: - text += "saprovore 3"; - have_any = true; - break; - case SP_GREY_ELF: if (you.experience_level > 4) { @@ -1714,16 +1658,6 @@ std::string status_mut_abilities() } break; - case SP_KOBOLD: - text += "saprovore 2"; - have_any = true; - break; - - case SP_HILL_ORC: - case SP_OGRE: - text += "saprovore 1"; - have_any = true; - break; default: break; } //end switch - innate abilities @@ -1798,6 +1732,13 @@ std::string status_mut_abilities() text += "poison resistance"; have_any = true; break; + case MUT_SAPROVOROUS: + if (have_any) + text += ", "; + snprintf(info, INFO_SIZE, "saprovore %d", level); + text += info; + have_any = true; + break; case MUT_CARNIVOROUS: if (have_any) text += ", "; diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 7e1a4cdb55..06169ab102 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -5982,6 +5982,11 @@ bool player::slowable() const return (!wearing_amulet(AMU_RESIST_SLOW)); } +bool player::omnivorous() const +{ + return (species == SP_TROLL || species == SP_OGRE); +} + flight_type player::flies() const { if (attribute[ATTR_TRANSFORMATION] == TRAN_DRAGON || -- cgit v1.2.3-54-g00ecf