From f5e97453a4ac3af452849dd8b3b429ecc8c7389d Mon Sep 17 00:00:00 2001 From: zelgadis Date: Mon, 1 Dec 2008 12:29:07 +0000 Subject: Added shields of reflection, though they're not randomly generated and have no valuation is shopping.cc. It currently only reflects missiles that are blocked with the shield. They could also reflect the brand effects of blocked melee weapons, but I'm not sure if that's a good idea. drop_item and the item to be dropped have been moved from fire_beam()'s parameters into the bolt structure, along with the beam's remaining range. Seems to work fine, but it might still lead to some buggyness. The game now distinguishes between killing yourself by hitting yourself with a beam bounced off a wall versus other forms of self targeting. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7705 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/hiscores.cc | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source/hiscores.cc') diff --git a/crawl-ref/source/hiscores.cc b/crawl-ref/source/hiscores.cc index 548e9c1532..9f3576d51e 100644 --- a/crawl-ref/source/hiscores.cc +++ b/crawl-ref/source/hiscores.cc @@ -763,7 +763,8 @@ void scorefile_entry::init_death_cause(int dam, int dsrc, // for death by monster if ((death_type == KILLED_BY_MONSTER || death_type == KILLED_BY_BEAM - || death_type == KILLED_BY_SPORE) + || death_type == KILLED_BY_SPORE + || death_type == KILLED_BY_REFLECTION) && !invalid_monster_index(death_source) && menv[death_source].type != -1) { @@ -1640,6 +1641,43 @@ std::string scorefile_entry::death_description(death_desc_verbosity verbosity) needs_damage = true; break; + case KILLED_BY_REFLECTION: + needs_damage = true; + if (terse) + desc += "reflected bolt"; + else + { + desc += "Killed by a reflected "; + if (auxkilldata.empty()) + desc += "bolt"; + else + desc += auxkilldata; + + if (!death_source_name.empty() && !oneline && !semiverbose) + { + desc += "\n"; + desc += " "; + desc += "... reflected by "; + desc += death_source_name; + needs_damage = false; + } + } + break; + + case KILLED_BY_BOUNCE: + if (terse) + desc += "bounced beam"; + else + { + desc += "Killed themselves with a bounced "; + if (auxkilldata.empty()) + desc += "beam"; + else + desc += auxkilldata; + } + needs_damage = true; + break; + case KILLED_BY_SPORE: if (terse) { -- cgit v1.2.3-54-g00ecf