Your summoned Daevas leave you if TSO puts you under penance, and they'll actually attack you if you abandon TSO. While the former only applies to Daevas on your current level, the latter happens for all visited dungeon levels. The functions used are generic enough to work for other cases as well, e.g. Trog's "Brothers in Arms" now also turn hostile if you leave Trog.
Also:
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3558 c06c8d41-db1a-0410-9941-cceddc491573
UFKLHUYL7WAQ3CI3D42T4C6KBGAUR63DSQAUQTTZG7GJMXSCVJWAC
VMIKJGB6CSFVZS6VMQNP33ALEDEO2TARDICVGDJFMZ4WSPTV3LFAC
KKEPQAZMWQFWPQ4P4KT5PWG2YFPG7H4JHL5K7USVHQ3Y6L4NWURQC
KZ362RP6C7HRFQB66QL3PBRG7MBEPLRKTFMJYK7DFJQKERFGNFXQC
TN2D3PHU7VSGUND2BDIC2F4U6O2HFSV3JXLF7HMYYMY7GZXM6IFAC
SDLKLUNFGVKDS55DDJZCBAVIB7NL3RRYPTACAY65SCUQKV6APFSAC
6PAG7GHXHIYXJPPTEK4KZQZT4CL2SJDAGTVIUDB4KK66PVSTWUMAC
WHY6LRRJ5T2NSBE3IUCR4X3TOAH7TTK5NPUPUIFT7TPNJ6J4HBDAC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
KHHAE5ZK7ITEZVMMUKYROKECLE2RU5ZU5OQ4Z4XSRQXE2R65O67AC
SWOYPTHJAWFEDBMB3ROT33VQZIXGZD5UOXEV456DDUENW2HGA66QC
CQ24AVAI6SW3AHTIDMLPSTRRBEU6FHRF5I5FD6G5QIYE6PO4BQMQC
EJEHTLHZ5DL4SJQJBMQL5K3IV2ZMCZQBVCRRERER7SPOMNKFJTVQC
SJOTTUZMA3UTGT5D6LKUTBDP2CZFXT24FB5IAWCUFHSHLLACM75QC
VCG3BRIYRTNNWYC3LOXD6KFGXOX37HAFW2HNV7WXVG2V7EUHLDZQC
I7QLYOTE6DLQZM7YWUWYLKHRJRB2A3STQ42ALSRGQICEWKD2QTEQC
else if (god == GOD_SHINING_ONE && you.duration[DUR_DIVINE_SHIELD])
{ // nor does TSO's divine shield
mpr("Your divine shield disappears!");
you.duration[DUR_DIVINE_SHIELD] = 0;
you.attribute[ATTR_DIVINE_SHIELD] = 0;
you.redraw_armour_class = true;
else if (god == GOD_SHINING_ONE)
{
if (you.duration[DUR_DIVINE_SHIELD])
{ // nor does TSO's divine shield
mpr("Your divine shield disappears!");
you.duration[DUR_DIVINE_SHIELD] = 0;
you.attribute[ATTR_DIVINE_SHIELD] = 0;
you.redraw_armour_class = true;
}
make_god_gifts_disappear(true); // only on level
}
// Make summoned (temporary) god gifts disappear on penance
// or when abandoning the god in question.
// If seen, only count monsters where the player can see the change and
// output a message.
static bool make_god_gifts_on_level_disappear(bool seen = false)
{
int count = 0;
for ( int i = 0; i < MAX_MONSTERS; ++i )
{
monsters *monster = &menv[i];
if (monster->type != -1
&& monster->attitude == ATT_FRIENDLY
&& monster->has_ench(ENCH_ABJ)
&& testbits(monster->flags,MF_GOD_GIFT))
{
// monster disappears
if (!seen || simple_monster_message(monster, " abandons you!"))
count++;
monster_die(monster, KILL_DISMISSED, 0);
}
}
return (count);
}
static bool god_gifts_disappear_wrapper()
{
return (make_god_gifts_on_level_disappear());
}
// Make god gifts disappear on all levels, or on only the current one.
bool make_god_gifts_disappear(bool level_only)
{
bool success = make_god_gifts_on_level_disappear(true);
if (level_only)
return (success);
return (apply_to_all_dungeons(god_gifts_disappear_wrapper) || success);
// When abandoning the god in question turn god gifts hostile.
// If seen, only count monsters where the player can see the change and
// output a message.
static bool make_god_gifts_on_level_hostile(bool seen = false)
{
int count = 0;
for ( int i = 0; i < MAX_MONSTERS; ++i )
{
monsters *monster = &menv[i];
if (monster->type != -1
&& monster->attitude == ATT_FRIENDLY
&& (monster->flags & MF_GOD_GIFT))
{
// monster changes attitude
monster->attitude = ATT_HOSTILE;
if (!seen || simple_monster_message(monster, " turns against you!"))
count++;
}
}
return (count);
}
static bool god_gifts_hostile_wrapper()
{
return (make_god_gifts_on_level_hostile());
}
// Make god gifts disappear on all levels, or on only the current one.
bool make_god_gifts_hostile(bool level_only)
{
bool success = make_god_gifts_on_level_hostile(true);
if (level_only)
return (success);
return (apply_to_all_dungeons(god_gifts_hostile_wrapper) || success);
}