mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 21:27:52 -04:00
80a002f8c0
* make birthing work * fix float representation on defskelgroup * test * update * debugger improvements & dont upload aux sprites * ? * fix progress * fixes * fixes * Create bea.gd * fix test * fix xmm reg clobbering in kernel (water) * cleanup cam-start * clear gamepad state every frame * allow controller connects and disconnects while running
1386 lines
39 KiB
Common Lisp
1386 lines
39 KiB
Common Lisp
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; name: effect-control.gc
|
|
;; name in dgo: effect-control
|
|
;; dgos: GAME, ENGINE
|
|
|
|
;; DECOMP BEGINS
|
|
|
|
(define *footstep-surface* 448)
|
|
|
|
(define *debug-effect-control* #f)
|
|
|
|
(defun sound-name-with-material ((arg0 symbol) (arg1 int) (arg2 string))
|
|
(let ((gp-0 format)
|
|
(a0-2 (clear *temp-string*))
|
|
(a1-1 "~S-~S~S")
|
|
(v1-1 (shr (shl arg1 52) 58))
|
|
)
|
|
(gp-0 a0-2 a1-1 arg0 (cond
|
|
((= v1-1 5)
|
|
"sand"
|
|
)
|
|
((= v1-1 6)
|
|
"wood"
|
|
)
|
|
((= v1-1 13)
|
|
"crwood"
|
|
)
|
|
((or (= v1-1 18) (= v1-1 8))
|
|
"pcmetal"
|
|
)
|
|
((or (= v1-1 16) (= v1-1 21))
|
|
"metal"
|
|
)
|
|
((= v1-1 9)
|
|
"snow"
|
|
)
|
|
((= v1-1 10)
|
|
"dpsnow"
|
|
)
|
|
((= v1-1 14)
|
|
"gravel"
|
|
)
|
|
((= v1-1 15)
|
|
"dirt"
|
|
)
|
|
((zero? v1-1)
|
|
"stone"
|
|
)
|
|
((= v1-1 3)
|
|
"water"
|
|
)
|
|
((= v1-1 4)
|
|
"tar"
|
|
)
|
|
((= v1-1 17)
|
|
"straw"
|
|
)
|
|
((= v1-1 1)
|
|
"ice"
|
|
)
|
|
((= v1-1 19)
|
|
"swamp"
|
|
)
|
|
((= v1-1 22)
|
|
"neutral"
|
|
)
|
|
(else
|
|
"grass"
|
|
)
|
|
)
|
|
arg2
|
|
)
|
|
)
|
|
(string->sound-name *temp-string*)
|
|
)
|
|
|
|
(defun
|
|
effect-param->sound-spec
|
|
((arg0 sound-spec) (arg1 (pointer float)) (arg2 int))
|
|
(while (> arg2 0)
|
|
(case (the int (-> arg1 0))
|
|
((3)
|
|
(logior! (-> arg0 mask) 1)
|
|
(set! (-> arg0 volume) (the int (* 10.24 (-> arg1 1))))
|
|
)
|
|
((4)
|
|
(logior! (-> arg0 mask) 1)
|
|
(+! (-> arg0 volume) (the int (* 10.24 (* (-> arg1 1) (rand-vu)))))
|
|
)
|
|
((5)
|
|
(logior! (-> arg0 mask) 2)
|
|
(set! (-> arg0 pitch-mod) (the int (* 1524.0 (-> arg1 1))))
|
|
)
|
|
((6)
|
|
(logior! (-> arg0 mask) 2)
|
|
(+! (-> arg0 pitch-mod) (the int (* 1524.0 (* (-> arg1 1) (rand-vu)))))
|
|
)
|
|
((9)
|
|
(logior! (-> arg0 mask) 4)
|
|
(set! (-> arg0 bend) (the int (* 327.66998 (-> arg1 1))))
|
|
)
|
|
((10)
|
|
(logior! (-> arg0 mask) 4)
|
|
(+! (-> arg0 bend) (the int (* 327.66998 (* (-> arg1 1) (rand-vu)))))
|
|
)
|
|
((11)
|
|
(logior! (-> arg0 mask) 64)
|
|
(set! (-> arg0 fo-min) (the int (-> arg1 1)))
|
|
)
|
|
((12)
|
|
(logior! (-> arg0 mask) 128)
|
|
(set! (-> arg0 fo-max) (the int (-> arg1 1)))
|
|
)
|
|
((13)
|
|
(logior! (-> arg0 mask) 256)
|
|
(set! (-> arg0 fo-curve) (the int (-> arg1 1)))
|
|
)
|
|
((19)
|
|
(set! (-> arg0 priority) (the int (-> arg1 1)))
|
|
)
|
|
)
|
|
(+! arg2 -2)
|
|
(set! arg1 (&-> arg1 2))
|
|
)
|
|
arg0
|
|
)
|
|
|
|
(defmethod TODO-RENAME-9 effect-control ((obj effect-control))
|
|
(let* ((a0-1 (-> obj process skel))
|
|
(v1-3 (if (< (-> obj channel-offset) (-> a0-1 active-channels))
|
|
(-> a0-1 root-channel (-> obj channel-offset))
|
|
(the-as joint-control-channel #f)
|
|
)
|
|
)
|
|
)
|
|
(cond
|
|
((and v1-3 (-> v1-3 frame-group))
|
|
(let* ((s5-0 (-> v1-3 frame-group))
|
|
(f30-0
|
|
(+
|
|
(* (-> v1-3 frame-num) (-> s5-0 artist-step))
|
|
(-> s5-0 artist-base)
|
|
)
|
|
)
|
|
)
|
|
(let ((a0-3 (-> a0-1 root-channel 0 num-func)))
|
|
(cond
|
|
((!= s5-0 (-> obj last-frame-group))
|
|
(set! (-> obj res) (-> s5-0 extra))
|
|
(let
|
|
((v1-6
|
|
(->
|
|
(lookup-tag-idx (-> s5-0 extra) 'effect-name 'base -1000000000.0)
|
|
lo
|
|
)
|
|
)
|
|
)
|
|
(set! (-> obj name) (if (>= (the-as int v1-6) 0)
|
|
(&-> (-> s5-0 extra tag) v1-6)
|
|
(the-as (pointer res-tag) #f)
|
|
)
|
|
)
|
|
)
|
|
(if (and (-> obj name) (= (-> obj name 0 key-frame) -1000000000.0))
|
|
(set! (-> obj name) (&-> (-> obj name) 1))
|
|
)
|
|
(TODO-RENAME-14 obj f30-0 f30-0 f30-0)
|
|
)
|
|
((or (not (-> obj name)) (= f30-0 (-> obj last-frame-num)))
|
|
)
|
|
(else
|
|
(let ((f28-0 (-> obj last-frame-num))
|
|
(f26-0 f30-0)
|
|
)
|
|
(cond
|
|
((= a0-3 num-func-seek!)
|
|
(let
|
|
((f0-6
|
|
(+
|
|
(* (-> v1-3 param 0) (-> s5-0 artist-step))
|
|
(-> s5-0 artist-base)
|
|
)
|
|
)
|
|
)
|
|
(cond
|
|
((< f26-0 f28-0)
|
|
(if (>= f28-0 f0-6)
|
|
(TODO-RENAME-14 obj f26-0 f28-0 f30-0)
|
|
)
|
|
)
|
|
(else
|
|
(if (>= f0-6 f28-0)
|
|
(TODO-RENAME-14 obj f28-0 f26-0 f30-0)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
((= a0-3 num-func-loop!)
|
|
(cond
|
|
((>= (-> v1-3 param 0) 0.0)
|
|
(cond
|
|
((< f26-0 f28-0)
|
|
(TODO-RENAME-14 obj f28-0 9999999.0 f30-0)
|
|
(TODO-RENAME-14 obj -100000000.0 f26-0 9999999.0)
|
|
)
|
|
(else
|
|
(TODO-RENAME-14 obj f28-0 f26-0 f30-0)
|
|
)
|
|
)
|
|
)
|
|
((< f28-0 f26-0)
|
|
(TODO-RENAME-14 obj f26-0 9999999.0 f30-0)
|
|
(TODO-RENAME-14 obj -100000000.0 f28-0 9999999.0)
|
|
)
|
|
(else
|
|
(TODO-RENAME-14 obj f26-0 f28-0 f30-0)
|
|
)
|
|
)
|
|
)
|
|
((= a0-3 num-func-+!)
|
|
(if (>= (-> v1-3 param 0) 0.0)
|
|
(TODO-RENAME-14 obj f28-0 f26-0 f30-0)
|
|
(TODO-RENAME-14 obj f26-0 f28-0 f30-0)
|
|
)
|
|
)
|
|
((= a0-3 num-func-identity)
|
|
(TODO-RENAME-14 obj f30-0 f30-0 f30-0)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(set! (-> obj last-frame-group) s5-0)
|
|
(set! (-> obj last-frame-num) f30-0)
|
|
)
|
|
)
|
|
(else
|
|
(set! (-> obj last-frame-group) #f)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
(defmethod
|
|
TODO-RENAME-14
|
|
effect-control
|
|
((obj effect-control) (arg0 float) (arg1 float) (arg2 float))
|
|
(let ((s2-0 (-> obj name)))
|
|
(while (= (-> s2-0 0 name) 'effect-name)
|
|
(let ((f0-0 (-> s2-0 0 key-frame)))
|
|
(when (or (and (< f0-0 arg1) (< arg0 f0-0)) (= f0-0 arg2))
|
|
(let* ((a0-1 obj)
|
|
(t9-0 (method-of-object a0-1 dummy-10))
|
|
(v1-7 (-> obj res))
|
|
(a1-1 (-> s2-0 0))
|
|
)
|
|
(t9-0
|
|
a0-1
|
|
(the-as
|
|
symbol
|
|
(->
|
|
(the-as
|
|
(pointer uint32)
|
|
(&+ (-> v1-7 data-base) (-> a1-1 data-offset))
|
|
)
|
|
)
|
|
)
|
|
f0-0
|
|
-1
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(set! s2-0 (&-> s2-0 1))
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
|
|
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
|
|
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
|
|
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
|
|
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
|
|
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
|
|
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
|
|
(defmethod
|
|
dummy-10
|
|
effect-control
|
|
((obj effect-control) (arg0 symbol) (arg1 float) (arg2 int))
|
|
(local-vars
|
|
(sv-160 int)
|
|
(sv-176 symbol)
|
|
(sv-192 symbol)
|
|
(sv-208 symbol)
|
|
(sv-224 int)
|
|
(sv-240 symbol)
|
|
(sv-256 symbol)
|
|
(sv-272 symbol)
|
|
(sv-288 res-lump)
|
|
)
|
|
(with-pp
|
|
(let ((s3-0 (-> arg0 value))
|
|
(s5-0 (cond
|
|
((< arg2 0)
|
|
(let
|
|
((v0-0
|
|
(get-property-value
|
|
(-> obj res)
|
|
'effect-joint
|
|
'exact
|
|
arg1
|
|
(the-as uint128 0)
|
|
(the-as (pointer res-tag) #f)
|
|
*res-static-buf*
|
|
)
|
|
)
|
|
)
|
|
(if (zero? v0-0)
|
|
0
|
|
(the-as int (+ v0-0 1))
|
|
)
|
|
)
|
|
)
|
|
(else
|
|
(empty)
|
|
arg2
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(when (logtest? (-> obj flags) 1)
|
|
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
|
|
(set! (-> a1-2 from) pp)
|
|
(set! (-> a1-2 num-params) 3)
|
|
(set! (-> a1-2 message) 'effect)
|
|
(set! (-> a1-2 param 0) (the-as uint arg0))
|
|
(set! (-> a1-2 param 1) (the-as uint arg1))
|
|
(set! (-> a1-2 param 2) (the-as uint s5-0))
|
|
(if (send-event-function (-> obj process) a1-2)
|
|
(return (the-as object 0))
|
|
)
|
|
)
|
|
)
|
|
(let ((v1-10 (symbol->string arg0)))
|
|
(cond
|
|
((and
|
|
(= (-> v1-10 data 0) 101)
|
|
(= (-> v1-10 data 1) 102)
|
|
(= (-> v1-10 data 2) 102)
|
|
(= (-> v1-10 data 3) 101)
|
|
(= (-> v1-10 data 4) 99)
|
|
(= (-> v1-10 data 5) 116)
|
|
(= (-> v1-10 data 6) 45)
|
|
)
|
|
(let* ((s3-1 (-> obj process root))
|
|
(v1-14
|
|
(if
|
|
(and
|
|
(nonzero? s3-1)
|
|
(type-type? (-> s3-1 type) collide-shape-moving)
|
|
)
|
|
s3-1
|
|
)
|
|
)
|
|
(t1-1 (if v1-14
|
|
(the-as
|
|
int
|
|
(-> (the-as collide-shape-moving v1-14) ground-pat)
|
|
)
|
|
*footstep-surface*
|
|
)
|
|
)
|
|
)
|
|
(dummy-11 obj arg0 (the-as basic arg1) s5-0 (-> obj res) t1-1)
|
|
)
|
|
)
|
|
((let ((v1-18 (symbol->string arg0)))
|
|
(and
|
|
(= (-> v1-18 data 0) 103)
|
|
(= (-> v1-18 data 1) 114)
|
|
(= (-> v1-18 data 2) 111)
|
|
(= (-> v1-18 data 3) 117)
|
|
(= (-> v1-18 data 4) 112)
|
|
(= (-> v1-18 data 5) 45)
|
|
)
|
|
)
|
|
(set! s3-0 (cond
|
|
((zero? s3-0)
|
|
(let
|
|
((v0-5
|
|
(lookup-part-group-pointer-by-name (symbol->string arg0))
|
|
)
|
|
)
|
|
(when v0-5
|
|
(set! (-> arg0 value) v0-5)
|
|
(set! s3-0 (-> v0-5 0))
|
|
)
|
|
)
|
|
(the-as (pointer sparticle-launch-group) s3-0)
|
|
)
|
|
(else
|
|
(-> (the-as (pointer sparticle-launch-group) s3-0) 0)
|
|
)
|
|
)
|
|
)
|
|
(when
|
|
(and
|
|
(nonzero? s3-0)
|
|
(=
|
|
(-> (the-as sparticle-launch-group s3-0) type)
|
|
sparticle-launch-group
|
|
)
|
|
)
|
|
(if *debug-effect-control*
|
|
(format
|
|
#t
|
|
"(~5D) effect group ~A ~A frame ~F joint ~D~%"
|
|
(-> *display* base-frame-counter)
|
|
(-> obj process name)
|
|
arg0
|
|
arg1
|
|
s5-0
|
|
)
|
|
)
|
|
(let ((s4-1 (get-process *default-dead-pool* part-tracker #x4000)))
|
|
(when s4-1
|
|
(let ((t9-7 (method-of-type part-tracker activate)))
|
|
(t9-7
|
|
(the-as part-tracker s4-1)
|
|
(-> obj process)
|
|
'part-tracker
|
|
(the-as pointer #x70004000)
|
|
)
|
|
)
|
|
(let ((s2-1 run-function-in-process)
|
|
(s1-0 s4-1)
|
|
(s0-0 part-tracker-init)
|
|
)
|
|
(set! sv-160 -1)
|
|
(set! sv-176 (the-as symbol #f))
|
|
(set! sv-192 (the-as symbol #f))
|
|
(set! sv-208 (the-as symbol #f))
|
|
(let
|
|
((t3-0
|
|
(vector<-cspace!
|
|
(new 'stack-no-clear 'vector)
|
|
(-> obj process node-list data s5-0)
|
|
)
|
|
)
|
|
)
|
|
((the-as
|
|
(function object object object object object object object object none)
|
|
s2-1
|
|
)
|
|
s1-0
|
|
s0-0
|
|
(the-as sparticle-launch-group s3-0)
|
|
sv-160
|
|
sv-176
|
|
sv-192
|
|
sv-208
|
|
t3-0
|
|
)
|
|
)
|
|
)
|
|
(-> s4-1 ppointer)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
((= arg0 'camera-shake)
|
|
(activate! *camera-smush-control* 819.2 37 600 1.0 0.995)
|
|
)
|
|
((zero? s3-0)
|
|
(dummy-12
|
|
obj
|
|
arg0
|
|
(the-as basic arg1)
|
|
s5-0
|
|
(-> obj res)
|
|
(string->sound-name (symbol->string arg0))
|
|
)
|
|
)
|
|
((= (-> (the-as basic s3-0) type) sparticle-launcher)
|
|
(if *debug-effect-control*
|
|
(format
|
|
#t
|
|
"(~5D) effect part ~A ~A frame ~F joint ~D~%"
|
|
(-> *display* base-frame-counter)
|
|
(-> obj process name)
|
|
arg0
|
|
arg1
|
|
s5-0
|
|
)
|
|
)
|
|
(format
|
|
#t
|
|
"-----> (~5D) effect part ~A ~A frame ~F joint ~D~%"
|
|
(-> *display* base-frame-counter)
|
|
(-> obj process name)
|
|
arg0
|
|
arg1
|
|
s5-0
|
|
)
|
|
(sp-launch-particles-var
|
|
*sp-particle-system-2d*
|
|
(the-as sparticle-launcher s3-0)
|
|
(vector<-cspace!
|
|
(new 'stack-no-clear 'vector)
|
|
(-> obj process node-list data s5-0)
|
|
)
|
|
(the-as sparticle-launch-state #f)
|
|
(the-as sparticle-launch-control #f)
|
|
1.0
|
|
)
|
|
)
|
|
((= (-> (the-as basic s3-0) type) sparticle-launch-group)
|
|
(if *debug-effect-control*
|
|
(format
|
|
#t
|
|
"(~5D) effect group ~A ~A frame ~F joint ~D~%"
|
|
(-> *display* base-frame-counter)
|
|
(-> obj process name)
|
|
arg0
|
|
arg1
|
|
s5-0
|
|
)
|
|
)
|
|
(let ((s4-3 (get-process *default-dead-pool* part-tracker #x4000)))
|
|
(when s4-3
|
|
(let ((t9-19 (method-of-type part-tracker activate)))
|
|
(t9-19
|
|
(the-as part-tracker s4-3)
|
|
(-> obj process)
|
|
'part-tracker
|
|
(the-as pointer #x70004000)
|
|
)
|
|
)
|
|
(let ((s2-3 run-function-in-process)
|
|
(s1-2 s4-3)
|
|
(s0-2 part-tracker-init)
|
|
)
|
|
(set! sv-224 -1)
|
|
(set! sv-240 (the-as symbol #f))
|
|
(set! sv-256 (the-as symbol #f))
|
|
(set! sv-272 (the-as symbol #f))
|
|
(let
|
|
((t3-1
|
|
(vector<-cspace!
|
|
(new 'stack-no-clear 'vector)
|
|
(-> obj process node-list data s5-0)
|
|
)
|
|
)
|
|
)
|
|
((the-as
|
|
(function object object object object object object object object none)
|
|
s2-3
|
|
)
|
|
s1-2
|
|
s0-2
|
|
s3-0
|
|
sv-224
|
|
sv-240
|
|
sv-256
|
|
sv-272
|
|
t3-1
|
|
)
|
|
)
|
|
)
|
|
(-> s4-3 ppointer)
|
|
)
|
|
)
|
|
)
|
|
((= (-> (the-as basic s3-0) type) sound-spec)
|
|
(sound-play-by-spec
|
|
(the-as sound-spec s3-0)
|
|
(new-sound-id)
|
|
(vector<-cspace!
|
|
(new 'stack-no-clear 'vector)
|
|
(-> obj process node-list data s5-0)
|
|
)
|
|
)
|
|
)
|
|
((= (-> (the-as basic s3-0) type) death-info)
|
|
(let ((v1-67 (-> obj process draw)))
|
|
(let ((a1-42 (-> (the-as death-info s3-0) vertex-skip))
|
|
(a0-55
|
|
(max
|
|
2
|
|
(the-as
|
|
int
|
|
(/
|
|
(-> (the-as death-info s3-0) timer)
|
|
(the-as uint (the int (-> *display* time-factor)))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(when (= (-> *setting-control* current video-mode) 'pal)
|
|
(if (< (the-as uint 1) a1-42)
|
|
(set!
|
|
a1-42
|
|
(/ (the-as uint (* (the-as uint 50) a1-42)) (the-as uint 60))
|
|
)
|
|
)
|
|
)
|
|
(let
|
|
((a2-29
|
|
(-> *display* frames (-> *display* last-screen) frame run-time)
|
|
)
|
|
)
|
|
(cond
|
|
((< 9000 (the-as int a2-29))
|
|
(set! a1-42 (* a1-42 4))
|
|
)
|
|
((< 7000 (the-as int a2-29))
|
|
(set! a1-42 (* a1-42 2))
|
|
)
|
|
)
|
|
)
|
|
(set! (-> v1-67 death-vertex-skip) a1-42)
|
|
(set! (-> v1-67 death-effect) (-> (the-as death-info s3-0) effect))
|
|
(set! (-> v1-67 death-timer) (+ a0-55 1))
|
|
)
|
|
(set! (-> v1-67 death-timer-org) (-> v1-67 death-timer))
|
|
(set!
|
|
(-> v1-67 death-draw-overlap)
|
|
(-> (the-as death-info s3-0) overlap)
|
|
)
|
|
)
|
|
(when (-> (the-as death-info s3-0) sound)
|
|
(let* ((s2-5 obj)
|
|
(s1-3 (method-of-object s2-5 dummy-12))
|
|
(s0-3 (-> (the-as death-info s3-0) sound))
|
|
)
|
|
(set! sv-288 (-> obj res))
|
|
(let
|
|
((t1-11
|
|
(string->sound-name
|
|
(the-as
|
|
string
|
|
(->
|
|
(the-as
|
|
(pointer uint32)
|
|
(+ #xff38 (the-as int (-> (the-as death-info s3-0) sound)))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(s1-3 s2-5 (the-as symbol s0-3) (the-as basic arg1) s5-0 sv-288 t1-11)
|
|
)
|
|
)
|
|
)
|
|
(send-event (-> obj process) 'death-start (the-as death-info s3-0))
|
|
)
|
|
(else
|
|
(dummy-12
|
|
obj
|
|
arg0
|
|
(the-as basic arg1)
|
|
s5-0
|
|
(-> obj res)
|
|
(string->sound-name (symbol->string arg0))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
)
|
|
)
|
|
|
|
(defmethod
|
|
dummy-11
|
|
effect-control
|
|
((obj effect-control)
|
|
(arg0 symbol)
|
|
(arg1 basic)
|
|
(arg2 int)
|
|
(arg3 basic)
|
|
(arg4 int)
|
|
)
|
|
(local-vars
|
|
(sv-48
|
|
(function sparticle-system sparticle-launcher vector sparticle-launch-state sparticle-launch-control float none)
|
|
)
|
|
(sv-64 sparticle-system)
|
|
(sv-80
|
|
(function sparticle-system sparticle-launcher vector sparticle-launch-state sparticle-launch-control float none)
|
|
)
|
|
(sv-96 sparticle-system)
|
|
)
|
|
(let ((s1-0 (the-as sound-name #f)))
|
|
(let ((a0-4 (-> *display* frames (-> *display* last-screen) frame run-time)))
|
|
(case arg0
|
|
(('effect-walk-step-left 'effect-run-step-left)
|
|
(set! s1-0 (sound-name-with-material 'walk arg4 "1"))
|
|
)
|
|
(('effect-walk-step-right 'effect-run-step-right)
|
|
(set! s1-0 (sound-name-with-material 'walk arg4 "2"))
|
|
)
|
|
(('effect-roll)
|
|
(set! s1-0 (sound-name-with-material 'roll arg4 ""))
|
|
)
|
|
(('effect-slide)
|
|
(set! s1-0 (sound-name-with-material 'slide arg4 ""))
|
|
)
|
|
(('effect-land)
|
|
(set! s1-0 (sound-name-with-material 'land arg4 ""))
|
|
)
|
|
(('effect-zoom-land)
|
|
(set! s1-0 (sound-name-with-material 'zoom-land arg4 ""))
|
|
)
|
|
(('effect-zoom-hit)
|
|
(set! s1-0 (sound-name-with-material 'zoom-hit arg4 ""))
|
|
)
|
|
(('effect-flut-land)
|
|
(set! s1-0 (sound-name-with-material 'flut-land arg4 ""))
|
|
)
|
|
(('effect-land-poof)
|
|
(when (< (the-as int a0-4) 9000)
|
|
(let* ((a0-13 obj)
|
|
(t9-8 (method-of-object a0-13 dummy-10))
|
|
(v1-15 (shr (shl arg4 52) 58))
|
|
)
|
|
(t9-8 a0-13 (cond
|
|
((= v1-15 5)
|
|
'group-land-poof-sand
|
|
)
|
|
((= v1-15 6)
|
|
'group-land-poof-wood
|
|
)
|
|
((= v1-15 13)
|
|
'group-land-poof-crwood
|
|
)
|
|
((or (= v1-15 18) (= v1-15 8))
|
|
'group-land-poof-pcmetal
|
|
)
|
|
((or (= v1-15 16) (= v1-15 21))
|
|
'group-land-poof-metal
|
|
)
|
|
((= v1-15 1)
|
|
'group-land-poof-ice
|
|
)
|
|
((= v1-15 9)
|
|
'group-land-poof-snow
|
|
)
|
|
((= v1-15 10)
|
|
'group-land-poof-dpsnow
|
|
)
|
|
((= v1-15 14)
|
|
'group-land-poof-gravel
|
|
)
|
|
((= v1-15 15)
|
|
'group-land-poof-dirt
|
|
)
|
|
((zero? v1-15)
|
|
'group-land-poof-stone
|
|
)
|
|
((= v1-15 3)
|
|
'group-land-poof-water
|
|
)
|
|
((= v1-15 4)
|
|
'group-land-poof-tar
|
|
)
|
|
((= v1-15 17)
|
|
'group-land-poof-straw
|
|
)
|
|
((= v1-15 19)
|
|
'group-land-poof-swamp
|
|
)
|
|
((= v1-15 22)
|
|
'group-land-poof-neutral
|
|
)
|
|
(else
|
|
'group-land-poof-grass
|
|
)
|
|
)
|
|
(the-as float arg1) -1
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(('effect-run-poof)
|
|
(when (< (the-as int a0-4) 9000)
|
|
(let* ((a0-14 obj)
|
|
(t9-9 (method-of-object a0-14 dummy-10))
|
|
(v1-20 (shr (shl arg4 52) 58))
|
|
)
|
|
(t9-9 a0-14 (cond
|
|
((= v1-20 5)
|
|
'group-run-poof-sand
|
|
)
|
|
((= v1-20 6)
|
|
'group-run-poof-wood
|
|
)
|
|
((= v1-20 13)
|
|
'group-run-poof-crwood
|
|
)
|
|
((or (= v1-20 18) (= v1-20 8))
|
|
'group-run-poof-pcmetal
|
|
)
|
|
((or (= v1-20 16) (= v1-20 21))
|
|
'group-run-poof-metal
|
|
)
|
|
((= v1-20 1)
|
|
'group-run-poof-ice
|
|
)
|
|
((= v1-20 9)
|
|
'group-run-poof-snow
|
|
)
|
|
((= v1-20 10)
|
|
'group-run-poof-dpsnow
|
|
)
|
|
((= v1-20 14)
|
|
'group-run-poof-gravel
|
|
)
|
|
((= v1-20 15)
|
|
'group-run-poof-dirt
|
|
)
|
|
((zero? v1-20)
|
|
'group-run-poof-stone
|
|
)
|
|
((= v1-20 3)
|
|
'group-run-poof-water
|
|
)
|
|
((= v1-20 4)
|
|
'group-run-poof-tar
|
|
)
|
|
((= v1-20 17)
|
|
'group-run-poof-straw
|
|
)
|
|
((= v1-20 19)
|
|
'group-run-poof-swamp
|
|
)
|
|
((= v1-20 22)
|
|
'group-run-poof-neutral
|
|
)
|
|
(else
|
|
'group-run-poof-grass
|
|
)
|
|
)
|
|
(the-as float arg1) -1
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(('effect-just-footprint)
|
|
(let* ((a0-15 obj)
|
|
(t9-10 (method-of-object a0-15 dummy-10))
|
|
(v1-24 (shr (shl arg4 52) 58))
|
|
)
|
|
(t9-10 a0-15 (cond
|
|
((= v1-24 5)
|
|
'group-just-footprint-sand
|
|
)
|
|
((= v1-24 6)
|
|
'group-just-footprint-wood
|
|
)
|
|
((= v1-24 13)
|
|
'group-just-footprint-crwood
|
|
)
|
|
((or (= v1-24 18) (= v1-24 8))
|
|
'group-just-footprint-pcmetal
|
|
)
|
|
((or (= v1-24 16) (= v1-24 21))
|
|
'group-just-footprint-metal
|
|
)
|
|
((= v1-24 1)
|
|
'group-just-footprint-ice
|
|
)
|
|
((= v1-24 9)
|
|
'group-just-footprint-snow
|
|
)
|
|
((= v1-24 10)
|
|
'group-just-footprint-dpsnow
|
|
)
|
|
((= v1-24 14)
|
|
'group-just-footprint-gravel
|
|
)
|
|
((= v1-24 15)
|
|
'group-just-footprint-dirt
|
|
)
|
|
((zero? v1-24)
|
|
'group-just-footprint-stone
|
|
)
|
|
((= v1-24 3)
|
|
'group-just-footprint-water
|
|
)
|
|
((= v1-24 4)
|
|
'group-just-footprint-tar
|
|
)
|
|
((= v1-24 17)
|
|
'group-just-footprint-straw
|
|
)
|
|
((= v1-24 19)
|
|
'group-just-footprint-swamp
|
|
)
|
|
((= v1-24 22)
|
|
'group-just-footprint-neutral
|
|
)
|
|
(else
|
|
'group-just-footprint-grass
|
|
)
|
|
)
|
|
(the-as float arg1) -1
|
|
)
|
|
)
|
|
)
|
|
(('effect-just-poof)
|
|
(when (< (the-as int a0-4) 9000)
|
|
(let* ((a0-16 obj)
|
|
(t9-11 (method-of-object a0-16 dummy-10))
|
|
(v1-29 (shr (shl arg4 52) 58))
|
|
)
|
|
(t9-11 a0-16 (cond
|
|
((= v1-29 5)
|
|
'group-just-poof-sand
|
|
)
|
|
((= v1-29 6)
|
|
'group-just-poof-wood
|
|
)
|
|
((= v1-29 13)
|
|
'group-just-poof-crwood
|
|
)
|
|
((or (= v1-29 18) (= v1-29 8))
|
|
'group-just-poof-pcmetal
|
|
)
|
|
((or (= v1-29 16) (= v1-29 21))
|
|
'group-just-poof-metal
|
|
)
|
|
((= v1-29 1)
|
|
'group-just-poof-ice
|
|
)
|
|
((= v1-29 9)
|
|
'group-just-poof-snow
|
|
)
|
|
((= v1-29 10)
|
|
'group-just-poof-dpsnow
|
|
)
|
|
((= v1-29 14)
|
|
'group-just-poof-gravel
|
|
)
|
|
((= v1-29 15)
|
|
'group-just-poof-dirt
|
|
)
|
|
((zero? v1-29)
|
|
'group-just-poof-stone
|
|
)
|
|
((= v1-29 3)
|
|
'group-just-poof-water
|
|
)
|
|
((= v1-29 4)
|
|
'group-just-poof-tar
|
|
)
|
|
((= v1-29 17)
|
|
'group-just-poof-straw
|
|
)
|
|
((= v1-29 19)
|
|
'group-just-poof-swamp
|
|
)
|
|
((= v1-29 22)
|
|
'group-just-poof-neutral
|
|
)
|
|
(else
|
|
'group-just-poof-grass
|
|
)
|
|
)
|
|
(the-as float arg1) -1
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(('effect-slide-poof)
|
|
(let* ((a0-19 obj)
|
|
(t9-12 (method-of-object a0-19 dummy-10))
|
|
(v1-33 (shr (shl arg4 52) 58))
|
|
)
|
|
(t9-12 a0-19 (cond
|
|
((= v1-33 5)
|
|
'group-slide-poof-sand
|
|
)
|
|
((= v1-33 6)
|
|
'group-slide-poof-wood
|
|
)
|
|
((= v1-33 13)
|
|
'group-slide-poof-crwood
|
|
)
|
|
((or (= v1-33 18) (= v1-33 8))
|
|
'group-slide-poof-pcmetal
|
|
)
|
|
((or (= v1-33 16) (= v1-33 21))
|
|
'group-slide-poof-metal
|
|
)
|
|
((= v1-33 1)
|
|
'group-slide-poof-ice
|
|
)
|
|
((= v1-33 9)
|
|
'group-slide-poof-snow
|
|
)
|
|
((= v1-33 10)
|
|
'group-slide-poof-dpsnow
|
|
)
|
|
((= v1-33 14)
|
|
'group-slide-poof-gravel
|
|
)
|
|
((= v1-33 15)
|
|
'group-slide-poof-dirt
|
|
)
|
|
((zero? v1-33)
|
|
'group-slide-poof-stone
|
|
)
|
|
((= v1-33 3)
|
|
'group-slide-poof-water
|
|
)
|
|
((= v1-33 4)
|
|
'group-slide-poof-tar
|
|
)
|
|
((= v1-33 17)
|
|
'group-slide-poof-straw
|
|
)
|
|
((= v1-33 19)
|
|
'group-slide-poof-swamp
|
|
)
|
|
((= v1-33 22)
|
|
'group-slide-poof-neutral
|
|
)
|
|
(else
|
|
'group-slide-poof-grass
|
|
)
|
|
)
|
|
(the-as float arg1) -1
|
|
)
|
|
)
|
|
)
|
|
(('effect-droppings)
|
|
(let* ((v1-36 (shr (shl arg4 52) 58))
|
|
(s0-0 (cond
|
|
((= v1-36 5)
|
|
(-> *part-id-table* 95)
|
|
)
|
|
((= v1-36 6)
|
|
(-> *part-id-table* 97)
|
|
)
|
|
((= v1-36 13)
|
|
(-> *part-id-table* 99)
|
|
)
|
|
((or (= v1-36 18) (= v1-36 8))
|
|
(-> *part-id-table* 2248)
|
|
)
|
|
((or (= v1-36 16) (= v1-36 21))
|
|
(-> *part-id-table* 2334)
|
|
)
|
|
((= v1-36 1)
|
|
(-> *part-id-table* 2249)
|
|
)
|
|
((= v1-36 9)
|
|
(-> *part-id-table* 2250)
|
|
)
|
|
((= v1-36 10)
|
|
(-> *part-id-table* 2251)
|
|
)
|
|
((= v1-36 14)
|
|
(-> *part-id-table* 2252)
|
|
)
|
|
((= v1-36 15)
|
|
(-> *part-id-table* 2253)
|
|
)
|
|
((zero? v1-36)
|
|
(-> *part-id-table* 98)
|
|
)
|
|
((= v1-36 3)
|
|
(-> *part-id-table* 2254)
|
|
)
|
|
((= v1-36 4)
|
|
(-> *part-id-table* 2255)
|
|
)
|
|
((= v1-36 17)
|
|
(-> *part-id-table* 2256)
|
|
)
|
|
((= v1-36 19)
|
|
(-> *part-id-table* 2257)
|
|
)
|
|
((= v1-36 22)
|
|
(-> *part-id-table* 2773)
|
|
)
|
|
(else
|
|
(-> *part-id-table* 96)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(when (nonzero? s0-0)
|
|
(set! sv-48 sp-launch-particles-var)
|
|
(set! sv-64 *sp-particle-system-2d*)
|
|
(let
|
|
((a2-36
|
|
(vector<-cspace!
|
|
(new 'stack-no-clear 'vector)
|
|
(-> obj process node-list data arg2)
|
|
)
|
|
)
|
|
(a3-6 #f)
|
|
(t0-1 #f)
|
|
(t1-1 1.0)
|
|
)
|
|
(sv-48
|
|
sv-64
|
|
s0-0
|
|
a2-36
|
|
(the-as sparticle-launch-state a3-6)
|
|
(the-as sparticle-launch-control t0-1)
|
|
t1-1
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(('effect-jump-droppings)
|
|
(let* ((v1-61 (shr (shl arg4 52) 58))
|
|
(s0-1 (cond
|
|
((= v1-61 5)
|
|
(-> *part-id-table* 106)
|
|
)
|
|
((= v1-61 6)
|
|
(-> *part-id-table* 2258)
|
|
)
|
|
((= v1-61 13)
|
|
(-> *part-id-table* 2259)
|
|
)
|
|
((or (= v1-61 18) (= v1-61 8))
|
|
(-> *part-id-table* 2260)
|
|
)
|
|
((or (= v1-61 16) (= v1-61 21))
|
|
(-> *part-id-table* 2335)
|
|
)
|
|
((= v1-61 1)
|
|
(-> *part-id-table* 2261)
|
|
)
|
|
((= v1-61 9)
|
|
(-> *part-id-table* 2262)
|
|
)
|
|
((= v1-61 10)
|
|
(-> *part-id-table* 2263)
|
|
)
|
|
((= v1-61 14)
|
|
(-> *part-id-table* 2264)
|
|
)
|
|
((= v1-61 15)
|
|
(-> *part-id-table* 2265)
|
|
)
|
|
((zero? v1-61)
|
|
(-> *part-id-table* 2266)
|
|
)
|
|
((= v1-61 3)
|
|
(-> *part-id-table* 2267)
|
|
)
|
|
((= v1-61 4)
|
|
(-> *part-id-table* 2268)
|
|
)
|
|
((= v1-61 17)
|
|
(-> *part-id-table* 2269)
|
|
)
|
|
((= v1-61 19)
|
|
(-> *part-id-table* 2270)
|
|
)
|
|
((= v1-61 22)
|
|
(-> *part-id-table* 2774)
|
|
)
|
|
(else
|
|
(-> *part-id-table* 107)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(when (nonzero? s0-1)
|
|
(set! sv-80 sp-launch-particles-var)
|
|
(set! sv-96 *sp-particle-system-2d*)
|
|
(let
|
|
((a2-37
|
|
(vector<-cspace!
|
|
(new 'stack-no-clear 'vector)
|
|
(-> obj process node-list data arg2)
|
|
)
|
|
)
|
|
(a3-7 #f)
|
|
(t0-2 #f)
|
|
(t1-2 1.0)
|
|
)
|
|
(sv-80
|
|
sv-96
|
|
s0-1
|
|
a2-37
|
|
(the-as sparticle-launch-state a3-7)
|
|
(the-as sparticle-launch-control t0-2)
|
|
t1-2
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(if s1-0
|
|
(dummy-12 obj arg0 arg1 arg2 arg3 s1-0)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
(defmethod
|
|
dummy-12
|
|
effect-control
|
|
((obj effect-control)
|
|
(arg0 symbol)
|
|
(arg1 basic)
|
|
(arg2 int)
|
|
(arg3 basic)
|
|
(arg4 sound-name)
|
|
)
|
|
(local-vars
|
|
(r0-0 uint128)
|
|
(v1-10 uint128)
|
|
(sv-112 int)
|
|
(sv-128 sound-name)
|
|
(sv-144 basic)
|
|
(sv-160 (function vector vector float))
|
|
)
|
|
(set! sv-144 arg3)
|
|
(let ((s0-0 arg4)
|
|
(gp-0 (new 'stack 'sound-spec))
|
|
(s5-0 (if (< arg2 0)
|
|
(the-as vector #f)
|
|
(vector<-cspace!
|
|
(new 'stack-no-clear 'vector)
|
|
(-> obj process node-list data arg2)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(set! (-> gp-0 sound-name) s0-0)
|
|
(logior! (-> gp-0 mask) 1)
|
|
(set! (-> gp-0 volume) 1024)
|
|
(logior! (-> gp-0 mask) 4)
|
|
(set!
|
|
(-> gp-0 bend)
|
|
(the int (* 327.66998 (rand-vu-float-range -100.0 100.0)))
|
|
)
|
|
(set! sv-112 0)
|
|
(let* ((t9-3 (method-of-type res-lump get-property-data))
|
|
(a1-6 'effect-param)
|
|
(a2-1 'exact)
|
|
(a3-1 arg1)
|
|
(t0-1 #f)
|
|
(t1-1 (the-as (pointer int) (& sv-112)))
|
|
(t2-0 *res-static-buf*)
|
|
(a1-7
|
|
(t9-3
|
|
(the-as res-lump sv-144)
|
|
a1-6
|
|
a2-1
|
|
(the-as float a3-1)
|
|
(the-as pointer t0-1)
|
|
(the-as (pointer res-tag) t1-1)
|
|
t2-0
|
|
)
|
|
)
|
|
)
|
|
(when a1-7
|
|
(let ((t9-4 effect-param->sound-spec)
|
|
(a0-5 gp-0)
|
|
)
|
|
(let ((v1-9 (the-as uint128 sv-112)))
|
|
(.pcpyud v1-10 v1-9 r0-0)
|
|
)
|
|
(t9-4
|
|
a0-5
|
|
(the-as (pointer float) a1-7)
|
|
(shr (* (the-as int v1-10) 2) 49)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(if
|
|
(and
|
|
(nonzero? (-> gp-0 fo-max))
|
|
(let ((f30-1 (* 4096.0 (the float (-> gp-0 fo-max)))))
|
|
(set! sv-160 vector-vector-distance)
|
|
(let ((a0-6 (ear-trans))
|
|
(a1-8 s5-0)
|
|
)
|
|
(< f30-1 (sv-160 a0-6 a1-8))
|
|
)
|
|
)
|
|
)
|
|
(return 0)
|
|
)
|
|
(when *debug-effect-control*
|
|
(set! sv-128 s0-0)
|
|
(string<-charp (clear *temp-string*) (the-as (pointer uint8) (& sv-128)))
|
|
(format
|
|
#t
|
|
"(~5D) effect sound ~A ~A (~S) frame ~F joint ~D "
|
|
(-> *display* base-frame-counter)
|
|
(-> obj process name)
|
|
arg0
|
|
*temp-string*
|
|
arg1
|
|
arg2
|
|
)
|
|
(format
|
|
#t
|
|
"volume: ~f pitch-mod: ~f~%"
|
|
(* 0.09765625 (the float (-> gp-0 volume)))
|
|
(* 0.000656168 (the float (-> gp-0 pitch-mod)))
|
|
)
|
|
)
|
|
(sound-play-by-spec gp-0 (new-sound-id) s5-0)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defbehavior target-land-effect target ()
|
|
(cond
|
|
((logtest? (-> self control root-prim prim-core action) #x4000)
|
|
(dummy-10 (-> self skel effect) 'effect-land-poof -1.0 -1)
|
|
(dummy-10 (-> self skel effect) 'effect-flut-land -1.0 -1)
|
|
)
|
|
((logtest? (-> self control root-prim prim-core action) 512)
|
|
(sound-play-by-name
|
|
(sound-name-with-material
|
|
'zoom-land
|
|
(the-as int (-> self control ground-pat))
|
|
""
|
|
)
|
|
(new-sound-id)
|
|
(the
|
|
int
|
|
(*
|
|
10.24
|
|
(*
|
|
100.0
|
|
(the
|
|
float
|
|
(the
|
|
int
|
|
(* 10.24 (* 0.000016276043 (-> self control ground-impact-vel)))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
0
|
|
1
|
|
#t
|
|
)
|
|
)
|
|
((logtest? (-> self water flags) 512)
|
|
(dummy-10 (-> self skel effect) 'effect-land-water -1.0 -1)
|
|
)
|
|
(else
|
|
(dummy-10 (-> self skel effect) 'effect-land-poof -1.0 -1)
|
|
(dummy-10 (-> self skel effect) 'effect-land -1.0 -1)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
|
|
|
|
|