jak-project/goal_src/levels/firecanyon/assistant-firecanyon.gc
ManDude 80a002f8c0
[decomp] entity birth (#964)
* make birthing work

* fix float representation on defskelgroup

* test

* update

* debugger improvements & dont upload aux sprites

* ?

* fix progress

* fixes

* fixes

* Create bea.gd

* fix test

* fix xmm reg clobbering in kernel (water)

* cleanup cam-start

* clear gamepad state every frame

* allow controller connects and disconnects while running
2021-11-15 19:05:28 -05:00

852 lines
24 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: assistant-firecanyon.gc
;; name in dgo: assistant-firecanyon
;; dgos: L1, FIC
;; DECOMP BEGINS
(deftype assistant-firecanyon (process-taskable)
()
:heap-base #x110
:method-count-assert 53
:size-assert #x17c
:flag-assert #x350110017c
)
(defskelgroup *assistant-firecanyon-sg* assistant-firecanyon
0
3
((1 (meters 999999)))
:bounds (static-spherem 0 0 0 4)
:longest-edge (meters 0)
:shadow 2
)
(defmethod
play-anim!
assistant-firecanyon
((obj assistant-firecanyon) (arg0 symbol))
(case (current-status (-> obj tasks))
(((task-status need-reward-speech))
(if arg0
(close-current! (-> obj tasks))
)
(new 'static 'spool-anim
:name "assistant-firecanyon-resolution"
:index 13
:parts 11
:command-list
'(
(0
want-levels
village1
firecanyon
)
((the binteger 151)
joint
"cameraB"
)
((the binteger 346)
joint
"camera"
)
((the binteger 346)
shadow
self
#f
)
((the binteger 461)
joint
"cameraB"
)
((the binteger 546)
joint
"camera"
)
((the binteger 636)
joint
"cameraB"
)
((the binteger 695)
alive
"balloon-12"
)
((the binteger 696)
joint
"camera"
)
((the binteger 821)
alive
"balloon-16"
)
((the binteger 822)
joint
"cameraB"
)
((the binteger 962) joint "camera") ((the binteger 1268) shadow self #t)
)
)
)
(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 3)
)
)
)
(defmethod get-art-elem assistant-firecanyon ((obj assistant-firecanyon))
(if (= (current-status (-> obj tasks)) (task-status invalid))
(-> obj draw art-group data 8)
(-> obj draw art-group data 3)
)
)
(defstate hidden (assistant-firecanyon)
:virtual #t
:trans
(behavior ()
((-> (method-of-type process-taskable hidden) trans))
(when (and (cond
((and
*target*
(>=
61440.0
(vector-vector-distance
(-> self root-override trans)
(-> *target* control trans)
)
)
)
#t
)
(else
(set! (-> self state-time) (-> *display* base-frame-counter))
#f
)
)
(and
(not
(closed?
(-> self tasks)
(game-task firecanyon-assistant)
(task-status need-reward-speech)
)
)
(not (movie?))
(not (level-hint-displayed?))
(not
(and
*cheat-mode*
(logtest? (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons l3))
)
)
(< (- (-> *display* base-frame-counter) (-> self state-time)) 3000)
)
)
(hide-hud)
(kill-current-level-hint '() '(sidekick voicebox) 'exit)
(when
(and
(seen-text? *game-info* (game-text-id firecanyon-not-enough-cells))
(hud-hidden?)
(can-grab-display? self)
(not (-> *setting-control* current hint))
)
(let
((gp-0
(new
'stack
'font-context
*font-default-matrix*
32
160
0.0
(font-color default)
(font-flags shadow kerning)
)
)
)
(let ((v1-26 gp-0))
(set! (-> v1-26 width) (the float 448))
)
(let ((v1-27 gp-0))
(set! (-> v1-27 height) (the float 80))
)
(let ((v1-28 gp-0))
(set! (-> v1-28 scale) 0.8)
)
(set! (-> gp-0 flags) (font-flags shadow kerning middle large))
(print-game-text
(lookup-text!
*common-text*
(game-text-id firecanyon-collect-cells-text)
#f
)
gp-0
#f
128
22
)
)
)
(level-hint-spawn
(game-text-id firecanyon-not-enough-cells)
"asstvb09"
(the-as entity #f)
*entity-pool*
(game-task none)
)
)
(none)
)
)
(defstate idle (assistant-firecanyon)
:virtual #t
:code
(behavior ()
(if (!= (if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
(get-art-elem self)
)
(ja-channel-push! 1 15)
)
(while #t
(let ((gp-0 #t))
(cond
((= (current-status (-> self tasks)) (task-status invalid))
(let* ((v1-8 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-9 (the-as number (logior #x3f800000 v1-8)))
)
(when (< (+ -1.0 (the-as float v1-9)) 0.5)
(let ((v1-14 (-> self skel root-channel 0)))
(set!
(-> v1-14 frame-group)
(the-as art-joint-anim (-> self draw art-group data 8))
)
)
(let* ((f30-0 2.0)
(v1-16
(/ (the-as int (rand-uint31-gen *random-generator*)) 256)
)
(v1-17 (the-as number (logior #x3f800000 v1-16)))
)
(countdown
(gp-1 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-17)))) 3))
(let ((a0-15 (-> self skel root-channel 0)))
(set!
(-> a0-15 frame-group)
(if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
)
(set!
(-> a0-15 param 0)
(the float (+ (-> (if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
data
0
length
)
-1
)
)
)
(set! (-> a0-15 param 1) 1.0)
(set! (-> a0-15 frame-num) 0.0)
(joint-control-channel-group!
a0-15
(if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
num-func-seek!
)
)
(until (ja-done? 0)
(suspend)
(let ((a0-16 (-> self skel root-channel 0)))
(set!
(-> a0-16 param 0)
(the float (+ (-> a0-16 frame-group data 0 length) -1))
)
(set! (-> a0-16 param 1) 1.0)
(joint-control-channel-group-eval!
a0-16
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
)
)
(set! gp-0 #f)
)
)
(when
(or
gp-0
(let*
((v1-53 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-54 (the-as number (logior #x3f800000 v1-53)))
)
(< (+ -1.0 (the-as float v1-54)) 0.5)
)
)
(let ((a0-20 (-> self skel root-channel 0)))
(set!
(-> a0-20 frame-group)
(the-as art-joint-anim (-> self draw art-group data 9))
)
(set!
(-> a0-20 param 0)
(the
float
(+
(->
(the-as art-joint-anim (-> self draw art-group data 9))
data
0
length
)
-1
)
)
)
(set! (-> a0-20 param 1) 1.0)
(set! (-> a0-20 frame-num) 0.0)
(joint-control-channel-group!
a0-20
(the-as art-joint-anim (-> self draw art-group data 9))
num-func-seek!
)
)
(until (ja-done? 0)
(suspend)
(let ((a0-21 (-> self skel root-channel 0)))
(set!
(-> a0-21 param 0)
(the float (+ (-> a0-21 frame-group data 0 length) -1))
)
(set! (-> a0-21 param 1) 1.0)
(joint-control-channel-group-eval!
a0-21
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
(let ((v1-81 (-> self skel root-channel 0)))
(set!
(-> v1-81 frame-group)
(the-as art-joint-anim (-> self draw art-group data 10))
)
)
(let* ((f30-1 2.0)
(v1-83 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-84 (the-as number (logior #x3f800000 v1-83)))
)
(countdown
(gp-2 (+ (the int (* f30-1 (+ -1.0 (the-as float v1-84)))) 3))
(let ((a0-28 (-> self skel root-channel 0)))
(set! (-> a0-28 frame-group) (if (> (-> self skel active-channels) 0)
(->
self
skel
root-channel
0
frame-group
)
)
)
(set!
(-> a0-28 param 0)
(the float (+ (-> (if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
data
0
length
)
-1
)
)
)
(set! (-> a0-28 param 1) 1.0)
(set! (-> a0-28 frame-num) 0.0)
(joint-control-channel-group!
a0-28
(if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
num-func-seek!
)
)
(until (ja-done? 0)
(suspend)
(let ((a0-29 (-> self skel root-channel 0)))
(set!
(-> a0-29 param 0)
(the float (+ (-> a0-29 frame-group data 0 length) -1))
)
(set! (-> a0-29 param 1) 1.0)
(joint-control-channel-group-eval!
a0-29
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
)
)
(let ((a0-31 (-> self skel root-channel 0)))
(set!
(-> a0-31 frame-group)
(the-as art-joint-anim (-> self draw art-group data 11))
)
(set!
(-> a0-31 param 0)
(the
float
(+
(->
(the-as art-joint-anim (-> self draw art-group data 11))
data
0
length
)
-1
)
)
)
(set! (-> a0-31 param 1) 1.0)
(set! (-> a0-31 frame-num) 0.0)
(joint-control-channel-group!
a0-31
(the-as art-joint-anim (-> self draw art-group data 11))
num-func-seek!
)
)
(until (ja-done? 0)
(suspend)
(let ((a0-32 (-> self skel root-channel 0)))
(set!
(-> a0-32 param 0)
(the float (+ (-> a0-32 frame-group data 0 length) -1))
)
(set! (-> a0-32 param 1) 1.0)
(joint-control-channel-group-eval!
a0-32
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
)
(let* ((v1-140 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-141 (the-as number (logior #x3f800000 v1-140)))
)
(when (< (+ -1.0 (the-as float v1-141)) 0.25)
(let ((v1-146 (-> self skel root-channel 0)))
(set!
(-> v1-146 frame-group)
(the-as art-joint-anim (-> self draw art-group data 12))
)
)
(let ((a0-39 (-> self skel root-channel 0)))
(set! (-> a0-39 frame-group) (if (> (-> self skel active-channels) 0)
(->
self
skel
root-channel
0
frame-group
)
)
)
(set!
(-> a0-39 param 0)
(the float (+ (-> (if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
data
0
length
)
-1
)
)
)
(set! (-> a0-39 param 1) 1.0)
(set! (-> a0-39 frame-num) 0.0)
(joint-control-channel-group!
a0-39
(if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
num-func-seek!
)
)
(until (ja-done? 0)
(suspend)
(let ((a0-40 (-> self skel root-channel 0)))
(set!
(-> a0-40 param 0)
(the float (+ (-> a0-40 frame-group data 0 length) -1))
)
(set! (-> a0-40 param 1) 1.0)
(joint-control-channel-group-eval!
a0-40
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
)
)
)
(else
(let* ((v1-176 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-177 (the-as number (logior #x3f800000 v1-176)))
)
(when (< (+ -1.0 (the-as float v1-177)) 0.8)
(let ((v1-182 (-> self skel root-channel 0)))
(set!
(-> v1-182 frame-group)
(the-as art-joint-anim (-> self draw art-group data 3))
)
)
(let* ((f30-2 4.0)
(v1-184
(/ (the-as int (rand-uint31-gen *random-generator*)) 256)
)
(v1-185 (the-as number (logior #x3f800000 v1-184)))
)
(countdown
(gp-3 (+ (the int (* f30-2 (+ -1.0 (the-as float v1-185)))) 8))
(let ((a0-49 (-> self skel root-channel 0)))
(set!
(-> a0-49 frame-group)
(if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
)
(set!
(-> a0-49 param 0)
(the float (+ (-> (if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
data
0
length
)
-1
)
)
)
(set! (-> a0-49 param 1) 1.0)
(set! (-> a0-49 frame-num) 0.0)
(joint-control-channel-group!
a0-49
(if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
num-func-seek!
)
)
(until (ja-done? 0)
(suspend)
(let ((a0-50 (-> self skel root-channel 0)))
(set!
(-> a0-50 param 0)
(the float (+ (-> a0-50 frame-group data 0 length) -1))
)
(set! (-> a0-50 param 1) 1.0)
(joint-control-channel-group-eval!
a0-50
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
)
)
(set! gp-0 #f)
)
)
(when
(or
gp-0
(let*
((v1-221 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-222 (the-as number (logior #x3f800000 v1-221)))
)
(< (+ -1.0 (the-as float v1-222)) 0.5)
)
)
(let ((a0-54 (-> self skel root-channel 0)))
(set!
(-> a0-54 frame-group)
(the-as art-joint-anim (-> self draw art-group data 4))
)
(set!
(-> a0-54 param 0)
(the
float
(+
(->
(the-as art-joint-anim (-> self draw art-group data 4))
data
0
length
)
-1
)
)
)
(set! (-> a0-54 param 1) 1.0)
(set! (-> a0-54 frame-num) 0.0)
(joint-control-channel-group!
a0-54
(the-as art-joint-anim (-> self draw art-group data 4))
num-func-seek!
)
)
(until (ja-done? 0)
(suspend)
(let ((a0-55 (-> self skel root-channel 0)))
(set!
(-> a0-55 param 0)
(the float (+ (-> a0-55 frame-group data 0 length) -1))
)
(set! (-> a0-55 param 1) 1.0)
(joint-control-channel-group-eval!
a0-55
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
(let ((v1-249 (-> self skel root-channel 0)))
(set!
(-> v1-249 frame-group)
(the-as art-joint-anim (-> self draw art-group data 5))
)
)
(let* ((f30-3 2.0)
(v1-251
(/ (the-as int (rand-uint31-gen *random-generator*)) 256)
)
(v1-252 (the-as number (logior #x3f800000 v1-251)))
)
(countdown
(gp-4 (+ (the int (* f30-3 (+ -1.0 (the-as float v1-252)))) 3))
(let ((a0-62 (-> self skel root-channel 0)))
(set! (-> a0-62 frame-group) (if (> (-> self skel active-channels) 0)
(->
self
skel
root-channel
0
frame-group
)
)
)
(set!
(-> a0-62 param 0)
(the float (+ (-> (if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
data
0
length
)
-1
)
)
)
(set! (-> a0-62 param 1) 1.0)
(set! (-> a0-62 frame-num) 0.0)
(joint-control-channel-group!
a0-62
(if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
num-func-seek!
)
)
(until (ja-done? 0)
(suspend)
(let ((a0-63 (-> self skel root-channel 0)))
(set!
(-> a0-63 param 0)
(the float (+ (-> a0-63 frame-group data 0 length) -1))
)
(set! (-> a0-63 param 1) 1.0)
(joint-control-channel-group-eval!
a0-63
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
)
)
(let ((a0-65 (-> self skel root-channel 0)))
(set!
(-> a0-65 frame-group)
(the-as art-joint-anim (-> self draw art-group data 6))
)
(set!
(-> a0-65 param 0)
(the
float
(+
(->
(the-as art-joint-anim (-> self draw art-group data 6))
data
0
length
)
-1
)
)
)
(set! (-> a0-65 param 1) 1.0)
(set! (-> a0-65 frame-num) 0.0)
(joint-control-channel-group!
a0-65
(the-as art-joint-anim (-> self draw art-group data 6))
num-func-seek!
)
)
(until (ja-done? 0)
(suspend)
(let ((a0-66 (-> self skel root-channel 0)))
(set!
(-> a0-66 param 0)
(the float (+ (-> a0-66 frame-group data 0 length) -1))
)
(set! (-> a0-66 param 1) 1.0)
(joint-control-channel-group-eval!
a0-66
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
)
(let* ((v1-308 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-309 (the-as number (logior #x3f800000 v1-308)))
)
(when (< (+ -1.0 (the-as float v1-309)) 0.5)
(let ((v1-314 (-> self skel root-channel 0)))
(set!
(-> v1-314 frame-group)
(the-as art-joint-anim (-> self draw art-group data 7))
)
)
(let* ((f30-4 2.0)
(v1-316
(/ (the-as int (rand-uint31-gen *random-generator*)) 256)
)
(v1-317 (the-as number (logior #x3f800000 v1-316)))
)
(countdown
(gp-5 (+ (the int (* f30-4 (+ -1.0 (the-as float v1-317)))) 3))
(let ((a0-75 (-> self skel root-channel 0)))
(set!
(-> a0-75 frame-group)
(if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
)
(set!
(-> a0-75 param 0)
(the float (+ (-> (if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
data
0
length
)
-1
)
)
)
(set! (-> a0-75 param 1) 1.0)
(set! (-> a0-75 frame-num) 0.0)
(joint-control-channel-group!
a0-75
(if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
num-func-seek!
)
)
(until (ja-done? 0)
(suspend)
(let ((a0-76 (-> self skel root-channel 0)))
(set!
(-> a0-76 param 0)
(the float (+ (-> a0-76 frame-group data 0 length) -1))
)
(set! (-> a0-76 param 1) 1.0)
(joint-control-channel-group-eval!
a0-76
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
)
)
)
)
)
)
)
)
(none)
)
)
(defmethod should-display? assistant-firecanyon ((obj assistant-firecanyon))
(first-any (-> obj tasks) #t)
(= (current-status (-> obj tasks)) (task-status need-reward-speech))
)
(defmethod
init-from-entity!
assistant-firecanyon
((obj assistant-firecanyon) (arg0 entity-actor))
(dummy-40
obj
arg0
*assistant-firecanyon-sg*
3
29
(new 'static 'vector :w 4096.0)
5
)
(set! (-> obj tasks) (get-task-control (game-task firecanyon-assistant)))
(first-any (-> obj tasks) #t)
(dummy-42 obj)
(none)
)