summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/describe.cc42
-rw-r--r--crawl-ref/source/fight.cc2
-rw-r--r--crawl-ref/source/item_use.cc2
-rw-r--r--crawl-ref/source/randart.cc16
-rw-r--r--crawl-ref/source/religion.cc36
-rw-r--r--crawl-ref/source/shopping.cc11
6 files changed, 61 insertions, 48 deletions
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index 8e42a94f09..eeadefbbd3 100644
--- a/crawl-ref/source/describe.cc
+++ b/crawl-ref/source/describe.cc
@@ -315,7 +315,7 @@ static std::vector<std::string> _randart_propnames( const item_def& item )
&& item_ident(item, ISFLAG_KNOW_PROPERTIES))
{
const std::string type = jewellery_base_ability_string(item.sub_type);
- if ( !type.empty() )
+ if (!type.empty())
propnames.push_back(type);
}
else if (item.base_type == OBJ_WEAPONS
@@ -324,22 +324,23 @@ static std::vector<std::string> _randart_propnames( const item_def& item )
std::string ego = weapon_brand_name(item, true);
if (!ego.empty())
{
- // ugly hack to remove the brackets...
- ego = ego.substr(2, ego.length()-3);
+ // XXX: Ugly hack to remove the brackets...
+ ego = ego.substr(2, ego.length() - 3);
- // and another one for adding a comma if needed
- for ( unsigned i = 0; i < ARRAYSZ(propanns); ++i )
- if (known_proprt(propanns[i].prop))
- {
- ego += ",";
- break;
- }
+ // ... and another one for adding a comma if needed.
+ for (unsigned i = 0; i < ARRAYSZ(propanns); ++i)
+ if (known_proprt(propanns[i].prop)
+ && propanns[i].prop != RAP_BRAND)
+ {
+ ego += ",";
+ break;
+ }
propnames.push_back(ego);
}
}
- for ( unsigned i = 0; i < ARRAYSZ(propanns); ++i )
+ for (unsigned i = 0; i < ARRAYSZ(propanns); ++i)
{
if (known_proprt(propanns[i].prop))
{
@@ -2089,22 +2090,27 @@ void inscribe_item(item_def &item, bool proper_prompt)
// existing inscription become an option.
if (!proper_prompt || need_autoinscribe || is_inscribed)
{
- prompt = (is_inscribed ? "Add to inscription? "
- : "Inscribe item? ");
+ prompt = "Press (i) to ";
+ prompt += (is_inscribed ? "add to inscription"
+ : "inscribe");
if (need_autoinscribe || is_inscribed)
{
- prompt += "(You may also ";
+ if (!need_autoinscribe || !is_inscribed)
+ prompt += " or ";
+ else
+ prompt += ", ";
+
if (need_autoinscribe)
{
- prompt += "(a)utoinscribe";
+ prompt += "(a) to autoinscribe";
if (is_inscribed)
prompt += ", or ";
}
if (is_inscribed)
- prompt += "(c)lear it";
- prompt += ".) ";
+ prompt += "(c) to clear it";
}
+ prompt += ". ";
if (proper_prompt)
mpr(prompt.c_str(), MSGCH_PROMPT);
@@ -2897,7 +2903,7 @@ static void _detailed_god_description(god_type which_god)
" decks of Destruction -- weapons and ammunition" EOL
" decks of Dungeons -- jewellery, books, "
"miscellaneous items" EOL
- " decks of Summoning -- corpses" EOL
+ " decks of Summoning -- corpses, chunks, blood" EOL
" decks of Wonders -- consumables: food, potions, "
"scrolls, wands" EOL;
}
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index 2ca6e34dbe..b2ea2259bf 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -4075,7 +4075,7 @@ int melee_attack::mons_to_hit()
static bool wielded_weapon_check(const item_def *weapon)
{
bool result = true;
- if (!you.received_weapon_warning
+ if (!you.received_weapon_warning && !you.duration[DUR_CONF]
&& (weapon && weapon->base_type != OBJ_STAVES
&& (weapon->base_type != OBJ_WEAPONS || is_range_weapon(*weapon))
|| you.attribute[ATTR_WEAPON_SWAP_INTERRUPTED]))
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 6d541d6951..ec6c9938fa 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -1910,7 +1910,7 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus,
// Should only happen if the player answered 'n' to one of those
// "Fire through friendly?" prompts.
- if (pbolt.fr_count > 0 || pbolt.beam_cancelled)
+ if (pbolt.beam_cancelled)
{
canned_msg(MSG_OK);
you.turn_is_over = false;
diff --git a/crawl-ref/source/randart.cc b/crawl-ref/source/randart.cc
index d676e93813..65c2c512be 100644
--- a/crawl-ref/source/randart.cc
+++ b/crawl-ref/source/randart.cc
@@ -169,7 +169,7 @@ static std::string _replace_name_parts(const std::string name_in,
if (god_gift == GOD_NO_GOD || god_gift == GOD_XOM)
{
name = replace_all(name, "@player_death@",
- "@player_name@'s "
+ "@player_name@"
+ getRandNameString("killer_name"));
name = replace_all(name, "@player_doom@",
"@player_name@'s "
@@ -177,7 +177,7 @@ static std::string _replace_name_parts(const std::string name_in,
}
else
{
- // simply overwrite the name with one of type "god's Favour"
+ // Simply overwrite the name with one of type "God's Favour".
name = "of ";
name += god_name(god_gift, false);
name += "'s ";
@@ -857,13 +857,13 @@ void static _get_randart_properties(const item_def &item,
if (!done_powers
&& one_chance_in(4 + power_level)
&& (aclass != OBJ_JEWELLERY
- || (atype != RING_PROTECTION_FROM_COLD
- && atype != RING_FIRE
- && atype != RING_ICE))
+ || atype != RING_PROTECTION_FROM_COLD
+ && atype != RING_FIRE
+ && atype != RING_ICE)
&& (aclass != OBJ_ARMOUR
- || (atype != ARM_DRAGON_ARMOUR
- && atype != ARM_ICE_DRAGON_ARMOUR
- && atype != ARM_GOLD_DRAGON_ARMOUR)))
+ || atype != ARM_DRAGON_ARMOUR
+ && atype != ARM_ICE_DRAGON_ARMOUR
+ && atype != ARM_GOLD_DRAGON_ARMOUR))
{
proprt[RAP_COLD] = 1;
if (one_chance_in(5))
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index f7fbfef2fc..804ef912d2 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -928,7 +928,7 @@ static void _get_pure_deck_weights(int weights[])
static void _update_sacrifice_weights(int which)
{
- switch ( which )
+ switch (which)
{
case 0:
you.sacrifice_value[OBJ_ARMOUR] /= 5;
@@ -975,8 +975,8 @@ static void _show_pure_deck_chances()
_get_pure_deck_weights(weights);
- float total = (float) (weights[0] + weights[1] + weights[2] + weights[3] +
- weights[4]);
+ float total = (float) (weights[0] + weights[1] + weights[2] + weights[3]
+ + weights[4]);
mprf(MSGCH_DIAGNOSTICS, "Pure cards chances: "
"escape %0.2f%%, destruction %0.2f%%, dungeons %0.2f%%,"
@@ -991,7 +991,7 @@ static void _show_pure_deck_chances()
static void _give_nemelex_gift()
{
- if ( grid_destroys_items(grd[you.x_pos][you.y_pos]) )
+ if (grid_destroys_items(grd[you.x_pos][you.y_pos]))
return;
// Nemelex will give at least one gift early.
@@ -2039,8 +2039,8 @@ void pray()
// Nemelexites can abort out now instead of offering something
// they don't want to lose.
- if ( you.religion == GOD_NEMELEX_XOBEH && altar_god == GOD_NO_GOD
- && !_confirm_pray_sacrifice() )
+ if (you.religion == GOD_NEMELEX_XOBEH && altar_god == GOD_NO_GOD
+ && !_confirm_pray_sacrifice())
{
you.turn_is_over = false;
return;
@@ -5195,12 +5195,12 @@ static piety_gain_t _sacrifice_one_item_noncount( const item_def& item)
you.attribute[ATTR_CARD_COUNTDOWN]);
#endif
}
- if (item.base_type == OBJ_CORPSES && one_chance_in(2+you.piety/50)
- // Nemelex piety gain is fairly fast...at least
- // when you have low piety.
+ // Nemelex piety gain is fairly fast...at least
+ // when you have low piety.
+ if (item.base_type == OBJ_CORPSES && one_chance_in(2 + you.piety/50)
|| x_chance_in_y(value/2 + 1, 30 + you.piety/2))
{
- if ( is_artefact(item) )
+ if (is_artefact(item))
{
gain_piety(2);
relative_piety_gain = PIETY_LOTS;
@@ -5212,10 +5212,12 @@ static piety_gain_t _sacrifice_one_item_noncount( const item_def& item)
}
}
- if (item.base_type == OBJ_FOOD && item.sub_type == FOOD_CHUNK)
- // No sacrifice value for chunks of flesh, since food
- // value goes towards decks of wonder.
- ;
+ if (item.base_type == OBJ_FOOD && item.sub_type == FOOD_CHUNK
+ || is_blood_potion(item))
+ {
+ // Count chunks and blood potions towards decks of Summoning.
+ you.sacrifice_value[OBJ_CORPSES] += value;
+ }
else if (item.base_type == OBJ_CORPSES)
{
#if DEBUG_GIFTS || DEBUG_CARDS || DEBUG_SACRIFICE
@@ -5368,14 +5370,14 @@ void offer_items()
item_value(item));
#endif
- for ( int j = 0; j < item.quantity; ++j )
+ for (int j = 0; j < item.quantity; ++j)
{
const piety_gain_t gain = _sacrifice_one_item_noncount(item);
// Update piety gain if necessary.
- if ( gain != PIETY_NONE )
+ if (gain != PIETY_NONE)
{
- if ( relative_piety_gain == PIETY_NONE )
+ if (relative_piety_gain == PIETY_NONE)
relative_piety_gain = gain;
else // some + some = lots
relative_piety_gain = PIETY_LOTS;
diff --git a/crawl-ref/source/shopping.cc b/crawl-ref/source/shopping.cc
index b383b1e548..8610e3c7ef 100644
--- a/crawl-ref/source/shopping.cc
+++ b/crawl-ref/source/shopping.cc
@@ -1284,7 +1284,6 @@ unsigned int item_value( item_def item, bool ident )
case POT_RESTORE_ABILITIES:
valued += 50;
break;
- case POT_BLOOD:
case POT_BERSERK_RAGE:
case POT_HEAL_WOUNDS:
valued += 30;
@@ -1297,10 +1296,13 @@ unsigned int item_value( item_def item, bool ident )
case POT_LEVITATION:
valued += 20;
break;
- case POT_BLOOD_COAGULATED:
+ case POT_BLOOD:
case POT_PORRIDGE:
valued += 10;
break;
+ case POT_BLOOD_COAGULATED:
+ valued += 5;
+ break;
case POT_CONFUSION:
case POT_DECAY:
case POT_DEGENERATION:
@@ -1353,11 +1355,14 @@ unsigned int item_value( item_def item, bool ident )
valued = 8;
break;
+ case FOOD_CHUNK:
+ if (food_is_rotten(item))
+ break;
+
case FOOD_CHOKO:
case FOOD_LYCHEE:
case FOOD_RAMBUTAN:
case FOOD_SNOZZCUMBER:
- case FOOD_CHUNK:
valued = 4;
break;