summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/traps.cc
diff options
context:
space:
mode:
authorJude Brown <bookofjude@users.sourceforge.net>2009-12-07 18:35:15 +1000
committerJude Brown <bookofjude@users.sourceforge.net>2009-12-07 18:39:37 +1000
commit2574105cd5908c0257dc8f2b29a1a33fac5ccb19 (patch)
tree58424cdc7ecac0cefa8802021fd8968853f99c78 /crawl-ref/source/traps.cc
parent7a14cd46a6ef20eccf81ee4a3842f6d25e53c582 (diff)
downloadcrawl-ref-2574105cd5908c0257dc8f2b29a1a33fac5ccb19.tar.gz
crawl-ref-2574105cd5908c0257dc8f2b29a1a33fac5ccb19.zip
Only place natural and magical traps in Slime.
The jellies and acid blobs would've eaten any mechanical traps.
Diffstat (limited to 'crawl-ref/source/traps.cc')
-rw-r--r--crawl-ref/source/traps.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/crawl-ref/source/traps.cc b/crawl-ref/source/traps.cc
index d27137443b..8bf5d030f0 100644
--- a/crawl-ref/source/traps.cc
+++ b/crawl-ref/source/traps.cc
@@ -1464,6 +1464,25 @@ int num_traps_for_place(int level_number, const level_id &place)
return 0;
}
+trap_type random_trap_slime(int level_number)
+{
+ trap_type type = NUM_TRAPS;
+
+ if (random2(1 + level_number) > 14 && one_chance_in(3))
+ {
+ type = TRAP_ZOT;
+ }
+
+ if (one_chance_in(5) && is_valid_shaft_level(level_id::current()))
+ type = TRAP_SHAFT;
+ if (one_chance_in(5))
+ type = TRAP_TELEPORT;
+ if (one_chance_in(10))
+ type = TRAP_ALARM;
+
+ return (type);
+}
+
static trap_type random_trap_default(int level_number, const level_id &place)
{
trap_type type = TRAP_DART;