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-03 09:49:19 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-03 09:49:19 +0000
commit1e6c29fcdad466fe9bbae6326ef19bcad8e73707 (patch)
treed4600a8098234fc850c34323ac212e403e31a4b8 /crawl-ref/source
parentbc72da21789d32c6c7cce104f51c50348997b58a (diff)
downloadcrawl-ref-1e6c29fcdad466fe9bbae6326ef19bcad8e73707.tar.gz
crawl-ref-1e6c29fcdad466fe9bbae6326ef19bcad8e73707.zip
Bug/FR 1947001: For damaging cards add "You draw card xy" to the prompt,
so you can reread it while targetting, and add a targetting subcommand "show prompt" that'll do just that. (Though you can already do that by looking at the help.) Fix plain coloured items highlighted in grey in prompts, and add two new colouring prefixes: evil_item (/draining, necromancy books, etc.) and evil_eating (cannibalism, intelligent being) that only apply for the good gods. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5455 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/command.cc1
-rw-r--r--crawl-ref/source/decks.cc31
-rw-r--r--crawl-ref/source/directn.cc70
-rw-r--r--crawl-ref/source/enum.h1
-rw-r--r--crawl-ref/source/itemname.cc14
-rw-r--r--crawl-ref/source/menu.cc4
-rw-r--r--crawl-ref/source/religion.cc4
7 files changed, 81 insertions, 44 deletions
diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc
index ca6f166666..5f4b35fef0 100644
--- a/crawl-ref/source/command.cc
+++ b/crawl-ref/source/command.cc
@@ -644,6 +644,7 @@ static const char *targeting_help_1 =
"<w><<</w>/<w>></w> : cycle through up/down stairs\n"
"<w>Tab</w> : cycle through shops and portals\n"
"<w>Ctrl-F</w> : change monster targeting mode\n"
+ "<w>Ctrl-P</w> : repeat prompt\n"
" \n"
"<h>Targeting (zapping wands, casting spells, etc.):\n"
"The keys from examine surroundings also work here.\n"
diff --git a/crawl-ref/source/decks.cc b/crawl-ref/source/decks.cc
index db45b50fdb..34cf168221 100644
--- a/crawl-ref/source/decks.cc
+++ b/crawl-ref/source/decks.cc
@@ -1583,7 +1583,7 @@ static bool _damaging_card(card_type card, int power, deck_rarity_type rarity)
ZAP_ORB_OF_ELECTRICITY };
const zap_type painzaps[2] = { ZAP_AGONY, ZAP_NEGATIVE_ENERGY };
- switch ( card )
+ switch (card)
{
case CARD_VITRIOL:
ztype = (one_chance_in(3) ? ZAP_DEGENERATION : ZAP_BREATHE_ACID);
@@ -1612,8 +1612,9 @@ static bool _damaging_card(card_type card, int power, deck_rarity_type rarity)
case CARD_PAIN:
if (power_level == 2)
{
+ mprf("You have drawn %s.", card_name(card));
_mass_drain(power);
- return true;
+ return (true);
}
else
ztype = painzaps[power_level];
@@ -1623,12 +1624,18 @@ static bool _damaging_card(card_type card, int power, deck_rarity_type rarity)
break;
}
- if (spell_direction(target, beam) && player_tracer(ztype, power/4, beam))
+ snprintf(info, INFO_SIZE, "You have drawn %s. Aim where? ",
+ card_name(card));
+
+ if (spell_direction(target, beam, DIR_NONE, TARG_ENEMY, true, info)
+ && player_tracer(ztype, power/4, beam))
+ {
zapping(ztype, random2(power/4), beam);
+ }
else
rc = false;
- return rc;
+ return (rc);
}
static void _elixir_card(int power, deck_rarity_type rarity)
@@ -2712,8 +2719,15 @@ bool card_effect(card_type which_card, deck_rarity_type rarity,
if (tell_card)
{
- msg::stream << "You have drawn " << card_name( which_card )
- << '.' << std::endl;
+ // These card types will usually give this message in the targetting
+ // prompt, and the cases where they don't are handled specially.
+ if (which_card != CARD_VITRIOL && which_card != CARD_FLAME
+ && which_card != CARD_FROST && which_card != CARD_HAMMER
+ && which_card != CARD_SPARK && which_card != CARD_PAIN
+ && which_card != CARD_VENOM)
+ {
+ mprf("You have drawn %s.", card_name(which_card));
+ }
}
if (which_card == CARD_XOM && !crawl_state.is_god_acting())
@@ -2776,7 +2790,10 @@ bool card_effect(card_type which_card, deck_rarity_type rarity,
case CARD_VENOM:
if ( coinflip() )
+ {
+ mprf("You have drawn %s.", card_name(which_card));
your_spells(SPELL_OLGREBS_TOXIC_RADIANCE,random2(power/4), false);
+ }
else
rc = _damaging_card(which_card, power, rarity);
break;
@@ -2800,7 +2817,7 @@ bool card_effect(card_type which_card, deck_rarity_type rarity,
break;
case CARD_WILD_MAGIC:
- // yes, high power is bad here
+ // Yes, high power is bad here.
miscast_effect( SPTYP_RANDOM, random2(power/15) + 5,
random2(power), 0, "a card of wild magic" );
break;
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc
index 23ce7b0b1a..feb805e7dc 100644
--- a/crawl-ref/source/directn.cc
+++ b/crawl-ref/source/directn.cc
@@ -484,10 +484,10 @@ void direction(dist& moves, targeting_type restricts,
bool found_autotarget = false;
bool target_unshifted = Options.target_unshifted_dirs;
- // Find a default target
+ // Find a default target.
if (Options.default_target && mode == TARG_ENEMY)
{
- skip_iter = true; // skip first iteration...XXX mega-hack
+ skip_iter = true; // Skip first iteration...XXX mega-hack
if (you.prev_targ != MHITNOT && you.prev_targ != MHITYOU)
{
const monsters *montarget = &menv[you.prev_targ];
@@ -534,12 +534,12 @@ void direction(dist& moves, targeting_type restricts,
command_type key_command;
- if ( skip_iter )
+ if (skip_iter)
{
- if ( found_autotarget )
+ if (found_autotarget)
key_command = CMD_NO_CMD;
else
- key_command = CMD_TARGET_CYCLE_FORWARD; // find closest enemy
+ key_command = CMD_TARGET_CYCLE_FORWARD; // Find closest target.
}
else
{
@@ -550,9 +550,9 @@ void direction(dist& moves, targeting_type restricts,
}
#ifdef USE_TILE
- // if a mouse command, update location to mouse position...
- if ( key_command == CMD_TARGET_MOUSE_MOVE
- || key_command == CMD_TARGET_MOUSE_SELECT )
+ // If a mouse command, update location to mouse position.
+ if (key_command == CMD_TARGET_MOUSE_MOVE
+ || key_command == CMD_TARGET_MOUSE_SELECT)
{
coord_def gc;
if (gui_get_mouse_grid_pos(gc))
@@ -585,9 +585,10 @@ void direction(dist& moves, targeting_type restricts,
target_unshifted = false;
}
- if ( key_command == CMD_TARGET_MAYBE_PREV_TARGET )
+
+ if (key_command == CMD_TARGET_MAYBE_PREV_TARGET)
{
- if ( moves.tx == you.x_pos && moves.ty == you.y_pos )
+ if (moves.tx == you.x_pos && moves.ty == you.y_pos)
key_command = CMD_TARGET_PREV_TARGET;
else
key_command = CMD_TARGET_SELECT;
@@ -602,7 +603,7 @@ void direction(dist& moves, targeting_type restricts,
int i, mid;
- switch ( key_command )
+ switch (key_command)
{
// standard movement
case CMD_TARGET_DOWN_LEFT:
@@ -631,16 +632,16 @@ void direction(dist& moves, targeting_type restricts,
if (restricts != DIR_TARGET)
{
// A direction is allowed, and we've selected it.
- moves.dx = Compass[i].x;
- moves.dy = Compass[i].y;
+ moves.dx = Compass[i].x;
+ moves.dy = Compass[i].y;
// Needed for now...eventually shouldn't be necessary
- moves.tx = you.x_pos + moves.dx;
- moves.ty = you.y_pos + moves.dy;
- moves.isValid = true;
+ moves.tx = you.x_pos + moves.dx;
+ moves.ty = you.y_pos + moves.dy;
+ moves.isValid = true;
moves.isTarget = false;
- show_beam = false;
+ show_beam = false;
moves.choseRay = false;
- loop_done = true;
+ loop_done = true;
}
else
{
@@ -659,6 +660,11 @@ void direction(dist& moves, targeting_type restricts,
}
break;
+ case CMD_TARGET_SHOW_PROMPT:
+ mprf(MSGCH_PROMPT, "%s (%s)", prompt? prompt : "Aim",
+ target_mode_help_text(restricts));
+ break;
+
#ifdef WIZARD
case CMD_TARGET_CYCLE_BEAM:
show_beam = find_ray(you.x_pos, you.y_pos, moves.tx, moves.ty,
@@ -734,7 +740,7 @@ void direction(dist& moves, targeting_type restricts,
break;
}
- // we have a valid previous target (maybe)
+ // We have a valid previous target (maybe).
{
const monsters *montarget = &menv[you.prev_targ];
@@ -746,12 +752,12 @@ void direction(dist& moves, targeting_type restricts,
}
else
{
- // We have all the information we need
- moves.isValid = true;
+ // We have all the information we need.
+ moves.isValid = true;
moves.isTarget = true;
- moves.tx = montarget->x;
- moves.ty = montarget->y;
- if ( !just_looking )
+ moves.tx = montarget->x;
+ moves.ty = montarget->y;
+ if (!just_looking)
{
// We have to turn off show_beam, because
// when jumping to a previous target we don't
@@ -778,14 +784,14 @@ void direction(dist& moves, targeting_type restricts,
}
moves.isValid = true;
moves.isTarget = true;
- loop_done = true;
+ loop_done = true;
you.prev_grd_targ = coord_def(0, 0);
- // maybe we should except just_looking here?
+ // Maybe we should except just_looking here?
mid = mgrd[moves.tx][moves.ty];
- if ( mid != NON_MONSTER )
+ if (mid != NON_MONSTER)
you.prev_targ = mid;
else if (moves.tx == you.x_pos && moves.ty == you.y_pos)
you.prev_targ = MHITYOU;
@@ -822,7 +828,6 @@ void direction(dist& moves, targeting_type restricts,
}
else if (!skip_iter)
flush_input_buffer(FLUSH_ON_FAILURE);
-
break;
case CMD_TARGET_CANCEL:
@@ -929,12 +934,12 @@ void direction(dist& moves, targeting_type restricts,
break;
}
- if ( loop_done == true )
+ if (loop_done == true)
{
// This is where we either finalize everything, or else
// decide that we're not really done and continue looping.
- if ( just_looking ) // easy out
+ if (just_looking) // easy out
break;
// A bunch of confirmation tests; if we survive them all,
@@ -955,12 +960,12 @@ void direction(dist& moves, targeting_type restricts,
mpr("Sorry, you can't target what you can't see.",
MSGCH_EXAMINE_FILTER);
}
- // Ask for confirmation if we're quitting for some odd reason
+ // Ask for confirmation if we're quitting for some odd reason.
else if ( moves.isValid || moves.isCancel
|| yesno("Are you sure you want to fizzle?", false, 'n') )
{
// Finalize whatever is inside the loop
- // (moves-internal finalizations can be done later)
+ // (moves-internal finalizations can be done later).
moves.choseRay = show_beam;
moves.ray = ray;
break;
@@ -2493,6 +2498,7 @@ command_type targeting_behaviour::get_command(int key)
case 'v': return CMD_TARGET_DESCRIBE;
case '?': return CMD_TARGET_HELP;
case ' ': return just_looking? CMD_TARGET_CANCEL : CMD_TARGET_SELECT;
+ case CONTROL('P'): return CMD_TARGET_SHOW_PROMPT;
#ifdef WIZARD
case CONTROL('C'): return CMD_TARGET_CYCLE_BEAM;
#endif
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index 1e9d0337ed..970b0c7fe7 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -587,6 +587,7 @@ enum command_type
CMD_TARGET_HIDE_BEAM,
CMD_TARGET_CENTER,
CMD_TARGET_CANCEL,
+ CMD_TARGET_SHOW_PROMPT,
CMD_TARGET_OLD_SPACE,
CMD_TARGET_FIND_TRAP,
CMD_TARGET_FIND_PORTAL,
diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc
index 96069237a5..9f2444089d 100644
--- a/crawl-ref/source/itemname.cc
+++ b/crawl-ref/source/itemname.cc
@@ -40,6 +40,7 @@
#include "player.h"
#include "quiver.h"
#include "randart.h"
+#include "religion.h"
#include "skills2.h"
#include "state.h"
#include "stuff.h"
@@ -2193,6 +2194,9 @@ const std::string menu_colour_item_prefix(const item_def &item)
}
}
+ if (is_good_god(you.religion) && is_evil_item(item))
+ prefixes.push_back("evil_item");
+
switch (item.base_type)
{
case OBJ_CORPSES:
@@ -2204,6 +2208,14 @@ const std::string menu_colour_item_prefix(const item_def &item)
}
// intentional fall-through
case OBJ_FOOD:
+ if ((item.base_type == OBJ_CORPSES || item.sub_type == FOOD_CHUNK)
+ && (is_good_god(you.religion) && is_player_same_species(item.plus)
+ || you.religion == GOD_ZIN
+ && mons_intel(item.plus) >= I_NORMAL))
+ {
+ prefixes.push_back("evil_eating");
+ }
+
if (item.base_type != OBJ_CORPSES
&& !can_ingest(item.base_type, item.sub_type, true, true, false)
|| you.species == SP_VAMPIRE && !mons_has_blood(item.plus)
@@ -2254,7 +2266,7 @@ const std::string get_menu_colour_prefix_tags(item_def &item,
std::string item_name = item.name(desc);
int col = menu_colour(item_name, cprf, "pickup");
- if (col != LIGHTGRAY)
+ if (col != -1)
colour = colour_to_str( col );
if (!colour.empty())
diff --git a/crawl-ref/source/menu.cc b/crawl-ref/source/menu.cc
index a3d00595ed..82e43a0a76 100644
--- a/crawl-ref/source/menu.cc
+++ b/crawl-ref/source/menu.cc
@@ -1170,8 +1170,8 @@ int menu_colour(const std::string &text, const std::string &prefix,
for (unsigned int i = 0; i < Options.menu_colour_mappings.size(); ++i)
{
const colour_mapping &cm = Options.menu_colour_mappings[i];
- if ( (cm.tag.empty() || cm.tag == "any" || cm.tag == tag
- || cm.tag == "inventory" && tag == "pickup")
+ if ((cm.tag.empty() || cm.tag == "any" || cm.tag == tag
+ || cm.tag == "inventory" && tag == "pickup")
&& cm.pattern.matches(tmp_text) )
{
return (cm.colour);
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 53ed6dcd91..cde1fc4ed7 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -2740,11 +2740,11 @@ bool ely_destroy_weapons()
int i = igrd[you.x_pos][you.y_pos];
while (i != NON_ITEM)
{
- const int next = mitm[i].link; // in case we can't get it later.
+ const int next = mitm[i].link; // In case we can't get it later.
if (mitm[i].base_type != OBJ_WEAPONS
&& mitm[i].base_type != OBJ_MISSILES
- || item_is_stationary(mitm[i])) // held in a net
+ || item_is_stationary(mitm[i])) // Held in a net?
{
i = next;
continue;