Skip to content

Commit c2bdaf7

Browse files
committed
Factored out some common attributes into a class Wallish.
1 parent 8a155b3 commit c2bdaf7

File tree

1 file changed

+13
-21
lines changed

1 file changed

+13
-21
lines changed

simalq/tile/scenery.hy

+13-21
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,20 @@
123123
(not (and tile.passwallable (player-status 'Pass))))))))))))
124124
125125
126-
(deftile "██" "a wall" Scenery
126+
(defclass Wallish [Scenery]
127+
(setv
128+
blocks-move T blocks-diag T
129+
passwallable T
130+
wand-destructible T))
131+
132+
133+
(deftile "██" "a wall" Wallish
127134
:iq-ix #(
128135
2 ; wall
129136
131) ; invisible wall
130137
; Replacing invisible walls with walls is not entirely cosmetic:
131138
; IQ's invisible walls are specifically immune to passwall
132139
; amulets, albeit not wall-destroying wands.
133-
:blocks-move T :blocks-diag T
134-
:passwallable T
135-
:wand-destructible T
136140
:flavor "Among the most numerous and persistent of the obstacles that stand in the way of your inevitable victory.\n\n This man, with lime and rough-cast, doth present\n Wall, that vile Wall which did these lovers sunder;\n And through Wall's chink, poor souls, they are content\n To whisper, at the which let no man wonder.")
137141

138142
(deftile "██" "the Void" Scenery
@@ -317,27 +321,21 @@
317321
:flavor "Get me outta here.")
318322

319323

320-
(deftile "##" "a cracked wall" [Scenery Damageable]
324+
(deftile "##" "a cracked wall" [Wallish Damageable]
321325
:field-defaults (dict
322326
:hp 2)
323327
:iq-ix-mapper ["hp"
324328
{3 4 4 2 15 6}]
325329

326-
:blocks-move T :blocks-diag T :blocks-player-shots F
327-
:passwallable T
328-
:wand-destructible T
330+
:blocks-player-shots F
329331
:immune #(DamageType.Poison DamageType.Fire DamageType.DeathMagic)
330332

331333
:flavor "I think this dungeon might not be up to code.")
332334

333335

334-
(defclass BreakableWall [Scenery]
336+
(defclass BreakableWall [Wallish]
335337

336338
(setv
337-
blocks-monster T
338-
blocks-diag T
339-
passwallable T
340-
wand-destructible T
341339
color 'white
342340
color-bg 'black)
343341

@@ -391,13 +389,10 @@
391389

392390
(setv poshooked-callback phase-shift))
393391

394-
(deftile "☯█" "a phasing wall (in phase)" PhasingWall
392+
(deftile "☯█" "a phasing wall (in phase)" [PhasingWall Wallish]
395393
:color #('white None)
396394
:color-bg #('black None)
397395
:iq-ix 139
398-
:blocks-move T :blocks-diag T
399-
:passwallable T
400-
:wand-destructible T
401396

402397
:phase-replace "phasing wall (out of phase)"
403398

@@ -657,7 +652,7 @@
657652
658653
:flavor #[[Easy there, Admiral Ackbar. This kind of trap isn't necessarily dangerous. Well, admittedly, the key word here is "necessarily".]])
659654
660-
(deftile :name "a trapped wall" :superc Scenery
655+
(deftile :name "a trapped wall" :superc Wallish
661656
:color #('black 'pale-yellow)
662657
:color-bg #(None 'black)
663658
:field-defaults (dict
@@ -670,9 +665,6 @@
670665
(+ "" (if (< @wallnum 10) (str @wallnum) "^")))
671666
:suffix-dict (meth []
672667
(dict :type @wallnum))
673-
:blocks-move T :blocks-diag T
674-
:passwallable T
675-
:wand-destructible T
676668
:info-bullets (meth [#* extra]
677669
(.info-bullets (super)
678670
#("Wallfall type" @wallnum)))

0 commit comments

Comments
 (0)