2020-10-26 21:08:24 -04:00
|
|
|
;;-*-Lisp-*-
|
2020-09-04 14:44:23 -04:00
|
|
|
(in-package goal)
|
|
|
|
|
|
|
|
;; name: farmer.gc
|
|
|
|
;; name in dgo: farmer
|
|
|
|
;; dgos: L1, VI1
|
|
|
|
|
2021-08-18 21:33:31 -04:00
|
|
|
(define-extern *farmer-sg* skeleton-group)
|
|
|
|
|
2021-09-28 20:42:00 -04:00
|
|
|
;; DECOMP BEGINS
|
|
|
|
|
2021-08-18 21:33:31 -04:00
|
|
|
(deftype farmer (process-taskable)
|
|
|
|
()
|
|
|
|
:heap-base #x110
|
|
|
|
:method-count-assert 53
|
|
|
|
:size-assert #x17c
|
|
|
|
:flag-assert #x350110017c
|
|
|
|
)
|
|
|
|
|
2021-09-28 20:42:00 -04:00
|
|
|
|
2021-08-18 21:33:31 -04:00
|
|
|
(let
|
|
|
|
((v1-1
|
|
|
|
(new 'static 'skeleton-group
|
|
|
|
:art-group-name "farmer"
|
|
|
|
:bounds (new 'static 'vector :w 16384.0)
|
|
|
|
:max-lod 1
|
|
|
|
:version #x6
|
|
|
|
:shadow 3
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(set! (-> v1-1 jgeo) 0)
|
|
|
|
(set! (-> v1-1 janim) 4)
|
|
|
|
(set! (-> v1-1 mgeo 0) (the-as uint 1))
|
|
|
|
(set! (-> v1-1 lod-dist 0) 81920.0)
|
|
|
|
(set! (-> v1-1 mgeo 1) (the-as uint 2))
|
|
|
|
(set! (-> v1-1 lod-dist 1) 4095996000.0)
|
|
|
|
(set! *farmer-sg* v1-1)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defmethod play-anim! farmer ((obj farmer) (arg0 symbol))
|
|
|
|
(case (current-status (-> obj tasks))
|
2021-10-16 14:06:33 -04:00
|
|
|
(((task-status need-hint) (task-status need-introduction))
|
2021-08-18 21:33:31 -04:00
|
|
|
(if arg0
|
|
|
|
(close-status! (-> obj tasks) (task-status need-introduction))
|
|
|
|
)
|
|
|
|
(new 'static 'spool-anim
|
|
|
|
:name "farmer-introduction"
|
|
|
|
:index 6
|
|
|
|
:parts 5
|
|
|
|
:command-list '()
|
|
|
|
)
|
|
|
|
)
|
2021-10-16 14:06:33 -04:00
|
|
|
(((task-status need-reminder))
|
2021-08-18 21:33:31 -04:00
|
|
|
(set! (-> obj skippable) #t)
|
|
|
|
(cond
|
|
|
|
((zero? (get-reminder (-> obj tasks) 0))
|
|
|
|
(if arg0
|
|
|
|
(save-reminder (-> obj tasks) 1 0)
|
|
|
|
)
|
|
|
|
(new 'static 'spool-anim
|
|
|
|
:name "farmer-reminder-1"
|
|
|
|
:index 7
|
|
|
|
:parts 2
|
|
|
|
:command-list '()
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(else
|
|
|
|
(if arg0
|
|
|
|
(save-reminder (-> obj tasks) 0 0)
|
|
|
|
)
|
|
|
|
(new 'static 'spool-anim
|
|
|
|
:name "farmer-reminder-2"
|
|
|
|
:index 8
|
|
|
|
:parts 2
|
|
|
|
:command-list '()
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2021-10-16 14:06:33 -04:00
|
|
|
(((task-status need-reward-speech))
|
2021-08-18 21:33:31 -04:00
|
|
|
(when arg0
|
2021-10-16 14:06:33 -04:00
|
|
|
(set! (-> obj cell-for-task) (current-task (-> obj tasks)))
|
2021-08-18 21:33:31 -04:00
|
|
|
(close-current! (-> obj tasks))
|
|
|
|
)
|
|
|
|
(new 'static 'spool-anim
|
|
|
|
:name "farmer-resolution"
|
|
|
|
:index 9
|
|
|
|
:parts 4
|
|
|
|
:command-list '()
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(else
|
|
|
|
(if arg0
|
|
|
|
(format
|
|
|
|
0
|
|
|
|
"ERROR: <GMJ>: ~S playing anim for task status ~S~%"
|
|
|
|
(-> obj name)
|
2021-10-16 14:06:33 -04:00
|
|
|
(task-status->string (current-status (-> obj tasks)))
|
2021-08-18 21:33:31 -04:00
|
|
|
)
|
|
|
|
)
|
|
|
|
(-> obj draw art-group data 4)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defmethod get-art-elem farmer ((obj farmer))
|
2021-10-16 14:06:33 -04:00
|
|
|
(case (current-status (-> obj tasks))
|
|
|
|
(((task-status need-hint)
|
|
|
|
(task-status need-introduction)
|
|
|
|
(task-status need-resolution)
|
|
|
|
(task-status invalid)
|
|
|
|
)
|
|
|
|
(-> obj draw art-group data 4)
|
|
|
|
)
|
|
|
|
(else
|
2021-08-18 21:33:31 -04:00
|
|
|
(-> obj draw art-group data 5)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defmethod TODO-RENAME-43 farmer ((obj farmer))
|
|
|
|
(when
|
|
|
|
(TODO-RENAME-10
|
|
|
|
(-> obj ambient)
|
|
|
|
(new 'stack-no-clear 'vector)
|
|
|
|
9000
|
|
|
|
122880.0
|
|
|
|
obj
|
|
|
|
)
|
|
|
|
(let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
|
|
|
|
(v1-4 (the-as number (logior #x3f800000 v1-3)))
|
|
|
|
(f0-2 (+ -1.0 (the-as float v1-4)))
|
|
|
|
)
|
|
|
|
(cond
|
|
|
|
((< 0.8333333 f0-2)
|
2021-10-16 14:06:33 -04:00
|
|
|
(play-ambient (-> obj ambient) "FAR-LO1A" #f (-> obj root-override trans))
|
2021-08-18 21:33:31 -04:00
|
|
|
)
|
|
|
|
((< 0.6666667 f0-2)
|
2021-10-16 14:06:33 -04:00
|
|
|
(play-ambient (-> obj ambient) "FAR-AM01" #f (-> obj root-override trans))
|
2021-08-18 21:33:31 -04:00
|
|
|
)
|
|
|
|
((< 0.5 f0-2)
|
2021-09-28 20:42:00 -04:00
|
|
|
#f
|
2021-08-18 21:33:31 -04:00
|
|
|
)
|
|
|
|
((< 0.33333334 f0-2)
|
2021-10-16 14:06:33 -04:00
|
|
|
(play-ambient (-> obj ambient) "FAR-AM2A" #f (-> obj root-override trans))
|
2021-08-18 21:33:31 -04:00
|
|
|
)
|
|
|
|
((< 0.16666667 f0-2)
|
2021-10-16 14:06:33 -04:00
|
|
|
(play-ambient (-> obj ambient) "FAR-AM02" #f (-> obj root-override trans))
|
2021-08-18 21:33:31 -04:00
|
|
|
)
|
|
|
|
(else
|
2021-09-28 20:42:00 -04:00
|
|
|
#f
|
2021-08-18 21:33:31 -04:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2021-09-28 20:42:00 -04:00
|
|
|
(defmethod initialize-collision farmer ((obj farmer) (arg0 int) (arg1 vector))
|
2021-08-18 21:33:31 -04:00
|
|
|
(let
|
|
|
|
((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player))))
|
|
|
|
(let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0)))
|
|
|
|
(set! (-> s4-0 prim-core collide-as) (the-as uint 256))
|
|
|
|
(set! (-> s4-0 collide-with) (the-as uint 16))
|
|
|
|
(set! (-> s4-0 prim-core action) (the-as uint 1))
|
|
|
|
(set! (-> s4-0 prim-core offense) 4)
|
|
|
|
(set-vector! (-> s4-0 local-sphere) 4096.0 8192.0 -4096.0 12288.0)
|
2021-08-22 20:46:37 -04:00
|
|
|
(dummy-46 s5-0)
|
2021-08-18 21:33:31 -04:00
|
|
|
(let ((s3-0 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
|
|
|
|
(set! (-> s3-0 prim-core collide-as) (the-as uint 256))
|
|
|
|
(set! (-> s3-0 collide-with) (the-as uint 16))
|
|
|
|
(set! (-> s3-0 prim-core action) (the-as uint 1))
|
|
|
|
(set! (-> s3-0 prim-core offense) 4)
|
|
|
|
(set-vector! (-> s3-0 local-sphere) 4096.0 6144.0 -4096.0 8192.0)
|
|
|
|
)
|
2021-08-22 20:46:37 -04:00
|
|
|
(dummy-28 s4-0)
|
2021-08-18 21:33:31 -04:00
|
|
|
(let ((s3-1 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
|
|
|
|
(set! (-> s3-1 prim-core collide-as) (the-as uint 256))
|
|
|
|
(set! (-> s3-1 collide-with) (the-as uint 16))
|
|
|
|
(set! (-> s3-1 prim-core action) (the-as uint 1))
|
|
|
|
(set! (-> s3-1 prim-core offense) 4)
|
|
|
|
(set-vector! (-> s3-1 local-sphere) 4096.0 10240.0 -4096.0 8192.0)
|
|
|
|
)
|
2021-08-22 20:46:37 -04:00
|
|
|
(dummy-28 s4-0)
|
2021-08-18 21:33:31 -04:00
|
|
|
)
|
|
|
|
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
|
2021-08-22 20:46:37 -04:00
|
|
|
(dummy-50 s5-0)
|
2021-09-28 20:42:00 -04:00
|
|
|
(set! (-> obj root-override) s5-0)
|
2021-08-18 21:33:31 -04:00
|
|
|
)
|
|
|
|
0
|
|
|
|
(none)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defmethod copy-defaults! farmer ((obj farmer) (arg0 res-lump))
|
|
|
|
(dummy-40 obj arg0 *farmer-sg* 3 25 (new 'static 'vector :w 4096.0) 5)
|
2021-09-28 20:42:00 -04:00
|
|
|
(set! (-> obj root-override nav-radius) 40960.0)
|
|
|
|
(nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f))
|
2021-08-18 21:33:31 -04:00
|
|
|
(set! (-> obj tasks) (get-task-control (game-task village1-yakow)))
|
|
|
|
(dummy-42 obj)
|
|
|
|
(none)
|
|
|
|
)
|
2021-09-28 20:42:00 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|