Skip to content

Commit

Permalink
Implemented wands of annihilation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kodiologist committed Feb 2, 2024
1 parent 7ac4f4f commit 8a4a35a
Show file tree
Hide file tree
Showing 3 changed files with 32 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 @@ -8,7 +8,7 @@
simalq.util [CommandError]
simalq.game-state [G]
simalq.geometry [pos-seed turn-and-pos-seed burst at]
simalq.tile [Tile]
simalq.tile [Tile Damageable]
simalq.tile.scenery [Scenery]
simalq.util [CommandError DamageType StatusEffect msg burst-damage refactor-hp])
(setv T True F False)
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 annihilation" Usable
:color 'navy
:iq-ix 104
:acquirement-points 250
:use (meth [target]
"Utterly destroys everything at the target."
(for [t (list (at target))]
(cond
t.superblock
None
(isinstance t Damageable)
(.damage t Inf None)
T
(.rm-from-map t))))
:flavor "Now this is a real wand of nothing. A wand of nothingness. A wand of nothing left.")
(deftile "/ " "a wand of flame" Usable
:color 'orange
:iq-ix 154
Expand Down
1 change: 0 additions & 1 deletion simalq/tile/unimplemented.hy
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

(do-mac `(do ~@(gfor [iq-ix stem] [

[104 "wand_of_annihilation"]
[105 "exit_making_wand"]
[106 "wand_of_gating"]
[121 "poison_gas_bomb"]
Expand Down
13 changes: 13 additions & 0 deletions tests/test_item.hy
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,19 @@
(assert (= G.score (+ (* 12 hp) 10 (* 3 hp) (* 4 hp) (* 5 hp)))))


(defn test-wand-annihilation []
(init [])
(set-square 'E
"orc" "wall" "exit" "pile of gold" "negaton" "Void" "hole")
; Everything except the Void is destroyed by annihilation.
(use-item "wand of annihilation" 1 0)
(assert-at 'E "Void")
; Contra IQ, we allow the player to kill herself with a wand of
; annihilation, because it's funny.
(use-item "wand of annihilation" 0 0)
(cant (wk 'E) "You're dead. You can undo or load a saved game."))


(defn test-wand-flame []
(init [
:height 1
Expand Down

0 comments on commit 8a4a35a

Please sign in to comment.