Attached Files:
|
deep-abyss-02.patch [^] (27,684 bytes) 2015-10-22 20:16 [Show Content] [Hide Content]From d0d563a2c66d70a5eb68b8660e438179f8a7dca9 Mon Sep 17 00:00:00 2001
From: "Edgar A. Bering IV" <trizor@gmail.com>
Date: Thu, 15 Oct 2015 14:04:28 -0500
Subject: [PATCH 1/4] Refactor take_stairs. Refactor banished()
Split into two functions.
One private to stairs.cc that determines
if the player can actually walk on some dungeon stairs at a position
and figures out where those stairs go.
The other does the actual business of moving the player, set up and teardown,
etc. We then use this in banished() instead of going down an abyss entrance.
There are probably other places that can take advantage of this refactor.
---
crawl-ref/source/abyss.cc | 5 +-
crawl-ref/source/stairs.cc | 164 +++++++++++++++++++++++++--------------------
crawl-ref/source/stairs.h | 4 ++
3 files changed, 100 insertions(+), 73 deletions(-)
diff --git a/crawl-ref/source/abyss.cc b/crawl-ref/source/abyss.cc
index 1053916..cd465e2 100644
--- a/crawl-ref/source/abyss.cc
+++ b/crawl-ref/source/abyss.cc
@@ -395,12 +395,15 @@ void banished(const string &who)
return;
}
+ const int depth = 1;
const string what = "Cast into the Abyss" + _who_banished(who);
take_note(Note(NOTE_MESSAGE, 0, 0, what), true);
stop_delay(true);
run_animation(ANIMATION_BANISH, UA_BRANCH_ENTRY, false);
- down_stairs(DNGN_ENTER_ABYSS); // heh heh
+ push_features_to_abyss();
+ floor_transition(DNGN_ENTER_ABYSS, orig_terrain(you.pos()),
+ level_id(BRANCH_ABYSS, depth), true);
// Xom just might decide to interfere.
if (you_worship(GOD_XOM) && who != "Xom" && who != "wizard command"
diff --git a/crawl-ref/source/stairs.cc b/crawl-ref/source/stairs.cc
index 757925c..93a7e55 100644
--- a/crawl-ref/source/stairs.cc
+++ b/crawl-ref/source/stairs.cc
@@ -90,11 +90,8 @@ static void _player_change_level_reset()
you.prev_grd_targ.reset();
}
-static void _player_change_level(dungeon_feature_type feat, const string &dst)
+static void _player_change_level(level_id lev)
{
- level_id lev = stair_destination(feat, dst, true);
- if (!lev.is_valid())
- die("Unknown down stair: %s", dungeon_feature_name(feat));
you.depth = lev.depth;
you.where_are_you = lev.branch;
}
@@ -434,23 +431,14 @@ static void _new_level_amuses_xom(dungeon_feature_type feat,
}
}
-void take_stairs(dungeon_feature_type force_stair, bool going_up,
- bool force_known_shaft, bool wizard)
+static level_id _travel_destination(const dungeon_feature_type how,
+ const dungeon_feature_type whence,
+ bool forced, bool going_up,
+ bool known_shaft)
{
- const level_id old_level = level_id::current();
-
- const dungeon_feature_type old_feat = orig_terrain(you.pos());
- dungeon_feature_type stair_find = force_stair ? force_stair : old_feat;
-
- // Taking a shaft manually
- const bool known_shaft = (!force_stair
- && get_trap_type(you.pos()) == TRAP_SHAFT
- && stair_find != DNGN_UNDISCOVERED_TRAP)
- || (force_stair == DNGN_TRAP_SHAFT
- && force_known_shaft);
- // Latter case is falling down a shaft.
- const bool shaft = known_shaft || force_stair == DNGN_TRAP_SHAFT;
+ const bool shaft = known_shaft || how == DNGN_TRAP_SHAFT;
level_id shaft_dest;
+ level_id dest;
if (shaft)
{
if (!is_valid_shaft_level())
@@ -458,7 +446,7 @@ void take_stairs(dungeon_feature_type force_stair, bool going_up,
if (known_shaft)
mpr("The shaft disappears in a puff of logic!");
_maybe_destroy_trap(you.pos());
- return;
+ return dest;
}
shaft_dest = you.shaft_dest(known_shaft);
@@ -466,26 +454,26 @@ void take_stairs(dungeon_feature_type force_stair, bool going_up,
// How far down you fall via a shaft or hatch.
const int shaft_depth = (shaft ? shaft_dest.depth - you.depth : 1);
+ // Only check the current position for a legal stair traverse.
+ // Check that we're going the right way (if we're not falling through
+ // a shaft or being forced).
+ if (!shaft && !forced && !_check_stairs(how, going_up))
+ return dest;
+
// Up and down both work for some portals.
// Canonicalize the direction: hell exits into the vestibule are considered
// going up; everything else is going down. This mostly affects which way you
// fall if confused.
- if (feat_is_bidirectional_portal(stair_find))
- going_up = (stair_find == DNGN_ENTER_HELL && player_in_hell());
-
- // Only check the current position for a legal stair traverse.
- // Check that we're going the right way (if we're not falling through
- // a shaft or being forced).
- if (!shaft && !force_stair && !_check_stairs(stair_find, going_up))
- return;
+ if (feat_is_bidirectional_portal(how))
+ going_up = (how == DNGN_ENTER_HELL && player_in_hell());
- if (_stair_moves_pre(stair_find))
- return;
+ if (_stair_moves_pre(how))
+ return dest;
// Falling down is checked before the transition if going upstairs, since
// it might prevent the transition itself.
- if (going_up && _fall_down_stairs(stair_find, true))
- return;
+ if (going_up && _fall_down_stairs(how, true))
+ return dest;
if (shaft)
{
@@ -498,7 +486,7 @@ void take_stairs(dungeon_feature_type force_stair, bool going_up,
"shaft!");
}
_maybe_destroy_trap(you.pos());
- return;
+ return dest;
}
if (!known_shaft)
@@ -526,13 +514,13 @@ void take_stairs(dungeon_feature_type force_stair, bool going_up,
// in main.cc: _can_take_stairs())
for (branch_iterator it; it; ++it)
{
- if (stair_find != it->entry_stairs)
+ if (how != it->entry_stairs)
continue;
if (!is_existing_level(level_id(it->id, 1))
&& runes_for_branch(it->id) > 0)
{
- _rune_effect(stair_find);
+ _rune_effect(how);
}
break;
@@ -540,9 +528,20 @@ void take_stairs(dungeon_feature_type force_stair, bool going_up,
// Bail if any markers veto the move.
if (_marker_vetoes_level_change())
- return;
+ return dest;
- // All checks are done, the player is on the move now.
+ // Markers might be deleted when removing portals.
+ const string dst = env.markers.property_at(you.pos(), MAT_ANY, "dst");
+
+ if (shaft)
+ return shaft_dest;
+ else
+ return stair_destination(how, dst, true);
+}
+
+void floor_transition(dungeon_feature_type how, const dungeon_feature_type whence, level_id whither, bool forced, bool going_up, bool shaft, bool wizard)
+{
+ const level_id old_level = level_id::current();
// Clean up fake blood.
heal_flayed_effect(&you, true, true);
@@ -551,25 +550,22 @@ void take_stairs(dungeon_feature_type force_stair, bool going_up,
clear_trapping_net();
end_searing_ray();
- // Markers might be deleted when removing portals.
- const string dst = env.markers.property_at(you.pos(), MAT_ANY, "dst");
-
// Fire level-leaving trigger.
- leaving_level_now(stair_find);
+ leaving_level_now(how);
// Not entirely accurate - the player could die before
// reaching the Abyss.
- if (!force_stair && old_feat == DNGN_ENTER_ABYSS)
+ if (!forced && whence == DNGN_ENTER_ABYSS)
{
mark_milestone("abyss.enter", "entered the Abyss!");
take_note(Note(NOTE_MESSAGE, 0, 0, "Voluntarily entered the Abyss."), true);
}
- else if (!force_stair && old_feat == DNGN_EXIT_THROUGH_ABYSS)
+ else if (!forced && whence == DNGN_EXIT_THROUGH_ABYSS)
{
mark_milestone("abyss.enter", "escaped (hah) into the Abyss!");
take_note(Note(NOTE_MESSAGE, 0, 0, "Took an exit into the Abyss."), true);
}
- else if (stair_find == DNGN_EXIT_ABYSS
+ else if (how == DNGN_EXIT_ABYSS
&& you.chapter != CHAPTER_POCKET_ABYSS)
{
mark_milestone("abyss.exit", "escaped from the Abyss!");
@@ -588,7 +584,7 @@ void take_stairs(dungeon_feature_type force_stair, bool going_up,
const coord_def stair_pos = you.pos();
- if (stair_find == DNGN_EXIT_DUNGEON)
+ if (how == DNGN_EXIT_DUNGEON)
{
you.depth = 0;
mpr("You have escaped!");
@@ -599,22 +595,19 @@ void take_stairs(dungeon_feature_type force_stair, bool going_up,
ouch(INSTANT_DEATH, KILLED_BY_LEAVING);
}
- if (stair_find == DNGN_ENTER_LABYRINTH || stair_find == DNGN_ENTER_ZIGGURAT)
+ if (how == DNGN_ENTER_LABYRINTH || how == DNGN_ENTER_ZIGGURAT)
dungeon_terrain_changed(you.pos(), DNGN_STONE_ARCH);
- if (stair_find == DNGN_ENTER_PANDEMONIUM
- || stair_find == DNGN_ENTER_ABYSS
- || feat_is_portal_entrance(stair_find))
+ if (how == DNGN_ENTER_PANDEMONIUM
+ || how == DNGN_ENTER_ABYSS
+ || feat_is_portal_entrance(how))
{
you.level_stack.push_back(level_pos::current());
}
// Actually change the player's branch and depth, along with some cleanup.
_player_change_level_reset();
- if (shaft)
- you.depth = shaft_dest.depth;
- else
- _player_change_level(stair_find, dst);
+ _player_change_level(whither);
// Some branch specific messages.
if (old_level.branch == BRANCH_VESTIBULE
@@ -623,15 +616,15 @@ void take_stairs(dungeon_feature_type force_stair, bool going_up,
mpr("Thank you for visiting Hell. Please come again soon.");
}
- if (stair_find == DNGN_EXIT_ABYSS
- || stair_find == DNGN_EXIT_PANDEMONIUM
- || stair_find == DNGN_EXIT_THROUGH_ABYSS)
+ if (how == DNGN_EXIT_ABYSS
+ || how == DNGN_EXIT_PANDEMONIUM
+ || how == DNGN_EXIT_THROUGH_ABYSS)
{
mpr("You pass through the gate.");
take_note(Note(NOTE_MESSAGE, 0, 0,
- stair_find == DNGN_EXIT_ABYSS ? "Escaped the Abyss" :
- stair_find == DNGN_EXIT_PANDEMONIUM ? "Escaped Pandemonium" :
- stair_find == DNGN_EXIT_THROUGH_ABYSS ? "Escaped into the Abyss" :
+ how == DNGN_EXIT_ABYSS ? "Escaped the Abyss" :
+ how == DNGN_EXIT_PANDEMONIUM ? "Escaped Pandemonium" :
+ how == DNGN_EXIT_THROUGH_ABYSS ? "Escaped into the Abyss" :
"Buggered into bugdom"), true);
if (!you.wizard || !crawl_state.is_replaying_keys())
@@ -640,7 +633,7 @@ void take_stairs(dungeon_feature_type force_stair, bool going_up,
// Fixup exits from the Hell branches.
if (player_in_branch(BRANCH_VESTIBULE) && is_hell_subbranch(old_level.branch))
- stair_find = branches[old_level.branch].entry_stairs;
+ how = branches[old_level.branch].entry_stairs;
// Special messages on returning from portal vaults, Abyss, Pan, etc.
if (!is_connected_branch(old_level.branch)
@@ -654,15 +647,15 @@ void take_stairs(dungeon_feature_type force_stair, bool going_up,
// Falling down the stairs or portal.
if (!going_up && !shaft
- && force_stair != DNGN_ENTER_ABYSS
- && force_stair != DNGN_ABYSSAL_STAIR
- && force_stair != DNGN_EXIT_ABYSS)
+ && how != DNGN_ENTER_ABYSS
+ && how != DNGN_ABYSSAL_STAIR
+ && how != DNGN_EXIT_ABYSS)
{
- _fall_down_stairs(stair_find, false);
+ _fall_down_stairs(how, false);
}
if (shaft)
- stair_find = DNGN_TRAP_SHAFT;
+ how = DNGN_TRAP_SHAFT;
switch (you.where_are_you)
{
@@ -676,7 +669,7 @@ void take_stairs(dungeon_feature_type force_stair, bool going_up,
mpr("The abyssal Rune of Zot can be found at this depth.");
break;
}
- if (!force_stair)
+ if (!forced)
mpr("You enter the Abyss!");
mpr("To return, you must find a gate leading back.");
@@ -699,13 +692,13 @@ void take_stairs(dungeon_feature_type force_stair, bool going_up,
default:
// This hits both cases.
if (!shaft)
- _climb_message(stair_find, going_up, old_level.branch);
+ _climb_message(how, going_up, old_level.branch);
break;
}
// An extra message from using this particular stair (e.g. hatches).
if (!shaft)
- _exit_stair_message(stair_find);
+ _exit_stair_message(how);
// Did we enter a new branch?
if (!player_in_branch(old_level.branch))
@@ -732,7 +725,7 @@ void take_stairs(dungeon_feature_type force_stair, bool going_up,
else
{
// Entered a branch (including portals) through the front door.
- if (stair_find == branches[branch].entry_stairs)
+ if (how == branches[branch].entry_stairs)
{
if (branches[branch].entry_message)
mpr(branches[branch].entry_message);
@@ -750,10 +743,12 @@ void take_stairs(dungeon_feature_type force_stair, bool going_up,
}
}
- const bool newlevel = load_level(stair_find, LOAD_ENTER_LEVEL, old_level);
+ const bool newlevel = load_level(how, LOAD_ENTER_LEVEL, old_level);
if (newlevel)
- _new_level_amuses_xom(stair_find, old_feat, shaft, shaft_depth, !force_stair);
+ _new_level_amuses_xom(how, whence, shaft,
+ (shaft ? whither.depth - old_level.depth : 1),
+ !forced);
// This should maybe go in load_level?
if (you.where_are_you == BRANCH_ABYSS)
@@ -768,7 +763,7 @@ void take_stairs(dungeon_feature_type force_stair, bool going_up,
// Dunno why this is on going down only.
if (!going_up)
{
- moveto_location_effects(old_feat);
+ moveto_location_effects(whence);
// Clear list of beholding and constricting/constricted monsters.
you.clear_beholders();
@@ -797,6 +792,31 @@ void take_stairs(dungeon_feature_type force_stair, bool going_up,
request_autopickup();
}
+void take_stairs(dungeon_feature_type force_stair, bool going_up,
+ bool force_known_shaft, bool wizard)
+{
+ const dungeon_feature_type old_feat = orig_terrain(you.pos());
+ dungeon_feature_type how = force_stair ? force_stair : old_feat;
+
+ // Taking a shaft manually
+ const bool known_shaft = (!force_stair
+ && get_trap_type(you.pos()) == TRAP_SHAFT
+ && how != DNGN_UNDISCOVERED_TRAP)
+ || (force_stair == DNGN_TRAP_SHAFT
+ && force_known_shaft);
+ // Latter case is falling down a shaft.
+ const bool shaft = known_shaft || force_stair == DNGN_TRAP_SHAFT;
+
+ level_id whither = _travel_destination(how, old_feat,
+ bool(force_stair), going_up, known_shaft);
+
+ if (!whither.is_valid())
+ return;
+
+ floor_transition(how, old_feat, whither,
+ bool(force_stair), going_up, shaft, wizard);
+}
+
void up_stairs(dungeon_feature_type force_stair, bool wizard)
{
take_stairs(force_stair, true, false, wizard);
diff --git a/crawl-ref/source/stairs.h b/crawl-ref/source/stairs.h
index 20c4535..6db101c 100644
--- a/crawl-ref/source/stairs.h
+++ b/crawl-ref/source/stairs.h
@@ -10,6 +10,10 @@ bool check_annotation_exclusion_warning();
level_id stair_destination(dungeon_feature_type feat, const string &dst,
bool for_real = false);
level_id stair_destination(coord_def pos, bool for_real = false);
+void floor_transition(dungeon_feature_type how,
+ const dungeon_feature_type whence, level_id whither,
+ bool forced, bool going_up = false, bool shaft = false,
+ bool wizard = false);
void take_stairs(dungeon_feature_type force_stair = DNGN_UNSEEN,
bool going_up = false, bool force_known_shaft = false,
bool wizard = false);
--
2.3.2 (Apple Git-55)
From 02f5841d8cc929bd52bf54a73f2e4ee468e9eb65 Mon Sep 17 00:00:00 2001
From: "Edgar A. Bering IV" <trizor@gmail.com>
Date: Thu, 15 Oct 2015 14:58:06 -0500
Subject: [PATCH 2/4] Track power of successful banishment.
Includes a stub for selecting how deep to send a player.
Vary banishment depth on power. Currently banisher HD is used
for power; the specific formula probably needs some tweaking
or balance.
---
crawl-ref/source/abyss.cc | 24 +++++++++++++++++++++---
crawl-ref/source/abyss.h | 2 +-
crawl-ref/source/actor.h | 2 +-
crawl-ref/source/attack.cc | 3 ++-
crawl-ref/source/beam.cc | 3 ++-
crawl-ref/source/main.cc | 2 +-
crawl-ref/source/monster.cc | 2 +-
crawl-ref/source/monster.h | 2 +-
crawl-ref/source/player.cc | 4 +++-
crawl-ref/source/player.h | 3 ++-
crawl-ref/source/stairs.cc | 1 +
11 files changed, 36 insertions(+), 12 deletions(-)
diff --git a/crawl-ref/source/abyss.cc b/crawl-ref/source/abyss.cc
index cd465e2..ba1e342 100644
--- a/crawl-ref/source/abyss.cc
+++ b/crawl-ref/source/abyss.cc
@@ -369,7 +369,24 @@ static string _who_banished(const string &who)
return who.empty() ? who : " (" + who + ")";
}
-void banished(const string &who)
+static int _banished_depth(const int power)
+{
+ // Linear, with the max going from (1,1) to (25,5)
+ // and the min going from (9,1) to (27,5)
+ // Currently using HD for power
+
+ // This means an orc will send you to A:1, an orc warrior
+ // has a small chance of A:2,
+ // Elves have a good shot at sending you to A:3, but won't
+ // always
+ // Ancient Liches are sending you to A:5 and there's nothing
+ // you can do about that.
+ const int maxdepth = min(5, max(div_rand_round((power + 5), 6), 1));
+ const int mindepth = max(1, (4 * power + 7) / 23);
+ return random_range(mindepth, maxdepth);
+}
+
+void banished(const string &who, const int power)
{
ASSERT(!crawl_state.game_is_arena());
push_features_to_abyss();
@@ -395,8 +412,9 @@ void banished(const string &who)
return;
}
- const int depth = 1;
- const string what = "Cast into the Abyss" + _who_banished(who);
+ const int depth = _banished_depth(power);
+ const string what = make_stringf("Cast into level %d of the Abyss", depth)
+ + _who_banished(who);
take_note(Note(NOTE_MESSAGE, 0, 0, what), true);
stop_delay(true);
diff --git a/crawl-ref/source/abyss.h b/crawl-ref/source/abyss.h
index 323140c..7102693 100644
--- a/crawl-ref/source/abyss.h
+++ b/crawl-ref/source/abyss.h
@@ -27,7 +27,7 @@ extern abyss_state abyssal_state;
void abyss_morph();
-void banished(const string &who = "");
+void banished(const string &who = "", const int power = 0);
void push_features_to_abyss();
void generate_abyss();
diff --git a/crawl-ref/source/actor.h b/crawl-ref/source/actor.h
index bc3222f..b501179 100644
--- a/crawl-ref/source/actor.h
+++ b/crawl-ref/source/actor.h
@@ -205,7 +205,7 @@ public:
bool cleanup_dead = true,
bool attacker_effects = true) = 0;
virtual bool heal(int amount, bool max_too = false) = 0;
- virtual void banish(actor *agent, const string &who = "") = 0;
+ virtual void banish(actor *agent, const string &who = "", const int power = 0) = 0;
virtual void blink() = 0;
virtual void teleport(bool right_now = false,
bool wizard_tele = false) = 0;
diff --git a/crawl-ref/source/attack.cc b/crawl-ref/source/attack.cc
index 79be849..c856f6d 100644
--- a/crawl-ref/source/attack.cc
+++ b/crawl-ref/source/attack.cc
@@ -520,7 +520,8 @@ bool attack::distortion_affects_defender()
if (defender_visible)
obvious_effect = true;
- defender->banish(attacker, attacker->name(DESC_PLAIN, true));
+ defender->banish(attacker, attacker->name(DESC_PLAIN, true),
+ attacker->get_experience_level());
return true;
}
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 5ad3b89..ecc48c5 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -3557,7 +3557,8 @@ void bolt::affect_player_enchantment(bool resistible)
mpr("This spell isn't strong enough to banish yourself.");
break;
}
- you.banish(agent(), get_source_name());
+ you.banish(agent(), get_source_name(),
+ agent()->get_experience_level());
obvious_effect = true;
break;
diff --git a/crawl-ref/source/main.cc b/crawl-ref/source/main.cc
index 0161ef6..7039b49 100644
--- a/crawl-ref/source/main.cc
+++ b/crawl-ref/source/main.cc
@@ -2392,7 +2392,7 @@ static void _check_banished()
else
mprf(MSGCH_BANISHMENT, "The Abyss bends around you!");
more();
- banished(you.banished_by);
+ banished(you.banished_by, you.banished_power);
}
}
diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc
index 7c03573..201d4a1 100644
--- a/crawl-ref/source/monster.cc
+++ b/crawl-ref/source/monster.cc
@@ -2921,7 +2921,7 @@ void monster::expose_to_element(beam_type flavour, int strength,
}
}
-void monster::banish(actor *agent, const string &)
+void monster::banish(actor *agent, const string &, const int)
{
coord_def old_pos = pos();
diff --git a/crawl-ref/source/monster.h b/crawl-ref/source/monster.h
index 00f71db..c1362c4 100644
--- a/crawl-ref/source/monster.h
+++ b/crawl-ref/source/monster.h
@@ -341,7 +341,7 @@ public:
bool malmutate(const string &/*reason*/) override;
void corrupt();
bool polymorph(int pow) override;
- void banish(actor *agent, const string &who = "") override;
+ void banish(actor *agent, const string &who = "", const int power = 0) override;
void expose_to_element(beam_type element, int strength = 0,
bool slow_cold_blood = true) override;
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index a730299..a9efb77 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -5276,6 +5276,7 @@ player::player()
type_ids.init(false);
banished_by.clear();
+ banished_power = 0;
last_mid = 0;
last_cast_spell = SPELL_NO_SPELL;
@@ -5566,7 +5567,7 @@ void player::god_conduct(conduct_type thing_done, int level)
::did_god_conduct(thing_done, level);
}
-void player::banish(actor* /*agent*/, const string &who)
+void player::banish(actor* /*agent*/, const string &who, const int power)
{
ASSERT(!crawl_state.game_is_arena());
if (brdepth[BRANCH_ABYSS] == -1)
@@ -5580,6 +5581,7 @@ void player::banish(actor* /*agent*/, const string &who)
banished = true;
banished_by = who;
+ banished_power = power;
}
// For semi-undead species (Vampire!) reduce food cost for spells and abilities
diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h
index 6616f71..f7f5792 100644
--- a/crawl-ref/source/player.h
+++ b/crawl-ref/source/player.h
@@ -356,6 +356,7 @@ public:
// If true, player is headed to the Abyss.
bool banished;
string banished_by;
+ int banished_power;
bool wield_change; // redraw weapon
bool redraw_quiver; // redraw quiver
@@ -624,7 +625,7 @@ public:
bool malmutate(const string &reason) override;
bool polymorph(int pow) override;
void backlight();
- void banish(actor* /*agent*/, const string &who = "") override;
+ void banish(actor* /*agent*/, const string &who = "", const int power = 0) override;
void blink() override;
void teleport(bool right_now = false,
bool wizard_tele = false) override;
diff --git a/crawl-ref/source/stairs.cc b/crawl-ref/source/stairs.cc
index 93a7e55..6aa66a3 100644
--- a/crawl-ref/source/stairs.cc
+++ b/crawl-ref/source/stairs.cc
@@ -572,6 +572,7 @@ void floor_transition(dungeon_feature_type how, const dungeon_feature_type whenc
you.attribute[ATTR_BANISHMENT_IMMUNITY] = you.elapsed_time + 100
+ random2(100);
you.banished_by = "";
+ you.banished_power = 0;
}
// Interlevel travel data.
--
2.3.2 (Apple Git-55)
From f73364122231df40fb5558310e3d216a7d86a154 Mon Sep 17 00:00:00 2001
From: "Edgar A. Bering IV" <trizor@gmail.com>
Date: Thu, 22 Oct 2015 13:02:51 -0500
Subject: [PATCH 3/4] Xom and Miscast banishment power.
Xom and miscasts now work on XL for determining banishment depth.
This also means that Zot traps use XL for determining depth, as Zot
trap banishment is just a miscast.
---
crawl-ref/source/spl-miscast.cc | 2 +-
crawl-ref/source/xom.cc | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/crawl-ref/source/spl-miscast.cc b/crawl-ref/source/spl-miscast.cc
index 2ab3253..2143de6 100644
--- a/crawl-ref/source/spl-miscast.cc
+++ b/crawl-ref/source/spl-miscast.cc
@@ -551,7 +551,7 @@ bool MiscastEffect::_send_to_abyss()
{
return _malign_gateway(); // attempt to degrade to malign gateway
}
- target->banish(act_source, cause);
+ target->banish(act_source, cause, target->get_experience_level());
return true;
}
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc
index 5454293..d24b713 100644
--- a/crawl-ref/source/xom.cc
+++ b/crawl-ref/source/xom.cc
@@ -3162,8 +3162,8 @@ static int _xom_do_banishment(bool debug = false)
god_speaks(GOD_XOM, _get_xom_speech("banishment").c_str());
- // Handles note taking.
- banished("Xom");
+ // Handles note taking, scales depth by XL
+ banished("Xom", you.experience_level);
const int result = xom_maybe_reverts_banishment(true, debug);
return result;
--
2.3.2 (Apple Git-55)
From b3586064800ad0b9f850201ed8fc4f78d38fbff6 Mon Sep 17 00:00:00 2001
From: "Edgar A. Bering IV" <trizor@gmail.com>
Date: Thu, 22 Oct 2015 13:12:09 -0500
Subject: [PATCH 4/4] Correctly mark abyss.enter milestone
Previously the milestone was marked before the player entered the
abyss, so that place and oplace were the same (where banished from).
Now we mark after doing the floor_transition, so that place will
have the Abyss depth and oplace will be where from.
---
crawl-ref/source/abyss.cc | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/crawl-ref/source/abyss.cc b/crawl-ref/source/abyss.cc
index ba1e342..719a8c8 100644
--- a/crawl-ref/source/abyss.cc
+++ b/crawl-ref/source/abyss.cc
@@ -393,12 +393,6 @@ void banished(const string &who, const int power)
if (brdepth[BRANCH_ABYSS] == -1)
return;
- if (!player_in_branch(BRANCH_ABYSS))
- {
- mark_milestone("abyss.enter",
- "was cast into the Abyss!" + _who_banished(who));
- }
-
if (player_in_branch(BRANCH_ABYSS))
{
if (level_id::current().depth < brdepth[BRANCH_ABYSS])
@@ -422,6 +416,8 @@ void banished(const string &who, const int power)
push_features_to_abyss();
floor_transition(DNGN_ENTER_ABYSS, orig_terrain(you.pos()),
level_id(BRANCH_ABYSS, depth), true);
+ // This is an honest abyss entry, mark milestone
+ mark_milestone("abyss.enter", "was cast into the Abyss!" + _who_banished(who));
// Xom just might decide to interfere.
if (you_worship(GOD_XOM) && who != "Xom" && who != "wizard command"
--
2.3.2 (Apple Git-55)
|