From 61bdb2932105d91f430a0e067a5022732f33355a Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Thu, 9 Aug 2007 20:28:33 +0000 Subject: Targetting changes: 1. when the current target is you, this is now shown 2. wraparound includes you for TARG_ANY and TARG_FRIEND (Unfortunately I can't get this to work for '-', so it only works in one direction.) 3. "... looks unstable" message moved to mstuff2 for consistency with the reversal message 4. teleportation is now of type TARG_ANY git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1986 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/beam.cc | 2 +- crawl-ref/source/direct.cc | 20 +++++++++++++++++--- crawl-ref/source/item_use.cc | 10 +++++++--- crawl-ref/source/mstuff2.cc | 4 ++++ 4 files changed, 29 insertions(+), 7 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 791371e41a..17b4da20a9 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -3787,7 +3787,7 @@ static int affect_monster_enchantment(bolt &beam, monsters *mon) return mons_immune_magic(mon) ? MON_UNAFFECTED : MON_RESIST; } - if (simple_monster_message(mon, " looks slightly unstable.")) + if (mons_near(mon) && player_monster_visible(mon)) beam.obvious_effect = true; monster_teleport(mon, false); diff --git a/crawl-ref/source/direct.cc b/crawl-ref/source/direct.cc index 3287e99d20..47b310f1f1 100644 --- a/crawl-ref/source/direct.cc +++ b/crawl-ref/source/direct.cc @@ -310,6 +310,11 @@ void direction(dist& moves, targeting_type restricts, { mprf(MSGCH_PROMPT, "%s (%s)", prompt? prompt : "Aim", target_mode_help_text(restricts)); + + if ((mode == TARG_ANY || mode == TARG_FRIEND) + && moves.tx == you.x_pos && moves.ty == you.y_pos) + terse_describe_square(moves.target()); + show_prompt = false; } @@ -972,12 +977,18 @@ static char find_square( int xps, int yps, { if (direction == 1 && temp_xps == minx && temp_yps == maxy) { - return find_square(ctrx, ctry, mfp, direction, find_targ, mode, + if (mode == TARG_ANY || mode == TARG_FRIEND) + { + mfp[0] = vyou.x; + mfp[1] = vyou.y; + return (1); + } + return find_square(ctrx, ctry, mfp, direction, find_targ, mode, false, next_los(direction, los, wrap)); } if (direction == -1 && temp_xps == ctrx && temp_yps == ctry) { - return find_square(minx, maxy, mfp, direction, find_targ, mode, + return find_square(minx, maxy, mfp, direction, find_targ, mode, false, next_los(direction, los, wrap)); } @@ -1610,7 +1621,10 @@ static std::string stair_destination_description(const coord_def &pos) static void describe_cell(int mx, int my) { bool mimic_item = false; - + + if (mx == you.x_pos && my == you.y_pos) + mpr("You."); + if (mgrd[mx][my] != NON_MONSTER) { int i = mgrd[mx][my]; diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index b15d66e35b..5d7a49a509 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -2764,9 +2764,13 @@ void zap_wand(void) const bool dangerous = player_in_a_dangerous_place(); if (alreadyknown) { - if (wand.sub_type == WAND_HASTING - || wand.sub_type == WAND_HEALING - || wand.sub_type == WAND_INVISIBILITY) + if (wand.sub_type == WAND_TELEPORTATION) + { + targ_mode = TARG_ANY; + } + else if (wand.sub_type == WAND_HASTING + || wand.sub_type == WAND_HEALING + || wand.sub_type == WAND_INVISIBILITY) { targ_mode = TARG_FRIEND; } diff --git a/crawl-ref/source/mstuff2.cc b/crawl-ref/source/mstuff2.cc index 2a48a3fc35..1da999505c 100644 --- a/crawl-ref/source/mstuff2.cc +++ b/crawl-ref/source/mstuff2.cc @@ -825,7 +825,11 @@ void monster_teleport(struct monsters *monster, bool instan, bool silent) simple_monster_message(monster, " seems more stable."); } else + { + if (!silent) + simple_monster_message(monster, " looks slightly unstable."); monster->add_ench( mon_enchant(ENCH_TP, coinflip()? 3 : 4) ); + } return; } -- cgit v1.2.3-54-g00ecf