summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-11-19 22:16:37 -0600
committerDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-11-19 22:16:37 -0600
commitcbf5fe7b39f4ae734ba7b596b8a1c17264f797ea (patch)
tree17c93ff67a01bcd68821b71cec081e3a2ced1d37 /crawl-ref/source
parent8e6f0b9972661f6e73e809b55274c0cd4e40528b (diff)
downloadcrawl-ref-cbf5fe7b39f4ae734ba7b596b8a1c17264f797ea.tar.gz
crawl-ref-cbf5fe7b39f4ae734ba7b596b8a1c17264f797ea.zip
Properly mark blessed whips as TSO gifts (Scourges instead of Blades).
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/effects.cc4
-rw-r--r--crawl-ref/source/enum.h2
-rw-r--r--crawl-ref/source/goditem.cc2
-rw-r--r--crawl-ref/source/item_use.cc4
-rw-r--r--crawl-ref/source/itemname.cc31
-rw-r--r--crawl-ref/source/itemprop.cc7
-rw-r--r--crawl-ref/source/itemprop.h4
-rw-r--r--crawl-ref/source/mon-gear.cc4
-rw-r--r--crawl-ref/source/religion.cc9
-rw-r--r--crawl-ref/source/xom.cc4
10 files changed, 39 insertions, 32 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index b31ed17d89..063b1db69e 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -2051,9 +2051,9 @@ int acquirement_create_item(object_class_type class_wanted,
continue;
}
- // Only TSO gifts blessed blades, and currently not through
+ // Only TSO gifts blessed weapons, and currently not through
// acquirement, but make sure of this anyway.
- if (agent != GOD_SHINING_ONE && is_blessed_blade(doodad))
+ if (agent != GOD_SHINING_ONE && is_blessed(doodad))
{
destroy_item(thing_created, true);
thing_created = NON_ITEM;
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index 8bd163a786..a521077906 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -1392,7 +1392,7 @@ enum item_status_flag_type // per item flags: ie. ident status, cursed status
ISFLAG_EQ_JEWELLERY_MASK = 0x0000000F, // mask of flags for known jewellery
ISFLAG_CURSED = 0x00000100, // cursed
- ISFLAG_BLESSED_BLADE = 0x00000200, // personalized TSO's gift
+ ISFLAG_BLESSED_WEAPON = 0x00000200, // personalized TSO's gift
ISFLAG_RESERVED_2 = 0x00000400, // reserved
ISFLAG_RESERVED_3 = 0x00000800, // reserved
diff --git a/crawl-ref/source/goditem.cc b/crawl-ref/source/goditem.cc
index 849cd63ede..dbcb130e59 100644
--- a/crawl-ref/source/goditem.cc
+++ b/crawl-ref/source/goditem.cc
@@ -36,7 +36,7 @@ bool is_holy_item(const item_def& item)
switch (item.base_type)
{
case OBJ_WEAPONS:
- retval = (is_blessed_blade(item)
+ retval = (is_blessed(item)
|| get_weapon_brand(item) == SPWPN_HOLY_WRATH);
break;
case OBJ_SCROLLS:
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 6685bea91b..cef3e363ba 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -158,7 +158,7 @@ bool can_wield(item_def *weapon, bool say_reason,
{
mpr("This weapon is holy and will not allow you to wield it.");
// If it's a standard weapon, you know its ego now.
- if (!is_artefact(*weapon) && !is_blessed_blade(*weapon)
+ if (!is_artefact(*weapon) && !is_blessed(*weapon)
&& !item_type_known(*weapon))
{
set_ident_flags(*weapon, ISFLAG_KNOW_TYPE);
@@ -177,7 +177,7 @@ bool can_wield(item_def *weapon, bool say_reason,
{
mpr("You're too hungry to wield that.");
// If it's a standard weapon, you know its ego now.
- if (!is_artefact(*weapon) && !is_blessed_blade(*weapon)
+ if (!is_artefact(*weapon) && !is_blessed(*weapon)
&& !item_type_known(*weapon))
{
set_ident_flags(*weapon, ISFLAG_KNOW_TYPE);
diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc
index 46ffb389da..9ac7083160 100644
--- a/crawl-ref/source/itemname.cc
+++ b/crawl-ref/source/itemname.cc
@@ -981,9 +981,9 @@ std::string item_def::name_aux(description_level_type desc,
unsigned long ignore_flags) const
{
// Shortcuts
- const int item_typ = this->sub_type;
- const int it_plus = this->plus;
- const int item_plus2 = this->plus2;
+ const int item_typ = sub_type;
+ const int it_plus = plus;
+ const int item_plus2 = plus2;
const bool know_type = ident || item_type_known(*this);
@@ -1023,7 +1023,7 @@ std::string item_def::name_aux(description_level_type desc,
std::ostringstream buff;
- switch (this->base_type)
+ switch (base_type)
{
case OBJ_WEAPONS:
if (know_curse && !terse)
@@ -1060,16 +1060,21 @@ std::string item_def::name_aux(description_level_type desc,
buff << get_artefact_name(*this);
break;
}
- else if (flags & ISFLAG_BLESSED_BLADE && !dbname)
- { // since Daevas can get blessed base items, we need a separate
- // flag for this, so they can still have their eudemon blades
- buff << "Blessed Blade";
+ else if (flags & ISFLAG_BLESSED_WEAPON && !dbname)
+ { // Since Angels and Daevas can get blessed base items, we
+ // need a separate flag for this, so they can still have
+ // their holy scourges and blessed eudemon blades.
+ buff << "Blessed ";
+ if (weapon_skill(*this) == SK_MACES_FLAILS)
+ buff << "Scourge";
+ else
+ buff << "Blade";
break;
}
// Now that we can have "glowing elven" weapons, it's
// probably a good idea to cut out the descriptive
- // term once it's become obsolete. -- bwr
+ // term once it's become obsolete. - bwr
if (know_cosmetic)
{
switch (get_equip_desc(*this))
@@ -1214,7 +1219,7 @@ std::string item_def::name_aux(description_level_type desc,
// Now that we can have "glowing elven" armour, it's
// probably a good idea to cut out the descriptive
- // term once it's become obsolete. -- bwr
+ // term once it's become obsolete. - bwr
if (know_cosmetic)
{
switch (get_equip_desc(*this))
@@ -1287,7 +1292,7 @@ std::string item_def::name_aux(description_level_type desc,
if (know_ego && !is_artefact(*this))
{
- const special_armour_type sparm = get_armour_ego_type( *this );
+ const special_armour_type sparm = get_armour_ego_type(*this);
if (sparm != SPARM_NORMAL)
{
@@ -1367,10 +1372,10 @@ std::string item_def::name_aux(description_level_type desc,
COMPILE_CHECK( ARRAYSZ(potion_colours) == PDC_NCOLOURS, c1 );
const char *qualifier =
- (pqual < 0 || pqual >= PDQ_NQUALS)? "bug-filled "
+ (pqual < 0 || pqual >= PDQ_NQUALS) ? "bug-filled "
: potion_qualifiers[pqual];
- const char *clr = (pcolour < 0 || pcolour >= PDC_NCOLOURS)?
+ const char *clr = (pcolour < 0 || pcolour >= PDC_NCOLOURS) ?
"bogus" : potion_colours[pcolour];
buff << qualifier << clr << " potion";
diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc
index 272b0df66f..d700b753d8 100644
--- a/crawl-ref/source/itemprop.cc
+++ b/crawl-ref/source/itemprop.cc
@@ -1500,7 +1500,7 @@ bool is_demonic(const item_def &item)
return (false);
}
-bool is_blessed_blade(const item_def &item)
+bool is_blessed(const item_def &item)
{
if (item.base_type == OBJ_WEAPONS)
{
@@ -1525,11 +1525,12 @@ bool is_blessed_blade(const item_def &item)
return (false);
}
-bool is_blessed_blade_convertible(const item_def &item)
+bool is_blessed_convertible(const item_def &item)
{
return (!is_artefact(item)
&& (item.base_type == OBJ_WEAPONS
&& (is_demonic(item)
+ || item.sub_type == WPN_HOLY_SCOURGE
|| weapon_skill(item) == SK_LONG_BLADES)));
}
@@ -1604,7 +1605,7 @@ bool convert2good(item_def &item, bool allow_blessed)
break;
}
- if (is_blessed_blade(item))
+ if (is_blessed(item))
item.flags &= ~ISFLAG_RACIAL_MASK;
return (true);
diff --git a/crawl-ref/source/itemprop.h b/crawl-ref/source/itemprop.h
index ac95f91f2d..a8f1eceabd 100644
--- a/crawl-ref/source/itemprop.h
+++ b/crawl-ref/source/itemprop.h
@@ -110,8 +110,8 @@ hands_reqd_type hands_reqd(object_class_type base_type, int sub_type,
size_type size);
bool is_demonic(const item_def &item);
-bool is_blessed_blade(const item_def &item);
-bool is_blessed_blade_convertible(const item_def &item);
+bool is_blessed(const item_def &item);
+bool is_blessed_convertible(const item_def &item);
bool convert2good(item_def &item, bool allow_blessed = true);
bool convert2bad(item_def &item);
diff --git a/crawl-ref/source/mon-gear.cc b/crawl-ref/source/mon-gear.cc
index 978b948af1..ebc7fc6be4 100644
--- a/crawl-ref/source/mon-gear.cc
+++ b/crawl-ref/source/mon-gear.cc
@@ -42,10 +42,10 @@ static void _give_monster_item(monsters *mon, int thing,
unset_ident_flags(mthing, ISFLAG_IDENT_MASK);
if (mon->undead_or_demonic()
- && (is_blessed_blade(mthing)
+ && (is_blessed(mthing)
|| get_weapon_brand(mthing) == SPWPN_HOLY_WRATH))
{
- if (is_blessed_blade(mthing))
+ if (is_blessed(mthing))
convert2bad(mthing);
if (get_weapon_brand(mthing) == SPWPN_HOLY_WRATH)
set_item_ego_type(mthing, OBJ_WEAPONS, SPWPN_NORMAL);
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 244aa832fc..86225c5dd2 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -4282,10 +4282,10 @@ static bool _bless_weapon(god_type god, brand_type brand, int colour)
{
convert2good(wpn);
- if (is_blessed_blade_convertible(wpn))
+ if (is_blessed_convertible(wpn))
{
origin_acquired(wpn, GOD_SHINING_ONE);
- wpn.flags |= ISFLAG_BLESSED_BLADE;
+ wpn.flags |= ISFLAG_BLESSED_WEAPON;
}
burden_change();
@@ -4418,7 +4418,8 @@ static bool _altar_prayer()
bool did_bless = false;
- // TSO blesses weapons with holy wrath, and long blades specially.
+ // TSO blesses weapons with holy wrath, and long blades and demon
+ // whips specially.
if (you.religion == GOD_SHINING_ONE
&& !you.num_gifts[GOD_SHINING_ONE]
&& !player_under_penance()
@@ -4428,7 +4429,7 @@ static bool _altar_prayer()
if (wpn
&& (get_weapon_brand(*wpn) != SPWPN_HOLY_WRATH
- || is_blessed_blade_convertible(*wpn)))
+ || is_blessed_convertible(*wpn)))
{
did_bless = _bless_weapon(GOD_SHINING_ONE, SPWPN_HOLY_WRATH,
YELLOW);
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc
index b79f99207f..c0d5df800d 100644
--- a/crawl-ref/source/xom.cc
+++ b/crawl-ref/source/xom.cc
@@ -892,8 +892,8 @@ static bool _is_chaos_upgradeable(const item_def &item,
if (item.flags & ISFLAG_SUMMONED)
return (false);
- // Blessed blades are protected, being gifts from good gods.
- if (is_blessed_blade(item))
+ // Blessed weapons are protected, being gifts from good gods.
+ if (is_blessed(item))
return (false);
// God gifts from good gods are protected. Also, Beogh hates all