;;-*-Lisp-*-
(in-package goal)
(bundles "GAME.CGO")
(require "engine/game/game-h.gc")
(declare-type nav-enemy process-drawable)

(define-extern nav-enemy-send-attack (function process touching-shapes-entry symbol object :behavior nav-enemy))

(define-extern nav-enemy-set-hit-from-direction (function process none :behavior nav-enemy))

(define-extern nav-enemy-get-new-patrol-point (function int :behavior nav-enemy))

(define-extern nav-enemy-test-point-near-nav-mesh? (function vector symbol :behavior nav-enemy))

(defenum nav-enemy-flags
  :bitfield #t
  :type uint32
  (navenmf0 0)
  (navenmf1 1)
  (navenmf2 2)
  (enable-rotate 3)
  (enable-travel 4)
  (navenmf5 5)
  (navenmf6 6)
  (navenmf7 7)
  (navenmf8 8)
  (standing-jump 9)
  (drop-jump 10)
  (navenmf11 11)
  (navenmf12 12)
  (navenmf13 13)
  (navenmf14 14)
  (navenmf15 15)
  (navenmf16 16)
  (navenmf17 17)
  (navenmf18 18)
  (navenmf19 19)
  (navenmf20 20)
  (navenmf21 21)
  (navenmf22 22)
  (navenmf23 23)
  (navenmf24 24)
  (navenmf25 25)
  (navenmf26 26)
  (navenmf27 27)
  (navenmf28 28)
  (navenmf29 29)
  (navenmf30 30)
  (navenmf31 31))

;; DECOMP BEGINS

(deftype nav-enemy-info (basic)
  ((idle-anim                 int32)
   (walk-anim                 int32)
   (turn-anim                 int32)
   (notice-anim               int32)
   (run-anim                  int32)
   (jump-anim                 int32)
   (jump-land-anim            int32)
   (victory-anim              int32)
   (taunt-anim                int32)
   (die-anim                  int32)
   (neck-joint                int32)
   (player-look-at-joint      int32)
   (run-travel-speed          meters)
   (run-rotate-speed          degrees)
   (run-acceleration          meters)
   (run-turn-time             seconds)
   (walk-travel-speed         meters)
   (walk-rotate-speed         degrees)
   (walk-acceleration         meters)
   (walk-turn-time            seconds)
   (attack-shove-back         meters)
   (attack-shove-up           meters)
   (shadow-size               meters)
   (notice-nav-radius         meters)
   (nav-nearest-y-threshold   meters)
   (notice-distance           meters)
   (proximity-notice-distance meters)
   (stop-chase-distance       meters)
   (frustration-distance      meters)
   (frustration-time          time-frame)
   (die-anim-hold-frame       float)
   (jump-anim-start-frame     float)
   (jump-land-anim-end-frame  float)
   (jump-height-min           meters)
   (jump-height-factor        float)
   (jump-start-anim-speed     float)
   (shadow-max-y              meters)
   (shadow-min-y              meters)
   (shadow-locus-dist         meters)
   (use-align                 symbol)
   (draw-shadow               symbol)
   (move-to-ground            symbol)
   (hover-if-no-ground        symbol)
   (use-momentum              symbol)
   (use-flee                  symbol)
   (use-proximity-notice      symbol)
   (use-jump-blocked          symbol)
   (use-jump-patrol           symbol)
   (gnd-collide-with          collide-kind)
   (debug-draw-neck           symbol)
   (debug-draw-jump           symbol)))

(deftype nav-enemy (process-drawable)
  ((collide-info        collide-shape-moving :overlay-at root)
   (enemy-info          fact-info-enemy :overlay-at fact)
   (hit-from-dir        vector :inline)
   (event-param-point   vector :inline)
   (frustration-point   vector :inline)
   (jump-dest           vector :inline)
   (jump-trajectory     trajectory :inline)
   (jump-time           time-frame)
   (nav-info            nav-enemy-info)
   (target-speed        float)
   (momentum-speed      float)
   (acceleration        float)
   (rotate-speed        float)
   (turn-time           time-frame)
   (frustration-time    time-frame)
   (speed-scale         float)
   (neck                joint-mod)
   (reaction-time       time-frame)
   (notice-time         time-frame)
   (state-timeout       time-frame)
   (free-time           time-frame)
   (touch-time          time-frame)
   (nav-enemy-flags     nav-enemy-flags)
   (incomming-attack-id handle)
   (jump-return-state   (state process))
   (rand-gen            random-generator))
  (:state-methods
   nav-enemy-attack
   nav-enemy-chase
   nav-enemy-flee
   nav-enemy-die
   nav-enemy-fuel-cell
   nav-enemy-give-up
   nav-enemy-jump
   nav-enemy-jump-land
   nav-enemy-idle
   nav-enemy-notice
   nav-enemy-patrol
   nav-enemy-stare
   nav-enemy-stop-chase
   nav-enemy-victory)
  (:methods
   (nav-enemy-method-34 (_type_) none)
   (nav-enemy-wait-for-cue () _type_ :state)
   (nav-enemy-jump-to-point () _type_ :state)
   (nav-enemy-method-37 (_type_) none)
   (nav-enemy-method-38 (_type_) none)
   (common-post (_type_) none)
   (nav-enemy-method-40 (_type_) none)
   (nav-enemy-method-41 (_type_) none)
   (new-patrol-point! (_type_) int)
   (attack-handler (_type_ process event-message-block) object)
   (touch-handler (_type_ process event-message-block) object)
   (init-defaults! (_type_ nav-enemy-info) none)
   (target-in-range? (_type_ float) basic)
   (initialize-collision (_type_) none)
   (nav-enemy-method-48 (_type_) none)
   (init-jm! (_type_ nav-enemy-info) float)
   (nav-enemy-method-50 (_type_ vector) symbol)
   (nav-enemy-method-51 (_type_) none)
   (nav-enemy-method-52 (_type_ vector) symbol)
   (nav-enemy-method-53 (_type_) symbol)
   (nav-enemy-method-54 (_type_ vector) symbol)
   (nav-enemy-method-55 (_type_) symbol)
   (set-jump-height-factor! (_type_ int) none)
   (nav-enemy-method-57 (_type_) none)
   (nav-enemy-method-58 (_type_) none)
   (nav-enemy-method-59 (_type_) none)
   (nav-enemy-method-60 (_type_ symbol) symbol)
   (snow-bunny-attack () _type_ :state)
   (snow-bunny-chase-hop () _type_ :state)
   (snow-bunny-defend () _type_ :state)
   (nav-enemy-method-64 () _type_ :state)
   (snow-bunny-lunge () _type_ :state)
   (snow-bunny-nav-resume () _type_ :state)
   (snow-bunny-patrol-hop () _type_ :state)
   (snow-bunny-patrol-idle () _type_ :state)
   (nav-enemy-method-69 () _type_ :state)
   (snow-bunny-retreat-hop () _type_ :state)
   (snow-bunny-tune-spheres () _type_ :state)
   (nav-enemy-touch-handler (_type_ process event-message-block) object)
   (nav-enemy-attack-handler (_type_ process event-message-block) object)
   (nav-enemy-jump-blocked () _type_ :state)
   (nav-enemy-method-75 () _type_ :state)))
