power that could train Invocations was the 7mp demon summon).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1061 c06c8d41-db1a-0410-9941-cceddc491573
AVSWNOP23Z2QCLQGXFDZV7TI4RC3XSXHIX2HDXFHXGKDEZSSIGJQC
////////////////////////////////////////////////////////////////////////////
static int lugonu_warp_monster(int x, int y, int pow, int)
{
if (!in_bounds(x, y) || mgrd[x][y] == NON_MONSTER)
return (0);
monsters &mon = menv[ mgrd[x][y] ];
if (!mons_friendly(&mon))
behaviour_event( &mon, ME_ANNOY, MHITYOU );
if (check_mons_resist_magic(&mon, pow * 2))
{
mprf("%s resists.", mon.name(DESC_CAP_THE).c_str());
return (1);
}
if (!check_mons_resist_magic(&mon, pow))
{
mon.hurt(&you, 1 + random2(pow / 6));
if (!mon.alive())
return (1);
}
mon.blink();
return (1);
}
static void lugonu_warp_area(int pow)
{
apply_area_around_square( lugonu_warp_monster, you.x_pos, you.y_pos, pow );
}
static void lugonu_bends_space()
{
const int pow = 4 + skill_bump(SK_INVOCATIONS);
const bool area_warp = random2(pow) > 9;
mprf("Space bends %saround you!", area_warp? "sharply " : "");
if (area_warp)
lugonu_warp_area(pow);
random_blink(false, true);
const int damage = roll_dice(1, 4);
ouch(damage, 0, KILLED_BY_WILD_MAGIC, "a spatial distortion");
}