When hovering the cursor/cross-hair over a visible monster which has a blocked line of fire, describe the monster as having a blocked line of fire.
If a player tracer beam is fired at a visble monster or square which has a blocked line of fire, warn the player about it and allow the player to cancel.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9845 c06c8d41-db1a-0410-9941-cceddc491573
BC24BZTIVJ6GORK7XXGHQ7YXKYBEPFCTKVCANZE6PEXY4L3ZQMCAC
EPRT5LWIQULNZW5XP3ZMAGMEZ5KC4PQTW2BDTEXNH367LDL5NE5QC
XCL4GC6RUWUK57HONM5CRUEOCCECR4NYAI5KLPJKCYM5OURU3AYQC
MVQRUYIXCXGGH7J7TN2GKUQL23EOBLYGPJL4TBQKCZR2D6DCL7XQC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
UADYVV3UD5ERJTZZJGY4EUQ4NJ2JSBG7YYUJ75ZRBIXRQXQKOJPAC
UDDZ7BNFAK3BDG5UIOMEDWGH4XRJOWV4AERTZOJ7VT6IOKBP4EIQC
if (is_tracer && YOU_KILL(thrower) && flavour != BEAM_DIGGING
&& flavour <= BEAM_LAST_REAL && pos() != target && pos() != source
&& !affects_nothing && bounces == 0 && reflections == 0
&& see_grid(target) && !grid_is_solid(grd(target)))
{
// Okay, with all those tests passed, this is probably an instance
// of the player manually targetting something whose line of fire
// is blocked, even though its line of sight isn't blocked. Give
// a warning about this fact.
std::string prompt = "Your line of fire to ";
const monsters* mon = monster_at(target);
if (mon && you.can_see(mon))
prompt += mon->name(DESC_NOCAP_THE);
else
{
prompt += "the targeted "
+ feature_description(target, false, DESC_PLAIN, false);
}
prompt += " is blocked by "
+ feature_description(pos(), false, DESC_NOCAP_A, false);
prompt += ". Continue anyway?";
if (!yesno(prompt.c_str(), false, 'n'))
{
beam_cancelled = true;
finish_beam();
return;
}
// Well, we warned them.
}