mirror of
https://github.com/open-goal/jak-project
synced 2026-07-31 08:16:02 -04:00
48cb9bb787
Add support for `as-type` macro, and detecting inline font methods. This works in all three games but I've only updated jak 3's goal_src for now. Eventually I will go back and work through the others, but I want to get more decompiler features in first.  --------- Co-authored-by: water111 <awaterford1111445@gmail.com>
2357 lines
80 KiB
Common Lisp
Vendored
Generated
2357 lines
80 KiB
Common Lisp
Vendored
Generated
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpartgroup group-turret-explode
|
|
:id 235
|
|
:duration (seconds 0.5)
|
|
:linger-duration (seconds 1)
|
|
:flags (sp0)
|
|
:bounds (static-bspherem 0 0 0 15)
|
|
:parts ((sp-item 1022 :period (seconds 5) :length (seconds 0.085) :offset -10)
|
|
(sp-item 1023 :fade-after (meters 60) :period (seconds 5) :length (seconds 0.1))
|
|
(sp-item 1024 :fade-after (meters 60) :falloff-to (meters 60) :period (seconds 5) :length (seconds 0.335))
|
|
(sp-item 1025 :fade-after (meters 200) :falloff-to (meters 200) :period (seconds 5) :length (seconds 0.167))
|
|
(sp-item 1026 :period (seconds 5) :length (seconds 0.017) :offset -10)
|
|
(sp-item 1027 :fade-after (meters 150) :falloff-to (meters 150) :period (seconds 5) :length (seconds 0.167))
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 1025
|
|
:init-specs ((:texture (explosion-edge level-default-sprite))
|
|
(:num 1.0 1.0)
|
|
(:scale-x (meters 1) (meters 1))
|
|
(:rot-z (degrees 0) (degrees 360) :store)
|
|
(:scale-y (meters 0.8) (meters 0.2))
|
|
(:r 255.0)
|
|
(:g 255.0)
|
|
(:b 255.0)
|
|
(:a 32.0 32.0)
|
|
(:vel-y (meters 0.02) (meters 0.01))
|
|
(:scalevel-x (meters 0.01) (meters 0.13333334))
|
|
(:scalevel-y :copy scalevel-x)
|
|
(:fade-r 0.0)
|
|
(:fade-g -0.36)
|
|
(:fade-b -4.24)
|
|
(:fade-a -0.22068965)
|
|
(:friction 0.95)
|
|
(:timer (seconds 3.335))
|
|
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3))
|
|
(:func 'sparticle-motion-blur)
|
|
(:next-time (seconds 0.085) (seconds 0.015))
|
|
(:next-launcher 1028)
|
|
(:conerot-x '*sp-temp*)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 1027
|
|
:init-specs ((:texture (explosion-nebula level-default-sprite))
|
|
(:num 1.0 1.0)
|
|
(:scale-x (meters 1) (meters 1))
|
|
(:rot-z (degrees 0))
|
|
(:scale-y :copy scale-x)
|
|
(:r 255.0)
|
|
(:g 255.0)
|
|
(:b 255.0)
|
|
(:a 0.0)
|
|
(:vel-y (meters 0.02) (meters 0.01))
|
|
(:scalevel-x (meters 0.01) (meters 0.13333334))
|
|
(:rotvel-z (degrees -0.12) (degrees 0.24))
|
|
(:scalevel-y :copy scalevel-x)
|
|
(:fade-r 0.0)
|
|
(:fade-g -0.36)
|
|
(:fade-b -4.24)
|
|
(:fade-a 0.22068965)
|
|
(:friction 0.95)
|
|
(:timer (seconds 3.335))
|
|
(:flags (sp-cpuinfo-flag-2))
|
|
(:next-time (seconds 0.085) (seconds 0.015))
|
|
(:next-launcher 1028)
|
|
(:conerot-x (degrees 0) (degrees 360))
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 1028
|
|
:init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.017) (seconds 0.065)) (:next-launcher 1029))
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 1029
|
|
:init-specs ((:scalevel-x (meters 0.016666668) (meters 0.016666668))
|
|
(:scalevel-y :copy scalevel-x)
|
|
(:fade-r -0.44)
|
|
(:fade-g -2.36)
|
|
(:fade-b -2.64)
|
|
(:next-time (seconds 0.117) (seconds 0.047))
|
|
(:next-launcher 1030)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 1030
|
|
:init-specs ((:scalevel-x (meters 0.008333334) (meters 0.008333334))
|
|
(:scalevel-y :copy scalevel-x)
|
|
(:fade-r -1.2944444)
|
|
(:fade-g -0.7111111)
|
|
(:fade-b -0.094444446)
|
|
(:fade-a -0.06545454 -0.06545454)
|
|
(:next-time (seconds 0.5) (seconds 0.097))
|
|
(:next-launcher 1031)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 1031
|
|
:init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0))
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 1026
|
|
:init-specs ((:texture (glow level-default-sprite))
|
|
(:num 1.0)
|
|
(:scale-x (meters 5))
|
|
(:scale-y :copy scale-x)
|
|
(:r 255.0)
|
|
(:g 255.0)
|
|
(:b 255.0)
|
|
(:a 96.0)
|
|
(:scalevel-x (meters 0.5))
|
|
(:rotvel-z (degrees 0.3))
|
|
(:scalevel-y :copy scalevel-x)
|
|
(:fade-r 0.0)
|
|
(:fade-g -1.28)
|
|
(:fade-b -5.1)
|
|
(:fade-a 0.0)
|
|
(:timer (seconds 0.335))
|
|
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3))
|
|
(:next-time (seconds 0.167))
|
|
(:next-launcher 1032)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 1032
|
|
:init-specs ((:scalevel-x (meters -0.2))
|
|
(:scalevel-y :copy scalevel-x)
|
|
(:fade-r 0.0)
|
|
(:fade-g -2.56)
|
|
(:fade-b 0.0)
|
|
(:fade-a -1.92)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 1024
|
|
:init-specs ((:texture (specs level-default-sprite))
|
|
(:num 5.0 3.0)
|
|
(:x (meters 0.25))
|
|
(:scale-x (meters 1) (meters 0.25))
|
|
(:rot-z (degrees 0) (degrees 360))
|
|
(:scale-y :copy scale-x)
|
|
(:r 255.0)
|
|
(:g 255.0)
|
|
(:b 255.0)
|
|
(:a 16.0 48.0)
|
|
(:vel-y (meters 0.083333336) (meters 0.083333336))
|
|
(:scalevel-x (meters 0.006666667) (meters 0.0016666667))
|
|
(:rotvel-z (degrees -0.12) (degrees 0.24))
|
|
(:scalevel-y :copy scalevel-x)
|
|
(:fade-r 0.0)
|
|
(:fade-g -0.18)
|
|
(:fade-b -2.12)
|
|
(:accel-y (meters -0.00016666666) (meters -0.00033333333))
|
|
(:friction 0.87)
|
|
(:timer (seconds 3.335))
|
|
(:flags (sp-cpuinfo-flag-2))
|
|
(:next-time (seconds 0.117) (seconds 0.047))
|
|
(:next-launcher 1033)
|
|
(:conerot-x (degrees 0) (degrees 360))
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 1033
|
|
:init-specs ((:scalevel-x (meters 0.0016666667))
|
|
(:scalevel-y :copy scalevel-x)
|
|
(:fade-r 0.0)
|
|
(:fade-g 0.02)
|
|
(:fade-b 0.23555556)
|
|
(:next-time (seconds 0.15) (seconds 0.047))
|
|
(:next-launcher 1034)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 1034
|
|
:init-specs ((:fade-r -0.5543478) (:fade-g -0.5543478) (:fade-a -0.13913043))
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 1022
|
|
:init-specs ((:texture (bigpuff level-default-sprite))
|
|
(:num 3.0 1.0)
|
|
(:x (meters 0) (meters 0.6))
|
|
(:scale-x (meters 2) (meters 1.5))
|
|
(:rot-z (degrees 0) (degrees 360))
|
|
(:scale-y :copy scale-x)
|
|
(:r 70.0 20.0)
|
|
(:g 70.0 20.0)
|
|
(:b 70.0 20.0)
|
|
(:a 0.0 40.0)
|
|
(:vel-y (meters 0) (meters 0.1))
|
|
(:scalevel-x (meters 0.033333335) (meters 0.016666668))
|
|
(:rotvel-z (degrees -0.12) (degrees 0.24))
|
|
(:scalevel-y :copy scalevel-x)
|
|
(:fade-r 3.3)
|
|
(:fade-g 3.12)
|
|
(:fade-b 1.18)
|
|
(:fade-a 1.76)
|
|
(:friction 0.88)
|
|
(:timer (seconds 2.367))
|
|
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3))
|
|
(:next-time (seconds 0.117) (seconds 0.047))
|
|
(:next-launcher 1035)
|
|
(:conerot-x (degrees 0) (degrees 360))
|
|
(:conerot-y (degrees 0) (degrees 360))
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 1035
|
|
:init-specs ((:scalevel-x (meters 0.0033333334))
|
|
(:scalevel-y :copy scalevel-x)
|
|
(:fade-r -0.53333336)
|
|
(:fade-g -1.9666667)
|
|
(:fade-b -2.2)
|
|
(:fade-a -0.41666666)
|
|
(:next-time (seconds 0.15) (seconds 0.047))
|
|
(:next-launcher 1036)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 1036
|
|
:init-specs ((:scalevel-x (meters 0))
|
|
(:scalevel-y :copy scalevel-x)
|
|
(:fade-r -0.38833332)
|
|
(:fade-g -0.21333334)
|
|
(:fade-b -0.028333334)
|
|
(:fade-a -0.38833332)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 1023
|
|
:init-specs ((:texture (motion-blur-part level-default-sprite))
|
|
(:num 4.0 2.0)
|
|
(:scale-x (meters 0.1) (meters 0.25))
|
|
(:rot-x 4)
|
|
(:rot-z (degrees 0) (degrees 360))
|
|
(:scale-y (meters 0.2) (meters 0.1))
|
|
(:r 128.0 128.0)
|
|
(:g 96.0)
|
|
(:b 64.0)
|
|
(:a 64.0 64.0)
|
|
(:scalevel-x (meters 0.13333334) (meters 0.02))
|
|
(:fade-g 1.6)
|
|
(:fade-b 3.2)
|
|
(:fade-a -1.6)
|
|
(:timer (seconds 0.267))
|
|
(:flags (sp-cpuinfo-flag-2))
|
|
)
|
|
)
|
|
|
|
;; definition of type target-turret-params
|
|
(deftype target-turret-params (structure)
|
|
((fire-interval time-frame)
|
|
(max-health float)
|
|
(roty-accel float)
|
|
(roty-friction float)
|
|
(rotyv-max float)
|
|
(rotx-accel float)
|
|
(rotx-friction float)
|
|
(rotxv-max float)
|
|
(rotx-min float)
|
|
(rotx-max float)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type target-turret-params
|
|
(defmethod inspect ((this target-turret-params))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(format #t "[~8x] ~A~%" this 'target-turret-params)
|
|
(format #t "~1Tfire-interval: ~D~%" (-> this fire-interval))
|
|
(format #t "~1Tmax-health: ~f~%" (-> this max-health))
|
|
(format #t "~1Troty-accel: ~f~%" (-> this roty-accel))
|
|
(format #t "~1Troty-friction: ~f~%" (-> this roty-friction))
|
|
(format #t "~1Trotyv-max: ~f~%" (-> this rotyv-max))
|
|
(format #t "~1Trotx-accel: ~f~%" (-> this rotx-accel))
|
|
(format #t "~1Trotx-friction: ~f~%" (-> this rotx-friction))
|
|
(format #t "~1Trotxv-max: ~f~%" (-> this rotxv-max))
|
|
(format #t "~1Trotx-min: ~f~%" (-> this rotx-min))
|
|
(format #t "~1Trotx-max: ~f~%" (-> this rotx-max))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition of type turret-info
|
|
(deftype turret-info (basic)
|
|
((process (pointer process))
|
|
(handle handle)
|
|
(turret (pointer process))
|
|
(grabbed? symbol)
|
|
(turret-type type)
|
|
(exit? symbol)
|
|
(quat quaternion :inline)
|
|
(trans vector :inline)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type turret-info
|
|
(defmethod inspect ((this turret-info))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(format #t "[~8x] ~A~%" this (-> this type))
|
|
(format #t "~1Tprocess: #x~X~%" (-> this process))
|
|
(format #t "~1Thandle: ~D~%" (-> this handle))
|
|
(format #t "~1Tturret: #x~X~%" (-> this turret))
|
|
(format #t "~1Tgrabbed?: ~A~%" (-> this grabbed?))
|
|
(format #t "~1Tturret-type: ~A~%" (-> this turret-type))
|
|
(format #t "~1Texit?: ~A~%" (-> this exit?))
|
|
(format #t "~1Tquat: #<quaternion @ #x~X>~%" (-> this quat))
|
|
(format #t "~1Ttrans: ~`vector`P~%" (-> this trans))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup skel-turret drill-turret-ext 0 2
|
|
((1 (meters 999999)))
|
|
:bounds (static-spherem 0 1.8 0 3.8)
|
|
:origin-joint-index 3
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup skel-turret-explode drill-turret-ext 3 5
|
|
((4 (meters 999999)))
|
|
:bounds (static-spherem 0 1.8 0 3.8)
|
|
:origin-joint-index 3
|
|
)
|
|
|
|
;; definition for symbol *turret-exploder-params*, type joint-exploder-static-params
|
|
(define *turret-exploder-params*
|
|
(new 'static 'joint-exploder-static-params
|
|
:joints (new 'static 'boxed-array :type joint-exploder-static-joint-params
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 3 :parent-joint-index -1)
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1)
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1)
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1)
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1)
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1)
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1)
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1)
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1)
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1)
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1)
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1)
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1)
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1)
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1)
|
|
)
|
|
:collide-spec (collide-spec backgnd)
|
|
)
|
|
)
|
|
|
|
;; definition for symbol *target-turret-params*, type target-turret-params
|
|
(define *target-turret-params* (new 'static 'target-turret-params
|
|
:fire-interval (seconds 0.15)
|
|
:max-health 16.0
|
|
:roty-accel -98304.0
|
|
:roty-friction 0.98
|
|
:rotyv-max 14563.556
|
|
:rotx-accel -65536.0
|
|
:rotx-friction 0.98
|
|
:rotxv-max 9102.223
|
|
:rotx-min -10922.667
|
|
:rotx-max 5461.3335
|
|
)
|
|
)
|
|
|
|
;; definition of type target-turret-info
|
|
(deftype target-turret-info (structure)
|
|
((idle-anim int32)
|
|
(camera-joint int32)
|
|
(explode-sg skeleton-group)
|
|
(explode-params explosion-init-params)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type target-turret-info
|
|
(defmethod inspect ((this target-turret-info))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(format #t "[~8x] ~A~%" this 'target-turret-info)
|
|
(format #t "~1Tidle-anim: ~D~%" (-> this idle-anim))
|
|
(format #t "~1Tcamera-joint: ~D~%" (-> this camera-joint))
|
|
(format #t "~1Texplode-sg: ~A~%" (-> this explode-sg))
|
|
(format #t "~1Texplode-params: ~A~%" (-> this explode-params))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition of type target-turret
|
|
(deftype target-turret (process-focusable)
|
|
((params target-turret-params)
|
|
(info target-turret-info)
|
|
(hud handle)
|
|
(shadow-backup shadow-geo)
|
|
(rider handle)
|
|
(smush-control smush-control :inline)
|
|
(fire-recoil smush-control :inline)
|
|
(sound-id sound-id 3)
|
|
(sound-playing symbol 3)
|
|
(cam-string-vector vector :inline)
|
|
(pause-proc basic)
|
|
(shot-timeout time-frame)
|
|
(fire-time time-frame)
|
|
(fire-time-interval time-frame)
|
|
(focus-ignore-timer time-frame)
|
|
(enable-controls symbol)
|
|
(roty degrees)
|
|
(rotyv degrees)
|
|
(rotyvv degrees)
|
|
(roty-min degrees)
|
|
(roty-max degrees)
|
|
(rotx degrees)
|
|
(rotxv degrees)
|
|
(rotxvv degrees)
|
|
(rotx-min degrees)
|
|
(rotx-max degrees)
|
|
(dest-roty degrees)
|
|
(dest-rotx degrees)
|
|
(target-quat quaternion :inline)
|
|
(init-trans vector :inline)
|
|
(init-quat quaternion :inline)
|
|
(health float)
|
|
(track-handle handle)
|
|
(heat float)
|
|
(heat-target float)
|
|
(arrow-angle float)
|
|
(arrow-alpha float)
|
|
(arrow-red float)
|
|
(red-filter-timer time-frame)
|
|
(ride-height float)
|
|
)
|
|
(:state-methods
|
|
idle
|
|
setup
|
|
active
|
|
shutdown
|
|
dormant
|
|
die
|
|
)
|
|
(:methods
|
|
(attack-handler (_type_ attack-info symbol) none)
|
|
(init! (_type_) none)
|
|
(target-turret-method-36 (_type_) none)
|
|
(init-fields! (_type_) none)
|
|
(target-turret-method-38 (_type_) none)
|
|
(get-params (_type_) target-turret-params)
|
|
(target-turret-method-40 (_type_) none)
|
|
(target-turret-method-41 (_type_) object)
|
|
(target-turret-method-42 (_type_) none)
|
|
(target-turret-method-43 (_type_) none)
|
|
(target-turret-method-44 (_type_) none)
|
|
(target-turret-method-45 (_type_) none)
|
|
(target-turret-method-46 (_type_ quaternion) none)
|
|
(target-turret-method-47 (_type_) none)
|
|
(target-turret-method-48 (_type_ vector) symbol)
|
|
(target-turret-method-49 (_type_ vector vector float) float)
|
|
(target-turret-method-50 (_type_) none)
|
|
(target-turret-method-51 (_type_ vector vector) none)
|
|
(target-turret-method-52 (_type_) none)
|
|
(target-turret-method-53 (_type_) none)
|
|
(target-turret-method-54 (_type_) none)
|
|
(target-turret-method-55 (_type_) none)
|
|
(target-turret-method-56 (_type_ process int symbol event-message-block) object)
|
|
(explode-turret (_type_) none)
|
|
(target-turret-method-58 (_type_) none)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type target-turret
|
|
(defmethod inspect ((this target-turret))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(let ((t9-0 (method-of-type process-focusable inspect)))
|
|
(t9-0 this)
|
|
)
|
|
(format #t "~2Tparams: #<target-turret-params @ #x~X>~%" (-> this params))
|
|
(format #t "~2Tinfo: #<target-turret-info @ #x~X>~%" (-> this info))
|
|
(format #t "~2Thud: ~D~%" (-> this hud))
|
|
(format #t "~2Tshadow-backup: ~A~%" (-> this shadow-backup))
|
|
(format #t "~2Trider: ~D~%" (-> this rider))
|
|
(format #t "~2Tsmush-control: #<smush-control @ #x~X>~%" (-> this smush-control))
|
|
(format #t "~2Tfire-recoil: #<smush-control @ #x~X>~%" (-> this fire-recoil))
|
|
(format #t "~2Tsound-id[3] @ #x~X~%" (-> this sound-id))
|
|
(format #t "~2Tsound-playing[3] @ #x~X~%" (-> this sound-playing))
|
|
(format #t "~2Tcam-string-vector: #<vector @ #x~X>~%" (-> this cam-string-vector))
|
|
(format #t "~2Tpause-proc: ~A~%" (-> this pause-proc))
|
|
(format #t "~2Tshot-timeout: ~D~%" (-> this shot-timeout))
|
|
(format #t "~2Tfire-time: ~D~%" (-> this fire-time))
|
|
(format #t "~2Tfire-time-interval: ~D~%" (-> this fire-time-interval))
|
|
(format #t "~2Tfocus-ignore-timer: ~D~%" (-> this focus-ignore-timer))
|
|
(format #t "~2Tenable-controls: ~A~%" (-> this enable-controls))
|
|
(format #t "~2Troty: (deg ~r)~%" (-> this roty))
|
|
(format #t "~2Trotyv: (deg ~r)~%" (-> this rotyv))
|
|
(format #t "~2Trotyvv: (deg ~r)~%" (-> this rotyvv))
|
|
(format #t "~2Troty-min: (deg ~r)~%" (-> this roty-min))
|
|
(format #t "~2Troty-max: (deg ~r)~%" (-> this roty-max))
|
|
(format #t "~2Trotx: (deg ~r)~%" (-> this rotx))
|
|
(format #t "~2Trotxv: (deg ~r)~%" (-> this rotxv))
|
|
(format #t "~2Trotxvv: (deg ~r)~%" (-> this rotxvv))
|
|
(format #t "~2Trotx-min: (deg ~r)~%" (-> this rotx-min))
|
|
(format #t "~2Trotx-max: (deg ~r)~%" (-> this rotx-max))
|
|
(format #t "~2Tdest-roty: (deg ~r)~%" (-> this dest-roty))
|
|
(format #t "~2Tdest-rotx: (deg ~r)~%" (-> this dest-rotx))
|
|
(format #t "~2Ttarget-quat: #<quaternion @ #x~X>~%" (-> this target-quat))
|
|
(format #t "~2Tinit-trans: #<vector @ #x~X>~%" (-> this init-trans))
|
|
(format #t "~2Tinit-quat: #<quaternion @ #x~X>~%" (-> this init-quat))
|
|
(format #t "~2Thealth: ~f~%" (-> this health))
|
|
(format #t "~2Ttrack-handle: ~D~%" (-> this track-handle))
|
|
(format #t "~2Theat: ~f~%" (-> this heat))
|
|
(format #t "~2Theat-target: ~f~%" (-> this heat-target))
|
|
(format #t "~2Tarrow-angle: ~f~%" (-> this arrow-angle))
|
|
(format #t "~2Tarrow-alpha: ~f~%" (-> this arrow-alpha))
|
|
(format #t "~2Tarrow-red: ~f~%" (-> this arrow-red))
|
|
(format #t "~2Tred-filter-timer: ~D~%" (-> this red-filter-timer))
|
|
(format #t "~2Tride-height: ~f~%" (-> this ride-height))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition for function target-turret-active-post
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defbehavior target-turret-active-post target-turret ()
|
|
(target-turret-method-44 self)
|
|
(target-turret-method-45 self)
|
|
(target-turret-method-58 self)
|
|
(transform-post)
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 41 of type target-turret
|
|
(defmethod target-turret-method-41 ((this target-turret))
|
|
(and (-> *setting-control* user-current pilot)
|
|
*target*
|
|
(not (focus-test? *target* in-head light board mech dark))
|
|
(and *target* (and (>= 20480.0 (vector-vector-distance (-> this root trans) (-> *target* control trans)))
|
|
(not (logtest? (focus-status teleporting) (-> *target* focus-status)))
|
|
)
|
|
)
|
|
(let ((f30-1 24576.0)
|
|
(s4-0 (-> this root))
|
|
(s5-0 (target-pos 0))
|
|
)
|
|
(and (< f30-1
|
|
(fabs
|
|
(deg-diff (y-angle s4-0) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s5-0 (-> s4-0 trans))))
|
|
)
|
|
)
|
|
(logtest? (-> *target* control status) (collide-status on-surface))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for method 40 of type target-turret
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod target-turret-method-40 ((this target-turret))
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 42 of type target-turret
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod target-turret-method-42 ((this target-turret))
|
|
(send-event (handle->process (-> this hud)) 'force-show)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 43 of type target-turret
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod target-turret-method-43 ((this target-turret))
|
|
(send-event (handle->process (-> this hud)) 'hide-and-die)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 44 of type target-turret
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod target-turret-method-44 ((this target-turret))
|
|
(when (nonzero? (-> this part))
|
|
(let ((t9-0 (method-of-type sparticle-launch-control spawn)))
|
|
(t9-0 (-> this part) (-> this root trans))
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 46 of type target-turret
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod target-turret-method-46 ((this target-turret) (arg0 quaternion))
|
|
(let ((s3-0 (new 'stack-no-clear 'matrix))
|
|
(s4-0 (new 'stack-no-clear 'matrix))
|
|
(gp-0 (new 'stack-no-clear 'quaternion))
|
|
)
|
|
(matrix-rotate-y! s3-0 (-> this roty))
|
|
(matrix-rotate-x! s4-0 (-> this rotx))
|
|
(matrix*! s3-0 s4-0 s3-0)
|
|
(matrix->quaternion gp-0 s3-0)
|
|
(quaternion-smooth-seek! (-> this target-quat) (-> this target-quat) gp-0 (the-as float arg0))
|
|
(let ((f30-0 (update! (-> this smush-control))))
|
|
(update! (-> this fire-recoil))
|
|
(quaternion-rotate-local-x! (-> this root quat) gp-0 (* -910.2222 f30-0))
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 47 of type target-turret
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod target-turret-method-47 ((this target-turret))
|
|
(let ((s5-0 (-> this params)))
|
|
(cond
|
|
((-> this enable-controls)
|
|
(when (>= (-> *camera-combiner* interp-val) 1.0)
|
|
(set! (-> this rotyvv)
|
|
(analog-input (the-as int (-> *cpad-list* cpads 0 leftx)) 128.0 32.0 110.0 (-> s5-0 roty-accel))
|
|
)
|
|
(set! (-> this rotxvv)
|
|
(analog-input (the-as int (-> *cpad-list* cpads 0 lefty)) 128.0 32.0 110.0 (-> s5-0 rotx-accel))
|
|
)
|
|
(if (-> *setting-control* cam-current flip-vertical)
|
|
(set! (-> this rotxvv) (- (-> this rotxvv)))
|
|
)
|
|
)
|
|
)
|
|
(else
|
|
(let ((f28-0 (lerp-scale 1.0 -1.0 (-> this rotyv) -14563.556 14563.556))
|
|
(f30-0 (lerp-scale 1.0 -1.0 (-> this rotxv) -9102.223 9102.223))
|
|
)
|
|
(set! (-> this rotyvv)
|
|
(* (-> s5-0 roty-accel)
|
|
(+ (* 3.0 (lerp-scale 1.0 -1.0 (deg-diff (-> this roty) (-> this dest-roty)) -910.2222 910.2222))
|
|
(* -0.9 f28-0)
|
|
)
|
|
)
|
|
)
|
|
(set! (-> this rotxvv)
|
|
(* (-> s5-0 rotx-accel)
|
|
(+ (* 2.0 (lerp-scale 1.0 -1.0 (deg-diff (-> this rotx) (-> this dest-rotx)) -910.2222 910.2222))
|
|
(* -0.8 f30-0)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(+! (-> this rotyv) (* (-> this rotyvv) (seconds-per-frame)))
|
|
(set! (-> this rotyv) (* (-> this rotyv) (-> s5-0 roty-friction)))
|
|
(set! (-> this rotyv) (fmax (fmin (-> this rotyv) (-> s5-0 rotyv-max)) (- (-> s5-0 rotyv-max))))
|
|
(set! (-> this roty)
|
|
(the float (sar (shl (the int (+ (-> this roty) (* (-> this rotyv) (seconds-per-frame)))) 48) 48))
|
|
)
|
|
(+! (-> this rotxv) (* (-> this rotxvv) (seconds-per-frame)))
|
|
(set! (-> this rotxv) (* (-> this rotxv) (-> s5-0 rotx-friction)))
|
|
(set! (-> this rotxv) (fmax (fmin (-> this rotxv) (-> s5-0 rotxv-max)) (- (-> s5-0 rotxv-max))))
|
|
)
|
|
(set! (-> this rotx)
|
|
(the float (sar (shl (the int (+ (-> this rotx) (* (-> this rotxv) (seconds-per-frame)))) 48) 48))
|
|
)
|
|
(cond
|
|
((>= (-> this rotx) (-> this rotx-max))
|
|
(set! (-> this rotx) (-> this rotx-max))
|
|
(set! (-> this rotxv) 0.0)
|
|
)
|
|
((>= (-> this rotx-min) (-> this rotx))
|
|
(set! (-> this rotx) (-> this rotx-min))
|
|
(set! (-> this rotxv) 0.0)
|
|
)
|
|
)
|
|
(when (!= (-> this roty-min) (-> this roty-max))
|
|
(cond
|
|
((>= (-> this roty) (-> this roty-max))
|
|
(set! (-> this roty) (-> this roty-max))
|
|
(set! (-> this rotyv) 0.0)
|
|
)
|
|
((>= (-> this roty-min) (-> this roty))
|
|
(set! (-> this roty) (-> this roty-min))
|
|
(set! (-> this rotyv) 0.0)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 45 of type target-turret
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod target-turret-method-45 ((this target-turret))
|
|
(let ((f30-0 (fabs (/ (-> this rotyv) (-> this params rotyv-max))))
|
|
(f28-0 (fabs (/ (-> this rotxv) (-> this params rotxv-max))))
|
|
(f26-0 (- 1.0 (-> this params roty-friction)))
|
|
(f24-0 (- 1.0 (-> this params rotx-friction)))
|
|
(s5-0 (-> this sound-playing 0))
|
|
(s4-0 (-> this sound-playing 1))
|
|
)
|
|
(cond
|
|
((and (-> this sound-playing 0) (< f30-0 f26-0))
|
|
(sound-stop (-> this sound-id 0))
|
|
(set! (-> this sound-playing 0) #f)
|
|
)
|
|
((< (* 1.2 f26-0) f30-0)
|
|
(sound-play "drill-turret-lp" :id (-> this sound-id 0) :position (-> this root trans))
|
|
(set! (-> this sound-playing 0) #t)
|
|
)
|
|
)
|
|
(cond
|
|
((and (-> this sound-playing 1) (< f28-0 f24-0))
|
|
(sound-stop (-> this sound-id 1))
|
|
(set! (-> this sound-playing 1) #f)
|
|
)
|
|
((< (* 1.2 f24-0) f28-0)
|
|
(sound-play "drill-turret-l2" :id (-> this sound-id 1) :position (-> this root trans))
|
|
(set! (-> this sound-playing 1) #t)
|
|
)
|
|
)
|
|
(if (and (or s5-0 s4-0) (< f30-0 f26-0) (< f28-0 f24-0))
|
|
(sound-play "drill-tur-stop" :position (-> this root trans))
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 56 of type target-turret
|
|
;; INFO: Used lq/sq
|
|
(defmethod target-turret-method-56 ((this target-turret) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
|
(local-vars (v0-0 object))
|
|
(case arg2
|
|
(('turret-type)
|
|
'turret
|
|
)
|
|
(('camera-offset)
|
|
(set! v0-0 (-> arg3 param 0))
|
|
(set! (-> (the-as vector v0-0) x) 0.0)
|
|
(set! (-> (the-as vector v0-0) y) 0.0)
|
|
(set! (-> (the-as vector v0-0) z) 0.0)
|
|
(set! (-> (the-as vector v0-0) w) 0.0)
|
|
v0-0
|
|
)
|
|
(('trans 'player-pos)
|
|
(set! v0-0 (-> arg3 param 0))
|
|
(set! (-> (the-as vector v0-0) quad) (-> this root trans quad))
|
|
v0-0
|
|
)
|
|
(('quat 'player-quat)
|
|
(quaternion-copy! (the-as quaternion (-> arg3 param 0)) (-> this target-quat))
|
|
)
|
|
(('rider)
|
|
(-> this rider)
|
|
)
|
|
(('shadow)
|
|
(cond
|
|
((-> arg3 param 0)
|
|
(set! v0-0 (-> this shadow-backup))
|
|
(set! (-> this draw shadow) (the-as shadow-geo v0-0))
|
|
v0-0
|
|
)
|
|
(else
|
|
(set! (-> this draw shadow) #f)
|
|
#f
|
|
)
|
|
)
|
|
)
|
|
(('fire-down)
|
|
(cond
|
|
((>= (-> this heat) 1.0)
|
|
(if (time-elapsed? (-> this fire-time) (* 6 (-> this fire-time-interval)))
|
|
(target-turret-method-52 this)
|
|
)
|
|
)
|
|
(else
|
|
(if (time-elapsed? (-> this fire-time) (-> this fire-time-interval))
|
|
(target-turret-method-52 this)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(('fire-pressed)
|
|
(if (time-elapsed? (-> this fire-time) (-> this fire-time-interval))
|
|
(target-turret-method-52 this)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for function turret-handler
|
|
(defbehavior turret-handler target-turret ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
|
(target-turret-method-56 self arg0 arg1 arg2 arg3)
|
|
)
|
|
|
|
;; definition for method 21 of type target-turret
|
|
(defmethod get-trans ((this target-turret) (arg0 int))
|
|
"Get the `trans` for this process."
|
|
(if (= arg0 1)
|
|
(-> this root trans)
|
|
((method-of-type process-focusable get-trans) this arg0)
|
|
)
|
|
)
|
|
|
|
;; definition for method 58 of type target-turret
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod target-turret-method-58 ((this target-turret))
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate idle (target-turret)
|
|
:virtual #t
|
|
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
|
(case message
|
|
(('attack 'bonk)
|
|
(send-event proc 'target-turret-get-off 90)
|
|
(send-event proc 'shove #f (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id))
|
|
(damage 2.0)
|
|
(vehicle-damage-factor 1.0)
|
|
(vehicle-impulse-factor 1.0)
|
|
(shove-back (meters 3))
|
|
(shove-up (meters 1))
|
|
)
|
|
)
|
|
)
|
|
#f
|
|
)
|
|
(('touch)
|
|
(send-event proc 'target-turret-get-off 90)
|
|
(send-shoves (-> self root) proc (the-as touching-shapes-entry (-> block param 0)) 0.7 6144.0 16384.0)
|
|
#f
|
|
)
|
|
(('pickup)
|
|
(when (send-event proc 'change-mode 'turret self)
|
|
(set! (-> self rider) (process->handle proc))
|
|
(go-virtual setup)
|
|
)
|
|
)
|
|
(('exit)
|
|
#t
|
|
)
|
|
(else
|
|
(turret-handler proc argc message block)
|
|
)
|
|
)
|
|
)
|
|
:enter (behavior ()
|
|
(set-zero! (-> self smush-control))
|
|
(set-zero! (-> self fire-recoil))
|
|
(logior! (-> self focus-status) (focus-status disable ignore inactive))
|
|
(set! (-> self rider) (the-as handle #f))
|
|
(ja-channel-set! 1)
|
|
(ja :group! (-> self draw art-group data (-> self info idle-anim)))
|
|
)
|
|
:exit (behavior ()
|
|
(let ((gp-0 (res-lump-struct (-> self entity) 'on-exit structure)))
|
|
(if (and gp-0 (not *scene-player*))
|
|
(script-eval (the-as pair gp-0))
|
|
)
|
|
)
|
|
)
|
|
:trans (behavior ()
|
|
(when (and (target-turret-method-41 self) (can-display-query? self "turret" -99.0))
|
|
(let ((gp-0
|
|
(new 'stack 'font-context *font-default-matrix* 32 320 0.0 (font-color default) (font-flags shadow kerning))
|
|
)
|
|
)
|
|
(set-width! gp-0 340)
|
|
(set-height! gp-0 80)
|
|
(let ((v1-7 gp-0)
|
|
(a0-6 (-> *setting-control* user-default language))
|
|
)
|
|
(set! (-> v1-7 scale) (if (or (= a0-6 (language-enum korean)) (= a0-6 (language-enum russian)))
|
|
0.9
|
|
0.7
|
|
)
|
|
)
|
|
)
|
|
(set! (-> gp-0 flags) (font-flags shadow kerning large))
|
|
(print-game-text
|
|
(lookup-text! *common-text* (text-id text-0083) #f)
|
|
gp-0
|
|
#f
|
|
44
|
|
(bucket-id hud-draw-hud-alpha)
|
|
)
|
|
)
|
|
(when (and (cpad-pressed? 0 triangle) (send-event *target* 'change-mode 'turret self))
|
|
(set! (-> self rider) (process->handle *target*))
|
|
(go-virtual setup)
|
|
)
|
|
)
|
|
(if *target*
|
|
(look-at!
|
|
(-> *target* neck)
|
|
(vector+!
|
|
(new 'stack-no-clear 'vector)
|
|
(-> self root root-prim prim-core world-sphere)
|
|
(new 'static 'vector :y 2048.0 :w 1.0)
|
|
)
|
|
'nothing-special
|
|
self
|
|
)
|
|
)
|
|
)
|
|
:code sleep-code
|
|
:post (behavior ()
|
|
(target-turret-method-47 self)
|
|
(target-turret-method-46 self (the-as quaternion #x3ea8f5c3))
|
|
(target-turret-method-55 self)
|
|
(target-turret-method-44 self)
|
|
(transform-post)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate setup (target-turret)
|
|
:virtual #t
|
|
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
|
(case message
|
|
(('change-mode)
|
|
(go-virtual active)
|
|
)
|
|
(else
|
|
(turret-handler proc argc message block)
|
|
)
|
|
)
|
|
)
|
|
:enter (behavior ()
|
|
(set-setting! 'mode-name 'cam-turret 0.0 0)
|
|
(set! (-> self enable-controls) #t)
|
|
(logclear! (-> self focus-status) (focus-status disable ignore inactive))
|
|
)
|
|
:code sleep-code
|
|
:post transform-post
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate active (target-turret)
|
|
:virtual #t
|
|
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
|
(case message
|
|
(('draw)
|
|
(cond
|
|
((-> block param 0)
|
|
(ja-channel-set! 1)
|
|
(ja :group! (-> self draw art-group data (-> self info idle-anim)))
|
|
(transform-post)
|
|
)
|
|
(else
|
|
(ja-channel-set! 0)
|
|
(transform-post)
|
|
)
|
|
)
|
|
)
|
|
(('bonk)
|
|
#f
|
|
)
|
|
(('attack)
|
|
(when (not *debug-player-vehicle-unkillable*)
|
|
(let ((a2-1 (-> block param 0))
|
|
(a1-3 (-> block param 1))
|
|
)
|
|
(attack-handler self (the-as attack-info a1-3) (the-as symbol a2-1))
|
|
)
|
|
)
|
|
)
|
|
(('test)
|
|
(set! (-> self health) (seek (-> self health) 0.0 (the-as float (-> block param 0))))
|
|
)
|
|
(('exit-valid)
|
|
(target-turret-method-48 self (the-as vector (-> block param 0)))
|
|
)
|
|
(('exit)
|
|
(go-virtual shutdown)
|
|
#f
|
|
)
|
|
(else
|
|
(turret-handler proc argc message block)
|
|
)
|
|
)
|
|
)
|
|
:enter (behavior ()
|
|
(logior! (-> self skel status) (joint-control-status sync-math))
|
|
(process-entity-status! self (entity-perm-status no-kill) #t)
|
|
(set! (-> self red-filter-timer) 0)
|
|
(set! (-> self ride-height) 0.0)
|
|
(if (handle->process (-> self rider))
|
|
(target-turret-method-40 self)
|
|
)
|
|
(ja-channel-set! 1)
|
|
(ja :group! (-> self draw art-group data (-> self info idle-anim)))
|
|
)
|
|
:exit (behavior ()
|
|
(set-filter-color! 1.0 1.0 1.0)
|
|
(target-turret-method-43 self)
|
|
)
|
|
:trans (behavior ()
|
|
(if (time-elapsed? (-> self focus-ignore-timer) (seconds 2))
|
|
(logclear! (-> self focus-status) (focus-status ignore))
|
|
(logior! (-> self focus-status) (focus-status ignore))
|
|
)
|
|
(if (or (<= (the int (-> self health)) 0) (not (handle->process (-> self rider))))
|
|
(go-virtual die)
|
|
)
|
|
)
|
|
:code sleep-code
|
|
:post (behavior ()
|
|
(when (nonzero? (-> self red-filter-timer))
|
|
(cond
|
|
((< (current-time) (-> self red-filter-timer))
|
|
(let* ((v1-5 (- (-> self red-filter-timer) (current-time)))
|
|
(f0-1 (- 1.0 (* 0.041666668 (the float v1-5))))
|
|
)
|
|
(set-filter-color! 1.0 f0-1 f0-1)
|
|
)
|
|
)
|
|
(else
|
|
(set! (-> self red-filter-timer) 0)
|
|
(set-filter-color! 1.0 1.0 1.0)
|
|
)
|
|
)
|
|
)
|
|
(target-turret-method-47 self)
|
|
(target-turret-method-46 self (the-as quaternion #x3ea8f5c3))
|
|
(target-turret-method-54 self)
|
|
(target-turret-method-55 self)
|
|
((the-as (function none) target-turret-active-post))
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate shutdown (target-turret)
|
|
:virtual #t
|
|
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
|
(case message
|
|
(('exit)
|
|
(and (time-elapsed? (-> self state-time) (seconds 0.05)) (< (fabs (-> self rotx)) 1820.4445))
|
|
)
|
|
(else
|
|
(turret-handler proc argc message block)
|
|
)
|
|
)
|
|
)
|
|
:enter (behavior ()
|
|
(logior! (-> self focus-status) (focus-status ignore))
|
|
(set! (-> self enable-controls) #f)
|
|
(set! (-> self dest-roty) (the float (sar (shl (the int (quaternion-y-angle (-> self init-quat))) 48) 48)))
|
|
(set! (-> self dest-rotx) 0.0)
|
|
(set-time! (-> self state-time))
|
|
(persist-with-delay *setting-control* 'interp-time (seconds 0.5) 'interp-time 'abs 150.0 0)
|
|
(remove-setting! 'mode-name)
|
|
(ja-channel-set! 1)
|
|
(ja :group! (-> self draw art-group data (-> self info idle-anim)))
|
|
)
|
|
:exit (behavior ()
|
|
(sound-stop (-> self sound-id 0))
|
|
(sound-stop (-> self sound-id 1))
|
|
(sound-stop (-> self sound-id 2))
|
|
(set-zero! (-> self smush-control))
|
|
(set-zero! (-> self fire-recoil))
|
|
(logclear! (-> self skel status) (joint-control-status sync-math))
|
|
)
|
|
:trans (behavior ()
|
|
(if (and (time-elapsed? (-> self state-time) (seconds 0.05))
|
|
(< (fabs (-> self rotyvv)) 364.0889)
|
|
(< (fabs (-> self rotyv)) 910.2222)
|
|
(< (fabs (-> self rotxvv)) 182.04445)
|
|
(< (fabs (-> self rotxv)) 910.2222)
|
|
)
|
|
(go-virtual idle)
|
|
)
|
|
)
|
|
:code sleep-code
|
|
:post (behavior ()
|
|
(target-turret-method-47 self)
|
|
(target-turret-method-46 self (the-as quaternion #x3ea8f5c3))
|
|
(target-turret-method-55 self)
|
|
(if *target*
|
|
(look-at!
|
|
(-> *target* neck)
|
|
(vector+!
|
|
(new 'stack-no-clear 'vector)
|
|
(-> self root root-prim prim-core world-sphere)
|
|
(new 'static 'vector :y 2048.0 :w 1.0)
|
|
)
|
|
'nothing-special
|
|
self
|
|
)
|
|
)
|
|
((the-as (function none) target-turret-active-post))
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate dormant (target-turret)
|
|
:virtual #t
|
|
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
|
(case message
|
|
(('attack 'bonk)
|
|
(send-event proc 'target-turret-get-off 90)
|
|
(send-event proc 'shove #f (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id))
|
|
(damage 2.0)
|
|
(vehicle-damage-factor 1.0)
|
|
(vehicle-impulse-factor 1.0)
|
|
(shove-back (meters 3))
|
|
(shove-up (meters 1))
|
|
)
|
|
)
|
|
)
|
|
#f
|
|
)
|
|
(('touch)
|
|
(send-event proc 'target-turret-get-off 90)
|
|
(send-shoves (-> self root) proc (the-as touching-shapes-entry (-> block param 0)) 0.7 6144.0 16384.0)
|
|
#f
|
|
)
|
|
(('exit)
|
|
#t
|
|
)
|
|
(else
|
|
(turret-handler proc argc message block)
|
|
)
|
|
)
|
|
)
|
|
:enter (behavior ()
|
|
(set-zero! (-> self smush-control))
|
|
(set-zero! (-> self fire-recoil))
|
|
(target-turret-method-50 self)
|
|
(logior! (-> self focus-status) (focus-status disable ignore inactive))
|
|
)
|
|
:code sleep-code
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate die (target-turret)
|
|
:virtual #t
|
|
:code (behavior ()
|
|
(remove-setting! 'mode-name)
|
|
(sound-stop (-> self sound-id 0))
|
|
(sound-stop (-> self sound-id 1))
|
|
(sound-stop (-> self sound-id 2))
|
|
(logior! (-> self focus-status) (focus-status disable ignore inactive))
|
|
(suspend-for (seconds 0.8)
|
|
)
|
|
(send-event
|
|
(handle->process (-> self rider))
|
|
'attack
|
|
#f
|
|
(static-attack-info
|
|
:mask (vehicle-impulse-factor)
|
|
((id (new-attack-id)) (damage 2.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'turret))
|
|
)
|
|
)
|
|
(let ((v1-18 (-> self root root-prim)))
|
|
(set! (-> v1-18 prim-core collide-as) (collide-spec))
|
|
(set! (-> v1-18 prim-core collide-with) (collide-spec))
|
|
)
|
|
0
|
|
(logior! (-> self draw status) (draw-control-status no-draw))
|
|
(sound-play "turret-die" :position (-> self root trans))
|
|
(explode-turret self)
|
|
(while (-> self child)
|
|
(suspend)
|
|
)
|
|
(cleanup-for-death self)
|
|
)
|
|
)
|
|
|
|
;; definition for method 57 of type target-turret
|
|
;; INFO: Used lq/sq
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod explode-turret ((this target-turret))
|
|
(when (-> this info explode-sg)
|
|
(let ((s5-0 (new 'stack 'joint-exploder-tuning (the-as uint 0))))
|
|
(process-spawn
|
|
joint-exploder
|
|
(-> this info explode-sg)
|
|
5
|
|
s5-0
|
|
(-> this info explode-params)
|
|
:name "joint-exploder"
|
|
:to this
|
|
:unk 0
|
|
)
|
|
)
|
|
)
|
|
(let ((v1-10 (new 'stack-no-clear 'vector)))
|
|
(vector-copy! v1-10 (-> this root trans))
|
|
(+! (-> v1-10 y) 8192.0)
|
|
(cond
|
|
((logtest? (-> *part-group-id-table* 235 flags) (sp-group-flag sp13))
|
|
(vector-copy! (-> *launch-matrix* trans) v1-10)
|
|
(part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 235))
|
|
)
|
|
(else
|
|
(vector-copy! (-> *launch-matrix* trans) v1-10)
|
|
(part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 235))
|
|
)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 53 of type target-turret
|
|
;; WARN: Return type mismatch symbol vs none.
|
|
(defmethod target-turret-method-53 ((this target-turret))
|
|
#t
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 54 of type target-turret
|
|
;; INFO: Used lq/sq
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod target-turret-method-54 ((this target-turret))
|
|
(set! (-> *game-info* score) (-> this health))
|
|
(let ((s4-0 (new 'stack-no-clear 'vector)))
|
|
(set! (-> s4-0 x) 0.0)
|
|
(set! (-> s4-0 y) 20480.0)
|
|
(set! (-> s4-0 z) 81920.0)
|
|
(set! (-> s4-0 w) 1.0)
|
|
(let ((s5-0 (new 'stack-no-clear 'vector4w)))
|
|
(set! (-> s5-0 quad) (the-as uint128 0))
|
|
(vector-matrix*! s4-0 s4-0 (-> this node-list data 0 bone transform))
|
|
(if (transform-point-qword! s5-0 s4-0)
|
|
(send-event
|
|
(handle->process (-> this hud))
|
|
'set-hud-pos
|
|
(+ (/ (-> s5-0 x) 16) -1792)
|
|
(+ (/ (-> s5-0 y) 16) -1840)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(target-turret-method-42 this)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 55 of type target-turret
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod target-turret-method-55 ((this target-turret))
|
|
(seek!
|
|
(-> this heat)
|
|
(-> this heat-target)
|
|
(* (fmin 0.5 (fabs (- (-> this heat) (-> this heat-target)))) (seconds-per-frame))
|
|
)
|
|
(seek! (-> this heat-target) 0.0 (* 0.4 (seconds-per-frame)))
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 34 of type target-turret
|
|
;; WARN: Return type mismatch time-frame vs none.
|
|
(defmethod attack-handler ((this target-turret) (arg0 attack-info) (arg1 symbol))
|
|
(when arg1
|
|
(case (-> arg0 mode)
|
|
(('wasp-shot 'neo-wasp-shot 'guard-shot 'explode 'neo-grenadier-shot)
|
|
(case (-> arg0 mode)
|
|
(('neo-grenadier-shot)
|
|
(seek! (-> this health) 0.0 1.0)
|
|
)
|
|
(else
|
|
(seek! (-> this health) 0.0 0.5)
|
|
)
|
|
)
|
|
(activate! (-> this smush-control) 0.2 15 75 1.0 0.9 (-> *display* entity-clock))
|
|
(cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1))
|
|
(sound-play "turret-take-hit")
|
|
(set! (-> this red-filter-timer) (+ (current-time) (seconds 0.08)))
|
|
(set-time! (-> this focus-ignore-timer))
|
|
)
|
|
(('neo-juicer-shot)
|
|
(seek! (-> this health) 0.0 (seconds-per-frame))
|
|
(set-time! (-> this focus-ignore-timer))
|
|
)
|
|
)
|
|
)
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 50 of type target-turret
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod target-turret-method-50 ((this target-turret))
|
|
(set! (-> this roty) (y-angle (-> this root)))
|
|
(set! (-> this rotx) 0.0)
|
|
(set! (-> this rotyv) 0.0)
|
|
(set! (-> this rotyvv) 0.0)
|
|
(set! (-> this rotxv) 0.0)
|
|
(set! (-> this rotxvv) 0.0)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 35 of type target-turret
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod init! ((this target-turret))
|
|
(initialize-skeleton
|
|
this
|
|
(the-as skeleton-group (art-group-get-by-name *level* "skel-turret" (the-as (pointer level) #f)))
|
|
(the-as pair 0)
|
|
)
|
|
(set! (-> this info) (new 'static 'target-turret-info :idle-anim 2 :camera-joint 12))
|
|
(set! (-> this info explode-sg)
|
|
(the-as skeleton-group (art-group-get-by-name *level* "skel-turret-explode" (the-as (pointer level) #f)))
|
|
)
|
|
(set! (-> this info explode-params) (the-as explosion-init-params *turret-exploder-params*))
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 36 of type target-turret
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod target-turret-method-36 ((this target-turret))
|
|
(let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others))))
|
|
(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)
|
|
)
|
|
(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 bot))
|
|
(set! (-> s4-0 prim-core action) (collide-action solid))
|
|
(set! (-> s4-0 transform-index) 3)
|
|
(set-vector! (-> s4-0 local-sphere) 0.0 7372.8 0.0 14745.6)
|
|
(set! (-> s5-0 root-prim) s4-0)
|
|
)
|
|
(let ((v1-12 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
|
|
(set! (-> v1-12 prim-core collide-as) (collide-spec bot camera-blocker))
|
|
(set! (-> v1-12 prim-core action) (collide-action solid))
|
|
(set! (-> v1-12 transform-index) 3)
|
|
(set-vector! (-> v1-12 local-sphere) 0.0 8192.0 0.0 9830.4)
|
|
)
|
|
(let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
|
|
(set! (-> v1-14 transform-index) 3)
|
|
(set-vector! (-> v1-14 local-sphere) 0.0 6553.6 0.0 12288.0)
|
|
)
|
|
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
|
|
(let ((v1-17 (-> s5-0 root-prim)))
|
|
(set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as))
|
|
(set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with))
|
|
)
|
|
(set! (-> this root) s5-0)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 48 of type target-turret
|
|
;; INFO: Used lq/sq
|
|
(defmethod target-turret-method-48 ((this target-turret) (arg0 vector))
|
|
(local-vars (sv-592 int))
|
|
(let* ((s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this init-quat)))
|
|
(s1-0 (-> this root trans))
|
|
(s5-0 (new 'stack-no-clear 'vector))
|
|
(s2-0 (new 'stack 'collide-query))
|
|
(s0-0 8)
|
|
(f30-0 (/ 65536.0 (+ -1.0 (the float s0-0))))
|
|
)
|
|
(set! (-> s3-0 y) 0.0)
|
|
(vector-xz-normalize! s3-0 24576.0)
|
|
(set! sv-592 0)
|
|
(while (< sv-592 s0-0)
|
|
(vector+! s5-0 s1-0 s3-0)
|
|
(vector-rotate-y! s3-0 s3-0 f30-0)
|
|
(vector-copy! (-> s2-0 start-pos) s5-0)
|
|
(set-vector! (-> s2-0 move-dist) 0.0 -24576.0 0.0 0.0)
|
|
(+! (-> s2-0 start-pos y) 2048.0)
|
|
(let ((v1-9 s2-0))
|
|
(set! (-> v1-9 radius) 409.6)
|
|
(set! (-> v1-9 collide-with) (collide-spec backgnd))
|
|
(set! (-> v1-9 ignore-process0) this)
|
|
(set! (-> v1-9 ignore-process1) #f)
|
|
(set! (-> v1-9 ignore-pat) (-> this root pat-ignore-mask))
|
|
(set! (-> v1-9 action-mask) (collide-action solid))
|
|
)
|
|
(when (>= (fill-and-probe-using-line-sphere *collide-cache* s2-0) 0.0)
|
|
(set! (-> s5-0 y) (+ 4096.0 (-> s2-0 best-other-tri intersect y)))
|
|
(vector-copy! arg0 s5-0)
|
|
(return #t)
|
|
)
|
|
(set! sv-592 (+ sv-592 1))
|
|
)
|
|
)
|
|
#f
|
|
)
|
|
|
|
;; definition for method 51 of type target-turret
|
|
;; INFO: Used lq/sq
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod target-turret-method-51 ((this target-turret) (arg0 vector) (arg1 vector))
|
|
(let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params)))
|
|
(set! (-> gp-0 ent) (-> this entity))
|
|
(set! (-> gp-0 charge) 1.0)
|
|
(set! (-> gp-0 options) (projectile-options po13 po17))
|
|
(logclear! (-> gp-0 options) (projectile-options po14 po15 po16))
|
|
(vector-copy! (-> gp-0 pos) arg0)
|
|
(vector-copy! (-> gp-0 vel) (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 1228800.0))
|
|
(set! (-> gp-0 notify-handle) (the-as handle #f))
|
|
(set! (-> gp-0 owner-handle) (the-as handle #f))
|
|
(set! (-> gp-0 target-handle) (the-as handle #f))
|
|
(set! (-> gp-0 target-pos quad) (the-as uint128 0))
|
|
(set! (-> gp-0 ignore-handle) (process->handle this))
|
|
(let* ((v1-12 *game-info*)
|
|
(a0-10 (+ (-> v1-12 attack-id) 1))
|
|
)
|
|
(set! (-> v1-12 attack-id) a0-10)
|
|
(set! (-> gp-0 attack-id) a0-10)
|
|
)
|
|
(set! (-> gp-0 timeout) (-> this shot-timeout))
|
|
(spawn-projectile turret-shot gp-0 this *default-dead-pool*)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 49 of type target-turret
|
|
;; INFO: Used lq/sq
|
|
(defmethod target-turret-method-49 ((this target-turret) (arg0 vector) (arg1 vector) (arg2 float))
|
|
(let ((s5-0 (new 'stack-no-clear 'collide-query)))
|
|
(vector-copy! (-> s5-0 start-pos) arg0)
|
|
(vector-normalize-copy! (-> s5-0 move-dist) arg1 arg2)
|
|
(let ((v1-1 s5-0))
|
|
(set! (-> v1-1 radius) 2048.0)
|
|
(set! (-> v1-1 collide-with) (collide-spec backgnd enemy obstacle hit-by-others-list))
|
|
(set! (-> v1-1 ignore-process0) this)
|
|
(set! (-> v1-1 ignore-process1) #f)
|
|
(set! (-> v1-1 ignore-pat)
|
|
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
|
|
)
|
|
(set! (-> v1-1 action-mask) (collide-action solid))
|
|
)
|
|
(let ((f0-1 (fill-and-probe-using-line-sphere *collide-cache* s5-0)))
|
|
(cond
|
|
((>= f0-1 0.0)
|
|
(* arg2 f0-1)
|
|
)
|
|
(else
|
|
(empty)
|
|
arg2
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for method 52 of type target-turret
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod target-turret-method-52 ((this target-turret))
|
|
(set-time! (-> this fire-time))
|
|
(when (-> this rider)
|
|
(if (= (handle->process (-> this rider)) *target*)
|
|
(cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1))
|
|
)
|
|
(send-event (handle->process (-> this rider)) 'fire)
|
|
)
|
|
(seek! (-> this heat-target) 1.05 0.075)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 10 of type target-turret
|
|
(defmethod deactivate ((this target-turret))
|
|
"Make a process dead, clean it up, remove it from the active pool, and return to dead pool."
|
|
(if (valid? (-> this hud) (the-as type #f) "" #t 0)
|
|
(send-event (handle->process (-> this hud)) 'hide-and-die)
|
|
)
|
|
(sound-stop (-> this sound-id 0))
|
|
(sound-stop (-> this sound-id 1))
|
|
(sound-stop (-> this sound-id 2))
|
|
((method-of-type process-drawable deactivate) this)
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 39 of type target-turret
|
|
(defmethod get-params ((this target-turret))
|
|
*target-turret-params*
|
|
)
|
|
|
|
;; definition for method 37 of type target-turret
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod init-fields! ((this target-turret))
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 38 of type target-turret
|
|
;; WARN: Return type mismatch object vs none.
|
|
(defmethod target-turret-method-38 ((this target-turret))
|
|
(go (method-of-object this idle))
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 11 of type target-turret
|
|
;; WARN: Return type mismatch none vs object.
|
|
(defmethod init-from-entity! ((this target-turret) (arg0 entity-actor))
|
|
"Set up a newly created process from the entity that created it."
|
|
(stack-size-set! (-> this main-thread) 512)
|
|
(target-turret-method-36 this)
|
|
(when arg0
|
|
(process-drawable-from-entity! this arg0)
|
|
(set-yaw-angle-clear-roll-pitch! (-> this root) (res-lump-float arg0 'rotoffset))
|
|
)
|
|
(init! this)
|
|
(set! (-> this params) (get-params this))
|
|
(set! (-> this shadow-backup) (-> this draw shadow))
|
|
(logclear! (-> this mask) (process-mask actor-pause))
|
|
(set! (-> this focus-status) (the-as focus-status (logior (focus-status turret) (-> this focus-status))))
|
|
(set! (-> this fact)
|
|
(new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc))
|
|
)
|
|
(set-zero! (-> this smush-control))
|
|
(set! (-> this hud) (the-as handle #f))
|
|
(set! (-> this sound-id 0) (new-sound-id))
|
|
(set! (-> this sound-id 1) (new-sound-id))
|
|
(set! (-> this sound-id 2) (new-sound-id))
|
|
(set! (-> this sound-playing 0) #f)
|
|
(set! (-> this sound-playing 1) #f)
|
|
(set! (-> this sound-playing 2) #f)
|
|
(set! (-> this shot-timeout) (seconds 0.667))
|
|
(set! (-> this health) (-> this params max-health))
|
|
(set! (-> this heat) 0.0)
|
|
(set! (-> this heat-target) 0.0)
|
|
(set! (-> this arrow-angle) 0.0)
|
|
(set! (-> this enable-controls) #f)
|
|
(set! (-> this rider) (the-as handle #f))
|
|
(set! (-> this rotx-min) (-> this params rotx-min))
|
|
(set! (-> this rotx-max) (-> this params rotx-max))
|
|
(set! (-> this roty-min) 0.0)
|
|
(set! (-> this roty-max) 0.0)
|
|
(set! (-> this fire-time-interval) (-> this params fire-interval))
|
|
(set! (-> this focus-ignore-timer) 0)
|
|
(target-turret-method-50 this)
|
|
(init-fields! this)
|
|
(target-turret-method-46 this (the-as quaternion #x3f800000))
|
|
(quaternion-copy! (-> this init-quat) (-> this root quat))
|
|
(target-turret-method-38 this)
|
|
)
|
|
|
|
;; definition for function target-turret-blend-mat
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defbehavior target-turret-blend-mat target ((arg0 cam-rotation-tracker) (arg1 matrix) (arg2 float))
|
|
(rlet ((acc :class vf)
|
|
(vf0 :class vf)
|
|
(vf4 :class vf)
|
|
(vf5 :class vf)
|
|
(vf6 :class vf)
|
|
(vf7 :class vf)
|
|
)
|
|
(init-vf0-vector)
|
|
(cond
|
|
((>= arg2 1.0)
|
|
(dotimes (s4-1 3)
|
|
(vector-normalize-copy! (the-as vector (&-> arg0 inv-mat quad s4-1)) (the-as vector (&-> arg1 quad s4-1)) 1.0)
|
|
(set! (-> arg0 inv-mat vector s4-1 w) 0.0)
|
|
)
|
|
)
|
|
(else
|
|
(dotimes (s3-0 3)
|
|
(set! arg2 (fmax 0.0 (fmin 1.0 arg2)))
|
|
(vector-normalize! (the-as vector (&-> arg0 inv-mat quad s3-0)) (- 1.0 arg2))
|
|
(let ((v1-15 (&-> arg0 inv-mat quad s3-0)))
|
|
(let ((a0-5 (&-> arg0 inv-mat quad s3-0)))
|
|
(let ((a1-5 (&-> arg1 quad s3-0)))
|
|
(let ((a2-2 arg2))
|
|
(.mov vf7 a2-2)
|
|
)
|
|
(.lvf vf5 (&-> a1-5 0))
|
|
)
|
|
(.lvf vf4 (&-> a0-5 0))
|
|
)
|
|
(.add.x.vf.w vf6 vf0 vf0)
|
|
(.mul.x.vf.xyz acc vf5 vf7)
|
|
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
|
(.svf (&-> v1-15 0) vf6)
|
|
)
|
|
(vector-normalize! (the-as vector (&-> arg0 inv-mat quad s3-0)) 1.0)
|
|
(set! (-> arg0 inv-mat vector s3-0 w) 0.0)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate cam-turret (camera-slave)
|
|
:event cam-standard-event-handler
|
|
:enter (behavior ()
|
|
(when (not (-> self enter-has-run))
|
|
(vector-copy! (-> self saved-pt) (-> self trans))
|
|
(set! (-> self blend-from-type) (camera-blend-from-type unknown-1))
|
|
(set! (-> self blend-to-type) (camera-blend-to-type unknown-0))
|
|
0
|
|
)
|
|
)
|
|
:trans (behavior ()
|
|
(if (not (logtest? (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET)))
|
|
(cam-slave-go cam-free-floating)
|
|
)
|
|
)
|
|
:code (behavior ()
|
|
(until #f
|
|
(when (not (paused?))
|
|
(let ((a0-1 (handle->process (-> *camera* focus handle))))
|
|
(when (and a0-1 (nonzero? (-> (the-as target a0-1) turret)))
|
|
(let ((gp-0 (handle->process (-> (the-as target a0-1) turret handle))))
|
|
(when gp-0
|
|
(let* ((s5-0 (-> (the-as target-turret gp-0) node-list data (-> (the-as target-turret gp-0) info camera-joint)))
|
|
(a0-8 (-> self tracking))
|
|
(s3-0 (-> s5-0 bone transform))
|
|
(s4-0 (new 'stack-no-clear 'vector))
|
|
)
|
|
(target-turret-blend-mat a0-8 s3-0 (* (-> *camera* settings unk-float0) (seconds-per-frame)))
|
|
(when (send-event gp-0 'camera-offset s4-0)
|
|
(vector<-cspace! (-> self trans) s5-0)
|
|
(vector-matrix*! s4-0 s4-0 s3-0)
|
|
(vector+! (-> self trans) (-> self trans) s4-0)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(suspend)
|
|
)
|
|
#f
|
|
)
|
|
)
|
|
|
|
;; definition for function target-turret-get-on-play
|
|
;; INFO: Used lq/sq
|
|
;; WARN: Return type mismatch symbol vs none.
|
|
(defbehavior target-turret-get-on-play target ()
|
|
(ja-channel-set! 1)
|
|
(ja-no-eval :group! jakb-turret-get-on-ja :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(if (< 34.0 (ja-aframe-num 0))
|
|
(logior! (-> self draw status) (draw-control-status no-draw))
|
|
(logclear! (-> self draw status) (draw-control-status no-draw))
|
|
)
|
|
(let ((f30-1 (sin (lerp-scale 0.0 16384.0 (ja-aframe-num 0) 0.0 20.0))))
|
|
(let ((f28-0 (lerp-scale 0.0 1.0 (ja-aframe-num 0) 0.0 20.0)))
|
|
(let ((a0-16 (as-type (handle->process (-> self turret handle)) process-drawable)))
|
|
(if a0-16
|
|
(vector-copy! (-> self alt-cam-pos) (-> (the-as process-drawable a0-16) root trans))
|
|
)
|
|
)
|
|
(vector-lerp!
|
|
(-> self control trans)
|
|
(-> self control unknown-vector37)
|
|
(-> self control unknown-vector38)
|
|
f30-1
|
|
)
|
|
(set! (-> self control trans y)
|
|
(lerp (-> self control unknown-vector37 y) (-> self control unknown-vector38 y) f28-0)
|
|
)
|
|
)
|
|
(quaternion-slerp!
|
|
(-> self control quat-for-control)
|
|
(-> self control unknown-quat39)
|
|
(-> self control unknown-quat40)
|
|
f30-1
|
|
)
|
|
)
|
|
(rot->dir-targ! (-> self control))
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
(none)
|
|
)
|
|
|
|
;; definition for function target-for-turret-get-on-play
|
|
;; INFO: Used lq/sq
|
|
;; WARN: Return type mismatch symbol vs none.
|
|
(defbehavior target-for-turret-get-on-play target ()
|
|
(ja-channel-push! 1 (seconds 0.2))
|
|
(let ((gp-1
|
|
(vector-! (new 'stack-no-clear 'vector) (-> self control unknown-vector38) (-> self control unknown-vector37))
|
|
)
|
|
)
|
|
(ja-no-eval :group! jakb-turret-for-get-on-ja :num! (seek! (ja-aframe 46.0 0)) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(let ((f30-0 (sin (lerp-scale 0.0 16384.0 (ja-aframe-num 0) 0.0 20.0))))
|
|
(let ((a0-12 (as-type (handle->process (-> self turret handle)) process-drawable)))
|
|
(if a0-12
|
|
(vector-copy! (-> self alt-cam-pos) (-> (the-as process-drawable a0-12) root trans))
|
|
)
|
|
)
|
|
(vector+float*! (-> self control trans) (-> self control unknown-vector37) gp-1 f30-0)
|
|
(quaternion-slerp!
|
|
(-> self control quat-for-control)
|
|
(-> self control unknown-quat39)
|
|
(-> self control unknown-quat40)
|
|
f30-0
|
|
)
|
|
)
|
|
(rot->dir-targ! (-> self control))
|
|
(suspend)
|
|
(ja :num! (seek! (ja-aframe 46.0 0)))
|
|
)
|
|
)
|
|
(none)
|
|
)
|
|
|
|
;; definition for function target-turret-get-off-play
|
|
;; INFO: Used lq/sq
|
|
;; WARN: Return type mismatch symbol vs none.
|
|
(defbehavior target-turret-get-off-play target ()
|
|
(ja-channel-push! 1 (seconds 0.1))
|
|
(ja-no-eval :group! jakb-turret-get-off-ja :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(if (< 4.0 (ja-aframe-num 0))
|
|
(logclear! (-> self draw status) (draw-control-status no-draw))
|
|
(logior! (-> self draw status) (draw-control-status no-draw))
|
|
)
|
|
(cond
|
|
((< (ja-aframe-num 0) 76.0)
|
|
(send-event (handle->process (-> self turret handle)) 'player-quat (-> self control dir-targ))
|
|
(set-quaternion! (-> self control) (-> self control dir-targ))
|
|
(quaternion-copy! (-> self control unknown-quat39) (-> self control quat-for-control))
|
|
(vector-copy! (-> self control unknown-vector37) (-> self control trans))
|
|
)
|
|
(else
|
|
(let ((f30-1 (sin (lerp-scale 0.0 16384.0 (ja-aframe-num 0) 76.0 95.0))))
|
|
(let ((f28-0 (lerp-scale 0.0 1.0 (ja-aframe-num 0) 76.0 95.0)))
|
|
(vector-lerp!
|
|
(-> self control trans)
|
|
(-> self control unknown-vector37)
|
|
(-> self control unknown-vector38)
|
|
f30-1
|
|
)
|
|
(set! (-> self control trans y)
|
|
(lerp (-> self control unknown-vector37 y) (-> self control unknown-vector38 y) f28-0)
|
|
)
|
|
)
|
|
(quaternion-slerp!
|
|
(-> self control quat-for-control)
|
|
(-> self control unknown-quat39)
|
|
(-> self control unknown-quat40)
|
|
f30-1
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(rot->dir-targ! (-> self control))
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
(none)
|
|
)
|
|
|
|
;; definition for function target-for-turret-get-off-play
|
|
;; INFO: Used lq/sq
|
|
;; WARN: Return type mismatch symbol vs none.
|
|
(defbehavior target-for-turret-get-off-play target ()
|
|
(ja-channel-push! 1 (seconds 0.1))
|
|
(ja-no-eval :group! jakb-turret-for-get-off-ja :num! (seek! max 1.2) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(send-event (handle->process (-> self turret handle)) 'player-pos (-> self turret trans))
|
|
(let ((a1-3 (new 'stack-no-clear 'event-message-block)))
|
|
(let ((v1-25 (process->ppointer self)))
|
|
(set! (-> a1-3 from) v1-25)
|
|
)
|
|
(set! (-> a1-3 num-params) 1)
|
|
(set! (-> a1-3 message) 'player-quat)
|
|
(set! (-> a1-3 param 0) (the-as uint (-> self control dir-targ)))
|
|
(send-event-function (handle->process (-> self turret handle)) a1-3)
|
|
)
|
|
(set-quaternion! (-> self control) (-> self control dir-targ))
|
|
(move-to-point! (-> self control) (-> self turret trans))
|
|
(suspend)
|
|
(ja :num! (seek! max 1.2))
|
|
)
|
|
(quaternion-copy! (-> self control unknown-quat39) (-> self control quat-for-control))
|
|
(vector-copy! (-> self control unknown-vector37) (-> self control trans))
|
|
(let ((gp-1
|
|
(vector-! (new 'stack-no-clear 'vector) (-> self control unknown-vector38) (-> self control unknown-vector37))
|
|
)
|
|
(f30-0 19.0)
|
|
)
|
|
(ja-no-eval :group! jakb-turret-for-get-on-ja
|
|
:num! (seek! (/ f30-0 (-> self skel root-channel 0 frame-group artist-step)) 1.2)
|
|
:frame-num 0.0
|
|
)
|
|
(until (ja-done? 0)
|
|
(let ((f0-11 (sin (lerp-scale 0.0 16384.0 (ja-aframe-num 0) 0.0 f30-0))))
|
|
(vector+float*! (-> self control trans) (-> self control unknown-vector37) gp-1 f0-11)
|
|
(quaternion-slerp!
|
|
(-> self control quat-for-control)
|
|
(-> self control unknown-quat39)
|
|
(-> self control unknown-quat40)
|
|
f0-11
|
|
)
|
|
)
|
|
(suspend)
|
|
(ja :num! (seek! (/ f30-0 (-> self skel root-channel 0 frame-group artist-step)) 1.2))
|
|
)
|
|
)
|
|
(none)
|
|
)
|
|
|
|
;; definition for function target-turret-exit-turret?
|
|
(defbehavior target-turret-exit-turret? target ()
|
|
(and (or (not (-> self control unknown-handle02))
|
|
(and (cpad-pressed? (-> self control cpad number) triangle) (-> *setting-control* user-current pilot-exit))
|
|
)
|
|
(let ((a1-0 (new 'stack-no-clear 'event-message-block)))
|
|
(set! (-> a1-0 from) (process->ppointer self))
|
|
(set! (-> a1-0 num-params) 1)
|
|
(set! (-> a1-0 message) 'exit-valid)
|
|
(set! (-> a1-0 param 0) (the-as uint (-> self control unknown-vector38)))
|
|
(and (send-event-function (handle->process (-> self turret handle)) a1-0)
|
|
(let ((v0-0 (the-as object #t)))
|
|
(set! (-> self turret exit?) (the-as symbol v0-0))
|
|
v0-0
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for function target-turret-stance-play
|
|
;; WARN: Return type mismatch symbol vs none.
|
|
(defbehavior target-turret-stance-play target ()
|
|
(ja-channel-set! 1)
|
|
(ja :group! jakb-turret-stance-ja)
|
|
(until (target-turret-exit-turret?)
|
|
(suspend)
|
|
(can-play-stance-amibent?)
|
|
)
|
|
(none)
|
|
)
|
|
|
|
;; definition for function target-for-turret-stance-play
|
|
;; WARN: Return type mismatch symbol vs none.
|
|
(defbehavior target-for-turret-stance-play target ()
|
|
(ja-channel-push! 3 (seconds 0.1))
|
|
(ja-no-eval :group! jakb-turret-for-stance-ja :num! zero)
|
|
(let ((a0-2 (-> self skel root-channel 1)))
|
|
(let ((f0-1 0.0))
|
|
(set! (-> a0-2 frame-interp 1) f0-1)
|
|
(set! (-> a0-2 frame-interp 0) f0-1)
|
|
)
|
|
(set! (-> a0-2 frame-group) (the-as art-joint-anim jakb-turret-for-stance-right-ja))
|
|
(set! (-> a0-2 frame-num) 0.0)
|
|
(joint-control-channel-group! a0-2 (the-as art-joint-anim jakb-turret-for-stance-right-ja) num-func-identity)
|
|
)
|
|
(let ((a0-3 (-> self skel root-channel 2)))
|
|
(let ((f0-3 1.0))
|
|
(set! (-> a0-3 frame-interp 1) f0-3)
|
|
(set! (-> a0-3 frame-interp 0) f0-3)
|
|
)
|
|
(set! (-> a0-3 frame-group) (the-as art-joint-anim jakb-turret-for-stance-left-ja))
|
|
(set! (-> a0-3 frame-num) 0.0)
|
|
(joint-control-channel-group! a0-3 (the-as art-joint-anim jakb-turret-for-stance-left-ja) num-func-identity)
|
|
)
|
|
(until (target-turret-exit-turret?)
|
|
(let ((a1-4 (new 'stack-no-clear 'event-message-block)))
|
|
(set! (-> a1-4 from) (process->ppointer self))
|
|
(set! (-> a1-4 num-params) 0)
|
|
(set! (-> a1-4 message) 'sideways)
|
|
(let* ((t9-4 send-event-function)
|
|
(a0-5 (handle->process (-> self turret handle)))
|
|
(f30-0 (the-as float (t9-4 a0-5 a1-4)))
|
|
)
|
|
(let ((a0-8 (-> self skel root-channel 1)))
|
|
(let ((f0-6 (fmax 0.0 (- f30-0))))
|
|
(set! (-> a0-8 frame-interp 1) f0-6)
|
|
(set! (-> a0-8 frame-interp 0) f0-6)
|
|
)
|
|
(set! (-> a0-8 param 0) 0.0)
|
|
(set! (-> a0-8 frame-num) (-> self skel root-channel 0 frame-num))
|
|
(joint-control-channel-group! a0-8 (the-as art-joint-anim #f) num-func-chan)
|
|
)
|
|
(let ((a0-9 (-> self skel root-channel 2)))
|
|
(let ((f0-10 (fmax 0.0 f30-0)))
|
|
(set! (-> a0-9 frame-interp 1) f0-10)
|
|
(set! (-> a0-9 frame-interp 0) f0-10)
|
|
)
|
|
(set! (-> a0-9 param 0) 0.0)
|
|
(set! (-> a0-9 frame-num) (-> self skel root-channel 0 frame-num))
|
|
(joint-control-channel-group! a0-9 (the-as art-joint-anim #f) num-func-chan)
|
|
)
|
|
)
|
|
)
|
|
(ja :num! (loop! 0.5))
|
|
(can-play-stance-amibent?)
|
|
(suspend)
|
|
)
|
|
(none)
|
|
)
|
|
|
|
;; definition for function target-turret-stance-fire-play
|
|
;; WARN: Return type mismatch symbol vs none.
|
|
(defbehavior target-turret-stance-fire-play target ()
|
|
(local-vars (v1-3 object))
|
|
(ja-channel-set! 1)
|
|
(ja :group! jakb-turret-stance-ja)
|
|
(until v1-3
|
|
(suspend)
|
|
(can-play-stance-amibent?)
|
|
(set! v1-3 (or (ja-done? 0) (target-turret-exit-turret?)))
|
|
)
|
|
(none)
|
|
)
|
|
|
|
;; definition for function target-for-turret-stance-fire-play
|
|
;; WARN: Return type mismatch symbol vs none.
|
|
(defbehavior target-for-turret-stance-fire-play target ()
|
|
(local-vars (v1-11 object))
|
|
(ja-channel-push! 1 (seconds 0.2))
|
|
(ja :group! jakb-turret-for-fire-ja)
|
|
(until v1-11
|
|
(suspend)
|
|
(can-play-stance-amibent?)
|
|
(ja :num! (seek!))
|
|
(set! v1-11 (or (ja-done? 0) (target-turret-exit-turret?)))
|
|
)
|
|
(none)
|
|
)
|
|
|
|
;; definition for function target-turret-stance-end
|
|
;; WARN: Return type mismatch symbol vs none.
|
|
(defbehavior target-turret-stance-end target ()
|
|
(local-vars
|
|
(a0-4 process)
|
|
(a1-3 event-message-block)
|
|
(t9-3 (function process-tree event-message-block object))
|
|
)
|
|
(ja-channel-push! 1 (seconds 0.1))
|
|
(ja-no-eval :group! jakb-turret-stance-ja :num! (loop!) :frame-num 0.0)
|
|
(until (t9-3 a0-4 a1-3)
|
|
(suspend)
|
|
(ja :num! (loop!))
|
|
(set! a1-3 (new 'stack-no-clear 'event-message-block))
|
|
(set! (-> a1-3 from) (process->ppointer self))
|
|
(set! (-> a1-3 num-params) 0)
|
|
(set! (-> a1-3 message) 'exit)
|
|
(set! t9-3 send-event-function)
|
|
(set! a0-4 (handle->process (-> self turret handle)))
|
|
)
|
|
(none)
|
|
)
|
|
|
|
;; definition for function target-for-turret-stance-end
|
|
;; WARN: Return type mismatch symbol vs none.
|
|
(defbehavior target-for-turret-stance-end target ()
|
|
(local-vars
|
|
(a0-4 process)
|
|
(a1-3 event-message-block)
|
|
(t9-3 (function process-tree event-message-block object))
|
|
)
|
|
(ja-channel-push! 1 (seconds 0.1))
|
|
(ja-no-eval :group! jakb-turret-for-stance-ja :num! (loop!) :frame-num 0.0)
|
|
(until (t9-3 a0-4 a1-3)
|
|
(suspend)
|
|
(ja :num! (loop!))
|
|
(set! a1-3 (new 'stack-no-clear 'event-message-block))
|
|
(set! (-> a1-3 from) (process->ppointer self))
|
|
(set! (-> a1-3 num-params) 0)
|
|
(set! (-> a1-3 message) 'exit)
|
|
(set! t9-3 send-event-function)
|
|
(set! a0-4 (handle->process (-> self turret handle)))
|
|
)
|
|
(none)
|
|
)
|
|
|
|
;; definition for function target-turret-post
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defbehavior target-turret-post target ()
|
|
(send-event (handle->process (-> self turret handle)) 'player-pos (-> self turret trans))
|
|
(send-event (handle->process (-> self turret handle)) 'player-quat (-> self control dir-targ))
|
|
(set-quaternion! (-> self control) (-> self control dir-targ))
|
|
(move-to-point! (-> self control) (-> self turret trans))
|
|
(update-transforms (-> self control))
|
|
(target-no-move-post)
|
|
(cond
|
|
((cpad-pressed? (-> self control cpad number) r1)
|
|
(send-event (handle->process (-> self turret handle)) 'fire-pressed)
|
|
)
|
|
((cpad-hold? (-> self control cpad number) r1)
|
|
(send-event (handle->process (-> self turret handle)) 'fire-down)
|
|
)
|
|
((let ((a0-26 (-> *cpad-list* cpads (-> self control cpad number))))
|
|
(logtest? (logclear (pad-buttons r1) (-> a0-26 button0-abs 0)) (-> a0-26 button0-abs 1))
|
|
)
|
|
(send-event (handle->process (-> self turret handle)) 'fire-up)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for function target-turret-stance-handler
|
|
;; INFO: Used lq/sq
|
|
(defbehavior target-turret-stance-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
|
(cond
|
|
((and (= arg2 'query) (= (-> arg3 param 0) 'mode))
|
|
'turret
|
|
)
|
|
(else
|
|
(case arg2
|
|
(('change-mode)
|
|
(case (-> arg3 param 0)
|
|
(('grab)
|
|
(when (not (focus-test? self dead))
|
|
(if (-> arg3 param 1)
|
|
(set! (-> self turret grabbed?) #t)
|
|
)
|
|
#t
|
|
)
|
|
)
|
|
(('pilot)
|
|
(target-exit)
|
|
(logclear! (-> self target-flags) (target-flags tf6))
|
|
(target-standard-event-handler arg0 arg1 arg2 arg3)
|
|
)
|
|
)
|
|
)
|
|
(('end-mode)
|
|
(case (-> arg3 param 0)
|
|
(('grab)
|
|
(when (-> self turret grabbed?)
|
|
(set! (-> self turret grabbed?) #f)
|
|
#t
|
|
)
|
|
)
|
|
(('turret)
|
|
(when (-> self control unknown-handle02)
|
|
(set! (-> self control unknown-handle02) (the-as handle #f))
|
|
#t
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(('get-turret)
|
|
(-> self turret handle)
|
|
)
|
|
(('attack 'attack-invinc)
|
|
(let ((gp-1
|
|
(the-as object (mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer (-> arg3 param 1)) 168))
|
|
)
|
|
)
|
|
((method-of-type attack-info compute-intersect-info)
|
|
(the-as attack-info gp-1)
|
|
(-> arg3 param 1)
|
|
self
|
|
(as-type arg0 process-drawable)
|
|
(the-as touching-shapes-entry (-> arg3 param 0))
|
|
)
|
|
(case (-> (the-as attack-info gp-1) mode)
|
|
(('turret)
|
|
(let ((a0-22 (-> self attack-info)))
|
|
(let ((v1-24 a0-22))
|
|
(set! (-> v1-24 attacker) (the-as handle #f))
|
|
(set! (-> v1-24 mode) 'generic)
|
|
(set! (-> v1-24 shove-back) 6144.0)
|
|
(set! (-> v1-24 shove-up) 4915.2)
|
|
(set! (-> v1-24 angle) #f)
|
|
(set! (-> v1-24 trans quad) (-> self control trans quad))
|
|
(set! (-> v1-24 control) 0.0)
|
|
(set! (-> v1-24 invinc-time) (-> *TARGET-bank* hit-invulnerable-timeout))
|
|
(set! (-> v1-24 damage) (-> *FACT-bank* health-default-inc))
|
|
)
|
|
(combine! a0-22 (the-as attack-info gp-1) self)
|
|
)
|
|
(cond
|
|
((= (-> self game mode) 'play)
|
|
(send-event (handle->process (-> self turret handle)) 'player-pos (-> self control trans))
|
|
(go target-death 'turret)
|
|
#t
|
|
)
|
|
(else
|
|
(go target-turret-get-off)
|
|
#f
|
|
)
|
|
)
|
|
)
|
|
(('bot)
|
|
(let ((a0-32 (-> self attack-info)))
|
|
(let ((v1-40 a0-32))
|
|
(set! (-> v1-40 attacker) (the-as handle #f))
|
|
(set! (-> v1-40 mode) 'generic)
|
|
(set! (-> v1-40 shove-back) 6144.0)
|
|
(set! (-> v1-40 shove-up) 4915.2)
|
|
(set! (-> v1-40 angle) #f)
|
|
(set! (-> v1-40 trans quad) (-> self control trans quad))
|
|
(set! (-> v1-40 control) 0.0)
|
|
(set! (-> v1-40 invinc-time) (-> *TARGET-bank* hit-invulnerable-timeout))
|
|
(set! (-> v1-40 damage) (-> *FACT-bank* health-default-inc))
|
|
)
|
|
(combine! a0-32 (the-as attack-info gp-1) self)
|
|
)
|
|
(go target-death 'bot)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(else
|
|
(target-generic-event-handler arg0 arg1 arg2 arg3)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate target-turret-stance (target)
|
|
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
|
(case message
|
|
(('fire)
|
|
(go target-turret-stance-fire)
|
|
)
|
|
(else
|
|
(target-turret-stance-handler proc argc message block)
|
|
)
|
|
)
|
|
)
|
|
:exit (behavior ()
|
|
(when (not (and (-> self next-state) (let ((v1-3 (-> self next-state name)))
|
|
(or (= v1-3 'target-turret-stance) (= v1-3 'target-turret-stance-fire))
|
|
)
|
|
)
|
|
)
|
|
(send-event self 'end-mode 'turret)
|
|
(target-exit)
|
|
(logclear! (-> self target-flags) (target-flags tf2 tf5))
|
|
(logclear! (-> self focus-status) (focus-status disable grabbed))
|
|
(logclear! (-> self control status) (collide-status on-surface))
|
|
(set! (-> self turret grabbed?) #f)
|
|
(let ((v1-17 (-> self turret turret)))
|
|
(if v1-17
|
|
(deactivate (-> v1-17 0))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
:code (behavior ((arg0 handle))
|
|
(when (and (-> self control unknown-handle02) (not (-> self turret exit?)))
|
|
(case (-> self turret turret-type)
|
|
(('turret)
|
|
(target-turret-stance-play)
|
|
)
|
|
(('for-turret)
|
|
(target-for-turret-stance-play)
|
|
)
|
|
(('hellcat)
|
|
(ja-channel-set! 0)
|
|
(until (target-turret-exit-turret?)
|
|
(suspend)
|
|
)
|
|
)
|
|
(('scorpion)
|
|
(ja-channel-set! 0)
|
|
(until (target-turret-exit-turret?)
|
|
(suspend)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(case (-> self turret turret-type)
|
|
(('turret 'scorpion)
|
|
(target-turret-stance-end)
|
|
)
|
|
(('for-turret)
|
|
(target-for-turret-stance-end)
|
|
)
|
|
)
|
|
(go target-turret-get-off)
|
|
)
|
|
:post target-turret-post
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate target-turret-stance-fire (target)
|
|
:event target-turret-stance-handler
|
|
:exit (-> target-turret-stance exit)
|
|
:code (behavior ()
|
|
(local-vars (a0-1 object))
|
|
(let ((v1-1 (-> self turret turret-type)))
|
|
(b! (!= v1-1 'turret) cfg-2 :delay (set! a0-1 #f))
|
|
(target-turret-stance-fire-play)
|
|
(b! #t cfg-8 :delay (nop!))
|
|
(label cfg-2)
|
|
(b! (!= v1-1 'for-turret) cfg-4 :delay (set! a0-1 #f))
|
|
(target-for-turret-stance-fire-play)
|
|
(b! #t cfg-8 :delay (nop!))
|
|
(label cfg-4)
|
|
(set! a0-1 'scorpion)
|
|
(when (= v1-1 (the-as symbol a0-1))
|
|
(let ((t9-2 ja-channel-set!))
|
|
(set! a0-1 0)
|
|
(t9-2 (the-as int a0-1))
|
|
)
|
|
(until (target-turret-exit-turret?)
|
|
(suspend)
|
|
)
|
|
)
|
|
)
|
|
(label cfg-8)
|
|
(go target-turret-stance (the-as handle a0-1))
|
|
)
|
|
:post target-turret-post
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(let ((a0-74 (copy *empty-mods* 'loading-level)))
|
|
(set! (-> a0-74 flags) (surface-flag gun-off gun-fast-exit))
|
|
(set! *turret-get-on-mods* a0-74)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate target-turret-get-on (target)
|
|
:event target-generic-event-handler
|
|
:exit (behavior ()
|
|
(logclear! (-> self target-flags) (target-flags tf6))
|
|
)
|
|
:code (behavior ((arg0 handle))
|
|
(when (zero? (-> self turret))
|
|
(set! (-> self turret) (new 'process 'turret-info))
|
|
(set! (-> self turret process) (process->ppointer self))
|
|
)
|
|
(set! (-> self turret turret-type) (the-as type (send-event (handle->process arg0) 'turret-type)))
|
|
(set! (-> self turret handle) arg0)
|
|
(set! (-> self turret grabbed?) #f)
|
|
(set! (-> self turret exit?) #f)
|
|
(set! (-> self control mod-surface) *turret-get-on-mods*)
|
|
(set! (-> self neck flex-blend) 0.0)
|
|
(logior! (-> self target-flags) (target-flags tf2 tf5 lleg-still rleg-still lleg-no-ik rleg-no-ik))
|
|
(logior! (-> self focus-status) (focus-status disable grabbed))
|
|
(vector-copy! (-> self control unknown-vector37) (-> self control trans))
|
|
(set! (-> self control unknown-quat39 quad) (-> self control quat quad))
|
|
(send-event (handle->process arg0) 'player-pos (-> self control unknown-vector38))
|
|
(send-event (handle->process arg0) 'player-quat (-> self control unknown-quat40))
|
|
(vector-copy! (-> self alt-cam-pos) (-> self control camera-pos))
|
|
(sound-play "jump" :vol 70)
|
|
(case (-> self turret turret-type)
|
|
(('turret)
|
|
(target-turret-get-on-play)
|
|
)
|
|
(('for-turret)
|
|
(target-for-turret-get-on-play)
|
|
)
|
|
(('scorpion)
|
|
(ja-channel-set! 1)
|
|
(ja-no-eval :group! jakb-turret-get-on-ja
|
|
:num! (identity (the float (+ (-> (the-as art-joint-anim jakb-turret-get-on-ja) frames num-frames) -1)))
|
|
)
|
|
(suspend)
|
|
0
|
|
)
|
|
)
|
|
(send-event (handle->process arg0) 'change-mode)
|
|
(vector-copy! (-> self turret trans) (-> self control trans))
|
|
(set! (-> self turret turret) (the-as (pointer process) #f))
|
|
(set! (-> self neck flex-blend) 0.0)
|
|
(set! (-> self control mod-surface) *empty-mods*)
|
|
(set! (-> self control unknown-handle02) (-> self turret handle))
|
|
(go target-turret-stance arg0)
|
|
)
|
|
:post target-no-move-post
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate target-turret-get-off (target)
|
|
:event target-generic-event-handler
|
|
:exit (behavior ()
|
|
(target-exit)
|
|
(logclear! (-> self target-flags) (target-flags tf6))
|
|
)
|
|
:code (behavior ()
|
|
(logclear! (-> self focus-status) (focus-status disable grabbed))
|
|
(logior! (-> self target-flags) (target-flags lleg-still rleg-still lleg-no-ik rleg-no-ik))
|
|
(set! (-> self control mod-surface) *empty-mods*)
|
|
(rot->dir-targ! (-> self control))
|
|
(set! (-> self neck flex-blend) 0.0)
|
|
(send-event (handle->process (-> self turret handle)) 'player-pos (-> self turret trans))
|
|
(set! (-> self control unknown-quat40 quad) (-> self control quat quad))
|
|
(case (-> self turret turret-type)
|
|
(('turret 'scorpion)
|
|
(target-turret-get-off-play)
|
|
)
|
|
(('for-turret)
|
|
(target-for-turret-get-off-play)
|
|
)
|
|
(else
|
|
(vector-copy! (-> self control trans) (-> self control unknown-vector38))
|
|
(quaternion-copy! (-> self control quat-for-control) (-> self control unknown-quat40))
|
|
(rot->dir-targ! (-> self control))
|
|
(logior! (-> self skel status) (joint-control-status sync-math))
|
|
)
|
|
)
|
|
(rot->dir-targ! (-> self control))
|
|
(ja-post)
|
|
(let ((gp-0 (new 'stack-no-clear 'vector)))
|
|
(when (!= (-> self turret turret-type) 'hellcat)
|
|
(vector<-cspace! gp-0 (joint-node jakb-lod0-jg main))
|
|
(+! (-> gp-0 y) -9011.2)
|
|
(move-to-point! (-> self control) gp-0)
|
|
)
|
|
)
|
|
(send-event *camera* 'ease-in)
|
|
(ja-channel-set! 0)
|
|
(logclear! (-> self control status) (collide-status on-surface on-ground touch-surface))
|
|
(let ((v1-44 (new-stack-vector0)))
|
|
(let ((f0-4 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))))
|
|
0.0
|
|
(vector-! v1-44 (-> self control transv) (vector-float*! v1-44 (-> self control dynam gravity-normal) f0-4))
|
|
)
|
|
(let* ((f0-5 (vector-length v1-44))
|
|
(f1-2 f0-5)
|
|
(f2-0 -49152.0)
|
|
(a0-47 (vector+!
|
|
(-> self control transv)
|
|
(vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-0)
|
|
(vector-float*! v1-44 v1-44 (/ f0-5 f1-2))
|
|
)
|
|
)
|
|
)
|
|
(go target-falling a0-47)
|
|
)
|
|
)
|
|
)
|
|
:post (behavior ()
|
|
(target-no-move-post)
|
|
)
|
|
)
|