From 151e03aa3be3015e394dba00cc16e8024031c87f Mon Sep 17 00:00:00 2001 From: dolorous Date: Thu, 1 Jan 2009 23:20:18 +0000 Subject: Add various long-standing skeleton changes, to compensate for their stairs-related weakness: * For consistency, skeletons created by vampire draining now have the normal duration of 200, instead of 90. To compensate for this, they are left 25% of the time imstead of 75%. * Skeletons can now be left after butchering corpses, with the same chance of 25%, so that vampires don't have an exclusive advantage. * Monsters that eat corpses (and effectively butcher them) can leave skeletons from doing so, with the same chance of 25%. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8095 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/delay.cc | 18 ++++++++++-------- crawl-ref/source/effects.cc | 8 +++++++- crawl-ref/source/misc.cc | 25 ++++++++++++++++++++----- crawl-ref/source/misc.h | 3 ++- crawl-ref/source/mon-util.cc | 8 ++++++-- 5 files changed, 45 insertions(+), 17 deletions(-) diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index aa0cd0bc30..e3fef159d0 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -465,12 +465,11 @@ void stop_delay( bool stop_stair_travel ) item_def &corpse = (delay.parm1 ? you.inv[delay.parm2] : mitm[delay.parm2]); - if (mons_skeleton(corpse.plus)) - { - mpr("All blood oozes out of the corpse!"); - bleed_onto_floor(you.pos(), corpse.plus, delay.duration, false); - turn_corpse_into_skeleton(corpse, 90); - } + mpr("All blood oozes out of the corpse!"); + bleed_onto_floor(you.pos(), corpse.plus, delay.duration, false); + + if (mons_skeleton(corpse.plus) && one_chance_in(4)) + turn_corpse_into_skeleton(corpse); else { if (delay.parm1) @@ -1093,7 +1092,7 @@ static void _finish_delay(const delay_queue_item &delay) vampire_nutrition_per_turn(corpse, 1); if (mons_skeleton(corpse.plus) && !one_chance_in(4)) - turn_corpse_into_skeleton(corpse, 90); + turn_corpse_into_skeleton(corpse); else { if (delay.parm1) @@ -1214,7 +1213,10 @@ static void _finish_delay(const delay_queue_item &delay) item_def &corpse = mitm[delay.parm1]; - turn_corpse_into_chunks(corpse); + if (mons_skeleton(corpse.plus) && one_chance_in(4)) + turn_corpse_into_skeleton_and_chunks(corpse); + else + turn_corpse_into_chunks(corpse); if (you.duration[DUR_BERSERKER] && you.berserk_penalty != NO_BERSERK_PENALTY) diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc index 8607e4fa55..9559ba9da3 100644 --- a/crawl-ref/source/effects.cc +++ b/crawl-ref/source/effects.cc @@ -2949,9 +2949,15 @@ static void _rot_inventory_food(long time_delta) continue; } - // Carried skeletons are not destroyed. if (you.inv[i].sub_type == CORPSE_SKELETON) + { + if (you.equip[EQ_WEAPON] == i) + unwield_item(); + + destroy_item(you.inv[i]); + burden_changed_by_rot = true; continue; + } if (!mons_skeleton(you.inv[i].plus)) { diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index 9175c51df5..9ca1a1994b 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -132,10 +132,7 @@ static void _create_monster_hide(int mons_class) move_item_to_grid(&o, you.pos()); } -// Vampire draining corpses currently leaves them a time of 90, while -// the default time is 200. I'm not sure whether this is for balancing -// reasons or just an arbitrary difference. (jpeg) -void turn_corpse_into_skeleton(item_def &item, int time) +void turn_corpse_into_skeleton(item_def &item) { ASSERT(item.base_type == OBJ_CORPSES && item.sub_type == CORPSE_BODY); @@ -153,7 +150,7 @@ void turn_corpse_into_skeleton(item_def &item, int time) item.plus = MONS_RAT; item.sub_type = CORPSE_SKELETON; - item.special = time; + item.special = 200; item.colour = LIGHTGREY; } @@ -180,6 +177,24 @@ void turn_corpse_into_chunks(item_def &item) _create_monster_hide(item.plus); } +void turn_corpse_into_skeleton_and_chunks(item_def &item) +{ + ASSERT(item.base_type == OBJ_CORPSES && item.sub_type == CORPSE_BODY); + + if (mons_skeleton(item.plus)) + { + int o = get_item_slot(); + if (o != NON_ITEM) + { + item_def &skel = item; + turn_corpse_into_skeleton(skel); + copy_item_to_grid(skel, you.pos()); + } + } + + turn_corpse_into_chunks(item); +} + // Initialize blood potions with a vector of timers. void init_stack_blood_potions(item_def &stack, int age) { diff --git a/crawl-ref/source/misc.h b/crawl-ref/source/misc.h index 1374dbef26..4f2a5ffddc 100644 --- a/crawl-ref/source/misc.h +++ b/crawl-ref/source/misc.h @@ -24,8 +24,9 @@ bool merfolk_change_is_safe(bool quiet = false); void merfolk_start_swimming(); void new_level(); void trackers_init_new_level(bool transit); -void turn_corpse_into_skeleton(item_def &item, int time = 200); +void turn_corpse_into_skeleton(item_def &item); void turn_corpse_into_chunks(item_def &item); +void turn_corpse_into_skeleton_and_chunks(item_def &item); void init_stack_blood_potions( item_def &stack, int age = -1 ); void maybe_coagulate_blood_potions_floor( int obj ); diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 8a8283f64d..6e3bc12d80 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -4741,7 +4741,8 @@ bool monsters::eat_corpse(item_def &item, int near) // Assume that eating a corpse requires butchering it. // - // Use logic from misc.cc:turn_corpse_into_chunks(). + // Use logic from misc.cc:turn_corpse_into_chunks() and + // the butchery-related delays in delay.cc:stop_delay(). const int max_chunks = mons_weight(item.plus) / 150; @@ -4749,7 +4750,10 @@ bool monsters::eat_corpse(item_def &item, int near) if (!food_is_rotten(item)) bleed_onto_floor(pos(), item.plus, max_chunks, true); - destroy_item(item.index()); + if (mons_skeleton(item.plus) && one_chance_in(4)) + turn_corpse_into_skeleton(item); + else + destroy_item(item.index()); return (true); } -- cgit v1.2.3-54-g00ecf