;;-*-Lisp-*- (in-package goal) ;; definition of type dig-sinking-plat (deftype dig-sinking-plat (rigid-body-platform) ((anchor-point vector :inline) (sync sync-linear :inline) (last-ridden-time time-frame) (prev-pos float) (path-pos float) (surface-height float) (once basic) (bubbling-sound-id sound-id) ) ) ;; definition for method 3 of type dig-sinking-plat (defmethod inspect ((this dig-sinking-plat)) (when (not this) (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type rigid-body-platform inspect))) (t9-0 this) ) (format #t "~2Tanchor-point: #~%" (-> this anchor-point)) (format #t "~2Tsync: #~%" (-> this sync)) (format #t "~2Tlast-ridden-time: ~D~%" (-> this last-ridden-time)) (format #t "~2Tprev-pos: ~f~%" (-> this prev-pos)) (format #t "~2Tpath-pos: ~f~%" (-> this path-pos)) (format #t "~2Tsurface-height: ~f~%" (-> this surface-height)) (format #t "~2Tonce: ~A~%" (-> this once)) (format #t "~2Tbubbling-sound-id: ~D~%" (-> this bubbling-sound-id)) (label cfg-4) this ) ;; failed to figure out what this is: (defskelgroup skel-dig-sinking-plat dig-sinking-plat dig-sinking-plat-lod0-jg dig-sinking-plat-idle-ja ((dig-sinking-plat-lod0-mg (meters 999999))) :bounds (static-spherem 0 -2 0 5.25) ) ;; definition for method 29 of type dig-sinking-plat ;; WARN: Return type mismatch int vs none. (defmethod rigid-body-object-method-29 ((this dig-sinking-plat) (arg0 float)) (call-parent-method this arg0) (rigid-body-platform-method-56 this (-> this anchor-point)) 0 (none) ) ;; definition for method 32 of type dig-sinking-plat ;; WARN: Return type mismatch int vs none. (defmethod allocate-and-init-cshape ((this dig-sinking-plat)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) (the-as (function collide-shape-moving collide-query vector vector object) nothing) ) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) (set! (-> s4-0 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) (set! (-> s4-0 prim-core action) (collide-action solid rideable)) (set! (-> s4-0 transform-index) 3) (set-vector! (-> s4-0 local-sphere) 0.0 -8192.0 0.0 21504.0) (set! (-> s5-0 total-prims) (the-as uint 1)) (set! (-> s5-0 root-prim) s4-0) ) (pusher-init s5-0) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (let ((v1-16 (-> s5-0 root-prim))) (set! (-> s5-0 backup-collide-as) (-> v1-16 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-16 prim-core collide-with)) ) (set! (-> this root) s5-0) ) 0 (none) ) ;; definition for symbol *dig-sinking-platform-constants*, type rigid-body-platform-constants (define *dig-sinking-platform-constants* (new 'static 'rigid-body-platform-constants :info (new 'static 'rigid-body-info :mass 4.0 :inv-mass 0.25 :linear-damping 0.9 :angular-damping 0.48 :friction-factor 0.1 :cm-offset-joint (new 'static 'vector :y -8192.0 :w 1.0) :inertial-tensor-box (new 'static 'array meters 3 (meters 6) (meters 4) (meters 6)) ) :extra (new 'static 'rigid-body-object-extra-info :max-time-step 0.02 :gravity (meters 80) :idle-distance (meters 200) :attack-force-scale 2.0 ) :name '*dig-sinking-platform-constants* :drag-factor 2.0 :buoyancy-factor 1.2 :max-buoyancy-depth (meters 2) :player-weight (meters 80) :player-bonk-factor 0.5 :player-dive-factor 1.0 :player-force-distance (meters 30) :player-force-clamp (meters 1000000) :player-force-timeout #x1e :explosion-force (meters 1000) :control-point-count 5 :platform #t :sound-name "mud-plat" ) ) ;; definition for method 53 of type dig-sinking-plat (defmethod rigid-body-platform-method-53 ((this dig-sinking-plat) (arg0 vector)) (-> this surface-height) ) ;; definition for method 37 of type dig-sinking-plat (defmethod rigid-body-object-method-37 ((this dig-sinking-plat)) (when (not (logtest? (-> this path flags) (path-control-flag not-found))) (set! (-> this prev-pos) (-> this path-pos)) (set! (-> this path-pos) (get-norm! (-> this sync) 0)) (when (< (-> this path-pos) (-> this prev-pos)) (let ((a0-2 (-> this skel root-channel 0))) (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-2 param 0) (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 2)) frames num-frames) -1)) ) (set! (-> a0-2 param 1) 1.0) (set! (-> a0-2 frame-num) 0.0) (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-seek!) ) (let ((a0-3 (-> this skel root-channel 0))) (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group frames num-frames) -1))) (set! (-> a0-3 param 1) 1.0) (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) ) ) (let ((f30-0 (/ 300.0 (the float (-> this sync period))))) (let* ((f0-12 (/ 1.0 (- 1.0 (* 2.0 f30-0)))) (f0-13 (* (fmax 0.0 (- (-> this path-pos) f30-0)) f0-12)) ) (get-point-at-percent-along-path! (-> this path) (-> this anchor-point) f0-13 'interp) ) (cond ((< (-> this path-pos) f30-0) (set! (-> this float-height-offset) (* -8192.0 (/ (- f30-0 (-> this path-pos)) f30-0))) ) ((< (- 1.0 (* 2.0 f30-0)) (-> this path-pos)) (cond ((< (- 1.0 f30-0) (-> this path-pos)) (set! (-> this float-height-offset) (* -8192.0 (/ (- (-> this path-pos) (- 1.0 f30-0)) f30-0))) (let ((a0-5 (-> this skel root-channel 0))) (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group frames num-frames) -1))) (set! (-> a0-5 param 1) 1.0) (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) ) ) (else (when (-> this once) (let ((a0-6 (-> this skel root-channel 0))) (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) (set! (-> a0-6 param 0) (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 3)) frames num-frames) -1)) ) (set! (-> a0-6 param 1) 1.0) (set! (-> a0-6 frame-num) 0.0) (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-seek!) ) (set! (-> this once) #f) ) (let ((a0-7 (-> this skel root-channel 0))) (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group frames num-frames) -1))) (set! (-> a0-7 param 1) 1.0) (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) ) ) ) ) (else (set! (-> this float-height-offset) 0.0) ) ) ) ) (cond ((time-elapsed? (-> this last-ridden-time) (seconds 0.5)) (when (nonzero? (-> this bubbling-sound-id)) (let ((v1-84 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-84 command) (sound-command set-param)) (set! (-> v1-84 id) (-> this bubbling-sound-id)) (set! (-> v1-84 params volume) -4) (set! (-> v1-84 auto-time) 120) (set! (-> v1-84 auto-from) 2) (set! (-> v1-84 params mask) (the-as uint 17)) (-> v1-84 id) ) (set! (-> this bubbling-sound-id) (new 'static 'sound-id)) 0 ) ) (else (if (zero? (-> this bubbling-sound-id)) (set! (-> this bubbling-sound-id) (sound-play "lava-plat-sink")) ) ) ) ((method-of-type rigid-body-platform rigid-body-object-method-37) this) (none) ) ;; definition for method 56 of type dig-sinking-plat ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod rigid-body-platform-method-56 ((this dig-sinking-plat) (arg0 vector)) (when (not (logtest? (-> this path flags) (path-control-flag not-found))) (let ((v1-4 (new 'stack-no-clear 'vector))) (cond ((< (-> this prev-pos) (-> this path-pos)) (vector-! v1-4 arg0 (-> this rbody state position)) (set! (-> v1-4 y) 0.0) (let* ((f0-2 (vector-length v1-4)) (f1-2 (* 1000.0 (fmax 0.0 (fmin 4096.0 (+ -4096.0 f0-2))))) ) (when (< 0.0 f1-2) (vector-float*! v1-4 v1-4 (/ f1-2 f0-2)) (rigid-body-method-20 (-> this rbody state) v1-4) ) ) ) (else (let ((v1-5 (new 'stack-no-clear 'vector))) (set! (-> v1-5 quad) (-> arg0 quad)) (+! (-> v1-5 y) -8192.0) (let ((a0-16 (-> this rbody)) (a2-2 (-> this root quat)) ) (rigid-body-method-26 (-> a0-16 state) v1-5 a2-2) ) ) (set! (-> this once) (the-as basic #t)) ) ) ) ) 0 (none) ) ;; failed to figure out what this is: (defstate idle (dig-sinking-plat) :virtual #t :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('ridden) (set-time! (-> self last-ridden-time)) ) ) (rigid-body-object-event-handler proc argc message block) ) ) ;; failed to figure out what this is: (defstate active (dig-sinking-plat) :virtual #t :event (-> (method-of-type dig-sinking-plat idle) event) ) ;; definition for method 33 of type dig-sinking-plat ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod init-skel-and-rigid-body ((this dig-sinking-plat)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-sinking-plat" (the-as (pointer uint32) #f))) (the-as pair 0) ) (alloc-and-init-rigid-body-control this *dig-sinking-platform-constants*) (set! (-> this anchor-point quad) (-> this root trans quad)) (set! (-> this surface-height) (+ -4096.0 (-> this root trans y))) (let ((s5-1 (-> this info control-point-count))) (dotimes (s4-1 s5-1) (let ((s3-0 (-> this control-point-array data s4-1))) (let ((f30-0 (* 65536.0 (/ (the float s4-1) (the float s5-1))))) (set! (-> s3-0 local-pos x) (* 16384.0 (sin f30-0))) (set! (-> s3-0 local-pos y) -8192.0) (set! (-> s3-0 local-pos z) (* 16384.0 (cos f30-0))) ) (set! (-> s3-0 local-pos w) 1.0) ) ) ) (let ((s5-2 (-> this entity))) (set! (-> this path) (new 'process 'path-control this 'path 0.0 s5-2 #f)) (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (set! (-> this fact) (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) (let ((a1-5 (new 'stack-no-clear 'sync-info-params))) (let ((v1-25 0)) (if #f (set! v1-25 (logior v1-25 1)) ) (set! (-> a1-5 sync-type) 'sync-linear) (set! (-> a1-5 sync-flags) (the-as sync-flags v1-25)) ) (set! (-> a1-5 entity) s5-2) (set! (-> a1-5 period) (the-as uint 3000)) (set! (-> a1-5 percent) 0.0) (initialize! (-> this sync) a1-5) ) ) (set! (-> this bubbling-sound-id) (new 'static 'sound-id)) (set! (-> this once) (the-as basic #t)) 0 (none) ) ;; failed to figure out what this is: (defpartgroup group-dig-log :id 1145 :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 4956) (sp-item 4957) (sp-item 4958 :binding 4955) (sp-item 4955 :flags (bit1 start-dead)) (sp-item 4955 :flags (bit1 start-dead)) (sp-item 4955 :flags (bit1 start-dead)) (sp-item 4955 :flags (bit1 start-dead)) (sp-item 4959) ) ) ;; failed to figure out what this is: (defpart 4956 :init-specs ((:texture (new 'static 'texture-id :page #xc)) (:num 3.0 2.0) (:x (meters 4)) (:scale-x (meters 2) (meters 1)) (:rot-z (degrees 0) (degrees 3600)) (:scale-y :copy scale-x) (:r 128.0) (:g 96.0 32.0) (:b 64.0 32.0) (:a 8.0 8.0) (:vel-x (meters 0.016666668) (meters 0.016666668)) (:vel-y (meters 0.02) (meters 0.02)) (:scalevel-x (meters 0.006666667)) (:rotvel-z (degrees -0.2) (degrees 0.4)) (:scalevel-y :copy scalevel-x) (:fade-a -0.053333335) (:friction 0.98) (:timer (seconds 3)) (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-12)) (:rotate-y (degrees 0) (degrees 3600)) ) ) ;; failed to figure out what this is: (defpart 4957 :init-specs ((:texture (new 'static 'texture-id :index #x2 :page #xade)) (:num 1.0 1.0) (:x (meters 4)) (:scale-x (meters 0.2) (meters 0.3)) (:rot-z (degrees 0) (degrees 3600)) (:scale-y :copy scale-x) (:r 180.0 32.0) (:g 150.0 32.0) (:b 130.0 32.0) (:a 64.0 64.0) (:vel-x (meters 0.02) (meters 0.02)) (:vel-y (meters 0.026666667) (meters 0.026666667)) (:rotvel-z (degrees -0.2) (degrees 0.4)) (:fade-a -0.35555556) (:accel-y (meters -0.0013333333)) (:friction 0.98) (:timer (seconds 1)) (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-12)) (:rotate-y (degrees 0) (degrees 3600)) ) ) ;; failed to figure out what this is: (defpart 4958 :init-specs ((:texture (new 'static 'texture-id :index #x2 :page #xade)) (:num 0.05 0.05) (:x (meters -10) (meters 12)) (:y (meters 38)) (:scale-x (meters 0.6) (meters 0.3)) (:rot-z (degrees 0) (degrees 3600)) (:scale-y :copy scale-x) (:r 180.0 32.0) (:g 150.0 32.0) (:b 130.0 32.0) (:a 64.0 64.0) (:vel-x (meters -0.00066666666) (meters 0.0013333333)) (:rotvel-z (degrees -0.2) (degrees 0.4)) (:fade-a -0.16) (:accel-y (meters -0.004333333)) (:friction 0.98) (:timer (seconds 2)) (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-12)) (:rotate-y (degrees 90)) ) ) ;; failed to figure out what this is: (defpart 4959 :init-specs ((:texture (new 'static 'texture-id :page #xc)) (:num 0.2 0.2) (:x (meters -8) (meters 8)) (:y (meters 38)) (:scale-x (meters 2) (meters 0.3)) (:rot-z (degrees 0) (degrees 3600)) (:scale-y :copy scale-x) (:r 180.0 32.0) (:g 150.0 32.0) (:b 130.0 32.0) (:a 8.0 8.0) (:scalevel-x (meters 0.033333335)) (:rotvel-z (degrees -0.2) (degrees 0.4)) (:scalevel-y :copy scalevel-x) (:fade-a -0.04) (:accel-y (meters -0.0013333333)) (:friction 0.98) (:timer (seconds 4)) (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-12)) (:rotate-y (degrees 90)) ) ) ;; failed to figure out what this is: (defpart 4955 :init-specs ((:texture (new 'static 'texture-id :page #xc)) (:num 2.0) (:scale-x (meters 0.5) (meters 0.3)) (:rot-z (degrees 0) (degrees 3600)) (:scale-y :copy scale-x) (:r 180.0 32.0) (:g 150.0 32.0) (:b 130.0 32.0) (:a 8.0 4.0) (:scalevel-x (meters 0.01)) (:rotvel-z (degrees -0.2) (degrees 0.4)) (:scalevel-y :copy scalevel-x) (:fade-a -0.04) (:timer (seconds 4)) (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-12)) ) ) ;; definition of type dig-log-button-info (deftype dig-log-button-info (basic) ((cam-ret-mode symbol) (cam-ret-dir vector :inline) ) ) ;; definition for method 3 of type dig-log-button-info (defmethod inspect ((this dig-log-button-info)) (when (not this) (set! this this) (goto cfg-4) ) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~1Tcam-ret-mode: ~A~%" (-> this cam-ret-mode)) (format #t "~1Tcam-ret-dir: #~%" (-> this cam-ret-dir)) (label cfg-4) this ) ;; definition for symbol *dig-log-button-infos*, type (array dig-log-button-info) (define *dig-log-button-infos* (new 'static 'boxed-array :type dig-log-button-info (new 'static 'dig-log-button-info :cam-ret-mode 'instant :cam-ret-dir (new 'static 'vector :x 0.1464 :z -0.9892 :w 1.0) ) (new 'static 'dig-log-button-info :cam-ret-mode 'normal :cam-ret-dir (new 'static 'vector :x 0.9805 :z 0.1963 :w 1.0) ) (new 'static 'dig-log-button-info :cam-ret-mode 'normal :cam-ret-dir (new 'static 'vector :x 0.8602 :z 0.5099 :w 1.0) ) (new 'static 'dig-log-button-info :cam-ret-mode 'instant :cam-ret-dir (new 'static 'vector :x -0.9946 :z 0.1035 :w 1.0) ) (new 'static 'dig-log-button-info :cam-ret-mode 'normal :cam-ret-dir (new 'static 'vector :x 0.9966 :z -0.0813 :w 1.0) ) ) ) ;; definition for symbol *dig-log-heights*, type (inline-array vector) (define *dig-log-heights* (new 'static 'inline-array vector 2 (new 'static 'vector :x 56320.0 :y 32768.0 :z 23552.0 :w 14336.0) (new 'static 'vector :x 5120.0 :y -4096.0) ) ) ;; definition of type dig-log (deftype dig-log (process-drawable) ((pressed-count int8) (total-buttons int8) (last-button-id int8) (base-y float) (hud-handle handle) (pad-ihj1bn234i1b int32 2) ) (:state-methods idle moving ) (:methods (dig-log-method-22 (_type_ symbol) symbol) ) ) ;; definition for method 3 of type dig-log (defmethod inspect ((this dig-log)) (when (not this) (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) (format #t "~2Tpressed-count: ~D~%" (-> this pressed-count)) (format #t "~2Ttotal-buttons: ~D~%" (-> this total-buttons)) (format #t "~2Tlast-button-id: ~D~%" (-> this last-button-id)) (format #t "~2Tbase-y: ~f~%" (-> this base-y)) (format #t "~2Thud-handle: ~D~%" (-> this hud-handle)) (format #t "~2Tstate-time: ~D~%" (-> this state-time)) (label cfg-4) this ) ;; failed to figure out what this is: (defskelgroup skel-dig-log dig-log dig-log-lod0-jg dig-log-idle-ja ((dig-log-lod0-mg (meters 999999))) :bounds (static-spherem 0 7.25 0 11) :origin-joint-index 3 ) ;; definition for function dig-log-event-handler (defbehavior dig-log-event-handler dig-log ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('hit) (set! (-> self last-button-id) (the-as int (/ (the-as int (-> arg3 param 0)) 8))) (set! (-> self pressed-count) (min (+ (-> self pressed-count) 1) (-> self total-buttons))) (set! (-> *game-info* counter) (the float (- (-> self total-buttons) (-> self pressed-count)))) (cond ((= (-> self pressed-count) (-> self total-buttons)) (dig-log-method-22 self #f) (task-node-close! (game-task-node dig-find-totem-raise-log)) ) (else (dig-log-method-22 self #t) ) ) (go-virtual moving) ) (('hud-dig-button) (dig-log-method-22 self (the-as symbol (-> arg3 param 0))) ) ) ) ;; definition for method 12 of type dig-log (defmethod run-logic? ((this dig-log)) "Should this process be run? Checked by execute-process-tree." #t ) ;; definition for method 22 of type dig-log ;; WARN: Return type mismatch int vs symbol. ;; WARN: disable def twice: 16. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. (defmethod dig-log-method-22 ((this dig-log) (arg0 symbol)) (the-as symbol (cond (arg0 (when (!= (-> this pressed-count) (-> this total-buttons)) (when (not (handle->process (-> this hud-handle))) (let ((v0-0 (ppointer->handle (process-spawn hud-dig-button :init hud-init-by-other :to this)))) (set! (-> this hud-handle) (the-as handle v0-0)) v0-0 ) ) ) ) (else (send-event (handle->process (-> this hud-handle)) 'hide-and-die) (set! (-> this hud-handle) (the-as handle #f)) (the-as int #f) ) ) ) ) ;; failed to figure out what this is: (defstate idle (dig-log) :virtual #t :event dig-log-event-handler :code sleep-code ) ;; failed to figure out what this is: (defstate moving (dig-log) :virtual #t :enter (behavior () (set-setting! 'ignore-target #t 0.0 0) ) :exit (behavior () (remove-setting! 'ignore-target) ) :code (behavior () (local-vars (v1-12 object)) (let ((gp-0 (-> *dig-log-button-infos* (-> self last-button-id)))) (let* ((t0-0 (if (= (-> self pressed-count) (-> self total-buttons)) "diglog5" "diglog1" ) ) (s5-0 (add-process *gui-control* self (gui-channel jak) (gui-action queue) t0-0 -99.0 0)) ) (set-time! (-> self state-time)) (until (time-elapsed? (-> self state-time) (seconds 0.15)) (suspend) ) (until v1-12 (suspend) (set! v1-12 (and *target* (not (focus-test? *target* in-air)) (process-grab? *target* #f))) ) (while (!= (get-status *gui-control* s5-0) (gui-status ready)) (suspend) ) (set-time! (-> self state-time)) (until (time-elapsed? (-> self state-time) (seconds 0.2)) (suspend) ) (set-setting! 'entity-name "camera-249" 0.0 0) (set-action! *gui-control* (gui-action play) s5-0 (gui-channel none) (gui-action none) (the-as string #f) (the-as (function gui-connection symbol) #f) (the-as process #f) ) ) (set-time! (-> self state-time)) (until (time-elapsed? (-> self state-time) (seconds 0.5)) (suspend) ) (let ((f30-0 (+ (-> (&-> *dig-log-heights* 0 data (- (-> self total-buttons) (-> self pressed-count))) 0) (-> self base-y)) ) (s5-1 (current-time)) ) (until (>= (-> self root trans y) f30-0) (set! (-> self root trans y) (seek-with-smooth (-> self root trans y) f30-0 (* 4096.0 (seconds-per-frame)) 0.25 40.96) ) (when (>= (current-time) s5-1) (activate! *camera-smush-control* (rand-vu-float-range 614.4 1433.6) 45 75 1.0 0.95 (-> *display* camera-clock) ) (set! s5-1 (+ (current-time) (rand-vu-int-range (seconds 0.05) (seconds 0.15)))) ) (let ((a1-10 (new 'stack-no-clear 'vector))) (set! (-> a1-10 quad) (-> self root trans quad)) (set! (-> a1-10 y) (+ 59592.703 (-> self base-y))) (spawn (-> self part) a1-10) ) (suspend) ) ) (set-time! (-> self state-time)) (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) (if (= (-> gp-0 cam-ret-mode) 'instant) (persist-with-delay *setting-control* 'interp-time (seconds 0.05) 'interp-time 'abs 0.0 0) ) (set-setting! 'string-startup-vector 'abs (-> gp-0 cam-ret-dir) 0) (remove-setting! 'entity-name) (when (!= (-> gp-0 cam-ret-mode) 'instant) (set-time! (-> self state-time)) (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) ) ) (set-time! (-> self state-time)) (until (time-elapsed? (-> self state-time) (seconds 0.1)) (suspend) ) (remove-setting! 'string-startup-vector) (until (process-release? *target*) (suspend) ) (set-time! (-> self state-time)) (until (time-elapsed? (-> self state-time) (seconds 4)) (suspend) ) (go-virtual idle) ) :post transform-post ) ;; definition for method 11 of type dig-log ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this dig-log) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) (set! (-> this hud-handle) (the-as handle #f)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) (set! (-> s3-0 prim-core action) (collide-action solid)) (set! (-> s3-0 transform-index) 3) (set-vector! (-> s3-0 local-sphere) 0.0 29696.0 0.0 45056.0) (set! (-> s4-0 total-prims) (the-as uint 1)) (set! (-> s4-0 root-prim) s3-0) ) (pusher-init s4-0) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (let ((v1-12 (-> s4-0 root-prim))) (set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (set! (-> this base-y) (-> this root trans y)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-log" (the-as (pointer uint32) #f))) (the-as pair 0) ) (set! (-> this pressed-count) 0) (set! (-> this total-buttons) 0) (set! sv-16 (new 'static 'res-tag)) (let ((v1-19 (res-lump-data (-> this entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) (when (and v1-19 (nonzero? (-> sv-16 elt-count))) (let ((s5-2 (-> v1-19 0))) (countdown (s4-2 (-> s5-2 length)) (let ((s3-1 (-> s5-2 data s4-2 actor))) (when s3-1 (add-icon! *minimap* this (the-as uint 16) (the-as int #f) (the-as vector s3-1) 0) (+! (-> this total-buttons) 1) (if (logtest? (-> s3-1 extra perm status) (entity-perm-status subtask-complete)) (+! (-> this pressed-count) 1) ) ) ) ) ) ) ) (if (task-node-closed? (game-task-node dig-find-totem-raise-log)) (set! (-> this pressed-count) (-> this total-buttons)) ) (set! (-> this root trans y) (+ (-> (&-> *dig-log-heights* 0 data (- (-> this total-buttons) (-> this pressed-count))) 0) (-> this base-y)) ) (transform-post) (when (!= (-> this pressed-count) (-> this total-buttons)) (set! (-> *game-info* counter) (the float (- (-> this total-buttons) (-> this pressed-count)))) (if (string= (-> *game-info* last-continue name) "dig3b-back-room") (dig-log-method-22 this #t) ) ) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1145) this)) (set! (-> this event-hook) dig-log-event-handler) (go (method-of-object this idle)) (none) ) ;; definition of type dig-button (deftype dig-button (process-drawable) ((down-y float) ) (:state-methods idle-up going-down idle-down ) ) ;; definition for method 3 of type dig-button (defmethod inspect ((this dig-button)) (when (not this) (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) (format #t "~2Tdown-y: ~f~%" (-> this down-y)) (label cfg-4) this ) ;; failed to figure out what this is: (defskelgroup skel-dig-button dig-button dig-button-lod0-jg dig-button-idle-ja ((dig-button-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 3) ) ;; definition for method 12 of type dig-button (defmethod run-logic? ((this dig-button)) "Should this process be run? Checked by execute-process-tree." #t ) ;; failed to figure out what this is: (defstate idle-up (dig-button) :virtual #t :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('attack) (when (logtest? (-> (the-as attack-info (-> block param 1)) penetrate-using) (penetrate flop)) (go-virtual going-down) #f ) ) ) ) :code (behavior () (transform-post) (suspend) (transform-post) (sleep-code) ) ) ;; failed to figure out what this is: (defstate going-down (dig-button) :virtual #t :code (behavior () (sound-play "dig-button") (until (= (-> self root trans y) (-> self down-y)) (seek! (-> self root trans y) (-> self down-y) (* 16384.0 (seconds-per-frame))) (logior! (-> self skel status) (joint-control-status sync-math)) (transform-post) (logclear! (-> self skel status) (joint-control-status sync-math)) (suspend) ) (process-entity-status! self (entity-perm-status subtask-complete) #t) (let ((gp-1 (res-lump-struct (-> self entity) 'on-activate structure))) (if gp-1 (script-eval (the-as pair gp-1)) ) ) (go-virtual idle-down) ) ) ;; failed to figure out what this is: (defstate idle-down (dig-button) :virtual #t :code (behavior () (set! (-> self root trans y) (-> self down-y)) (transform-post) (suspend) (transform-post) (sleep-code) ) ) ;; definition for method 11 of type dig-button ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this dig-button) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot player-list)) (set! (-> v1-2 prim-core action) (collide-action solid)) (set! (-> v1-2 transform-index) 3) (set-vector! (-> v1-2 local-sphere) 0.0 0.0 0.0 12288.0) (set! (-> s4-0 total-prims) (the-as uint 1)) (set! (-> s4-0 root-prim) v1-2) ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (let ((v1-5 (-> s4-0 root-prim))) (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-button" (the-as (pointer uint32) #f))) (the-as pair 0) ) (set! (-> this down-y) (+ -2048.0 (-> this root trans y))) (if (task-node-closed? (game-task-node dig-find-totem-raise-log)) (process-entity-status! this (entity-perm-status subtask-complete) #t) ) (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) (go (method-of-object this idle-down)) (go (method-of-object this idle-up)) ) (none) ) ;; definition for method 15 of type hud-dig-button ;; WARN: Return type mismatch int vs none. (defmethod draw ((this hud-dig-button)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 487.0 (* 130.0 (-> this offset)))) 210 ) (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -16 20) ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-dig-button ;; WARN: Return type mismatch int vs none. (defmethod update-values ((this hud-dig-button)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-dig-button ;; WARN: Return type mismatch int vs none. (defmethod init-callback ((this hud-dig-button)) (set! (-> this level) (level-get *level* 'dig3a)) (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xd21))) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) (logior! (-> this flags) (hud-flags show)) (set! (-> this sprites 0 flags) (the-as uint 4)) (set! (-> this sprites 0 scale-x) 1.0) (set! (-> this sprites 0 scale-y) 1.0) (alloc-string-if-needed this 0) (set! (-> this strings 0 scale) 0.6) (set! (-> this strings 0 flags) (font-flags kerning middle large)) 0 (none) ) ;; definition for function dig3-login ;; WARN: Return type mismatch int vs none. (defun dig3-login () (set! *nav-network* (new 'loading-level 'nav-network)) 0 (none) ) ;; definition for function dig3-activate ;; WARN: Return type mismatch int vs none. (defun dig3-activate () (setup-user-array (-> *part-id-table* 1309) "grenadier-grenade-part") (setup-user-array (-> *part-id-table* 638) "grenadier-grenade-part") (setup-user-array (-> *part-id-table* 639) "grenadier-grenade-part") 0 (none) ) ;; definition for function dig3-deactivate ;; WARN: Return type mismatch int vs none. (defun dig3-deactivate () (set! *nav-network* (the-as nav-network 0)) 0 (none) )