Skip to content

Commit

Permalink
teleporting lich
Browse files Browse the repository at this point in the history
  • Loading branch information
David O'Toole committed Dec 17, 2009
1 parent da04ecf commit 0dc6663
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 8 deletions.
17 changes: 11 additions & 6 deletions forest/enemy.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,10 @@
(column [player-column *world*]))
(let ((coords
(block searching
(dolist (dir '(:north :south :east :west))
(dolist (dir (car (one-of '((:north :south :east :west)
(:west :north :east :south)
(:east :north :south :west)
(:soutn :west :north :east)))))
(multiple-value-bind (r c) (step-in-direction row column dir)
(unless (and [obstacle-at-p *world* r c]
(< [distance-to-player self] 8))
Expand All @@ -238,7 +241,6 @@
[drop-cell *world* self r c]
(dotimes (i 10)
[drop self (clone =sparkles=)]))))))


(define-method attack lich (target)
[damage [get-player *world*] 10]
Expand All @@ -249,7 +251,7 @@
(define-method run lich ()
[expend-action-points self 6]
(when (and (null <screamed>)
(< [distance-to-player self] 15))
(< [distance-to-player self] 16))
(setf <screamed> t)
[say self "A scream of undead power chills you to the bone!"]
[play-sample self "lichscream"])
Expand All @@ -264,9 +266,12 @@
(percent-of-time 10 [teleport self])
(progn (setf <direction> (random-direction))
[>>move self direction])))
(progn (when (< 7 (random 10))
(setf <direction> (random-direction)))
[>>move self direction]))))))
(progn
[move self direction]
(when (and <screamed>
(< [distance-to-player self] 12))
(percent-of-time 12 [teleport self]))))))))


(define-method die lich ()
[say self "The lich dies!"]
Expand Down
1 change: 0 additions & 1 deletion forest/forest.org
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
** TODO [#B] more story stuff
** TODO [#B] oil flask bomb
** TODO [#B] rose found in the forest
** TODO [#B] teleporting lich next to player!
** TODO [#B] wolves are annoying
** TODO [#C] Command-Q should quit on mac ?
** TODO [#C] add emote code to XE2 and cells
Expand Down
17 changes: 17 additions & 0 deletions forest/forest.org_archive
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,23 @@ CLOSED: [2009-12-17 Thu 02:24]
:ARCHIVE_CATEGORY: forest
:ARCHIVE_TODO: TODO
:END:
* DONE [#B] teleporting lich next to player!
CLOSED: [2009-12-17 Thu 07:27]
:PROPERTIES:
:ARCHIVE_TIME: 2009-12-17 Thu 07:27
:ARCHIVE_FILE: ~/xe2/forest/forest.org
:ARCHIVE_CATEGORY: forest
:ARCHIVE_TODO: DONE
:END:
* DONE [#A] forest exits should be able to be in any column
:PROPERTIES:
:ARCHIVE_TIME: 2009-12-17 Thu 07:27
:ARCHIVE_FILE: ~/xe2/forest/forest.org
:ARCHIVE_CATEGORY: forest
:ARCHIVE_TODO: TODO
:END:





Expand Down
Binary file added forest/sparkles-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added forest/sparkles-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion forest/startup.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@
(defparameter *room-window-width* 800)
(defparameter *room-window-height* 600)

(defparameter *start-level* 3)
(defparameter *start-level* 1)

(defun init-forest ()
(xe2:message "Initializing Forest...")
Expand Down

0 comments on commit 0dc6663

Please sign in to comment.