summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-05 17:22:38 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-05 17:22:38 +0000
commit7ca638385f00f42e37e81e85b6f9d6ff691dc968 (patch)
treece8609b81e695958eb0e1c6be003a993bdca27f0 /crawl-ref
parent79e40b730c7e40238fadc533264c796e21b3b431 (diff)
downloadcrawl-ref-7ca638385f00f42e37e81e85b6f9d6ff691dc968.tar.gz
crawl-ref-7ca638385f00f42e37e81e85b6f9d6ff691dc968.zip
Fix assumptions about the order of weapon subtypes in _give_weapon() and
_beogh_retribution(), and fix them so that they work the same way as before r8681. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8905 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/makeitem.cc34
-rw-r--r--crawl-ref/source/religion.cc17
2 files changed, 46 insertions, 5 deletions
diff --git a/crawl-ref/source/makeitem.cc b/crawl-ref/source/makeitem.cc
index 98bc1b0278..da343e18cf 100644
--- a/crawl-ref/source/makeitem.cc
+++ b/crawl-ref/source/makeitem.cc
@@ -3151,8 +3151,32 @@ static item_make_species_type _give_weapon(monsters *mon, int level,
case MONS_WIGHT:
case MONS_NORRIS:
item.base_type = OBJ_WEAPONS;
- item.sub_type = (one_chance_in(6) ? WPN_WAR_AXE + random2(4)
- : WPN_MACE + random2(12));
+
+ if (one_chance_in(6))
+ {
+ const int temp_rand = random2(4);
+ item.sub_type = ((temp_rand == 0) ? WPN_SPIKED_FLAIL :
+ (temp_rand == 1) ? WPN_GREAT_MACE :
+ (temp_rand == 2) ? WPN_WAR_AXE
+ : WPN_TRIDENT);
+ }
+ else
+ {
+ const int temp_rand = random2(12);
+ item.sub_type = ((temp_rand == 0) ? WPN_MACE :
+ (temp_rand == 1) ? WPN_FLAIL :
+ (temp_rand == 2) ? WPN_MORNINGSTAR :
+ (temp_rand == 3) ? WPN_DAGGER :
+ (temp_rand == 4) ? WPN_SHORT_SWORD :
+ (temp_rand == 5) ? WPN_LONG_SWORD :
+ (temp_rand == 6) ? WPN_SCIMITAR :
+ (temp_rand == 7) ? WPN_GREAT_SWORD :
+ (temp_rand == 8) ? WPN_HAND_AXE :
+ (temp_rand == 9) ? WPN_BATTLEAXE :
+ (temp_rand == 10) ? WPN_SPEAR
+ : WPN_HALBERD);
+ }
+
if (coinflip())
{
force_item = true;
@@ -3544,7 +3568,9 @@ static item_make_species_type _give_weapon(monsters *mon, int level,
{
force_item = true;
item.base_type = OBJ_WEAPONS;
- item.sub_type = WPN_LONG_SWORD + random2(3);
+ item.sub_type = (one_chance_in(3) ? WPN_LONG_SWORD :
+ coinflip() ? WPN_SCIMITAR
+ : WPN_GREAT_SWORD);
if (one_chance_in(7))
item.sub_type = WPN_HALBERD;
@@ -3652,7 +3678,7 @@ static item_make_species_type _give_weapon(monsters *mon, int level,
force_item = true;
item_race = MAKE_ITEM_NO_RACE;
item.base_type = OBJ_WEAPONS;
- item.sub_type = coinflip()? WPN_DAGGER : WPN_SHORT_SWORD;
+ item.sub_type = coinflip() ? WPN_DAGGER : WPN_SHORT_SWORD;
{
const int temp_rand = random2(5);
set_item_ego_type( item, OBJ_WEAPONS,
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 31a2ccd18a..b7302bfe20 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -4555,8 +4555,23 @@ static bool _beogh_retribution()
for (int i = 0; i < num_to_create; ++i)
{
+ const int temp_rand = random2(13);
+ int wpn_type = ((temp_rand == 0) ? WPN_CLUB :
+ (temp_rand == 1) ? WPN_MACE :
+ (temp_rand == 2) ? WPN_FLAIL :
+ (temp_rand == 3) ? WPN_MORNINGSTAR :
+ (temp_rand == 4) ? WPN_DAGGER :
+ (temp_rand == 5) ? WPN_SHORT_SWORD :
+ (temp_rand == 6) ? WPN_LONG_SWORD :
+ (temp_rand == 7) ? WPN_SCIMITAR :
+ (temp_rand == 8) ? WPN_GREAT_SWORD :
+ (temp_rand == 9) ? WPN_HAND_AXE :
+ (temp_rand == 10) ? WPN_BATTLEAXE :
+ (temp_rand == 11) ? WPN_SPEAR
+ : WPN_HALBERD);
+
// Create item.
- int slot = items(0, OBJ_WEAPONS, WPN_CLUB + random2(13),
+ int slot = items(0, OBJ_WEAPONS, wpn_type,
true, you.experience_level,
am_orc ? MAKE_ITEM_NO_RACE : MAKE_ITEM_ORCISH,
0, 0, GOD_BEOGH);