summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-11-30 17:09:11 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-11-30 17:09:11 +0000
commit9d4fedd31985fd009b5ef5d7f7a8879ff3628e08 (patch)
treefb7c8f152b0b05a6d624312a95ac8d8f09a75ff8 /crawl-ref/source
parente64fe854e624a576dca8247b01e1f7026784d7ec (diff)
downloadcrawl-ref-9d4fedd31985fd009b5ef5d7f7a8879ff3628e08.tar.gz
crawl-ref-9d4fedd31985fd009b5ef5d7f7a8879ff3628e08.zip
Dance now generates less good weapons with low power and better ones
with high power. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2955 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/decks.cc38
1 files changed, 37 insertions, 1 deletions
diff --git a/crawl-ref/source/decks.cc b/crawl-ref/source/decks.cc
index 30b5fb703d..b8ce78bc31 100644
--- a/crawl-ref/source/decks.cc
+++ b/crawl-ref/source/decks.cc
@@ -2287,13 +2287,49 @@ static void summon_dancing_weapon(int power, deck_rarity_type rarity)
you.x_pos, you.y_pos,
friendly ? you.pet_target : MHITYOU,
250, false, false, false, true );
-
+
// Given the abundance of Nemelex decks, not setting hard reset
// leaves a trail of weapons behind, most of which just get
// offered to Nemelex again, adding an unnecessary source of
// piety.
if (mon != -1)
+ {
+ // Override the weapon
+ ASSERT( menv[mon].weapon() != NULL );
+ item_def& wpn(*menv[mon].weapon());
+
+ // FIXME Mega-hack (breaks encapsulation too)
+ wpn.flags &= ~ISFLAG_RACIAL_MASK;
+
+ if ( power_level == 0 )
+ {
+ // Wimpy, negative-enchantment weapon
+ wpn.plus = -random2(4);
+ wpn.plus2 = -random2(4);
+ wpn.sub_type = (coinflip() ? WPN_DAGGER : WPN_CLUB );
+ set_item_ego_type(wpn, OBJ_WEAPONS, SPWPN_NORMAL);
+ }
+ else if ( power_level == 1 )
+ {
+ // This is getting good...
+ wpn.plus = random2(4) - 1;
+ wpn.plus2 = random2(4) - 1;
+ wpn.sub_type = (coinflip() ? WPN_LONG_SWORD : WPN_HAND_AXE);
+ if ( coinflip() )
+ set_item_ego_type(wpn, OBJ_WEAPONS,
+ coinflip() ? SPWPN_FLAMING : SPWPN_FREEZING);
+ }
+ else if ( power_level == 2 )
+ {
+ // Rare and powerful
+ wpn.plus = random2(4) + 2;
+ wpn.plus2 = random2(4) + 2;
+ wpn.sub_type = (coinflip() ? WPN_KATANA : WPN_EXECUTIONERS_AXE);
+ set_item_ego_type(wpn, OBJ_WEAPONS,
+ coinflip() ? SPWPN_SPEED : SPWPN_ELECTROCUTION);
+ }
menv[mon].flags |= MF_HARD_RESET;
+ }
}
static void summon_skeleton(int power, deck_rarity_type rarity)