|
@@ -77,6 +77,10 @@
|
77
|
77
|
(health-regen :initarg :health-regen :initform 1 :type fixnum)
|
78
|
78
|
(color :initarg :color :initform (color-from-name "#1919ff"))))
|
79
|
79
|
|
|
80
|
+(defclass tomb (tile-entity)
|
|
81
|
+ ((codepoint :initform #x2616)
|
|
82
|
+ (color :initform (color-from-name "yellow"))))
|
|
83
|
+
|
80
|
84
|
(defclass minion (mobile)
|
81
|
85
|
((color :initarg :color :initform (color-from-name "yellow"))))
|
82
|
86
|
|
|
@@ -448,10 +452,20 @@
|
448
|
452
|
(when location
|
449
|
453
|
(setf (gethash location (game-map-mobiles map)) enemy)))))))
|
450
|
454
|
|
|
455
|
+(defun spawn-tombs (map)
|
|
456
|
+ (loop for room in (crawler::rooms (game-map-dungeon map)) do
|
|
457
|
+ (with-slots ((x1 crawler::x1) (x2 crawler::x2) (y1 crawler::y1) (y2 crawler::y2)) room
|
|
458
|
+ (when (= 2 (random 5))
|
|
459
|
+ (let* ((location (nearest-open-tile (gethash (calc-location x2 y2 map) (game-map-terrain map)) map))
|
|
460
|
+ (tomb (make-instance 'tomb :location location)))
|
|
461
|
+ (when location
|
|
462
|
+ (setf (gethash location (game-map-terrain map)) tomb)))))))
|
|
463
|
+
|
451
|
464
|
(defun initialize-map (map player)
|
452
|
465
|
(fill-map-from-crawler map player)
|
453
|
466
|
(setf (gethash (slot-value player 'location) (game-map-mobiles map)) player)
|
454
|
467
|
(spawn-enemies map player)
|
|
468
|
+ (spawn-tombs map)
|
455
|
469
|
map)
|
456
|
470
|
|
457
|
471
|
(defun get-neighbors (tile map layer &key (filter-fun #'identity))
|