summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-03-10 16:11:24 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-03-10 16:11:24 +0000
commit9206d5f989a000bf928bbfc8d7bf0e64e7ce6ae3 (patch)
tree622b6aea498583bd87d3f9021465fe8cde0a7398 /crawl-ref/source
parentcdd916da064806bcc7da69efbb1b9cdc4ce818ad (diff)
downloadcrawl-ref-9206d5f989a000bf928bbfc8d7bf0e64e7ce6ae3.tar.gz
crawl-ref-9206d5f989a000bf928bbfc8d7bf0e64e7ce6ae3.zip
Add minor cosmetic fixes.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9407 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/beam.cc12
-rw-r--r--crawl-ref/source/fight.cc11
-rw-r--r--crawl-ref/source/hiscores.cc1
-rw-r--r--crawl-ref/source/ouch.cc4
-rw-r--r--crawl-ref/source/ouch.h1
-rw-r--r--crawl-ref/source/player.cc21
-rw-r--r--crawl-ref/source/player.h2
7 files changed, 25 insertions, 27 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 9dc223b63e..fe701dc282 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -3831,17 +3831,15 @@ void bolt::affect_player()
bool was_affected = false;
int old_hp = you.hp;
- hurted = std::max(hurted, 0);
+ hurted = std::max(0, hurted);
// If the beam is an actual missile or of the MMISSILE type (Earth magic)
// we might bleed on the floor.
if (!engulfs
&& (flavour == BEAM_MISSILE || flavour == BEAM_MMISSILE))
{
- int blood = hurted / 2; // assumes DVORP_PIERCING, factor: 0.5
- if (blood > you.hp)
- blood = you.hp;
-
+ // assumes DVORP_PIERCING, factor: 0.5
+ int blood = std::min(you.hp, hurted / 2);
bleed_onto_floor(you.pos(), -1, blood, true);
}
@@ -3865,8 +3863,8 @@ void bolt::affect_player()
// handling of missiles
if (item && item->base_type == OBJ_MISSILES)
{
- // SPMSL_POISONED handled via callback _poison_hit_victim() in
- // item_use.cc
+ // SPMSL_POISONED is handled via callback _poison_hit_victim()
+ // in item_use.cc.
if (item->sub_type == MI_THROWING_NET)
{
player_caught_in_net();
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index c2d54f9c7c..fe421df57b 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -4248,20 +4248,21 @@ void melee_attack::mons_do_napalm()
void melee_attack::wasp_paralyse_defender()
{
- // [dshaligram] Adopted 4.1.2's wasp mechanics, in slightly modified form.
+ // [dshaligram] Adopted 4.1.2's wasp mechanics, in slightly modified
+ // form.
if (attacker->id() == MONS_RED_WASP || one_chance_in(3))
- defender->poison( attacker, coinflip()? 2 : 1 );
+ defender->poison(attacker, coinflip() ? 2 : 1);
- int paralyse_roll = (damage_done > 4? 3 : 20);
+ int paralyse_roll = (damage_done > 4 ? 3 : 20);
if (attacker->id() == MONS_YELLOW_WASP)
paralyse_roll += 3;
if (defender->res_poison() <= 0)
{
if (one_chance_in(paralyse_roll))
- defender->paralyse( attacker, roll_dice(1, 3) );
+ defender->paralyse(attacker, roll_dice(1, 3));
else
- defender->slow_down( attacker, roll_dice(1, 3) );
+ defender->slow_down(attacker, roll_dice(1, 3));
}
}
diff --git a/crawl-ref/source/hiscores.cc b/crawl-ref/source/hiscores.cc
index 331d5ae67b..587b48741a 100644
--- a/crawl-ref/source/hiscores.cc
+++ b/crawl-ref/source/hiscores.cc
@@ -1776,7 +1776,6 @@ std::string scorefile_entry::death_description(death_desc_verbosity verbosity)
break;
}
-
if (oneline && desc.length() > 2)
desc[1] = tolower(desc[1]);
diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc
index 6c16582638..748c4c4443 100644
--- a/crawl-ref/source/ouch.cc
+++ b/crawl-ref/source/ouch.cc
@@ -262,7 +262,7 @@ void splash_with_acid(int acid_strength, bool corrode_items)
if (post_res_dam > 0)
{
- mpr( "The acid burns!" );
+ mpr("The acid burns!");
if (post_res_dam < dam)
canned_msg(MSG_YOU_RESIST);
@@ -285,7 +285,7 @@ void weapon_acid(int acid_strength)
ouch(roll_dice(1, acid_strength), NON_MONSTER, KILLED_BY_ACID);
}
else if (x_chance_in_y(acid_strength + 1, 20))
- _item_corrode( hand_thing );
+ _item_corrode(hand_thing);
}
void _item_corrode(int slot)
diff --git a/crawl-ref/source/ouch.h b/crawl-ref/source/ouch.h
index 29fb02de8d..ed9376b4a7 100644
--- a/crawl-ref/source/ouch.h
+++ b/crawl-ref/source/ouch.h
@@ -69,7 +69,6 @@ int actor_to_death_source(const actor* agent);
void ouch(int dam, int death_source, kill_method_type death_type,
const char *aux = NULL, bool see_source = true);
-
void lose_level(void);
bool drain_exp(bool announce_full = true);
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 3ea824aae0..972af81dd5 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -2744,20 +2744,21 @@ int player_sust_abil(bool calc_unid)
{
int sa = 0;
- sa += player_equip( EQ_RINGS, RING_SUSTAIN_ABILITIES, calc_unid );
+ sa += player_equip(EQ_RINGS, RING_SUSTAIN_ABILITIES, calc_unid);
- return sa;
-} // end player_sust_abil()
+ return (sa);
+}
-int carrying_capacity( burden_state_type bs )
+int carrying_capacity(burden_state_type bs)
{
int cap = 3500 + (you.strength * 100) + (player_is_airborne() ? 1000 : 0);
- if ( bs == BS_UNENCUMBERED )
- return (cap * 5) / 6;
- else if ( bs == BS_ENCUMBERED )
- return (cap * 11) / 12;
+
+ if (bs == BS_UNENCUMBERED)
+ return ((cap * 5) / 6);
+ else if (bs == BS_ENCUMBERED)
+ return ((cap * 11) / 12);
else
- return cap;
+ return (cap);
}
int burden_change(void)
@@ -6911,9 +6912,9 @@ int player::hurt(const actor *agent, int amount, beam_type flavour,
bool cleanup_dead)
{
// We ignore cleanup_dead here.
- const monsters *mon = dynamic_cast<const monsters*>(agent);
if (agent->atype() == ACT_MONSTER)
{
+ const monsters *mon = dynamic_cast<const monsters*>(agent);
ouch(amount, mon->mindex(),
KILLED_BY_MONSTER, "", player_monster_visible(mon));
}
diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h
index bc214b322a..751c7189df 100644
--- a/crawl-ref/source/player.h
+++ b/crawl-ref/source/player.h
@@ -99,7 +99,7 @@ int burden_change(void);
/* ***********************************************************************
* called from: items - misc
* *********************************************************************** */
-int carrying_capacity( burden_state_type bs = BS_OVERLOADED );
+int carrying_capacity(burden_state_type bs = BS_OVERLOADED);
/* ***********************************************************************