Files
jak-project/test/decompiler/reference/levels/village1/farmer_REF.gc
T
ManDude 7ce58f709f process-spawn + pretty printer improvements (#1428)
* some jp support to fix some errors in the original game

* music fade toggle

* recognize `process-new` macros!!

* strip casts in this macro

* rename macro

* fix cast typecheck

* update source 1

* detect kernel stack case

* less boilerplate

* `manipy-spawn` special case

* pretty printer improvements

* revert dumb thing from earlier

* use shell detection on `send-event`

* fix some events

* remove unused argument

* detect `static-attack-info` and add `CondNoElse` to shell detect

* better `attack-info` detect

* support `process-spawn` in multi-lets

* detect `rand-float-gen` pt 1

* detect as return value

* detect in `countdown` and  `dotimes`

* oops this wasnt working

* fancier `send-event`s

* clang

* update source!!

* fix tests

* fine jeez

* uh okay

* fix some accidental regressions

* fix more regressions

* regression fixes

* fix big bug...

* extra safety!
2022-06-10 02:18:08 +01:00

162 lines
5.5 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
(import "goal_src/import/farmer-ag.gc")
;; definition of type farmer
(deftype farmer (process-taskable)
()
:heap-base #x110
:method-count-assert 53
:size-assert #x17c
:flag-assert #x350110017c
)
;; definition for method 3 of type farmer
(defmethod inspect farmer ((obj farmer))
(let ((t9-0 (method-of-type process-taskable inspect)))
(t9-0 obj)
)
obj
)
;; failed to figure out what this is:
(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
)
;; definition for method 32 of type farmer
(defmethod play-anim! farmer ((obj farmer) (arg0 symbol))
(case (current-status (-> obj tasks))
(((task-status need-hint) (task-status need-introduction))
(if arg0
(close-status! (-> obj tasks) (task-status need-introduction))
)
(new 'static 'spool-anim :name "farmer-introduction" :index 6 :parts 5 :command-list '())
)
(((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 '())
)
)
)
(((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 '())
)
(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)
)
)
)
;; definition for method 31 of type farmer
(defmethod get-art-elem farmer ((obj farmer))
(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
(-> obj draw art-group data 5)
)
)
)
;; definition for method 43 of type farmer
(defmethod TODO-RENAME-43 farmer ((obj farmer))
(when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj)
(let ((f0-2 (rand-float-gen)))
(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
)
)
)
)
)
;; definition for method 41 of type farmer
;; INFO: Return type mismatch int vs none.
(defmethod initialize-collision farmer ((obj farmer) (arg0 int) (arg1 vector))
(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)
)
0
(none)
)
;; definition for method 11 of type farmer
(defmethod init-from-entity! farmer ((obj farmer) (arg0 entity-actor))
(dummy-40 obj arg0 *farmer-sg* 3 25 (new 'static 'vector :w 4096.0) 5)
(set! (-> obj root-override nav-radius) 40960.0)
(nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f))
(set! (-> obj tasks) (get-task-control (game-task village1-yakow)))
(dummy-42 obj)
(none)
)