jak-project/goal_src/levels/village3/assistant-village3.gc
water111 4a0ac6c155
[graphics] first half of shadow renderer (#1246)
* start on dma stuff

* temp

* temp

* add shadow cpu
2022-03-22 21:42:37 -04:00

236 lines
7.9 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: assistant-village3.gc
;; name in dgo: assistant-village3
;; dgos: L1, VI3
;; DECOMP BEGINS
(deftype assistant-villagec (process-taskable)
()
:heap-base #x110
:method-count-assert 53
:size-assert #x17c
:flag-assert #x350110017c
)
(defskelgroup *assistant-village3-sg* assistant-village3
0
3
((1 (meters 999999)))
:bounds (static-spherem 0 0 0 4)
:longest-edge (meters 0)
:shadow 2
)
(defmethod dummy-52 assistant-villagec ((obj assistant-villagec))
(let ((v1-1 (-> obj draw shadow-ctrl)))
(when v1-1
(let ((f0-0 (-> obj root-override trans y)))
(let ((a0-2 v1-1))
(set! (-> a0-2 settings bot-plane w) (- (+ -2048.0 f0-0)))
)
0
(set! (-> v1-1 settings top-plane w) (- (+ 1024.0 f0-0)))
)
0
)
)
(none)
)
(defmethod draw-npc-shadow assistant-villagec ((obj assistant-villagec))
(-> obj draw shadow-ctrl)
(cond
((and (-> obj draw shadow) (zero? (-> obj draw cur-lod)) (logtest? (-> obj draw status) (draw-status was-drawn)))
(let ((v1-9 (-> obj draw shadow-ctrl)))
(set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags)))
)
0
(update-direction-from-time-of-day (-> obj draw shadow-ctrl))
)
(else
(let ((v1-14 (-> obj draw shadow-ctrl)))
(logior! (-> v1-14 settings flags) 32)
)
0
)
)
(none)
)
(defmethod play-anim! assistant-villagec ((obj assistant-villagec) (arg0 symbol))
(set! (-> obj talk-message) (game-text-id press-to-talk-to-assistant))
(cond
((= (get-task-status (game-task finalboss-movies)) (task-status need-introduction))
(if arg0
(format
0
"ERROR: <GMJ>: ~S playing anim for task status ~S~%"
(-> obj name)
(task-status->string (current-status (-> obj tasks)))
)
)
(get-art-elem obj)
)
(else
(new 'static 'spool-anim :name "assistant-village3-reminder" :index 4 :parts 3 :command-list '())
)
)
)
(defmethod get-art-elem assistant-villagec ((obj assistant-villagec))
(-> obj draw art-group data 3)
)
(defmethod should-display? assistant-villagec ((obj assistant-villagec))
(and (task-closed? (game-task village3-button) (task-status need-introduction)) (not (sages-kidnapped?)))
)
(defmethod target-above-threshold? assistant-villagec ((obj assistant-villagec))
(the-as symbol (and *target* (< (-> (target-pos 0) z) -14245888.0)))
)
(defmethod TODO-RENAME-43 assistant-villagec ((obj assistant-villagec))
(when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 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.85714287 f0-2)
(play-ambient (-> obj ambient) "ASSTLP31" #f (-> obj root-override trans))
)
((< 0.71428573 f0-2)
(play-ambient (-> obj ambient) "ASSTLP32" #f (-> obj root-override trans))
)
((< 0.5714286 f0-2)
(play-ambient (-> obj ambient) "ASSTLP33" #f (-> obj root-override trans))
)
((< 0.42857143 f0-2)
(let ((v1-16 (get-task-status (game-task lavatube-end))))
(if (not (or (= v1-16 (task-status need-reward-speech)) (= v1-16 (task-status invalid))))
(play-ambient (-> obj ambient) "ASSTLP34" #f (-> obj root-override trans))
)
)
)
((< 0.2857143 f0-2)
(let ((v1-21 (get-task-status (game-task lavatube-end))))
(if (not (or (= v1-21 (task-status need-reward-speech)) (= v1-21 (task-status invalid))))
(play-ambient (-> obj ambient) "ASSTLP35" #f (-> obj root-override trans))
)
)
)
((< 0.14285715 f0-2)
(let ((v1-26 (get-task-status (game-task lavatube-end))))
(if (not (or (= v1-26 (task-status need-reward-speech)) (= v1-26 (task-status invalid))))
(play-ambient (-> obj ambient) "ASSTLP36" #f (-> obj root-override trans))
)
)
)
((nonzero? (get-task-status (game-task citadel-sage-green)))
(play-ambient (-> obj ambient) "ASSTLP37" #f (-> obj root-override trans))
)
)
)
)
)
(defstate idle (assistant-villagec)
: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
(TODO-RENAME-43 self)
(let ((a0-8 (-> self skel root-channel 0)))
(set! (-> a0-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 3)))
(set! (-> a0-8 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1))
)
(set! (-> a0-8 param 1) 1.0)
(set! (-> a0-8 frame-num) 0.0)
(joint-control-channel-group! a0-8 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!)
)
(until (ja-done? 0)
(suspend)
(let ((a0-9 (-> self skel root-channel 0)))
(set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1)))
(set! (-> a0-9 param 1) 1.0)
(joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!)
)
)
(let ((gp-0 (-> *display* base-frame-counter)))
(while (let* ((s5-0 (-> *display* base-frame-counter))
(f30-0 300.0)
(f28-0 0.16)
(f26-0 0.17000002)
(v1-31 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-32 (the-as number (logior #x3f800000 v1-31)))
)
(< (- s5-0 (the-as time-frame (the int (* f30-0 (+ f28-0 (* f26-0 (+ -1.0 (the-as float v1-32)))))))) gp-0)
)
(suspend)
)
)
(let ((gp-1 (-> self skel root-channel 0)))
(set! (-> gp-1 frame-group) (if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
)
(set! (-> gp-1 param 0) (ja-aframe 0.0 0))
(set! (-> gp-1 param 1) 1.0)
(set! (-> gp-1 frame-num) (ja-aframe 16.0 0))
(joint-control-channel-group!
gp-1
(if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
num-func-seek!
)
)
(until (ja-done? 0)
(suspend)
(let ((gp-2 (-> self skel root-channel 0)))
(set! (-> gp-2 param 0) (ja-aframe 0.0 0))
(set! (-> gp-2 param 1) 1.0)
(joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-seek!)
)
)
(let ((gp-3 (-> *display* base-frame-counter)))
(while (let* ((s5-1 (-> *display* base-frame-counter))
(f30-1 300.0)
(f28-1 0.16)
(f26-1 0.17000002)
(v1-56 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-57 (the-as number (logior #x3f800000 v1-56)))
)
(< (- s5-1 (the-as time-frame (the int (* f30-1 (+ f28-1 (* f26-1 (+ -1.0 (the-as float v1-57)))))))) gp-3)
)
(suspend)
)
)
)
(none)
)
)
(defmethod init-from-entity! assistant-villagec ((obj assistant-villagec) (arg0 entity-actor))
(dummy-40 obj arg0 *assistant-village3-sg* 3 31 (new 'static 'vector :w 4096.0) 5)
(set! (-> obj tasks) (get-task-control (game-task assistant-village3)))
(dummy-42 obj)
(none)
)