diff options
-rw-r--r-- | crawl-ref/source/debug.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/food.cc | 49 | ||||
-rw-r--r-- | crawl-ref/source/monstuff.cc | 12 | ||||
-rw-r--r-- | crawl-ref/source/mutation.cc | 9 | ||||
-rw-r--r-- | crawl-ref/source/randart.cc | 4 |
5 files changed, 48 insertions, 30 deletions
diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc index d7012294fe..6783f205ae 100644 --- a/crawl-ref/source/debug.cc +++ b/crawl-ref/source/debug.cc @@ -2271,7 +2271,6 @@ static const char *mutation_type_names[] = { "fangs", "hooves", "talons", - "paws", "breathe poison", "stinger", "big wings", @@ -2281,7 +2280,8 @@ static const char *mutation_type_names[] = { "shaggy fur", "high mp", "low mp", - "sleepiness", + "", + "", "", "", diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc index eb8b08c58f..5138d12246 100644 --- a/crawl-ref/source/food.cc +++ b/crawl-ref/source/food.cc @@ -742,16 +742,18 @@ static void describe_food_change(int food_increment) mpr(msg.c_str()); } // end describe_food_change() -static bool prompt_eat_chunk(const item_def &item, bool rotten) +static bool _player_can_eat_rotten_meat(bool need_msg = false) { - if (rotten && !player_mutation_level(MUT_SAPROVOROUS) - && !yesno("Are you sure you want to eat this rotten meat?", - false, 'n')) + if (you.attribute[ATTR_TRANSFORMATION] == TRAN_LICH + || player_mutation_level(MUT_SAPROVOROUS)) { - canned_msg(MSG_OK); - return (false); + return (true); } - return (true); + + if (need_msg) + mpr("You refuse to eat that rotten meat."); + + return (false); } // should really be merged into function below -- FIXME @@ -792,7 +794,7 @@ void eat_from_inventory(int which_inventory_slot) const int chunk_type = mons_corpse_effect( mons_type ); const bool rotten = food_is_rotten(food); - if (!prompt_eat_chunk(food, rotten)) + if (rotten && !_player_can_eat_rotten_meat(true)) return; eat_chunk(determine_chunk_effect(chunk_type, rotten), cannibal, intel); @@ -839,7 +841,7 @@ void eat_floor_item(int item_link) const bool cannibal = is_player_same_species( food.plus ); const bool rotten = food_is_rotten(food); - if (!prompt_eat_chunk(food, rotten)) + if (!_player_can_eat_rotten_meat(true)) return; eat_chunk(determine_chunk_effect(chunk_type, rotten), cannibal, intel); @@ -859,7 +861,7 @@ int eat_from_floor() return 0; bool need_more = false; - int vamp_undrainable_corpse = 0; + int unusable_corpse = 0; bool found_valid = false; for (int o = igrd[you.x_pos][you.y_pos]; o != NON_ITEM; o = mitm[o].link) { @@ -875,10 +877,15 @@ int eat_from_floor() if (!mons_has_blood(item.plus)) { - vamp_undrainable_corpse++; + unusable_corpse++; continue; } } + else if (food_is_rotten(item) && !_player_can_eat_rotten_meat()) + { + unusable_corpse++; + continue; + } found_valid = true; std::ostringstream prompt; @@ -901,11 +908,17 @@ int eat_from_floor() // else no: try next one } - if (!found_valid && vamp_undrainable_corpse) + if (!found_valid && unusable_corpse) { - mprf("%s devoid of blood.", - (vamp_undrainable_corpse == 1) ? "This corpse is" - : "These corpses are"); + if (you.species == SP_VAMPIRE) + { + mprf("%s devoid of blood.", + (unusable_corpse == 1) ? "This corpse is" + : "These corpses are"); + } + else + _player_can_eat_rotten_meat(true); + need_more = true; } @@ -1554,7 +1567,7 @@ static int determine_chunk_effect(int which_chunk_type, bool rotten_chunk) case CE_HCL: case CE_MUTAGEN_RANDOM: if (you.species == SP_GHOUL - || you.attribute[ATTR_TRANSFORMATION] == TRAN_LICH) + || you.attribute[ATTR_TRANSFORMATION] == TRAN_LICH) { this_chunk_effect = CE_CLEAN; } @@ -1562,7 +1575,7 @@ static int determine_chunk_effect(int which_chunk_type, bool rotten_chunk) case CE_POISONOUS: if (you.attribute[ATTR_TRANSFORMATION] == TRAN_LICH - || player_res_poison() > 0) + || player_res_poison() > 0) { this_chunk_effect = CE_CLEAN; } @@ -1570,7 +1583,7 @@ static int determine_chunk_effect(int which_chunk_type, bool rotten_chunk) case CE_CONTAMINATED: if (you.attribute[ATTR_TRANSFORMATION] == TRAN_LICH - && player_mutation_level(MUT_SAPROVOROUS) < 3) + && player_mutation_level(MUT_SAPROVOROUS) < 3) { this_chunk_effect = CE_CLEAN; } diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index b5970bcc0e..84b4478425 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -467,7 +467,7 @@ static bool _is_pet_kill(killer_type killer, int i) return (false); const monsters *m = &menv[i]; - if (mons_friendly(m)) + if (mons_friendly(m)) // this includes enslaved monsters return (true); // Check if the monster was confused by you or a friendly, which @@ -685,11 +685,13 @@ static void _fire_monster_death_event(monsters *monster, { const level_id target(BRANCH_SLIME_PITS, 6); if (is_existing_level(target)) + { apply_to_level( target, true, target == level_id::current()? _slime_pit_unlock_onlevel : _slime_pit_unlock_offlevel ); + } } } } @@ -728,14 +730,16 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent) if (me.ench == ENCH_CONFUSION && me.who == KC_YOU) killer = KILL_YOU_CONF; } + else if (MON_KILL(killer) && monster->has_ench(ENCH_CHARM)) + killer = KILL_YOU_CONF; // Well, it was confused in a sense... (jpeg) // Take note! if (killer != KILL_RESET && killer != KILL_DISMISSED) { - if ( MONST_INTERESTING(monster) || + if ( MONST_INTERESTING(monster) // XXX yucky hack - monster->type == MONS_PLAYER_GHOST || - monster->type == MONS_PANDEMONIUM_DEMON ) + || monster->type == MONS_PLAYER_GHOST + || monster->type == MONS_PANDEMONIUM_DEMON ) { take_note(Note(NOTE_KILL_MONSTER, monster->type, mons_friendly(monster), diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc index 894873188f..2cbf81e6c9 100644 --- a/crawl-ref/source/mutation.cc +++ b/crawl-ref/source/mutation.cc @@ -1042,10 +1042,13 @@ static bool _mutation_is_fully_inactive(mutation_type mut) && !you.demon_pow[mut] && !mutation_defs[mut].physical); } +// Is there any sense in trying to mutate? +// XXX: Should this also check for mutation resistance or the amulet? bool can_safely_mutate() { - return (!you.is_undead || - (you.is_undead == US_SEMI_UNDEAD && you.hunger_state == HS_ENGORGED)); + return (!you.is_undead + || (you.is_undead == US_SEMI_UNDEAD + && you.hunger_state == HS_ENGORGED)); } formatted_string describe_mutations() @@ -1807,7 +1810,7 @@ bool mutate(mutation_type which_mutation, bool failMsg, bool force_mutation, } // Saprovorous can't be randomly acquired - if (mutat == MUT_SAPROVOROUS) + if (mutat == MUT_SAPROVOROUS && !force_mutation) return false; if (you.mutation[mutat] > 13 && !force_mutation) diff --git a/crawl-ref/source/randart.cc b/crawl-ref/source/randart.cc index a722c2cef4..6ed9069317 100644 --- a/crawl-ref/source/randart.cc +++ b/crawl-ref/source/randart.cc @@ -1787,8 +1787,7 @@ bool make_item_blessed_blade( item_def &item ) return (false); // mark as a random artefact - item.flags |= ISFLAG_ARTEFACT_MASK; - item.flags &= ~ISFLAG_UNRANDART; + item.flags |= ISFLAG_RANDART; ASSERT(!item.props.exists( KNOWN_PROPS_KEY )); item.props[KNOWN_PROPS_KEY].new_vector(SV_BOOL).resize(RA_PROPERTIES); @@ -1818,7 +1817,6 @@ bool make_item_blessed_blade( item_def &item ) // in case this is ever needed anywhere item.special = (random_int() & RANDART_SEED_MASK); - item.flags |= ISFLAG_RANDART; return (true); } |