summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/acr.cc5
-rw-r--r--crawl-ref/source/items.cc2
-rw-r--r--crawl-ref/source/ouch.cc4
-rw-r--r--crawl-ref/source/religion.cc13
-rw-r--r--crawl-ref/source/shopping.cc6
5 files changed, 15 insertions, 15 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index 166c029f5c..d813caf12a 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -2410,7 +2410,7 @@ void process_command( command_type cmd )
case CMD_LIST_GOLD:
mprf("You have %d gold piece%s.",
- you.gold, (you.gold > 1) ? "s" : "");
+ you.gold, you.gold > 1 ? "s" : "");
break;
case CMD_INSCRIBE_ITEM:
@@ -2857,12 +2857,11 @@ static void _decrement_durations()
#if DEBUG_DIAGNOSTICS || DEBUG_SACRIFICE || DEBUG_PIETY
mpr("Piety increases by 1 due to piety pool.", MSGCH_DIAGNOSTICS);
- if (!you.duration[DUR_PIETY_POOL])
+ if (you.duration[DUR_PIETY_POOL] == 0)
mpr("Piety pool is now empty.", MSGCH_DIAGNOSTICS);
#endif
}
-
if (!you.permanent_levitation() && !you.permanent_flight())
{
if (_decrement_a_duration(DUR_LEVITATION,
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc
index 39d74eb2af..1675ec0c9b 100644
--- a/crawl-ref/source/items.cc
+++ b/crawl-ref/source/items.cc
@@ -1500,7 +1500,7 @@ int move_item_to_player( int obj, int quant_got, bool quiet )
if (!quiet)
{
mprf("You now have %d gold piece%s.",
- you.gold, (you.gold > 1) ? "s" : "");
+ you.gold, you.gold > 1 ? "s" : "");
}
learned_something_new(TUT_SEEN_GOLD);
diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc
index 078d80be82..8d797a1e31 100644
--- a/crawl-ref/source/ouch.cc
+++ b/crawl-ref/source/ouch.cc
@@ -607,8 +607,8 @@ void expose_player_to_element(beam_type flavour, int strength)
void lose_level()
{
- // Because you.experience is unsigned long, if it's going to be -ve
- // must die straightaway.
+ // Because you.experience is unsigned long, if it's going to be
+ // negative, must die straightaway.
if (you.experience_level == 1)
{
ouch(INSTANT_DEATH, NON_MONSTER, KILLED_BY_DRAINING);
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 432f04656b..2549754bf5 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -2440,7 +2440,7 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known,
switch (you.religion)
{
case GOD_ELYVILON: // healer god cares more about this
- if (you.penance[GOD_ELYVILON])
+ if (player_under_penance())
penance = 1; // if already under penance smaller bonus
else
penance = level;
@@ -5715,7 +5715,7 @@ void offer_items()
// donate gold to gain piety distributed over time
if (you.religion == GOD_ZIN)
{
- if (!you.gold)
+ if (you.gold == 0)
{
mpr("You don't have anything to sacrifice.");
return;
@@ -5724,7 +5724,8 @@ void offer_items()
if (!yesno("Do you wish to part with all of your money?", true, 'n'))
return;
- const int donation_value = (int) (you.gold/200 * log((double)you.gold));
+ const int donation_value =
+ (int)(you.gold / MAX_PIETY * log((double)you.gold));
#if DEBUG_DIAGNOSTICS || DEBUG_SACRIFICE || DEBUG_PIETY
mprf(MSGCH_DIAGNOSTICS, "A donation of $%d amounts to an "
"increase of piety by %d.", you.gold, donation_value);
@@ -5741,13 +5742,13 @@ void offer_items()
return;
}
- const int estimated_piety = you.piety + donation_value;
-
you.duration[DUR_PIETY_POOL] += donation_value;
if (you.duration[DUR_PIETY_POOL] > 500)
you.duration[DUR_PIETY_POOL] = 500;
- if (you.penance[GOD_ZIN])
+ const int estimated_piety = you.piety + you.duration[DUR_PIETY_POOL];
+
+ if (player_under_penance())
{
if (estimated_piety >= you.penance[GOD_ZIN])
mpr("You feel that you will soon be absolved of all your sins.");
diff --git a/crawl-ref/source/shopping.cc b/crawl-ref/source/shopping.cc
index e341a49aca..be23d980cd 100644
--- a/crawl-ref/source/shopping.cc
+++ b/crawl-ref/source/shopping.cc
@@ -283,7 +283,7 @@ static void _in_a_shop( int shopidx )
if (!total_cost)
{
snprintf( info, INFO_SIZE, "You have %d gold piece%s.", you.gold,
- (you.gold == 1) ? "" : "s" );
+ you.gold == 1 ? "" : "s" );
textcolor(YELLOW);
}
@@ -292,7 +292,7 @@ static void _in_a_shop( int shopidx )
snprintf( info, INFO_SIZE, "You now have %d gold piece%s. "
"You are short %d gold piece%s for the purchase.",
you.gold,
- (you.gold == 1) ? "" : "s",
+ you.gold == 1 ? "" : "s",
total_cost - you.gold,
(total_cost - you.gold == 1) ? "" : "s" );
@@ -303,7 +303,7 @@ static void _in_a_shop( int shopidx )
snprintf( info, INFO_SIZE, "You now have %d gold piece%s. "
"After the purchase, you will have %d gold piece%s.",
you.gold,
- (you.gold == 1) ? "" : "s",
+ you.gold == 1 ? "" : "s",
you.gold - total_cost,
(you.gold - total_cost == 1) ? "" : "s" );