summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells4.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-27 11:50:19 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-27 11:50:19 +0000
commit0e6ace1ac92fe52e8a23335ccf68b69056407bbc (patch)
tree207b3f218d1c213f7fefbbbec2c6bf425bc1f7b5 /crawl-ref/source/spells4.cc
parent7a5efda30e5d565558b2df4fd7e28db62f757308 (diff)
downloadcrawl-ref-0e6ace1ac92fe52e8a23335ccf68b69056407bbc.tar.gz
crawl-ref-0e6ace1ac92fe52e8a23335ccf68b69056407bbc.zip
Axe some more obsolete functions as well as the rotting ability that
isn't used anywhere. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9256 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells4.cc')
-rw-r--r--crawl-ref/source/spells4.cc387
1 files changed, 0 insertions, 387 deletions
diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc
index 715bfc9564..c8f4db1e45 100644
--- a/crawl-ref/source/spells4.cc
+++ b/crawl-ref/source/spells4.cc
@@ -67,8 +67,6 @@ enum DEBRIS // jmf: add for shatter, dig, and Giants to throw
static int _make_a_rot_cloud(const coord_def& where, int pow, cloud_type ctype);
-void do_monster_rot(int mon);
-
// Just to avoid typing this over and over.
// Returns true if monster died. -- bwr
static bool _player_hurt_monster(monsters& m, int damage)
@@ -846,96 +844,6 @@ void cast_discharge(int pow)
}
}
-// NB: this must be checked against the same effects
-// in fight.cc for all forms of attack !!! {dlb}
-// This function should be currently unused (the effect is too powerful).
-static int _distortion_monsters(coord_def where, int pow, int, actor *)
-{
- if (pow > 100)
- pow = 100;
-
- if (where == you.pos())
- {
- if (you.skills[SK_TRANSLOCATIONS] < random2(8))
- {
- MiscastEffect( &you, NON_MONSTER, SPTYP_TRANSLOCATION,
- pow / 9 + 1, pow, "cast bend on self" );
- }
- else
- {
- MiscastEffect( &you, NON_MONSTER, SPTYP_TRANSLOCATION, 1, 1,
- "cast bend on self" );
- }
-
- return (1);
- }
-
- monsters *defender = monster_at(where);
- if (defender == NULL)
- return (0);
-
- int specdam = 0;
-
- if (defender->type == MONS_BLINK_FROG
- || defender->type == MONS_PRINCE_RIBBIT) // any others resist?
- {
- int hp = defender->hit_points;
- int max_hp = defender->max_hit_points;
-
- mpr("The blink frog basks in the translocular energy.");
-
- if (hp < max_hp)
- hp += 1 + random2(1 + pow / 4) + random2(1 + pow / 7);
-
- if (hp > max_hp)
- hp = max_hp;
-
- defender->hit_points = hp;
- return 1;
- }
- else if (coinflip())
- {
- mprf("Space bends around %s.",
- defender->name(DESC_NOCAP_THE).c_str());
- specdam += 1 + random2avg( 7, 2 ) + random2(pow) / 40;
- }
- else if (coinflip())
- {
- mprf("Space warps horribly around %s!",
- defender->name(DESC_NOCAP_THE).c_str());
- specdam += 3 + random2avg( 12, 2 ) + random2(pow) / 25;
- }
- else if (one_chance_in(3))
- {
- monster_blink(defender);
- return 1;
- }
- else if (one_chance_in(3))
- {
- monster_teleport(defender, coinflip());
- return 1;
- }
- else if (one_chance_in(3))
- {
- defender->banish();
- return 1;
- }
- else
- {
- canned_msg(MSG_NOTHING_HAPPENS);
- return 1;
- }
-
- _player_hurt_monster(*defender, specdam);
-
- return (specdam);
-}
-
-void cast_bend(int pow)
-{
- apply_one_neighbouring_square( _distortion_monsters, pow );
-}
-
// 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
// the insane damage potential. -- bwr
@@ -979,42 +887,6 @@ void cast_dispersal(int pow)
mpr("The air shimmers briefly around you.");
}
-static int _spell_swap_func(coord_def where, int pow, int, actor *)
-{
- monsters *defender = monster_at(where);
- if (defender == NULL)
- return (0);
-
- if (defender->type == MONS_BLINK_FROG
- || defender->type == MONS_PRINCE_RIBBIT
- || check_mons_resist_magic( defender, pow ))
- {
- simple_monster_message( defender, mons_immune_magic(defender) ?
- " is unaffected." : " resists." );
- }
- else
- {
- // Swap doesn't seem to actually swap, but just sets the
- // monster's location equal to the players... this being because
- // the acr.cc call is going to move the player afterwards (for
- // the regular friendly monster swap). So we'll go through
- // standard swap procedure here... since we really want to apply
- // the same swap_places function as with friendly monsters...
- // see note over there. -- bwr
- coord_def old_pos = defender->pos();
-
- if (swap_places( defender ))
- you.moveto(old_pos);
- }
-
- return 1;
-}
-
-void cast_swap(int pow)
-{
- apply_one_neighbouring_square(_spell_swap_func, pow);
-}
-
static int _make_a_rot_cloud(const coord_def& where, int pow, cloud_type ctype)
{
for (stack_iterator si(where); si; ++si)
@@ -1502,107 +1374,6 @@ void cast_fulsome_distillation( int powc )
mpr( "Unfortunately, you can't carry it right now!" );
}
-static int _rot_living(coord_def where, int pow, int, actor *)
-{
- monsters *monster = monster_at(where);
- if (monster == NULL)
- return (0);
-
- if (mons_holiness(monster) != MH_NATURAL)
- return (0);
-
- if (check_mons_resist_magic(monster, pow))
- return (0);
-
- int ench = ((random2(pow) + random2(pow) + random2(pow) + random2(pow))/4);
- ench = 1 + (ench >= 20) + (ench >= 35) + (ench >= 50);
-
- monster->add_ench(mon_enchant(ENCH_ROT, ench, KC_YOU));
-
- return (1);
-}
-
-static int _rot_undead(coord_def where, int pow, int, actor *)
-{
- monsters *monster = monster_at(where);
-
- if (monster == NULL)
- return (0);
-
- if (mons_holiness(monster) != MH_UNDEAD)
- return (0);
-
- if (check_mons_resist_magic(monster, pow))
- return (0);
-
- // 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
- // rot player mummies.
- // 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
- // the evil mummy & orc gods.
- switch (monster->type)
- {
- case MONS_ZOMBIE_SMALL:
- case MONS_ZOMBIE_LARGE:
- case MONS_MUMMY:
- case MONS_GUARDIAN_MUMMY:
- case MONS_GREATER_MUMMY:
- case MONS_MUMMY_PRIEST:
- case MONS_GHOUL:
- case MONS_NECROPHAGE:
- case MONS_VAMPIRE:
- case MONS_VAMPIRE_KNIGHT:
- case MONS_VAMPIRE_MAGE:
- case MONS_LICH:
- case MONS_ANCIENT_LICH:
- case MONS_WIGHT:
- case MONS_BORIS:
- break;
- case MONS_ROTTING_HULK:
- default:
- return 0; // Immune (no flesh) or already rotting.
- }
-
- int ench = ((random2(pow) + random2(pow) + random2(pow) + random2(pow))/4);
- ench = 1 + (ench >= 20) + (ench >= 35) + (ench >= 50);
-
- monster->add_ench(mon_enchant(ENCH_ROT, ench, KC_YOU));
-
- return (1);
-}
-
-static int _rot_corpses(coord_def where, int pow, int, actor *)
-{
- return _make_a_rot_cloud(where, pow, CLOUD_MIASMA);
-}
-
-void cast_rotting(int pow)
-{
- apply_area_visible(_rot_living, pow);
- apply_area_visible(_rot_undead, pow);
- apply_area_visible(_rot_corpses, pow);
- return;
-}
-
-void do_monster_rot(int mon)
-{
- int damage = 1 + random2(3);
-
- if (mons_holiness(&menv[mon]) == MH_UNDEAD && !one_chance_in(5))
- {
- apply_area_cloud(make_a_normal_cloud, menv[mon].pos(),
- 10, 1, CLOUD_MIASMA, KC_YOU, KILL_YOU_MISSILE);
- }
-
- _player_hurt_monster( mon, damage );
-}
-
static int _snake_charm_monsters(coord_def where, int pow, int, actor *)
{
monsters* monster = monster_at(where);
@@ -1980,44 +1751,6 @@ bool cast_fragmentation(int pow, const dist& spd)
return (true);
}
-bool cast_twist(int pow, const coord_def& where)
-{
- monsters *monster = monster_at(where);
-
- // Anything there?
- if (monster == NULL)
- {
- mpr("There is no monster there!");
- // This counts as a real cast, in order not to leak invisible
- // monster locations, and to allow victory-dancing.
- return (true);
- }
-
- // Identify mimics, if necessary.
- if (mons_is_mimic(monster->type))
- monster->flags |= MF_KNOWN_MIMIC;
-
- // Monster can magically save vs attack.
- if (check_mons_resist_magic(monster, pow * 2))
- {
- simple_monster_message(monster, mons_resist_string(monster));
- return (true);
- }
-
- // Roll the damage... this spell is pretty low on damage, because
- // it can target any monster in LOS (high utility). This is
- // similar to the damage done by Magic Dart (although, the
- // distribution is much more uniform). -- bwr
- const int damage = 1 + random2(3 + pow / 5);
-
- // Inflict the damage.
- if (!_player_hurt_monster(*monster, damage))
- if (mons_is_mimic(monster->type))
- mimic_alert(monster);
-
- return (true);
-}
-
bool cast_portal_projectile(int pow)
{
dist target;
@@ -2047,126 +1780,6 @@ bool cast_portal_projectile(int pow)
return (true);
}
-//
-// This version of far strike is a bit too creative for level one, in
-// order to make it work we needed to put a lot of restrictions on it
-// (like the damage limitation), which wouldn't be necessary if it were
-// a higher level spell. This code might come back as a high level
-// translocation spell later (maybe even with special effects if it's
-// using some of Josh's ideas about occasionally losing the weapon).
-// Would potentially make a good high-level, second book Warper spell
-// (since Translocations is a utility school, it should be higher level
-// that usual... especially if it turns into a flavoured smiting spell).
-// This can all wait until after the next release (as it would be better
-// to have a proper way to do a single weapon strike here (you_attack
-// does far more than we need or want here)). --bwr
-//
-void cast_far_strike(int pow)
-{
- dist targ;
- bolt tmp; // used, but ignored
-
- // Get target, using DIR_TARGET for targetting only,
- // since we don't use fire_beam() for this spell.
- if (!spell_direction(targ, tmp, DIR_TARGET))
- return;
-
- // Get the target monster...
- if (monster_at(targ.target) == NULL)
- {
- mpr("There is no monster there!");
- return;
- }
-
- if (trans_wall_blocking( targ.target ))
- {
- mpr("A translucent wall is in the way.");
- return;
- }
-
- // Start with weapon base damage...
-
- int damage = 3; // default unarmed damage
- int speed = 10; // default unarmed time
-
- if (you.weapon()) // if not unarmed
- {
- const item_def& wpn(*you.weapon());
- // Look up the base damage.
- if (wpn.base_type == OBJ_WEAPONS)
- {
- damage = property( wpn, PWPN_DAMAGE );
- speed = property( wpn, PWPN_SPEED );
-
- if (get_weapon_brand(wpn) == SPWPN_SPEED)
- speed /= 2;
- }
- else if (item_is_staff(wpn))
- {
- damage = property(wpn, PWPN_DAMAGE );
- speed = property(wpn, PWPN_SPEED );
- }
- }
-
- // Because we're casting a spell (and don't want to make this level
- // one spell too good), we're not applying skill speed bonuses and at
- // the very least guaranteeing one full turn (speed == 10) like the
- // other spells (if any thing else related to speed is changed, at
- // least leave this right before the application to you.time_taken).
- // Leaving skill out of the speed bonus is an important part of
- // keeping this spell from becoming a "better than actual melee"
- // spell... although, it's fine if that's the case for early Warpers,
- // Fighter types, and such that pick up this trivial first level spell,
- // shouldn't be using it instead of melee (but rather as an accessory
- // long range plinker). Therefore, we tone things down to try and
- // guarantee that the spell is never begins to approach real combat
- // (although the magic resistance check might end up with a higher
- // hit rate than attacking against EV for high level Warpers). -- bwr
- if (speed < 10)
- speed = 10;
-
- you.time_taken *= speed;
- you.time_taken /= 10;
-
- // Apply strength only to damage (since we're only interested in
- // force here, not finesse... the dex/to-hit part of combat is
- // instead handled via magical ability). This part could probably
- // just be removed, as it's unlikely to make any real difference...
- // if it is, the Warper stats in newgame.cc should be changed back
- // to the standard 6 int-4 dex of spellcasters. -- bwr
- int dammod = 78;
- const int dam_stat_val = you.strength;
-
- if (dam_stat_val > 11)
- dammod += (random2(dam_stat_val - 11) * 2);
- else if (dam_stat_val < 9)
- dammod -= (random2(9 - dam_stat_val) * 3);
-
- damage *= dammod;
- damage /= 78;
-
- monsters *monster = monster_at(targ.target);
-
- // Apply monster's AC.
- if (monster->ac > 0)
- damage -= random2( 1 + monster->ac );
-
- // Roll the damage...
- damage = 1 + random2( damage );
-
- // Monster can magically save vs attack (this could be replaced or
- // augmented with an EV check).
- if (check_mons_resist_magic( monster, pow * 2 ))
- {
- simple_monster_message( monster, mons_immune_magic(monster) ?
- " is unaffected." : " resists." );
- return;
- }
-
- // Inflict the damage.
- _player_hurt_monster(*monster, damage);
-}
-
bool cast_apportation(int pow, const coord_def& where)
{
// Protect the player from destroying the item.