slowly changing to a messages based model of events

This commit is contained in:
left_adjoint 2023-02-26 21:16:11 -08:00
parent 78b1d28634
commit e1541e1196
1 changed files with 9 additions and 7 deletions

View File

@ -60,13 +60,8 @@
(attack :accessor :attack)
(food :accessor :food)
(level :accessor :level :initform 1)
(yours :reader :yours :initarg yours)
(on-damage :accessor :on-damage :initarg :on-damage)
(on-bought :accessor :on-bought :initarg :on-bought)
(on-faint :accessor :on-faint :initarg :on-faint)
(on-sell :accessor :on-sell :initarg :on-faint)
(on-endturn :accessor :on-endturn :initarg :on-endturn)
(on-startcombat :accessor :on-startcombat :initarg :on-startcombat)))
(team :reader :team :initarg team)
(handler :reader :handler :initarg handler)))
;; I want to write this in a mostly functional way, where the whole thing is an explicit function from player-state to player-state
;; part of the idea here is to emphasize a text based interchange format so people can even have different autopets clients as
@ -81,3 +76,10 @@
;;;; happened
;;;; so do we want a bunch of different handler functions like I wrote above or should we, instead, just have a message type that
;;;; includes information about what happened and who it involved
;;;;let's prototype out what messages should look like
;;;; '(damage player1 3 4) the third pet on player1's team takes 4 damage
;;;; '(faint player2 2) the second pet on player2's team has fainted
;;;; '(ate apple 3) the third pet on the player's team at an apple
;;;; '(gain player1 3 4 2) the third pet on player one's team gains 4 health and 2 attack