jak-project/test/decompiler/reference/levels/village2/gambler_REF.gc
ManDude 24578b64b9
proper support for hardcoded "time" types (#1141)
* hardcode `time-frame`things

* Update cam-states_REF.gc

* Update level-info_REF.gc

* update refs 1

* update refs 2

* update refs 3

* update refs 4

* update refs 5

* update detection and casting

* Update FormExpressionAnalysis.cpp

* update refs 6

* update mood decomp

* update refs 7

* update refs 8

* remove temp entity birth code

* update time-frame casts

* fix compiler

* hardcode stuff and fix some types

* fix some bitfield detection being wrong

* bug fixes

* detect seconds on adds with immediate

* update refs 9

* fix casts and rand-vu-int-range bugs (update refs 10)

* update refs 11

* update 12

* update 13

* update 14

* Update game-info_REF.gc

* improve cpad macros detection

* remove unused code

* update refs

* clang

* update source code

* Update cam-states.gc

* `lavatube-energy` finish

* update refs

* fix actor bank stuff

* Update navigate.gc

* reduce entity default stack size

* Update transformq-h.gc

* oops forgot these

* fix code and tests

* fix mood sound stuff

* Update load-dgo.gc

* Update README.md
2022-02-12 12:26:19 -05:00

290 lines
10 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; definition of type gambler
(deftype gambler (process-taskable)
()
:heap-base #x110
:method-count-assert 53
:size-assert #x17c
:flag-assert #x350110017c
)
;; definition for method 3 of type gambler
(defmethod inspect gambler ((obj gambler))
(let ((t9-0 (method-of-type process-taskable inspect)))
(t9-0 obj)
)
obj
)
;; failed to figure out what this is:
(defskelgroup *gambler-sg* gambler
0
5
((1 (meters 20)) (2 (meters 40)) (3 (meters 999999)))
:bounds (static-spherem 0 0 0 4)
:longest-edge (meters 0)
:shadow 4
)
;; definition for method 32 of type gambler
(defmethod play-anim! gambler ((obj gambler) (arg0 symbol))
(set! (-> obj talk-message) (game-text-id press-to-talk))
(case (current-status (-> obj tasks))
(((task-status need-hint) (task-status need-introduction))
(when arg0
(close-status! (-> obj tasks) (task-status need-introduction))
(close-specific-task! (game-task village2-gambler-money) (task-status need-introduction))
)
(new 'static 'spool-anim
:name "gambler-introduction-1"
:index 11
:parts 9
:command-list
'((0 want-levels village2 rolling)
(0 display-level rolling #f)
(29 joint "cameraB")
(103 joint "camera")
(231 joint "cameraB")
(730 display-level rolling display)
(730 want-force-vis rolling #t)
(732 alive "gorge-pusher-5")
(732 alive "gorge-pusher-6")
(732 alive "gorge-start-1")
(732 joint "camera")
(945 joint "cameraB")
(950 dead "gorge-pusher-5")
(950 dead "gorge-pusher-6")
(950 dead "gorge-start-1")
(950 display-level rolling #f)
(950 want-force-vis rolling #f)
)
)
)
(((task-status need-reminder))
(set! (-> obj skippable) #t)
(cond
((closed? (-> obj tasks) (game-task rolling-race) (task-status need-reward-speech))
(new 'static 'spool-anim :name "gambler-reminder-money" :index 13 :parts 2 :command-list '())
)
((closed? (-> obj tasks) (game-task village2-gambler-money) (task-status need-reward-speech))
(new 'static 'spool-anim :name "gambler-reminder-race" :index 12 :parts 2 :command-list '())
)
((zero? (get-reminder (-> obj tasks) 5))
(if arg0
(save-reminder (-> obj tasks) 1 5)
)
(new 'static 'spool-anim :name "gambler-reminder-race" :index 12 :parts 2 :command-list '())
)
(else
(if arg0
(save-reminder (-> obj tasks) 0 5)
)
(new 'static 'spool-anim :name "gambler-reminder-money" :index 13 :parts 2 :command-list '())
)
)
)
(((task-status need-reward-speech))
(if (not arg0)
(set! (-> obj will-talk) #t)
)
(case (current-task (-> obj tasks))
(((game-task rolling-race))
(when arg0
(set! (-> obj cell-for-task) (current-task (-> obj tasks)))
(close-current! (-> obj tasks))
)
(new 'static 'spool-anim :name "gambler-resolution-race" :index 14 :parts 3 :command-list '())
)
(else
(cond
(arg0
(set! (-> obj cell-for-task) (current-task (-> obj tasks)))
(close-current! (-> obj tasks))
(send-event *target* 'get-pickup 5 (- (-> *GAME-bank* money-task-inc)))
)
(else
(set! (-> obj talk-message) (game-text-id press-to-trade-money))
)
)
(new 'static 'spool-anim :name "gambler-resolution-money" :index 15 :parts 2 :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 7)
)
)
)
;; definition for method 31 of type gambler
(defmethod get-art-elem gambler ((obj gambler))
(-> obj draw art-group data 7)
)
;; definition for method 43 of type gambler
(defmethod TODO-RENAME-43 gambler ((obj gambler))
(when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 61440.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.9230769 f0-2)
(play-ambient (-> obj ambient) "GAM-AM01" #f (-> obj root-override trans))
)
((< 0.84615386 f0-2)
(play-ambient (-> obj ambient) "GAM-AM02" #f (-> obj root-override trans))
)
((< 0.7692308 f0-2)
(play-ambient (-> obj ambient) "GAM-AM03" #f (-> obj root-override trans))
)
((< 0.6923077 f0-2)
(play-ambient (-> obj ambient) "GAM-AM04" #f (-> obj root-override trans))
)
((< 0.61538464 f0-2)
(play-ambient (-> obj ambient) "GAM-AM05" #f (-> obj root-override trans))
)
((< 0.53846157 f0-2)
(play-ambient (-> obj ambient) "GAM-AM06" #f (-> obj root-override trans))
)
((< 0.46153846 f0-2)
(play-ambient (-> obj ambient) "GAM-AM07" #f (-> obj root-override trans))
)
((< 0.3846154 f0-2)
(play-ambient (-> obj ambient) "GAM-AM08" #f (-> obj root-override trans))
)
((< 0.30769232 f0-2)
(play-ambient (-> obj ambient) "GAM-AM09" #f (-> obj root-override trans))
)
((< 0.23076923 f0-2)
(if (not (task-closed? (game-task ogre-boss) (task-status need-reminder)))
(play-ambient (-> obj ambient) "GAM-AM10" #f (-> obj root-override trans))
)
)
((< 0.15384616 f0-2)
(play-ambient (-> obj ambient) "GAM-AM11" #f (-> obj root-override trans))
)
((< 0.07692308 f0-2)
(play-ambient (-> obj ambient) "GAM-AM12" #f (-> obj root-override trans))
)
(else
(play-ambient (-> obj ambient) "GAM-AM13" #f (-> obj root-override trans))
)
)
)
)
)
;; failed to figure out what this is:
(defstate idle (gambler)
:virtual #t
:code
(behavior ()
(when (!= (if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
(-> self draw art-group data 7)
)
(ja-channel-push! 1 60)
(let ((v1-6 (-> self skel root-channel 0)))
(set! (-> v1-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 7)))
)
)
(while #t
(let ((a0-9 (-> self skel root-channel 0)))
(set! (-> a0-9 frame-group) (if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
)
(set! (-> a0-9 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
data
0
length
)
-1
)
)
)
(set! (-> a0-9 param 1) 1.0)
(set! (-> a0-9 frame-num) 0.0)
(joint-control-channel-group!
a0-9
(if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
num-func-seek!
)
)
(until (ja-done? 0)
(suspend)
(let ((a0-10 (-> self skel root-channel 0)))
(set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1)))
(set! (-> a0-10 param 1) 1.0)
(joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!)
)
)
(TODO-RENAME-43 self)
(let* ((v1-38 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-39 (the-as number (logior #x3f800000 v1-38)))
(f0-9 (+ -1.0 (the-as float v1-39)))
)
(cond
((< f0-9 0.16666667)
(let ((a0-15 (-> self skel root-channel 0)))
(set! (-> a0-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 5)))
)
)
((< f0-9 0.33333334)
(let ((a0-16 (-> self skel root-channel 0)))
(set! (-> a0-16 frame-group) (the-as art-joint-anim (-> self draw art-group data 6)))
)
)
((< f0-9 0.5)
(let ((a0-17 (-> self skel root-channel 0)))
(set! (-> a0-17 frame-group) (the-as art-joint-anim (-> self draw art-group data 7)))
)
)
((< f0-9 0.6666667)
(let ((a0-18 (-> self skel root-channel 0)))
(set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 8)))
)
)
((< f0-9 0.8333333)
(let ((a0-19 (-> self skel root-channel 0)))
(set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 9)))
)
)
(else
(let ((a0-20 (-> self skel root-channel 0)))
(set! (-> a0-20 frame-group) (the-as art-joint-anim (-> self draw art-group data 10)))
)
)
)
)
)
(none)
)
)
;; definition for method 11 of type gambler
(defmethod init-from-entity! gambler ((obj gambler) (arg0 entity-actor))
(dummy-40 obj arg0 *gambler-sg* 3 32 (new 'static 'vector :w 4096.0) 5)
(set! (-> obj tasks) (get-task-control (game-task rolling-race)))
(set! (-> obj sound-flava) (music-flava gambler))
(set! (-> obj draw light-index) (the-as uint 4))
(dummy-42 obj)
(none)
)