;;-*-Lisp-*-
(in-package goal)

;; name: warp-gate.gc
;; name in dgo: warp-gate
;; dgos: GAME, COMMON

;; DECOMP BEGINS

(if (not (nmember "common" *kernel-packages*))
    (set! *kernel-packages* (cons "common" *kernel-packages*))
    )

(defpartgroup group-warpgate
  :id 130
  :duration (seconds 0.267)
  :flags (use-local-clock unk-6)
  :bounds (static-bspherem 0 0 0 8)
  :rotate ((degrees 90) (degrees 0) (degrees 0))
  :parts ((sp-item 586 :flags (is-3d launch-asap bit7)) (sp-item 587 :flags (launch-asap)) (sp-item 588 :flags (bit7)))
  )

(defpart 586
  :init-specs ((:texture (harddot effects))
    (:num 1.0)
    (:scale-x (meters 4.75))
    (:scale-y :copy scale-x)
    (:r 255.0)
    (:g 255.0)
    (:b 255.0)
    (:a 196.0)
    (:fade-a -3.1875)
    (:timer (seconds 0.267))
    (:flags (sp-cpuinfo-flag-2))
    (:rotate-y (degrees 0))
    )
  )

(defpart 587
  :init-specs ((:texture (glow effects))
    (:num 1.0)
    (:scale-x (meters 14))
    (:rot-x (degrees 11.25))
    (:rot-z (degrees 0) (degrees 3600))
    (:scale-y :copy scale-x)
    (:r 255.0)
    (:g 255.0)
    (:b 255.0)
    (:a 48.0)
    (:fade-a -0.8)
    (:timer (seconds 0.267))
    (:flags (glow))
    (:userdata 4096.0)
    )
  )

(defpart 588
  :init-specs ((:texture (hotdot effects))
    (:num 16.0)
    (:x (meters 0) (meters 2))
    (:scale-x (meters 0.1) (meters 0.1))
    (:scale-y :copy scale-x)
    (:r 255.0)
    (:g 255.0)
    (:b 255.0)
    (:a 255.0)
    (:scalevel-x (meters -0.0025))
    (:scalevel-y :copy scalevel-x)
    (:timer (seconds 0.267))
    (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3))
    (:rotate-y (degrees 0) (degrees 3600))
    )
  )

(defpartgroup group-airtrain-dust-plume :id 131 :bounds (static-bspherem 0 0 0 15) :parts ((sp-item 589)))

(defpart 589
  :init-specs ((:texture (bigpuff effects))
    (:num 1.0 1.0)
    (:x (meters 0) (meters 10))
    (:scale-x (meters 1) (meters 1))
    (:rot-z (degrees 0) (degrees 3600))
    (:scale-y (meters 1) (meters 1))
    (:r 128.0)
    (:g 106.0 16.0)
    (:b 64.0 32.0)
    (:a 16.0 32.0)
    (:vel-x (meters 0.033333335) (meters 0.033333335))
    (:scalevel-x (meters 0.033333335) (meters 0.006666667))
    (:rotvel-z (degrees -0.3) (degrees 0.6))
    (:scalevel-y :copy scalevel-x)
    (:fade-a -0.04 -0.08)
    (:accel-y (meters 0.00033333333))
    (:friction 0.95 0.03)
    (:timer (seconds 4.335))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-12))
    (:rotate-y (degrees 0) (degrees 3600))
    )
  )

(defpartgroup group-airtrain-dust-hover :id 132 :bounds (static-bspherem 0 0 0 15) :parts ((sp-item 590)))

(defpart 590
  :init-specs ((:texture (bigpuff effects))
    (:num 1.0)
    (:x (meters 0) (meters 5))
    (:scale-x (meters 1) (meters 1))
    (:rot-z (degrees 0) (degrees 3600))
    (:scale-y (meters 1) (meters 1))
    (:r 128.0)
    (:g 106.0 16.0)
    (:b 64.0 32.0)
    (:a 16.0 16.0)
    (:vel-x (meters 0.033333335) (meters 0.033333335))
    (:scalevel-x (meters 0.016666668) (meters 0.006666667))
    (:rotvel-z (degrees -0.3) (degrees 0.6))
    (:scalevel-y :copy scalevel-x)
    (:fade-a -0.04 -0.08)
    (:accel-y (meters 0.00033333333))
    (:friction 0.95 0.03)
    (:timer (seconds 4.335))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-12))
    (:rotate-y (degrees 0) (degrees 3600))
    )
  )

(defpartgroup group-airtrain-thruster
  :id 133
  :linger-duration (seconds 2)
  :flags (unk-4 unk-6)
  :bounds (static-bspherem 0 0 0 12)
  :rotate ((degrees 180) (degrees 0) (degrees 0))
  :parts ((sp-item 591 :flags (bit6 bit7))
    (sp-item 592 :flags (bit6 bit7))
    (sp-item 593 :flags (bit7))
    (sp-item 594 :flags (bit7))
    (sp-item 595 :flags (bit7))
    )
  )

(defpartgroup group-airtrain-thruster-off
  :id 134
  :linger-duration (seconds 2)
  :flags (unk-4 unk-6)
  :bounds (static-bspherem 0 0 0 12)
  :rotate ((degrees 180) (degrees 0) (degrees 0))
  :parts ((sp-item 595 :fade-after (meters 120) :falloff-to (meters 90) :flags (bit7))
    (sp-item 596 :fade-after (meters 120) :falloff-to (meters 90) :flags (bit7))
    (sp-item 597 :flags (bit6 bit7))
    )
  )

(defpart 591
  :init-specs ((:texture (glow effects))
    (:num 1.0)
    (:y (meters 0.1))
    (:scale-x (meters 1) (meters 0.4))
    (:rot-x (degrees 2.25))
    (:scale-y :copy scale-x)
    (:r 255.0)
    (:g 64.0 128.0)
    (:b 0.0)
    (:a 64.0 8.0)
    (:timer (seconds 0.017))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow))
    (:userdata 409.6)
    (:rotate-y (degrees 0))
    )
  )

(defpart 592
  :init-specs ((:texture (glow-soft effects))
    (:num 1.0)
    (:y (meters 0.1))
    (:scale-x (meters 4.8) (meters 0.6))
    (:rot-x (degrees 2.25))
    (:scale-y :copy scale-x)
    (:r 255.0)
    (:g 64.0 128.0)
    (:b 0.0)
    (:a 16.0 2.0)
    (:timer (seconds 0.017))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow))
    (:userdata 409.6)
    (:rotate-y (degrees 0))
    )
  )

(defpart 593
  :init-specs ((:texture (bigpuff effects))
    (:num 1.0 2.0)
    (:scale-x (meters 1) (meters 1))
    (:rot-z (degrees 0) (degrees 3600))
    (:scale-y (meters 1) (meters 1))
    (:r 196.0)
    (:g 128.0 64.0)
    (:b :copy g)
    (:a 16.0 16.0)
    (:vel-x (meters -0.006666667) (meters 0.013333334))
    (:vel-y (meters -0.05) (meters -0.1))
    (:vel-z (meters -0.006666667) (meters 0.013333334))
    (:scalevel-x (meters 0.053333335) (meters 0.053333335))
    (:rotvel-z (degrees -1.2) (degrees 2.4))
    (:scalevel-y :copy scalevel-x)
    (:fade-r 0.0)
    (:fade-g 0.0)
    (:fade-b 0.0)
    (:fade-a -0.21333334 -0.42666668)
    (:accel-y (meters 0.00016666666) (meters 0.0005))
    (:friction 0.94 0.04)
    (:timer (seconds 2))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-12 sp-cpuinfo-flag-14))
    (:rotate-y (degrees 0))
    )
  )

(defpart 596
  :init-specs ((:texture (bigpuff effects))
    (:num 1.0 2.0)
    (:scale-x (meters 1) (meters 1))
    (:rot-z (degrees 0) (degrees 3600))
    (:scale-y (meters 1) (meters 1))
    (:r 196.0)
    (:g 128.0 64.0)
    (:b :copy g)
    (:a 10.0 4.0)
    (:vel-x (meters -0.006666667) (meters 0.013333334))
    (:vel-y (meters -0.05) (meters -0.1))
    (:vel-z (meters -0.006666667) (meters 0.013333334))
    (:scalevel-x (meters 0.053333335) (meters 0.053333335))
    (:rotvel-z (degrees -1.2) (degrees 2.4))
    (:scalevel-y :copy scalevel-x)
    (:fade-r 0.0)
    (:fade-g 0.0)
    (:fade-b 0.0)
    (:fade-a -0.21333334 -0.42666668)
    (:accel-y (meters 0.00016666666) (meters 0.0005))
    (:friction 0.94 0.04)
    (:timer (seconds 2))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-12 sp-cpuinfo-flag-14))
    (:rotate-y (degrees 0))
    )
  )

(defpart 597
  :init-specs ((:texture (glow effects))
    (:num 1.0)
    (:y (meters 0.1))
    (:scale-x (meters 1.4) (meters 0.1))
    (:rot-x (degrees 2.25))
    (:scale-y :copy scale-x)
    (:r 128.0)
    (:g 48.0 32.0)
    (:b 0.0)
    (:a 48.0 8.0)
    (:timer (seconds 0.017))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow))
    (:userdata 409.6)
    (:rotate-y (degrees 0))
    )
  )

(defpart 594
  :init-specs ((:texture (hotdot effects))
    (:num 0.0 1.0)
    (:x (meters 0) (meters 0.5))
    (:scale-x (meters 0.2) (meters 0.1))
    (:scale-y :copy scale-x)
    (:r 192.0 64.0)
    (:g 128.0)
    (:b 0.0)
    (:a 128.0)
    (:omega (degrees 0.0675) (degrees 0.0225))
    (:vel-x (meters -0.013333334) (meters 0.026666667))
    (:vel-y (meters -0.1) (meters -0.06666667))
    (:vel-z (meters -0.013333334) (meters 0.026666667))
    (:fade-g -1.0)
    (:fade-a -2.56)
    (:accel-x (meters 0) (meters 0.0016666667))
    (:friction 0.96 0.02)
    (:timer (seconds 0.085) (seconds 0.08))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-12 sp-cpuinfo-flag-14))
    (:func 'sparticle-motion-blur)
    (:rotate-y (degrees 0) (degrees 3600))
    )
  )

(defpart 595
  :init-specs ((:num 0.4)
    (:rot-x 8)
    (:r 1638.4)
    (:g 1331.2)
    (:b 1433.6)
    (:vel-y (meters -0.05) (meters -0.016666668))
    (:fade-r 32.768)
    (:fade-g 28.671999)
    (:fade-b 26.623999)
    (:accel-x (meters 0) (meters 0.0016666667))
    (:friction 0.94)
    (:timer (seconds 0.335))
    (:flags (distort))
    (:next-time (seconds 0.167))
    (:next-launcher 598)
    (:rotate-y (degrees 0) (degrees 360))
    )
  )

(defpart 598
  :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b -4.096))
  )

(defpartgroup group-warp-hellcat-thruster
  :id 135
  :duration (seconds 3)
  :flags (use-local-clock unk-4)
  :bounds (static-bspherem 0 0 0 32)
  :parts ((sp-item 599 :flags (is-3d bit7))
    (sp-item 600 :flags (is-3d bit7))
    (sp-item 601 :flags (bit7))
    (sp-item 602 :flags (is-3d bit7))
    (sp-item 603 :flags (is-3d bit7))
    (sp-item 604 :flags (bit7))
    )
  )

(defpart 599
  :init-specs ((:texture (mech-flame effects))
    (:num 1.0)
    (:x (meters 1.45))
    (:y (meters 1.1))
    (:z (meters -5.15))
    (:scale-x (meters 0.6))
    (:rot-x 4)
    (:scale-y (meters 2))
    (:r 128.0 128.0)
    (:g 32.0 96.0)
    (:b :copy g)
    (:a 128.0 64.0)
    (:timer (seconds 0.017))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3))
    (:rotate-y (degrees 0))
    )
  )

(defpart 600
  :init-specs ((:texture (mech-flame effects))
    (:num 1.0)
    (:x (meters 1.45))
    (:y (meters 1.1))
    (:z (meters -5.15))
    (:scale-x (meters 0.6))
    (:rot-x 4)
    (:rot-z (degrees 90))
    (:scale-y (meters 2))
    (:r 128.0 128.0)
    (:g 32.0 96.0)
    (:b :copy g)
    (:a 128.0 64.0)
    (:timer (seconds 0.017))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3))
    (:rotate-y (degrees 0))
    )
  )

(defpart 601
  :init-specs ((:texture (glow-soft effects))
    (:num 1.0)
    (:x (meters 1.45))
    (:y (meters 1.1))
    (:z (meters -4.75))
    (:scale-x (meters 1.75))
    (:rot-x (degrees 0.5625))
    (:scale-y :copy scale-x)
    (:r 255.0)
    (:g 0.0 64.0)
    (:b 0.0)
    (:a 16.0 4.0)
    (:rotvel-z (degrees 0.3))
    (:timer (seconds 0.017))
    (:flags (glow))
    (:userdata 2048.0)
    (:rotate-y (degrees 0))
    )
  )

(defpart 602
  :init-specs ((:texture (mech-flame effects))
    (:num 1.0)
    (:x (meters -1.45))
    (:y (meters 1.1))
    (:z (meters -5.15))
    (:scale-x (meters 0.6))
    (:rot-x 4)
    (:scale-y (meters 2))
    (:r 128.0 128.0)
    (:g 32.0 96.0)
    (:b :copy g)
    (:a 128.0 64.0)
    (:timer (seconds 0.017))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3))
    (:rotate-y (degrees 0))
    )
  )

(defpart 603
  :init-specs ((:texture (mech-flame effects))
    (:num 1.0)
    (:x (meters -1.45))
    (:y (meters 1.1))
    (:z (meters -5.15))
    (:scale-x (meters 0.6))
    (:rot-x 4)
    (:rot-z (degrees 90))
    (:scale-y (meters 2))
    (:r 128.0 128.0)
    (:g 32.0 96.0)
    (:b :copy g)
    (:a 128.0 64.0)
    (:timer (seconds 0.017))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3))
    (:rotate-y (degrees 0))
    )
  )

(defpart 604
  :init-specs ((:texture (glow-soft effects))
    (:num 1.0)
    (:x (meters -1.45))
    (:y (meters 1.1))
    (:z (meters -4.75))
    (:scale-x (meters 1.75))
    (:rot-x (degrees 0.5625))
    (:scale-y :copy scale-x)
    (:r 255.0)
    (:g 0.0 64.0)
    (:b 0.0)
    (:a 16.0 4.0)
    (:rotvel-z (degrees 0.3))
    (:timer (seconds 0.017))
    (:flags (glow))
    (:userdata 2048.0)
    (:rotate-y (degrees 0))
    )
  )

(defskelgroup skel-warp-gate warp-gate warp-gate-lod0-jg warp-gate-idle-ja
              ((warp-gate-lod0-mg (meters 999999)))
              :bounds (static-spherem 0 3 0 4)
              :origin-joint-index 3
              )

(deftype warp-gate (process-drawable)
  ((root         collide-shape :override)
   (level-name   uint32)
   (on-notice    pair)
   (on-activate  pair)
   (on-close     pair)
   (wait-for     pair)
   (continue     continue-point)
   (distance     meters)
   (anim-speed   float)
   (test-time    time-frame)
   (center       vector         :inline)
   )
  (:state-methods
    idle
    (use continue-point)
    hidden
    )
  (:methods
    (init-skel-and-collide (_type_) none)
    (setup-fields (_type_) none)
    (handle-notice (_type_) continue-point)
    )
  )


(defmethod handle-notice ((this warp-gate))
  (let ((s5-0 (script-eval (-> this on-notice))))
    (cond
      ((= s5-0 'hide)
       (logior! (-> this draw status) (draw-control-status no-draw))
       (set! (-> this continue) #f)
       )
      (s5-0
        (logclear! (-> this draw status) (draw-control-status no-draw))
        (set! (-> this continue) (get-continue-by-name *game-info* (the-as string (car s5-0))))
        (set! (-> this on-activate) (the-as pair (car (cdr s5-0))))
        (set! (-> this wait-for) (the-as pair (car (cdr (cdr s5-0)))))
        (set! (-> this on-close) (the-as pair (car (cdr (cdr (cdr s5-0))))))
        )
      (else
        (set! (-> this continue) #f)
        )
      )
    )
  (-> this continue)
  )

(defstate hidden (warp-gate)
  :virtual #t
  :code sleep-code
  )

(defstate idle (warp-gate)
  :virtual #t
  :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
    (case message
      (('hide)
       (go-virtual hidden)
       )
      (('effect)
       (process-spawn
         part-tracker
         :init part-tracker-init
         (-> *part-group-id-table* 130)
         0
         #f
         #f
         #f
         (-> self node-list data 4 bone transform)
         :to *entity-pool*
         )
       )
      )
    )
  :code (behavior ()
    (remove-setting! 'allow-progress)
    (set-time! (-> self state-time))
    (update-transforms (-> self root))
    (until #f
      (handle-notice self)
      (when (and (and *target*
                      (and (>= (-> self distance) (vector-vector-distance (-> self root trans) (-> *target* control trans)))
                           (not (logtest? (focus-status teleporting) (-> *target* focus-status)))
                           )
                      )
                 (and (-> self continue)
                      (not (focus-test? *target* in-head edge-grab pole flut tube board pilot mech indax))
                      (-> *setting-control* user-current airlock)
                      ;; og:preserve-this
                      ;; For speedrunner mode, always allow warp-gates to be used
                      ;; even when dialogues are playing
                      (or (-> *pc-settings* speedrunner-mode?)
                          (not (-> *setting-control* user-current hint)))
                      )
                 )
        (talker-surpress!)
        ;; og:preserve-this
        ;; For speedrunner mode, always allow warp-gates to be used
        ;; even when dialogues are playing
        (when (and (or (-> *pc-settings* speedrunner-mode?)
                       (can-display-query? self (the-as string #f) -99.0))
                   (cond
                     ((and (-> *target* next-state) (let ((v1-30 (-> *target* next-state name)))
                                                      (or (= v1-30 'target-warp-in) (= v1-30 'target-warp-out))
                                                      )
                           )
                      (set-time! (-> self state-time))
                      #f
                      )
                     (else
                       #t
                       )
                     )
                   (time-elapsed? (-> self state-time) (seconds 0.1))
                   )
          (if (and (cpad-pressed? 0 triangle) (process-grab? *target* #f))
              (go-virtual use (-> self continue))
              )
          (script-eval (-> self on-close))
          (let ((gp-0
                  (new 'stack 'font-context *font-default-matrix* 32 320 0.0 (font-color default) (font-flags shadow kerning))
                  )
                )
            (let ((v1-51 gp-0))
              (set! (-> v1-51 width) (the float 340))
              )
            (let ((v1-52 gp-0))
              (set! (-> v1-52 height) (the float 80))
              )
            (let ((v1-53 gp-0))
              (set! (-> v1-53 scale) 0.9)
              )
            (set! (-> gp-0 flags) (font-flags shadow kerning large))
            (print-game-text
              (lookup-text! *common-text* (text-id press-triangle-to-use) #f)
              gp-0
              #f
              44
              (bucket-id progress)
              )
            )
          )
        )
      (cond
        ((-> self continue)
         (seek! (-> self anim-speed) 1.0 (* 2.0 (seconds-per-frame)))
         (setup-masks (-> self draw) 2 0)
         )
        (else
          (setup-masks (-> self draw) 0 2)
          (seek! (-> self anim-speed) 0.0 (* 2.0 (seconds-per-frame)))
          )
        )
      (update! (-> self sound))
      (ja-post)
      (suspend)
      (ja :num! (loop! (-> self anim-speed)))
      )
    #f
    )
  )

(defstate use (warp-gate)
  :virtual #t
  :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
    (case message
      (('effect)
       (process-spawn
         part-tracker
         :init part-tracker-init
         (-> *part-group-id-table* 130)
         0
         #f
         #f
         #f
         (-> self node-list data 4 bone transform)
         :to *entity-pool*
         )
       )
      )
    )
  :exit (behavior ()
    (remove-setting! 'mode-name)
    (remove-setting! 'interp-time)
    )
  :trans (behavior ()
    (send-event *camera* 'joystick 0.0 0.0)
    )
  :code (behavior ((arg0 continue-point))
    (local-vars (v1-38 symbol))
    (kill-current-talker (the-as symbol '()) '() 'exit)
    (set-setting! 'mode-name 'cam-fixed 0.0 0)
    (set-setting! 'interp-time 'abs 0.0 0)
    (set-time! (-> self state-time))
    (logclear! (-> self mask) (process-mask actor-pause))
    (when (not arg0)
      (process-release? *target*)
      (go-virtual idle)
      )
    (set-setting! 'allow-progress #f 0.0 0)
    (set! (-> *setting-control* user-default border-mode) #t)
    (set! (-> *level* play?) #t)
    (apply-settings *setting-control*)
    (let ((s5-0 (new 'stack-no-clear 'event-message-block)))
      (set! (-> s5-0 from) (process->ppointer self))
      (set! (-> s5-0 num-params) 4)
      (set! (-> s5-0 message) 'change-state)
      (set! (-> s5-0 param 0) (the-as uint target-warp-out))
      (let ((v1-22 (new 'static 'vector)))
        (set! (-> v1-22 quad) (-> self center quad))
        (set! (-> s5-0 param 1) (the-as uint v1-22))
        )
      (set! (-> s5-0 param 2) (the-as uint (target-pos 0)))
      (set! (-> s5-0 param 3) (the-as uint (process->handle self)))
      (send-event-function *target* s5-0)
      )
    (script-eval (-> self on-activate))
    (while (begin
             (set! v1-38 (when (-> self wait-for)
                           (let* ((s5-1 (-> self wait-for))
                                  (a1-8 (car s5-1))
                                  )
                             (while (not (null? s5-1))
                               (when (not (member (level-status *level* (the-as symbol a1-8)) '(loaded active)))
                                 (set! v1-38 #t)
                                 (goto cfg-21)
                                 )
                               (set! s5-1 (cdr s5-1))
                               (set! a1-8 (car s5-1))
                               )
                             )
                           #f
                           )
                   )
             (label cfg-21)
             (or v1-38 (not (time-elapsed? (-> self state-time) (seconds 2))))
             )
      (update! (-> self sound))
      (suspend)
      (ja :num! (loop!))
      (ja-post)
      )
    (if (not (logtest? (-> arg0 flags) (continue-flags no-blackout)))
        (set-blackout-frames (seconds 0.05))
        )
    (start 'play arg0)
    (suspend-for (seconds 1)
      )
    (while (and *target* (and (>= 81920.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))
                              (not (logtest? (focus-status teleporting) (-> *target* focus-status)))
                              )
                )
      (suspend)
      (ja :num! (loop!))
      (ja-post)
      )
    (logior! (-> self mask) (process-mask actor-pause))
    (go-virtual idle)
    )
  )

;; WARN: Return type mismatch draw-control vs none.
(defmethod init-skel-and-collide ((this warp-gate))
  (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
    (set! (-> s5-0 penetrated-by) (penetrate))
    (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0))))
      (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle))
      (set! (-> v1-2 prim-core action) (collide-action solid))
      (set! (-> v1-2 transform-index) 3)
      (set-vector! (-> v1-2 local-sphere) 0.0 12288.0 0.0 16384.0)
      (set! (-> s5-0 total-prims) (the-as uint 1))
      (set! (-> s5-0 root-prim) v1-2)
      )
    (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
    (let ((v1-5 (-> s5-0 root-prim)))
      (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as))
      (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with))
      )
    (set! (-> this root) s5-0)
    )
  (initialize-skeleton
    this
    (the-as skeleton-group (art-group-get-by-name *level* "skel-warp-gate" (the-as (pointer uint32) #f)))
    (the-as pair 0)
    )
  (none)
  )

;; WARN: Return type mismatch float vs none.
(defmethod setup-fields ((this warp-gate))
  (set! (-> this level-name) (the-as uint (-> this level name)))
  (set! (-> this on-notice) (res-lump-struct (-> this entity) 'on-notice pair))
  (set! (-> this on-activate) #f)
  (set! (-> this wait-for) #f)
  (set! (-> this continue) #f)
  (set! (-> this on-close) #f)
  (set! (-> this part) (create-launch-control (-> *part-group-id-table* 130) this))
  (set! (-> this center quad) (-> this root trans quad))
  (+! (-> this center y) 13516.8)
  (set! (-> this sound)
        (new 'process 'ambient-sound (static-sound-spec "warpgate" :fo-max 30) (-> this root trans))
        )
  (set! (-> this distance) (res-lump-float (-> this entity) 'distance :default 20480.0))
  (none)
  )

;; WARN: Return type mismatch object vs none.
(defbehavior warp-gate-init warp-gate ((arg0 entity-actor) (arg1 vector))
  (stack-size-set! (-> self main-thread) 512)
  (init-skel-and-collide self)
  (if arg0
      (process-drawable-from-entity! self arg0)
      )
  (if arg1
      (set! (-> self root trans quad) (-> arg1 quad))
      )
  (logior! (-> self mask) (process-mask actor-pause))
  ;; og:preserve-this added for revisiting nest
  (#when PC_PORT
    (when (string= (-> self name) "air-train-1")
      (set! (-> (the (pointer pair) (get-tag-index-data arg0 2)))
            '(cond
              ((task-closed? "nest-boss-resolution") '("nest-warp" (scene-play '("city-air-train-in-nest" "nest-air-train-out")) #f (want-anim "city-air-train-in-nest")))
              ((task-closed? "nest-get-to-gun-introduction") '("nest-warp" (scene-play '("city-air-train-in-nest" "nest-air-train-out")) #f (want-anim "city-air-train-in-nest")))
              ((task-closed? "dig-find-totem-introduction") '("caspad-warp" (scene-play '("city-air-train-in-caspad" "caspad-air-train-out")) #f (want-anim "city-air-train-in-caspad")))
              ((task-closed? "dig-knock-down-introduction") '("caspad-warp" (scene-play '("city-air-train-in-caspad" "caspad-air-train-out")) #f (want-anim "city-air-train-in-caspad"))))
            )
      )
    )
  (setup-fields self)
  (go-virtual idle)
  (none)
  )

(defmethod init-from-entity! ((this warp-gate) (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"
  (warp-gate-init arg0 (the-as vector #f))
  (none)
  )

(define *warp-jump-mods* (new 'static 'surface
                           :name 'jump
                           :turnv 273066.66
                           :turnvv 1820444.5
                           :tiltv 65536.0
                           :tiltvv 262144.0
                           :transv-max 65536.0
                           :target-speed 65536.0
                           :slip-factor 1.0
                           :slide-factor 1.0
                           :slope-up-factor 1.0
                           :slope-down-factor 1.0
                           :slope-slip-angle 1.0
                           :impact-fric 1.0
                           :bend-factor 1.0
                           :bend-speed 1.0
                           :alignv 1.0
                           :slope-up-traction 1.0
                           :align-speed 1.0
                           :turnvf 30.0
                           :turnvvf 30.0
                           :tiltvf 150.0
                           :tiltvvf 15.0
                           :mode 'air
                           :flags (surface-flag turn-to-vel turn-when-centered gun-off)
                           )
        )

(defstate target-warp-out (target)
  :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
    (case message
      (('death-end)
       (let ((v0-0 (the-as object (logior (-> self draw status) (draw-control-status no-draw)))))
         (set! (-> self draw status) (the-as draw-control-status v0-0))
         v0-0
         )
       )
      (('warp-gate)
       (if (not (-> self control unknown-spool-anim00))
           'busy
           )
       )
      (else
        (target-generic-event-handler proc argc message block)
        )
      )
    )
  :enter (behavior ((arg0 vector) (arg1 vector) (arg2 target))
    (set-time! (-> self state-time))
    (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface))
    (set! (-> self control mod-surface) *warp-jump-mods*)
    (set! (-> self control unknown-vector37 quad) (-> arg0 quad))
    (set! (-> self control unknown-vector38 quad) (-> arg1 quad))
    (+! (-> self control unknown-vector37 y) -4096.0)
    (set! (-> self control unknown-word04) (the-as uint #f))
    (set! (-> self control unknown-handle02) (the-as handle arg2))
    (vector-reset! (-> self control transv))
    (logior! (-> self state-flags) (state-flags sf6))
    (set! (-> self alt-cam-pos quad) (-> arg1 quad))
    (forward-up-nopitch->quaternion
      (-> self control dir-targ)
      (vector-! (new 'stack-no-clear 'vector) arg1 (-> self control trans))
      (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ))
      )
    )
  :exit (behavior ()
    (logclear! (-> self state-flags) (state-flags sf6))
    )
  :code (behavior ((arg0 vector) (arg1 vector) (arg2 target))
    (ja-channel-push! 1 (seconds 0.2))
    (ja-no-eval :group! jakb-duck-high-jump-ja :num! (seek! (ja-aframe 16.0 0)) :frame-num 0.0)
    (until (ja-done? 0)
      (suspend)
      (ja :num! (seek! (ja-aframe 16.0 0)))
      )
    (vector-! (-> self control transv) (-> self control unknown-vector37) (-> self control trans))
    (vector-xz-normalize! (-> self control transv) 32768.0)
    (let ((v1-18 (new-stack-vector0)))
      (let ((f0-6 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))))
        0.0
        (vector-! v1-18 (-> self control transv) (vector-float*! v1-18 (-> self control dynam gravity-normal) f0-6))
        )
      (let* ((f0-7 (vector-length v1-18))
             (f1-1 f0-7)
             (f2-4
               (- (sqrtf
                    (* 2.0
                       (-> self control dynam gravity-length)
                       (vector-dot
                         (-> self control dynam gravity-normal)
                         (vector-! (new 'stack-no-clear 'vector) (-> self control unknown-vector37) (-> self control trans))
                         )
                       )
                    )
                  (* 0.008333334 (- (-> self control dynam gravity-length)))
                  )
               )
             )
        (vector+!
          (-> self control transv)
          (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-4)
          (vector-float*! v1-18 v1-18 (/ f0-7 f1-1))
          )
        )
      )
    (let ((v1-20 (-> self control root-prim)))
      (set! (-> v1-20 prim-core collide-as) (collide-spec))
      (set! (-> v1-20 prim-core collide-with) (collide-spec))
      )
    0
    (set-time! (-> self state-time))
    (set! (-> self trans-hook)
          (lambda :behavior target
            ()
            (let ((v1-0 (new-stack-vector0))
                  (f0-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))
                  )
              0.0
              (vector-! v1-0 (-> self control transv) (vector-float*! v1-0 (-> self control dynam gravity-normal) f0-1))
              (let* ((f1-2 (vector-length v1-0))
                     (f2-0 f1-2)
                     )
                (if (< f0-1 0.0)
                    (set! f0-1 8192.0)
                    )
                (vector+!
                  (-> self control transv)
                  (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-1)
                  (vector-float*! v1-0 v1-0 (/ f1-2 f2-0))
                  )
                )
              )
            (let ((gp-1 (vector-! (new-stack-vector0) (-> self control unknown-vector37) (-> self control trans))))
              (set! (-> gp-1 y) 0.0)
              (send-event *target* 'sidekick #f)
              (when (and (or (< (vector-dot gp-1 (-> self control transv)) 0.0) (-> self control unknown-spool-anim00))
                         (time-elapsed? (-> self state-time) (seconds 0.05))
                         )
                (vector-seek! (-> self draw color-mult) (new 'static 'vector) (* 2.0 (seconds-per-frame)))
                (set! (-> self control transv x) (* 0.95 (-> self control transv x)))
                (set! (-> self control transv z) (* 0.95 (-> self control transv z)))
                (when (not (-> self control unknown-spool-anim00))
                  (sound-play "warpgate-tele")
                  (send-event (handle->process (-> self control unknown-handle02)) 'effect)
                  (send-event self 'draw #f)
                  (set! (-> self control unknown-word04) (the-as uint #t))
                  )
                )
              )
            (none)
            )
          )
    (ja-no-eval :group! jakb-duck-high-jump-ja :num! (seek! (ja-aframe 40.0 0)) :frame-num (ja-aframe 16.0 0))
    (until (ja-done? 0)
      (suspend)
      (ja :num! (seek! (ja-aframe 40.0 0)))
      )
    (sleep-code)
    )
  :post target-no-stick-post
  )

(defstate target-warp-in (target)
  :event target-generic-event-handler
  :enter (behavior ((arg0 vector) (arg1 vector) (arg2 target))
    (set! (-> self control did-move-to-pole-or-max-jump-height) (the-as float arg2))
    ((-> target-warp-out enter) arg0 arg1 arg2)
    )
  :exit (-> target-warp-out exit)
  :trans (behavior ()
    (set! (-> self control transv x)
          (* 2.4 (- (-> self control unknown-vector38 x) (-> self control unknown-vector37 x)))
          )
    (set! (-> self control transv z)
          (* 2.4 (- (-> self control unknown-vector38 z) (-> self control unknown-vector37 z)))
          )
    (if (logtest? (-> self control status) (collide-status on-surface))
        (go target-hit-ground #f)
        )
    )
  :code (behavior ((arg0 vector) (arg1 vector) (arg2 target))
    (let ((a0-1 (-> self control did-move-to-pole-or-max-jump-height)))
      (when a0-1
        (let ((s5-0 (res-lump-struct (the-as res-lump a0-1) 'camera-name structure)))
          (when s5-0
            (logclear! (-> self state-flags) (state-flags sf6))
            (process-spawn-function
              process
              (lambda ((arg0 string))
                (local-vars (a1-2 event-message-block))
                (with-pp
                  (add-setting! 'entity-name arg0 0.0 0)
                  (until (send-event-function *camera* a1-2)
                    (suspend)
                    (set! a1-2 (new 'stack-no-clear 'event-message-block))
                    (let ((v1-2 (process->ppointer pp)))
                      (set! (-> a1-2 from) v1-2)
                      )
                    (set! (-> a1-2 num-params) 0)
                    (set! (-> a1-2 message) 'intro-done?)
                    )
                  (none)
                  )
                )
              s5-0
              :to self
              )
            )
          )
        )
      )
    (let ((v1-13 (-> self control root-prim)))
      (set! (-> self control backup-collide-as) (-> v1-13 prim-core collide-as))
      (set! (-> self control backup-collide-with) (-> v1-13 prim-core collide-with))
      )
    (let ((v1-16 (-> self control root-prim)))
      (set! (-> v1-16 prim-core collide-as) (collide-spec))
      (set! (-> v1-16 prim-core collide-with) (collide-spec))
      )
    0
    (ja-channel-set! 0)
    (vector-reset! (-> self control transv))
    (move-to-point! (-> self control) (-> self control unknown-vector37))
    (let ((s5-1 (current-time)))
      (while (or (not (time-elapsed? s5-1 (seconds 1)))
                 (< 81920.0 (vector-vector-distance (camera-pos) (-> self control trans)))
                 )
        (suspend)
        )
      )
    (set-heading-vec! (-> self control) (-> self control transv))
    (rot->dir-targ! (-> self control))
    (set-time! (-> self state-time))
    (set! (-> self post-hook) target-no-stick-post)
    (ja-channel-set! 1)
    (send-event
      (if arg2
          (-> arg2 child 3)
          )
      'effect
      )
    (send-event self 'draw #t)
    (sound-play "warpgate-tele")
    (ja-no-eval :group! jakb-duck-high-jump-ja :num! (seek! (ja-aframe 42.0 0)) :frame-num (ja-aframe 40.0 0))
    (until (ja-done? 0)
      (let ((v1-59 (new-stack-vector0)))
        (let ((f0-5 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))))
          0.0
          (vector-! v1-59 (-> self control transv) (vector-float*! v1-59 (-> self control dynam gravity-normal) f0-5))
          )
        (let* ((f0-6 (vector-length v1-59))
               (f1-1 f0-6)
               (f2-3
                 (- (sqrtf (* 4096.0 (-> self control dynam gravity-length)))
                    (* 0.008333334 (- (-> self control dynam gravity-length)))
                    )
                 )
               )
          (vector+!
            (-> self control transv)
            (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-3)
            (vector-float*! v1-59 v1-59 (/ f0-6 f1-1))
            )
          )
        )
      (suspend)
      (ja :num! (seek! (ja-aframe 42.0 0)))
      )
    (ja-no-eval :group! jakb-duck-high-jump-ja :num! (seek! (ja-aframe 50.0 0)) :frame-num (ja-aframe 42.0 0))
    (until (ja-done? 0)
      (suspend)
      (ja :num! (seek! (ja-aframe 50.0 0)))
      )
    (let ((v1-80 (-> self control root-prim)))
      (set! (-> v1-80 prim-core collide-as) (-> self control backup-collide-as))
      (set! (-> v1-80 prim-core collide-with) (-> self control backup-collide-with))
      )
    (ja-no-eval :group! jakb-duck-high-jump-ja :num! (seek!) :frame-num (ja-aframe 50.0 0))
    (until (ja-done? 0)
      (suspend)
      (ja :num! (seek!))
      )
    (target-falling-anim -1 (seconds 0.33))
    )
  :post target-no-move-post
  )

(defskelgroup skel-air-train air-train air-train-lod0-jg air-train-idle-ja
              ((air-train-lod0-mg (meters 999999)))
              :bounds (static-spherem 0 2 -2 12.5)
              :origin-joint-index 3
              )

(deftype air-train (warp-gate)
  "NOTE - I guess this is why sometimes the air-train makes the warp-gate sound"
  ((part-exhaust-left   sparticle-launch-control)
   (part-exhaust-right  sparticle-launch-control)
   (part-dust           sparticle-launch-control)
   (dust-y              float)
   (hover-sound         sound-id)
   (base-pos            vector  :inline)
   )
  )


;; WARN: Return type mismatch warp-gate vs air-train.
(defmethod relocate ((this air-train) (offset int))
  (if (nonzero? (-> this part-exhaust-left))
      (&+! (-> this part-exhaust-left) offset)
      )
  (if (nonzero? (-> this part-exhaust-right))
      (&+! (-> this part-exhaust-right) offset)
      )
  (if (nonzero? (-> this part-dust))
      (&+! (-> this part-dust) offset)
      )
  (the-as air-train ((method-of-type warp-gate relocate) this offset))
  )

(defmethod deactivate ((this air-train))
  "Make a process dead, clean it up, remove it from the active pool, and return to dead pool."
  (sound-stop (-> this hover-sound))
  (if (nonzero? (-> this part-exhaust-left))
      (kill-and-free-particles (-> this part-exhaust-left))
      )
  (if (nonzero? (-> this part-exhaust-right))
      (kill-and-free-particles (-> this part-exhaust-right))
      )
  (if (nonzero? (-> this part-dust))
      (kill-and-free-particles (-> this part-dust))
      )
  ((method-of-type warp-gate deactivate) this)
  (none)
  )

;; WARN: Return type mismatch draw-control vs none.
(defmethod init-skel-and-collide ((this air-train))
  (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-group s5-0 (the-as uint 2) 0)))
      (set! (-> s5-0 total-prims) (the-as uint 3))
      (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle))
      (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list))
      (set! (-> s4-0 prim-core action) (collide-action solid))
      (set! (-> s4-0 transform-index) 3)
      (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 69632.0)
      (set! (-> s5-0 root-prim) s4-0)
      )
    (let ((v1-13 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0))))
      (set! (-> v1-13 prim-core collide-as) (collide-spec obstacle))
      (set! (-> v1-13 prim-core collide-with) (collide-spec jak player-list))
      (set! (-> v1-13 prim-core action) (collide-action solid))
      (set! (-> v1-13 transform-index) 4)
      (set-vector! (-> v1-13 local-sphere) 0.0 10240.0 0.0 24576.0)
      )
    (let ((v1-15 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0))))
      (set! (-> v1-15 prim-core collide-as) (collide-spec obstacle))
      (set! (-> v1-15 prim-core collide-with) (collide-spec jak player-list))
      (set! (-> v1-15 prim-core action) (collide-action solid))
      (set! (-> v1-15 transform-index) 3)
      (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 53248.0)
      )
    (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
    (let ((v1-18 (-> s5-0 root-prim)))
      (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as))
      (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with))
      )
    (set! (-> this root) s5-0)
    )
  (initialize-skeleton
    this
    (the-as skeleton-group (art-group-get-by-name *level* "skel-air-train" (the-as (pointer uint32) #f)))
    (the-as pair 0)
    )
  (none)
  )

;; WARN: Return type mismatch sound-id vs none.
(defmethod setup-fields ((this air-train))
  (let ((t9-0 (method-of-type warp-gate setup-fields)))
    (t9-0 this)
    )
  (set! (-> this base-pos quad) (-> this root trans quad))
  (let ((v1-2 (-> this level-name)))
    (set! (-> this dust-y) (cond
                             ((= v1-2 'nest)
                              -1105.92
                              )
                             ((= v1-2 'caspad)
                              114647.04
                              )
                             (else
                               (the-as float #x7f800000)
                               )
                             )
          )
    )
  (set! (-> this part-exhaust-left) (create-launch-control (-> *part-group-id-table* 134) this))
  (set! (-> this part-exhaust-right) (create-launch-control (-> *part-group-id-table* 134) this))
  (set! (-> this part-dust) (create-launch-control (-> *part-group-id-table* 132) this))
  (set! (-> this root pause-adjust-distance) 368640.0)
  (set! (-> this hover-sound) (sound-play "air-train"))
  (none)
  )

(defstate idle (air-train)
  :virtual #t
  :post (behavior ()
    (let ((t9-0 (-> (method-of-type warp-gate idle) post)))
      (if t9-0
          ((the-as (function none) t9-0))
          )
      )
    (set! (-> self root trans y) (+ (-> self base-pos y)
                                    (* 696.32 (cos (* 66.19798 (the float (mod (current-time) 990)))))
                                    (* 450.56 (cos (* 42.25403 (the float (mod (current-time) 1551)))))
                                    )
          )
    (spawn-with-cspace (-> self part-exhaust-left) (joint-node air-train-lod0-jg thruster_l))
    (spawn-with-cspace (-> self part-exhaust-right) (joint-node air-train-lod0-jg thruster_r))
    (let ((f0-9 (-> self dust-y)))
      (when (!= f0-9 (the-as float #x7f800000))
        (let ((a1-2 (new 'stack-no-clear 'vector)))
          (set! (-> a1-2 quad) (-> self root trans quad))
          (set! (-> a1-2 y) f0-9)
          (spawn (-> self part-dust) a1-2)
          )
        )
      )
    (sound-play "air-train" :id (-> self hover-sound) :position (-> self root trans))
    )
  )

(defstate use (air-train)
  :virtual #t
  :code (behavior ((arg0 continue-point))
    (kill-current-talker (the-as symbol '()) '() 'exit)
    (set-time! (-> self state-time))
    (logclear! (-> self mask) (process-mask actor-pause))
    (when (not arg0)
      (process-release? *target*)
      (go-virtual idle)
      )
    (set-setting! 'allow-progress #f 0.0 0)
    (set! (-> *setting-control* user-default border-mode) #t)
    (set! (-> *level* play?) #t)
    (apply-settings *setting-control*)
    (sound-stop (-> self hover-sound))
    (set! (-> self hover-sound) (new 'static 'sound-id))
    (script-eval (-> self on-activate))
    (sleep-code)
    )
  )

(scene-method-16 (new 'static 'scene
                   :name "city-air-train-in-caspad"
                   :extra #f
                   :info #f
                   :mask-to-clear (process-mask movie enemy platform projectile)
                   :entity "scene-stage-87"
                   :art-group "scenecamera"
                   :anim "city-air-train-in-caspad"
                   :parts 3
                   :command-list '((0
                       (kill "air-train-1")
                       (fadein (frame-time-30 (new 'static 'bfloat :data 10.0)))
                       (part-tracker
                         "group-airtrain-thruster-off"
                         entity
                         "air-train"
                         joint
                         "thruster_l"
                         track
                         #t
                         duration
                         (frame-range 0 102)
                         )
                       (part-tracker
                         "group-airtrain-thruster-off"
                         entity
                         "air-train"
                         joint
                         "thruster_r"
                         track
                         #t
                         duration
                         (frame-range 0 102)
                         )
                       )
                     (102
                       (part-tracker
                         "group-airtrain-thruster"
                         entity
                         "air-train"
                         joint
                         "thruster_l"
                         track
                         #t
                         duration
                         (frame-range 102 280)
                         )
                       (part-tracker
                         "group-airtrain-thruster"
                         entity
                         "air-train"
                         joint
                         "thruster_r"
                         track
                         #t
                         duration
                         (frame-range 102 280)
                         )
                       )
                     (265 (fadeout (frame-time-30 (new 'static 'bfloat :data 15.0))))
                     )
                   :cut-list '(51 102 226)
                   :wait-ground-time (seconds 1)
                   :draw-target #f
                   :abort #t
                   :actor (new 'static 'boxed-array :type scene-actor
                     (new 'static 'scene-actor
                       :name "scenecamera"
                       :level #f
                       :art-group "skel-scenecamera"
                       :prefix ""
                       :draw-frames '((min max))
                       :scissor-frames '()
                       :camera 4
                       :shadow-flags -1
                       :shadow-volume-joint #f
                       )
                     (new 'static 'scene-actor
                       :name "sidekick-highres"
                       :level 'ljakdax
                       :art-group "skel-sidekick-highres"
                       :prefix ""
                       :draw-frames '((min max))
                       :scissor-frames '()
                       :flags #x1
                       :shadow-flags -1
                       :shadow-volume-joint #f
                       )
                     (new 'static 'scene-actor
                       :name "jak-highres"
                       :level 'ljakdax
                       :art-group "skel-jak-highres"
                       :prefix ""
                       :draw-frames '((min max))
                       :scissor-frames '()
                       :flags #x1
                       :shadow-flags -1
                       :shadow-volume-joint #f
                       )
                     (new 'static 'scene-actor
                       :name "air-train"
                       :level 'ctyport
                       :art-group "skel-air-train"
                       :prefix ""
                       :draw-frames '((min max))
                       :scissor-frames '((102 max))
                       :flags #x1
                       :shadow-flags -1
                       :shadow-volume-joint #f
                       )
                     )
                   :load-point-obj "ctyport-air-train"
                   :end-point-obj "caspad-warp"
                   :borrow '()
                   :sfx-volume -1.0
                   :ambient-volume -1.0
                   :music-volume -1.0
                   :blackout-end #t
                   :peaceful #t
                   :music-delay 1500.0
                   :save #t
                   )
                 )

(scene-method-16 (new 'static 'scene
                   :name "city-air-train-in-nest"
                   :extra #f
                   :info #f
                   :mask-to-clear (process-mask movie enemy platform projectile)
                   :entity "scene-stage-87"
                   :art-group "scenecamera"
                   :anim "city-air-train-in-nest"
                   :parts 3
                   :command-list '((0
                       (kill "air-train-1")
                       (fadein (frame-time-30 (new 'static 'bfloat :data 10.0)))
                       (part-tracker
                         "group-airtrain-thruster-off"
                         entity
                         "air-train"
                         joint
                         "thruster_l"
                         track
                         #t
                         duration
                         (frame-range 0 102)
                         )
                       (part-tracker
                         "group-airtrain-thruster-off"
                         entity
                         "air-train"
                         joint
                         "thruster_r"
                         track
                         #t
                         duration
                         (frame-range 0 102)
                         )
                       )
                     (102
                       (part-tracker
                         "group-airtrain-thruster"
                         entity
                         "air-train"
                         joint
                         "thruster_l"
                         track
                         #t
                         duration
                         (frame-range 102 280)
                         )
                       (part-tracker
                         "group-airtrain-thruster"
                         entity
                         "air-train"
                         joint
                         "thruster_r"
                         track
                         #t
                         duration
                         (frame-range 102 280)
                         )
                       )
                     (265 (fadeout (frame-time-30 (new 'static 'bfloat :data 15.0))))
                     )
                   :cut-list '(51 102 226)
                   :wait-ground-time (seconds 1)
                   :draw-target #f
                   :abort #t
                   :actor (new 'static 'boxed-array :type scene-actor
                     (new 'static 'scene-actor
                       :name "scenecamera"
                       :level #f
                       :art-group "skel-scenecamera"
                       :prefix ""
                       :draw-frames '((min max))
                       :scissor-frames '()
                       :camera 4
                       :shadow-flags -1
                       :shadow-volume-joint #f
                       )
                     (new 'static 'scene-actor
                       :name "sidekick-highres"
                       :level 'ljakdax
                       :art-group "skel-sidekick-highres"
                       :prefix ""
                       :draw-frames '((min max))
                       :scissor-frames '()
                       :flags #x1
                       :shadow-flags -1
                       :shadow-volume-joint #f
                       )
                     (new 'static 'scene-actor
                       :name "jak-highres"
                       :level 'ljakdax
                       :art-group "skel-jak-highres"
                       :prefix ""
                       :draw-frames '((min max))
                       :scissor-frames '()
                       :flags #x1
                       :shadow-flags -1
                       :shadow-volume-joint #f
                       )
                     (new 'static 'scene-actor
                       :name "air-train"
                       :level 'ctyport
                       :art-group "skel-air-train"
                       :prefix ""
                       :draw-frames '((min max))
                       :scissor-frames '((102 max))
                       :flags #x1
                       :shadow-flags -1
                       :shadow-volume-joint #f
                       )
                     )
                   :load-point-obj "ctyport-air-train"
                   :end-point-obj "nest-warp"
                   :borrow '()
                   :sfx-volume -1.0
                   :ambient-volume -1.0
                   :music-volume -1.0
                   :blackout-end #t
                   :peaceful #t
                   :music-delay 1500.0
                   :save #t
                   )
                 )

(scene-method-16 (new 'static 'scene
                   :name "city-air-train-out"
                   :extra #f
                   :info #f
                   :mask-to-clear (process-mask movie enemy platform projectile)
                   :entity "scene-stage-87"
                   :art-group "scenecamera"
                   :anim "city-air-train-out"
                   :parts 2
                   :command-list '((0
                       (kill "air-train-1")
                       (fadein (frame-time-30 (new 'static 'bfloat :data 10.0)))
                       (part-tracker
                         "group-airtrain-thruster"
                         entity
                         "air-train"
                         joint
                         "thruster_l"
                         track
                         #t
                         duration
                         (frame-range 0 98)
                         )
                       (part-tracker
                         "group-airtrain-thruster"
                         entity
                         "air-train"
                         joint
                         "thruster_r"
                         track
                         #t
                         duration
                         (frame-range 0 98)
                         )
                       )
                     (98
                       (part-tracker
                         "group-airtrain-thruster-off"
                         entity
                         "air-train"
                         joint
                         "thruster_l"
                         track
                         #t
                         duration
                         (frame-range 98 240)
                         )
                       (part-tracker
                         "group-airtrain-thruster-off"
                         entity
                         "air-train"
                         joint
                         "thruster_r"
                         track
                         #t
                         duration
                         (frame-range 98 240)
                         )
                       )
                     (230 (fadeout (frame-time-30 (new 'static 'bfloat :data 10.0))))
                     )
                   :cut-list '(98 188)
                   :wait-ground-time (seconds 1)
                   :draw-target #f
                   :abort #t
                   :actor (new 'static 'boxed-array :type scene-actor
                     (new 'static 'scene-actor
                       :name "scenecamera"
                       :level #f
                       :art-group "skel-scenecamera"
                       :prefix ""
                       :draw-frames '((min max))
                       :scissor-frames '()
                       :camera 4
                       :shadow-flags -1
                       :shadow-volume-joint #f
                       )
                     (new 'static 'scene-actor
                       :name "sidekick-highres"
                       :level 'ljakdax
                       :art-group "skel-sidekick-highres"
                       :prefix ""
                       :draw-frames '((min max))
                       :scissor-frames '()
                       :flags #x1
                       :shadow-flags -1
                       :shadow-volume-joint #f
                       )
                     (new 'static 'scene-actor
                       :name "jak-highres"
                       :level 'ljakdax
                       :art-group "skel-jak-highres"
                       :prefix ""
                       :draw-frames '((min max))
                       :scissor-frames '()
                       :flags #x1
                       :shadow-flags -1
                       :shadow-volume-joint #f
                       )
                     (new 'static 'scene-actor
                       :name "air-train"
                       :level 'ctyport
                       :art-group "skel-air-train"
                       :prefix ""
                       :draw-frames '((min max))
                       :scissor-frames '()
                       :flags #x1
                       :shadow-flags -1
                       :shadow-volume-joint #f
                       )
                     )
                   :load-point-obj "ctyport-air-train"
                   :end-point-obj "ctyport-warp"
                   :borrow '()
                   :sfx-volume -1.0
                   :ambient-volume -1.0
                   :music-volume -1.0
                   :blackout-end #t
                   :peaceful #t
                   :music-delay 1500.0
                   :save #t
                   )
                 )

(scene-method-16
  (new 'static 'scene
    :name "city-ashelin-drop-off"
    :extra #f
    :info #f
    :mask-to-clear (process-mask movie enemy platform projectile)
    :entity "scene-stage-87"
    :art-group "scenecamera"
    :anim "city-ashelin-drop-off"
    :parts 3
    :command-list '((0
        (kill "air-train-1")
        (fadein (frame-time-30 (new 'static 'bfloat :data 10.0)))
        (fma-sphere
          (nav kill-once)
          sphere
          (new 'static 'vector :x 1585152.0 :y 31539.2 :z 7225344.0 :w 26624.0)
          duration
          (frame-range (new 'static 'bfloat) (new 'static 'bfloat :data 9.0))
          )
        (fma-sphere
          (nav kill-once)
          sphere
          (new 'static 'vector :x 1570816.0 :y 31539.2 :z 7249920.0 :w 30720.0)
          duration
          (frame-range (new 'static 'bfloat) (new 'static 'bfloat :data 21.0))
          )
        (fma-sphere
          (nav kill-once)
          sphere
          (new 'static 'vector :x 1556480.0 :y 31539.2 :z 7278592.0 :w 34816.0)
          duration
          (frame-range (new 'static 'bfloat) (new 'static 'bfloat :data 48.0))
          )
        (fma-sphere (nav kill-once) sphere (new 'static 'vector :x 1542144.0 :y 31539.2 :z 7303168.0 :w 34816.0))
        (fma-sphere
          (nav kill-once)
          sphere
          (new 'static 'vector :x 1527808.0 :y 31539.2 :z 7331840.0 :w 34816.0)
          duration
          (frame-range (new 'static 'bfloat) (new 'static 'bfloat :data 208.0))
          )
        (fma-sphere
          (nav kill-once)
          sphere
          (new 'static 'vector :x 1499136.0 :y 31539.2 :z 7360512.0 :w 34816.0)
          duration
          (frame-range (new 'static 'bfloat) (new 'static 'bfloat :data 225.0))
          )
        (fma-sphere
          (nav kill-once)
          sphere
          (new 'static 'vector :x 1486848.0 :y 31539.2 :z 7380992.0 :w 38912.0)
          duration
          (frame-range (new 'static 'bfloat) (new 'static 'bfloat :data 233.0))
          )
        (fma-sphere
          (nav kill-once)
          sphere
          (new 'static 'vector :x 1451212.8 :y 31539.2 :z 7389184.0 :w 38912.0)
          duration
          (frame-range (new 'static 'bfloat) (new 'static 'bfloat :data 245.0))
          )
        (fma-sphere
          (nav kill-once)
          sphere
          (new 'static 'vector :x 1409433.6 :y 31539.2 :z 7412531.0 :w 38912.0)
          duration
          (frame-range (new 'static 'bfloat) (new 'static 'bfloat :data 245.0))
          )
        (fma-sphere
          (nav kill-once)
          sphere
          (new 'static 'vector :x 1518592.0 :y 31539.2 :z 7317504.0 :w 22528.0)
          duration
          (frame-range (new 'static 'bfloat) (new 'static 'bfloat :data 295.0))
          )
        (fma-sphere (nav kill-once) sphere (new 'static 'vector :x 1525350.4 :y 31539.2 :z 7272857.5 :w 17203.2))
        )
      (177 (part-tracker
             "group-warp-hellcat-thruster"
             entity
             "hellcat"
             joint
             "main"
             track
             #t
             duration
             (frame-range 177 295)
             )
           )
      (290 (fadeout (frame-time-30 (new 'static 'bfloat :data 10.0))))
      )
    :cut-list '(115 177)
    :wait-ground-time (seconds 1)
    :draw-target #f
    :abort #t
    :actor (new 'static 'boxed-array :type scene-actor
      (new 'static 'scene-actor
        :name "scenecamera"
        :level #f
        :art-group "skel-scenecamera"
        :prefix ""
        :draw-frames '((min max))
        :scissor-frames '()
        :camera 4
        :shadow-flags -1
        :shadow-volume-joint #f
        )
      (new 'static 'scene-actor
        :name "sidekick-highres"
        :level 'ljkdxash
        :art-group "skel-sidekick-highres"
        :prefix ""
        :draw-frames '((min max))
        :scissor-frames '()
        :flags #x1
        :shadow-flags -1
        :shadow-volume-joint #f
        )
      (new 'static 'scene-actor
        :name "jak-highres"
        :level 'ljkdxash
        :art-group "skel-jak-highres"
        :prefix ""
        :draw-frames '((min max))
        :scissor-frames '()
        :flags #x1
        :shadow-flags -1
        :shadow-volume-joint #f
        )
      (new 'static 'scene-actor
        :name "ashelin-highres"
        :level 'ljkdxash
        :art-group "skel-ashelin-highres"
        :prefix ""
        :draw-frames '((min max))
        :scissor-frames '()
        :flags #x1
        :shadow-flags -1
        :shadow-volume-joint #f
        )
      (new 'static 'scene-actor
        :name "hellcat"
        :level 'lwidea
        :art-group "skel-hellcat"
        :prefix ""
        :draw-frames '((min max))
        :scissor-frames '()
        :flags #x1
        :shadow-flags -1
        :shadow-volume-joint #f
        )
      )
    :load-point-obj "ctyport-air-train-ashelin"
    :end-point-obj "ctyport-start"
    :borrow '((ctywide 1 lwidea special))
    :sfx-volume -1.0
    :ambient-volume -1.0
    :music-volume -1.0
    :blackout-end #t
    :peaceful #t
    :music-delay 1500.0
    :save #t
    )
  )

(scene-method-16 (new 'static 'scene
                   :name "caspad-air-train-in"
                   :extra #f
                   :info #f
                   :mask-to-clear (process-mask movie enemy platform projectile)
                   :entity "air-train-3"
                   :art-group "scenecamera"
                   :anim "caspad-air-train-in"
                   :parts 4
                   :command-list '((0
                       (kill "air-train-3")
                       (fadein (frame-time-30 (new 'static 'bfloat :data 5.0)))
                       (part-tracker
                         "group-airtrain-thruster-off"
                         entity
                         "air-train"
                         joint
                         "thruster_l"
                         track
                         #t
                         duration
                         (frame-range 0 285)
                         )
                       (part-tracker
                         "group-airtrain-thruster-off"
                         entity
                         "air-train"
                         joint
                         "thruster_r"
                         track
                         #t
                         duration
                         (frame-range 0 285)
                         )
                       )
                     (285
                       (part-tracker
                         "group-airtrain-thruster"
                         entity
                         "air-train"
                         joint
                         "thruster_l"
                         track
                         #t
                         duration
                         (frame-range 285 480)
                         )
                       (part-tracker
                         "group-airtrain-thruster"
                         entity
                         "air-train"
                         joint
                         "thruster_r"
                         track
                         #t
                         duration
                         (frame-range 285 480)
                         )
                       )
                     (293 (part-tracker
                            "group-airtrain-dust-plume"
                            entity
                            "particleman"
                            joint
                            "particleA"
                            track
                            #t
                            duration
                            (frame-range 293 370)
                            )
                          )
                     (470 (fadeout (frame-time-30 10)))
                     )
                   :cut-list '(93 285)
                   :wait-ground-time (seconds 1)
                   :draw-target #f
                   :abort #t
                   :actor (new 'static 'boxed-array :type scene-actor
                     (new 'static 'scene-actor
                       :name "scenecamera"
                       :level #f
                       :art-group "skel-scenecamera"
                       :prefix ""
                       :draw-frames '((min max))
                       :scissor-frames '()
                       :camera 4
                       :shadow-flags -1
                       :shadow-volume-joint #f
                       )
                     (new 'static 'scene-actor
                       :name "sidekick-highres"
                       :level 'caspad
                       :art-group "skel-sidekick-highres"
                       :prefix ""
                       :draw-frames '((min max))
                       :scissor-frames '()
                       :flags #x1
                       :shadow-flags -1
                       :shadow-volume-joint #f
                       )
                     (new 'static 'scene-actor
                       :name "jak-highres"
                       :level 'caspad
                       :art-group "skel-jak-highres"
                       :prefix ""
                       :draw-frames '((min max))
                       :scissor-frames '()
                       :flags #x1
                       :shadow-flags -1
                       :shadow-volume-joint #f
                       )
                     (new 'static 'scene-actor
                       :name "air-train"
                       :level 'caspad
                       :art-group "skel-air-train"
                       :prefix ""
                       :draw-frames '((min max))
                       :scissor-frames '()
                       :flags #x1
                       :shadow-flags -1
                       :shadow-volume-joint #f
                       )
                     (new 'static 'scene-actor
                       :name "particleman"
                       :level 'caspad
                       :art-group "skel-particleman"
                       :prefix ""
                       :draw-frames '((min max))
                       :scissor-frames '()
                       :flags #x1
                       :shadow-flags -1
                       :shadow-volume-joint #f
                       )
                     )
                   :load-point-obj "caspad-warp"
                   :end-point-obj "ctyport-warp"
                   :borrow '()
                   :sfx-volume -1.0
                   :ambient-volume -1.0
                   :music-volume -1.0
                   :blackout-end #t
                   :peaceful #t
                   :music-delay 1500.0
                   :save #t
                   )
                 )

(scene-method-16
  (new 'static 'scene
    :name "caspad-air-train-out"
    :extra #f
    :info #f
    :mask-to-clear (process-mask movie enemy platform projectile)
    :entity "air-train-3"
    :art-group "scenecamera"
    :anim "caspad-air-train-out"
    :parts 3
    :command-list '((0
        (kill "air-train-3")
        (fadein (frame-time-30 (new 'static 'bfloat :data 10.0)))
        (part-tracker
          "group-airtrain-thruster"
          entity
          "air-train"
          joint
          "thruster_l"
          track
          #t
          duration
          (frame-range 0 195)
          )
        (part-tracker
          "group-airtrain-thruster"
          entity
          "air-train"
          joint
          "thruster_r"
          track
          #t
          duration
          (frame-range 0 195)
          )
        )
      (80
        (part-tracker
          "group-airtrain-dust-plume"
          entity
          "particleman"
          joint
          "particleA"
          track
          #t
          duration
          (frame-range 80 190)
          )
        )
      (180
        (part-tracker
          "group-airtrain-thruster-off"
          entity
          "air-train"
          joint
          "thruster_l"
          track
          #t
          duration
          (frame-range 180 295)
          )
        (part-tracker
          "group-airtrain-thruster-off"
          entity
          "air-train"
          joint
          "thruster_r"
          track
          #t
          duration
          (frame-range 180 295)
          )
        )
      (285 (fadeout (frame-time-30 (new 'static 'bfloat :data 10.0))))
      (10000
        (apply
          ,(lambda :behavior scene-player
             ()
             (set! (-> self scene end-point-obj) (if (task-node-closed? (game-task-node castle-break-in-introduction))
                                                     "caspad-face-castle"
                                                     "caspad-warp"
                                                     )
                   )
             (none)
             )
          )
        )
      )
    :cut-list '(180)
    :wait-ground-time (seconds 1)
    :draw-target #f
    :abort #t
    :actor (new 'static 'boxed-array :type scene-actor
      (new 'static 'scene-actor
        :name "scenecamera"
        :level #f
        :art-group "skel-scenecamera"
        :prefix ""
        :draw-frames '((min max))
        :scissor-frames '()
        :camera 4
        :shadow-flags -1
        :shadow-volume-joint #f
        )
      (new 'static 'scene-actor
        :name "sidekick-highres"
        :level 'caspad
        :art-group "skel-sidekick-highres"
        :prefix ""
        :draw-frames '((min max))
        :scissor-frames '()
        :flags #x1
        :shadow-flags -1
        :shadow-volume-joint #f
        )
      (new 'static 'scene-actor
        :name "jak-highres"
        :level 'caspad
        :art-group "skel-jak-highres"
        :prefix ""
        :draw-frames '((min max))
        :scissor-frames '()
        :flags #x1
        :shadow-flags -1
        :shadow-volume-joint #f
        )
      (new 'static 'scene-actor
        :name "air-train"
        :level 'caspad
        :art-group "skel-air-train"
        :prefix ""
        :draw-frames '((min max))
        :scissor-frames '()
        :flags #x1
        :shadow-flags -1
        :shadow-volume-joint #f
        )
      (new 'static 'scene-actor
        :name "particleman"
        :level 'caspad
        :art-group "skel-particleman"
        :prefix ""
        :draw-frames '((min max))
        :scissor-frames '()
        :flags #x1
        :shadow-flags -1
        :shadow-volume-joint #f
        )
      )
    :load-point-obj "caspad-warp"
    :end-point-obj "caspad-warp"
    :borrow '()
    :sfx-volume -1.0
    :ambient-volume -1.0
    :music-volume -1.0
    :blackout-end #t
    :peaceful #t
    :music-delay 1500.0
    :save #t
    )
  )

(scene-method-16 (new 'static 'scene
                   :name "nest-air-train-in"
                   :extra #f
                   :info #f
                   :mask-to-clear (process-mask movie enemy platform projectile)
                   :entity "scene-stage-90"
                   :art-group "scenecamera"
                   :anim "nest-air-train-in"
                   :parts 3
                   :command-list '((0
                       (kill "air-train-4")
                       (fadein (frame-time-30 (new 'static 'bfloat :data 5.0)))
                       (part-tracker
                         "group-airtrain-thruster-off"
                         entity
                         "air-train"
                         joint
                         "thruster_l"
                         track
                         #t
                         duration
                         (frame-range 0 88)
                         )
                       (part-tracker
                         "group-airtrain-thruster-off"
                         entity
                         "air-train"
                         joint
                         "thruster_r"
                         track
                         #t
                         duration
                         (frame-range 0 88)
                         )
                       )
                     (88
                       (part-tracker
                         "group-airtrain-thruster"
                         entity
                         "air-train"
                         joint
                         "thruster_l"
                         track
                         #t
                         duration
                         (frame-range 88 280)
                         )
                       (part-tracker
                         "group-airtrain-thruster"
                         entity
                         "air-train"
                         joint
                         "thruster_r"
                         track
                         #t
                         duration
                         (frame-range 88 280)
                         )
                       )
                     (75 (part-tracker
                           "group-airtrain-dust-plume"
                           entity
                           "particleman"
                           joint
                           "particleA"
                           track
                           #t
                           duration
                           (frame-range 90 170)
                           )
                         )
                     (265 (fadeout (frame-time-30 (new 'static 'bfloat :data 15.0))))
                     )
                   :cut-list '(30 88)
                   :wait-ground-time (seconds 1)
                   :draw-target #f
                   :abort #t
                   :actor (new 'static 'boxed-array :type scene-actor
                     (new 'static 'scene-actor
                       :name "scenecamera"
                       :level #f
                       :art-group "skel-scenecamera"
                       :prefix ""
                       :draw-frames '((min max))
                       :scissor-frames '()
                       :camera 4
                       :shadow-flags -1
                       :shadow-volume-joint #f
                       )
                     (new 'static 'scene-actor
                       :name "sidekick-highres"
                       :level 'nestb
                       :art-group "skel-sidekick-highres"
                       :prefix ""
                       :draw-frames '((min 117))
                       :scissor-frames '()
                       :flags #x1
                       :shadow-flags -1
                       :shadow-volume-joint #f
                       )
                     (new 'static 'scene-actor
                       :name "darkjak-highres"
                       :level 'nestb
                       :art-group "skel-darkjak-highres"
                       :prefix ""
                       :draw-frames '((min 117))
                       :scissor-frames '()
                       :flags #x1
                       :shadow-flags -1
                       :shadow-volume-joint #f
                       )
                     (new 'static 'scene-actor
                       :name "air-train"
                       :level 'nest
                       :art-group "skel-air-train"
                       :prefix ""
                       :draw-frames '((min max))
                       :scissor-frames '((30 88))
                       :flags #x1
                       :shadow-flags -1
                       :shadow-volume-joint #f
                       )
                     (new 'static 'scene-actor
                       :name "particleman"
                       :level 'nestb
                       :art-group "skel-particleman"
                       :prefix ""
                       :draw-frames '((min max))
                       :scissor-frames '()
                       :shadow-flags -1
                       :shadow-volume-joint #f
                       )
                     )
                   :load-point-obj "nest-warp"
                   :end-point-obj "ctyport-warp"
                   :borrow '()
                   :sfx-volume -1.0
                   :ambient-volume -1.0
                   :music-volume -1.0
                   :blackout-end #t
                   :peaceful #t
                   :music-delay 1500.0
                   :save #t
                   )
                 )

(scene-method-16 (new 'static 'scene
                   :name "nest-air-train-out"
                   :extra #f
                   :info #f
                   :mask-to-clear (process-mask movie enemy platform projectile)
                   :entity "scene-stage-90"
                   :art-group "scenecamera"
                   :anim "nest-air-train-out"
                   :parts 3
                   :command-list '((0
                       (kill "air-train-4")
                       (fadein (frame-time-30 (new 'static 'bfloat :data 15.0)))
                       (part-tracker
                         "group-airtrain-thruster"
                         entity
                         "air-train"
                         joint
                         "thruster_l"
                         track
                         #t
                         duration
                         (frame-range 0 242)
                         )
                       (part-tracker
                         "group-airtrain-thruster"
                         entity
                         "air-train"
                         joint
                         "thruster_r"
                         track
                         #t
                         duration
                         (frame-range 0 242)
                         )
                       )
                     (130 (part-tracker
                            "group-airtrain-dust-plume"
                            entity
                            "particleman"
                            joint
                            "particleA"
                            track
                            #t
                            duration
                            (frame-range 130 296)
                            )
                          )
                     (232
                       (part-tracker
                         "group-airtrain-thruster-off"
                         entity
                         "air-train"
                         joint
                         "thruster_l"
                         track
                         #t
                         duration
                         (frame-range 232 300)
                         )
                       (part-tracker
                         "group-airtrain-thruster-off"
                         entity
                         "air-train"
                         joint
                         "thruster_r"
                         track
                         #t
                         duration
                         (frame-range 232 300)
                         )
                       )
                     (295 (fadeout (frame-time-30 (new 'static 'bfloat :data 5.0))))
                     )
                   :cut-list '(232)
                   :wait-ground-time (seconds 1)
                   :draw-target #f
                   :abort #t
                   :actor (new 'static 'boxed-array :type scene-actor
                     (new 'static 'scene-actor
                       :name "scenecamera"
                       :level #f
                       :art-group "skel-scenecamera"
                       :prefix ""
                       :draw-frames '((min max))
                       :scissor-frames '()
                       :camera 4
                       :shadow-flags -1
                       :shadow-volume-joint #f
                       )
                     (new 'static 'scene-actor
                       :name "sidekick-highres"
                       :level 'nestb
                       :art-group "skel-sidekick-highres"
                       :prefix ""
                       :draw-frames '((min max))
                       :scissor-frames '()
                       :flags #x1
                       :shadow-flags -1
                       :shadow-volume-joint #f
                       )
                     (new 'static 'scene-actor
                       :name "darkjak-highres"
                       :level 'nestb
                       :art-group "skel-darkjak-highres"
                       :prefix ""
                       :draw-frames '((min max))
                       :scissor-frames '()
                       :flags #x1
                       :shadow-flags -1
                       :shadow-volume-joint #f
                       )
                     (new 'static 'scene-actor
                       :name "air-train"
                       :level 'nest
                       :art-group "skel-air-train"
                       :prefix ""
                       :draw-frames '((min max))
                       :scissor-frames '()
                       :flags #x1
                       :shadow-flags -1
                       :shadow-volume-joint #f
                       )
                     (new 'static 'scene-actor
                       :name "particleman"
                       :level 'nestb
                       :art-group "skel-particleman"
                       :prefix ""
                       :draw-frames '((min max))
                       :scissor-frames '()
                       :shadow-flags -1
                       :shadow-volume-joint #f
                       )
                     )
                   :load-point-obj "nest-warp"
                   :end-point-obj "nest-warp"
                   :borrow '()
                   :sfx-volume -1.0
                   :ambient-volume -1.0
                   :music-volume -1.0
                   :blackout-end #t
                   :peaceful #t
                   :music-delay 1500.0
                   :save #t
                   )
                 )
