summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-10 13:37:17 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-10 13:37:17 +0000
commit8fcf9242d71cf3fa44ad46bc5e37313e8b6b73b9 (patch)
tree4ba2cc2830d7503540677ae6ededc9192dbb076f /crawl-ref/source
parent22e375d42eabd760283d4e0d8ea42c65e66108af (diff)
downloadcrawl-ref-8fcf9242d71cf3fa44ad46bc5e37313e8b6b73b9.tar.gz
crawl-ref-8fcf9242d71cf3fa44ad46bc5e37313e8b6b73b9.zip
Reorder spells in your_spells() and clean up.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5702 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/spells2.cc52
-rw-r--r--crawl-ref/source/spells4.cc108
-rw-r--r--crawl-ref/source/spl-cast.cc912
3 files changed, 552 insertions, 520 deletions
diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc
index 7d1706aebe..b49ac3f3ce 100644
--- a/crawl-ref/source/spells2.cc
+++ b/crawl-ref/source/spells2.cc
@@ -607,9 +607,9 @@ static std::string describe_monsters(const counted_monster_list &list)
return (out.str());
}
-// poisonous light passes right through invisible players
+// Poisonous light passes right through invisible players
// and monsters, and so, they are unaffected by this spell --
-// assumes only you can cast this spell (or would want to)
+// assumes only you can cast this spell (or would want to).
void cast_toxic_radiance(void)
{
struct monsters *monster;
@@ -621,7 +621,7 @@ void cast_toxic_radiance(void)
more();
mesclr();
- // determine whether the player is hit by the radiance: {dlb}
+ // Determine whether the player is hit by the radiance. {dlb}
if (you.duration[DUR_INVIS])
{
mpr("The light passes straight through your body.");
@@ -866,7 +866,6 @@ bool vampiric_drain(int pow, const dist &vmove)
return (true);
}
-// Note: this function is currently only used for Freeze. -- bwr
char burn_freeze(int pow, beam_type flavour)
{
int mgr = NON_MONSTER;
@@ -895,6 +894,7 @@ char burn_freeze(int pow, beam_type flavour)
mgr = mgrd[you.x_pos + bmove.dx][you.y_pos + bmove.dy];
// Yes, this is strange, but it does maintain the original behaviour.
+ // Possibly to avoid giving information about invisible monsters?
if (mgr == NON_MONSTER)
{
mpr("There isn't anything close enough!");
@@ -1151,9 +1151,7 @@ bool cast_sticks_to_snakes(int pow, bool god_gift)
mon = random2(100) < pow / 3 ? MONS_BROWN_SNAKE : MONS_SNAKE;
}
else
- {
mon = MONS_SMALL_SNAKE;
- }
if (create_monster(
mgen_data(mon, beha, dur,
@@ -1184,6 +1182,7 @@ bool cast_sticks_to_snakes(int pow, bool god_gift)
// ogres, and most importantly ogre magi). Still it's unlikely
// any character is strong enough to bother lugging a few of
// these around. -- bwr
+
if (item_mass(you.inv[wpn]) < 300)
mon = MONS_SNAKE;
else
@@ -1217,7 +1216,9 @@ bool cast_sticks_to_snakes(int pow, bool god_gift)
dec_inv_item_quantity(you.equip[EQ_WEAPON], count);
mprf("You create %s snake%s!",
- count > 1 ? "some" : "a", count > 1 ? "s" : "");
+ count > 1 ? "some" : "a",
+ count > 1 ? "s" : "");
+
return (true);
}
@@ -1254,8 +1255,9 @@ bool cast_summon_scorpions(int pow, bool god_gift)
return (success);
}
-bool cast_summon_swarm(int pow, bool god_gift,
- bool force_hostile)
+// Creates a mixed swarm of typical swarming animals.
+// Number, duration and friendlinesss depend on spell power.
+bool cast_summon_swarm(int pow, bool god_gift, bool force_hostile)
{
bool success = false;
@@ -1271,37 +1273,37 @@ bool cast_summon_swarm(int pow, bool god_gift,
switch (random2(14))
{
case 0:
- case 1: // prototypical swarming creature {dlb}
+ case 1:
+ case 2: // prototypical swarming creature {dlb}
mon = MONS_KILLER_BEE;
break;
- case 2: // comment said "larva", code read scorpion {dlb}
- mon = MONS_SCORPION;
- break; // think: "The Arrival" {dlb}
+ case 3:
+ mon = MONS_SCORPION; // think: "The Arrival" {dlb}
+ break;
- case 3: //jmf: technically not insects but still cool
+ case 4: //jmf: technically not insects but still cool
mon = MONS_WORM;
break; // but worms kinda "swarm" so s'ok {dlb}
- case 4: // comment read "larva", code was for scorpion
+ case 5:
mon = MONS_GIANT_MOSQUITO;
break; // changed into giant mosquito 12jan2000 {dlb}
- case 5: // think: scarabs in "The Mummy" {dlb}
- mon = MONS_GIANT_BEETLE;
+ case 6:
+ mon = MONS_GIANT_BEETLE; // think: scarabs in "The Mummy" {dlb}
break;
- case 6: //jmf: blowfly instead of queen bee
+ case 7: //jmf: blowfly instead of queen bee
mon = MONS_GIANT_BLOWFLY;
break;
- // queen bee added if more than x bees in swarm? {dlb}
- // the above would require code rewrite - worth it? {dlb}
+ // Queen bee added if more than x bees in swarm? {dlb}
+ // The above would require code rewrite - worth it? {dlb}
- case 8: //jmf: changed to red wasp; was wolf spider
- mon = MONS_WOLF_SPIDER; //jmf: spiders aren't insects
- break; // think: "Kingdom of the Spiders" {dlb}
- // not just insects!!! - changed back {dlb}
+ case 8:
+ mon = MONS_WOLF_SPIDER; // think: "Kingdom of the Spiders" {dlb}
+ break;
case 9:
mon = MONS_BUTTERFLY; // comic relief? {dlb}
@@ -1314,7 +1316,7 @@ bool cast_summon_swarm(int pow, bool god_gift,
default: // 3 in 14 chance, 12jan2000 {dlb}
mon = MONS_GIANT_ANT;
break;
- } // end switch
+ }
bool friendly = (force_hostile) ? false : (random2(pow) > 7);
diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc
index bd58066c2c..7e7f321c62 100644
--- a/crawl-ref/source/spells4.cc
+++ b/crawl-ref/source/spells4.cc
@@ -74,8 +74,8 @@ static int quadrant_blink(int x, int y, int pow, int garbage);
void do_monster_rot(int mon);
-// just to avoid typing this over and over
-// now returns true if monster died -- bwr
+// Just to avoid typing this over and over.
+// Returns true if monster died. -- bwr
inline bool player_hurt_monster(int monster, int damage)
{
ASSERT( monster != NON_MONSTER );
@@ -97,7 +97,7 @@ inline bool player_hurt_monster(int monster, int damage)
}
return (false);
-} // end player_hurt_monster()
+}
// Here begin the actual spells:
static int shatter_monsters(int x, int y, int pow, int garbage)
@@ -193,7 +193,7 @@ static int shatter_monsters(int x, int y, int pow, int garbage)
damage = 0;
return (damage);
-} // end shatter_monsters()
+}
static int shatter_items(int x, int y, int pow, int garbage)
{
@@ -235,7 +235,7 @@ static int shatter_items(int x, int y, int pow, int garbage)
}
return 0;
-} // end shatter_items()
+}
static int shatter_walls(int x, int y, int pow, int garbage)
{
@@ -300,17 +300,20 @@ static int shatter_walls(int x, int y, int pow, int garbage)
}
return (0);
-} // end shatter_walls()
+}
void cast_shatter(int pow)
{
int damage = 0;
- const bool sil = silenced(you.x_pos, you.y_pos);
-
- noisy(30, you.x_pos, you.y_pos);
+ const bool silence = silenced(you.x_pos, you.y_pos);
- mprf((sil ? MSGCH_PLAIN : MSGCH_SOUND),
- "The dungeon %s!", (sil ? "shakes" : "rumbles"));
+ if (silence)
+ mpr("The dungeon shakes!");
+ else
+ {
+ noisy(30, you.x_pos, you.y_pos);
+ mpr("The dungeon rumbles!", MSGCH_SOUND);
+ }
switch (you.attribute[ATTR_TRANSFORMATION])
{
@@ -350,11 +353,11 @@ void cast_shatter(int pow)
int dest = apply_area_within_radius( shatter_walls, you.x_pos, you.y_pos,
pow, rad, 0 );
- if (dest && !sil)
+ if (dest && !silence)
mpr("Ka-crash!", MSGCH_SOUND);
-} // end cast_shatter()
+}
-// cast_forescry: raises evasion (by 8 currently) via divination
+// Cast_forescry: raises evasion (by 8 currently) via Divinations.
void cast_forescry(int pow)
{
if (!you.duration[DUR_FORESCRY])
@@ -377,7 +380,7 @@ void cast_see_invisible(int pow)
else
mpr("Your vision seems to sharpen.");
- // no message if you already are under the spell
+ // No message if you already are under the spell.
you.duration[DUR_SEE_INVISIBLE] += 10 + random2(2 + (pow / 2));
if (you.duration[DUR_SEE_INVISIBLE] > 100)
@@ -429,9 +432,9 @@ static int sleep_monsters(int x, int y, int pow, int garbage)
if (check_mons_resist_magic( &mon, pow ))
return 0;
- // works on friendlies too, so no check for that
+ // Works on friendlies too, so no check for that.
- //jmf: now that sleep == hibernation:
+ //jmf: Now that sleep == hibernation:
if (mons_res_cold( &mon ) > 0 && coinflip())
return 0;
if (mon.has_ench(ENCH_SLEEP_WARY))
@@ -443,12 +446,12 @@ static int sleep_monsters(int x, int y, int pow, int garbage)
mon.add_ench(ENCH_SLOW);
return 1;
-} // end sleep_monsters()
+}
void cast_mass_sleep(int pow)
{
apply_area_visible(sleep_monsters, pow);
-} // end cast_mass_sleep()
+}
// This is a hack until we set an is_beast flag in the monster data
// (which we might never do, this is sort of minor.)
@@ -464,10 +467,12 @@ static bool is_domesticated_animal(int type)
MONS_SPINY_FROG, MONS_BLINK_FROG, MONS_WOLF, MONS_WARG,
MONS_BEAR, MONS_GRIZZLY_BEAR, MONS_POLAR_BEAR, MONS_BLACK_BEAR
};
- for ( unsigned int i = 0; i < ARRAYSZ(types); ++i )
- if ( types[i] == type )
- return true;
- return false;
+
+ for (unsigned int i = 0; i < ARRAYSZ(types); ++i)
+ if (types[i] == type)
+ return (true);
+
+ return (false);
}
static int tame_beast_monsters(int x, int y, int pow, int garbage)
@@ -499,12 +504,12 @@ static int tame_beast_monsters(int x, int y, int pow, int garbage)
simple_monster_message(monster, " is tamed!");
if (random2(100) < random2(pow / 10))
- monster->attitude = ATT_FRIENDLY; // permanent
+ monster->attitude = ATT_FRIENDLY; // permanent
else
- monster->add_ench(ENCH_CHARM); // temporary
+ monster->add_ench(ENCH_CHARM); // temporary
return 1;
-} // end tame_beast_monsters()
+}
void cast_tame_beasts(int pow)
{
@@ -550,11 +555,13 @@ static int ignite_poison_objects(int x, int y, int pow, int garbage)
}
if (strength > 0)
+ {
place_cloud(CLOUD_FIRE, x, y, strength + roll_dice(3, strength / 4),
KC_YOU);
+ }
return (strength);
-} // end ignite_poison_objects()
+}
static int ignite_poison_clouds( int x, int y, int pow, int garbage )
{
@@ -585,7 +592,7 @@ static int ignite_poison_clouds( int x, int y, int pow, int garbage )
}
return did_anything;
-} // end ignite_poison_clouds()
+}
static int ignite_poison_monsters(int x, int y, int pow, int garbage)
{
@@ -980,7 +987,7 @@ static int distortion_monsters(int x, int y, int pow, int message)
void cast_bend(int pow)
{
apply_one_neighbouring_square( distortion_monsters, pow );
-} // end cast_bend()
+}
// Really this is just applying the best of Band/Warp weapon/Warp field
// into a spell that gives the "make monsters go away" benefit without
@@ -1028,7 +1035,7 @@ void cast_dispersal(int pow)
if (apply_area_around_square( disperse_monsters,
you.x_pos, you.y_pos, pow ) == 0)
{
- mpr( "There is a brief shimmering in the air around you." );
+ mpr( "The air shimmers briefly around you." );
}
}
@@ -1223,7 +1230,7 @@ static int intoxicate_monsters(int x, int y, int pow, int garbage)
menv[mon].add_ench(mon_enchant(ENCH_CONFUSION, 0, KC_YOU));
return 1;
-} // end intoxicate_monsters()
+}
void cast_intoxicate(int pow)
{
@@ -1237,7 +1244,7 @@ void cast_intoxicate(int pow)
}
apply_area_visible(intoxicate_monsters, pow);
-} // end cast_intoxicate()
+}
bool backlight_monsters(int x, int y, int pow, int garbage)
{
@@ -1636,13 +1643,13 @@ static int rot_undead(int x, int y, int pow, int garbage)
if (check_mons_resist_magic(&menv[mon], pow))
return 0;
- // this does not make sense -- player mummies are
+ // This does not make sense -- player mummies are
// immune to rotting (or have been) -- so what is
// the schema in use here to determine rotting??? {dlb}
- //jmf: up for discussion. it is clearly unfair to
+ //jmf: Up for discussion. it is clearly unfair to
// rot player mummies.
- // the `shcema' here is: corporeal non-player undead
+ // the `schema' here is: corporeal non-player undead
// rot, discorporeal undead don't rot. if you wanna
// insist that monsters get the same treatment as
// players, I demand my player mummies get to worship
@@ -1676,14 +1683,14 @@ static int rot_undead(int x, int y, int pow, int garbage)
menv[mon].add_ench( mon_enchant(ENCH_ROT, ench, KC_YOU) );
return 1;
-} // end rot_undead()
+}
static int rot_corpses(int x, int y, int pow, int garbage)
{
UNUSED( garbage );
return make_a_rot_cloud(x, y, pow, CLOUD_MIASMA);
-} // end rot_corpses()
+}
void cast_rotting(int pow)
{
@@ -1691,7 +1698,7 @@ void cast_rotting(int pow)
apply_area_visible(rot_undead, pow);
apply_area_visible(rot_corpses, pow);
return;
-} // end cast_rotting()
+}
void do_monster_rot(int mon)
{
@@ -1705,7 +1712,7 @@ void do_monster_rot(int mon)
player_hurt_monster( mon, damage );
return;
-} // end do_monster_rot()
+}
static int snake_charm_monsters(int x, int y, int pow, int message)
{
@@ -1713,11 +1720,14 @@ static int snake_charm_monsters(int x, int y, int pow, int message)
int mon = mgrd[x][y];
- if (mon == NON_MONSTER) return 0;
- if (mons_friendly(&menv[mon])) return 0;
- if (one_chance_in(4)) return 0;
- if (mons_char(menv[mon].type) != 'S') return 0;
- if (check_mons_resist_magic(&menv[mon], pow)) return 0;
+ if (mon == NON_MONSTER
+ || one_chance_in(4)
+ || mons_friendly(&menv[mon])
+ || mons_char(menv[mon].type) != 'S'
+ || check_mons_resist_magic(&menv[mon], pow))
+ {
+ return 0;
+ }
menv[mon].attitude = ATT_FRIENDLY;
mprf("%s sways back and forth.", menv[mon].name(DESC_CAP_THE).c_str());
@@ -1753,16 +1763,16 @@ void cast_fragmentation(int pow) // jmf: ripped idea from airstrike
//FIXME: if (player typed '>' to attack floor) goto do_terrain;
blast.beam_source = MHITYOU;
blast.thrower = KILL_YOU;
- blast.aux_source.clear();
blast.ex_size = 1; // default
blast.type = '#';
blast.colour = 0;
- blast.set_target(beam);
blast.source_x = you.x_pos;
blast.source_y = you.y_pos;
- blast.is_tracer = false;
blast.flavour = BEAM_FRAG;
blast.hit = AUTOMATIC_HIT;
+ blast.is_tracer = false;
+ blast.set_target(beam);
+ blast.aux_source.clear();
// Number of dice vary... 3 is easy/common, but it can get as high as 6.
blast.damage = dice_def( 0, 5 + pow / 10 );
@@ -2078,7 +2088,7 @@ void cast_fragmentation(int pow) // jmf: ripped idea from airstrike
}
else if (blast.damage.num == 0)
{
- // if damage dice are zero we assume that nothing happened at all.
+ // If damage dice are zero we assume that nothing happened at all.
canned_msg(MSG_SPELL_FIZZLES);
}
} // end cast_fragmentation()
@@ -2099,7 +2109,7 @@ void cast_twist(int pow)
const int mons = mgrd[ targ.tx ][ targ.ty ];
- // anything there?
+ // Anything there?
if (mons == NON_MONSTER || targ.isMe)
{
mpr("There is no monster there!");
diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc
index 065c549315..a44084f7e7 100644
--- a/crawl-ref/source/spl-cast.cc
+++ b/crawl-ref/source/spl-cast.cc
@@ -913,6 +913,9 @@ static bool _spell_is_uncastable(spell_type spell)
// Returns SPRET_SUCCESS if spell is successfully cast for purposes of
// exercising, SPRET_FAIL otherwise, or SPRET_ABORT if the player canceled
// the casting.
+// Not all of these are actually real spells; invocations, decks, rods or misc.
+// effects might also land us here.
+// Others are currently unused or unimplemented.
spret_type your_spells(spell_type spell, int powc, bool allow_fail)
{
struct dist spd;
@@ -938,10 +941,10 @@ spret_type your_spells(spell_type spell, int powc, bool allow_fail)
(testbits(flags, SPFLAG_HELPFUL) ? TARG_FRIEND : TARG_ENEMY);
targeting_type dir =
- (testbits( flags, SPFLAG_TARGET ) ? DIR_TARGET :
- testbits( flags, SPFLAG_GRID ) ? DIR_TARGET :
- testbits( flags, SPFLAG_DIR ) ? DIR_DIR
- : DIR_NONE);
+ (testbits( flags, SPFLAG_TARGET ) ? DIR_TARGET :
+ testbits( flags, SPFLAG_GRID ) ? DIR_TARGET :
+ testbits( flags, SPFLAG_DIR ) ? DIR_DIR
+ : DIR_NONE);
const char *prompt = get_spell_target_prompt(spell);
if (spell == SPELL_EVAPORATE)
@@ -1072,374 +1075,351 @@ spret_type your_spells(spell_type spell, int powc, bool allow_fail)
switch (spell)
{
- case SPELL_IDENTIFY:
- identify(powc);
- break;
-
- case SPELL_TELEPORT_SELF:
- you_teleport();
+ // Attack spells.
+ // using burn_freeze()
+ case SPELL_BURN:
+ if (burn_freeze(powc, BEAM_FIRE) == -1)
+ return (SPRET_ABORT);
break;
- case SPELL_CAUSE_FEAR:
- mass_enchantment(ENCH_FEAR, powc, MHITYOU);
+ case SPELL_FREEZE:
+ if (burn_freeze(powc, BEAM_COLD) == -1)
+ return (SPRET_ABORT);
break;
- case SPELL_CREATE_NOISE: // unused, the player can shout to do this - bwr
- noisy(25, you.x_pos, you.y_pos, "You hear a voice calling your name!");
+ case SPELL_CRUSH:
+ if (burn_freeze(powc, BEAM_MISSILE) == -1)
+ return (SPRET_ABORT);
break;
- case SPELL_REMOVE_CURSE:
- remove_curse(false);
+ case SPELL_ARC:
+ if (burn_freeze(powc, BEAM_ELECTRICITY) == -1)
+ return (SPRET_ABORT);
break;
+ // direct beams/bolts
case SPELL_MAGIC_DART:
if (!zapping(ZAP_MAGIC_DARTS, powc, beam, true))
return (SPRET_ABORT);
break;
- case SPELL_FIREBALL:
- if (!fireball(powc, beam))
- return (SPRET_ABORT);
- break;
-
- case SPELL_DELAYED_FIREBALL:
- crawl_state.cant_cmd_repeat("You can't repeat delayed fireball.");
- // This spell has two main advantages over Fireball:
- //
- // (1) The release is instantaneous, so monsters will not
- // get an action before the player... this allows the
- // player to hit monsters with a double fireball (this
- // is why we only allow one delayed fireball at a time,
- // if you want to allow for more, then the release should
- // take at least some amount of time).
- //
- // The casting of this spell still costs a turn. So
- // casting Delayed Fireball and immediately releasing
- // the fireball is only slightly different than casting
- // a regular Fireball (monsters act in the middle instead
- // of at the end). This is why we allow for the spell
- // level discount so that Fireball is free with this spell
- // (so that it only costs 7 levels instead of 13 to have
- // both).
- //
- // (2) When the fireball is released, it is guaranteed to
- // go off... the spell only fails at this point. This can
- // be a large advantage for characters who have difficulty
- // casting Fireball in their standard equipment. However,
- // the power level for the actual fireball is determined at
- // release, so if you do swap out your enhancers you'll
- // get a less powerful ball when its released. -- bwr
- //
- if (!you.attribute[ ATTR_DELAYED_FIREBALL ])
- {
- // okay, this message is weak but functional -- bwr
- mpr( "You feel magically charged." );
- you.attribute[ ATTR_DELAYED_FIREBALL ] = 1;
- }
- else
- canned_msg( MSG_NOTHING_HAPPENS );
- break;
-
case SPELL_STRIKING:
if (!zapping(ZAP_STRIKING, powc, beam, true))
return (SPRET_ABORT);
break;
- case SPELL_CONJURE_FLAME:
- if (!conjure_flame(powc))
+ case SPELL_THROW_FLAME:
+ if (!zapping(ZAP_FLAME, powc, beam, true))
return (SPRET_ABORT);
break;
- case SPELL_DIG:
- if (!zapping(ZAP_DIGGING, powc, beam, true))
+ case SPELL_THROW_FROST:
+ if (!zapping(ZAP_FROST, powc, beam, true))
return (SPRET_ABORT);
break;
- case SPELL_BOLT_OF_FIRE:
- if (!zapping(ZAP_FIRE, powc, beam, true))
+ case SPELL_PAIN:
+ if (!zapping(ZAP_PAIN, powc, beam, true))
return (SPRET_ABORT);
+ dec_hp(1, false);
break;
- case SPELL_BOLT_OF_COLD:
- if (!zapping(ZAP_COLD, powc, beam, true))
+ case SPELL_FLAME_TONGUE:
+ if (!zapping(ZAP_FLAME_TONGUE, powc, beam, true))
return (SPRET_ABORT);
break;
- case SPELL_LIGHTNING_BOLT:
- if (!zapping(ZAP_LIGHTNING, powc, beam, true))
+ case SPELL_SANDBLAST:
+ if (!cast_sandblast(powc, beam))
return (SPRET_ABORT);
break;
- case SPELL_BOLT_OF_MAGMA:
- if (!zapping(ZAP_MAGMA, powc, beam, true))
+ case SPELL_BONE_SHARDS:
+ if (!cast_bone_shards(powc, beam))
return (SPRET_ABORT);
break;
- case SPELL_POLYMORPH_OTHER:
- // Trying is already enough, even if it fails.
- did_god_conduct(DID_DELIBERATE_MUTATING, 10);
-
- if (!zapping(ZAP_POLYMORPH_OTHER, powc, beam, true))
+ case SPELL_SHOCK:
+ if (!zapping(ZAP_ELECTRICITY, powc, beam, true))
return (SPRET_ABORT);
break;
- case SPELL_SLOW:
- if (!zapping(ZAP_SLOWING, powc, beam, true))
+ case SPELL_STING:
+ if (!zapping(ZAP_STING, powc, beam, true))
return (SPRET_ABORT);
break;
- case SPELL_HASTE:
- if (!zapping(ZAP_HASTING, powc, beam, true))
- return (SPRET_ABORT);
+ case SPELL_VAMPIRIC_DRAINING:
+ vampiric_drain(powc, spd);
break;
- case SPELL_PARALYSE:
- if (!zapping(ZAP_PARALYSIS, powc, beam, true))
+ case SPELL_BOLT_OF_FIRE:
+ if (!zapping(ZAP_FIRE, powc, beam, true))
return (SPRET_ABORT);
break;
- case SPELL_CONFUSE:
- if (!zapping(ZAP_CONFUSION, powc, beam, true))
+ case SPELL_BOLT_OF_COLD:
+ if (!zapping(ZAP_COLD, powc, beam, true))
return (SPRET_ABORT);
break;
- case SPELL_CONFUSING_TOUCH:
- cast_confusing_touch(powc);
- break;
-
- case SPELL_SURE_BLADE:
- cast_sure_blade(powc);
- break;
-
- case SPELL_INVISIBILITY:
- if (!zapping(ZAP_INVISIBILITY, powc, beam, true))
+ case SPELL_STONE_ARROW:
+ if (!zapping(ZAP_STONE_ARROW, powc, beam, true))
return (SPRET_ABORT);
break;
- case SPELL_THROW_FLAME:
- if (!zapping(ZAP_FLAME, powc, beam, true))
+ case SPELL_POISON_ARROW:
+ if (!zapping(ZAP_POISON_ARROW, powc, beam, true))
return (SPRET_ABORT);
break;
- case SPELL_THROW_FROST:
- if (!zapping(ZAP_FROST, powc, beam, true))
+ case SPELL_BOLT_OF_IRON:
+ if (!zapping(ZAP_IRON_BOLT, powc, beam, true))
return (SPRET_ABORT);
break;
- case SPELL_CONTROLLED_BLINK:
- if (blink(powc, true) == -1)
+ case SPELL_LIGHTNING_BOLT:
+ if (!zapping(ZAP_LIGHTNING, powc, beam, true))
return (SPRET_ABORT);
break;
- case SPELL_FREEZING_CLOUD:
- cast_big_c(powc, CLOUD_COLD, KC_YOU, beam);
+ case SPELL_BOLT_OF_MAGMA:
+ if (!zapping(ZAP_MAGMA, powc, beam, true))
+ return (SPRET_ABORT);
break;
- case SPELL_MEPHITIC_CLOUD:
- if (!stinking_cloud(powc, beam))
+ case SPELL_VENOM_BOLT:
+ if (!zapping(ZAP_VENOM_BOLT, powc, beam, true))
return (SPRET_ABORT);
break;
- case SPELL_RING_OF_FLAMES:
- cast_ring_of_flames(powc);
+ case SPELL_BOLT_OF_DRAINING:
+ if (!zapping(ZAP_NEGATIVE_ENERGY, powc, beam, true))
+ return (SPRET_ABORT);
break;
- case SPELL_RESTORE_STRENGTH:
- restore_stat(STAT_STRENGTH, 0, false);
+ case SPELL_LEHUDIBS_CRYSTAL_SPEAR:
+ if (!zapping(ZAP_CRYSTAL_SPEAR, powc, beam, true))
+ return (SPRET_ABORT);
break;
- case SPELL_RESTORE_INTELLIGENCE:
- restore_stat(STAT_INTELLIGENCE, 0, false);
+ case SPELL_BOLT_OF_INACCURACY:
+ if (!zapping(ZAP_BEAM_OF_ENERGY, powc, beam, true))
+ return (SPRET_ABORT);
break;
- case SPELL_RESTORE_DEXTERITY:
- restore_stat(STAT_DEXTERITY, 0, false);
+ case SPELL_STICKY_FLAME:
+ if (!zapping(ZAP_STICKY_FLAME, powc, beam, true))
+ return (SPRET_ABORT);
break;
- case SPELL_VENOM_BOLT:
- if (!zapping(ZAP_VENOM_BOLT, powc, beam, true))
+ case SPELL_DISPEL_UNDEAD:
+ if (!zapping(ZAP_DISPEL_UNDEAD, powc, beam, true))
return (SPRET_ABORT);
break;
- case SPELL_OLGREBS_TOXIC_RADIANCE:
- cast_toxic_radiance();
+ case SPELL_ISKENDERUNS_MYSTIC_BLAST:
+ if (!zapping(ZAP_MYSTIC_BLAST, powc, beam, true))
+ return (SPRET_ABORT);
break;
- case SPELL_TELEPORT_OTHER:
- // teleport creature (I think)
- if (!zapping(ZAP_TELEPORTATION, powc, beam, true))
+ case SPELL_THUNDERBOLT:
+ if (!zapping(ZAP_LIGHTNING, powc, beam, true))
return (SPRET_ABORT);
break;
- case SPELL_LESSER_HEALING:
- if (!cast_healing(5))
+ case SPELL_AGONY:
+ if (!zapping(ZAP_AGONY, powc, beam, true))
return (SPRET_ABORT);
break;
- case SPELL_GREATER_HEALING:
- if (!cast_healing(25))
+ case SPELL_DISRUPT:
+ if (!zapping(ZAP_DISRUPTION, powc, beam, true))
return (SPRET_ABORT);
break;
- case SPELL_CURE_POISON_I: //jmf: `healing' version? group w/ S_C_P_II?
- cast_cure_poison(powc);
+ case SPELL_DISINTEGRATE:
+ if (!zapping(ZAP_DISINTEGRATION, powc, beam, true))
+ return (SPRET_ABORT);
break;
- case SPELL_PURIFICATION:
- purification();
+ case SPELL_ICE_BOLT:
+ if (!zapping(ZAP_ICE_BOLT, powc, beam, true))
+ return (SPRET_ABORT);
break;
- case SPELL_DEATHS_DOOR:
- cast_deaths_door(powc);
+ case SPELL_ORB_OF_FRAGMENTATION:
+ if (!zapping(ZAP_ORB_OF_FRAGMENTATION, powc, beam, true))
+ return (SPRET_ABORT);
break;
- case SPELL_SELECTIVE_AMNESIA:
- crawl_state.cant_cmd_repeat("You can't repeat selective amnesia.");
-
- if (!cast_selective_amnesia(false))
+ case SPELL_CIGOTUVIS_DEGENERATION:
+ if (!zapping(ZAP_DEGENERATION, powc, beam, true))
return (SPRET_ABORT);
- break; // Sif Muna power calls with true
-
- case SPELL_MASS_CONFUSION:
- mass_enchantment(ENCH_CONFUSION, powc, MHITYOU);
break;
- case SPELL_SMITING:
- cast_smiting(powc, spd);
+ case SPELL_ORB_OF_ELECTROCUTION:
+ if (!zapping(ZAP_ORB_OF_ELECTRICITY, powc, beam, true))
+ return (SPRET_ABORT);
break;
- case SPELL_REPEL_UNDEAD:
- turn_undead(50);
+ case SPELL_FLAME_OF_CLEANSING:
+ if (!zapping(ZAP_CLEANSING_FLAME, powc, beam, true))
+ return (SPRET_ABORT);
break;
case SPELL_HOLY_WORD:
holy_word(50, HOLY_WORD_SPELL, you.x_pos, you.y_pos, true);
break;
- case SPELL_DETECT_CURSE:
- detect_curse(false);
- break;
-
- case SPELL_ABJURATION_I:
- case SPELL_ABJURATION_II:
- abjuration(powc);
- break;
-
- case SPELL_LEVITATION:
- potion_effect( POT_LEVITATION, powc );
+ case SPELL_REPEL_UNDEAD:
+ turn_undead(50);
break;
- case SPELL_BOLT_OF_DRAINING:
- if (!zapping(ZAP_NEGATIVE_ENERGY, powc, beam, true))
+ case SPELL_HELLFIRE:
+ // Should only be available from
+ // staff of Dispater & Sceptre of Asmodeus
+ if (!zapping(ZAP_HELLFIRE, powc, beam, true))
return (SPRET_ABORT);
break;
- case SPELL_LEHUDIBS_CRYSTAL_SPEAR:
- if (!zapping(ZAP_CRYSTAL_SPEAR, powc, beam, true))
+ // Clouds and explosions.
+ case SPELL_MEPHITIC_CLOUD:
+ if (!stinking_cloud(powc, beam))
return (SPRET_ABORT);
break;
- case SPELL_BOLT_OF_INACCURACY:
- if (!zapping(ZAP_BEAM_OF_ENERGY, powc, beam, true))
- return (SPRET_ABORT);
+ case SPELL_EVAPORATE:
+ if (!cast_evaporate(powc, beam, potion))
+ return SPRET_ABORT;
break;
case SPELL_POISONOUS_CLOUD:
cast_big_c(powc, CLOUD_POISON, KC_YOU, beam);
break;
- case SPELL_POISON_ARROW:
- if (!zapping(ZAP_POISON_ARROW, powc, beam, true))
- return (SPRET_ABORT);
+ case SPELL_FREEZING_CLOUD:
+ cast_big_c(powc, CLOUD_COLD, KC_YOU, beam);
break;
case SPELL_FIRE_STORM:
cast_fire_storm(powc, beam);
break;
- case SPELL_DETECT_TRAPS:
- mprf("You detect %s", (detect_traps(powc) > 0) ? "traps!"
- : "nothing.");
- break;
-
- case SPELL_BLINK:
- random_blink(true);
- break;
-
- case SPELL_ISKENDERUNS_MYSTIC_BLAST:
- if (!zapping(ZAP_MYSTIC_BLAST, powc, beam, true))
+ case SPELL_ICE_STORM:
+ if (!zapping(ZAP_ICE_STORM, powc, beam, true))
return (SPRET_ABORT);
break;
- case SPELL_ENSLAVEMENT:
- if (!zapping(ZAP_ENSLAVEMENT, powc, beam, true))
+ case SPELL_FIREBALL:
+ if (!fireball(powc, beam))
return (SPRET_ABORT);
break;
- case SPELL_MAGIC_MAPPING:
- if (you.level_type == LEVEL_PANDEMONIUM)
+ case SPELL_DELAYED_FIREBALL:
+ crawl_state.cant_cmd_repeat("You can't repeat delayed fireball.");
+ // This spell has two main advantages over Fireball:
+ //
+ // (1) The release is instantaneous, so monsters will not
+ // get an action before the player... this allows the
+ // player to hit monsters with a double fireball (this
+ // is why we only allow one delayed fireball at a time,
+ // if you want to allow for more, then the release should
+ // take at least some amount of time).
+ //
+ // The casting of this spell still costs a turn. So
+ // casting Delayed Fireball and immediately releasing
+ // the fireball is only slightly different than casting
+ // a regular Fireball (monsters act in the middle instead
+ // of at the end). This is why we allow for the spell
+ // level discount so that Fireball is free with this spell
+ // (so that it only costs 7 levels instead of 13 to have
+ // both).
+ //
+ // (2) When the fireball is released, it is guaranteed to
+ // go off... the spell only fails at this point. This can
+ // be a large advantage for characters who have difficulty
+ // casting Fireball in their standard equipment. However,
+ // the power level for the actual fireball is determined at
+ // release, so if you do swap out your enhancers you'll
+ // get a less powerful ball when its released. -- bwr
+ //
+ if (!you.attribute[ ATTR_DELAYED_FIREBALL ])
{
- mpr("Your Earth magic cannot map Pandemonium.");
+ // okay, this message is weak but functional -- bwr
+ mpr( "You feel magically charged." );
+ you.attribute[ ATTR_DELAYED_FIREBALL ] = 1;
}
else
- {
- powc = stepdown_value( powc, 10, 10, 40, 45 );
- magic_mapping( 5 + powc, 50 + random2avg( powc * 2, 2 ), false );
- }
+ canned_msg( MSG_NOTHING_HAPPENS );
break;
- case SPELL_HEAL_OTHER:
- zapping(ZAP_HEALING, powc, beam);
+ // LOS spells
+ case SPELL_SMITING:
+ cast_smiting(powc, spd);
break;
- case SPELL_PAIN:
- if (!zapping(ZAP_PAIN, powc, beam, true))
- return (SPRET_ABORT);
- dec_hp(1, false);
+ case SPELL_TWIST:
+ cast_twist(powc);
break;
- case SPELL_EXTENSION:
- extension(powc);
+ case SPELL_AIRSTRIKE:
+ airstrike(powc, spd);
break;
- case SPELL_CONTROL_UNDEAD:
- mass_enchantment(ENCH_CHARM, powc, MHITYOU);
+ case SPELL_FRAGMENTATION:
+ cast_fragmentation(powc);
break;
- case SPELL_VAMPIRIC_DRAINING:
- vampiric_drain(powc, spd);
+ case SPELL_FAR_STRIKE:
+ cast_far_strike(powc);
break;
- case SPELL_DETECT_ITEMS:
- mprf("You detect %s", (detect_items(powc) > 0) ? "items!"
- : "nothing.");
+ case SPELL_PORTAL_PROJECTILE:
+ if (!cast_portal_projectile(powc))
+ return SPRET_ABORT;
break;
- case SPELL_BORGNJORS_REVIVIFICATION:
- cast_revivification(powc);
+ // other effects
+ case SPELL_DISCHARGE:
+ cast_discharge(powc);
break;
- case SPELL_BURN:
- if (burn_freeze(powc, BEAM_FIRE) == -1)
- return (SPRET_ABORT);
+ case SPELL_CHAIN_LIGHTNING:
+ cast_chain_lightning(powc);
break;
- case SPELL_FREEZE:
- if (burn_freeze(powc, BEAM_COLD) == -1)
- return (SPRET_ABORT);
+ case SPELL_DISPERSAL:
+ cast_dispersal(powc);
+ break;
+
+ case SPELL_SHATTER:
+ cast_shatter(powc);
+ break;
+
+ case SPELL_BEND:
+ cast_bend(powc);
+ break;
+
+ case SPELL_SYMBOL_OF_TORMENT:
+ torment(TORMENT_SPELL, you.x_pos, you.y_pos);
break;
case SPELL_OZOCUBUS_REFRIGERATION:
cast_refrigeration(powc);
break;
- case SPELL_STICKY_FLAME:
- if (!zapping(ZAP_STICKY_FLAME, powc, beam, true))
- return (SPRET_ABORT);
+ case SPELL_IGNITE_POISON:
+ cast_ignite_poison(powc);
break;
- // Spells that create new monsters. If a god is making you cast one
- // of these spells, any monsters produced will count as god gifts.
+ case SPELL_ROTTING:
+ cast_rotting(powc);
+ break;
+
+ // Summoning spells, and other spells that create new monsters.
+ // If a god is making you cast one of these spells, any monsters produced
+ // will count as god gifts.
case SPELL_SUMMON_BUTTERFLIES:
cast_summon_butterflies(powc, god_gift);
break;
@@ -1494,6 +1474,7 @@ spret_type your_spells(spell_type spell, int powc, bool allow_fail)
break;
case SPELL_TUKIMAS_DANCE:
+ // Temporarily turns a wielded weapon into a dancing weapon.
crawl_state.cant_cmd_repeat("You can't repeat Tukima's Dance.");
cast_tukimas_dance(powc, god_gift);
break;
@@ -1548,44 +1529,92 @@ spret_type your_spells(spell_type spell, int powc, bool allow_fail)
case SPELL_DEATH_CHANNEL:
cast_death_channel(powc, god_gift);
break;
- // End of spells that create new monsters.
- case SPELL_OZOCUBUS_ARMOUR:
- ice_armour(powc, false);
+ // Enchantments.
+ case SPELL_CONFUSING_TOUCH:
+ cast_confusing_touch(powc);
break;
- case SPELL_REPEL_MISSILES:
- missile_prot(powc);
+ case SPELL_BACKLIGHT:
+ if (!zapping(ZAP_BACKLIGHT, powc + 10, beam, true))
+ return (SPRET_ABORT);
break;
- case SPELL_BERSERKER_RAGE:
- cast_berserk();
+ case SPELL_CAUSE_FEAR:
+ mass_enchantment(ENCH_FEAR, powc, MHITYOU);
break;
- case SPELL_DISPEL_UNDEAD:
- if (!zapping(ZAP_DISPEL_UNDEAD, powc, beam, true))
+ case SPELL_SLOW:
+ if (!zapping(ZAP_SLOWING, powc, beam, true))
return (SPRET_ABORT);
break;
- case SPELL_THUNDERBOLT:
- if (!zapping(ZAP_LIGHTNING, powc, beam, true))
+ case SPELL_CONFUSE:
+ if (!zapping(ZAP_CONFUSION, powc, beam, true))
return (SPRET_ABORT);
break;
- case SPELL_FLAME_OF_CLEANSING:
- if (!zapping(ZAP_CLEANSING_FLAME, powc, beam, true))
+ case SPELL_ENSLAVEMENT:
+ if (!zapping(ZAP_ENSLAVEMENT, powc, beam, true))
return (SPRET_ABORT);
break;
- case SPELL_REGENERATION:
- cast_regen(powc);
+ case SPELL_TAME_BEASTS:
+ cast_tame_beasts(powc);
break;
- case SPELL_BONE_SHARDS:
- if (!cast_bone_shards(powc, beam))
+ case SPELL_SLEEP:
+ {
+ const int sleep_power =
+ stepdown_value( powc * 9 / 10, 5, 35, 45, 50 );
+#ifdef DEBUG_DIAGNOSTICS
+ mprf(MSGCH_DIAGNOSTICS, "Sleep power stepdown: %d -> %d",
+ powc, sleep_power);
+#endif
+ if (!zapping(ZAP_SLEEP, sleep_power, beam, true))
+ return (SPRET_ABORT);
+ break;
+ }
+
+ case SPELL_PARALYSE:
+ if (!zapping(ZAP_PARALYSIS, powc, beam, true))
return (SPRET_ABORT);
break;
+ case SPELL_POLYMORPH_OTHER:
+ // Trying is already enough, even if it fails.
+ did_god_conduct(DID_DELIBERATE_MUTATING, 10);
+
+ if (!zapping(ZAP_POLYMORPH_OTHER, powc, beam, true))
+ return (SPRET_ABORT);
+ break;
+
+ case SPELL_TELEPORT_OTHER:
+ if (!zapping(ZAP_TELEPORTATION, powc, beam, true))
+ return (SPRET_ABORT);
+ break;
+
+ case SPELL_INTOXICATE:
+ cast_intoxicate(powc);
+ break;
+
+ case SPELL_MASS_CONFUSION:
+ mass_enchantment(ENCH_CONFUSION, powc, MHITYOU);
+ break;
+
+ case SPELL_MASS_SLEEP:
+ cast_mass_sleep(powc);
+ break;
+
+ case SPELL_CONTROL_UNDEAD:
+ mass_enchantment(ENCH_CHARM, powc, MHITYOU);
+ break;
+
+ case SPELL_ABJURATION_I:
+ case SPELL_ABJURATION_II:
+ abjuration(powc);
+ break;
+
case SPELL_BANISHMENT:
if (beam.target_x == you.x_pos && beam.target_y == you.y_pos)
{
@@ -1596,29 +1625,79 @@ spret_type your_spells(spell_type spell, int powc, bool allow_fail)
return (SPRET_ABORT);
break;
- case SPELL_CIGOTUVIS_DEGENERATION:
- if (!zapping(ZAP_DEGENERATION, powc, beam, true))
+ case SPELL_OLGREBS_TOXIC_RADIANCE:
+ cast_toxic_radiance();
+ break;
+
+ // beneficial enchantments
+ case SPELL_HASTE:
+ if (!zapping(ZAP_HASTING, powc, beam, true))
return (SPRET_ABORT);
break;
- case SPELL_STING:
- if (!zapping(ZAP_STING, powc, beam, true))
+ case SPELL_INVISIBILITY:
+ if (!zapping(ZAP_INVISIBILITY, powc, beam, true))
return (SPRET_ABORT);
break;
- case SPELL_SUBLIMATION_OF_BLOOD:
- cast_sublimation_of_blood(powc);
+ case SPELL_LESSER_HEALING:
+ if (!cast_healing(5))
+ return (SPRET_ABORT);
break;
- case SPELL_HELLFIRE:
- // Should only be available from:
- // staff of Dispater & Sceptre of Asmodeus
- if (!zapping(ZAP_HELLFIRE, powc, beam, true))
+ case SPELL_GREATER_HEALING:
+ if (!cast_healing(25))
return (SPRET_ABORT);
break;
- case SPELL_CORPSE_ROT:
- corpse_rot(0);
+ case SPELL_HEAL_OTHER:
+ zapping(ZAP_HEALING, powc, beam);
+ break;
+
+ // Self-enchantments. (Spells that can only affect the player.)
+ // Resistances.
+ case SPELL_INSULATION:
+ cast_insulation(powc);
+ break;
+
+ case SPELL_RESIST_POISON:
+ cast_resist_poison(powc);
+ break;
+
+ case SPELL_SEE_INVISIBLE:
+ cast_see_invisible(powc);
+ break;
+
+ case SPELL_CONTROL_TELEPORT:
+ cast_teleport_control(powc);
+ break;
+
+ // Healing.
+ case SPELL_CURE_POISON_I: // Ely version
+ case SPELL_CURE_POISON_II: // Poison magic version
+ // both use same function
+ cast_cure_poison(powc);
+ break;
+
+ case SPELL_PURIFICATION:
+ purification();
+ break;
+
+ case SPELL_RESTORE_STRENGTH:
+ restore_stat(STAT_STRENGTH, 0, false);
+ break;
+
+ case SPELL_RESTORE_INTELLIGENCE:
+ restore_stat(STAT_INTELLIGENCE, 0, false);
+ break;
+
+ case SPELL_RESTORE_DEXTERITY:
+ restore_stat(STAT_DEXTERITY, 0, false);
+ break;
+
+ // Weapon brands.
+ case SPELL_SURE_BLADE:
+ cast_sure_blade(powc);
break;
case SPELL_TUKIMAS_VORPAL_BLADE:
@@ -1636,11 +1715,6 @@ spret_type your_spells(spell_type spell, int powc, bool allow_fail)
canned_msg(MSG_SPELL_FIZZLES);
break;
- case SPELL_LETHAL_INFUSION:
- if (!brand_weapon(SPWPN_DRAINING, powc))
- canned_msg(MSG_SPELL_FIZZLES);
- break;
-
case SPELL_MAXWELLS_SILVER_HAMMER:
if (!brand_weapon(SPWPN_DUMMY_CRUSHING, powc))
canned_msg(MSG_SPELL_FIZZLES);
@@ -1651,85 +1725,56 @@ spret_type your_spells(spell_type spell, int powc, bool allow_fail)
canned_msg(MSG_SPELL_FIZZLES);
break;
- case SPELL_CRUSH:
- burn_freeze(powc, BEAM_MISSILE);
- break;
-
- case SPELL_BOLT_OF_IRON:
- if (!zapping(ZAP_IRON_BOLT, powc, beam, true))
- return (SPRET_ABORT);
- break;
-
- case SPELL_STONE_ARROW:
- if (!zapping(ZAP_STONE_ARROW, powc, beam, true))
- return (SPRET_ABORT);
- break;
-
- case SPELL_TOMB_OF_DOROKLOHE:
- entomb(powc);
- break;
-
- case SPELL_STONEMAIL:
- stone_scales(powc);
+ case SPELL_EXCRUCIATING_WOUNDS:
+ if (!brand_weapon(SPWPN_PAIN, powc))
+ canned_msg(MSG_SPELL_FIZZLES);
break;
- case SPELL_SHOCK:
- if (!zapping(ZAP_ELECTRICITY, powc, beam, true))
- return (SPRET_ABORT);
+ case SPELL_LETHAL_INFUSION:
+ if (!brand_weapon(SPWPN_DRAINING, powc))
+ canned_msg(MSG_SPELL_FIZZLES);
break;
- case SPELL_SWIFTNESS:
- cast_swiftness(powc);
+ case SPELL_WARP_BRAND:
+ if (!brand_weapon(SPWPN_DISTORTION, powc))
+ canned_msg(MSG_SPELL_FIZZLES);
break;
- case SPELL_FLY:
- cast_fly(powc);
+ case SPELL_POISON_AMMUNITION:
+ cast_poison_ammo();
break;
- case SPELL_INSULATION:
- cast_insulation(powc);
+ // Transformations.
+ case SPELL_BLADE_HANDS:
+ transform(powc, TRAN_BLADE_HANDS);
break;
- case SPELL_ORB_OF_ELECTROCUTION:
- if (!zapping(ZAP_ORB_OF_ELECTRICITY, powc, beam, true))
- return (SPRET_ABORT);
+ case SPELL_SPIDER_FORM:
+ transform(powc, TRAN_SPIDER);
break;
- case SPELL_DETECT_CREATURES:
- {
- int known_plants = count_detected_plants();
- int num_creatures = detect_creatures(powc);
-
- if (!num_creatures)
- mpr("You detect nothing.");
- else if (num_creatures == known_plants)
- mpr("You detect no further creatures.");
- else
- mpr("You detect creatures!");
- break;
- }
- case SPELL_CURE_POISON_II: // poison magic version of cure poison
- cast_cure_poison(powc);
+ case SPELL_STATUE_FORM:
+ transform(powc, TRAN_STATUE);
break;
- case SPELL_CONTROL_TELEPORT:
- cast_teleport_control(powc);
+ case SPELL_ICE_FORM:
+ transform(powc, TRAN_ICE_BEAST);
break;
- case SPELL_POISON_AMMUNITION:
- cast_poison_ammo();
+ case SPELL_DRAGON_FORM:
+ transform(powc, TRAN_DRAGON);
break;
- case SPELL_RESIST_POISON:
- cast_resist_poison(powc);
+ case SPELL_NECROMUTATION:
+ transform(powc, TRAN_LICH);
break;
- case SPELL_PROJECTED_NOISE:
- project_noise();
+ case SPELL_AIR_WALK:
+ transform(powc, TRAN_AIR);
break;
case SPELL_ALTER_SELF:
- // trying is already enough, even if it fails
+ // Trying is already enough, even if it fails.
did_god_conduct(DID_DELIBERATE_MUTATING, 10);
crawl_state.cant_cmd_repeat("You can't repeat Alter Self.");
@@ -1749,249 +1794,224 @@ spret_type your_spells(spell_type spell, int powc, bool allow_fail)
mpr("Odd... you don't feel any different.");
break;
- case SPELL_DEBUGGING_RAY:
- if (!zapping(ZAP_DEBUGGING_RAY, powc, beam, true))
- return (SPRET_ABORT);
- break;
-
- case SPELL_RECALL:
- recall(0);
+ // General enhancement.
+ case SPELL_BERSERKER_RAGE:
+ cast_berserk();
break;
- case SPELL_PORTAL:
- crawl_state.cant_cmd_repeat("You can't repeat create portal.");
- if (portal() == -1)
- return (SPRET_ABORT);
+ case SPELL_REGENERATION:
+ cast_regen(powc);
break;
- case SPELL_AGONY:
- if (!zapping(ZAP_AGONY, powc, beam, true))
- return (SPRET_ABORT);
+ case SPELL_REPEL_MISSILES:
+ missile_prot(powc);
break;
- case SPELL_SPIDER_FORM:
- transform(powc, TRAN_SPIDER);
+ case SPELL_DEFLECT_MISSILES:
+ deflection(powc);
break;
- case SPELL_DISRUPT:
- if (!zapping(ZAP_DISRUPTION, powc, beam, true))
- return (SPRET_ABORT);
+ case SPELL_SWIFTNESS:
+ cast_swiftness(powc);
break;
- case SPELL_DISINTEGRATE:
- if (!zapping(ZAP_DISINTEGRATION, powc, beam, true))
- return (SPRET_ABORT);
+ case SPELL_LEVITATION:
+ potion_effect( POT_LEVITATION, powc );
break;
- case SPELL_BLADE_HANDS:
- transform(powc, TRAN_BLADE_HANDS);
+ case SPELL_FLY:
+ cast_fly(powc);
break;
- case SPELL_STATUE_FORM:
- transform(powc, TRAN_STATUE);
+ case SPELL_STONESKIN:
+ cast_stoneskin(powc);
break;
- case SPELL_ICE_FORM:
- transform(powc, TRAN_ICE_BEAST);
+ case SPELL_STONEMAIL:
+ stone_scales(powc);
break;
- case SPELL_DRAGON_FORM:
- transform(powc, TRAN_DRAGON);
+ case SPELL_CONDENSATION_SHIELD:
+ cast_condensation_shield(powc);
break;
- case SPELL_NECROMUTATION:
- transform(powc, TRAN_LICH);
+ case SPELL_OZOCUBUS_ARMOUR:
+ ice_armour(powc, false);
break;
- case SPELL_SYMBOL_OF_TORMENT:
- torment(TORMENT_SPELL, you.x_pos, you.y_pos);
+ case SPELL_FORESCRY:
+ cast_forescry(powc);
break;
- case SPELL_DEFLECT_MISSILES:
- deflection(powc);
+ case SPELL_SILENCE:
+ cast_silence(powc);
break;
- case SPELL_ORB_OF_FRAGMENTATION:
- if (!zapping(ZAP_ORB_OF_FRAGMENTATION, powc, beam, true))
- return (SPRET_ABORT);
- break;
+ // other
+ case SPELL_SELECTIVE_AMNESIA:
+ crawl_state.cant_cmd_repeat("You can't repeat selective amnesia.");
- case SPELL_ICE_BOLT:
- if (!zapping(ZAP_ICE_BOLT, powc, beam, true))
+ // Sif Muna power calls with true
+ if (!cast_selective_amnesia(false))
return (SPRET_ABORT);
break;
- case SPELL_ARC:
- if (burn_freeze(powc, BEAM_ELECTRICITY) == -1)
- return (SPRET_ABORT);
+ case SPELL_EXTENSION:
+ extension(powc);
break;
- case SPELL_AIRSTRIKE:
- airstrike(powc, spd);
+ case SPELL_BORGNJORS_REVIVIFICATION:
+ cast_revivification(powc);
break;
- case SPELL_ICE_STORM:
- if (!zapping(ZAP_ICE_STORM, powc, beam, true))
- return (SPRET_ABORT);
+ case SPELL_SUBLIMATION_OF_BLOOD:
+ cast_sublimation_of_blood(powc);
break;
- //jmf: new spells 19mar2000
- case SPELL_FLAME_TONGUE:
- if (!zapping(ZAP_FLAME_TONGUE, powc, beam, true))
- return (SPRET_ABORT);
+ case SPELL_DEATHS_DOOR:
+ cast_deaths_door(powc);
break;
- case SPELL_PASSWALL:
- cast_passwall(powc);
+ case SPELL_RING_OF_FLAMES:
+ cast_ring_of_flames(powc);
break;
- case SPELL_IGNITE_POISON:
- cast_ignite_poison(powc);
+ // Escape spells.
+ case SPELL_BLINK:
+ random_blink(true);
break;
- case SPELL_TAME_BEASTS:
- cast_tame_beasts(powc);
+ case SPELL_TELEPORT_SELF:
+ you_teleport();
break;
- case SPELL_SLEEP:
- {
- const int sleep_power =
- stepdown_value( powc * 9 / 10, 5, 35, 45, 50 );
-#ifdef DEBUG_DIAGNOSTICS
- mprf(MSGCH_DIAGNOSTICS, "Sleep power stepdown: %d -> %d",
- powc, sleep_power);
-#endif
- if (!zapping(ZAP_SLEEP, sleep_power, beam, true))
+ case SPELL_SEMI_CONTROLLED_BLINK:
+ //jmf: powc is ignored
+ if (cast_semi_controlled_blink(powc) == -1)
return (SPRET_ABORT);
break;
- }
- case SPELL_MASS_SLEEP:
- cast_mass_sleep(powc);
+ case SPELL_CONTROLLED_BLINK:
+ if (blink(powc, true) == -1)
+ return (SPRET_ABORT);
break;
- case SPELL_DETECT_MAGIC:
- mpr("FIXME: implement!");
+ // Utility spells.
+ case SPELL_DETECT_CURSE:
+ detect_curse(false);
break;
- case SPELL_DETECT_SECRET_DOORS:
- cast_detect_secret_doors(powc);
+ case SPELL_REMOVE_CURSE:
+ remove_curse(false);
break;
- case SPELL_SEE_INVISIBLE:
- cast_see_invisible(powc);
+ case SPELL_IDENTIFY:
+ identify(powc);
break;
- case SPELL_FORESCRY:
- cast_forescry(powc);
+ case SPELL_DETECT_SECRET_DOORS:
+ cast_detect_secret_doors(powc);
break;
- case SPELL_EXCRUCIATING_WOUNDS:
- if (!brand_weapon(SPWPN_PAIN, powc))
- canned_msg(MSG_SPELL_FIZZLES);
+ case SPELL_DETECT_TRAPS:
+ mprf("You detect %s", (detect_traps(powc) > 0) ? "traps!"
+ : "nothing.");
break;
- case SPELL_WARP_BRAND:
- if (!brand_weapon(SPWPN_DISTORTION, powc))
- canned_msg(MSG_SPELL_FIZZLES);
+ case SPELL_DETECT_ITEMS:
+ mprf("You detect %s", (detect_items(powc) > 0) ? "items!"
+ : "nothing.");
break;
- case SPELL_SILENCE:
- cast_silence(powc);
- break;
+ case SPELL_DETECT_CREATURES:
+ {
+ int known_plants = count_detected_plants();
+ int num_creatures = detect_creatures(powc);
- case SPELL_SHATTER:
- cast_shatter(powc);
+ if (!num_creatures)
+ mpr("You detect nothing.");
+ else if (num_creatures == known_plants)
+ mpr("You detect no further creatures.");
+ else
+ mpr("You detect creatures!");
break;
+ }
- case SPELL_DISPERSAL:
- cast_dispersal(powc);
+ case SPELL_MAGIC_MAPPING:
+ if (you.level_type == LEVEL_PANDEMONIUM)
+ {
+ mpr("Your Earth magic cannot map Pandemonium.");
+ }
+ else
+ {
+ powc = stepdown_value( powc, 10, 10, 40, 45 );
+ magic_mapping( 5 + powc, 50 + random2avg( powc * 2, 2 ), false );
+ }
break;
- case SPELL_DISCHARGE:
- cast_discharge(powc);
+ case SPELL_CREATE_NOISE: // Unused, the player can shout to do this. - bwr
+ noisy(25, you.x_pos, you.y_pos, "You hear a voice calling your name!");
break;
- case SPELL_BEND:
- cast_bend(powc);
+ case SPELL_PROJECTED_NOISE:
+ project_noise();
break;
- case SPELL_BACKLIGHT:
- if (!zapping(ZAP_BACKLIGHT, powc + 10, beam, true))
+ case SPELL_CONJURE_FLAME:
+ if (!conjure_flame(powc))
return (SPRET_ABORT);
break;
- case SPELL_INTOXICATE:
- cast_intoxicate(powc);
- break;
-
- case SPELL_EVAPORATE:
- if ( !cast_evaporate(powc, beam, potion) )
- return SPRET_ABORT;
- break;
-
- case SPELL_FULSOME_DISTILLATION:
- cast_fulsome_distillation(powc);
+ case SPELL_DIG:
+ if (!zapping(ZAP_DIGGING, powc, beam, true))
+ return (SPRET_ABORT);
break;
- case SPELL_FRAGMENTATION:
- cast_fragmentation(powc);
+ case SPELL_PASSWALL:
+ cast_passwall(powc);
break;
- case SPELL_AIR_WALK:
- transform(powc, TRAN_AIR);
+ case SPELL_TOMB_OF_DOROKLOHE:
+ entomb(powc);
break;
- case SPELL_SANDBLAST:
- if (!cast_sandblast(powc, beam))
+ case SPELL_APPORTATION:
+ if (cast_apportation(powc) == -1)
return (SPRET_ABORT);
break;
- case SPELL_ROTTING:
- cast_rotting(powc);
+ case SPELL_SWAP:
+ crawl_state.cant_cmd_repeat("You can't swap.");
+ cast_swap(powc);
break;
- case SPELL_CONDENSATION_SHIELD:
- cast_condensation_shield(powc);
+ case SPELL_RECALL:
+ recall(0);
break;
- case SPELL_SEMI_CONTROLLED_BLINK:
- //jmf: powc is ignored
- if (cast_semi_controlled_blink(powc) == -1)
+ case SPELL_PORTAL:
+ crawl_state.cant_cmd_repeat("You can't repeat create portal.");
+ if (portal() == -1)
return (SPRET_ABORT);
break;
- case SPELL_STONESKIN:
- cast_stoneskin(powc);
- break;
-
- case SPELL_CHAIN_LIGHTNING:
- cast_chain_lightning(powc);
- break;
-
- case SPELL_TWIST:
- cast_twist(powc);
+ case SPELL_CORPSE_ROT:
+ corpse_rot(0);
break;
- case SPELL_FAR_STRIKE:
- cast_far_strike(powc);
+ case SPELL_FULSOME_DISTILLATION:
+ cast_fulsome_distillation(powc);
break;
- case SPELL_SWAP:
- crawl_state.cant_cmd_repeat("You can't swap.");
- cast_swap(powc);
+ case SPELL_DETECT_MAGIC:
+ mpr("FIXME: implement!");
break;
- case SPELL_APPORTATION:
- if (cast_apportation(powc) == -1)
+ case SPELL_DEBUGGING_RAY:
+ if (!zapping(ZAP_DEBUGGING_RAY, powc, beam, true))
return (SPRET_ABORT);
break;
- case SPELL_PORTAL_PROJECTILE:
- if (!cast_portal_projectile(powc))
- return SPRET_ABORT;
- break;
-
default:
mpr("Invalid spell!");
break;