diff options
author | Adam Borowski <kilobyte@angband.pl> | 2009-12-27 17:48:37 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2009-12-27 17:48:37 +0100 |
commit | 42d227a273a1334b60ca7574a8127d1a4b2744a1 (patch) | |
tree | 2655bcdeab4c1e157906b88ccefdda7645ee580a /crawl-ref/source/mon-stuff.cc | |
parent | 5b7701dc9d19fdad4de1a64b41995d65c03b7df6 (diff) | |
parent | dc3e12a4da48363a7cadb77f30b8e784d5f82acf (diff) | |
download | crawl-ref-42d227a273a1334b60ca7574a8127d1a4b2744a1.tar.gz crawl-ref-42d227a273a1334b60ca7574a8127d1a4b2744a1.zip |
Merge branch 'master' into iood
Diffstat (limited to 'crawl-ref/source/mon-stuff.cc')
-rw-r--r-- | crawl-ref/source/mon-stuff.cc | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/crawl-ref/source/mon-stuff.cc b/crawl-ref/source/mon-stuff.cc index 974188694a..4eae124ef4 100644 --- a/crawl-ref/source/mon-stuff.cc +++ b/crawl-ref/source/mon-stuff.cc @@ -133,7 +133,9 @@ int _make_mimic_item(monster_type type) case MONS_POTION_MIMIC: item.base_type = OBJ_POTIONS; - item.sub_type = random2(NUM_POTIONS); + do + item.sub_type = random2(NUM_POTIONS); + while (is_blood_potion(item)); break; case MONS_GOLD_MIMIC: @@ -158,6 +160,7 @@ const item_def *give_mimic_item(monsters *mimic) return 0; if (!mimic->pickup_misc(mitm[it], 0)) ASSERT("Mimic failed to pickup its item."); + ASSERT(mimic->inv[MSLOT_MISCELLANY] != NON_ITEM); return (&mitm[mimic->inv[MSLOT_MISCELLANY]]); } @@ -195,7 +198,7 @@ bool curse_an_item( bool decay_potions, bool quiet ) || you.inv[i].base_type == OBJ_JEWELLERY || you.inv[i].base_type == OBJ_POTIONS) { - if (item_cursed( you.inv[i] )) + if (you.inv[i] .cursed()) continue; if (you.inv[i].base_type != OBJ_POTIONS @@ -530,14 +533,16 @@ static void _check_kill_milestone(const monsters *mons, if (mons->props.exists("original_was_unique")) is_unique = mons->props["original_was_unique"].get_bool(); - if (mons->type == MONS_PLAYER_GHOST) + // Don't give milestones for summoned ghosts {due} + if (mons->type == MONS_PLAYER_GHOST && !mons->is_summoned()) { std::string milestone = _milestone_kill_verb(killer) + "the ghost of "; milestone += get_ghost_description(*mons, true); milestone += "."; mark_milestone("ghost", milestone); } - else if (is_unique) + // Or summoned uniques, which a summoned ghost is treated as {due} + else if (is_unique && !mons->is_summoned()) { mark_milestone("unique", _milestone_kill_verb(killer) @@ -1461,7 +1466,7 @@ int monster_die(monsters *monster, killer_type killer, const bool gives_xp = (!summoned && !mons_class_flag(monster->type, M_NO_EXP_GAIN)); - const bool drop_items = !hard_reset; + bool drop_items = !hard_reset; const bool mons_reset(killer == KILL_RESET || killer == KILL_DISMISSED); @@ -1728,7 +1733,7 @@ int monster_die(monsters *monster, killer_type killer, } // Cheibriados hates fast monsters. - if (mons_is_fast(monster)) + if (mons_is_fast(monster) && !monster->cannot_move()) { did_god_conduct(DID_KILL_FAST, monster->hit_dice, true, monster); @@ -2047,7 +2052,7 @@ int monster_die(monsters *monster, killer_type killer, // A banished monster that doesn't go on the transit list // loses all items. if (!monster->is_summoned()) - monster->destroy_inventory(); + drop_items = false; break; } @@ -2055,7 +2060,7 @@ int monster_die(monsters *monster, killer_type killer, monster->flags |= MF_BANISHED; monster->set_transit(level_id(LEVEL_ABYSS)); in_transit = true; - monster->destroy_inventory(); + drop_items = false; // Make monster stop patrolling and/or travelling. monster->patrol_point.reset(); monster->travel_path.clear(); @@ -2066,7 +2071,7 @@ int monster_die(monsters *monster, killer_type killer, break; default: - monster->destroy_inventory(); + drop_items = false; break; } @@ -2129,7 +2134,7 @@ int monster_die(monsters *monster, killer_type killer, _elven_twin_died(monster, in_transit); } else if (mons_is_mimic(monster->type)) - monster->destroy_inventory(); + drop_items = false; else if (!monster->is_summoned()) { if (mons_genus(monster->type) == MONS_MUMMY) @@ -3130,6 +3135,11 @@ bool mons_avoids_cloud(const monsters *monster, cloud_struct cloud, if (placement) extra_careful = true; + // Berserk monsters are less careful and will blindly plow through any + // dangerous cloud, just to kill you. {due} + if (!extra_careful && monster->berserk()) + return (true); + switch (cl_type) { case CLOUD_MIASMA: |