summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells4.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-31 21:24:37 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-31 21:24:37 +0000
commit879381b4e68347b743d5fd69b4ccfa9dfd5162bb (patch)
tree6613b946fa5ab7f419b53beb122ae6f0ad3762e7 /crawl-ref/source/spells4.cc
parent630b860361ef96c367743da0da276f320209e61d (diff)
downloadcrawl-ref-879381b4e68347b743d5fd69b4ccfa9dfd5162bb.tar.gz
crawl-ref-879381b4e68347b743d5fd69b4ccfa9dfd5162bb.zip
Fix 2032476: improve interface for Lee's Rapid Deconstruction.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6742 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells4.cc')
-rw-r--r--crawl-ref/source/spells4.cc23
1 files changed, 5 insertions, 18 deletions
diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc
index 31b1ad7c4c..d9be443673 100644
--- a/crawl-ref/source/spells4.cc
+++ b/crawl-ref/source/spells4.cc
@@ -1705,25 +1705,15 @@ void cast_snake_charm(int pow)
apply_one_neighbouring_square(_snake_charm_monsters, pow);
}
-void cast_fragmentation(int pow) // jmf: ripped idea from airstrike
+bool cast_fragmentation(int pow, const dist& spd)
{
bolt beam;
- dist spd;
int debris = 0;
int trap;
bool explode = false;
bool hole = true;
const char *what = NULL;
- mpr("Fragment what (e.g. a wall or monster)?", MSGCH_PROMPT);
- direction(spd, DIR_TARGET, TARG_ENEMY);
-
- if (!spd.isValid)
- {
- canned_msg(MSG_SPELL_FIZZLES);
- return;
- }
-
//FIXME: If (player typed '>' to attack floor) goto do_terrain;
beam.beam_source = MHITYOU;
beam.thrower = KILL_YOU;
@@ -1745,12 +1735,8 @@ void cast_fragmentation(int pow) // jmf: ripped idea from airstrike
if (mon != NON_MONSTER)
{
- // This needs its own hand_buff... we also need to do it first
- // in case the target dies. -- bwr
- char explode_msg[INFO_SIZE];
-
- snprintf(explode_msg, sizeof(explode_msg), "%s explodes!",
- menv[mon].name(DESC_CAP_THE).c_str());
+ // Save this message in case the monster isn't available later.
+ std::string explode_msg = menv[mon].name(DESC_CAP_THE) + " explodes!";
switch (menv[mon].type)
{
@@ -1872,7 +1858,7 @@ void cast_fragmentation(int pow) // jmf: ripped idea from airstrike
goto do_terrain;
}
- mpr(explode_msg);
+ mpr(explode_msg.c_str());
goto all_done;
}
@@ -2046,6 +2032,7 @@ void cast_fragmentation(int pow) // jmf: ripped idea from airstrike
// If damage dice are zero we assume that nothing happened at all.
canned_msg(MSG_SPELL_FIZZLES);
}
+ return true;
}
void cast_twist(int pow)