summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-02-06 17:54:25 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-02-06 17:54:25 +0000
commit15914c94597d6c51c42ef22b7ee4f7f1970520eb (patch)
tree47cc0d0c322f8a5ab276aaddb78e2403b4d86d6b /crawl-ref
parent7f57e44d0660cbb1c9971f3c170a011ffa7eb4a1 (diff)
downloadcrawl-ref-15914c94597d6c51c42ef22b7ee4f7f1970520eb.tar.gz
crawl-ref-15914c94597d6c51c42ef22b7ee4f7f1970520eb.zip
Fixed unbrandability of friendly hellions.
Moved beam cycling to ^C. We really need to make it a wizmode-only option. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@926 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/direct.cc23
-rw-r--r--crawl-ref/source/enum.h1
-rw-r--r--crawl-ref/source/view.cc11
3 files changed, 29 insertions, 6 deletions
diff --git a/crawl-ref/source/direct.cc b/crawl-ref/source/direct.cc
index 0a164913cb..015ad7fcc9 100644
--- a/crawl-ref/source/direct.cc
+++ b/crawl-ref/source/direct.cc
@@ -104,11 +104,13 @@ static command_type read_direction_key()
const int key = unmangle_direction_keys(getchm(KC_TARGETING),KC_TARGETING);
switch ( key )
{
-
case ESCAPE: return CMD_TARGET_CANCEL;
+#ifdef WIZARD
+ case 'F': return CMD_TARGET_WIZARD_MAKE_FRIENDLY;
+#endif
case 'v': return CMD_TARGET_DESCRIBE;
case '?': return CMD_TARGET_HELP;
- case ' ': return CMD_TARGET_CYCLE_BEAM;
+ case CONTROL('C'): return CMD_TARGET_CYCLE_BEAM;
case ':': return CMD_TARGET_HIDE_BEAM;
case '\r': return CMD_TARGET_SELECT;
case '.': return CMD_TARGET_SELECT;
@@ -497,6 +499,23 @@ void direction(struct dist& moves, targeting_type restricts,
loop_done = true;
moves.isCancel = true;
break;
+
+#ifdef WIZARD
+ case CMD_TARGET_WIZARD_MAKE_FRIENDLY:
+ // Maybe we can skip this check...but it can't hurt
+ if (!in_bounds(moves.tx, moves.ty))
+ break;
+ mid = mgrd[moves.tx][moves.ty];
+ if (mid == NON_MONSTER) // can put in terrain description here
+ break;
+
+ {
+ monsters &m = menv[mid];
+ m.attitude = m.attitude == ATT_FRIENDLY?
+ ATT_HOSTILE : ATT_FRIENDLY;
+ }
+ break;
+#endif
case CMD_TARGET_DESCRIBE:
// Maybe we can skip this check...but it can't hurt
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index 4819753756..ccc8b70890 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -711,6 +711,7 @@ enum command_type
CMD_TARGET_FIND_DOWNSTAIR,
CMD_TARGET_FIND_YOU,
CMD_TARGET_DESCRIBE,
+ CMD_TARGET_WIZARD_MAKE_FRIENDLY,
CMD_TARGET_HELP,
// [ds] Silently ignored, requests another round of input.
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index fef73784fc..cd5d9fcc56 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -259,13 +259,11 @@ static unsigned fix_colour(unsigned raw_colour)
// This order is important - is_element_colour() doesn't want to see the
// munged colours returned by dos_brand, so it should always be done
// before applying DOS brands.
-#if defined(WIN32CONSOLE) || defined(DOS)
const int colflags = raw_colour & 0xFF00;
-#endif
// Evaluate any elemental colours to guarantee vanilla colour is returned
if (is_element_colour( raw_colour ))
- raw_colour = element_colour( raw_colour );
+ raw_colour = colflags | element_colour( raw_colour );
#if defined(WIN32CONSOLE) || defined(DOS)
if (colflags)
@@ -1501,6 +1499,7 @@ static int cyclic_offset( unsigned int ui, int cycle_dir, int startpoint,
// If cycle_dir is 0, find the first fitting ray. If it is 1 or -1,
// assume that ray is appropriately filled in, and look for the next
// ray in that cycle direction.
+
bool find_ray( int sourcex, int sourcey, int targetx, int targety,
bool allow_fallback, ray_def& ray, int cycle_dir )
{
@@ -1530,7 +1529,11 @@ bool find_ray( int sourcex, int sourcey, int targetx, int targety,
bool blocked = false;
for ( inray = 0; inray < cellray; ++inray )
{
- if (grid_is_solid(grd[sourcex + signx * ray_coord_x[inray + cur_offset]][sourcey + signy * ray_coord_y[inray + cur_offset]]))
+ if (grid_is_solid(
+ grd[sourcex
+ + signx * ray_coord_x[inray + cur_offset]]
+ [sourcey
+ + signy * ray_coord_y[inray + cur_offset]]))
{
blocked = true;
break;