with high power.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2955 c06c8d41-db1a-0410-9941-cceddc491573
TF5WVX4WNGWZTEB6BN3CLPOTLT7KWA3B6P2L2QWRFH67YTH5LVMAC
{
// 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);
}