summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-death.cc
diff options
context:
space:
mode:
authorreaverb <reaverb.Crawl@gmail.com>2014-05-13 14:19:11 -0400
committerreaverb <reaverb.Crawl@gmail.com>2014-05-13 21:08:36 -0400
commit12223c06ef9274e1b90c86d4c6a8ebd9f813c66a (patch)
treeac71d6e58668844f1ce17905d76901f19e640ce3 /crawl-ref/source/mon-death.cc
parent8e1b8955197c90e724290fb66c5842639f659b8f (diff)
downloadcrawl-ref-12223c06ef9274e1b90c86d4c6a8ebd9f813c66a.tar.gz
crawl-ref-12223c06ef9274e1b90c86d4c6a8ebd9f813c66a.zip
Remove Shedu
They never really worked as enemies - their only unique aspect, partner resurrection, was just annoying.
Diffstat (limited to 'crawl-ref/source/mon-death.cc')
-rw-r--r--crawl-ref/source/mon-death.cc205
1 files changed, 1 insertions, 204 deletions
diff --git a/crawl-ref/source/mon-death.cc b/crawl-ref/source/mon-death.cc
index a37bcf45a0..5a7d4398d6 100644
--- a/crawl-ref/source/mon-death.cc
+++ b/crawl-ref/source/mon-death.cc
@@ -336,17 +336,8 @@ static int _calc_player_experience(const monster* mons)
const bool already_got_half_xp = testbits(mons->flags, MF_GOT_HALF_XP);
const int half_xp = (experience + 1) / 2;
- // We give double exp for shedu here, rather than artificially
- // adjusting the modifier.
- if (mons->flags & MF_BAND_MEMBER && mons_is_shedu(mons))
- experience *= 2;
-
- if (created_friendly || was_neutral || no_xp
- || mons_is_shedu(mons) && shedu_pair_alive(mons))
- {
+ if (created_friendly || was_neutral || no_xp)
return 0; // No xp if monster was created friendly or summoned.
- // or if you've only killed one of two shedu.
- }
if (!mons->damage_total)
{
@@ -2511,13 +2502,6 @@ int monster_die(monster* mons, killer_type killer,
}
else if (mons_is_elven_twin(mons) && mons_near(mons))
elven_twin_died(mons, in_transit, killer, killer_index);
- else if (mons_is_shedu(mons))
- {
- if (was_banished) // Don't try resurrecting them.
- mons->number = 0;
- else
- shedu_do_resurrection(mons);
- }
else if (mons->type == MONS_VAULT_WARDEN)
timeout_terrain_changes(0, true);
else if (mons->type == MONS_FLAYED_GHOST)
@@ -3427,190 +3411,3 @@ void mons_felid_revive(monster* mons)
newmons->props["felid_revives"].get_byte() = revives;
}
}
-
-/**
- * Determine a shedu's pair by index.
- *
- * The index of a shedu's pair is stored as mons->number. This function attempts
- * to return a pointer to that monster. If that monster doesn't exist, or is
- * dead, returns NULL.
- *
- * @param mons The monster whose pair we're searching for. Assumed to be a
- * shedu.
- * @returns Either a monster* or NULL if a monster was not found.
-**/
-monster* get_shedu_pair(const monster* mons)
-{
- monster* pair = monster_by_mid(mons->number);
- if (pair)
- return pair;
-
- return NULL;
-}
-
-/**
- * Determine if a shedu's pair is alive.
- *
- * A simple function that checks the return value of get_shedu_pair is not null.
- *
- * @param mons The monster whose pair we are searching for.
- * @returns True if the pair is alive, False otherwise.
-**/
-bool shedu_pair_alive(const monster* mons)
-{
- if (get_shedu_pair(mons) == NULL)
- return false;
-
- return true;
-}
-
-/**
- * Determine if a monster is or was a shedu.
- *
- * @param mons The monster to check.
- * @returns Either True if the monster is or was a shedu, otherwise
- * False.
-**/
-bool mons_is_shedu(const monster* mons)
-{
- return mons->type == MONS_SHEDU
- || (mons->props.exists("original_name")
- && mons->props["original_name"].get_string() == "shedu");
-}
-
-/**
- * Initial resurrection functionality for Shedu.
- *
- * This function is called when a shedu dies. It attempts to find that shedu's
- * pair, wakes them if necessary, and then begins the resurrection process by
- * giving them the ENCH_PREPARING_RESURRECT enchantment timer. If a pair does
- * not exist (i.e., this is the second shedu to have died), nothing happens.
- *
- * @param mons The shedu who died.
-**/
-void shedu_do_resurrection(const monster* mons)
-{
- if (!mons_is_shedu(mons))
- return;
-
- if (mons->number == 0)
- return;
-
- monster* my_pair = get_shedu_pair(mons);
- if (!my_pair)
- return;
-
- // Wake the other one up if it's asleep.
- if (my_pair->asleep())
- behaviour_event(my_pair, ME_DISTURB, 0, my_pair->pos());
-
- if (you.can_see(my_pair))
- simple_monster_message(my_pair, " ceases action and prepares to resurrect its fallen mate.");
-
- my_pair->add_ench(ENCH_PREPARING_RESURRECT);
-}
-
-/**
- * Perform resurrection of a shedu.
- *
- * This function is called when the ENCH_PREPARING_RESURRECT timer runs out. It
- * determines if there is a viable corpse (of which there will always be one),
- * where that corpse is (if it is not in line of sight, no resurrection occurs;
- * if it is in your pack, it is resurrected "from" your pack, etc), and then
- * perform the actual resurrection by creating a new shedu monster.
- *
- * @param mons The shedu who is to perform the resurrection.
-**/
-void shedu_do_actual_resurrection(monster* mons)
-{
- // Here is where we actually recreate the dead
- // shedu.
- bool found_body = false;
- coord_def place_at;
- bool from_inventory = false;
-
- // Our pair might already be irretrievably dead.
- if (mons->number == 0)
- return;
-
- for (radius_iterator ri(mons->pos(), LOS_NO_TRANS); ri; ++ri)
- {
- for (stack_iterator si(*ri); si; ++si)
- if (si->base_type == OBJ_CORPSES && si->sub_type == CORPSE_BODY
- && si->props.exists(MONSTER_MID)
- && static_cast<unsigned int>(si->props[MONSTER_MID].get_int()) == mons->number)
- {
- place_at = *ri;
- destroy_item(si->index());
- found_body = true;
- break;
- }
- }
-
- if (!found_body)
- {
- for (unsigned slot = 0; slot < ENDOFPACK; ++slot)
- {
- if (!you.inv[slot].defined())
- continue;
-
- item_def* si = &you.inv[slot];
- if (si->base_type == OBJ_CORPSES && si->sub_type == CORPSE_BODY
- && si->props.exists(MONSTER_MID)
- && static_cast<unsigned int>(si->props[MONSTER_MID].get_int()) == mons->number)
- {
- // it was in the player's inventory
- place_at = coord_def(-1, -1);
- dec_inv_item_quantity(slot, 1, false);
- found_body = true;
- from_inventory = true;
- break;
- }
- }
-
- if (found_body)
- place_at = you.pos();
- }
-
- if (!found_body)
- {
- mons->number = 0;
- return;
- }
-
- mgen_data new_shedu;
- new_shedu.cls = MONS_SHEDU;
- new_shedu.behaviour = mons->behaviour;
- ASSERT(!place_at.origin());
- new_shedu.foe = mons->foe;
- new_shedu.god = mons->god;
-
- monster* my_pair = 0;
- for (distance_iterator di(place_at, true, false); di; ++di)
- {
- if (monster_at(*di) || !monster_habitable_grid(mons, grd(*di)))
- continue;
-
- new_shedu.pos = *di;
- if (my_pair = place_monster(new_shedu, true))
- break;
- }
-
- // give up
- if (!my_pair)
- {
- dprf("Couldn't place new shedu!");
- return;
- }
-
- my_pair->number = mons->mid;
- mons->number = my_pair->mid;
- my_pair->flags |= MF_BAND_MEMBER;
-
- if (from_inventory)
- simple_monster_message(mons, " resurrects its mate from your pack!");
- else if (you.can_see(mons))
- simple_monster_message(mons, " resurrects its mate from the grave!");
- else if (you.can_see(my_pair))
- simple_monster_message(mons, " rises from the grave!");
-}