summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-28 23:07:35 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-28 23:07:35 +0000
commit6bf5bb925649736d9d313011523bdb429c225970 (patch)
treec874f9c4aa50725e1d48d7dbb624370e3823e8f2
parentca1e897a646bb9c098a1fc651a3b4aa6c976ddc7 (diff)
downloadcrawl-ref-6bf5bb925649736d9d313011523bdb429c225970.tar.gz
crawl-ref-6bf5bb925649736d9d313011523bdb429c225970.zip
Apply r6700 and r6706: Cleansing Flame harming helpless monsters and
angering TSO, !blood counting towards decks of summoning. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@6710 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/beam.cc8
-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/player.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
8 files changed, 68 insertions, 51 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 69614f6cc0..5c1f024c4e 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -2264,9 +2264,13 @@ int mons_adjust_flavoured(monsters *monster, bolt &pbolt, int hurted,
break;
case BEAM_HOLY: // flame of cleansing
+ // Cleansing flame doesn't hurt holy monsters or monsters your
+ // god wouldn't like to be hurt.
if (mons_is_holy(monster)
- || (is_good_god(you.religion)
- && (is_follower(monster) || mons_neutral(monster))))
+ || you.religion == GOD_SHINING_ONE
+ && is_unchivalric_attack(&you, monster, monster)
+ || is_good_god(you.religion)
+ && (is_follower(monster) || mons_neutral(monster)))
{
hurted = 0;
}
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index 519c54126b..1ae4a49c63 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))
{
@@ -2091,22 +2092,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);
@@ -2903,7 +2909,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 5f6b47c671..9f1f518690 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -4079,7 +4079,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 eec49676a7..54c0d5a659 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -1915,7 +1915,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/player.cc b/crawl-ref/source/player.cc
index fc5a0076fc..5ff5f3fa21 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -128,7 +128,7 @@ bool move_player_to_grid( int x, int y, bool stepped, bool allow_shift,
|| mons_is_submerged( &menv[ mgrd[x][y] ])));
const int cloud = env.cgrid[x][y];
- if (cloud != EMPTY_CLOUD)
+ if (cloud != EMPTY_CLOUD && !you.duration[DUR_CONF])
{
const cloud_type ctype = env.cloud[ cloud ].type;
// Don't prompt if already in a cloud of the same type.
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 2d0e44b142..96e59b0319 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -931,7 +931,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;
@@ -978,8 +978,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%%,"
@@ -994,7 +994,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.
@@ -2042,8 +2042,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;
@@ -5203,12 +5203,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;
@@ -5220,10 +5220,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
@@ -5376,14 +5378,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 a169778b4a..0766efd39f 100644
--- a/crawl-ref/source/shopping.cc
+++ b/crawl-ref/source/shopping.cc
@@ -1155,7 +1155,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;
@@ -1168,10 +1167,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:
@@ -1224,11 +1226,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;