summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-10-31 07:21:30 -0500
committerDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-10-31 07:23:39 -0500
commit77b9d999ee0718111a4f72c9440351a42b45eb45 (patch)
treeacd7b0e2c3670fc74cf4a7abec12f34d4d9f6b28 /crawl-ref/source
parentd57059f214fcee7e3258cafce6a6131f8558d45b (diff)
downloadcrawl-ref-77b9d999ee0718111a4f72c9440351a42b45eb45.tar.gz
crawl-ref-77b9d999ee0718111a4f72c9440351a42b45eb45.zip
After some thought, allow mundane items to be artefacts again, but more
rarely than non-mundane items. After all, there are some unrandarts made from mundane items, so there's precedent for it.
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/artefact.cc10
-rw-r--r--crawl-ref/source/effects.cc14
-rw-r--r--crawl-ref/source/itemprop.cc2
-rw-r--r--crawl-ref/source/makeitem.cc21
4 files changed, 24 insertions, 23 deletions
diff --git a/crawl-ref/source/artefact.cc b/crawl-ref/source/artefact.cc
index d1dbdd0450..fd4214c23f 100644
--- a/crawl-ref/source/artefact.cc
+++ b/crawl-ref/source/artefact.cc
@@ -1945,16 +1945,16 @@ bool make_item_randart( item_def &item )
if (item.flags & ISFLAG_UNRANDART)
return (false);
- if (item_is_mundane(item))
+ if (item_is_mundane(item) && !one_chance_in(4))
return (false);
- ASSERT(!item.props.exists( KNOWN_PROPS_KEY ));
- ASSERT(!item.props.exists( ARTEFACT_NAME_KEY ));
- ASSERT(!item.props.exists( ARTEFACT_APPEAR_KEY ));
+ ASSERT(!item.props.exists(KNOWN_PROPS_KEY));
+ ASSERT(!item.props.exists(ARTEFACT_NAME_KEY));
+ ASSERT(!item.props.exists(ARTEFACT_APPEAR_KEY));
item.props[KNOWN_PROPS_KEY].new_vector(SV_BOOL).resize(ART_PROPERTIES);
CrawlVector &known = item.props[KNOWN_PROPS_KEY].get_vector();
known.set_max_size(ART_PROPERTIES);
- for (vec_size i = 0; i < ART_PROPERTIES; i++)
+ for (vec_size i = 0; i < ART_PROPERTIES; ++i)
known[i] = (bool) false;
item.flags |= ISFLAG_RANDART;
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index b3dbbc2602..9cf8840c41 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -1962,7 +1962,7 @@ int acquirement_create_item(object_class_type class_wanted,
if (eq == EQ_BODY_ARMOUR || you.equip[eq] != -1)
{
const special_armour_type sparm = get_armour_ego_type(doodad);
- bool is_mundane = (sparm == SPARM_NORMAL);
+ bool is_plain = (sparm == SPARM_NORMAL);
bool is_redundant = false;
// If the created item is an ego item, check whether we're
@@ -1970,7 +1970,7 @@ int acquirement_create_item(object_class_type class_wanted,
// whether the enchantment is worse than that of the current
// item. (For armour, only consider items of the same subtype.)
// If so, try filling an unfilled equipment slot after all.
- if (!is_mundane && agent != GOD_XOM)
+ if (!is_plain && agent != GOD_XOM)
{
if (you.equip[eq] != -1
&& (eq != EQ_BODY_ARMOUR
@@ -1983,23 +1983,23 @@ int acquirement_create_item(object_class_type class_wanted,
}
}
- if (is_mundane || is_redundant)
+ if (is_plain || is_redundant)
{
if (_try_give_mundane_armour(doodad))
{
- // Make sure the item is mundane.
+ // Make sure the item is plain.
doodad.special = SPARM_NORMAL;
// Okawaru shouldn't hand out negatively enchanted
- // mundane items.
+ // plain items.
if (agent == GOD_OKAWARU && doodad.plus < 0)
doodad.plus = 0;
else if (agent == GOD_XOM && doodad.plus > 0)
doodad.plus *= -1;
}
- else if (is_mundane && agent != GOD_XOM && one_chance_in(3))
+ else if (is_plain && agent != GOD_XOM && one_chance_in(3))
{
- // If the item is mundane and there aren't any
+ // If the item is plain and there aren't any
// unfilled slots, we might want to roll again.
destroy_item(thing_created, true);
thing_created = NON_ITEM;
diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc
index b271b715ce..ffb665f089 100644
--- a/crawl-ref/source/itemprop.cc
+++ b/crawl-ref/source/itemprop.cc
@@ -584,7 +584,7 @@ bool item_is_critical(const item_def &item)
&& item.plus != RUNE_ABYSSAL);
}
-// Is item something that no one would bother enchanting?
+// Is item something that no one would usually bother enchanting?
bool item_is_mundane(const item_def &item)
{
switch (item.base_type)
diff --git a/crawl-ref/source/makeitem.cc b/crawl-ref/source/makeitem.cc
index b13f0c97e4..7dd4886b09 100644
--- a/crawl-ref/source/makeitem.cc
+++ b/crawl-ref/source/makeitem.cc
@@ -937,14 +937,14 @@ static bool _try_make_weapon_artefact(item_def& item, int force_type,
if (one_chance_in(4))
{
- do_curse_item( item );
+ do_curse_item(item);
item.plus = -random2(6);
item.plus2 = -random2(6);
}
else if ((item.plus < 0 || item.plus2 < 0)
&& !one_chance_in(3))
{
- do_curse_item( item );
+ do_curse_item(item);
}
return (true);
}
@@ -954,7 +954,7 @@ static bool _try_make_weapon_artefact(item_def& item, int force_type,
&& one_chance_in(12)
&& x_chance_in_y(31 + item_level * 3, 3000))
{
- return _try_make_item_special_unrand(item, force_type, item_level);
+ return (_try_make_item_special_unrand(item, force_type, item_level));
}
return (false);
@@ -2222,9 +2222,10 @@ static void _generate_armour_item(item_def& item, bool allow_uniques,
if (force_good)
hide2armour(item);
- // Hide armours and crystal plate mail normally don't get egos, but
+ // Skin armours and crystal plate mail normally don't get egos, but
// can be randarts.
if (armour_is_hide(item, true)
+ || item.sub_type == ARM_ANIMAL_SKIN
|| item.sub_type == ARM_CRYSTAL_PLATE_MAIL)
{
if (!forced_ego)
@@ -3007,15 +3008,15 @@ static bool _weapon_is_visibly_special(const item_def &item)
const int brand = get_weapon_brand(item);
const bool visibly_branded = (brand != SPWPN_NORMAL);
- if (item_is_mundane(item))
- return (false);
-
if (get_equip_desc(item) != ISFLAG_NO_DESC)
return (false);
if (visibly_branded || is_artefact(item))
return (true);
+ if (item_is_mundane(item))
+ return (false);
+
if ((item.plus || item.plus2)
&& (one_chance_in(3) || get_equip_race(item) && one_chance_in(7)))
{
@@ -3030,15 +3031,15 @@ static bool _armour_is_visibly_special(const item_def &item)
const int brand = get_armour_ego_type(item);
const bool visibly_branded = (brand != SPARM_NORMAL);
- if (item_is_mundane(item))
- return (false);
-
if (get_equip_desc(item) != ISFLAG_NO_DESC)
return (false);
if (visibly_branded || is_artefact(item))
return (true);
+ if (item_is_mundane(item))
+ return (false);
+
if (item.plus && !one_chance_in(3))
return (true);