diff options
author | Jude Brown <bookofjude@users.sourceforge.net> | 2009-12-07 18:35:15 +1000 |
---|---|---|
committer | Jude Brown <bookofjude@users.sourceforge.net> | 2009-12-07 18:39:37 +1000 |
commit | 2574105cd5908c0257dc8f2b29a1a33fac5ccb19 (patch) | |
tree | 58424cdc7ecac0cefa8802021fd8968853f99c78 /crawl-ref/source | |
parent | 7a14cd46a6ef20eccf81ee4a3842f6d25e53c582 (diff) | |
download | crawl-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')
-rw-r--r-- | crawl-ref/source/branch.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/traps.cc | 19 | ||||
-rw-r--r-- | crawl-ref/source/traps.h | 2 |
3 files changed, 22 insertions, 1 deletions
diff --git a/crawl-ref/source/branch.cc b/crawl-ref/source/branch.cc index bcb5c69938..a8ed8355f6 100644 --- a/crawl-ref/source/branch.cc +++ b/crawl-ref/source/branch.cc @@ -213,7 +213,7 @@ Branch branches[] = { NULL, false, true, GREEN, LIGHTGREEN, mons_pitslime_rare, mons_pitslime_level, - NULL, NULL, NULL, NULL, + NULL, random_trap_slime, NULL, NULL, 5, 'M', false, true }, { BRANCH_SNAKE_PIT, BRANCH_LAIR, 5, 7, 0, 0, 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; diff --git a/crawl-ref/source/traps.h b/crawl-ref/source/traps.h index 43285f96d7..a40aaf2941 100644 --- a/crawl-ref/source/traps.h +++ b/crawl-ref/source/traps.h @@ -43,6 +43,8 @@ int num_traps_for_place(int level_number = -1, trap_type random_trap_for_place(int level_number = -1, const level_id &place = level_id::current()); +trap_type random_trap_slime(int level_number = -1); + int traps_zero_number(int level_number = -1); int traps_pan_number(int level_number = -1); |