diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-12-11 11:12:18 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-12-11 11:12:18 +0000 |
commit | a9ac64d3b972306982b27c81632182864022f939 (patch) | |
tree | 137e07e43b0d975949d817e257645a0aa9053c23 /crawl-ref/source/spells3.cc | |
parent | dec341f5c123fcaab27d036d70dbef1456ad10fb (diff) | |
download | crawl-ref-a9ac64d3b972306982b27c81632182864022f939.tar.gz crawl-ref-a9ac64d3b972306982b27c81632182864022f939.zip |
Generalize swapping two pieces of terrain in function swap_terrain().
Encapsulate filling out a corpse object for a particular monster in
fill_out_corpse().
Started work on "swap chaos weapon with weapon of victim" chaos effect, but am
putting that off until there's some actor class virtual methods for changing
inventory and equipment.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7807 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells3.cc')
-rw-r--r-- | crawl-ref/source/spells3.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc index a63facdc81..c03ab68b98 100644 --- a/crawl-ref/source/spells3.cc +++ b/crawl-ref/source/spells3.cc @@ -777,8 +777,12 @@ static void _equip_undead(const coord_def &a, int corps, int monster, } static bool _raise_remains(const coord_def &a, int corps, beh_type beha, - unsigned short hitting, god_type god, bool actual) + unsigned short hitting, god_type god, bool actual, + int* mon_index) { + if (mon_index != NULL) + *mon_index = -1; + const item_def& item = mitm[corps]; if (!_animatable_remains(item)) @@ -815,6 +819,8 @@ static bool _raise_remains(const coord_def &a, int corps, beh_type beha, a, hitting, 0, god, zombie_type, number)); + if (mon_index != NULL) + *mon_index = monster; if (monster != -1) { @@ -843,7 +849,7 @@ static bool _raise_remains(const coord_def &a, int corps, beh_type beha, bool animate_remains(const coord_def &a, corpse_type class_allowed, beh_type beha, unsigned short hitting, god_type god, bool actual, - bool quiet) + bool quiet, int* mon_index) { if (is_sanctuary(a)) return (false); @@ -859,7 +865,8 @@ bool animate_remains(const coord_def &a, corpse_type class_allowed, { const bool was_butchering = is_being_butchered(*si); - success = _raise_remains(a, si.link(), beha, hitting, god, actual); + success = _raise_remains(a, si.link(), beha, hitting, god, actual, + mon_index); if (actual && success) { |