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-01-13 20:34:46 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-13 20:34:46 +0000
commitdf31ea9fdcfedf252e62f6bf0c5cff53df4b93d0 (patch)
tree2d7966f0f0eac61f1c17fa7182aa2ea22490a98f /crawl-ref/source
parent0962c7818135807861f1f8d659a952a8ea8f4ddb (diff)
downloadcrawl-ref-df31ea9fdcfedf252e62f6bf0c5cff53df4b93d0.tar.gz
crawl-ref-df31ea9fdcfedf252e62f6bf0c5cff53df4b93d0.zip
Mixed commit of small additions/changes.
FR 1870139: output "Tele" among enchantment abbrevs when "about to teleport" FR 1834016: print item slots along with rotting message (I added an option for this as I personally don't need this.) Gods: * Add ^ line for Zin's mutation protection. * Modify protection from harm adjectives in ^ screen to make difference between Ely and Zin/TSO more obvious. Tiles: Bug 1870238: Show mimics to be "autopickuable" (green frame). * Smarter handling of L-click actions in inventory. * code clean-up git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3269 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/describe.cc30
-rw-r--r--crawl-ref/source/effects.cc40
-rw-r--r--crawl-ref/source/externs.h11
-rw-r--r--crawl-ref/source/initfile.cc1
-rw-r--r--crawl-ref/source/item_use.cc20
-rw-r--r--crawl-ref/source/libgui.cc142
-rw-r--r--crawl-ref/source/output.cc8
-rw-r--r--crawl-ref/source/tile1.cc23
8 files changed, 179 insertions, 96 deletions
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index 7484b9c8a3..0015d51be2 100644
--- a/crawl-ref/source/describe.cc
+++ b/crawl-ref/source/describe.cc
@@ -2477,9 +2477,15 @@ void describe_god( god_type which_god, bool give_title )
if (harm_protection_type hpt =
god_protects_from_harm(which_god, false))
{
- const char *how = (you.piety >= 150) ? "carefully" :
- (you.piety >= 90) ? "often" :
- (you.piety >= 30) ? "sometimes" :
+ int prayer_prot = 0;
+ if (you.religion == GOD_ELYVILON && you.piety > 30)
+ prayer_prot = 100 - 3000/you.piety;
+
+ int prot_chance = 10 + you.piety/10 + prayer_prot; // chance * 100
+
+ const char *how = (prot_chance >= 85) ? "carefully" :
+ (prot_chance >= 55) ? "often" :
+ (prot_chance >= 25) ? "sometimes" :
"occasionally";
const char *when =
(hpt == HPT_PRAYING) ? " during prayer" :
@@ -2491,14 +2497,22 @@ void describe_god( god_type which_god, bool give_title )
god_name(which_god).c_str(), how, when );
}
- if (which_god == GOD_ZIN && you.piety >= 30)
+ if (which_god == GOD_ZIN)
{
have_any = true;
- cprintf("Praying to %s will provide sustenance if starving."
- EOL, god_name(which_god).c_str());
+ if (you.piety >= 30)
+ cprintf("Praying to %s will provide sustenance if starving."
+ EOL, god_name(which_god).c_str());
+
+ const char *how = (you.piety >= 150) ? "carefully" : // res mut. 3
+ (you.piety >= 100) ? "often" :
+ (you.piety >= 50) ? "sometimes" :
+ "occasionally";
+
+ cprintf("%s %s shields you from mutagenic effects." EOL,
+ god_name(which_god).c_str(), how);
}
-
- if (which_god == GOD_TROG)
+ else if (which_god == GOD_TROG)
{
have_any = true;
cprintf("You can call upon %s to burn books in your surroundings."
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index f73e2a233f..9e761c6841 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -1912,7 +1912,7 @@ static void hell_effects()
(temp_rand == 6) ? "\"We have you now!\"" :
// plain messages
(temp_rand == 7) ? (player_can_smell()) ? "You smell brimstone." :
- "Brimstone rains from above." :
+ "Brimstone rains from above." :
(temp_rand == 8) ? "You feel lost and a long, long way from home..." :
(temp_rand == 9) ? "You shiver with fear." :
// warning
@@ -2028,7 +2028,7 @@ static void rot_inventory_food(long time_delta)
// inventory {should be moved elsewhere - dlb}
bool burden_changed_by_rot = false;
- bool new_rotting_item = false;
+ std::vector<char> rotten_items;
for (int i = 0; i < ENDOFPACK; i++)
{
if (you.inv[i].quantity < 1)
@@ -2083,14 +2083,15 @@ static void rot_inventory_food(long time_delta)
if (you.inv[i].special < 100 && (you.inv[i].special + (time_delta / 20)>=100))
{
- new_rotting_item = true;
+ rotten_items.push_back(index_to_letter( i ));
}
}
//mv: messages when chunks/corpses become rotten
- if (new_rotting_item)
+ if (!rotten_items.empty())
{
- // XXX: should probably still notice?
+ std::string msg = "";
+
// Races that can't smell don't care, and trolls are stupid and
// don't care.
if (player_can_smell() && you.species != SP_TROLL)
@@ -2102,33 +2103,44 @@ static void rot_inventory_food(long time_delta)
case 1:
case 2:
temp_rand = random2(8);
- mpr( ((temp_rand < 5) ? "You smell something rotten." :
+ msg = (temp_rand < 5) ? "You smell something rotten." :
(temp_rand == 5) ? "You smell rotting flesh." :
(temp_rand == 6) ? "You smell decay."
- : "There is something rotten in your inventory."),
- MSGCH_ROTTEN_MEAT );
+ : "There is something rotten in your inventory.";
break;
// level 3 saprovores like it
case 3:
temp_rand = random2(8);
- mpr( ((temp_rand < 5) ? "You smell something rotten." :
+ msg = (temp_rand < 5) ? "You smell something rotten." :
(temp_rand == 5) ? "The smell of rotting flesh makes you hungry." :
(temp_rand == 6) ? "You smell decay. Yum-yum."
- : "Wow! There is something tasty in your inventory."),
- MSGCH_ROTTEN_MEAT );
+ : "Wow! There is something tasty in your inventory.";
break;
default:
temp_rand = random2(8);
- mpr( ((temp_rand < 5) ? "You smell something rotten." :
+ msg = (temp_rand < 5) ? "You smell something rotten." :
(temp_rand == 5) ? "The smell of rotting flesh makes you sick." :
(temp_rand == 6) ? "You smell decay. Yuck!"
- : "Ugh! There is something really disgusting in your inventory."),
- MSGCH_ROTTEN_MEAT );
+ : "Ugh! There is something really disgusting in your inventory.";
break;
}
}
+ else if (Options.list_rotten)
+ msg = "Something in your inventory has become rotten.";
+
+ if (Options.list_rotten)
+ {
+ mprf(MSGCH_ROTTEN_MEAT, "%s (slot%s %s)",
+ msg.c_str(),
+ rotten_items.size() > 1 ? "s" : "",
+ comma_separated_line(rotten_items.begin(),
+ rotten_items.end()).c_str());
+ }
+ else if (!msg.empty())
+ mpr(msg.c_str(), MSGCH_ROTTEN_MEAT);
+
learned_something_new(TUT_ROTTEN_FOOD);
}
if (burden_changed_by_rot)
diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h
index e463b9b000..c62fe73685 100644
--- a/crawl-ref/source/externs.h
+++ b/crawl-ref/source/externs.h
@@ -1567,15 +1567,16 @@ public:
bool clean_map; // remove unseen clouds/monsters
bool show_uncursed; // label known uncursed items as "uncursed"
bool easy_open; // open doors with movement
- bool easy_unequip; // allow auto-removing of armour / jewelry
- bool easy_butcher; // open doors with movement
+ bool easy_unequip; // allow auto-removing of armour / jewellery
+ bool easy_butcher; // autoswap to butchering tool
bool always_confirm_butcher; // even if only one corpse
- bool default_target; // start targeting on a real target
+ bool list_rotten; // list slots for rotting corpses/chunks
+ bool default_target; // start targeting on a real target
bool autopickup_no_burden; // don't autopickup if it changes burden
bool note_all_skill_levels; // take note for all skill levels (1-27)
- bool note_skill_max; // take note when skills reach new max
+ bool note_skill_max; // take note when skills reach new max
bool note_all_spells; // take note when learning any spell
- std::string user_note_prefix; // Prefix for user notes
+ std::string user_note_prefix;// Prefix for user notes
int note_hp_percent; // percentage hp for notetaking
int ood_interesting; // how many levels OOD is noteworthy?
int easy_confirm; // make yesno() confirming easier
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index 443d744eee..e5a6ffcd5d 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -613,6 +613,7 @@ void game_options::reset_options()
easy_unequip = true;
easy_butcher = true;
always_confirm_butcher = false;
+ list_rotten = false;
easy_confirm = CONFIRM_SAFE_EASY;
easy_quit_item_prompts = true;
hp_warning = 10;
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index e5b12df2ef..4a7237c0f2 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -4415,11 +4415,14 @@ void tile_use_item(int idx, InvAction act)
// Equipped?
bool equipped = false;
+ bool equipped_weapon = false;
for (unsigned int i=0; i< NUM_EQUIP;i++)
{
if (you.equip[i] == idx)
{
equipped = true;
+ if (i == EQ_WEAPON)
+ equipped_weapon = true;
break;
}
}
@@ -4428,7 +4431,11 @@ void tile_use_item(int idx, InvAction act)
// Special case for folks who are wielding something
// that they shouldn't be wielding.
- if (you.equip[EQ_WEAPON] == idx)
+ // Note that this is only a problem for equipables
+ // (otherwise it would only waste a turn)
+ if (you.equip[EQ_WEAPON] == idx
+ && (you.inv[idx].base_type == OBJ_ARMOUR
+ || you.inv[idx].base_type == OBJ_JEWELLERY))
{
if (!check_warning_inscriptions(you.inv[idx], OPER_WIELD))
return;
@@ -4437,6 +4444,7 @@ void tile_use_item(int idx, InvAction act)
return;
}
+
// Use it
switch (you.inv[idx].base_type)
{
@@ -4472,7 +4480,7 @@ void tile_use_item(int idx, InvAction act)
return;
case OBJ_ARMOUR:
- if (equipped)
+ if (equipped && !equipped_weapon)
{
if (!check_warning_inscriptions(you.inv[idx], OPER_TAKEOFF))
return;
@@ -4493,8 +4501,12 @@ void tile_use_item(int idx, InvAction act)
return;
case OBJ_CORPSES:
- if (you.species != SP_VAMPIRE)
+ if (you.species != SP_VAMPIRE
+ || you.inv[idx].sub_type == CORPSE_SKELETON
+ || you.inv[idx].special < 100)
+ {
break;
+ }
// intentional fall-through for Vampires
case OBJ_FOOD:
if (!check_warning_inscriptions(you.inv[idx], OPER_EAT))
@@ -4520,7 +4532,7 @@ void tile_use_item(int idx, InvAction act)
return;
case OBJ_JEWELLERY:
- if (equipped)
+ if (equipped && !equipped_weapon)
{
if (!check_warning_inscriptions(you.inv[idx], OPER_REMOVE))
return;
diff --git a/crawl-ref/source/libgui.cc b/crawl-ref/source/libgui.cc
index 68b49f4609..612042594e 100644
--- a/crawl-ref/source/libgui.cc
+++ b/crawl-ref/source/libgui.cc
@@ -23,6 +23,7 @@
#include "direct.h"
#include "files.h"
#include "itemname.h"
+#include "itemprop.h"
#include "items.h"
#include "externs.h"
#include "guic.h"
@@ -1072,10 +1073,11 @@ int convert_cursor_pos(int mx, int my, int *cx, int *cy)
for (r = w->regions.begin();r != w->regions.end();r++)
{
if (! (*r)->is_active()) continue;
- if( (*r)->mouse_pos(mx, my, cx, cy))
+
+ if ( (*r)->mouse_pos(mx, my, cx, cy))
{
id = (*r)->id;
- mx0 = (*r)->mx;
+ mx0 = (*r)->mx;
break;
}
}
@@ -1084,9 +1086,9 @@ int convert_cursor_pos(int mx, int my, int *cx, int *cy)
y = *cy;
/********************************************/
- if(id == REGION_TDNGN)
+ if (id == REGION_TDNGN)
{
- x--;
+ x--;
if (!in_viewport_bounds(x+1,y+1)) return REGION_NONE;
}
@@ -1098,8 +1100,8 @@ int convert_cursor_pos(int mx, int my, int *cx, int *cy)
if (id == REGION_INV1 || id == REGION_INV2)
{
- x = x + y * mx0;
- y = 0;
+ x = x + y * mx0;
+ y = 0;
}
if (id == REGION_DNGN)
@@ -1152,6 +1154,7 @@ static int handle_mouse_motion(int mouse_x, int mouse_y, bool init)
}
else
mode = convert_cursor_pos(mouse_x, mouse_y, &cx, &cy);
+
if (oldcx == cx && oldcy == cy && oldmode == mode) return 0;
// erase old cursor
@@ -1227,66 +1230,83 @@ static int handle_mouse_motion(int mouse_x, int mouse_y, bool init)
if (display_actions)
{
int type = you.inv[ix].base_type;
- if (type != OBJ_CORPSES || you.species == SP_VAMPIRE)
- desc += EOL "[L-Click] ";
+ desc += EOL;
+
+ if (type != OBJ_CORPSES
+ || you.species == SP_VAMPIRE
+ && you.inv[ix].sub_type != CORPSE_SKELETON
+ && you.inv[ix].special >= 100)
+ {
+ desc += "[L-Click] ";
- if (itemlist_iflag[cx] & TILEI_FLAG_EQUIP)
- type += 18;
+ if (itemlist_iflag[cx] & TILEI_FLAG_EQUIP)
+ {
+ if (you.equip[EQ_WEAPON] == ix)
+ {
+ if (type == OBJ_JEWELLERY || type == OBJ_ARMOUR
+ || type == OBJ_WEAPONS || type == OBJ_STAVES)
+ {
+ type = OBJ_WEAPONS + 18;
+ }
+ }
+ else
+ type += 18;
+ }
- switch (type)
- {
- case OBJ_WEAPONS:
- case OBJ_STAVES:
- desc += "*(w)ield";
- break;
- case OBJ_WEAPONS + 18:
- case OBJ_STAVES + 18:
- desc += "unwield";
- break;
- case OBJ_MISSILES:
- desc += "*(t)hrow";
- break;
- case OBJ_WANDS:
- desc += "*(z)ap";
- break;
- case OBJ_BOOKS:
- if (item_type_known(you.inv[ix])
- && you.inv[ix].sub_type != BOOK_MANUAL
- && you.inv[ix].sub_type != BOOK_DESTRUCTION)
+ switch (type)
{
- desc += "*(M)emorize";
+ // first equipable categories
+ case OBJ_WEAPONS:
+ case OBJ_STAVES:
+ desc += "*(w)ield";
+ break;
+ case OBJ_WEAPONS + 18:
+ case OBJ_STAVES + 18:
+ desc += "unwield";
+ break;
+ case OBJ_ARMOUR:
+ desc += "*(W)ear";
+ break;
+ case OBJ_ARMOUR + 18:
+ desc += "*(T)ake off";
+ break;
+ case OBJ_JEWELLERY:
+ desc += "*(P)ut on";
+ break;
+ case OBJ_JEWELLERY + 18:
+ desc += "*(R)emove";
break;
+ case OBJ_MISSILES:
+ desc += "*(t)hrow";
+ break;
+ case OBJ_WANDS:
+ desc += "*(z)ap";
+ break;
+ case OBJ_BOOKS:
+ if (item_type_known(you.inv[ix])
+ && you.inv[ix].sub_type != BOOK_MANUAL
+ && you.inv[ix].sub_type != BOOK_DESTRUCTION)
+ {
+ desc += "*(M)emorize";
+ break;
+ }
+ // else fall-through
+ case OBJ_SCROLLS:
+ desc += "*(r)ead";
+ break;
+ case OBJ_POTIONS:
+ desc += "*(q)uaff";
+ break;
+ case OBJ_FOOD:
+ desc += "*(e)at";
+ break;
+ case OBJ_CORPSES:
+ if (you.species == SP_VAMPIRE)
+ desc += "drink blood";
+ break;
+ default:
+ desc += "*Use it";
}
- // else fall-through
- case OBJ_SCROLLS:
- desc += "*(r)ead";
- break;
- case OBJ_JEWELLERY:
- desc += "*(P)ut on";
- break;
- case OBJ_JEWELLERY + 18:
- desc += "*(R)emove";
- break;
- case OBJ_POTIONS:
- desc += "*(q)uaff";
- break;
- case OBJ_ARMOUR:
- desc += "*(W)ear";
- break;
- case OBJ_ARMOUR + 18:
- desc += "*(T)ake off";
- break;
- case OBJ_FOOD:
- desc += "*(e)at";
- break;
- case OBJ_CORPSES:
- if (you.species == SP_VAMPIRE)
- desc += "drink blood";
- else // no action possible
- desc += EOL;
- break;
- default:
- desc += "*Use it";
}
desc += EOL "[R-Click] Info";
diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc
index a696d632af..a0a94ce98b 100644
--- a/crawl-ref/source/output.cc
+++ b/crawl-ref/source/output.cc
@@ -517,6 +517,12 @@ void print_stats(void)
cprintf( "Holy " );
}
+ if (you.duration[DUR_TELEPORT])
+ {
+ textcolor( LIGHTBLUE );
+ cprintf( "Tele " );
+ }
+
if (you.duration[DUR_DEFLECT_MISSILES])
{
@@ -1195,7 +1201,7 @@ void print_overview_screen()
const int relec = player_res_electricity(calc_unid);
const int rsust = player_sust_abil(calc_unid);
const int rmuta = wearing_amulet(AMU_RESIST_MUTATION, calc_unid)
- || you.religion == GOD_ZIN && you.piety >= 180
+ || you.religion == GOD_ZIN && you.piety >= 150
|| you.mutation[MUT_MUTATION_RESISTANCE] == 3;
const int rslow = wearing_amulet(AMU_RESIST_SLOW, calc_unid);
diff --git a/crawl-ref/source/tile1.cc b/crawl-ref/source/tile1.cc
index 4a9e999c12..7e5f51a304 100644
--- a/crawl-ref/source/tile1.cc
+++ b/crawl-ref/source/tile1.cc
@@ -3583,7 +3583,7 @@ void tile_place_monster(int gx, int gy, int idx, bool foreground)
{
return;
}
-
+
const coord_def gc(gx, gy);
const coord_def ep = view2show(grid2view(gc));
@@ -3592,8 +3592,25 @@ void tile_place_monster(int gx, int gy, int idx, bool foreground)
int flag = t & (~TILE_FLAG_MASK);
int mon_wep = menv[idx].inv[MSLOT_WEAPON];
- if (menv[idx].type >= MONS_DRACONIAN &&
- menv[idx].type <= MONS_DRACONIAN_SCORCHER)
+ if (menv[idx].type >= MONS_GOLD_MIMIC &&
+ menv[idx].type <= MONS_POTION_MIMIC)
+ {
+ const monsters *mon = &menv[idx];
+ if (!mons_is_known_mimic(mon))
+ {
+ item_def item;
+ get_mimic_item( mon, item );
+ if (item_needs_autopickup(item))
+ {
+ if (foreground)
+ env.tile_bg[ep.x-1][ep.y-1] |= TILE_FLAG_CURSOR3;
+ else
+ env.tile_bk_bg[gx][gy] |= TILE_FLAG_CURSOR3;
+ }
+ }
+ }
+ else if (menv[idx].type >= MONS_DRACONIAN &&
+ menv[idx].type <= MONS_DRACONIAN_SCORCHER)
{
int race = draco_subspecies(&menv[idx]);
int cls = menv[idx].type;