From 8d64e9366af875a9be375434337c556039c5e024 Mon Sep 17 00:00:00 2001 From: Kodi Arfer Date: Mon, 12 Feb 2024 17:42:24 -0500 Subject: [PATCH] Implemented wands of webs. --- simalq/tile/item.hy | 15 +++++++++++++++ simalq/tile/unimplemented.hy | 1 - tests/test_item.hy | 20 ++++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/simalq/tile/item.hy b/simalq/tile/item.hy index 225f3fa..c648286 100644 --- a/simalq/tile/item.hy +++ b/simalq/tile/item.hy @@ -409,6 +409,21 @@ :flavor "This attempt to create a portable phase trigger didn't entirely succeed.") +(deftile "/ " "a wand of webs" Usable + :color 'dark-gray + :iq-ix 170 + :acquirement-points 150 + + :targeted F + :use (meth [] + "Creates a web at every empty square in the reality bubble." + (for [ + pos (burst G.player.pos G.rules.reality-bubble-size) + :if (not (at pos))] + (Tile.make pos "web"))) + + :flavor "Of all the wands you can find in the dungeon, this can truly be said to be one of them. It looks and feels awfully like a body part from an oversized arachnid, and it makes a huge mess, but it has its uses.") + (deftile "/ " "a wand of death" Usable :color 'blue :iq-ix 156 diff --git a/simalq/tile/unimplemented.hy b/simalq/tile/unimplemented.hy index 5bae9eb..baf8fbe 100644 --- a/simalq/tile/unimplemented.hy +++ b/simalq/tile/unimplemented.hy @@ -35,7 +35,6 @@ [164 "cyclops"] [165 "dark_prince"] [166 "blind_mage"] - [170 "wand_of_webs"] [177 "doppelganger"] [178 "magical_barrier_generator"] [179 "magical_barrier_east"] diff --git a/tests/test_item.hy b/tests/test_item.hy index 5b2c90e..80ebaa9 100644 --- a/tests/test_item.hy +++ b/tests/test_item.hy @@ -488,6 +488,26 @@ (assert-at [3 0] "wall")) +(defn test-wand-webs [] + (init [ + :height 1 + :tiles ['floor "pile of gold" 'floor "wall" "giant spider" "wall" 'floor 'floor]]) + + (setv G.rules.reality-bubble-size 7) + (use-item "wand of webs") + ; Every free square in the reality bubble gets a web. + ; (The wand doesn't add a web under the spider, but the spider makes + ; one itself.) + (assert-at [1 0] "web") + (assert-at [2 0] "pile of gold") + (assert-at [3 0] "web") + (assert-at [4 0] "wall") + (assert-at [5 0] "giant spider" "web") + (assert-at [6 0] "wall") + (assert-at [7 0] "web") + (assert-at [8 0] 'floor)) + + (defn test-wand-death [] (setv map-marks { "s " "shade"