|
From: <gi...@cr...> - 2012-02-26 23:13:00
|
via 1c2ffa1eb4a0dc637ebf132e1f55159b78307cd4 (commit)
via 333634f169e7fb7e099c7ed5d289c558271326ca (commit)
from e80537dcc93b76a30a1677d83a486520be90863f (commit)
-----------------------------------------------------------------------
commit 1c2ffa1eb4a0dc637ebf132e1f55159b78307cd4
Author: Neil Moore <ne...@s-...>
Date: Sun Feb 26 18:08:45 2012 -0500
Fix some magic numbers.
commit 333634f169e7fb7e099c7ed5d289c558271326ca
Author: Neil Moore <ne...@s-...>
Date: Sun Feb 26 17:51:35 2012 -0500
Allow monspecs to give randarts.
Previously, the "randart" tag was overridden by monster_level.
Monspecs still won't *randomly* give randarts.
-----------------------------------------------------------------------
Summary of changes:
crawl-ref/source/dungeon.cc | 3 +++
crawl-ref/source/makeitem.cc | 14 +++++++-------
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index f1f53df..6cfcd09 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -4341,6 +4341,9 @@ static void _dgn_give_mon_spec_items(mons_spec &mspec,
case ISPEC_SUPERB:
item_level = MAKE_GOOD_ITEM;
break;
+ case ISPEC_RANDART:
+ item_level = ISPEC_RANDART;
+ break;
}
}
diff --git a/crawl-ref/source/makeitem.cc b/crawl-ref/source/makeitem.cc
index c2e83f3..0730cc7 100644
--- a/crawl-ref/source/makeitem.cc
+++ b/crawl-ref/source/makeitem.cc
@@ -1558,7 +1558,7 @@ static void _generate_weapon_item(item_def& item, bool allow_uniques,
}
// Forced randart.
- if (item_level == -6)
+ if (item_level == ISPEC_RANDART)
{
int i;
int ego = item.special;
@@ -1632,7 +1632,7 @@ static void _generate_weapon_item(item_def& item, bool allow_uniques,
item.plus -= 1 + random2(3);
item.plus2 -= 1 + random2(3);
- if (item_level == -5)
+ if (item_level == ISPEC_BAD)
do_curse_item(item);
}
else if ((force_good || is_demonic(item) || forced_ego
@@ -2324,7 +2324,7 @@ static void _generate_armour_item(item_def& item, bool allow_uniques,
}
// Forced randart.
- if (item_level == -6)
+ if (item_level == ISPEC_RANDART)
{
int i;
for (i = 0; i < 100; ++i)
@@ -2377,7 +2377,7 @@ static void _generate_armour_item(item_def& item, bool allow_uniques,
item.plus -= 1 + random2(3);
- if (item_level == -5)
+ if (item_level == ISPEC_BAD)
do_curse_item(item);
}
else if ((forced_ego || item.sub_type == ARM_WIZARD_HAT
@@ -3588,11 +3588,11 @@ static int _test_item_level()
case 0:
return MAKE_GOOD_ITEM;
case 1:
- return -4; // damaged
+ return ISPEC_DAMAGED;
case 2:
- return -5; // cursed
+ return ISPEC_BAD;
case 3:
- return -6; // force randart
+ return ISPEC_RANDART;
default:
return random2(50);
}
--
Dungeon Crawl Stone Soup
|