Skip to content

Commit 8b3e407

Browse files
committed
Implemented cyclopes.
1 parent a540c7d commit 8b3e407

File tree

3 files changed

+38
-3
lines changed

3 files changed

+38
-3
lines changed

simalq/tile/monster.hy

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,12 @@
214214
(when (is d None)
215215
; The player is in our square. Just give up.
216216
(return F))
217-
(when reverse
218-
(setv d d.opposite))
217+
(if reverse
218+
(setv d d.opposite)
219+
(when (and (adjacent? @pos G.player.pos) (in d Direction.orths))
220+
; We're already as close as we can get, without entering the
221+
; player's square.
222+
(return F)))
219223
220224
(setv target None)
221225
(defn ok-target []
@@ -895,6 +899,15 @@
895899
:flavor "An animated statue with dull senses and unbelievable strength.\n\n I have a big ol' golem.\n I made it out of clay.\n And when it's dry and ready,\n Oh people I shall slay.")
896900
897901
902+
(deftile "C " "a cyclops" Approacher
903+
:iq-ix 164
904+
:destruction-points 100
905+
906+
:immune #(PlayerMelee MundaneArrow MagicArrow)
907+
908+
:flavor "A one-eyed gentle giant carrying a shield the size of a refrigerator, against which even magic arrows are useless. Abiding by a philosophy of nonviolent resistance against kyriarchy, he will do his best to obstruct you without hurting a hair on your head.")
909+
910+
898911
(defclass Lord [Approacher Summoner]
899912
900913
(setv

simalq/tile/unimplemented.hy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
(do-mac `(do ~@(gfor [iq-ix stem] [
2020

2121
[152 "random_gate"]
22-
[164 "cyclops"]
2322
[178 "magical_barrier_generator"]
2423
[184 "giant_ant"]
2524
[185 "dark_brain"]

tests/test_monster.hy

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -913,6 +913,29 @@
913913
(assert-at [3 0] "golem"))
914914

915915

916+
(defn test-cyclops []
917+
918+
; Cyclopes approach, but don't attack.
919+
(init [:tiles ['floor "cyclops"]])
920+
(wait 1)
921+
(assert-at 'E "cyclops")
922+
(wait 5)
923+
(assert (= G.player.hp 100))
924+
; They're immune to swords and arrows.
925+
(wk 'E)
926+
(shoot 'E)
927+
(assert-at 'E "cyclops")
928+
929+
; Contra IQ, cyclopes will try to get orthogonal to you even if
930+
; they're diagonally adjacent and there are no diagonal blockers.
931+
(init [
932+
:map "
933+
@ .
934+
. C"])
935+
(wait)
936+
(assert-at 'S "cyclops"))
937+
938+
916939
(defn test-lord []
917940
"This test effectively covers archdevils and Dark Princes, which are
918941
special cases of Lords of the Undead."

0 commit comments

Comments
 (0)