summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dactions.cc
diff options
context:
space:
mode:
authorSteve Melenchuk <smelenchuk@gmail.com>2014-03-31 19:37:40 -0600
committerSteve Melenchuk <smelenchuk@gmail.com>2014-05-07 18:23:18 -0600
commit9351631d8478c6c4630496da9f381199f4ba8089 (patch)
treedbecff7574a9dc837d7822f13b135e5691e8e68f /crawl-ref/source/dactions.cc
parent50380c4b95a4073fee00d9687290e0572a3cce6a (diff)
downloadcrawl-ref-9351631d8478c6c4630496da9f381199f4ba8089.tar.gz
crawl-ref-9351631d8478c6c4630496da9f381199f4ba8089.zip
Gozag: shift gold to top of piles.
Diffstat (limited to 'crawl-ref/source/dactions.cc')
-rw-r--r--crawl-ref/source/dactions.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/crawl-ref/source/dactions.cc b/crawl-ref/source/dactions.cc
index 774a609362..bc2c56955c 100644
--- a/crawl-ref/source/dactions.cc
+++ b/crawl-ref/source/dactions.cc
@@ -12,6 +12,7 @@
#include "decks.h"
#include "dungeon.h"
#include "env.h"
+#include "items.h"
#include "libutil.h"
#include "mon-behv.h"
#include "mon-death.h"
@@ -60,6 +61,7 @@ static const char *daction_names[] =
#if TAG_MAJOR_VERSION == 34
"end spirit howl",
#endif
+ "gold to top of piles",
};
#endif
@@ -280,6 +282,21 @@ static void _apply_daction(daction_type act)
if (player_in_branch(BRANCH_TOMB))
unset_level_flags(LFLAG_NO_TELE_CONTROL, you.depth != 3);
break;
+ case DACT_GOLD_ON_TOP:
+ for (rectangle_iterator ri(0); ri; ++ri)
+ {
+ for (stack_iterator j(*ri); j; ++j)
+ {
+ if (j->base_type == OBJ_GOLD)
+ {
+ int dummy = j->link;
+ unlink_item(dummy);
+ move_item_to_grid(&dummy, *ri, true);
+ break;
+ }
+ }
+ }
+ break;
#if TAG_MAJOR_VERSION == 34
case DACT_END_SPIRIT_HOWL:
case DACT_HOLY_NEW_ATTEMPT: