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

;; definition for symbol *merc-death-globals*, type vector
(define *merc-death-globals* (new 'global 'vector))

;; definition of type death-info
(deftype death-info (basic)
  ((vertex-skip uint16  :offset-assert   4)
   (timer       uint8   :offset-assert   6)
   (overlap     uint8   :offset-assert   7)
   (effect      uint32  :offset-assert   8)
   (sound       symbol  :offset-assert  12)
   )
  :method-count-assert 9
  :size-assert         #x10
  :flag-assert         #x900000010
  )

;; definition for method 3 of type death-info
(defmethod inspect death-info ((obj death-info))
  (format #t "[~8x] ~A~%" obj (-> obj type))
  (format #t "~Tvertex-skip: ~D~%" (-> obj vertex-skip))
  (format #t "~Ttimer: ~D~%" (-> obj timer))
  (format #t "~Toverlap: ~D~%" (-> obj overlap))
  (format #t "~Teffect: ~D~%" (-> obj effect))
  (format #t "~Tsound: ~A~%" (-> obj sound))
  obj
  )

;; definition for function birth-func-death-sparks
;; INFO: Return type mismatch int vs none.
(defun birth-func-death-sparks ()
  0
  (none)
  )

;; definition for symbol death-beach-puppy, type death-info
(define death-beach-puppy
  (new 'static 'death-info :vertex-skip #x82 :timer #x4b :overlap #x4 :effect #x29 :sound 'temp-enemy-die)
  )

;; definition for symbol death-jungle-snake, type death-info
(define death-jungle-snake
  (new 'static 'death-info :vertex-skip #xa :timer #x4b :overlap #x4 :effect #x29 :sound 'temp-enemy-die)
  )

;; definition for symbol death-default, type death-info
(define death-default
  (new 'static 'death-info :vertex-skip #x50 :timer #x4b :overlap #x4 :effect #x29 :sound 'temp-enemy-die)
  )

;; definition for symbol death-warp-in, type death-info
(define death-warp-in
  (new 'static 'death-info :vertex-skip #x96 :timer #x4b :effect #x29 :sound 'warpgate-tele)
  )

;; definition for symbol death-warp-out, type death-info
(define death-warp-out
  (new 'static 'death-info :vertex-skip #x96 :timer #x96 :effect #x29 :sound 'warpgate-tele)
  )

;; failed to figure out what this is:
(defpart 41
  :init-specs ((sp-flt spt-scale-x (meters 0.5))
    (sp-copy-from-other spt-scale-y -4)
    (sp-rnd-flt spt-r 64.0 32.0 1.0)
    (sp-rnd-flt spt-g 16.0 32.0 1.0)
    (sp-rnd-flt spt-b 48.0 32.0 1.0)
    (sp-rnd-flt spt-a 48.0 48.0 1.0)
    (sp-rnd-flt spt-vel-y (meters 0) (meters 0.006666667) 1.0)
    (sp-flt spt-scalevel-x (meters -0.0016666667))
    (sp-flt spt-scalevel-y (meters 0.02))
    (sp-flt spt-accel-y -2.7306666)
    (sp-int spt-timer 120)
    (sp-cpuinfo-flags bit2 bit3 bit12)
    (sp-int-plain-rnd spt-next-time 15 59 1)
    (sp-launcher-by-id spt-next-launcher 42)
    )
  )

;; failed to figure out what this is:
(defpart 42
  :init-specs ((sp-flt spt-fade-a -1.4222223)
    (sp-int spt-timer 45)
    (sp-int spt-next-time 42)
    (sp-launcher-by-id spt-next-launcher 43)
    )
  )

;; failed to figure out what this is:
(defpart 43
  :init-specs ((sp-flt spt-scalevel-x (meters 0)) (sp-flt spt-fade-a -0.21333334) (sp-int-plain-rnd spt-timer 0 296 1))
  )

;; definition for function merc-death-spawn
;; INFO: Return type mismatch int vs none.
(defun merc-death-spawn ((arg0 int) (arg1 vector) (arg2 vector))
  (let ((v1-2 (-> *part-id-table* arg0)))
    (if (and (nonzero? v1-2) (= (-> v1-2 type) sparticle-launcher))
        (sp-launch-particles-death *sp-particle-system-2d* v1-2 arg1)
        )
    )
  0
  (none)
  )
