than taking their entire inventory with them.
If a monster drops/fires/throws a summoned item the item will vanish (assuming it's not a fired/thrown item which returns to the monster).
Don't generate summoned monsters with throwing nets since the net will disappear as soon as it hits the target.
If a monster drops an item onto a item destroying grid the item will be destroyed, accompanied by the approriate sound. This should never happen, since monsters only drop items in order to pick up another one, and they can't pick up items off of item destroying grids since there won't be any items there, but maybe in the future confused monsters will spontaneously drop items or something.
Don't let orcs use orc-slaying weapons or draconians use dragon-slaying weapons.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7836 c06c8d41-db1a-0410-9941-cceddc491573
2OY3EXIBFR22QCCKPZOA37YUI7CX7BEKRRYSDSBDKQN6VTDBD7LAC
SYOUKIZKYUNJ7YVII2XYYZXYDXEN5I6SB7OIUIPXQMBF2K4HZFSQC
UPA65AL4JXYLIHH4D42IWJHRTOAF2BPOVZOAKOXBLZBYIMDZDFFQC
AYU5OVG2HZO46KDAPKUWAVHS5HTYFKUWIMIRMTHAXVVFEDJE7YPAC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
W74555HMPXUQ72AGKBXC5P3STMMX5DZAW6ZESUDLNVJBCAG43PLAC
GMCNF7YBSN7WQJNHSF3RV2NTHTVP4TABCNP7S26UEIHPAKNCPWGAC
SM6YRPYZS6LMDQA6X3VAOK2PGMUFKPD7JMWJISOQSMX2CBR4ISPAC
TJ72NVTRNJKF55RTH5MRLTHHVPOJ2M5OOYEWF4UFLTO2PPPTU6PQC
GPEJOT73KMACP33IPAKFR5ROGHCOIP22VXZMQNYTGLEA2OSZUM2AC
EPR4MQUMXA4US62JU6FYSGMQFMLA5UGLVO4FE633IAEOJHLLTUWQC
SDLKLUNFGVKDS55DDJZCBAVIB7NL3RRYPTACAY65SCUQKV6APFSAC
X5WLJCJVW55SXZVP7IKP7ADCJIGNKN4PKAXFECVR6TNK7XSMZR7QC
QS3ZRS3E6KL3YJHPKYEWCWJYRBJSXD5OOYF6Y25HZVECGPJRDB5QC
L254F6ZIU2HWGLFFGPIORTN4C3TDQ3E5JZ7Z7GQA5AEDIKL6PKDAC
UAJN2CFA2QHYDHW2UFAVPPHDQFCD54RKM6V2UC4AMEDJUBBLNWIQC
TGJZXTUIAKCFZQJ54ZQEBGFBVZSJCAX6AWDRSH3TP7UJRLGUM5SAC
Y2NYY7HWFZ2LQDK3ACSLGS37F2J2IJ5LRGCIMZYXLEOSVPD3A4DAC
DTO3EUKWHZ5RJNGNCFYXSOVTIPVXPP637F2W7WFGYKJ7JK7VNKNQC
TZ2SH2SPO5TFSFL2OCV5A32P2X4CRHEKEK7ENUFCBVF3RKUWAD4AC
I46SXTM3KJ53E34L35Q6XPBCTA3DH7FWIOUREY4FZDAGZYBLTZYAC
7V4DCKFJCNBXFODMKJ6H3MCDUTSD4XVQ7D4D6XFCD4JNF4HCE4KAC
7YUGK5Q64KG5O7GJGTUBRRLHAHBCJ5YOE23YUPT6UBKUSB67CYAQC
CDFS7Z74W5HKPQIHQICOG442KQFXUSBGGLDDQLE3MG74T44YU6AQC
std::string summoned_poof_msg(const monsters* monster, bool plural)
{
int summon_type = 0;
bool valid_mon = false;
if (monster != NULL && !invalid_monster(monster))
{
(void) monster->is_summoned(NULL, &summon_type);
valid_mon = true;
}
std::string msg = "disappear%s in a puff of smoke";
bool no_chaos = false;
switch(summon_type)
{
case SPELL_SHADOW_CREATURES:
msg = "disolve%s into shadows";
no_chaos = true;
break;
case MON_SUMM_CHAOS:
msg = "degenerate%s into a cloud of primal chaos";
break;
case MON_SUMM_WRATH:
case MON_SUMM_AID:
if (valid_mon && is_good_god(monster->god))
{
msg = "disolve%s into sparkling lights";
no_chaos = true;
}
break;
}
if (valid_mon)
{
if (monster->god == GOD_XOM && !no_chaos && one_chance_in(10)
|| monster->type == MONS_CHAOS_SPAWN)
{
msg = "degenerate%s into a cloud of primal chaos";
}
if (mons_is_holy(monster) && summon_type != SPELL_SHADOW_CREATURES
&& summon_type != MON_SUMM_CHAOS)
{
msg = "disolve%s into sparkling lights";
}
}
// Conjugate.
msg = make_stringf(msg.c_str(), plural ? "" : "s");
return (msg);
}
std::string summoned_poof_msg(const int midx, const item_def &item)
{
if (midx == NON_MONSTER)
return summoned_poof_msg(NULL, item);
else
return summoned_poof_msg(&menv[midx], item);
}
std::string summoned_poof_msg(const monsters* monster, const item_def &item)
{
ASSERT(item.flags & ISFLAG_SUMMONED);
return summoned_poof_msg(monster, item.quantity > 1);
}
case MON_SUMM_WRATH:
case MON_SUMM_AID:
if (is_good_god(monster->god))
{
msg = " disolves into sparkling lights!";
cloud = CLOUD_NONE;
}
break;
}
if (monster->god == GOD_XOM && one_chance_in(10)
|| cloud != CLOUD_NONE && monster->type == MONS_CHAOS_SPAWN)
{
msg = " degenerates into a cloud of primal chaos!";
cloud = CLOUD_CHAOS;
}
if (mons_is_holy(monster) && summon_type != SPELL_SHADOW_CREATURES
&& summon_type != MON_SUMM_CHAOS)
{
msg = " disolves into sparkling lights!";
cloud = CLOUD_NONE;
}
const int brand = get_weapon_brand(item);
// Draconians won't use dragon slaying weapons.
if (brand == SPWPN_DRAGON_SLAYING && is_dragonkind(this, this))
return (false);
// Orcs won't use orc slaying weapons.
if (brand == SPWPN_ORC_SLAYING && is_orckind(this, this))
return (false);
const std::string iname = mitm[item_index].name(DESC_NOCAP_A);
if (!move_item_to_grid(&item_index, pos()))
if (item.flags & ISFLAG_SUMMONED)
{
on_floor = false;
if (need_message(near))
mprf("%s %s as %s drops %s!",
item.name(DESC_CAP_THE).c_str(),
summoned_poof_msg(this, item).c_str(),
name(DESC_NOCAP_THE).c_str(),
item.quantity > 1 ? "them" : "it");
item_was_destroyed(item, mindex());
}
else if (!move_item_to_grid(&item_index, pos()))
if (need_message(near))
mprf("%s drops %s.", name(DESC_CAP_THE).c_str(), iname.c_str());
if (need_message(near))
mprf("%s drops %s.", name(DESC_CAP_THE).c_str(),
item.name(DESC_NOCAP_A).c_str());
dungeon_feature_type feat = grd(pos());
if (grid_destroys_items(feat))
{
if ( player_can_hear(pos()) )
mprf(MSGCH_SOUND, grid_item_destruction_message(feat));
item_was_destroyed(item, mindex());
unlink_item(item_index);
}
}
if (item->flags & ISFLAG_SUMMONED)
{
if (see_grid(p))
{
mprf("%s %s!",
item->name(DESC_CAP_THE).c_str(),
summoned_poof_msg(beam.beam_source, *item).c_str());
}
item_was_destroyed(*item, beam.beam_source);
beam.dropped_item = true;
beam.item_pos = p;
beam.item_index = NON_ITEM;
return;
}