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-09-28 20:42:00 -04:00
|
|
|
;; DECOMP BEGINS
|
2022-06-09 21:18:08 -04:00
|
|
|
|
2022-06-29 22:20:09 -04:00
|
|
|
(import "goal_src/jak1/import/farmer-ag.gc")
|
2021-09-28 20:42:00 -04:00
|
|
|
|
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
|
|
|
|
2022-05-19 21:30:14 -04:00
|
|
|
(defskelgroup *farmer-sg* farmer farmer-lod0-jg farmer-sitting-cycle-ja
|
|
|
|
((farmer-lod0-mg (meters 20)) (farmer-lod1-mg (meters 999999)))
|
|
|
|
:bounds (static-spherem 0 0 0 4)
|
|
|
|
:shadow farmer-shadow-mg
|
|
|
|
)
|
2021-08-18 21:33:31 -04:00
|
|
|
|
|
|
|
(defmethod play-anim! farmer ((obj farmer) (arg0 symbol))
|
2022-01-08 20:57:57 -05:00
|
|
|
(case (current-status (-> obj tasks))
|
|
|
|
(((task-status need-hint) (task-status need-introduction))
|
2021-08-18 21:33:31 -04:00
|
|
|
(if arg0
|
2022-01-08 20:57:57 -05:00
|
|
|
(close-status! (-> obj tasks) (task-status need-introduction))
|
|
|
|
)
|
|
|
|
(new 'static 'spool-anim :name "farmer-introduction" :index 6 :parts 5 :command-list '())
|
2021-08-18 21:33:31 -04:00
|
|
|
)
|
2022-01-08 20:57:57 -05:00
|
|
|
(((task-status need-reminder))
|
|
|
|
(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-08-18 21:33:31 -04:00
|
|
|
)
|
|
|
|
)
|
2022-01-08 20:57:57 -05:00
|
|
|
(((task-status need-reward-speech))
|
|
|
|
(when arg0
|
|
|
|
(set! (-> obj cell-for-task) (current-task (-> obj tasks)))
|
|
|
|
(close-current! (-> obj tasks))
|
|
|
|
)
|
|
|
|
(new 'static 'spool-anim :name "farmer-resolution" :index 9 :parts 4 :command-list '())
|
2021-08-18 21:33:31 -04:00
|
|
|
)
|
2022-01-08 20:57:57 -05:00
|
|
|
(else
|
|
|
|
(if arg0
|
|
|
|
(format
|
|
|
|
0
|
|
|
|
"ERROR: <GMJ>: ~S playing anim for task status ~S~%"
|
|
|
|
(-> obj name)
|
|
|
|
(task-status->string (current-status (-> obj tasks)))
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(-> obj draw art-group data 4)
|
2021-08-18 21:33:31 -04:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defmethod get-art-elem farmer ((obj farmer))
|
2022-01-08 20:57:57 -05:00
|
|
|
(case (current-status (-> obj tasks))
|
|
|
|
(((task-status need-hint) (task-status need-introduction) (task-status need-resolution) (task-status invalid))
|
2021-10-16 14:06:33 -04:00
|
|
|
(-> obj draw art-group data 4)
|
|
|
|
)
|
2022-01-08 20:57:57 -05:00
|
|
|
(else
|
|
|
|
(-> obj draw art-group data 5)
|
|
|
|
)
|
2021-08-18 21:33:31 -04:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defmethod TODO-RENAME-43 farmer ((obj farmer))
|
2022-02-12 12:26:19 -05:00
|
|
|
(when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj)
|
2022-06-09 21:18:08 -04:00
|
|
|
(let ((f0-2 (rand-float-gen)))
|
2022-01-08 20:57:57 -05:00
|
|
|
(cond
|
|
|
|
((< 0.8333333 f0-2)
|
|
|
|
(play-ambient (-> obj ambient) "FAR-LO1A" #f (-> obj root-override trans))
|
|
|
|
)
|
|
|
|
((< 0.6666667 f0-2)
|
|
|
|
(play-ambient (-> obj ambient) "FAR-AM01" #f (-> obj root-override trans))
|
|
|
|
)
|
|
|
|
((< 0.5 f0-2)
|
|
|
|
#f
|
|
|
|
)
|
|
|
|
((< 0.33333334 f0-2)
|
|
|
|
(play-ambient (-> obj ambient) "FAR-AM2A" #f (-> obj root-override trans))
|
|
|
|
)
|
|
|
|
((< 0.16666667 f0-2)
|
|
|
|
(play-ambient (-> obj ambient) "FAR-AM02" #f (-> obj root-override trans))
|
|
|
|
)
|
|
|
|
(else
|
|
|
|
#f
|
2021-08-18 21:33:31 -04:00
|
|
|
)
|
2022-01-08 20:57:57 -05:00
|
|
|
)
|
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))
|
2022-01-08 20:57:57 -05: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) (collide-kind enemy))
|
|
|
|
(set! (-> s4-0 collide-with) (collide-kind target))
|
|
|
|
(set! (-> s4-0 prim-core action) (collide-action solid))
|
|
|
|
(set! (-> s4-0 prim-core offense) (collide-offense indestructible))
|
|
|
|
(set-vector! (-> s4-0 local-sphere) 4096.0 8192.0 -4096.0 12288.0)
|
|
|
|
(set-root-prim! s5-0 s4-0)
|
|
|
|
(let ((s3-0 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
|
|
|
|
(set! (-> s3-0 prim-core collide-as) (collide-kind enemy))
|
|
|
|
(set! (-> s3-0 collide-with) (collide-kind target))
|
|
|
|
(set! (-> s3-0 prim-core action) (collide-action solid))
|
|
|
|
(set! (-> s3-0 prim-core offense) (collide-offense indestructible))
|
|
|
|
(set-vector! (-> s3-0 local-sphere) 4096.0 6144.0 -4096.0 8192.0)
|
|
|
|
(append-prim s4-0 s3-0)
|
|
|
|
)
|
|
|
|
(let ((s3-1 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
|
|
|
|
(set! (-> s3-1 prim-core collide-as) (collide-kind enemy))
|
|
|
|
(set! (-> s3-1 collide-with) (collide-kind target))
|
|
|
|
(set! (-> s3-1 prim-core action) (collide-action solid))
|
|
|
|
(set! (-> s3-1 prim-core offense) (collide-offense indestructible))
|
|
|
|
(set-vector! (-> s3-1 local-sphere) 4096.0 10240.0 -4096.0 8192.0)
|
|
|
|
(append-prim s4-0 s3-1)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
|
|
|
|
(backup-collide-with-as s5-0)
|
|
|
|
(set! (-> obj root-override) s5-0)
|
2021-08-18 21:33:31 -04:00
|
|
|
)
|
|
|
|
0
|
|
|
|
(none)
|
|
|
|
)
|
|
|
|
|
2021-11-15 19:05:28 -05:00
|
|
|
(defmethod init-from-entity! farmer ((obj farmer) (arg0 entity-actor))
|
2021-08-18 21:33:31 -04:00
|
|
|
(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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|