summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/item_use.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-25 17:04:20 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-25 17:04:20 +0000
commitb1c2d6e096eebdbae0c2f5a8dd48a5f67a1eb678 (patch)
tree9d9ef2508041df23a59c5bc447cc4ee8633944c5 /crawl-ref/source/item_use.cc
parent287e5f0820620b81b518ab1f554107afd8a62ebe (diff)
downloadcrawl-ref-b1c2d6e096eebdbae0c2f5a8dd48a5f67a1eb678.tar.gz
crawl-ref-b1c2d6e096eebdbae0c2f5a8dd48a5f67a1eb678.zip
Complete rewrite of the beam code, making it considerably saner.
However, there might be quite a few bugs lurking in this rewrite. Sorry. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7975 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r--crawl-ref/source/item_use.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 2c9be93581..7d638147b1 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -1873,7 +1873,7 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus,
pbolt.foe_helped = pbolt.foe_hurt = 0;
pbolt.foe_ratio = 100;
- fire_beam(pbolt);
+ pbolt.fire();
// Should only happen if the player answered 'n' to one of those
// "Fire through friendly?" prompts.
@@ -2588,9 +2588,10 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus,
if (teleport)
{
// Violating encapsulation somewhat...oh well.
- hit = (affect(pbolt, pbolt.target, &item) != 0);
+ pbolt.use_target_as_pos = true;
+ pbolt.affect_cell();
if (acc_bonus != DEBUG_COOKIE)
- beam_drop_object(pbolt, &item, pbolt.target);
+ pbolt.drop_object();
}
else
{
@@ -2599,7 +2600,7 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus,
// Dropping item copy, since the launched item might be different.
pbolt.drop_item = !did_return;
- fire_beam(pbolt);
+ pbolt.fire();
// The item can be destroyed before returning.
if (did_return && thrown_object_destroyed(&item, pbolt.target, true))
@@ -2617,7 +2618,7 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus,
// Fire beam in reverse.
pbolt.setup_retrace();
viewwindow(true, false);
- fire_beam(pbolt);
+ pbolt.fire();
msg::stream << item.name(DESC_CAP_THE) << " returns to your pack!"
<< std::endl;