This repository was archived by the owner on Aug 20, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed
mods/hello-world/world/region Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 436
436
(decode-payload (first (parse-sexps (depot :read-from (depot :entry " init.lisp" depot) ' character))) (region +world+ ) depot ' save-v0)))
437
437
438
438
(defmethod edit ((action (eql ' save-initial-state)) (editor editor))
439
+ (setf (clock +world+ ) 0.0 )
440
+ (reset (stats (u ' player)))
439
441
(let ((depot (depot :ensure-entry " region" (depot +world+ ) :type :directory )))
440
442
(depot :with-open (tx (depot :ensure-entry " init.lisp" depot) :output ' character)
441
443
(princ* (encode-payload (region +world+ ) NIL depot ' save-v0) (depot :to-stream tx)))))
Original file line number Diff line number Diff line change 1
- (:create-new nil :ephemeral ((player :inventory nil :unlocked nil :stats #S (stats :distance 91591.80466548586d0 :play-time 634.0799858272076d0 :kills 0 :deaths 97 :longest-session 0 :secrets-found 0 :money-accrued 0 :chunks-uncovered 148 :secrets-total 0 :chunks-total 1 ) :palette 0 :sword-level 0 :map-markers nil :nametag " Stranger" :location (-216.33525 -145.0 ) :velocity (0.0 0.0 ) :direction 1 :state :normal :animation stand :frame 1 :health 1050.0 :level 1 :experience 100 :stun-time 0.0 :active-effects nil ) (chunk-3640 :unlocked-p t )))
1
+ (:create-new nil :ephemeral ((player :inventory nil :unlocked nil :stats #S (stats :distance 91591.80466548586d0 :play-time 0.0 :kills 0 :deaths 97 :longest-session 0 :secrets-found 0 :money-accrued 0 :chunks-uncovered 148 :secrets-total 0 :chunks-total 1 ) :palette 0 :sword-level 0 :map-markers nil :nametag " Stranger" :location (-216.33525 -145.0 ) :velocity (0.0 0.0 ) :direction 1 :state :normal :animation stand :frame 1 :health 1050.0 :level 1 :experience 100 :stun-time 0.0 :active-effects nil ) (chunk-3640 :unlocked-p t )))
Original file line number Diff line number Diff line change 27
27
28
28
; ; FIXME: track longest-session
29
29
30
+ (defmethod reset ((stats stats))
31
+ (setf (stats-distance stats) 0d0 )
32
+ (setf (stats-play-time stats) 0d0 )
33
+ (setf (stats-kills stats) 0 )
34
+ (setf (stats-deaths stats) 0 )
35
+ (setf (stats-longest-session stats) 0 )
36
+ (setf (stats-secrets-found stats) 0 )
37
+ (setf (stats-money-accrued stats) 0 )
38
+ (setf (stats-chunks-uncovered stats) 0 )
39
+ (setf (stats-secrets-total stats) 0 )
40
+ (setf (stats-chunks-total stats) 0 ))
41
+
30
42
(defmethod hurt :after ((animatable animatable) (attacker stats-entity))
31
43
(when (<= (health animatable) 0 )
32
44
(incf (stats-kills (stats attacker)))))
You can’t perform that action at this time.
0 commit comments