Skip to content

Commit

Permalink
Implemented wands of flame.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kodiologist committed Feb 1, 2024
1 parent 3d1ff15 commit 43a5bf0
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
20 changes: 19 additions & 1 deletion simalq/tile/item.hy
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@
:flavor "Technically magical, but not terribly useful.")
(deftile "/ " "a wand of shielding" Usable
:color 'orange
:color 'dark-orange
:iq-ix 200
:acquirement-points 100
Expand Down Expand Up @@ -412,6 +412,24 @@
:flavor "This fell device vibrates with the barely contained energies of Hades as they hunger for the souls of the living. Aim carefully.")
(deftile "/ " "a wand of flame" Usable
:color 'orange
:iq-ix 154
:acquirement-points 100
:!mon-damage #(2 1 1)
:use (meth [target]
(doc f"Does {(get @mon-damage 1)} fire damage to all monsters in a size-{(- (len @mon-damage) 1)} burst, except at the center square, where they take {(get @mon-damage 0)} fire damage. Futhermore, all webs in the burst are destroyed. You take no damage.")
(for [
pos (burst-damage target :damage-type DamageType.Fire
:amount @mon-damage
:color 'orange)
tile (list (at pos))
:if (= tile.stem "web")]
(.rm-from-map tile)))
:flavor "Clean out the cobwebs and have yourself some barbecued goblin.")
(defclass FireBomb [Usable]
(setv
Expand Down
1 change: 0 additions & 1 deletion simalq/tile/unimplemented.hy
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
[132 "golem"]
[134 "siren"]
[152 "random_gate"]
[154 "wand_of_flame"]
[158 "ring_of_protection"]
[159 "amulet_of_poisonous_touch"]
[164 "cyclops"]
Expand Down
21 changes: 21 additions & 0 deletions tests/test_item.hy
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,27 @@
(assert (= G.score (+ (* 12 hp) 10 (* 3 hp) (* 4 hp) (* 5 hp)))))


(defn test-wand-flame []
(init [
:height 1
:tiles ["wall" ["orc" :hp 10] ["orc" :hp 10] "web" "wall" ["orc" :hp 10]]])

(assert (= G.player.hp 100))
(use-item "wand of flame" 3 0)
; The player is unhurt.
(assert (= G.player.hp 100))
; Orc 1 takes 1 damage.
(assert-hp [2 0] 9)
; Orc 2 takes 2 damage.
(assert-hp [3 0] 8)
; The web is destroyed.
(assert-at [4 0] 'floor)
; The wall is unaffected.
(assert-at [5 0] "wall")
; Orc 3 is out of range and undamaged.
(assert-hp [6 0] 10))


(defn test-fire-bomb []
"Put some orcs in a line and check how much damage is done to each."

Expand Down

0 comments on commit 43a5bf0

Please sign in to comment.