diff options
author | Robert Vollmert <rvollmert@gmx.net> | 2009-12-01 11:23:32 +0100 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2009-12-01 11:44:42 +0100 |
commit | 20889107ee4ef5e7f61b1facfdf4da4bc97935b6 (patch) | |
tree | edc5bd65a8764489c272d3cf343ffb81e95525d6 /crawl-ref/source/spells4.cc | |
parent | 74584418a0204eb12a70f8dd4647605f695dbf31 (diff) | |
download | crawl-ref-20889107ee4ef5e7f61b1facfdf4da4bc97935b6.tar.gz crawl-ref-20889107ee4ef5e7f61b1facfdf4da4bc97935b6.zip |
Passwall interface improvement (petato).
Patch slightly modified from
http://crawl.develz.org/mantis/view.php?id=106.
I've made a little patch that improves passwall's
behavior somewhat. It now gives different messages
depending on whether you failed the power check,
there's something blocking your path, or the wall is too
deep.
Additionally, the prompts have been removed: if it would
have been possible to cast the spell without dying,
that's what happens, and if the wall is too deep it's
canceled.
So basically it works like before, except you don't have
to worry about committing suicide by accident.
Diffstat (limited to 'crawl-ref/source/spells4.cc')
-rw-r--r-- | crawl-ref/source/spells4.cc | 36 |
1 files changed, 12 insertions, 24 deletions
diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc index 7abd8ebfaf..1a03080638 100644 --- a/crawl-ref/source/spells4.cc +++ b/crawl-ref/source/spells4.cc @@ -903,7 +903,6 @@ static int _passwall(coord_def where, int pow, int, actor *) int howdeep = 0; bool done = false; int shallow = 1 + (you.skills[SK_EARTH_MAGIC] / 8); - bool non_rock_barriers = false; // Irony: you can start on a secret door but not a door. // Worked stone walls are out, they're not diggable and @@ -931,7 +930,10 @@ static int _passwall(coord_def where, int pow, int, actor *) { default: if (feat_is_solid(grd(n))) - non_rock_barriers = true; + { + mpr("Something is blocking your path through the rock."); + return 0; + } done = true; break; @@ -947,32 +949,18 @@ static int _passwall(coord_def where, int pow, int, actor *) } int range = shallow + random2(pow) / 25; + int maxrange = shallow + pow / 25; - if (howdeep > shallow || non_rock_barriers) + if (howdeep >= maxrange) { - mprf("This rock feels %sdeep.", - non_rock_barriers || (howdeep > range)? "extremely " : ""); - - if (yesno("Try anyway?")) - { - if (howdeep > range || non_rock_barriers) - { - ouch(INSTANT_DEATH, NON_MONSTER, KILLED_BY_PETRIFICATION); - //jmf: not return; if wizard, successful transport is option - } - } - else - { - if (one_chance_in(30)) - mpr("Wuss."); - else - canned_msg(MSG_OK); - return 1; - } + mprf("This rock feels extremely deep."); + return 0; } - // Passwall delay is reduced, and the delay cannot be interrupted. - start_delay( DELAY_PASSWALL, 1 + howdeep, n.x, n.y ); + if (howdeep > range) + mprf("You fail to penetrate the rock."); + else // Passwall delay is reduced, and the delay cannot be interrupted. + start_delay(DELAY_PASSWALL, 1 + howdeep, n.x, n.y); return 1; } |