summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/docs/crawl_options.txt6
-rw-r--r--crawl-ref/init.txt1
-rw-r--r--crawl-ref/source/externs.h1
-rw-r--r--crawl-ref/source/initfile.cc6
-rw-r--r--crawl-ref/source/item_use.cc26
-rw-r--r--crawl-ref/source/libgui.cc96
-rw-r--r--crawl-ref/source/libgui.h3
-rw-r--r--crawl-ref/source/tile1.cc5
-rw-r--r--crawl-ref/source/tile2.cc8
-rw-r--r--crawl-ref/source/tiles.h17
10 files changed, 118 insertions, 51 deletions
diff --git a/crawl-ref/docs/crawl_options.txt b/crawl-ref/docs/crawl_options.txt
index 4ac2b0602b..c5bb94c40e 100644
--- a/crawl-ref/docs/crawl_options.txt
+++ b/crawl-ref/docs/crawl_options.txt
@@ -78,8 +78,8 @@ The contents of this text are:
macro_meta_entry, additional_macro_file
4-o Tiles Options.
show_items, title_screen, tile_player_col,
- tile_monster_col, tile_friendly_col, tile_item_col,
- tile_unseen_col, tile_floor_col, tile_wall_col,
+ tile_monster_col, tile_neutral_col, tile_friendly_col,
+ tile_item_col, tile_unseen_col, tile_floor_col, tile_wall_col,
tile_mapped_wall_col, tile_door_col, tile_downstairs_col,
tile_upstairs_col, tile_feature_col, tile_trap_col,
tile_water_col, tile_lava_col, tile_excluded_col
@@ -1297,6 +1297,7 @@ title_screen = true
tile_player_col = white
tile_monster_col = red
+tile_neutral_col = red
tile_friendly_col = lightred
tile_item_col = green
tile_unseen_col = black
@@ -1317,6 +1318,7 @@ tile_excluded_col = darkcyan
tile_player_col - colour of player position, as well as of
map centre during level map mode ('X')
tile_monster_col - colour of hostile monsters
+ tile_neutral_col - colour of neutral monsters
tile_friendly_col - colour of friendly monsters
tile_item_col - colour of known or detected items
tile_unseen_col - colour of unseen areas (usually stone)
diff --git a/crawl-ref/init.txt b/crawl-ref/init.txt
index 2b0d72683f..2771713917 100644
--- a/crawl-ref/init.txt
+++ b/crawl-ref/init.txt
@@ -275,6 +275,7 @@ show_items = !?/%=([)X}+\_.
# tile_player_col = white
# tile_monster_col = red
+# tile_neutral_col = red
# tile_friendly_col = lightred
# tile_item_col = green
# tile_unseen_col = black
diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h
index 7c510225d3..89aa78bb2b 100644
--- a/crawl-ref/source/externs.h
+++ b/crawl-ref/source/externs.h
@@ -1766,6 +1766,7 @@ public:
// minimap colours
char tile_player_col;
char tile_monster_col;
+ char tile_neutral_col;
char tile_friendly_col;
char tile_item_col;
char tile_unseen_col;
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index 8109534c03..f7e9e6bb67 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -805,6 +805,7 @@ void game_options::reset_options()
// minimap colours
tile_player_col = MAP_WHITE;
tile_monster_col = MAP_RED;
+ tile_neutral_col = MAP_RED;
tile_friendly_col = MAP_LTRED;
tile_item_col = MAP_GREEN;
tile_unseen_col = MAP_BLACK;
@@ -2731,6 +2732,11 @@ void game_options::read_option_line(const std::string &str, bool runscript)
tile_monster_col =
str_to_tile_colour(field);
}
+ else if (key == "tile_neutral_col")
+ {
+ tile_neutral_col =
+ str_to_tile_colour(field);
+ }
else if (key == "tile_friendly_col")
{
tile_friendly_col =
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 2bc815bccf..b304a06545 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -4687,10 +4687,27 @@ void tile_use_item(int idx, InvAction act)
}
return;
}
- else if (act != INV_USE)
+ else if (act == INV_USE2) // secondary item use
{
+ if (you.inv[idx].base_type == OBJ_WEAPONS
+ && is_throwable(you.inv[idx], player_size(PSIZE_BODY)))
+ {
+ fire_thing(idx); // fire weapons
+ }
+ else if (you.inv[idx].base_type == OBJ_MISCELLANY
+ || you.inv[idx].base_type == OBJ_STAVES
+ && item_is_rod(you.inv[idx])) // unwield rods/misc. items
+ {
+ if (you.equip[EQ_WEAPON] == idx
+ && check_warning_inscriptions(you.inv[idx], OPER_WIELD))
+ {
+ wield_weapon(true, PROMPT_GOT_SPECIAL); // unwield
+ }
+ }
return;
}
+ else if (act != INV_USE)
+ return;
// Equipped?
bool equipped = false;
@@ -4737,15 +4754,14 @@ void tile_use_item(int idx, InvAction act)
wield_weapon(true, idx);
return;
}
- // evoke misc. items and known rods
- if (type == OBJ_MISCELLANY
- ||item_is_rod(you.inv[idx]) && item_type_known(you.inv[idx]))
+ // evoke misc. items and rods
+ if (type == OBJ_MISCELLANY || item_is_rod(you.inv[idx]))
{
if (check_warning_inscriptions(you.inv[idx], OPER_EVOKE))
evoke_wielded();
return;
}
- // unwield unknown rods, other staves or weapons
+ // unwield staves or weapons
if (check_warning_inscriptions(you.inv[idx], OPER_WIELD))
wield_weapon(true, PROMPT_GOT_SPECIAL); // unwield
return;
diff --git a/crawl-ref/source/libgui.cc b/crawl-ref/source/libgui.cc
index 56343fdaa3..c6177d9b63 100644
--- a/crawl-ref/source/libgui.cc
+++ b/crawl-ref/source/libgui.cc
@@ -356,10 +356,15 @@ void GmapUpdate(int x, int y, int what, bool upd_tile)
if (x == you.x_pos && y == you.y_pos)
c = Options.tile_player_col; // player position always highlighted
- else if (mgrd[x][y] != NON_MONSTER && mons_friendly(&menv[mgrd[x][y]])
- && upd_tile)
+ else if (mgrd[x][y] != NON_MONSTER && upd_tile)
{
- c = Options.tile_friendly_col; // friendly monsters subtly different from hostiles
+ if (mons_friendly(&menv[mgrd[x][y]]))
+ c = Options.tile_friendly_col; // colour friendly monsters
+ else if (mons_neutral(&menv[mgrd[x][y]])
+ && Options.tile_neutral_col != Options.tile_monster_col)
+ {
+ c = Options.tile_neutral_col; // colour neutral monsters
+ }
}
else
{
@@ -1333,20 +1338,26 @@ static int handle_mouse_motion(int mouse_x, int mouse_y, bool init)
case OBJ_STAVES:
case OBJ_MISCELLANY:
desc += "Wield (w)";
+ if (is_throwable(you.inv[ix], player_size(PSIZE_BODY)))
+ desc += EOL "[Ctrl-L-Click] Fire (f)";
break;
case OBJ_WEAPONS + 18:
desc += "Unwield";
+ if (is_throwable(you.inv[ix], player_size(PSIZE_BODY)))
+ desc += EOL "[Ctrl-L-Click] Fire (f)";
break;
case OBJ_MISCELLANY + 18:
if (you.inv[ix].sub_type >= MISC_DECK_OF_ESCAPE
&& you.inv[ix].sub_type <= MISC_DECK_OF_DEFENCE)
{
desc += "Draw a card (E)";
+ desc += EOL "[Ctrl-L-Click] Unwield";
break;
}
// else fall-through
case OBJ_STAVES + 18: // rods - other staves handled above
desc += "Evoke (E)";
+ desc += EOL "[Ctrl-L-Click] Unwield";
break;
case OBJ_ARMOUR:
desc += "Wear (W)";
@@ -1533,10 +1544,15 @@ static int handle_mouse_button(int mx, int my, int button,
const int cmd_dir[9]={'1','2','3','4','5','6','7','8','9'};
int trig = CK_MOUSE_B1;
- if (button == 2) trig = CK_MOUSE_B2;
- if (button == 3) trig = CK_MOUSE_B3;
- if (button == 4) trig = CK_MOUSE_B4;
- if (button == 5) trig = CK_MOUSE_B5;
+ if (button == 2)
+ trig = CK_MOUSE_B2;
+ else if (button == 3)
+ trig = CK_MOUSE_B3;
+ else if (button == 4)
+ trig = CK_MOUSE_B4;
+ else if (button == 5)
+ trig = CK_MOUSE_B5;
+
if (shift) trig |= 512;
if (ctrl) trig |= 1024;
@@ -1608,6 +1624,7 @@ static int handle_mouse_button(int mx, int my, int button,
}
else
gui_set_mouse_inv(ix, INV_VIEW);
+
TileMoveInvCursor(-1);
return CK_MOUSE_B2ITEM;
}
@@ -1621,13 +1638,18 @@ static int handle_mouse_button(int mx, int my, int button,
gui_set_mouse_inv(ix, INV_PICKUP);
else
gui_set_mouse_inv(ix, INV_USE_FLOOR);
+
return CK_MOUSE_B1ITEM;
}
+
// use item
if (shift)
gui_set_mouse_inv(ix, INV_DROP);
+ else if (ctrl)
+ gui_set_mouse_inv(ix, INV_USE2);
else
gui_set_mouse_inv(ix, INV_USE);
+
return CK_MOUSE_B1ITEM;
}
}
@@ -1698,9 +1720,9 @@ static int handle_mouse_button(int mx, int my, int button,
// first, check if 3x3 grid around @ is clicked.
// if so, return equivalent numpad key
int adir = -1;
- for(dir=0;dir<9;dir++)
+ for (dir = 0; dir < 9; dir++)
{
- if( DCX+dx[dir] == cx && DCY+dy[dir]==cy)
+ if (DCX+dx[dir] == cx && DCY+dy[dir]==cy)
{
adir = dir;
break;
@@ -1713,20 +1735,23 @@ static int handle_mouse_button(int mx, int my, int button,
return cmd_s[adir];
else if (ctrl)
return cmd_c[adir];
- else return cmd_n[dir];
+ else
+ return cmd_n[dir];
}
- if (button != 1) return trig;
+ if (button != 1)
+ return trig;
// otherwise travel to that grid
const coord_def gc = view2grid(coord_def(cx+1, cy+1));
- if (!map_bounds(gc)) return 0;
+ if (!map_bounds(gc))
+ return 0;
// Activate travel
start_travel(gc.x, gc.y);
return CK_MOUSE_DONE;
}
- if(mouse_mode==MOUSE_MODE_COMMAND && mode == REGION_MAP)
+ if (mouse_mode==MOUSE_MODE_COMMAND && mode == REGION_MAP)
{
// begin telescope mode
if (button == 2)
@@ -1741,7 +1766,8 @@ static int handle_mouse_button(int mx, int my, int button,
// L-click: try to travel to the grid
const coord_def gc(cx-1, cy-1);
- if (!map_bounds(gc)) return 0;
+ if (!map_bounds(gc))
+ return 0;
// Activate travel
start_travel(gc.x, gc.y);
@@ -1762,12 +1788,10 @@ static int handle_mouse_button(int mx, int my, int button,
(mode == REGION_DNGN || mode == REGION_TDNGN))
{
if (cx < DCX-1 || cy < DCY-1 || cx > DCX+1 || cy > DCY+1) return 0;
- for(dir=0;dir<9;dir++)
+ for (dir = 0; dir < 9; dir++)
{
if( DCX+dx[dir] == cx && DCY+dy[dir]==cy)
- {
return cmd_dir[dir];
- }
}
return 0;
}
@@ -1794,34 +1818,35 @@ int getch_ck()
bool sh, ct;
int k;
- while(1)
- {
- k = 0;
- GetNextEvent(&etype, &key, &sh, &ct, &x1, &y1, &x2, &y2);
- switch(etype)
+ while (true)
{
+ k = 0;
+ GetNextEvent(&etype, &key, &sh, &ct, &x1, &y1, &x2, &y2);
+ switch(etype)
+ {
case EV_BUTTON:
k = handle_mouse_button(x1, y1, key, sh, ct);
- break;
+ break;
case EV_MOVE:
k = handle_mouse_motion(x1, y1, false);
- break;
+ break;
case EV_UNBUTTON:
k = handle_mouse_unbutton(x1, y1, key);
- break;
+ break;
case EV_KEYIN:
k = key;
- break;
+ break;
default:
- break;
- } // switch
+ break;
+ }
- if (k != 0) break;
- }/*while*/
+ if (k != 0)
+ break;
+ }
return k;
}
@@ -1867,8 +1892,9 @@ int mouse_get_mode()
return mouse_mode;
}
-void gui_init_view_params(coord_def &termsz, coord_def &viewsz,
- coord_def &msgp, coord_def &msgsz, coord_def &hudp, coord_def &hudsz)
+void gui_init_view_params(coord_def &termsz, coord_def &viewsz,
+ coord_def &msgp, coord_def &msgsz,
+ coord_def &hudp, coord_def &hudsz)
{
// TODO enne - set these other params too?
msgsz.x = msg_x;
@@ -1899,19 +1925,23 @@ void clrscr()
// clear Text regions
if (!region_lock[REGION_CRT])
region_crt->clear();
+
if (region_msg && !region_lock[REGION_MSG])
region_msg->clear();
+
if (region_stat && !region_lock[REGION_STAT])
region_stat->clear();
+
if (region_dngn && !region_lock[REGION_TDNGN])
region_dngn->clear();
+
if (region_tip && !region_lock[REGION_TIP])
region_tip->clear();
// Hack: Do not erase the backbuffer. Instead just hide it.
if (region_map)
{
- if(region_lock[REGION_MAP])
+ if (region_lock[REGION_MAP])
region_map->redraw();
else
region_map->flag = false;
diff --git a/crawl-ref/source/libgui.h b/crawl-ref/source/libgui.h
index 2fec6447ab..231eb2508d 100644
--- a/crawl-ref/source/libgui.h
+++ b/crawl-ref/source/libgui.h
@@ -80,7 +80,8 @@ bool gui_get_mouse_grid_pos(coord_def &gc);
enum InvAction
{
INV_DROP,
- INV_USE,
+ INV_USE, // primary inventory use
+ INV_USE2, // secondary inventory use
INV_PICKUP,
INV_VIEW,
INV_USE_FLOOR,
diff --git a/crawl-ref/source/tile1.cc b/crawl-ref/source/tile1.cc
index 99e1e6fd67..9284b1f0bf 100644
--- a/crawl-ref/source/tile1.cc
+++ b/crawl-ref/source/tile1.cc
@@ -816,6 +816,10 @@ int tileidx_monster(int mon_idx, bool detected)
{
ch |= TILE_FLAG_PET;
}
+ else if (mons_neutral(mons))
+ {
+ ch |= TILE_FLAG_NEUTRAL;
+ }
else if (mons_looks_stabbable(mons))
{
ch |= TILE_FLAG_STAB;
@@ -824,7 +828,6 @@ int tileidx_monster(int mon_idx, bool detected)
{
ch |= TILE_FLAG_MAY_STAB;
}
-
return ch;
}
diff --git a/crawl-ref/source/tile2.cc b/crawl-ref/source/tile2.cc
index 7926afcc67..a428ed3157 100644
--- a/crawl-ref/source/tile2.cc
+++ b/crawl-ref/source/tile2.cc
@@ -746,6 +746,12 @@ void tcache_compose_normal(int ix, int *fg, int *bg)
tcache_overlay(tc_img, ix, TILE_HEART, TREGION_0_NORMAL, &c, NULL);
status_shift += 10;
}
+ else if ((fg0 & TILE_FLAG_MAY_STAB) == TILE_FLAG_NEUTRAL)
+ {
+ // FIX ME: add real neutral marker!
+ tcache_overlay(tc_img, ix, TILE_NEW_STAIR, TREGION_0_NORMAL, &c, NULL);
+ status_shift += 10;
+ }
else if ((fg0 & TILE_FLAG_MAY_STAB) == TILE_FLAG_STAB)
{
tcache_overlay(tc_img, ix, TILE_STAB_BRAND, TREGION_0_NORMAL, &c, NULL);
@@ -757,7 +763,7 @@ void tcache_compose_normal(int ix, int *fg, int *bg)
NULL);
status_shift += 5;
}
-
+
if (fg0 & TILE_FLAG_POISON)
{
tcache_overlay(tc_img, ix, TILE_POISON, TREGION_0_NORMAL, &c, NULL,
diff --git a/crawl-ref/source/tiles.h b/crawl-ref/source/tiles.h
index c45324242e..3ccf159829 100644
--- a/crawl-ref/source/tiles.h
+++ b/crawl-ref/source/tiles.h
@@ -142,19 +142,20 @@ enum tile_flags
// Foreground flags
TILE_FLAG_S_UNDER = 0x00000800,
TILE_FLAG_FLYING = 0x00001000,
- TILE_FLAG_NET = 0x00002000,
- TILE_FLAG_PET = 0x00004000,
+ TILE_FLAG_PET = 0x00002000,
+ TILE_FLAG_NEUTRAL = 0x00004000,
TILE_FLAG_STAB = 0x00008000,
TILE_FLAG_MAY_STAB = 0x0000C000,
- TILE_FLAG_POISON = 0x00010000,
+ TILE_FLAG_NET = 0x00010000,
+ TILE_FLAG_POISON = 0x00020000,
// Background flags
TILE_FLAG_RAY = 0x00000800,
- TILE_FLAG_MM_UNSEEN = 0x00001000,
- TILE_FLAG_UNSEEN = 0x00002000,
- TILE_FLAG_CURSOR0 = 0x00000000,
- TILE_FLAG_CURSOR1 = 0x00008000,
- TILE_FLAG_CURSOR2 = 0x00004000,
+ TILE_FLAG_MM_UNSEEN = 0x00000000,
+ TILE_FLAG_UNSEEN = 0x00001000,
+ TILE_FLAG_CURSOR0 = 0x00002000,
+ TILE_FLAG_CURSOR1 = 0x00004000,
+ TILE_FLAG_CURSOR2 = 0x00008000,
TILE_FLAG_CURSOR3 = 0x0000C000,
TILE_FLAG_CURSOR = 0x0000C000,
TILE_FLAG_BLOOD = 0x00010000,