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

(import "goal_src/jak1/import/jaws-ag.gc")
(import "goal_src/jak1/import/assistant-village2-ag.gc")

;; definition of type assistant-levitator
(deftype assistant-levitator (process-taskable)
  ((boulder  entity-actor               :offset-assert 380)
   (particle sparticle-launch-control 4 :offset-assert 384)
   )
  :heap-base #x120
  :method-count-assert 53
  :size-assert         #x190
  :flag-assert         #x3501200190
  (:states
    just-particles
    )
  )

;; definition for method 3 of type assistant-levitator
(defmethod inspect assistant-levitator ((obj assistant-levitator))
  (let ((t9-0 (method-of-type process-taskable inspect)))
    (t9-0 obj)
    )
  (format #t "~T~Tboulder: ~A~%" (-> obj boulder))
  (format #t "~T~Tparticle[4] @ #x~X~%" (-> obj particle))
  obj
  )

;; definition for method 7 of type assistant-levitator
;; INFO: Return type mismatch process-taskable vs assistant-levitator.
(defmethod relocate assistant-levitator ((obj assistant-levitator) (arg0 int))
  (dotimes (v1-0 4)
    (if (nonzero? (-> obj particle v1-0))
        (&+! (-> obj particle v1-0) arg0)
        )
    )
  (the-as assistant-levitator ((method-of-type process-taskable relocate) obj arg0))
  )

;; definition for method 10 of type assistant-levitator
(defmethod deactivate assistant-levitator ((obj assistant-levitator))
  (dotimes (s5-0 4)
    (let ((a0-1 (-> obj particle s5-0)))
      (if (nonzero? a0-1)
          (kill-and-free-particles a0-1)
          )
      )
    )
  ((method-of-type process-taskable deactivate) obj)
  (none)
  )

;; failed to figure out what this is:
(defskelgroup *assistant-village2-sg* assistant-village2 assistant-village2-lod0-jg assistant-village2-idle-a-ja
              ((assistant-village2-lod0-mg (meters 20))
               (assistant-village2-lod1-mg (meters 40))
               (assistant-village2-lod2-mg (meters 999999))
               )
              :bounds (static-spherem 0 0 0 2)
              :shadow assistant-village2-shadow-mg
              )

;; failed to figure out what this is:
(defskelgroup *jaws-sg* jaws jaws-lod0-jg jaws-idle-ja
              ((jaws-lod0-mg (meters 999999)))
              :bounds (static-spherem 0 0 0 0.25)
              )

;; definition for method 52 of type assistant-levitator
;; INFO: Return type mismatch shadow-flags vs none.
(defmethod dummy-52 assistant-levitator ((obj assistant-levitator))
  (let ((v1-1 (-> obj draw shadow-ctrl)))
    (when v1-1
      (let ((f0-0 (-> obj root-override trans y)))
        (let ((a0-2 v1-1))
          (set! (-> a0-2 settings bot-plane w) (- (+ -409.6 f0-0)))
          )
        0
        (let ((a0-4 v1-1))
          (set! (-> a0-4 settings top-plane w) (- (+ 4096.0 f0-0)))
          )
        )
      0
      (logclear! (-> v1-1 settings flags) (shadow-flags shdf03))
      )
    )
  (none)
  )

;; definition for method 48 of type assistant-levitator
(defmethod draw-npc-shadow assistant-levitator ((obj assistant-levitator))
  (-> obj draw shadow-ctrl)
  (cond
    ((and (-> obj draw shadow)
          (zero? (-> obj draw cur-lod))
          (logtest? (-> obj draw status) (draw-status was-drawn))
          )
     (let ((v1-9 (-> obj draw shadow-ctrl)))
       (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw))
       )
     0
     (update-direction-from-time-of-day (-> obj draw shadow-ctrl))
     )
    (else
      (let ((v1-14 (-> obj draw shadow-ctrl)))
        (logior! (-> v1-14 settings flags) (shadow-flags disable-draw))
        )
      0
      )
    )
  (none)
  )

;; definition for method 32 of type assistant-bluehut
(defmethod play-anim! assistant-bluehut ((obj assistant-bluehut) (arg0 symbol))
  (set! (-> obj talk-message) (game-text-id press-to-talk-to-assistant))
  (case (current-status (-> obj tasks))
    (((task-status unknown) (task-status need-hint) (task-status need-introduction))
     (if (not arg0)
         (set! (-> obj will-talk) #t)
         )
     (case (current-task (-> obj tasks))
       (((game-task village2-levitator))
        (when arg0
          (close-status! (-> obj tasks) (task-status need-introduction))
          (send-event (-> obj sage extra process) 'clone (process->handle obj))
          (send-event (-> (entity-by-type flutflut-bluehut) extra process) 'clone (process->handle obj))
          )
        (new 'static 'spool-anim
          :name "assistant-village2-introduction"
          :index 15
          :parts 16
          :command-list '((0 send-event target draw #f)
            (0 kill "villageb-part-33")
            (95 send-event target draw #t)
            (95 joint "cameraB")
            (131 send-event target draw #f)
            (131 joint "camera")
            (190 setting-reset ocean-off #t)
            (190 kill "pontoonten-20")
            (190 kill "pontoonten-19")
            (190 kill "pontoonten-18")
            (190 kill "pontoonten-17")
            (190 kill "pontoonten-16")
            (190 kill "pontoonten-15")
            (190 kill "pontoonten-14")
            (190 kill "pontoonten-13")
            (190 kill "pontoonten-12")
            (190 kill "pontoonten-11")
            (190 kill "pontoonten-10")
            (190 kill "pontoonten-9")
            (190 kill "pontoonten-8")
            (190 kill "pontoonten-7")
            (190 kill "pontoonten-6")
            (190 kill "pontoonfive-3")
            (190 kill "pontoonfive-4")
            (190 kill "pontoonfive-5")
            (190 kill "pontoonfive-6")
            (190 kill "pontoonfive-7")
            (190 kill "pontoonfive-8")
            (190 kill "pontoonfive-12")
            (190 kill "pontoonfive-13")
            (190 kill "pontoonfive-14")
            (190 kill "pontoonfive-15")
            (190 kill "pontoonfive-16")
            (190 kill "pontoonfive-17")
            (190 kill "pontoonfive-18")
            (190 kill "pontoonfive-19")
            (190 kill "pontoonfive-20")
            (190 kill "allpontoons-1")
            (190 kill "med-res-level-12")
            (190 kill "med-res-level-13")
            (190 kill "med-res-level-15")
            (190 kill "swamp-blimp-3")
            (190 kill "barrel-85")
            (190 kill "barrel-86")
            (190 kill "money-2844")
            (190 kill "money-2845")
            (190 kill "money-2846")
            (190 kill "money-2847")
            (190 kill "money-2848")
            (190 kill "money-2849")
            (190 kill "money-4923")
            (190 kill "money-4924")
            (190 kill "money-4925")
            (190 kill "money-4926")
            (190 kill "money-4927")
            (190 kill "eco-27")
            (190 kill "sharkey-25")
            (190 kill "barrel-117")
            (190 kill "barrel-118")
            (190 kill "barrel-119")
            (190 kill "barrel-120")
            (190 kill "barrel-121")
            (190 kill "barrel-122")
            (190 kill "crate-3129")
            (190 kill "crate-3132")
            (190 kill "crate-3133")
            (190 kill "villageb-part-32")
            (190 kill "villageb-part-30")
            (190 kill "exit-chamber-dummy-1")
            (190 kill "villageb-part-34")
            (191 send-event target draw #t)
            (191 joint "cameraB")
            (241 joint "camera")
            (241 send-event target draw #f)
            (241 setting-unset ocean-off)
            (241 dead "pontoonten-20")
            (241 dead "pontoonten-19")
            (241 dead "pontoonten-18")
            (241 dead "pontoonten-17")
            (241 dead "pontoonten-16")
            (241 dead "pontoonten-15")
            (241 dead "pontoonten-14")
            (241 dead "pontoonten-13")
            (241 dead "pontoonten-12")
            (241 dead "pontoonten-11")
            (241 dead "pontoonten-10")
            (241 dead "pontoonten-9")
            (241 dead "pontoonten-8")
            (241 dead "pontoonten-7")
            (241 dead "pontoonten-6")
            (241 dead "pontoonfive-3")
            (241 dead "pontoonfive-4")
            (241 dead "pontoonfive-5")
            (241 dead "pontoonfive-6")
            (241 dead "pontoonfive-7")
            (241 dead "pontoonfive-8")
            (241 dead "pontoonfive-12")
            (241 dead "pontoonfive-13")
            (241 dead "pontoonfive-14")
            (241 dead "pontoonfive-15")
            (241 dead "pontoonfive-16")
            (241 dead "pontoonfive-17")
            (241 dead "pontoonfive-18")
            (241 dead "pontoonfive-19")
            (241 dead "pontoonfive-20")
            (241 dead "allpontoons-1")
            (241 dead "med-res-level-12")
            (241 dead "med-res-level-13")
            (241 dead "med-res-level-15")
            (241 dead "swamp-blimp-3")
            (241 dead "barrel-85")
            (241 dead "barrel-86")
            (241 dead "money-2844")
            (241 dead "money-2845")
            (241 dead "money-2846")
            (241 dead "money-2847")
            (241 dead "money-2848")
            (241 dead "money-2849")
            (241 dead "money-4923")
            (241 dead "money-4924")
            (241 dead "money-4925")
            (241 dead "money-4926")
            (241 dead "money-4927")
            (241 dead "eco-27")
            (241 dead "sharkey-25")
            (241 dead "barrel-117")
            (241 dead "barrel-118")
            (241 dead "barrel-119")
            (241 dead "barrel-120")
            (241 dead "barrel-121")
            (241 dead "barrel-122")
            (241 dead "crate-3129")
            (241 dead "crate-3132")
            (241 dead "crate-3133")
            (241 dead "villageb-part-32")
            (241 dead "villageb-part-30")
            (321 joint "cameraB")
            (352 joint "camera")
            (383 joint "cameraB")
            (411 joint "camera")
            (501 joint "cameraB")
            (501 send-event target draw #t)
            (567 joint "camera")
            (634 alive "fireboulder-6")
            (635 joint "cameraB")
            (701 joint "camera")
            (741 joint "cameraB")
            (784 joint "camera")
            (936 joint "cameraB")
            (1065 joint "camera")
            (1145 joint "cameraB")
            (1241 joint "camera")
            )
          )
        )
       (((game-task sunken-room))
        (when arg0
          (let* ((s5-2 (-> obj tasks))
                 (s4-0 (method-of-object s5-2 save-reminder))
                 )
            (s4-0 s5-2 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1)
            )
          (close-status! (-> obj tasks) (task-status need-introduction))
          (set! (-> obj jaws)
                (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *jaws-sg* #f :to obj))
                )
          (let ((v1-42 (handle->process (-> obj jaws))))
            (if v1-42
                (set! (-> (the-as manipy v1-42) draw light-index) (the-as uint 1))
                )
            )
          (send-event (handle->process (-> obj jaws)) 'anim-mode 'clone-anim)
          (send-event (handle->process (-> obj jaws)) 'center-joint 3)
          (send-event (-> (entity-by-type flutflut-bluehut) extra process) 'clone (process->handle obj))
          )
        (new 'static 'spool-anim
          :name "assistant-village2-introduction-room"
          :index 21
          :parts 10
          :command-list '((197 joint "cameraB")
            (351 joint "camera")
            (431 joint "cameraB")
            (553 joint "camera")
            (631 joint "cameraB")
            (842 joint "camera")
            (900 joint "cameraB")
            (1069 joint "camera")
            )
          )
        )
       (((game-task rolling-robbers))
        (when arg0
          (let* ((s5-5 (-> obj tasks))
                 (s4-1 (method-of-object s5-5 save-reminder))
                 )
            (s4-1 s5-5 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1)
            )
          (close-status! (-> obj tasks) (task-status need-introduction))
          )
        (new 'static 'spool-anim
          :name "assistant-village2-introduction-robbers"
          :index 17
          :parts 6
          :command-list '((55 joint "cameraB") (145 joint "camera") (207 joint "cameraB") (363 joint "camera"))
          )
        )
       (else
         (when arg0
           (close-status! (-> obj tasks) (task-status need-introduction))
           (send-event (-> (entity-by-type flutflut-bluehut) extra process) 'clone (process->handle obj))
           )
         (new 'static 'spool-anim
           :name "assistant-village2-introduction-flutflut"
           :index 19
           :parts 8
           :command-list '((71 joint "cameraB") (308 joint "camera") (426 joint "cameraB") (550 joint "camera") (644 joint "cameraB"))
           )
         )
       )
     )
    (((task-status need-reminder))
     (set! (-> obj skippable) #t)
     (let ((s4-2 (+ (get-reminder (-> obj tasks) 0) 1)))
       (if (< (the-as uint 2) (the-as uint s4-2))
           (set! s4-2 0)
           )
       (countdown (s3-0 3)
         (let ((v1-92 s4-2))
           (cond
             ((zero? v1-92)
              (if (!= (get-task-status (game-task sunken-room)) (task-status need-reminder))
                  (set! s4-2 1)
                  )
              )
             ((= v1-92 1)
              (if (!= (get-task-status (game-task rolling-robbers)) (task-status need-reminder))
                  (set! s4-2 2)
                  )
              )
             (else
               (if (!= (get-task-status (game-task swamp-flutflut)) (task-status need-reminder))
                   (set! s4-2 0)
                   )
               )
             )
           )
         )
       (if arg0
           (save-reminder (-> obj tasks) s4-2 2)
           )
       (cond
         ((zero? s4-2)
          (new 'static 'spool-anim :name "assistant-village2-reminder-1-room" :index 22 :parts 3 :command-list '())
          )
         ((= s4-2 1)
          (new 'static 'spool-anim :name "assistant-village2-reminder-1-robbers" :index 18 :parts 3 :command-list '())
          )
         (else
           (new 'static 'spool-anim :name "assistant-village2-reminder-1-flutflut" :index 20 :parts 3 :command-list '())
           )
         )
       )
     )
    (else
      (if arg0
          (format
            0
            "ERROR: <GMJ>: ~S playing anim for task status ~S~%"
            (-> obj name)
            (task-status->string (current-status (-> obj tasks)))
            )
          )
      (-> obj draw art-group data 5)
      )
    )
  )

;; definition for method 31 of type assistant-bluehut
(defmethod get-art-elem assistant-bluehut ((obj assistant-bluehut))
  (-> obj draw art-group data 10)
  )

;; definition for method 44 of type assistant-bluehut
(defmethod play-reminder assistant-bluehut ((obj assistant-bluehut))
  (cond
    ((and (-> obj will-talk) *target*)
     (let* ((f30-1 (+ -1552384.0 (-> (target-pos 0) x)))
            (f0-3 (+ 6352896.0 (-> (target-pos 0) z) f30-1))
            )
       (< 0.0 f0-3)
       )
     )
    (else
      #f
      )
    )
  )

;; definition for method 47 of type assistant-bluehut
(defmethod target-above-threshold? assistant-bluehut ((obj assistant-bluehut))
  (when (not (play-reminder obj))
    (set! (-> obj im-talking) #f)
    (return #f)
    )
  (let ((s5-0 (-> obj sage extra process)))
    (when (not s5-0)
      (let ((v1-7 #t))
        (set! (-> obj im-talking) v1-7)
        (return v1-7)
        )
      )
    (when (!= (-> (the-as sage-bluehut s5-0) next-state name) 'idle)
      (set! (-> obj im-talking) #f)
      (return #f)
      )
    (when (not (play-reminder (the-as sage-bluehut s5-0)))
      (let ((v1-15 #t))
        (set! (-> obj im-talking) v1-15)
        (return v1-15)
        )
      )
    (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data (-> obj center-joint-index))))
           (s3-0 (vector<-cspace!
                   (new 'stack-no-clear 'vector)
                   (-> (the-as sage-bluehut s5-0) node-list data (-> (the-as sage-bluehut s5-0) center-joint-index))
                   )
                 )
           (f0-1 (- (vector-vector-distance (target-pos 0) s3-0) (vector-vector-distance (target-pos 0) s4-0)))
           )
      (cond
        ((< f0-1 -4096.0)
         (set! (-> obj im-talking) #f)
         (return #f)
         )
        ((< 4096.0 f0-1)
         (let ((v1-24 #t))
           (set! (-> obj im-talking) v1-24)
           (return v1-24)
           )
         )
        (else
          (return (-> obj im-talking))
          )
        )
      )
    )
  (the-as symbol 0)
  )

;; definition for method 43 of type assistant-bluehut
(defmethod TODO-RENAME-43 assistant-bluehut ((obj assistant-bluehut))
  (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj)
    (let ((f30-0 (rand-float-gen)))
      (cond
        ((= (get-task-status (game-task village2-levitator)) (task-status invalid))
         #f
         )
        ((< 0.5 f30-0)
         (play-ambient (-> obj ambient) "ASSTLP23" #f (-> obj root-override trans))
         )
        (else
          (play-ambient (-> obj ambient) "ASSTLP24" #f (-> obj root-override trans))
          )
        )
      )
    )
  )

;; failed to figure out what this is:
(defstate idle (assistant-bluehut)
  :virtual #t
  :trans (behavior ()
    (case (get-task-status (game-task village2-levitator))
      (((task-status need-hint) (task-status need-introduction))
       (send-event self 'play-anim)
       )
      )
    ((-> (method-of-type process-taskable idle) trans))
    (none)
    )
  :code (behavior ()
    (if (!= (ja-group) (get-art-elem self))
        (ja-channel-push! 1 (seconds 0.05))
        )
    (loop
      (ja-no-eval :group! (get-art-elem self) :num! (seek!) :frame-num 0.0)
      (until (ja-done? 0)
        (suspend)
        (ja :num! (seek!))
        )
      (let ((f0-9 (rand-float-gen)))
        (cond
          ((< f0-9 0.33333334)
           (TODO-RENAME-43 self)
           (ja-no-eval :group! assistant-village2-idle-hut-look-right-ja :num! (seek!) :frame-num 0.0)
           (until (ja-done? 0)
             (suspend)
             (ja :num! (seek!))
             )
           (let ((gp-1 (-> *display* base-frame-counter)))
             (while (let ((s5-1 (-> *display* base-frame-counter))
                          (f30-0 300.0)
                          (f28-0 0.16)
                          (f26-0 0.17000002)
                          )
                      (< (- s5-1 (the-as time-frame (the int (* f30-0 (+ f28-0 (* f26-0 (rand-float-gen))))))) gp-1)
                      )
               (suspend)
               )
             )
           (ja-no-eval :group! (ja-group) :num! (seek! 0.0) :frame-num max)
           (until (ja-done? 0)
             (suspend)
             (ja :num! (seek! 0.0))
             )
           )
          ((< f0-9 0.6666667)
           (sound-play "welding-loop" :id (-> self sound-id) :position (the-as symbol (target-pos 0)))
           (ja-no-eval :group! assistant-village2-idle-hut-start-welding-ja :num! (seek!) :frame-num 0.0)
           (until (ja-done? 0)
             (suspend)
             (ja :num! (seek!))
             )
           (ja :group! assistant-village2-idle-hut-welding-ja)
           (let* ((f30-1 2.0)
                  (v1-113 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
                  (v1-114 (the-as number (logior #x3f800000 v1-113)))
                  )
             (countdown (gp-3 (+ (the int (* f30-1 (+ -1.0 (the-as float v1-114)))) 4))
               (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0)
               (until (ja-done? 0)
                 (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 30)))
                 (suspend)
                 (ja :num! (seek!))
                 )
               (ja-no-eval :group! (ja-group) :num! (seek! 0.0) :frame-num max)
               (until (ja-done? 0)
                 (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 30)))
                 (suspend)
                 (ja :num! (seek! 0.0))
                 )
               )
             )
           (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0)
           (until (ja-done? 0)
             (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 30)))
             (suspend)
             (ja :num! (seek!))
             )
           (sound-stop (-> self sound-id))
           (ja-no-eval :group! assistant-village2-idle-hut-stop-welding-ja :num! (seek!) :frame-num 0.0)
           (until (ja-done? 0)
             (suspend)
             (ja :num! (seek!))
             )
           )
          )
        )
      )
    (none)
    )
  )

;; failed to figure out what this is:
(defstate play-anim (assistant-bluehut)
  :virtual #t
  :exit (behavior ()
    (let ((a0-1 (handle->process (-> self jaws))))
      (if a0-1
          (deactivate a0-1)
          )
      )
    (send-event (-> self sage extra process) 'end-mode)
    (send-event (-> (entity-by-type flutflut-bluehut) extra process) 'end-mode)
    ((-> (method-of-type process-taskable play-anim) exit))
    (close-specific-task! (game-task village2-levitator) (task-status need-reminder-a))
    (none)
    )
  :trans (behavior ()
    '()
    (none)
    )
  )

;; definition for method 39 of type assistant-bluehut
(defmethod should-display? assistant-bluehut ((obj assistant-bluehut))
  (cond
    ((not (closed? (-> obj tasks) (game-task village2-levitator) (task-status unknown)))
     (dummy-33 obj)
     #f
     )
    ((or (= (get-task-status (game-task village2-levitator)) (task-status need-reward-speech)) (sages-kidnapped?))
     #f
     )
    (else
      #t
      )
    )
  )

;; failed to figure out what this is:
(defpartgroup group-assistant-bluehut-torch
  :id 288
  :bounds (static-bspherem 0 0 0 15)
  :parts ((sp-item 1322 :fade-after (meters 30) :falloff-to (meters 30))
    (sp-item 1323 :fade-after (meters 60) :falloff-to (meters 80))
    )
  )

;; failed to figure out what this is:
(defpart 1322
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2))
    (sp-rnd-flt spt-num 0.1 1.0 1.0)
    (sp-rnd-flt spt-scale-x (meters 1) (meters 3) 1.0)
    (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0)
    (sp-copy-from-other spt-scale-y -4)
    (sp-rnd-flt spt-r 100.0 28.0 1.0)
    (sp-flt spt-g 100.0)
    (sp-flt spt-b 80.0)
    (sp-rnd-flt spt-a 32.0 64.0 1.0)
    (sp-flt spt-fade-a -6.4)
    (sp-int spt-timer 10)
    (sp-cpuinfo-flags bit2 bit3)
    )
  )

;; failed to figure out what this is:
(defpart 1323
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2))
    (sp-rnd-flt spt-num 0.1 1.0 1.0)
    (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0)
    (sp-copy-from-other spt-scale-y -4)
    (sp-rnd-flt spt-r 128.0 128.0 1.0)
    (sp-flt spt-g 128.0)
    (sp-flt spt-b 64.0)
    (sp-rnd-flt spt-a 32.0 96.0 1.0)
    (sp-rnd-flt spt-vel-y (meters 0.013333334) (meters 0.08) 1.0)
    (sp-flt spt-scalevel-x (meters -0.00016666666))
    (sp-copy-from-other spt-scalevel-y -4)
    (sp-flt spt-fade-g -0.2)
    (sp-flt spt-fade-b -0.2)
    (sp-flt spt-accel-y -8.192)
    (sp-flt spt-friction 0.93)
    (sp-int spt-timer 1200)
    (sp-cpuinfo-flags bit2)
    (sp-flt spt-userdata 140288.0)
    (sp-func spt-func 'check-drop-level-assistant-bluehut)
    (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0)
    (sp-rnd-flt spt-conerot-y (degrees 45.0) (degrees 180.0) 1.0)
    )
  )

;; failed to figure out what this is:
(defpart 1324
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2))
    (sp-rnd-flt spt-num 3.0 1.0 1.0)
    (sp-rnd-flt spt-scale-x (meters 0.075) (meters 0.075) 1.0)
    (sp-copy-from-other spt-scale-y -4)
    (sp-rnd-flt spt-r 128.0 64.0 1.0)
    (sp-flt spt-g 96.0)
    (sp-rnd-flt spt-a 32.0 96.0 1.0)
    (sp-rnd-flt spt-vel-y (meters 0.011666667) (meters 0.0033333334) 1.0)
    (sp-flt spt-fade-a -0.85333335)
    (sp-flt spt-accel-y -0.68266666)
    (sp-int spt-timer 300)
    (sp-cpuinfo-flags bit2)
    (sp-rnd-flt spt-conerot-x (degrees 50.000004) (degrees 30.0) 1.0)
    (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0)
    )
  )

;; definition for function check-drop-level-assistant-bluehut
(defun check-drop-level-assistant-bluehut ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector))
  (when (< (-> arg2 y) (-> arg1 user-float))
    (let ((gp-0 (new 'stack-no-clear 'vector)))
      (sp-kill-particle arg0 arg1)
      (if (< (rand-float-gen) 0.25)
          (sound-play "water-drop")
          )
      (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0)
      (sp-launch-particles-var
        *sp-particle-system-2d*
        (-> *part-id-table* 1324)
        gp-0
        (the-as sparticle-launch-state #f)
        (the-as sparticle-launch-control #f)
        1.0
        )
      )
    )
  (none)
  )

;; definition for method 11 of type assistant-bluehut
(defmethod init-from-entity! assistant-bluehut ((obj assistant-bluehut) (arg0 entity-actor))
  (dummy-40 obj arg0 *assistant-village2-sg* 3 31 (new 'static 'vector :w 4096.0) 5)
  (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 288) obj))
  (set! (-> obj tasks) (get-task-control (game-task village2-levitator)))
  (set! (-> obj jaws) (the-as handle #f))
  (set! (-> obj sage) (entity-actor-lookup arg0 'alt-actor 0))
  (set! (-> obj im-talking) #t)
  (set! (-> obj draw light-index) (the-as uint 1))
  (set! (-> obj sound-id) (new-sound-id))
  (dummy-42 obj)
  (none)
  )

;; failed to figure out what this is:
(defpartgroup group-levitator-blue-beam
  :id 658
  :flags (use-local-clock)
  :bounds (static-bspherem -20 8 0 80)
  :parts ((sp-item 2673 :fade-after (meters 120) :falloff-to (meters 140) :binding 2670)
    (sp-item 2670 :flags (bit1 start-dead launch-asap) :binding 2671)
    (sp-item 2670 :flags (bit1 start-dead launch-asap) :binding 2672)
    (sp-item 2670 :flags (bit1 start-dead launch-asap) :binding 2671)
    (sp-item 2670 :flags (bit1 start-dead launch-asap) :binding 2672)
    (sp-item 2670 :flags (bit1 start-dead launch-asap) :binding 2671)
    (sp-item 2670 :flags (bit1 start-dead launch-asap) :binding 2672)
    (sp-item 2670 :flags (bit1 start-dead launch-asap) :binding 2671)
    (sp-item 2670 :flags (bit1 start-dead launch-asap) :binding 2672)
    (sp-item 2670 :flags (bit1 start-dead launch-asap) :binding 2671)
    (sp-item 2670 :flags (bit1 start-dead launch-asap) :binding 2672)
    (sp-item 2671 :flags (bit1 start-dead))
    (sp-item 2672 :flags (bit1 start-dead))
    (sp-item 2671 :flags (bit1 start-dead))
    (sp-item 2672 :flags (bit1 start-dead))
    (sp-item 2671 :flags (bit1 start-dead))
    (sp-item 2672 :flags (bit1 start-dead))
    (sp-item 2671 :flags (bit1 start-dead))
    (sp-item 2672 :flags (bit1 start-dead))
    (sp-item 2671 :flags (bit1 start-dead))
    (sp-item 2672 :flags (bit1 start-dead))
    (sp-item 2671 :flags (bit1 start-dead))
    (sp-item 2674 :falloff-to (meters 400))
    (sp-item 2675)
    (sp-item 2676 :falloff-to (meters 300))
    (sp-item 2693 :falloff-to (meters 400))
    (sp-item 2694 :falloff-to (meters 400))
    )
  )

;; failed to figure out what this is:
(defpart 2694
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2))
    (sp-rnd-flt spt-num 0.2 2.0 1.0)
    (sp-rnd-flt spt-scale-x (meters 0.5) (meters 3.5) 1.0)
    (sp-int spt-rot-x 4)
    (sp-rnd-flt spt-rot-z (degrees -1440.0) (degrees 2880.0) 1.0)
    (sp-rnd-flt spt-scale-y (meters 0.3) (meters 0.1) 1.0)
    (sp-flt spt-r 64.0)
    (sp-flt spt-g 64.0)
    (sp-flt spt-b 128.0)
    (sp-flt spt-a 128.0)
    (sp-flt spt-fade-a -1.4)
    (sp-int spt-timer 90)
    (sp-cpuinfo-flags bit2 bit3 bit14)
    (sp-int spt-next-time 10)
    (sp-launcher-by-id spt-next-launcher 146)
    )
  )

;; failed to figure out what this is:
(defpart 2693
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2))
    (sp-rnd-flt spt-num 0.2 2.0 1.0)
    (sp-rnd-flt spt-scale-x (meters 0.5) (meters 3.5) 1.0)
    (sp-int spt-rot-x 4)
    (sp-rnd-flt spt-rot-z (degrees -1440.0) (degrees 2880.0) 1.0)
    (sp-rnd-flt spt-scale-y (meters 0.3) (meters 0.1) 1.0)
    (sp-flt spt-r 64.0)
    (sp-flt spt-g 64.0)
    (sp-flt spt-b 128.0)
    (sp-flt spt-a 128.0)
    (sp-flt spt-fade-a -1.4)
    (sp-int spt-timer 90)
    (sp-cpuinfo-flags bit2 bit3 bit14)
    (sp-int spt-next-time 10)
    (sp-launcher-by-id spt-next-launcher 146)
    )
  )

;; failed to figure out what this is:
(defpart 2673
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2))
    (sp-rnd-flt spt-num 0.025 0.025 1.0)
    (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0)
    (sp-copy-from-other spt-scale-y -4)
    (sp-flt spt-r 0.0)
    (sp-flt spt-g 0.0)
    (sp-rnd-flt spt-b 128.0 128.0 1.0)
    (sp-rnd-flt spt-a 32.0 32.0 1.0)
    (sp-flt spt-vel-y (meters 0.053333335))
    (sp-flt spt-scalevel-x (meters -0.0033333334))
    (sp-copy-from-other spt-scalevel-y -4)
    (sp-int spt-timer 900)
    (sp-cpuinfo-flags bit2 bit3 bit14)
    (sp-flt spt-conerot-x (degrees 102.0))
    (sp-flt spt-conerot-y (degrees -90.0))
    (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.5) 1.0)
    )
  )

;; failed to figure out what this is:
(defpart 2670
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2))
    (sp-flt spt-num 1.0)
    (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0)
    (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0)
    (sp-rnd-flt spt-z (meters 1) (meters 0.5) 1.0)
    (sp-rnd-flt spt-scale-x (meters 2.2) (meters 0.4) 1.0)
    (sp-copy-from-other spt-scale-y -4)
    (sp-flt spt-r 0.0)
    (sp-flt spt-g 0.0)
    (sp-rnd-flt spt-b 128.0 128.0 1.0)
    (sp-flt spt-a 128.0)
    (sp-rnd-flt spt-omega 0.0 65536.0 1.0)
    (sp-rnd-int-flt spt-vel-x (meters -0.026666667) 1 218.45334)
    (sp-rnd-flt spt-vel-y (meters 0) (meters 0.053333335) 1.0)
    (sp-flt spt-vel-z (meters 0))
    (sp-flt spt-accel-z 0.0)
    (sp-int spt-timer 900)
    (sp-cpuinfo-flags bit2 bit3 bit7 bit14)
    )
  )

;; failed to figure out what this is:
(defpart 2671
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2))
    (sp-rnd-flt spt-num 0.2 1.0 1.0)
    (sp-rnd-flt spt-scale-x (meters 0.5) (meters 3.5) 1.0)
    (sp-int spt-rot-x 4)
    (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0)
    (sp-rnd-flt spt-scale-y (meters 0.4) (meters 0.2) 1.0)
    (sp-flt spt-r 64.0)
    (sp-flt spt-g 64.0)
    (sp-flt spt-b 128.0)
    (sp-flt spt-a 128.0)
    (sp-flt spt-fade-a -1.4)
    (sp-int spt-timer 90)
    (sp-cpuinfo-flags bit2 bit3 bit14)
    (sp-int spt-next-time 10)
    (sp-launcher-by-id spt-next-launcher 146)
    )
  )

;; failed to figure out what this is:
(defpart 2672
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x23 :page #x2))
    (sp-rnd-flt spt-num 0.2 1.0 1.0)
    (sp-rnd-flt spt-scale-x (meters 0.5) (meters 3.5) 1.0)
    (sp-int spt-rot-x 4)
    (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0)
    (sp-rnd-flt spt-scale-y (meters 0.4) (meters 0.2) 1.0)
    (sp-flt spt-r 64.0)
    (sp-flt spt-g 64.0)
    (sp-flt spt-b 128.0)
    (sp-flt spt-a 128.0)
    (sp-flt spt-fade-a -1.4)
    (sp-int spt-timer 90)
    (sp-cpuinfo-flags bit2 bit3 bit14)
    (sp-int spt-next-time 10)
    (sp-launcher-by-id spt-next-launcher 146)
    )
  )

;; failed to figure out what this is:
(defpart 2674
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2))
    (sp-flt spt-num 2.0)
    (sp-rnd-flt spt-scale-x (meters 2) (meters 0.5) 1.0)
    (sp-rnd-flt spt-scale-y (meters 0.6) (meters 0.8) 1.0)
    (sp-rnd-flt spt-r 16.0 48.0 1.0)
    (sp-rnd-flt spt-g 16.0 48.0 1.0)
    (sp-flt spt-b 128.0)
    (sp-flt spt-a 128.0)
    (sp-flt spt-vel-y (meters 0.32))
    (sp-flt spt-scalevel-x (meters 0.005))
    (sp-copy-from-other spt-scalevel-y -4)
    (sp-int spt-timer 150)
    (sp-cpuinfo-flags bit2 bit3 bit14)
    (sp-flt spt-conerot-x (degrees 102.0))
    (sp-flt spt-conerot-y (degrees -90.0))
    (sp-rnd-flt spt-conerot-radius (meters -1.5) (meters 1.5) 1.0)
    )
  )

;; failed to figure out what this is:
(defpart 2676
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2))
    (sp-flt spt-num 1.0)
    (sp-rnd-flt spt-scale-x (meters 3) (meters 1.5) 1.0)
    (sp-copy-from-other spt-scale-y -4)
    (sp-flt spt-r 0.0)
    (sp-flt spt-g 0.0)
    (sp-rnd-flt spt-b 128.0 128.0 1.0)
    (sp-rnd-flt spt-a 32.0 32.0 1.0)
    (sp-flt spt-vel-y (meters 0.10666667))
    (sp-flt spt-scalevel-x (meters 0.0016666667))
    (sp-copy-from-other spt-scalevel-y -4)
    (sp-int spt-timer 450)
    (sp-cpuinfo-flags bit2 bit3 bit14)
    (sp-flt spt-conerot-x (degrees 102.0))
    (sp-flt spt-conerot-y (degrees -90.0))
    (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.5) 1.0)
    )
  )

;; failed to figure out what this is:
(defpart 2675
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2))
    (sp-flt spt-num 1.0)
    (sp-rnd-flt spt-scale-x (meters 2) (meters 4) 1.0)
    (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0)
    (sp-copy-from-other spt-scale-y -4)
    (sp-rnd-flt spt-r 64.0 64.0 1.0)
    (sp-rnd-flt spt-g 64.0 64.0 1.0)
    (sp-rnd-flt spt-b 128.0 128.0 1.0)
    (sp-flt spt-a 128.0)
    (sp-flt spt-fade-a -5.12)
    (sp-int spt-timer 20)
    (sp-cpuinfo-flags bit2 bit3 bit14)
    )
  )

;; failed to figure out what this is:
(defpartgroup group-levitator-blue-beam-impact
  :id 659
  :flags (use-local-clock)
  :bounds (static-bspherem 0 0 0 34)
  :parts ((sp-item 2695) (sp-item 2696 :fade-after (meters 200) :falloff-to (meters 200)) (sp-item 2677))
  )

;; failed to figure out what this is:
(defpart 2696
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2))
    (sp-rnd-flt spt-num 2.0 6.0 1.0)
    (sp-rnd-flt spt-y (meters -0.5) (meters 1) 1.0)
    (sp-rnd-flt spt-scale-x (meters 0.6) (meters 1) 1.0)
    (sp-copy-from-other spt-scale-y -4)
    (sp-rnd-flt spt-r 0.0 32.0 1.0)
    (sp-rnd-flt spt-g 64.0 64.0 1.0)
    (sp-flt spt-b 255.0)
    (sp-rnd-flt spt-a 32.0 96.0 1.0)
    (sp-rnd-flt spt-vel-y (meters 0.053333335) (meters 0.10666667) 1.0)
    (sp-flt spt-scalevel-x (meters -0.005))
    (sp-copy-from-other spt-scalevel-y -4)
    (sp-flt spt-fade-r -0.26666668)
    (sp-flt spt-fade-g -1.0666667)
    (sp-flt spt-fade-b 0.0)
    (sp-rnd-flt spt-accel-y -1.3653333 -1.3653333 1.0)
    (sp-flt spt-friction 0.95)
    (sp-int-plain-rnd spt-timer 60 59 1)
    (sp-cpuinfo-flags bit0 bit2 bit3 bit14)
    (sp-rnd-flt spt-conerot-x (degrees 50.000004) (degrees 120.0) 1.0)
    (sp-rnd-flt spt-conerot-y (degrees 30.0) (degrees 120.0) 1.0)
    (sp-rnd-flt spt-conerot-radius (meters -0.5) (meters 0.5) 1.0)
    )
  )

;; failed to figure out what this is:
(defpart 2695
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2))
    (sp-flt spt-num 1.0)
    (sp-rnd-flt spt-scale-x (meters 1) (meters 4) 1.0)
    (sp-rnd-flt spt-rot-z (degrees 180.0) (degrees 360.0) 1.0)
    (sp-copy-from-other spt-scale-y -4)
    (sp-flt spt-r 255.0)
    (sp-flt spt-g 255.0)
    (sp-flt spt-b 255.0)
    (sp-flt spt-a 128.0)
    (sp-flt spt-fade-a -5.12)
    (sp-int spt-timer 10)
    (sp-cpuinfo-flags bit2 bit3 bit14)
    (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 1440.0) 1.0)
    (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 1440.0) 1.0)
    (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.5) 1.0)
    )
  )

;; failed to figure out what this is:
(defpart 2677
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2))
    (sp-flt spt-num 1.0)
    (sp-rnd-flt spt-scale-x (meters 6) (meters 6) 1.0)
    (sp-rnd-flt spt-rot-z (degrees 180.0) (degrees 360.0) 1.0)
    (sp-copy-from-other spt-scale-y -4)
    (sp-flt spt-r 0.0)
    (sp-rnd-flt spt-g 16.0 64.0 1.0)
    (sp-rnd-flt spt-b 128.0 128.0 1.0)
    (sp-flt spt-a 128.0)
    (sp-flt spt-fade-a -5.12)
    (sp-int spt-timer 10)
    (sp-cpuinfo-flags bit2 bit3 bit14)
    (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 1440.0) 1.0)
    (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 1440.0) 1.0)
    (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.5) 1.0)
    )
  )

;; failed to figure out what this is:
(defpartgroup group-levitator-on-big
  :id 660
  :duration 900
  :flags (use-local-clock)
  :bounds (static-bspherem 0 0 0 64)
  :parts ((sp-item 2751 :fade-after (meters 100) :falloff-to (meters 100) :binding 2750)
    (sp-item 2750 :flags (bit1 start-dead launch-asap) :binding 2797)
    (sp-item 2750 :flags (bit1 start-dead launch-asap) :binding 2798)
    (sp-item 2750 :flags (bit1 start-dead launch-asap) :binding 2797)
    (sp-item 2750 :flags (bit1 start-dead launch-asap) :binding 2798)
    (sp-item 2750 :flags (bit1 start-dead launch-asap) :binding 2797)
    (sp-item 2750 :flags (bit1 start-dead launch-asap) :binding 2798)
    (sp-item 2750 :flags (bit1 start-dead launch-asap) :binding 2797)
    (sp-item 2750 :flags (bit1 start-dead launch-asap) :binding 2798)
    (sp-item 2750 :flags (bit1 start-dead launch-asap) :binding 2797)
    (sp-item 2750 :flags (bit1 start-dead launch-asap) :binding 2798)
    (sp-item 2750 :flags (bit1 start-dead launch-asap) :binding 2797)
    (sp-item 2750 :flags (bit1 start-dead launch-asap) :binding 2798)
    (sp-item 2750 :flags (bit1 start-dead launch-asap) :binding 2797)
    (sp-item 2750 :flags (bit1 start-dead launch-asap) :binding 2798)
    (sp-item 2797 :flags (bit1 start-dead))
    (sp-item 2798 :flags (bit1 start-dead))
    (sp-item 2797 :flags (bit1 start-dead))
    (sp-item 2798 :flags (bit1 start-dead))
    (sp-item 2797 :flags (bit1 start-dead))
    (sp-item 2798 :flags (bit1 start-dead))
    (sp-item 2797 :flags (bit1 start-dead))
    (sp-item 2798 :flags (bit1 start-dead))
    (sp-item 2797 :flags (bit1 start-dead))
    (sp-item 2798 :flags (bit1 start-dead))
    (sp-item 2797 :flags (bit1 start-dead))
    (sp-item 2798 :flags (bit1 start-dead))
    (sp-item 2797 :flags (bit1 start-dead))
    (sp-item 2798 :flags (bit1 start-dead))
    (sp-item 2797 :flags (bit1 start-dead))
    (sp-item 2798 :flags (bit1 start-dead))
    (sp-item 2797 :flags (bit1 start-dead))
    (sp-item 2798 :flags (bit1 start-dead))
    (sp-item 2797 :flags (bit1 start-dead))
    (sp-item 2798 :flags (bit1 start-dead))
    (sp-item 2797 :flags (bit1 start-dead))
    (sp-item 2798 :flags (bit1 start-dead))
    (sp-item 2678)
    )
  )

;; failed to figure out what this is:
(defpart 2678
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2))
    (sp-flt spt-num 1.0)
    (sp-rnd-flt spt-x (meters -0.001) (meters 0.002) 1.0)
    (sp-rnd-flt spt-y (meters -0.001) (meters 0.002) 1.0)
    (sp-rnd-flt spt-z (meters -0.001) (meters 0.002) 1.0)
    (sp-flt spt-scale-x (meters 9))
    (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0)
    (sp-copy-from-other spt-scale-y -4)
    (sp-flt spt-r 0.0)
    (sp-rnd-flt spt-g 0.0 128.0 1.0)
    (sp-flt spt-b 255.0)
    (sp-rnd-flt spt-a 64.0 64.0 1.0)
    (sp-flt spt-vel-y (meters 0))
    (sp-rnd-flt spt-rotvel-z (degrees -1.2) (degrees 2.4) 1.0)
    (sp-flt spt-fade-a -3.2)
    (sp-int spt-timer 40)
    (sp-cpuinfo-flags bit2 bit3)
    )
  )

;; failed to figure out what this is:
(defpart 2751
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2))
    (sp-flt spt-num 1.0)
    (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0)
    (sp-copy-from-other spt-scale-y -4)
    (sp-flt spt-r 255.0)
    (sp-rnd-flt spt-b 128.0 128.0 1.0)
    (sp-rnd-flt spt-a 32.0 32.0 1.0)
    (sp-flt spt-scalevel-x (meters -0.0033333334))
    (sp-copy-from-other spt-scalevel-y -4)
    (sp-int spt-timer 900)
    (sp-cpuinfo-flags bit2 bit3 bit14)
    )
  )

;; failed to figure out what this is:
(defpart 2750
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2))
    (sp-flt spt-num 1.0)
    (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0)
    (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0)
    (sp-flt spt-z (meters 3))
    (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.2) 1.0)
    (sp-copy-from-other spt-scale-y -4)
    (sp-flt spt-r 0.0)
    (sp-rnd-flt spt-g 0.0 128.0 1.0)
    (sp-rnd-flt spt-b 128.0 128.0 1.0)
    (sp-flt spt-a 128.0)
    (sp-rnd-flt spt-omega 0.0 65536.0 1.0)
    (sp-rnd-int-flt spt-vel-x (meters -0.026666667) 1 218.45334)
    (sp-rnd-flt spt-vel-y (meters 0) (meters 0.053333335) 1.0)
    (sp-flt spt-vel-z (meters 0))
    (sp-flt spt-accel-z 0.0)
    (sp-int spt-timer 900)
    (sp-cpuinfo-flags bit2 bit3 bit7 bit14)
    )
  )

;; failed to figure out what this is:
(defpart 2797
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2))
    (sp-rnd-flt spt-num 0.2 0.4 1.0)
    (sp-rnd-flt spt-scale-x (meters 0.5) (meters 3.5) 1.0)
    (sp-int spt-rot-x 4)
    (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0)
    (sp-rnd-flt spt-scale-y (meters 0.2) (meters 0.1) 1.0)
    (sp-flt spt-r 64.0)
    (sp-flt spt-g 64.0)
    (sp-flt spt-b 128.0)
    (sp-flt spt-a 128.0)
    (sp-flt spt-fade-a -1.4)
    (sp-int spt-timer 90)
    (sp-cpuinfo-flags bit2 bit3 bit14)
    (sp-int spt-next-time 10)
    (sp-launcher-by-id spt-next-launcher 146)
    )
  )

;; failed to figure out what this is:
(defpart 2798
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x24 :page #x2))
    (sp-rnd-flt spt-num 0.2 0.4 1.0)
    (sp-rnd-flt spt-scale-x (meters 0.5) (meters 3.5) 1.0)
    (sp-int spt-rot-x 4)
    (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0)
    (sp-rnd-flt spt-scale-y (meters 0.2) (meters 0.1) 1.0)
    (sp-flt spt-r 64.0)
    (sp-flt spt-g 64.0)
    (sp-flt spt-b 128.0)
    (sp-flt spt-a 128.0)
    (sp-flt spt-fade-a -1.4)
    (sp-int spt-timer 90)
    (sp-cpuinfo-flags bit2 bit3 bit14)
    (sp-int spt-next-time 10)
    (sp-launcher-by-id spt-next-launcher 146)
    )
  )

;; failed to figure out what this is:
(defpartgroup group-levitator-on-small
  :id 661
  :duration 900
  :flags (use-local-clock)
  :bounds (static-bspherem 0 0 0 64)
  :parts ((sp-item 2679))
  )

;; failed to figure out what this is:
(defpart 2679
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2))
    (sp-flt spt-num 1.0)
    (sp-rnd-flt spt-x (meters -0.001) (meters 0.002) 1.0)
    (sp-rnd-flt spt-y (meters -0.001) (meters 0.002) 1.0)
    (sp-rnd-flt spt-z (meters -0.001) (meters 0.002) 1.0)
    (sp-flt spt-scale-x (meters 6))
    (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0)
    (sp-copy-from-other spt-scale-y -4)
    (sp-flt spt-r 0.0)
    (sp-rnd-flt spt-g 0.0 128.0 1.0)
    (sp-flt spt-b 255.0)
    (sp-rnd-flt spt-a 64.0 64.0 1.0)
    (sp-flt spt-vel-y (meters 0))
    (sp-rnd-flt spt-rotvel-z (degrees -1.2) (degrees 2.4) 1.0)
    (sp-flt spt-fade-a -3.2)
    (sp-int spt-timer 40)
    (sp-cpuinfo-flags bit2 bit3)
    )
  )

;; definition for function assistant-levitator-blue-glow
;; INFO: Return type mismatch object vs none.
(defbehavior assistant-levitator-blue-glow assistant-levitator ()
  (let ((gp-0 (new 'stack-no-clear 'vector)))
    (set-vector! gp-0 -17408.0 -2048.0 2048.0 1.0)
    (vector+! gp-0 gp-0 (-> self entity extra trans))
    (spawn (-> self particle 2) gp-0)
    (set-vector! gp-0 -38912.0 6144.0 4096.0 1.0)
    (vector+! gp-0 gp-0 (-> self entity extra trans))
    (spawn (-> self particle 3) gp-0)
    )
  (none)
  )

;; definition for function assistant-levitator-blue-beam
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defbehavior assistant-levitator-blue-beam assistant-levitator ()
  (let ((s5-0 (new 'stack-no-clear 'vector))
        (gp-0 (new 'stack-no-clear 'vector))
        )
    (let ((s4-0 (new 'stack-no-clear 'vector)))
      (set! (-> gp-0 quad) (-> self boulder extra trans quad))
      (let ((v1-3 (-> self boulder extra process)))
        (if v1-3
            (vector<-cspace! gp-0 (-> (the-as fireboulder v1-3) node-list data 4))
            )
        )
      (set-vector! s5-0 -49152.0 10240.0 5529.6 1.0)
      (vector+! s5-0 s5-0 (-> self entity extra trans))
      (vector-! s4-0 gp-0 s5-0)
      (let ((t2-0 (new 'stack-no-clear 'collide-tri-result)))
        0.0
        (if (>= (fill-and-probe-using-line-sphere
                  *collide-cache*
                  s5-0
                  s4-0
                  6144.0
                  (collide-kind target)
                  (the-as process #f)
                  t2-0
                  (new 'static 'pat-surface :noentity #x1)
                  )
                0.0
                )
            (send-event *target* 'shove #f (static-attack-info ((shove-up (meters 2)) (shove-back (meters 3)))))
            )
        )
      (vector-normalize! s4-0 (+ -20480.0 (vector-length s4-0)))
      (vector+! gp-0 s5-0 s4-0)
      (let ((f30-1 (vector-y-angle s4-0))
            (f0-11 (- 16384.0 (vector-x-angle s4-0)))
            )
        (set! (-> *part-id-table* 2674 init-specs 14 initial-valuef) f30-1)
        (set! (-> *part-id-table* 2674 init-specs 13 initial-valuef) f0-11)
        (set! (-> *part-id-table* 2676 init-specs 14 initial-valuef) f30-1)
        (set! (-> *part-id-table* 2676 init-specs 13 initial-valuef) f0-11)
        (set! (-> *part-id-table* 2673 init-specs 14 initial-valuef) f30-1)
        (set! (-> *part-id-table* 2673 init-specs 13 initial-valuef) f0-11)
        )
      )
    (spawn (-> self particle 0) s5-0)
    (spawn (-> self particle 1) gp-0)
    )
  (none)
  )

;; definition for method 32 of type assistant-levitator
(defmethod play-anim! assistant-levitator ((obj assistant-levitator) (arg0 symbol))
  (with-pp
    (case (current-status (-> obj tasks))
      (((task-status need-reward-speech))
       (when arg0
         (close-current! (-> obj tasks))
         (let ((a1-1 (new 'stack-no-clear 'event-message-block)))
           (set! (-> a1-1 from) pp)
           (set! (-> a1-1 num-params) 1)
           (set! (-> a1-1 message) 'clone)
           (set! (-> a1-1 param 0) (the-as uint (process->handle obj)))
           (let ((t9-2 send-event-function)
                 (v1-10 (-> obj boulder))
                 )
             (t9-2
               (if v1-10
                   (-> v1-10 extra process)
                   )
               a1-1
               )
             )
           )
         )
       (new 'static 'spool-anim
         :name "assistant-village2-resolution"
         :index 16
         :parts 7
         :command-list '((196 joint "cameraB")
           (241 joint "camera")
           (286 joint "cameraB")
           (436 joint "camera")
           (526 joint "cameraB")
           (581 joint "camera")
           (639 joint "cameraB")
           (715 joint "camera")
           )
         )
       )
      (else
        (if arg0
            (format
              0
              "ERROR: <GMJ>: ~S playing anim for task status ~S~%"
              (-> obj name)
              (task-status->string (current-status (-> obj tasks)))
              )
            )
        (-> obj draw art-group data 5)
        )
      )
    )
  )

;; definition for method 31 of type assistant-levitator
(defmethod get-art-elem assistant-levitator ((obj assistant-levitator))
  (if (= (get-task-status (game-task village2-levitator)) (task-status invalid))
      (-> obj draw art-group data 9)
      (-> obj draw art-group data 5)
      )
  )

;; failed to figure out what this is:
(defstate play-anim (assistant-levitator)
  :virtual #t
  :exit (behavior ()
    (let ((a1-0 (new 'stack-no-clear 'event-message-block)))
      (set! (-> a1-0 from) self)
      (set! (-> a1-0 num-params) 0)
      (set! (-> a1-0 message) 'stop-cloning)
      (let ((t9-0 send-event-function)
            (v1-1 (-> self boulder))
            )
        (t9-0
          (if v1-1
              (-> v1-1 extra process)
              )
          a1-0
          )
        )
      )
    ((-> (method-of-type process-taskable play-anim) exit))
    (none)
    )
  :trans (behavior ()
    (assistant-levitator-blue-glow)
    (if (< 200.0 (ja-aframe-num 0))
        (assistant-levitator-blue-beam)
        )
    ((-> (method-of-type process-taskable play-anim) trans))
    (none)
    )
  )

;; failed to figure out what this is:
(defstate hidden (assistant-levitator)
  :virtual #t
  :trans (behavior ()
    ((-> (method-of-type process-taskable hidden) trans))
    (when (and (cond
                 ((and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))))
                  #t
                  )
                 (else
                   (set! (-> self state-time) (-> *display* base-frame-counter))
                   #f
                   )
                 )
               (and (closed? (-> self tasks) (game-task village2-levitator) (task-status need-introduction))
                    (not (closed? (-> self tasks) (game-task village2-levitator) (task-status need-reward-speech)))
                    (not (movie?))
                    (not (level-hint-displayed?))
                    (not (and *cheat-mode* (cpad-hold? 0 l3)))
                    (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 10))
                    )
               )
      (hide-hud)
      (kill-current-level-hint '() '(sidekick voicebox) 'exit)
      (when (and (seen-text? *game-info* (game-text-id village2-levitator-need-cells))
                 (hud-hidden?)
                 (can-grab-display? self)
                 (not (-> *setting-control* current hint))
                 )
        (let ((gp-0
                (new 'stack 'font-context *font-default-matrix* 32 160 0.0 (font-color default) (font-flags shadow kerning))
                )
              )
          (let ((v1-28 gp-0))
            (set! (-> v1-28 width) (the float 448))
            )
          (let ((v1-29 gp-0))
            (set! (-> v1-29 height) (the float 80))
            )
          (let ((v1-30 gp-0))
            (set! (-> v1-30 scale) 0.8)
            )
          (set! (-> gp-0 flags) (font-flags shadow kerning middle large))
          (print-game-text
            (lookup-text! *common-text* (game-text-id village2-levitator-need-cells-text) #f)
            gp-0
            #f
            128
            22
            )
          )
        )
      (level-hint-spawn
        (game-text-id village2-levitator-need-cells)
        "asstvb71"
        (the-as entity #f)
        *entity-pool*
        (game-task none)
        )
      )
    (none)
    )
  )

;; definition for method 47 of type assistant-levitator
(defmethod target-above-threshold? assistant-levitator ((obj assistant-levitator))
  (= (get-task-status (game-task village2-levitator)) (task-status need-reward-speech))
  )

;; failed to figure out what this is:
(defstate idle (assistant-levitator)
  :virtual #t
  :exit (behavior ()
    (stop! (-> self sound))
    ((-> (method-of-type process-taskable idle) exit))
    (none)
    )
  :trans (behavior ()
    (assistant-levitator-blue-glow)
    (update! (-> self sound))
    ((-> (method-of-type process-taskable idle) trans))
    (none)
    )
  :code (behavior ()
    (if (!= (ja-group) (get-art-elem self))
        (ja-channel-push! 1 (seconds 0.05))
        )
    (loop
      (cond
        ((= (get-task-status (game-task village2-levitator)) (task-status invalid))
         (ja-no-eval :group! assistant-village2-idle-after-ja :num! (seek!) :frame-num 0.0)
         (until (ja-done? 0)
           (assistant-levitator-blue-beam)
           (suspend)
           (ja :num! (seek!))
           )
         )
        (else
          (ja :group! assistant-village2-idle-a-ja)
          (let* ((f30-0 2.0)
                 (v1-31 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
                 (v1-32 (the-as number (logior #x3f800000 v1-31)))
                 )
            (countdown (gp-0 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-32)))) 3))
              (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0)
              (until (ja-done? 0)
                (suspend)
                (ja :num! (seek!))
                )
              )
            )
          (ja-no-eval :group! assistant-village2-idle-to-b-ja :num! (seek!) :frame-num 0.0)
          (until (ja-done? 0)
            (suspend)
            (ja :num! (seek!))
            )
          (ja :group! assistant-village2-idle-b-ja)
          (let* ((f30-1 2.0)
                 (v1-91 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
                 (v1-92 (the-as number (logior #x3f800000 v1-91)))
                 )
            (countdown (gp-1 (+ (the int (* f30-1 (+ -1.0 (the-as float v1-92)))) 3))
              (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0)
              (until (ja-done? 0)
                (suspend)
                (ja :num! (seek!))
                )
              )
            )
          (ja-no-eval :group! assistant-village2-idle-to-a-ja :num! (seek!) :frame-num 0.0)
          (until (ja-done? 0)
            (suspend)
            (ja :num! (seek!))
            )
          )
        )
      )
    (none)
    )
  )

;; definition for method 39 of type assistant-levitator
(defmethod should-display? assistant-levitator ((obj assistant-levitator))
  (or (= (get-task-status (game-task village2-levitator)) (task-status need-reward-speech))
      (zero? (get-task-status (game-task village2-levitator)))
      )
  )

;; failed to figure out what this is:
(defstate just-particles (assistant-levitator)
  :code (behavior ()
    (ja-channel-set! 0)
    (loop
      (assistant-levitator-blue-glow)
      (assistant-levitator-blue-beam)
      (update! (-> self sound))
      (suspend)
      )
    (none)
    )
  )

;; definition for method 11 of type assistant-levitator
(defmethod init-from-entity! assistant-levitator ((obj assistant-levitator) (arg0 entity-actor))
  (dummy-40 obj arg0 *assistant-village2-sg* 3 31 (new 'static 'vector :w 4096.0) 5)
  (set! (-> obj tasks) (get-task-control (game-task village2-levitator)))
  (set! (-> obj boulder) (entity-actor-lookup arg0 'alt-actor 0))
  (set! (-> obj particle 0) (create-launch-control (-> *part-group-id-table* 658) obj))
  (set! (-> obj particle 1) (create-launch-control (-> *part-group-id-table* 659) obj))
  (set! (-> obj particle 2) (create-launch-control (-> *part-group-id-table* 660) obj))
  (set! (-> obj particle 3) (create-launch-control (-> *part-group-id-table* 661) obj))
  (set! (-> obj sound)
        (new 'process 'ambient-sound (static-sound-spec "lev-mach-idle" :fo-max 30) (-> obj root-override trans))
        )
  (if (= (get-task-status (game-task village2-levitator)) (task-status invalid))
      (go just-particles)
      (dummy-42 obj)
      )
  (none)
  )
