From e2cbc98a162d37386b3191ccf16c0d64ad7bb1b2 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Sun, 18 May 2008 09:40:53 +0000 Subject: Pull code from mon->can_see(target) into a new function mon->see_grid() and use it in the checks for monster/monster visibility. I didn't have the time to test it but it should at least solve part of the problem of monsters firing through walls (if monster visibility is even checked there, which I don't know). Also (as usually), more code cleanup. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5117 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/decks.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'crawl-ref/source/decks.cc') diff --git a/crawl-ref/source/decks.cc b/crawl-ref/source/decks.cc index aa83140bd4..2c59b1d8da 100644 --- a/crawl-ref/source/decks.cc +++ b/crawl-ref/source/decks.cc @@ -2308,7 +2308,7 @@ static bool _trowel_card(int power, deck_rarity_type rarity) }; if (create_monster( - mgen_data(RANDOM_ELEMENT(statues), + mgen_data(RANDOM_ELEMENT(statues), BEH_HOSTILE, 0, you.pos(), MHITYOU)) != -1) { mpr("A menacing statue appears!"); @@ -2542,7 +2542,7 @@ static void _summon_any_monster(int power, deck_rarity_type rarity) const bool friendly = (power_level > 0 || !one_chance_in(4)); create_monster( - mgen_data( mon_chosen, + mgen_data( mon_chosen, friendly ? BEH_FRIENDLY : BEH_HOSTILE, 3, coord_def(chosen_x, chosen_y), MHITYOU ) ); @@ -2587,9 +2587,11 @@ static void _summon_dancing_weapon(int power, deck_rarity_type rarity) wpn.plus = random2(4) - 1; wpn.plus2 = random2(4) - 1; wpn.sub_type = (coinflip() ? WPN_LONG_SWORD : WPN_HAND_AXE); - if ( coinflip() ) + if (coinflip()) + { set_item_ego_type(wpn, OBJ_WEAPONS, coinflip() ? SPWPN_FLAMING : SPWPN_FREEZING); + } } else if ( power_level == 2 ) { @@ -2645,7 +2647,7 @@ static void _summon_skeleton(int power, deck_rarity_type rarity) create_monster( mgen_data( - skeltypes[power_level], + skeltypes[power_level], friendly ? BEH_FRIENDLY : BEH_HOSTILE, std::min(power/50,6), you.pos(), @@ -2665,7 +2667,7 @@ static void _summon_ugly(int power, deck_rarity_type rarity) ugly = MONS_UGLY_THING; create_monster( - mgen_data( ugly, + mgen_data( ugly, friendly ? BEH_FRIENDLY : BEH_HOSTILE, std::min(power/50,6), you.pos(), -- cgit v1.2.3-54-g00ecf