summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-26 11:27:16 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-26 11:27:16 +0000
commit12fa7099be089e42c8e1640eb9ac2c3c6afa97a2 (patch)
treeb472b93a2035f3911289478d7577716d7492990a /crawl-ref/source
parent32e72edca686ce0f32d70c6418055fe14d5bd248 (diff)
downloadcrawl-ref-12fa7099be089e42c8e1640eb9ac2c3c6afa97a2.tar.gz
crawl-ref-12fa7099be089e42c8e1640eb9ac2c3c6afa97a2.zip
Removed hard tabs.
Corrected sling bullet description. Targeting forward wrap-around was broken, fixed. Dropped damage bonus for kenku clawed-kick. Don't show {tried} for equipped items. Removed Elyvilon's protection from high-damage hits even when not praying. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2207 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/beam.cc1
-rw-r--r--crawl-ref/source/describe.cc2
-rw-r--r--crawl-ref/source/direct.cc18
-rw-r--r--crawl-ref/source/dungeon.cc8
-rw-r--r--crawl-ref/source/fight.cc3
-rw-r--r--crawl-ref/source/it_use2.cc2
-rw-r--r--crawl-ref/source/itemname.cc8
-rw-r--r--crawl-ref/source/mon-util.cc5
-rw-r--r--crawl-ref/source/mutation.cc2
-rw-r--r--crawl-ref/source/newgame.cc6
-rw-r--r--crawl-ref/source/ouch.cc19
-rw-r--r--crawl-ref/source/player.cc2
-rw-r--r--crawl-ref/source/tutorial.cc2
-rw-r--r--crawl-ref/source/view.cc2
-rw-r--r--crawl-ref/source/xom.cc2
15 files changed, 40 insertions, 42 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 7d41d5fbce..6f7a05273e 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -2690,7 +2690,6 @@ static int affect_wall(bolt &beam, int x, int y)
{
beogh_idol_revenge();
}
-
beam.obvious_effect = 1;
}
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index e2a740d323..e66dcc0a5d 100644
--- a/crawl-ref/source/describe.cc
+++ b/crawl-ref/source/describe.cc
@@ -1373,7 +1373,7 @@ static std::string describe_ammo( const item_def &item )
break;
case MI_SLING_BULLET:
description += "A small heavy projectile made of lead. "
- "It can be fired with a sling, or thrown by hand.";
+ "It can be fired from a sling.";
break;
case MI_JAVELIN:
description += "A long, light polearm that can be thrown by hand. ";
diff --git a/crawl-ref/source/direct.cc b/crawl-ref/source/direct.cc
index fb2884c267..7f4104878f 100644
--- a/crawl-ref/source/direct.cc
+++ b/crawl-ref/source/direct.cc
@@ -993,6 +993,10 @@ bool in_los(int x, int y)
static bool find_monster( int x, int y, int mode )
{
const int targ_mon = mgrd[ x ][ y ];
+ if ((mode == TARG_FRIEND || mode == TARG_ANY)
+ && x == you.x_pos && y == you.y_pos)
+ return (true);
+
return (targ_mon != NON_MONSTER
&& in_los(x, y)
&& player_monster_visible( &(menv[targ_mon]) )
@@ -1158,24 +1162,22 @@ static char find_square( int xps, int yps,
ctrx = vyou.x, ctry = vyou.y;
while (temp_xps >= minx - 1 && temp_xps <= maxx
- && temp_yps <= maxy && temp_yps >= miny - 1)
+ && temp_yps <= maxy && temp_yps >= miny - 1)
{
if (direction == 1 && temp_xps == minx && temp_yps == maxy)
{
- if (mode == TARG_ANY || mode == TARG_FRIEND)
+ if (find_targ(you.x_pos, you.y_pos, mode))
{
- mfp[0] = vyou.x;
- mfp[1] = vyou.y;
+ mfp[0] = ctrx;
+ mfp[1] = ctry;
return (1);
}
return find_square(ctrx, ctry, mfp, direction, find_targ, mode,
- false, next_los(direction, los, wrap));
+ false, next_los(direction, los, wrap));
}
if (direction == -1 && temp_xps == ctrx && temp_yps == ctry)
- {
return find_square(minx, maxy, mfp, direction, find_targ, mode,
- false, next_los(direction, los, wrap));
- }
+ false, next_los(direction, los, wrap));
if (direction == 1)
{
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index e96d23fc1e..040fa54c7c 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -6959,8 +6959,8 @@ static void build_river( dungeon_feature_type river_type ) //mv
// lava and deep water grids. -- bwr
if (!one_chance_in(200)
&& (grd[i][j] < DNGN_ENTER_SHOP
- || grd[i][j] > DNGN_EXIT_PORTAL_VAULT)
- && grd[i][j] != DNGN_EXIT_HELL // just to be safe
+ || grd[i][j] > DNGN_EXIT_PORTAL_VAULT)
+ && grd[i][j] != DNGN_EXIT_HELL // just to be safe
&& mgrd[i][j] == NON_MONSTER
&& igrd[i][j] == NON_ITEM)
{
@@ -7025,8 +7025,8 @@ static void build_lake(dungeon_feature_type lake_type) //mv
// on lava and deep water grids. -- bwr
if (!one_chance_in(200)
&& (grd[i][j] < DNGN_ENTER_SHOP
- || grd[i][j] > DNGN_EXIT_PORTAL_VAULT)
- && grd[i][j] != DNGN_EXIT_HELL // just to be safe
+ || grd[i][j] > DNGN_EXIT_PORTAL_VAULT)
+ && grd[i][j] != DNGN_EXIT_HELL // just to be safe
&& mgrd[i][j] == NON_MONSTER
&& igrd[i][j] == NON_ITEM)
{
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index 821120b0eb..b56720a117 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -644,7 +644,8 @@ bool melee_attack::player_aux_unarmed()
else
unarmed_attack = "kick";
- aux_damage = ((you.mutation[MUT_HOOVES] || clawed_kick) ? 10 : 5);
+ aux_damage = (you.mutation[MUT_HOOVES] ? 10
+ : clawed_kick ? 8 : 5);
break;
}
diff --git a/crawl-ref/source/it_use2.cc b/crawl-ref/source/it_use2.cc
index d370aae720..e313767cf9 100644
--- a/crawl-ref/source/it_use2.cc
+++ b/crawl-ref/source/it_use2.cc
@@ -350,7 +350,7 @@ bool potion_effect( potion_type pot_eff, int pow )
mpr("You feel protected.");
you.duration[DUR_RESIST_FIRE] += random2(pow) + 10;
you.duration[DUR_RESIST_COLD] += random2(pow) + 10;
- you.duration[DUR_RESIST_POISON] += random2(pow) + 10;
+ you.duration[DUR_RESIST_POISON] += random2(pow) + 10;
you.duration[DUR_INSULATION] += random2(pow) + 10;
// one contamination point for each resist
contaminate_player(4);
diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc
index 1cc95497dd..accf5cf071 100644
--- a/crawl-ref/source/itemname.cc
+++ b/crawl-ref/source/itemname.cc
@@ -181,6 +181,7 @@ std::string item_def::name(description_level_type descrip,
buff << auxname;
+ bool equipped = false;
if (descrip == DESC_INVENTORY_EQUIP && this->x == -1 && this->y == -1)
{
ASSERT( this->link != -1 );
@@ -196,6 +197,7 @@ std::string item_def::name(description_level_type descrip,
{
buff << " (in hand)";
}
+ equipped = true;
}
else if (this->link == you.equip[EQ_CLOAK]
|| this->link == you.equip[EQ_HELMET]
@@ -205,22 +207,26 @@ std::string item_def::name(description_level_type descrip,
|| this->link == you.equip[EQ_BODY_ARMOUR])
{
buff << " (worn)";
+ equipped = true;
}
else if (this->link == you.equip[EQ_LEFT_RING])
{
buff << " (left hand)";
+ equipped = true;
}
else if (this->link == you.equip[EQ_RIGHT_RING])
{
buff << " (right hand)";
+ equipped = true;
}
else if (this->link == you.equip[EQ_AMULET])
{
buff << " (around neck)";
+ equipped = true;
}
}
- const bool tried = (!ident && item_type_tried(*this));
+ const bool tried = (!ident && !equipped && item_type_tried(*this));
std::string tried_str = "";
if (tried)
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 8246b685dd..7f7428f023 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -1742,8 +1742,8 @@ bool mons_is_paralysed(const monsters *m)
bool mons_is_confused(const monsters *m)
{
- return (m->has_ench(ENCH_CONFUSION) &&
- !mons_class_flag(m->type, M_CONFUSED));
+ return (m->has_ench(ENCH_CONFUSION)
+ && !mons_class_flag(m->type, M_CONFUSED));
}
bool mons_is_caught(const monsters *m)
@@ -5192,4 +5192,3 @@ std::string get_mon_shape_str(const mon_body_shape shape)
return (shape_names[shape]);
}
-
diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc
index fab48702d4..1cc7b19b33 100644
--- a/crawl-ref/source/mutation.cc
+++ b/crawl-ref/source/mutation.cc
@@ -1320,7 +1320,7 @@ bool mutate(mutation_type which_mutation, bool failMsg, bool force_mutation,
rot_hp( roll_dice( 1, 3 ) );
}
- xom_is_stimulated(64);
+ xom_is_stimulated(64);
return (true);
}
diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc
index 65a915bfdb..082dad4752 100644
--- a/crawl-ref/source/newgame.cc
+++ b/crawl-ref/source/newgame.cc
@@ -2397,8 +2397,8 @@ static void give_random_potion( int slot )
{
// Mummies can't quaff and don't care
if (you.species == SP_MUMMY)
- return;
-
+ return;
+
you.inv[ slot ].quantity = 1;
you.inv[ slot ].base_type = OBJ_POTIONS;
you.inv[ slot ].plus = 0;
@@ -2406,7 +2406,7 @@ static void give_random_potion( int slot )
int temp_rand = 8;
if (you.is_undead)
- temp_rand--;
+ temp_rand--;
switch (random2(temp_rand))
{
diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc
index b388b4e500..ebfb0d2b7a 100644
--- a/crawl-ref/source/ouch.cc
+++ b/crawl-ref/source/ouch.cc
@@ -760,7 +760,7 @@ void ouch( int dam, int death_source, kill_method_type death_type,
case GOD_ELYVILON:
case GOD_YREDELEMNUL:
if (dam >= you.hp && you.duration[DUR_PRAYER]
- && random2(you.piety) >= 30)
+ && random2(you.piety) >= 30)
{
simple_god_message( " protects you from harm!" );
return;
@@ -771,22 +771,12 @@ void ouch( int dam, int death_source, kill_method_type death_type,
}
+ dec_hp( dam, true );
+
// Even if we have low HP messages off, we'll still give a
// big hit warning (in this case, a hit for half our HPs) -- bwr
if (dam > 0 && you.hp_max <= dam * 2)
- {
- if (you.religion == GOD_ELYVILON && one_chance_in(3))
- {
- simple_god_message( " shields you from harm!" );
- return;
- }
- // Damage applied here:
- dec_hp( dam, true );
mpr( "Ouch! That really hurt!", MSGCH_DANGER );
- }
- else
- dec_hp( dam, true );
-
if (you.hp > 0)
{
@@ -807,7 +797,8 @@ void ouch( int dam, int death_source, kill_method_type death_type,
}
else
{
- damage_desc = scorefile_entry(dam, death_source, death_type, aux, true)
+ damage_desc = scorefile_entry(dam, death_source,
+ death_type, aux, true)
.death_description(scorefile_entry::DDV_TERSE);
}
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index ba5465dbc7..780a48d945 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -1346,7 +1346,7 @@ int player_spec_death()
}
else if (you.species == SP_VAMPIRE)
{
- // Vampires get bonus only when not hungry
+ // Vampires get bonus only when not hungry
if (you.experience_level >= 13 && you.hunger_state > HS_HUNGRY)
{
sd++;
diff --git a/crawl-ref/source/tutorial.cc b/crawl-ref/source/tutorial.cc
index d35efb4ba4..efde782355 100644
--- a/crawl-ref/source/tutorial.cc
+++ b/crawl-ref/source/tutorial.cc
@@ -1167,7 +1167,7 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y)
case TUT_SEEN_DOOR:
if (you.num_turns < 1)
- return;
+ return;
text << "The <w>" << stringize_glyph(get_screen_glyph(x,y))
<< "<magenta> is a closed door. You can open it by walking into it. "
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index 2ffddb5d96..7f1aa99ea9 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -563,7 +563,7 @@ screen_buffer_t colour_code_map( int x, int y, bool item_colour,
tc |= COLFLAG_STAIR_ITEM;
}
else if (Options.trap_item_brand
- && grid_is_trap(grid_value) && igrd[x][y] != NON_ITEM)
+ && grid_is_trap(grid_value) && igrd[x][y] != NON_ITEM)
{
tc |= COLFLAG_TRAP_ITEM;
}
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc
index 7a51f3eda0..8293fc4925 100644
--- a/crawl-ref/source/xom.cc
+++ b/crawl-ref/source/xom.cc
@@ -92,7 +92,7 @@ static const char *xom_generic_beneficence[] =
const char *describe_xom_favour()
{
- return (you.piety > 160) ? "A beloved toy of Xom." :
+ return (you.piety > 160) ? "A beloved toy of Xom." :
(you.piety > 145) ? "A favorite toy of Xom." :
(you.piety > 130) ? "A very special toy of Xom." :
(you.piety > 115) ? "A special toy of Xom." :