Skip to content

Commit bb10841

Browse files
committed
Replaced make-monster with a method Actor.make.
1 parent 8a3ab3a commit bb10841

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

simalq/tile/__init__.hy

+6
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,12 @@
309309
last-acted None)
310310
(setv mutable-fields #("last_acted"))
311311

312+
(defmeth [classmethod] make [pos stem [stack-ix 0] #** kwargs]
313+
(.make (super) pos stem stack-ix #** kwargs)
314+
; Newly created actors don't get to act on the turn they come into
315+
; being.
316+
(setv (. (at pos) [stack-ix] last-acted) G.turn-n))
317+
312318
(defmeth maybe-act []
313319
"Act, if we haven't already acted this turn."
314320
(when (or (is @last-acted None) (< @last-acted G.turn-n))

simalq/tile/monster.hy

+3-9
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,6 @@
154154
#* extra
155155
(@dod "Behavior" 'act))))
156156
157-
(defn make-monster [pos stem #** kwargs]
158-
(Tile.make pos stem #** kwargs)
159-
; Newly created monsters don't get to act on the turn they come
160-
; into being.
161-
(setv (. (at pos) [0] last-acted) G.turn-n))
162-
163157
;; --------------------------------------------------------------
164158
;; * Common behavior classes
165159
;; --------------------------------------------------------------
@@ -340,7 +334,7 @@
340334
; end summoning, wasting the consumed summon power.
341335
(return)))
342336
; We have a target. Place the monster.
343-
(make-monster target stem :hp hp))
337+
(@make target stem :hp hp))
344338
T))
345339
346340
;; --------------------------------------------------------------
@@ -674,7 +668,7 @@
674668
"Gunk Up — The monster's growth timer decreases by 1. If the timer has hit 0, it then transforms into an adult gunk."
675669
(-= @growth-timer 1)
676670
(when (= @growth-timer 0)
677-
(make-monster @pos "gunk")
671+
(@make @pos "gunk")
678672
(@rm-from-map)))
679673
680674
:flavor "A seed of discord the size of a basketball that can flood a room insde of a minute. Think fast.")
@@ -697,7 +691,7 @@
697691
698692
:hook-normal-destruction (meth []
699693
"A gunk seed is created in its square."
700-
(make-monster @pos "gunk seed"))
694+
(@make @pos "gunk seed"))
701695
702696
:flavor "A peevish and very prolific pile of puke that pokes with pseudopods. It resists most weapons, and even if you do manage to kill it, it leaves a seed behind.")
703697

0 commit comments

Comments
 (0)