From 2e0507ac62fefe90c1b6a15af5f971d2892d5534 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Mon, 30 Jun 2008 21:39:03 +0000 Subject: Force beams of digging (wand or spell, known or unknown, also /random effects) to ignore the endpoint target ('.') in favour of continuing until the end of the range. Unrestrict tridents for some more species. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6265 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/beam.cc | 2 ++ crawl-ref/source/directn.cc | 15 +++++++-------- crawl-ref/source/item_use.cc | 8 ++++---- crawl-ref/source/newgame.cc | 15 +++++++++++++++ 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index f3c6a68ea5..8c97298631 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -273,6 +273,8 @@ bool zapping(zap_type ztype, int power, bolt &pbolt, bool needs_tracer, // XXX: Needs to check silenced at other location, too. {dlb} noisy(25, you.x_pos, you.y_pos, "You hear a mighty clap of thunder!"); } + else if (ztype == ZAP_DIGGING) + pbolt.aimed_at_spot = false; fire_beam(pbolt); diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc index 7b787fa0fa..8d3b268e00 100644 --- a/crawl-ref/source/directn.cc +++ b/crawl-ref/source/directn.cc @@ -276,11 +276,11 @@ static bool _is_target_in_range(int x, int y, int range) // previous command differently (i.e., not just letting the keys // stuffed into the macro buffer replay as-is) because if the player // targeted a monster using the movement keys and the monster then -// moved between repititions, then simply replaying the keys in the +// moved between repetitions, then simply replaying the keys in the // buffer will target an empty square. -static void direction_again(dist& moves, targeting_type restricts, - targ_mode_type mode, int range, bool just_looking, - const char *prompt, targeting_behaviour *beh) +static void _direction_again(dist& moves, targeting_type restricts, + targ_mode_type mode, int range, bool just_looking, + const char *prompt, targeting_behaviour *beh) { moves.isValid = false; moves.isTarget = false; @@ -471,8 +471,7 @@ static void _fill_monster_list(bool full_info) void direction(dist& moves, targeting_type restricts, targ_mode_type mode, int range, bool just_looking, - bool needs_path, const char *prompt, - targeting_behaviour *beh) + bool needs_path, const char *prompt, targeting_behaviour *beh) { static targeting_behaviour stock_behaviour; if (!beh) @@ -491,8 +490,8 @@ void direction(dist& moves, targeting_type restricts, if (crawl_state.is_replaying_keys() && restricts != DIR_DIR) { - direction_again(moves, restricts, mode, range, just_looking, - prompt, beh); + _direction_again(moves, restricts, mode, range, just_looking, + prompt, beh); return; } diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 30431843c3..b13cb3aa24 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -3476,7 +3476,7 @@ void zap_wand( int slot ) } message_current_target(); - direction( zap_wand, DIR_NONE, targ_mode ); + direction(zap_wand, DIR_NONE, targ_mode); if (!zap_wand.isValid) { @@ -3516,10 +3516,10 @@ void zap_wand( int slot ) // and unknown wands (highest possible range, and unresistable beam // flavour). Don't use the tracer if firing at self. if (!beam.aimed_at_feet - && !player_tracer(!beam.effect_known ? ZAP_DEBUGGING_RAY - : type_zapped, + && !player_tracer(beam.effect_known ? type_zapped + : ZAP_DEBUGGING_RAY, 2 * (you.skills[SK_EVOCATIONS] - 1), - beam, !beam.effect_known ? 17 : 0)) + beam, beam.effect_known ? 0 : 17)) { return; } diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc index 8e8ed3ed92..f4b275b76a 100644 --- a/crawl-ref/source/newgame.cc +++ b/crawl-ref/source/newgame.cc @@ -2211,6 +2211,21 @@ static char_choice_restriction _weapon_restriction(weapon_type wpn) return (CC_BANNED); } + // Tridents are strictly better than spears, so unrestrict them + // for some species whose Polearm aptitudes are not too bad. + switch (you.species) + { + case SP_MOUNTAIN_DWARF: + case SP_OGRE: + case SP_DEMIGOD: + case SP_DEMONSPAWN: + case SP_GHOUL: + case SP_VAMPIRE: + return (CC_UNRESTRICTED); + default: + break; + } + // Both are polearms, right? return (_weapon_restriction(WPN_SPEAR)); -- cgit v1.2.3-54-g00ecf