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

(import "goal_src/jak1/import/balloon-ag.gc")

;; definition of type racer-info
(deftype racer-info (basic)
  ((entity              entity-actor          :offset-assert   4)
   (bike-trans          vector        :inline :offset-assert  16)
   (bike-quat           vector        :inline :offset-assert  32)
   (bike-scale          vector        :inline :offset-assert  48)
   (mod-x               float                 :offset-assert  64)
   (rot                 vector        :inline :offset-assert  80)
   (rot-old             vector        :inline :offset-assert  96)
   (rotv                vector        :inline :offset-assert 112)
   (lean-rotx           degrees               :offset-assert 128)
   (change-roty         degrees               :offset-assert 132)
   (change-roty-old     degrees               :offset-assert 136)
   (quat                vector        :inline :offset-assert 144)
   (surface-y           meters                :offset-assert 160)
   (surface-vy          meters                :offset-assert 164)
   (surface-quat        vector        :inline :offset-assert 176)
   (surface-quat-smooth vector        :inline :offset-assert 192)
   (cushion-base        meters                :offset-assert 208)
   (cushion-offset      meters                :offset-assert 212)
   (cushion-bob         meters                :offset-assert 216)
   (cushion-bob-old     meters                :offset-assert 220)
   (cushion-smush       smush-control :inline :offset-assert 224)
   (shock-offset        meters                :offset-assert 256)
   (shock-offsetv       meters                :offset-assert 260)
   (shock-rotx          meters                :offset-assert 264)
   (hill-value          float                 :offset-assert 268)
   (hill-ground-value   float                 :offset-assert 272)
   (hill-offset         meters                :offset-assert 276)
   (hill-rotx           degrees               :offset-assert 280)
   (hill-boost          meters                :offset-assert 284)
   (bob-timer           float                 :offset-assert 288)
   (bob-meta-timer      float                 :offset-assert 292)
   (bob-meta-meta-timer float                 :offset-assert 296)
   (bob-mult-rot        float                 :offset-assert 300)
   (bob-mult-trans      float                 :offset-assert 304)
   (bob-period          float                 :offset-assert 308)
   (bob-meta-time       time-frame            :offset-assert 312)
   (bob-hit-ground-time time-frame            :offset-assert 320)
   (cur-rotx            degrees               :offset-assert 328)
   (targ-rotx           degrees               :offset-assert 332)
   (speed-rotx          float                 :offset-assert 336)
   (mult-rotx           degrees               :offset-assert 340)
   (front-blade         joint-mod             :offset-assert 344)
   (front-rot           degrees               :offset-assert 348)
   (front-rotv          degrees               :offset-assert 352)
   (bottom-blade        joint-mod             :offset-assert 356)
   (bottom-rot          degrees               :offset-assert 360)
   (front               joint-mod             :offset-assert 364)
   (front-turn          degrees               :offset-assert 368)
   (tail                joint-mod             :offset-assert 372)
   (tail-tilt           degrees               :offset-assert 376)
   (transv-max          meters                :offset-assert 380)
   (slide-down-time     time-frame    2       :offset-assert 384)
   (slide-enter-time    time-frame            :offset-assert 400)
   (slide-mode          int32                 :offset-assert 408)
   (slide-amp           float                 :offset-assert 412)
   (slide-grip-mult     float                 :offset-assert 416)
   (slide-shift-x       float                 :offset-assert 420)
   (slide-interp        float                 :offset-assert 424)
   (heat                float                 :offset-assert 428)
   (boost-time          time-frame            :offset-assert 432)
   (boost-duration      time-frame            :offset-assert 440)
   (boost-curve         float                 :offset-assert 448)
   (boost-level         float                 :offset-assert 452)
   (boost-target        float                 :offset-assert 456)
   (boost-output        float                 :offset-assert 460)
   (hop?                symbol                :offset-assert 464)
   (hop-start-y         float                 :offset-assert 468)
   (bounce              int32                 :offset-assert 472)
   (bounce-hit          float                 :offset-assert 476)
   (engine-sound-id     sound-id              :offset-assert 480)
   (boost-sound-id      sound-id              :offset-assert 484)
   (engine-sound-pitch  float                 :offset-assert 488)
   (turn-anim-targ      float                 :offset-assert 492)
   (turn-anim-frame     float                 :offset-assert 496)
   (turn-anim-vel       float                 :offset-assert 500)
   (tail-anim-vel       float                 :offset-assert 504)
   (tail-anim-frame     float                 :offset-assert 508)
   (rudd-anim-vel       float                 :offset-assert 512)
   (rudd-anim-frame     float                 :offset-assert 516)
   (racing-time         time-frame            :offset-assert 520)
   (stick-lock          symbol                :offset-assert 528)
   (stick-off           symbol                :offset-assert 532)
   (heavy               symbol                :offset-assert 536)
   (unstuck-time        time-frame            :offset-assert 544)
   (stuck-count         int32                 :offset-assert 552)
   (scrape-sound-id     sound-id              :offset-assert 556)
   (heat-sound-time     time-frame            :offset-assert 560)
   )
  :method-count-assert 9
  :size-assert         #x238
  :flag-assert         #x900000238
  )

;; definition for method 3 of type racer-info
(defmethod inspect racer-info ((obj racer-info))
  (format #t "[~8x] ~A~%" obj (-> obj type))
  (format #t "~Tentity: ~A~%" (-> obj entity))
  (format #t "~Tbike-trans: ~`vector`P~%" (-> obj bike-trans))
  (format #t "~Tbike-quat: ~`vector`P~%" (-> obj bike-quat))
  (format #t "~Tbike-scale: ~`vector`P~%" (-> obj bike-scale))
  (format #t "~Tmod-x: ~f~%" (-> obj mod-x))
  (format #t "~Trot: ~`vector`P~%" (-> obj rot))
  (format #t "~Trot-old: ~`vector`P~%" (-> obj rot-old))
  (format #t "~Trotv: ~`vector`P~%" (-> obj rotv))
  (format #t "~Tlean-rotx: (deg ~r)~%" (-> obj lean-rotx))
  (format #t "~Tchange-roty: (deg ~r)~%" (-> obj change-roty))
  (format #t "~Tchange-roty-old: (deg ~r)~%" (-> obj change-roty-old))
  (format #t "~Tquat: ~`vector`P~%" (-> obj quat))
  (format #t "~Tsurface-y: (meters ~m)~%" (-> obj surface-y))
  (format #t "~Tsurface-vy: (meters ~m)~%" (-> obj surface-vy))
  (format #t "~Tsurface-quat: ~`vector`P~%" (-> obj surface-quat))
  (format #t "~Tsurface-quat-smooth: ~`vector`P~%" (-> obj surface-quat-smooth))
  (format #t "~Tcushion-base: (meters ~m)~%" (-> obj cushion-base))
  (format #t "~Tcushion-offset: (meters ~m)~%" (-> obj cushion-offset))
  (format #t "~Tcushion-bob: (meters ~m)~%" (-> obj cushion-bob))
  (format #t "~Tcushion-bob-old: (meters ~m)~%" (-> obj cushion-bob-old))
  (format #t "~Tcushion-smush: #<smush-control @ #x~X>~%" (-> obj cushion-smush))
  (format #t "~Tshock-offset: (meters ~m)~%" (-> obj shock-offset))
  (format #t "~Tshock-offsetv: (meters ~m)~%" (-> obj shock-offsetv))
  (format #t "~Tshock-rotx: (meters ~m)~%" (-> obj shock-rotx))
  (format #t "~Thill-value: ~f~%" (-> obj hill-value))
  (format #t "~Thill-ground-value: ~f~%" (-> obj hill-ground-value))
  (format #t "~Thill-offset: (meters ~m)~%" (-> obj hill-offset))
  (format #t "~Thill-rotx: (deg ~r)~%" (-> obj hill-rotx))
  (format #t "~Thill-boost: (meters ~m)~%" (-> obj hill-boost))
  (format #t "~Tbob-timer: ~f~%" (-> obj bob-timer))
  (format #t "~Tbob-meta-timer: ~f~%" (-> obj bob-meta-timer))
  (format #t "~Tbob-meta-meta-timer: ~f~%" (-> obj bob-meta-meta-timer))
  (format #t "~Tbob-mult-rot: ~f~%" (-> obj bob-mult-rot))
  (format #t "~Tbob-mult-trans: ~f~%" (-> obj bob-mult-trans))
  (format #t "~Tbob-period: ~f~%" (-> obj bob-period))
  (format #t "~Tbob-meta-time: ~D~%" (-> obj bob-meta-time))
  (format #t "~Tbob-hit-ground-time: ~D~%" (-> obj bob-hit-ground-time))
  (format #t "~Tcur-rotx: (deg ~r)~%" (-> obj cur-rotx))
  (format #t "~Ttarg-rotx: (deg ~r)~%" (-> obj targ-rotx))
  (format #t "~Tspeed-rotx: ~f~%" (-> obj speed-rotx))
  (format #t "~Tmult-rotx: (deg ~r)~%" (-> obj mult-rotx))
  (format #t "~Tfront-blade: ~A~%" (-> obj front-blade))
  (format #t "~Tfront-rot: (deg ~r)~%" (-> obj front-rot))
  (format #t "~Tfront-rotv: (deg ~r)~%" (-> obj front-rotv))
  (format #t "~Tbottom-blade: ~A~%" (-> obj bottom-blade))
  (format #t "~Tbottom-rot: (deg ~r)~%" (-> obj bottom-rot))
  (format #t "~Tfront: ~A~%" (-> obj front))
  (format #t "~Tfront-turn: (deg ~r)~%" (-> obj front-turn))
  (format #t "~Ttail: ~A~%" (-> obj tail))
  (format #t "~Ttail-tilt: (deg ~r)~%" (-> obj tail-tilt))
  (format #t "~Ttransv-max: (meters ~m)~%" (-> obj transv-max))
  (format #t "~Tslide-down-time[2] @ #x~X~%" (-> obj slide-down-time))
  (format #t "~Tslide-enter-time: ~D~%" (-> obj slide-enter-time))
  (format #t "~Tslide-mode: ~D~%" (-> obj slide-mode))
  (format #t "~Tslide-amp: ~f~%" (-> obj slide-amp))
  (format #t "~Tslide-grip-mult: ~f~%" (-> obj slide-grip-mult))
  (format #t "~Tslide-shift-x: ~f~%" (-> obj slide-shift-x))
  (format #t "~Tslide-interp: ~f~%" (-> obj slide-interp))
  (format #t "~Theat: ~f~%" (-> obj heat))
  (format #t "~Tboost-time: ~D~%" (-> obj boost-time))
  (format #t "~Tboost-duration: ~D~%" (-> obj boost-duration))
  (format #t "~Tboost-curve: ~f~%" (-> obj boost-curve))
  (format #t "~Tboost-level: ~f~%" (-> obj boost-level))
  (format #t "~Tboost-target: ~f~%" (-> obj boost-target))
  (format #t "~Tboost-output: ~f~%" (-> obj boost-output))
  (format #t "~Thop?: ~A~%" (-> obj hop?))
  (format #t "~Thop-start-y: ~f~%" (-> obj hop-start-y))
  (format #t "~Tbounce: ~D~%" (-> obj bounce))
  (format #t "~Tbounce-hit: ~f~%" (-> obj bounce-hit))
  (format #t "~Tengine-sound-id: ~D~%" (-> obj engine-sound-id))
  (format #t "~Tboost-sound-id: ~D~%" (-> obj boost-sound-id))
  (format #t "~Tengine-sound-pitch: ~f~%" (-> obj engine-sound-pitch))
  (format #t "~Tturn-anim-targ: ~f~%" (-> obj turn-anim-targ))
  (format #t "~Tturn-anim-frame: ~f~%" (-> obj turn-anim-frame))
  (format #t "~Tturn-anim-vel: ~f~%" (-> obj turn-anim-vel))
  (format #t "~Ttail-anim-vel: ~f~%" (-> obj tail-anim-vel))
  (format #t "~Ttail-anim-frame: ~f~%" (-> obj tail-anim-frame))
  (format #t "~Trudd-anim-vel: ~f~%" (-> obj rudd-anim-vel))
  (format #t "~Trudd-anim-frame: ~f~%" (-> obj rudd-anim-frame))
  (format #t "~Tracing-time: ~D~%" (-> obj racing-time))
  (format #t "~Tstick-lock: ~A~%" (-> obj stick-lock))
  (format #t "~Tstick-off: ~A~%" (-> obj stick-off))
  (format #t "~Theavy: ~A~%" (-> obj heavy))
  (format #t "~Tunstuck-time: ~D~%" (-> obj unstuck-time))
  (format #t "~Tstuck-count: ~D~%" (-> obj stuck-count))
  (format #t "~Tscrape-sound-id: ~D~%" (-> obj scrape-sound-id))
  (format #t "~Theat-sound-time: ~D~%" (-> obj heat-sound-time))
  obj
  )

;; definition of type racer-bank
(deftype racer-bank (basic)
  ((slide-hold-time            seconds  :offset-assert   8)
   (heat-max                   float    :offset-assert  16)
   (hotcoals-heat-inc          float    :offset-assert  20)
   (lava-heat-inc              float    :offset-assert  24)
   (lava-air-heat-inc          float    :offset-assert  28)
   (surface-heat-inc           float    :offset-assert  32)
   (jump-heat-inc              float    :offset-assert  36)
   (lavatube-hotcoals-heat-inc float    :offset-assert  40)
   (lavatube-lava-heat-inc     float    :offset-assert  44)
   (lavatube-lava-air-heat-inc float    :offset-assert  48)
   (lavatube-surface-heat-inc  float    :offset-assert  52)
   (lavatube-jump-heat-inc     float    :offset-assert  56)
   (boost-curve-max            meters   :offset-assert  60)
   (boost-level-max            meters   :offset-assert  64)
   (boost-level-inc            meters   :offset-assert  68)
   (boost-duration             seconds  :offset-assert  72)
   (default-front-blade        degrees  :offset-assert  80)
   (yellow-projectile-speed    meters   :offset-assert  84)
   )
  :method-count-assert 9
  :size-assert         #x58
  :flag-assert         #x900000058
  )

;; definition for method 3 of type racer-bank
(defmethod inspect racer-bank ((obj racer-bank))
  (format #t "[~8x] ~A~%" obj (-> obj type))
  (format #t "~Tslide-hold-time: (seconds ~e)~%" (-> obj slide-hold-time))
  (format #t "~Theat-max: ~f~%" (-> obj heat-max))
  (format #t "~Thotcoals-heat-inc: ~f~%" (-> obj hotcoals-heat-inc))
  (format #t "~Tlava-heat-inc: ~f~%" (-> obj lava-heat-inc))
  (format #t "~Tlava-air-heat-inc: ~f~%" (-> obj lava-air-heat-inc))
  (format #t "~Tsurface-heat-inc: ~f~%" (-> obj surface-heat-inc))
  (format #t "~Tjump-heat-inc: ~f~%" (-> obj jump-heat-inc))
  (format #t "~Tlavatube-hotcoals-heat-inc: ~f~%" (-> obj lavatube-hotcoals-heat-inc))
  (format #t "~Tlavatube-lava-heat-inc: ~f~%" (-> obj lavatube-lava-heat-inc))
  (format #t "~Tlavatube-lava-air-heat-inc: ~f~%" (-> obj lavatube-lava-air-heat-inc))
  (format #t "~Tlavatube-surface-heat-inc: ~f~%" (-> obj lavatube-surface-heat-inc))
  (format #t "~Tlavatube-jump-heat-inc: ~f~%" (-> obj lavatube-jump-heat-inc))
  (format #t "~Tboost-curve-max: (meters ~m)~%" (-> obj boost-curve-max))
  (format #t "~Tboost-level-max: (meters ~m)~%" (-> obj boost-level-max))
  (format #t "~Tboost-level-inc: (meters ~m)~%" (-> obj boost-level-inc))
  (format #t "~Tboost-duration: (seconds ~e)~%" (-> obj boost-duration))
  (format #t "~Tdefault-front-blade: (deg ~r)~%" (-> obj default-front-blade))
  (format #t "~Tyellow-projectile-speed: (meters ~m)~%" (-> obj yellow-projectile-speed))
  obj
  )

;; definition for symbol *RACER-bank*, type racer-bank
(define *RACER-bank* (new 'static 'racer-bank
                       :slide-hold-time (seconds 0.2)
                       :heat-max 100.0
                       :hotcoals-heat-inc 3.0
                       :lava-heat-inc 20.0
                       :lava-air-heat-inc 4.0
                       :surface-heat-inc 1.0
                       :jump-heat-inc 2.0
                       :lavatube-hotcoals-heat-inc 2.0
                       :lavatube-lava-heat-inc 4.5
                       :lavatube-lava-air-heat-inc 4.0
                       :lavatube-surface-heat-inc 1.0
                       :lavatube-jump-heat-inc 10.0
                       :boost-curve-max (meters 5)
                       :boost-level-max (meters 12.5)
                       :boost-level-inc (meters 2)
                       :boost-duration (seconds 2.5)
                       :yellow-projectile-speed (meters 80)
                       )
        )

;; failed to figure out what this is:
(defskelgroup *balloon-sg* balloon balloon-lod0-jg balloon-idle-ja
              ((balloon-lod0-mg (meters 20)) (balloon-lod1-mg (meters 999999)))
              :bounds (static-spherem 0 1.7 0 3)
              )
