summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/decks.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-18 09:40:53 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-18 09:40:53 +0000
commite2cbc98a162d37386b3191ccf16c0d64ad7bb1b2 (patch)
tree3c3fc7e3c9e0cf7bfaded82101d233492dac2216 /crawl-ref/source/decks.cc
parent8f675841ee07a21138fe098204f46018d28ea3b5 (diff)
downloadcrawl-ref-e2cbc98a162d37386b3191ccf16c0d64ad7bb1b2.tar.gz
crawl-ref-e2cbc98a162d37386b3191ccf16c0d64ad7bb1b2.zip
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
Diffstat (limited to 'crawl-ref/source/decks.cc')
-rw-r--r--crawl-ref/source/decks.cc12
1 files changed, 7 insertions, 5 deletions
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(),