Skip to content

Commit 8a4a35a

Browse files
committed
Implemented wands of annihilation.
1 parent 7ac4f4f commit 8a4a35a

File tree

3 files changed

+32
-2
lines changed

3 files changed

+32
-2
lines changed

simalq/tile/item.hy

+19-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
simalq.util [CommandError]
99
simalq.game-state [G]
1010
simalq.geometry [pos-seed turn-and-pos-seed burst at]
11-
simalq.tile [Tile]
11+
simalq.tile [Tile Damageable]
1212
simalq.tile.scenery [Scenery]
1313
simalq.util [CommandError DamageType StatusEffect msg burst-damage refactor-hp])
1414
(setv T True F False)
@@ -412,6 +412,24 @@
412412
413413
:flavor "This fell device vibrates with the barely contained energies of Hades as they hunger for the souls of the living. Aim carefully.")
414414
415+
(deftile "/ " "a wand of annihilation" Usable
416+
:color 'navy
417+
:iq-ix 104
418+
:acquirement-points 250
419+
420+
:use (meth [target]
421+
"Utterly destroys everything at the target."
422+
(for [t (list (at target))]
423+
(cond
424+
t.superblock
425+
None
426+
(isinstance t Damageable)
427+
(.damage t Inf None)
428+
T
429+
(.rm-from-map t))))
430+
431+
:flavor "Now this is a real wand of nothing. A wand of nothingness. A wand of nothing left.")
432+
415433
(deftile "/ " "a wand of flame" Usable
416434
:color 'orange
417435
:iq-ix 154

simalq/tile/unimplemented.hy

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

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

26-
[104 "wand_of_annihilation"]
2726
[105 "exit_making_wand"]
2827
[106 "wand_of_gating"]
2928
[121 "poison_gas_bomb"]

tests/test_item.hy

+13
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,19 @@
488488
(assert (= G.score (+ (* 12 hp) 10 (* 3 hp) (* 4 hp) (* 5 hp)))))
489489

490490

491+
(defn test-wand-annihilation []
492+
(init [])
493+
(set-square 'E
494+
"orc" "wall" "exit" "pile of gold" "negaton" "Void" "hole")
495+
; Everything except the Void is destroyed by annihilation.
496+
(use-item "wand of annihilation" 1 0)
497+
(assert-at 'E "Void")
498+
; Contra IQ, we allow the player to kill herself with a wand of
499+
; annihilation, because it's funny.
500+
(use-item "wand of annihilation" 0 0)
501+
(cant (wk 'E) "You're dead. You can undo or load a saved game."))
502+
503+
491504
(defn test-wand-flame []
492505
(init [
493506
:height 1

0 commit comments

Comments
 (0)