diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-11-29 15:49:47 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-11-29 15:49:47 +0000 |
commit | 9048012f07dd5c68f164e6bb213d8d5471fbaa14 (patch) | |
tree | cd174e0894ccbc157ceb9ed6b474cc9632b306e8 /crawl-ref/source/spells4.cc | |
parent | e781bb1729979292a3e2ae6c06d9c92900d4c11f (diff) | |
download | crawl-ref-9048012f07dd5c68f164e6bb213d8d5471fbaa14.tar.gz crawl-ref-9048012f07dd5c68f164e6bb213d8d5471fbaa14.zip |
Added Spark card. Added more pain effects. Breaks Nemelexite saves.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2933 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells4.cc')
-rw-r--r-- | crawl-ref/source/spells4.cc | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc index 9e361bc07e..f5fd7c9271 100644 --- a/crawl-ref/source/spells4.cc +++ b/crawl-ref/source/spells4.cc @@ -693,25 +693,30 @@ void cast_conjure_ball_lightning( int pow ) static int sleep_monsters(int x, int y, int pow, int garbage) { UNUSED( garbage ); - int mnstr = mgrd[x][y]; + const int mnstr = mgrd[x][y]; - if (mnstr == NON_MONSTER) return 0; - if (mons_holiness(&menv[mnstr]) != MH_NATURAL) return 0; - if (check_mons_resist_magic( &menv[mnstr], pow )) return 0; + if (mnstr == NON_MONSTER) + return 0; + + monsters& mon = menv[mnstr]; + + if (mons_holiness(&mon) != MH_NATURAL) + return 0; + if (check_mons_resist_magic( &mon, pow )) + return 0; - // Why shouldn't we be able to sleep friendly monsters? -- bwr - // if (mons_friendly( &menv[mnstr] )) return 0; + // works on friendlies too, so no check for that //jmf: now that sleep == hibernation: - if (mons_res_cold( &menv[mnstr] ) > 0 && coinflip()) + if (mons_res_cold( &mon ) > 0 && coinflip()) return 0; - if (menv[mnstr].has_ench(ENCH_SLEEP_WARY)) + if (mon.has_ench(ENCH_SLEEP_WARY)) return 0; - menv[mnstr].put_to_sleep(); + mon.put_to_sleep(); - if (mons_class_flag( menv[mnstr].type, M_COLD_BLOOD ) && coinflip()) - menv[mnstr].add_ench(ENCH_SLOW); + if (mons_class_flag( mon.type, M_COLD_BLOOD ) && coinflip()) + mon.add_ench(ENCH_SLOW); return 1; } // end sleep_monsters() |