src/entities/jewelery.lisp @ b1c0b37e9c86

Tweak
author Steve Losh <steve@stevelosh.com>
date Sun, 08 Jan 2017 00:31:45 +0000
parents 083f3f90f805
children f377744f622c
(in-package :ap.entities)

(defparameter *gemstones*
  (read-file-into-form "data/gemstones.lisp"))

(defparameter *jewelery*
  #("earring"
    "ring"
    "bracelet"
    "necklace"
    "ankle bracelet"
    "barette"
    "pin"
    "brooch"
    "hat pin"
    "cuff link"
    "locket"
    "medallion"))

(define-entity jewelery (visible coords holdable))

(defun random-jewelery-description ()
  (destructuring-bind (article gem)
      (random-elt *gemstones*)
    (format nil "~A ~A ~A" article gem (random-elt *jewelery*))))

(defun make-jewelery (x y)
  (create-entity 'jewelery
    :coords/x x
    :coords/y y
    :visible/glyph "*"
    :visible/color ap::+green-black+
    :holdable/description (random-jewelery-description)))