summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-summoning.cc
diff options
context:
space:
mode:
authorDracoOmega <draco_omega@live.com>2014-03-15 13:31:45 -0230
committerDracoOmega <draco_omega@live.com>2014-03-15 13:31:45 -0230
commit1b9ad3724cf3593832284276b81b4af6af2f3335 (patch)
tree5b1ec8b341c5e5429bfe3d20ec933029e2a8fee1 /crawl-ref/source/spl-summoning.cc
parent87ed260aadeed25e3c5192e4d8a258fc46bb4259 (diff)
downloadcrawl-ref-1b9ad3724cf3593832284276b81b4af6af2f3335.tar.gz
crawl-ref-1b9ad3724cf3593832284276b81b4af6af2f3335.zip
Simplify player CBL code
The main function of the code stripped out seems to have been to buggily fail to place ball lightnings a significant percentage of the time - otherwise this briefer version appears to function basically the same.
Diffstat (limited to 'crawl-ref/source/spl-summoning.cc')
-rw-r--r--crawl-ref/source/spl-summoning.cc30
1 files changed, 2 insertions, 28 deletions
diff --git a/crawl-ref/source/spl-summoning.cc b/crawl-ref/source/spl-summoning.cc
index 51a848efe4..56bd43cde8 100644
--- a/crawl-ref/source/spl-summoning.cc
+++ b/crawl-ref/source/spl-summoning.cc
@@ -965,43 +965,17 @@ spret_type cast_conjure_ball_lightning(int pow, god_type god, bool fail)
fail_check();
bool success = false;
- // XXX: for finding a nearby space
- monster temp;
- temp.type = MONS_BALL_LIGHTNING;
- temp.position = you.pos();
-
- // Restricted so that the situation doesn't get too gross. Each of
- // these will explode for 3d20 damage. -- bwr
const int how_many = min(8, 3 + random2avg(2 + pow / 50, 2));
for (int i = 0; i < how_many; ++i)
{
- coord_def target;
- bool found = false;
- for (int j = 0; j < 10; ++j)
- {
- if (random_near_space(&temp, you.pos(), target, true, false, false)
- && distance2(you.pos(), target) <= 5)
- {
- found = true;
- break;
- }
- }
-
- // If we fail, we'll try the ol' summon next to player trick.
- if (!found)
- target = you.pos();
-
- if (monster *ball = mons_place(
+ if (monster *ball = create_monster(
mgen_data(MONS_BALL_LIGHTNING, BEH_FRIENDLY, &you,
0, SPELL_CONJURE_BALL_LIGHTNING,
- target, MHITNOT, 0, god)))
+ you.pos(), MHITNOT, 0, god)))
{
success = true;
ball->add_ench(ENCH_SHORT_LIVED);
- ball->flags |= MF_ATT_CHANGE_ATTEMPT;
- ball->foe = MHITNOT;
- ball->behaviour = BEH_WANDER;
}
}