summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-16 17:11:06 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-16 17:11:06 +0000
commitb8ba267261e0586c01fad1c5f280d1fd16cd44ca (patch)
treedad33a9139ffe9c7bba93005f95f053e8a939340
parent5a01c6b4c075124a30e6ede371ba74bc58b504f8 (diff)
downloadcrawl-ref-b8ba267261e0586c01fad1c5f280d1fd16cd44ca.tar.gz
crawl-ref-b8ba267261e0586c01fad1c5f280d1fd16cd44ca.zip
FR 1836617: Add item brand for plants (and mimics) in Tiles.
FR 1870291: Give a message when gaining exp for killing monsters outside LOS. (This is something the player can find out by checking their xp pool, anyway, so it's not like it gives anything away. Currently does not happen for pet kills, should it?) Implement 1829910: Make Daevas fully resist negative energy, with the reasoning that TSO will protect them. Also, fix dragon slaying to actually have an effect on draconian players (whoops!) as well as on characters in Dragon Form. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3282 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/direct.cc32
-rw-r--r--crawl-ref/source/direct.h6
-rw-r--r--crawl-ref/source/fight.cc4
-rw-r--r--crawl-ref/source/item_use.cc1
-rw-r--r--crawl-ref/source/luadgn.cc4
-rw-r--r--crawl-ref/source/mon-util.cc5
-rw-r--r--crawl-ref/source/mon-util.h2
-rw-r--r--crawl-ref/source/monstuff.cc8
-rw-r--r--crawl-ref/source/player.cc6
-rw-r--r--crawl-ref/source/tile1.cc20
10 files changed, 62 insertions, 26 deletions
diff --git a/crawl-ref/source/direct.cc b/crawl-ref/source/direct.cc
index 8a0774ba25..7080b81dbe 100644
--- a/crawl-ref/source/direct.cc
+++ b/crawl-ref/source/direct.cc
@@ -1469,7 +1469,9 @@ void describe_floor()
break;
}
- feat = feature_description(you.x_pos, you.y_pos, DESC_NOCAP_A, false);
+ feat = feature_description(you.x_pos, you.y_pos,
+ is_bloodcovered(you.x_pos, you.y_pos),
+ DESC_NOCAP_A, false);
if (feat.empty())
return;
@@ -1528,11 +1530,14 @@ static std::string feature_do_grammar(description_level_type dtype,
}
std::string feature_description(dungeon_feature_type grid,
- trap_type trap,
+ trap_type trap, bool bloody,
description_level_type dtype,
bool add_stop)
{
std::string desc = raw_feature_description(grid, trap);
+ if (bloody)
+ desc += ", spattered with blood";
+
return feature_do_grammar(dtype, add_stop, grid_is_trap(grid), desc);
}
@@ -1782,8 +1787,8 @@ static bool interesting_feature(dungeon_feature_type feat)
}
#endif
-std::string feature_description(int mx, int my, description_level_type dtype,
- bool add_stop)
+std::string feature_description(int mx, int my, bool bloody,
+ description_level_type dtype, bool add_stop)
{
dungeon_feature_type grid = grd[mx][my];
if ( grid == DNGN_SECRET_DOOR )
@@ -1794,7 +1799,7 @@ std::string feature_description(int mx, int my, description_level_type dtype,
case DNGN_TRAP_MECHANICAL:
case DNGN_TRAP_MAGICAL:
case DNGN_TRAP_NATURAL:
- return (feature_description(grid, trap_type_at_xy(mx, my),
+ return (feature_description(grid, trap_type_at_xy(mx, my), bloody,
dtype, add_stop));
case DNGN_ENTER_SHOP:
return (shop_name(mx, my, add_stop));
@@ -1804,7 +1809,7 @@ std::string feature_description(int mx, int my, description_level_type dtype,
dtype, add_stop, false,
marker_feature_description(coord_def(mx, my))));
default:
- return (feature_description(grid, NUM_TRAPS, dtype, add_stop));
+ return (feature_description(grid, NUM_TRAPS, bloody, dtype, add_stop));
}
}
@@ -2124,7 +2129,11 @@ static void describe_cell(int mx, int my)
item_described = true;
}
- std::string feature_desc = feature_description(mx, my);
+ bool bloody = false;
+ if (is_bloodcovered(mx, my))
+ bloody = true;
+
+ std::string feature_desc = feature_description(mx, my, bloody);
#ifdef DEBUG_DIAGNOSTICS
std::string marker;
if (map_marker *mark = env.markers.find(coord_def(mx, my), MAT_ANY))
@@ -2148,8 +2157,6 @@ static void describe_cell(int mx, int my)
if (Options.tutorial_left && tutorial_feat_interesting(grd[mx][my]))
{
feature_desc += " (Press <w>v<lightgray> for more information.)";
- if (is_bloodcovered(mx, my))
- feature_desc += EOL "It is spattered with blood.";
print_formatted_paragraph(feature_desc, get_number_of_cols());
}
@@ -2160,13 +2167,6 @@ static void describe_cell(int mx, int my)
if (interesting_feature(feat))
feature_desc += " (Press 'v' for more information.)";
- bool bloody = false;
- if (is_bloodcovered(mx, my))
- {
- feature_desc += EOL "It is spattered with blood.";
- bloody = true;
- }
-
// Suppress "Floor." if there's something on that square that we've
// already described.
if ((feat == DNGN_FLOOR || feat == DNGN_FLOOR_SPECIAL) && !bloody
diff --git a/crawl-ref/source/direct.h b/crawl-ref/source/direct.h
index 839b84ebe9..125b045ad1 100644
--- a/crawl-ref/source/direct.h
+++ b/crawl-ref/source/direct.h
@@ -168,13 +168,13 @@ std::string get_monster_desc(const monsters *mon,
int dos_direction_unmunge(int doskey);
-std::string feature_description(int mx, int my,
+std::string feature_description(int mx, int my, bool bloody = false,
description_level_type dtype = DESC_CAP_A,
bool add_stop = true);
std::string raw_feature_description(dungeon_feature_type grid,
trap_type tr = NUM_TRAPS);
-std::string feature_description(dungeon_feature_type grid,
- trap_type trap = NUM_TRAPS,
+std::string feature_description(dungeon_feature_type grid,
+ trap_type trap = NUM_TRAPS, bool bloody = false,
description_level_type dtype = DESC_CAP_A,
bool add_stop = true);
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index da37438439..bec559af46 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -1969,7 +1969,9 @@ bool melee_attack::apply_damage_brand()
case SPWPN_DRAGON_SLAYING:
if (mons_genus(defender->mons_species()) == MONS_DRAGON
- || mons_genus(defender->mons_species()) == MONS_DRACONIAN)
+ || mons_genus(defender->mons_species()) == MONS_DRACONIAN
+ || defender->atype() == ACT_PLAYER
+ && you.attribute[ATTR_TRANSFORMATION] == TRAN_DRAGON)
{
special_damage = 1 + random2(3*damage_done/2);
if (defender_visible)
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 653637897e..b9742dec0a 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -514,6 +514,7 @@ void wield_effects(int item_wield_2, bool showMsgs)
case SPWPN_DRAGON_SLAYING:
mpr(player_genus(GENPC_DRACONIAN)
+ || you.attribute[ATTR_TRANSFORMATION] == TRAN_DRAGON
? "You feel a sudden desire to commit suicide."
: "You feel a sudden desire to slay dragons!");
break;
diff --git a/crawl-ref/source/luadgn.cc b/crawl-ref/source/luadgn.cc
index da053fb639..3e41a0b07c 100644
--- a/crawl-ref/source/luadgn.cc
+++ b/crawl-ref/source/luadgn.cc
@@ -1275,7 +1275,7 @@ static int dgn_feature_desc(lua_State *ls)
description_type_by_name(lua_tostring(ls, 2));
const bool need_stop = lua_isboolean(ls, 3)? lua_toboolean(ls, 3) : false;
const std::string s =
- feature_description(feat, NUM_TRAPS, dtype, need_stop);
+ feature_description(feat, NUM_TRAPS, false, dtype, need_stop);
lua_pushstring(ls, s.c_str());
return (1);
}
@@ -1288,7 +1288,7 @@ static int dgn_feature_desc_at(lua_State *ls)
description_type_by_name(lua_tostring(ls, 3));
const bool need_stop = lua_isboolean(ls, 4)? lua_toboolean(ls, 4) : false;
const std::string s =
- feature_description(luaL_checkint(ls, 1), luaL_checkint(ls, 2),
+ feature_description(luaL_checkint(ls, 1), luaL_checkint(ls, 2), false,
dtype, need_stop);
lua_pushstring(ls, s.c_str());
return (1);
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index f74b9c364a..dff1759555 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -1016,12 +1016,15 @@ int mons_res_negative_energy( const monsters *mon )
|| mons_holiness(mon) == MH_NONLIVING
|| mons_holiness(mon) == MH_PLANT
|| mon->type == MONS_SHADOW_DRAGON
- || mon->type == MONS_DEATH_DRAKE)
+ || mon->type == MONS_DEATH_DRAKE
+ // TSO protects his warriors' life force
+ || mon->type == MONS_DAEVA)
{
return (3); // to match the value for players
}
int u = 0;
+
if (mons_itemuse(mc) >= MONUSE_STARTING_EQUIPMENT)
{
diff --git a/crawl-ref/source/mon-util.h b/crawl-ref/source/mon-util.h
index e070e675b7..159fa60337 100644
--- a/crawl-ref/source/mon-util.h
+++ b/crawl-ref/source/mon-util.h
@@ -176,7 +176,7 @@ enum mon_resist_flags
// resistances
// Notes:
- // - negative energy is mostly handled via mons_has_life_force()
+ // - negative energy is mostly handled via mons_res_negative_energy()
// - acid is handled mostly by genus (jellies) plus non-living
// - asphyx-resistance replaces hellfrost resistance.
MR_RES_ELEC = (1<< 0),
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 2f663aeeac..a557e30d41 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -404,7 +404,13 @@ static void give_adjusted_experience(monsters *monster, killer_type killer,
if (created_friendly)
; // No experience if monster was created friendly
else if (YOU_KILL(killer))
+ {
+ int old_lev = you.experience_level;
gain_exp( experience, exp_gain, avail_gain );
+ // Give a message for monsters dying out of sight
+ if (exp_gain > 0 && !mons_near(monster) && you.experience_level == old_lev)
+ mpr("You feel a bit more experienced.");
+ }
else if (pet_kill)
gain_exp( experience / 2 + 1, exp_gain, avail_gain );
@@ -969,7 +975,7 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent)
if (monster->type == MONS_SIMULACRUM_SMALL
|| monster->type == MONS_SIMULACRUM_LARGE)
{
- simple_monster_message( monster, " vaporises!" );
+ simple_monster_message( monster, " vapourises!" );
place_cloud( CLOUD_COLD, monster->x, monster->y,
1 + random2(3), monster->kill_alignment() );
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 056ed3a3c2..1bf82f069e 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -164,7 +164,7 @@ bool move_player_to_grid( int x, int y, bool stepped, bool allow_shift,
"onto" : "into");
prompt += " that ";
prompt += feature_description(new_grid, trap_type_at_xy(x,y),
- DESC_BASENAME, false);
+ false, DESC_BASENAME, false);
prompt += '?';
// Zot traps require capital confirmation
@@ -6067,6 +6067,9 @@ bool player::travelling_light() const
int player::mons_species() const
{
+ if (player_genus(GENPC_DRACONIAN))
+ return (MONS_DRACONIAN);
+
switch (species)
{
case SP_HILL_ORC:
@@ -6074,6 +6077,7 @@ int player::mons_species() const
case SP_HIGH_ELF: case SP_GREY_ELF:
case SP_DEEP_ELF: case SP_SLUDGE_ELF:
return (MONS_ELF);
+
default:
return (MONS_HUMAN);
}
diff --git a/crawl-ref/source/tile1.cc b/crawl-ref/source/tile1.cc
index a95d7a9d41..52337dbee7 100644
--- a/crawl-ref/source/tile1.cc
+++ b/crawl-ref/source/tile1.cc
@@ -3625,6 +3625,15 @@ void tile_place_monster(int gx, int gy, int idx, bool foreground)
const monsters *mon = &menv[idx];
if (!mons_is_known_mimic(mon))
{
+ // if necessary add item brand
+ if (igrd[gx][gy] != NON_ITEM)
+ {
+ if (foreground)
+ t |= TILE_FLAG_S_UNDER;
+ else
+ t0 |= TILE_FLAG_S_UNDER;
+ }
+
item_def item;
get_mimic_item( mon, item );
if (item_needs_autopickup(item))
@@ -3636,6 +3645,17 @@ void tile_place_monster(int gx, int gy, int idx, bool foreground)
}
}
}
+ else if (menv[idx].holiness() == MH_PLANT)
+ {
+ // if necessary add item brand
+ if (igrd[gx][gy] != NON_ITEM)
+ {
+ if (foreground)
+ t |= TILE_FLAG_S_UNDER;
+ else
+ t0 |= TILE_FLAG_S_UNDER;
+ }
+ }
else if (menv[idx].type >= MONS_DRACONIAN &&
menv[idx].type <= MONS_DRACONIAN_SCORCHER)
{