summaryrefslogtreecommitdiff
path: root/model.lisp
diff options
context:
space:
mode:
authorGrant Shoshin Shangreaux <shoshin@cicadas.surf>2023-03-05 11:33:08 -0600
committerGrant Shoshin Shangreaux <shoshin@cicadas.surf>2023-03-05 11:33:08 -0600
commit89d0d687992b41f7f0f9b0d3da19d9d587f06010 (patch)
tree8d1dabc9cf9c79358b16c23959681fc299219e57 /model.lisp
parent04df19a88a381e6bdc60d7f566e02e99b40c0087 (diff)
Add: page-render-mode, model cleanup, tavern view wip
Diffstat (limited to 'model.lisp')
-rw-r--r--model.lisp48
1 files changed, 39 insertions, 9 deletions
diff --git a/model.lisp b/model.lisp
index 0598cf7..fef01da 100644
--- a/model.lisp
+++ b/model.lisp
@@ -103,7 +103,7 @@
:initarg :campaign
:initform nil
:type campaign
- :documentation "A hero may be in at mostk one campaign at a time."))
+ :documentation "A hero may be in at most one campaign at a time."))
(:metaclass db:persistent-class))
@@ -123,51 +123,75 @@
:reader campaign-creator
:initarg :creator
:initform (error "campaigns must have a creator")
- :documentation "The hero instance of the user who made this campaign.")
+ :type player
+ :documentation "The player instance of the user who made this campaign.")
(seers
:accessor campaign-seers
:initarg :seers
:initform nil
+ :type (or nil (cons player))
:documentation "Seers are the people who peer out into their instruments of divination that heroes may go on quests.")
(title
- :accessor campaign-title
+ :accessor title
:initarg :title
- :initform (error "A campaign needs a title"))
+ :initform (error "A campaign needs a title")
+ :type string)
(rumors
:accessor campaign-rumors
- :initarg nil
+ :initform nil
+ :type (or nil (cons rumor))
:documentation "Beasts, Monsters, and Hazards rumored to be lurking about."))
(:metaclass db:persistent-class)
(:documentation "A campaign is a container of quests. Campaigns are expected to be engaged with on a particular schedule, and are run by particular people."))
+(defclass rumor (db:store-object)
+ ((reporter
+ :reader rumor-reporter
+ :initarg :reporter
+ :type player
+ :documentation "The player who hast reported the vile rumor.")
+ (content
+ :accessor rumor-content
+ :initform (error "A rumor must have content")
+ :initarg :content
+ :type string
+ :documentation "A description of the supposed peril that awaits heroes in a particular campaign."))
+ (:metaclass db:persistent-class)
+ (:documentation "Transcript of a rumor reported by some player related to a Campaign."))
+
(defclass quest (game-object)
((campaign
:reader quest-campaign
:initarg :campaign
:initform (error "No quest can fall outside the scope of a campaign.")
+ :type campaign
:index-type idx:hash-index
:index-reader quests-in-campaign
:documentation "The campaign to which this quest belongs")
(name
:accessor quest-name
:initarg :name
+ :type string
:initform (format nil "~a" (gensym "QUEST")))
(horizon-of-hope
:accessor horizon-of-hope
:initarg :deadline
+ :type integer
:initform nil
:documentation "When all hope becomes lost.")
(heroes
:accessor heroes-on-quest
:initarg :heroes
:initform nil
+ :type (or nil (cons hero))
:documentation "A list of heroes in this quest. Join and flight dates are logged in the chronicle.")
- (startedp
- :accessor quest-startedp
+ (inception
+ :accessor quest-inception
:initform nil
- :documentation "Indication of whether the quest is active or not - i.e. whether heroes are on this quest."))
+ :type (or nil integer)
+ :documentation "Time at which the quest began."))
(:metaclass db:persistent-class)
- (:documentation "A collection of hazards"))
+ (:documentation "A collection of hazards with a deadline and start date which heroes will attack."))
(defclass hazard (game-object)
((quest
@@ -175,6 +199,12 @@
:index-type idx:hash-index
:index-reader hazards-in-quest
:documentation "The quest to which this hazard belongs. Initially it is unbound. It becomes boudn when the hazard is added to a quest.")
+ (description
+ :accessor description
+ :initarg :description
+ :initform ""
+ :type string
+ :documentation "")
(overcomep
:accessor is-overcome
:initform nil