diff options
author | Boutade <thegoofist@protonmail.com> | 2019-10-18 09:10:46 -0500 |
---|---|---|
committer | Boutade <thegoofist@protonmail.com> | 2019-10-18 09:10:46 -0500 |
commit | abd60654f2ad13f32f616dba88c85c3ba7690b2d (patch) | |
tree | c3bc83caeb4a749ffbad6e7cc4f81c6bcbf7329c /the-price-of-a-cup-of-coffee.lisp | |
parent | 24b37656e3dda8e490dc9ab7c197a804bb192247 (diff) |
getting sick and getting better
still needs tweaking, but the system functions
Diffstat (limited to 'the-price-of-a-cup-of-coffee.lisp')
-rw-r--r-- | the-price-of-a-cup-of-coffee.lisp | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/the-price-of-a-cup-of-coffee.lisp b/the-price-of-a-cup-of-coffee.lisp index 337c6d6..9444427 100644 --- a/the-price-of-a-cup-of-coffee.lisp +++ b/the-price-of-a-cup-of-coffee.lisp @@ -229,15 +229,32 @@ :source-rect (get-expression "nauseated") :dest-rect *sickness-rect*))) -(defun make-sick (hero) - (unless (sick-p hero) - (setf (sick-p hero) t) - (setf (walk-speed hero) (round (* 0.5 (walk-speed hero)))))) - -(defun get-better (hero) - (when (sick-p hero) - (setf (sick-p hero) nil) - (setf (walk-speed hero) (* 2 (walk-speed hero))))) + + + +(defun make-sick () + (unless (sick-p *nance*) + (setf (sick-p *nance*) t) + (setf (walk-speed *nance*) (round (* 0.5 (walk-speed *nance*)))))) + +(defun get-better () + (when (sick-p *nance*) + (setf (sick-p *nance*) nil) + (setf (walk-speed *nance*) (* 2 (walk-speed *nance*))))) + +(defun sickness-check () + (if (>= (percent *cold-meter*) 0.9) + (when (and (not (sick-p *nance*)) + (cointoss (percent *stress-meter*))) + (make-sick)) + (when (and (sick-p *nance*) + (cointoss (- 1.0 (percent *stress-meter*)))) + (get-better)))) + +(defun check-sickness-loop () + (sickness-check) + (pause-then 1000 #'check-sickness-loop)) + (defun in-front-of-door-p () |