2012-04-09 00:46

From 14e74982eca4ffa0891456160e4d2ef8913d704a Mon Sep 17 00:00:00 2001 From: Zannick <jokeserver@gmail.com> Date: Sat, 7 Apr 2012 18:15:43 -0700 Subject: [PATCH] Introduce shrieking orb mimics. Rework the Zot:5 system similar to Vaults:8, so that it is easy to define vaults that allow orb mimics. Also fix a mistabbing that threw me off while I was reading orb code. --- crawl-ref/source/dat/des/branches/zot.des | 77 +++++++++++++++++------------ crawl-ref/source/mon-info.cc | 2 + crawl-ref/source/mon-util.cc | 9 +++ crawl-ref/source/spl-transloc.cc | 2 +- 4 files changed, 58 insertions(+), 32 deletions(-) diff --git a/crawl-ref/source/dat/des/branches/zot.des b/crawl-ref/source/dat/des/branches/zot.des index e469a57..0be3229 100644 --- a/crawl-ref/source/dat/des/branches/zot.des +++ b/crawl-ref/source/dat/des/branches/zot.des @@ -9,6 +9,17 @@ # ############################################################################## +{{ + -- Orb of Zot placement, similar to how Vaults places its rune + -- Turn one 'Z' into the orb, the rest into orb mimics or nothing. + function zot5_orb(e) + e.nsubst("Z = 1:Z / *:o") + e.subst("o = o:1 .:9") + e.kitem("o = Orb of Zot mimic") + e.subvault("Z : zot5_orb") + end + +}} ############################################################################## ############################################################################## @@ -901,17 +912,37 @@ XXXXXXXXXXXcc..............ccXXXc...............cXXXcc..............ccXXXXXXXXXX XXXXXXXXXXXXccccccccccccccccXXXXcccccccc@ccccccccXXXXccccccccccccccccXXXXXXXXXXX ENDMAP -NAME: orb_original -TAGS: orb_chamber +########################################################### +# The orb! +########################################################### + +NAME: zot5_orb +TAGS: zot5_orb no_item_gen MARKER: Z = lua:item_pickup_change_flags { \ level_flags="!no_tele_control", item="auto" \ } KITEM: Z = Orb of Zot -KMASK: Z1! = no_item_gen +MAP +Z +ENDMAP + +########################################################### +# Zot:5 Orb chambers +########################################################### +# +# Each Orb chamber must be capable of placing the Orb. This is done by +# placing one or more Z and calling zot5_orb(_G). One Z will have the Orb, +# others will have a small chance of being an orb mimic, or will otherwise +# be replaced with '.' (plain floor). + +NAME: orb_original +TAGS: orb_chamber +KMASK: 1! = no_item_gen SUBST: ! = ^ .:40 SUBST: . = .:500 ^ COLOUR: c = magenta KMONS: 1 = patrolling Orb Guardian +: zot5_orb(_G) MAP ccccccccc ccccccccccc @@ -939,15 +970,12 @@ ENDMAP NAME: orb_monky_inset TAGS: orb_chamber WEIGHT: 5 -MARKER: Z = lua:item_pickup_change_flags { \ - level_flags="!no_tele_control", item="auto" \ - } -KITEM: Z = Orb of Zot -KMASK: Z1! = no_item_gen +KMASK: 1! = no_item_gen SUBST: ! = ^ .:40 SUBST: . = .:500 ^ COLOUR: c = magenta KMONS: 1 = patrolling Orb Guardian +: zot5_orb(_G) MAP ccccccccc ccccccccccc @@ -975,22 +1003,18 @@ ENDMAP NAME: orb_two_ways TAGS: orb_chamber WEIGHT: 5 -NSUBST: Y = 1:Z / *:. -MARKER: Z = lua:item_pickup_change_flags { \ - level_flags="!no_tele_control", item="auto" \ - } -KITEM: Z = Orb of Zot -KMASK: YZ1! = no_item_gen +KMASK: 1! = no_item_gen SUBST: ! = ^ .:40 SUBST: . = .:500 ^ COLOUR: c = magenta KMONS: 1 = patrolling Orb Guardian +: zot5_orb(_G) MAP ccccccccc XXXXXXXXXXX cXXXXX.....XXXc cXXX!!!1X...XXc - XXX!Y!XXX..XX + XXX!Z!XXX..XX XX!!!XX..XX XXXXXX..XXX XXXX.....XXXX @@ -1002,7 +1026,7 @@ cXXX!!!1X...XXc XXXX.....XXXX XXXX..XXXXX XXX..XX!!!X - XXX..XXX!Y!XX + XXX..XXX!Z!XX cXXX...X1!!!XXc cXXXX.....XXXXc XXXXXXXXXXX @@ -1012,16 +1036,13 @@ ENDMAP NAME: orb_monky_within_orb TAGS: orb_chamber WEIGHT: 5 -MARKER: Z = lua:item_pickup_change_flags { \ - level_flags="!no_tele_control", item="auto" \ - } -KITEM: Z = Orb of Zot -KMASK: Z1! = no_item_gen +KMASK: 1! = no_item_gen SUBST: ! = ^ .:40 SUBST: . = .:500 ^ COLOUR: cn = magenta TILE: n = dngn_transparent_wall_magenta KMONS: 1 = patrolling Orb Guardian +: zot5_orb(_G) MAP ccccccccc ccccccccccc @@ -1049,16 +1070,13 @@ ENDMAP NAME: orb_monky_twist TAGS: orb_chamber WEIGHT: 5 -MARKER: Z = lua:item_pickup_change_flags { \ - level_flags="!no_tele_control", item="auto" \ - } -KITEM: Z = Orb of Zot -KMASK: Z1! = no_item_gen +KMASK: 1! = no_item_gen SUBST: ! = ^ .:40 SUBST: . = .:500 ^ COLOUR: cn = magenta TILE: n = dngn_transparent_wall_magenta KMONS: 1 = patrolling Orb Guardian +: zot5_orb(_G) MAP ccccccccc ccccccccccc @@ -1085,17 +1103,14 @@ ENDMAP NAME: mrperson_orb_statues TAGS: orb_chamber -MARKER: Z = lua:item_pickup_change_flags { \ - level_flags="!no_tele_control", item="auto" \ - } -KITEM: Z = Orb of Zot -KMASK: Z1! = no_item_gen +KMASK: 1! = no_item_gen SUBST: ! = ^ .:40 SUBST: . = .:500 ^ COLOUR: G = magenta SUBST: G = G:100 F:1 KMONS: F = orange crystal statue / silver statue / ice statue KMONS: 1 = patrolling Orb Guardian +: zot5_orb(_G) MAP ccccccccc ccccccccccc diff --git a/crawl-ref/source/mon-info.cc b/crawl-ref/source/mon-info.cc index 86a66c1..648289e 100644 --- a/crawl-ref/source/mon-info.cc +++ b/crawl-ref/source/mon-info.cc @@ -964,6 +964,8 @@ std::string monster_info::mimic_name() const { s = "rune"; } + else if (item->base_type == OBJ_ORBS) + s = "orb"; else s = item->name(DESC_BASENAME); } diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 09eeb7b..f9ceaee 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -41,6 +41,7 @@ #include "mon-stuff.h" #include "notes.h" #include "options.h" +#include "orb.h" #include "random.h" #include "religion.h" #include "showsymb.h" @@ -883,6 +884,14 @@ void discover_mimic(const coord_def& pos, bool wake) mimic->seen_context = SC_JUST_SEEN; } + // Orb mimics shriek. + if (item && item->base_type == OBJ_ORBS) + { + orb_pickup_noise(pos, 30, + "The orb mimic lets out a hideous shriek!", + "The orb mimic lets out a furious burst of light!"); + } + // Just in case there's another one. if (mimic_at(pos)) discover_mimic(pos); diff --git a/crawl-ref/source/spl-transloc.cc b/crawl-ref/source/spl-transloc.cc index c4ee32a..ec4bd36 100644 --- a/crawl-ref/source/spl-transloc.cc +++ b/crawl-ref/source/spl-transloc.cc @@ -809,7 +809,7 @@ spret_type cast_apportation(int pow, bolt& beam, bool fail) else mpr("The mass is resisting your pull."); - return SPRET_SUCCESS; + return SPRET_SUCCESS; } // We need to modify the item *before* we move it, because -- 1.7.4.4