[Hide Content]From bae17e77b5fb5db447cafe3a6d8a675d87fcf616 Mon Sep 17 00:00:00 2001
From: Shayne Halvorson <N78291@gmail.com>
Date: Sun, 19 Jan 2014 14:25:43 -0600
Subject: [PATCH] New spell: Summon Lightning Spire (L4 Summ/Air)
This spell creates an immobile ranged ally for an early Summonings spell that
isn't designed around overwhelming enemies under your horde.
Between Scorpions, Ice Beasts, and this, Summoners can choose whether to work
towards a multiple-per-cast spell, several melee allies, or a single ranged one.
---
crawl-ref/source/book-data.h | 2 +-
crawl-ref/source/dat/descript/spells.txt | 6 ++++
crawl-ref/source/describe.cc | 2 +-
crawl-ref/source/enum.h | 1 +
crawl-ref/source/spl-cast.cc | 3 ++
crawl-ref/source/spl-data.h | 13 ++++++++
crawl-ref/source/spl-summoning.cc | 51 ++++++++++++++++++++++++++++++
crawl-ref/source/spl-summoning.h | 1 +
crawl-ref/source/spl-util.cc | 1 +
9 files changed, 78 insertions(+), 2 deletions(-)
diff --git a/crawl-ref/source/book-data.h b/crawl-ref/source/book-data.h
index 6ce3665..e0028db 100644
--- a/crawl-ref/source/book-data.h
+++ b/crawl-ref/source/book-data.h
@@ -213,7 +213,7 @@
SPELL_CALL_CANINE_FAMILIAR,
SPELL_SUMMON_SCORPIONS,
SPELL_SUMMON_ICE_BEAST,
- SPELL_NO_SPELL,
+ SPELL_SUMMON_LIGHTNING_SPIRE,
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
diff --git a/crawl-ref/source/dat/descript/spells.txt b/crawl-ref/source/dat/descript/spells.txt
index b386c8f..7a39d0e 100644
--- a/crawl-ref/source/dat/descript/spells.txt
+++ b/crawl-ref/source/dat/descript/spells.txt
@@ -1185,6 +1185,12 @@ Summon Iron Elementals spell
This spell summons one or more iron elementals.
%%%%
+Summon Lightning Spire spell
+
+This spell constructs a temporary lightning spire in an adjacent tile. Though
+it can fire bouncing bolts of electricity at the caster's foes, it is completely
+immobile.
+%%%%
Summon Minor Demon spell
This spell summons between one and three minor (rank 5) demons.
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index afb3623..199b516 100644
--- a/crawl-ref/source/describe.cc
+++ b/crawl-ref/source/describe.cc
@@ -2812,7 +2812,7 @@ static int _get_spell_description(const spell_type spell,
if (const int limit = summons_limit(spell))
{
description += "You can sustain at most " + number_in_words(limit)
- + " creatures summoned by this spell.\n";
+ + " creature" + (limit > 1 ? "s" : "") + " summoned by this spell.\n";
}
const bool rod = item && item->base_type == OBJ_RODS;
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index 953997e..0e05e8e 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -3723,6 +3723,7 @@ enum spell_type
SPELL_SHAFT_SELF,
#endif
SPELL_BLINKBOLT,
+ SPELL_SUMMON_LIGHTNING_SPIRE,
NUM_SPELLS
};
diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc
index 8e97362..5041e05 100644
--- a/crawl-ref/source/spl-cast.cc
+++ b/crawl-ref/source/spl-cast.cc
@@ -1570,6 +1570,9 @@ static spret_type _do_cast(spell_type spell, int powc,
case SPELL_CONJURE_BALL_LIGHTNING:
return cast_conjure_ball_lightning(powc, god, fail);
+ case SPELL_SUMMON_LIGHTNING_SPIRE:
+ return cast_summon_lightning_spire(powc, beam.target, god, fail);
+
case SPELL_CALL_IMP:
return cast_call_imp(powc, god, fail);
diff --git a/crawl-ref/source/spl-data.h b/crawl-ref/source/spl-data.h
index cdcb3a2..63eb162 100644
--- a/crawl-ref/source/spl-data.h
+++ b/crawl-ref/source/spl-data.h
@@ -3314,6 +3314,19 @@ struct spell_desc
},
{
+ SPELL_SUMMON_LIGHTNING_SPIRE, "Summon Lightning Spire",
+ SPTYP_SUMMONING | SPTYP_AIR,
+ SPFLAG_GRID | SPFLAG_NOT_SELF,
+ 4,
+ 200,
+ 1, 1,
+ 0,
+ NULL,
+ false,
+ false
+},
+
+{
SPELL_NO_SPELL, "nonexistent spell",
0,
SPFLAG_TESTING,
diff --git a/crawl-ref/source/spl-summoning.cc b/crawl-ref/source/spl-summoning.cc
index 1527f6f..10af678 100644
--- a/crawl-ref/source/spl-summoning.cc
+++ b/crawl-ref/source/spl-summoning.cc
@@ -875,6 +875,56 @@ spret_type cast_conjure_ball_lightning(int pow, god_type god, bool fail)
return SPRET_SUCCESS;
}
+spret_type cast_summon_lightning_spire(int pow, const coord_def& where, god_type god, bool fail)
+{
+ const int dur = min(1 + (random2(pow) / 10), 4);
+
+ if (distance2(where, you.pos()) > dist_range(spell_range(SPELL_SUMMON_LIGHTNING_SPIRE,
+ pow))
+ || !in_bounds(where))
+ {
+ mpr("That's too far away.");
+ return SPRET_ABORT;
+ }
+
+ if (!monster_habitable_grid(MONS_HUMAN, grd(where)))
+ {
+ mpr("You can't construct there.");
+ return SPRET_ABORT;
+ }
+
+ monster* mons = monster_at(where);
+ if (mons)
+ {
+ if (you.can_see(mons))
+ {
+ mpr("That space is already occupied.");
+ return SPRET_ABORT;
+ }
+
+ fail_check();
+
+ // invisible monster
+ mpr("Something you can't see is blocking your construction!");
+ return SPRET_SUCCESS;
+ }
+
+ fail_check();
+
+ if (create_monster(
+ mgen_data(MONS_LIGHTNING_SPIRE, BEH_FRIENDLY, &you, dur, SPELL_SUMMON_LIGHTNING_SPIRE,
+ where, MHITYOU, MG_FORCE_BEH | MG_FORCE_PLACE, god)))
+ {
+ if (!silenced(where))
+ mpr("An electric hum fills the air.");
+ }
+ else
+ canned_msg(MSG_NOTHING_HAPPENS);
+
+ return SPRET_SUCCESS;
+
+}
+
spret_type cast_call_imp(int pow, god_type god, bool fail)
{
fail_check();
@@ -3091,6 +3141,7 @@ static const summons_desc summonsdata[] =
{ SPELL_SUMMON_HORRIBLE_THINGS, 8, 2 },
{ SPELL_SHADOW_CREATURES, 4, 2 },
{ SPELL_SUMMON_DRAGON, 2, 8 },
+ { SPELL_SUMMON_LIGHTNING_SPIRE, 1, 2 },
// Monster spells
{ SPELL_FAKE_RAKSHASA_SUMMON, 4, 2 },
{ SPELL_SUMMON_UFETUBUS, 8, 2 },
diff --git a/crawl-ref/source/spl-summoning.h b/crawl-ref/source/spl-summoning.h
index eb5c47b..3561bd8 100644
--- a/crawl-ref/source/spl-summoning.h
+++ b/crawl-ref/source/spl-summoning.h
@@ -47,6 +47,7 @@ bool summon_holy_warrior(int pow, bool punish);
spret_type cast_tukimas_dance(int pow, god_type god = GOD_NO_GOD,
bool force_hostile = false, bool fail = false);
spret_type cast_conjure_ball_lightning(int pow, god_type god, bool fail);
+spret_type cast_summon_lightning_spire(int pow, const coord_def& where, god_type god, bool fail);
spret_type cast_call_imp(int pow, god_type god, bool fail);
bool summon_demon_type(monster_type mon, int pow, god_type god = GOD_NO_GOD,
diff --git a/crawl-ref/source/spl-util.cc b/crawl-ref/source/spl-util.cc
index e3f4b44..84a551a 100644
--- a/crawl-ref/source/spl-util.cc
+++ b/crawl-ref/source/spl-util.cc
@@ -1228,6 +1228,7 @@ bool spell_no_hostile_in_range(spell_type spell)
case SPELL_GOLUBRIAS_PASSAGE:
case SPELL_LRD:
case SPELL_FULMINANT_PRISM:
+ case SPELL_SUMMON_LIGHTNING_SPIRE:
// Shock and Lightning Bolt are no longer here, as the code below can
// account for possible bounces.
--
1.7.9.5