Skip to content

Commit

Permalink
Implemented gunks.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kodiologist committed Feb 1, 2024
1 parent cb13b0c commit 3d1ff15
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 3 deletions.
49 changes: 49 additions & 0 deletions simalq/tile/monster.hy
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,55 @@
:flavor "What looks like a big mobile puddle of slime is actually a man-sized amoeba. It retains the ability to divide (but not, fortunately, to grow), and its lack of distinct internal anatomy makes arrows pretty useless. It has just enough intelligence to notice that you're standing next to it and try to envelop you in its gloppy bulk.")
(deftile "s " "a gunk seed" Monster
:color 'dark-orange
:iq-ix 181
:destruction-points 10
:field-defaults (dict
:growth-timer 5)
:mutable-fields #("growth_timer")
:act (meth []
"Gunk Up — The monster's growth timer decreases by 1. If the timer has hit 0, it then transforms into an adult gunk."
(-= @growth-timer 1)
(when (= @growth-timer 0)
(make-monster @pos "gunk")
(@rm-from-map)))
:suffix-dict (meth []
(dict
#** (.suffix-dict (super))
:gt @growth-timer))
:info-bullets (meth [#* extra]
(.info-bullets (super)
#("Growth timer" @growth-timer)))
:flavor "A seed of discord the size of a basketball that can flood a room insde of a minute. Think fast.")
(deftile "O " "a gunk" Summoner
:color 'dark-orange
:iq-ix 182
:destruction-points 0
:immune #(PlayerMelee MundaneArrow MagicArrow)
:damage-melee 2
:!summon-frequency (f/ 1 5)
:act (meth []
(doc f"Gunky — If the monster can attack, it does. Otherwise, it builds up {@summon-frequency} summoning power per turn, which it can use to summon gunk seeds per `Generate`.")
(or
(@try-to-attack-player)
(@summon :stem "gunk seed" :frequency @summon-frequency :hp 1)))
:hook-normal-destruction (meth []
"A gunk seed is created in its square."
(make-monster @pos "gunk seed"))
: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.")
(deftile "S " "a specter" Approacher
:iq-ix 50
:destruction-points 100
Expand Down
2 changes: 0 additions & 2 deletions simalq/tile/unimplemented.hy
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@
[178 "magical_barrier_generator"]
[179 "magical_barrier_east"]
[180 "magical_barrier_north"]
[181 "gunk_seed"]
[182 "gunk"]
[183 "magical_key"]
[184 "giant_ant"]
[185 "dark_brain"]
Expand Down
1 change: 1 addition & 0 deletions tests/test_item.hy
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@

(defn test-wand-death []
(setv map-marks {
"s " "shade"
"☉G" ["generator" :summon-class "ghost"]
"☉o" ["generator" :summon-class "orc"]
"##" "cracked wall"})
Expand Down
45 changes: 44 additions & 1 deletion tests/test_monster.hy
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
hyrule [do-n])
(import
fractions [Fraction :as f/]
tests.lib [init assert-at assert-full-name assert-hp wait set-square wk shoot mv-player use-item top]
tests.lib [init assert-at assert-full-name assert-hp assert-textmap wait set-square wk shoot mv-player use-item top]
simalq.util [StatusEffect]
simalq.geometry [Direction Pos ray at burst]
simalq.game-state [G])
Expand Down Expand Up @@ -650,6 +650,49 @@
(assert-full-name [3 1] f"a blob (HP 2, wd ....., pw 0)"))


(defn test-gunk []
(setv marks {
"O " "gunk"
"s " "gunk seed"})
(init [
:map "
O . . .
████████
@ ██s . "
:map-marks marks])

; Gunks take 5 turns to reproduce, and gunk seeds take 5 turns to
; grow up.
(wait 4)
(assert-textmap :map-marks marks :text "
O . . .
████████
@ ██s . ")
(wait)
(assert-textmap :map-marks marks :text "
O s . .
████████
@ ██O . ")
; The timing continues to all line up when gunks that are continuously in
; the reality bubble grow or reproduce.
(wait 4)
(assert-textmap :map-marks marks :text "
O s . .
████████
@ ██O . ")
(wait)
(assert-textmap :map-marks marks :text "
O O . .
████████
@ ██O s ")
; A slain adult gunk leaves behind a seed.
(use-item "standard bomb" 1 1)
(assert-textmap :map-marks marks :text "
s s . .
████████
@ ██s . "))


(defn test-specter []

(defn check [turns #* middle-tiles]
Expand Down

0 comments on commit 3d1ff15

Please sign in to comment.