2020-10-26 21:08:24 -04:00
|
|
|
;;-*-Lisp-*-
|
2020-09-04 14:44:23 -04:00
|
|
|
(in-package goal)
|
|
|
|
|
|
|
|
;; name: assistant-lavatube.gc
|
|
|
|
;; name in dgo: assistant-lavatube
|
|
|
|
;; dgos: L1, LAV
|
|
|
|
|
2021-09-28 20:42:00 -04:00
|
|
|
;; DECOMP BEGINS
|
2022-06-09 21:18:08 -04:00
|
|
|
|
2021-09-28 20:42:00 -04:00
|
|
|
(deftype assistant-lavatube-start (process-taskable)
|
|
|
|
()
|
|
|
|
:heap-base #x110
|
|
|
|
:method-count-assert 53
|
|
|
|
:size-assert #x17c
|
|
|
|
:flag-assert #x350110017c
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2022-05-19 21:30:14 -04:00
|
|
|
(defskelgroup *assistant-lavatube-start-sg* assistant-lavatube-start assistant-lavatube-start-lod0-jg assistant-lavatube-start-idle-ja
|
|
|
|
((assistant-lavatube-start-lod0-mg (meters 999999)))
|
|
|
|
:bounds (static-spherem 0 0 0 4)
|
|
|
|
:shadow assistant-lavatube-start-shadow-mg
|
|
|
|
)
|
2021-09-28 20:42:00 -04:00
|
|
|
|
2023-09-26 10:17:00 -04:00
|
|
|
(defmethod play-anim! assistant-lavatube-start ((this assistant-lavatube-start) (arg0 symbol))
|
|
|
|
(case (current-status (-> this tasks))
|
2022-01-15 20:01:38 -05:00
|
|
|
(((task-status need-reward-speech))
|
2021-09-28 20:42:00 -04:00
|
|
|
(if arg0
|
2023-09-26 10:17:00 -04:00
|
|
|
(close-current! (-> this tasks))
|
2021-09-28 20:42:00 -04:00
|
|
|
)
|
2022-01-15 20:01:38 -05:00
|
|
|
(new 'static 'spool-anim
|
|
|
|
:name "assistant-lavatube-start-resolution"
|
|
|
|
:index 5
|
|
|
|
:parts 11
|
2022-06-09 21:18:08 -04:00
|
|
|
:command-list '((232 joint "cameraB") (491 joint "camera") (866 joint "cameraB") (1061 joint "camera"))
|
2022-01-15 20:01:38 -05:00
|
|
|
)
|
2021-09-28 20:42:00 -04:00
|
|
|
)
|
2022-01-15 20:01:38 -05:00
|
|
|
(else
|
|
|
|
(if arg0
|
|
|
|
(format
|
|
|
|
0
|
|
|
|
"ERROR: <GMJ>: ~S playing anim for task status ~S~%"
|
2023-09-26 10:17:00 -04:00
|
|
|
(-> this name)
|
|
|
|
(task-status->string (current-status (-> this tasks)))
|
2022-01-15 20:01:38 -05:00
|
|
|
)
|
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
(get-art-elem this)
|
2021-09-28 20:42:00 -04:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2023-09-26 10:17:00 -04:00
|
|
|
(defmethod get-art-elem assistant-lavatube-start ((this assistant-lavatube-start))
|
|
|
|
(-> this draw art-group data 3)
|
2021-09-28 20:42:00 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
(defstate hidden (assistant-lavatube-start)
|
|
|
|
:virtual #t
|
2022-06-09 21:18:08 -04:00
|
|
|
:trans (behavior ()
|
2022-01-15 20:01:38 -05:00
|
|
|
((-> (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
|
2021-09-28 20:42:00 -04:00
|
|
|
)
|
2022-01-15 20:01:38 -05:00
|
|
|
(else
|
2023-09-26 10:17:00 -04:00
|
|
|
(set-time! (-> self state-time))
|
2022-01-15 20:01:38 -05:00
|
|
|
#f
|
|
|
|
)
|
2021-09-28 20:42:00 -04:00
|
|
|
)
|
2022-01-15 20:01:38 -05:00
|
|
|
(and (not (closed? (-> self tasks) (game-task lavatube-start) (task-status need-reward-speech)))
|
|
|
|
(not (movie?))
|
|
|
|
(not (level-hint-displayed?))
|
|
|
|
(not (and *cheat-mode* (cpad-hold? 0 l3)))
|
2023-09-26 10:17:00 -04:00
|
|
|
(not (time-elapsed? (-> self state-time) (seconds 10)))
|
2022-01-15 20:01:38 -05:00
|
|
|
)
|
2021-09-28 20:42:00 -04:00
|
|
|
)
|
2022-01-15 20:01:38 -05:00
|
|
|
(hide-hud)
|
|
|
|
(kill-current-level-hint '() '(sidekick voicebox) 'exit)
|
2023-04-07 23:32:35 -04:00
|
|
|
(when (and (seen-text? *game-info* (text-id assistant-lavatube-need-cells))
|
2022-01-15 20:01:38 -05:00
|
|
|
(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))
|
2021-09-28 20:42:00 -04:00
|
|
|
)
|
2022-01-15 20:01:38 -05:00
|
|
|
(let ((v1-27 gp-0))
|
|
|
|
(set! (-> v1-27 height) (the float 80))
|
2021-09-28 20:42:00 -04:00
|
|
|
)
|
2022-01-15 20:01:38 -05:00
|
|
|
(let ((v1-28 gp-0))
|
|
|
|
(set! (-> v1-28 scale) 0.8)
|
|
|
|
)
|
|
|
|
(set! (-> gp-0 flags) (font-flags shadow kerning middle large))
|
2023-09-22 05:54:49 -04:00
|
|
|
(print-game-text (lookup-text! *common-text* (text-id assistant-lavatube-need-cells-text) #f) gp-0 #f 128 22)
|
2021-09-28 20:42:00 -04:00
|
|
|
)
|
|
|
|
)
|
2022-01-15 20:01:38 -05:00
|
|
|
(level-hint-spawn
|
2023-04-07 23:32:35 -04:00
|
|
|
(text-id assistant-lavatube-need-cells)
|
2022-01-15 20:01:38 -05:00
|
|
|
"asstva74"
|
|
|
|
(the-as entity #f)
|
|
|
|
*entity-pool*
|
|
|
|
(game-task none)
|
2021-09-28 20:42:00 -04:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defstate idle (assistant-lavatube-start)
|
|
|
|
:virtual #t
|
2022-06-09 21:18:08 -04:00
|
|
|
:code (behavior ()
|
2022-05-19 21:30:14 -04:00
|
|
|
(loop
|
|
|
|
(when (!= (ja-group) (get-art-elem self))
|
|
|
|
(ja-channel-push! 1 (seconds 0.05))
|
2023-10-06 10:42:16 -04:00
|
|
|
(ja :group! assistant-lavatube-start-idle-ja)
|
2021-09-28 20:42:00 -04:00
|
|
|
)
|
2022-01-15 20:01:38 -05:00
|
|
|
(let* ((f30-0 2.0)
|
|
|
|
(v1-7 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
|
|
|
|
(v1-8 (the-as number (logior #x3f800000 v1-7)))
|
|
|
|
)
|
|
|
|
(countdown (gp-0 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-8)))) 2))
|
2022-05-19 21:30:14 -04:00
|
|
|
(ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0)
|
2022-01-15 20:01:38 -05:00
|
|
|
(until (ja-done? 0)
|
|
|
|
(suspend)
|
2022-05-19 21:30:14 -04:00
|
|
|
(ja :num! (seek!))
|
2022-01-15 20:01:38 -05:00
|
|
|
)
|
|
|
|
)
|
2021-09-28 20:42:00 -04:00
|
|
|
)
|
2022-05-19 21:30:14 -04:00
|
|
|
(ja-channel-push! 1 (seconds 0.05))
|
2023-10-06 10:42:16 -04:00
|
|
|
(ja-no-eval :group! assistant-lavatube-start-idle-b-ja :num! (seek!) :frame-num 0.0)
|
2022-01-15 20:01:38 -05:00
|
|
|
(until (ja-done? 0)
|
|
|
|
(suspend)
|
2022-05-19 21:30:14 -04:00
|
|
|
(ja :num! (seek!))
|
2021-09-28 20:42:00 -04:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2023-09-26 10:17:00 -04:00
|
|
|
(defmethod should-display? assistant-lavatube-start ((this assistant-lavatube-start))
|
|
|
|
(first-any (-> this tasks) #t)
|
|
|
|
(= (current-status (-> this tasks)) (task-status need-reward-speech))
|
2021-09-28 20:42:00 -04:00
|
|
|
)
|
|
|
|
|
2023-09-26 10:17:00 -04:00
|
|
|
(defmethod init-from-entity! assistant-lavatube-start ((this assistant-lavatube-start) (arg0 entity-actor))
|
|
|
|
(process-taskable-method-40 this arg0 *assistant-lavatube-start-sg* 3 29 (new 'static 'vector :w 4096.0) 5)
|
|
|
|
(set! (-> this tasks) (get-task-control (game-task lavatube-start)))
|
|
|
|
(first-any (-> this tasks) #t)
|
|
|
|
(process-taskable-method-42 this)
|
2021-09-28 20:42:00 -04:00
|
|
|
(none)
|
|
|
|
)
|