Files
jak-project/goal_src/jak3/engine/target/surface-h.gc
T
water111 637990314b wip: better stack var support (#4222)
Closes #736

---------

Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
2026-04-19 00:14:44 +02:00

1254 lines
47 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: surface-h.gc
;; name in dgo: surface-h
;; dgos: GAME
;; +++surface-flag
;; TODO copied from jak 2
(defenum surface-flag
:bitfield #t
:type uint32
(look-around 0) ;; 1
(xz-local 1) ;; 2
(smooth-collision 2) ;; 4
(no-turn-around 3) ;; 8
(turn-to-pad 4) ;; 16
(turn-to-vel 5) ;; 32
(no-jump 6) ;; 64
(no-attack 7) ;; 128
(no-hands 8) ;; 256
(no-feet 9) ;; 512
(check-edge 10) ;; 1024
(air 11) ;; 2048
(attack 12) ;; 4096
(duck 13) ;; 8192
(momentum 14) ;; 16384
(turn-when-centered 15) ;; 32768
(turn-to-alt 16) ;; hi 1
(spin 17) ;; hi 2
(super 18) ;; hi 4
(gun-inactive 19) ;; hi 8
(gun-hide 20) ;; hi 16
(gun-off 21) ;; hi 32
(gun-fast-exit 22) ;; hi 64
(gun-direct 23) ;; hi 128
(gun-strafe 24) ;; hi 256
(gun-no-twist 25) ;; hi 512
(laser-hide 26) ;; hi 1024
(no-board 27) ;; hi 2048
(gun-turn-fast 28) ;; hi 4096
(sf29 29)
)
;; ---surface-flag
(declare-type target process-focusable)
(define-extern rail-surface-touch (function none :behavior target))
(define-extern gravel-surface-touch (function none :behavior target))
(define-extern mushroom-surface-touch (function none :behavior target))
(declare-type collide-shape trsqv)
(declare-type collide-shape-moving collide-shape)
(declare-type control-info collide-shape-moving)
(declare-type surface basic)
(define-extern *dark-jump-mods* surface)
(define-extern *flop-land-mods* surface)
(define-extern *pole-mods* surface)
(define-extern *grab-mods* surface)
(define-extern *edge-grab-mods* surface)
(define-extern *stone-surface* surface)
(define-extern *gravel-surface* surface)
(define-extern *edge-surface* surface)
(define-extern *wade-surface* surface)
(define-extern *quicksand-surface* surface)
(define-extern *tar-surface* surface)
(define-extern *ice-surface* surface)
(define-extern *rail-surface* surface)
(define-extern *mushroom-surface* surface)
;; DECOMP BEGINS
(deftype surface (basic)
"Definition of a bunch of parameters for different types of surfaces.
Parameters include values such as max speed, friction, callback functions that run
on impact, during touch, on exit, etc."
((name symbol)
(data float 30)
(turnv float :overlay-at (-> data 0))
(turnvf float :overlay-at (-> data 23))
(turnvv float :overlay-at (-> data 1))
(turnvvf float :overlay-at (-> data 24))
(tiltv float :overlay-at (-> data 2))
(tiltvf float :overlay-at (-> data 25))
(tiltvv float :overlay-at (-> data 3))
(tiltvvf float :overlay-at (-> data 26))
(vel-turn float :overlay-at (-> data 27))
(transv-max float :overlay-at (-> data 4))
(target-speed float :overlay-at (-> data 5))
(seek0 float :overlay-at (-> data 6))
(seek90 float :overlay-at (-> data 7))
(seek180 float :overlay-at (-> data 8))
(fric float :overlay-at (-> data 9))
(nonlin-fric-dist float :overlay-at (-> data 10))
(slip-factor float :overlay-at (-> data 11))
(slide-factor float :overlay-at (-> data 12))
(slope-up-factor float :overlay-at (-> data 13))
(slope-down-factor float :overlay-at (-> data 14))
(slope-slip-angle float :overlay-at (-> data 15))
(impact-fric float :overlay-at (-> data 16))
(bend-factor float :overlay-at (-> data 17))
(bend-speed float :overlay-at (-> data 18))
(alignv float :overlay-at (-> data 19))
(slope-up-traction float :overlay-at (-> data 20))
(align-speed float :overlay-at (-> data 21))
(slope-change-preserve float :overlay-at (-> data 22))
(hook function 5)
(active-hook (function none) :overlay-at (-> hook 0))
(touch-hook (function none) :overlay-at (-> hook 1))
(impact-hook (function control-info (pointer float) vector none) :overlay-at (-> hook 2))
(mult-hook (function surface surface surface int none) :overlay-at (-> hook 3))
(exit-hook function :overlay-at (-> hook 4))
(dataw uint32 2)
(mode symbol :overlay-at (-> dataw 0))
(flags surface-flag :overlay-at (-> dataw 1))
)
)
(defun calc-terminal-vel ((arg0 float) (arg1 float) (arg2 float))
(- (* (/ (- (/ arg0 60) arg1) arg2) (- 1.0 arg2)) arg1)
)
(defun calc-terminal2-vel ((arg0 float) (arg1 float) (arg2 float) (arg3 float))
(let ((f0-4 (sqrtf (/ (- (/ arg0 60) arg1) arg2))))
(- f0-4 (+ arg1 (* arg2 (square f0-4))))
)
)
(defun calc-terminal4-vel ((arg0 float) (arg1 float) (arg2 float))
(let ((f0-5 (sqrtf (sqrtf (/ (- (/ arg0 60) arg1) arg2)))))
(- f0-5 (+ arg1 (* arg2 (* (square f0-5) f0-5 f0-5))))
)
)
;; ERROR: Function may read a register that is not set: t3
(defmethod print ((this surface))
(local-vars (t3-0 none))
(format
#t
"#<surface f0:~m f1:~f tf+:~f tf-:~f sf:~f tvv:~m"
(-> this turnv)
(-> this turnvv)
(-> this tiltv)
(-> this tiltvv)
(-> this transv-max)
t3-0
)
(format #t " tm:~m rv:~R rvv:~R @ #x~X>" (-> this target-speed) (-> this seek0) (-> this seek90) this)
this
)
(defun surface-interp! ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 float))
(dotimes (v1-0 30)
(set! (-> arg0 data v1-0) (+ (* (-> arg2 data v1-0) arg3) (* (-> arg1 data v1-0) (- 1.0 arg3))))
)
(dotimes (v1-3 5)
(set! (-> arg0 hook v1-3) (cond
((and (nonzero? (-> arg2 hook v1-3)) (!= (-> arg2 hook v1-3) nothing))
(-> arg2 hook v1-3)
)
((and (nonzero? (-> arg1 hook v1-3)) (!= (-> arg1 hook v1-3) nothing))
(-> arg1 hook v1-3)
)
(else
nothing
)
)
)
)
(dotimes (v1-6 2)
(set! (-> arg0 dataw v1-6) (-> arg2 dataw v1-6))
)
arg0
)
(defun surface-mult! ((arg0 surface) (arg1 surface) (arg2 surface))
(dotimes (v1-0 30)
(set! (-> arg0 data v1-0) (* (-> arg2 data v1-0) (-> arg1 data v1-0)))
)
(dotimes (v1-3 5)
(set! (-> arg0 hook v1-3) (cond
((and (nonzero? (-> arg2 hook v1-3)) (!= (-> arg2 hook v1-3) nothing))
(-> arg2 hook v1-3)
)
((and (nonzero? (-> arg1 hook v1-3)) (!= (-> arg1 hook v1-3) nothing))
(-> arg1 hook v1-3)
)
(else
nothing
)
)
)
)
(dotimes (v1-6 2)
(set! (-> arg0 dataw v1-6) (-> arg2 dataw v1-6))
)
(set! (-> arg0 flags) (logior (-> arg1 flags) (-> arg2 flags)))
((-> arg0 mult-hook) arg0 arg1 arg2 1)
arg0
)
;; WARN: Return type mismatch float vs none.
(defun surface-clamp-speed ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int))
(when (= arg3 1)
(set! (-> arg0 transv-max) (fmin (-> arg0 transv-max) (-> arg1 transv-max)))
(set! (-> arg0 target-speed) (fmin (-> arg0 target-speed) (-> arg1 target-speed)))
)
(none)
)
(define *walk-mods* (new 'static 'surface
:name 'run
:turnv 131072.0
:turnvf 30.0
:turnvv 524288.0
:turnvvf 30.0
:tiltv 65536.0
:tiltvf 150.0
:tiltvv 262144.0
:tiltvvf 15.0
:transv-max 40960.0
:target-speed 40960.0
:seek0 1.0
:seek90 1.0
:seek180 1.0
:fric 1.0
:nonlin-fric-dist 1.0
:slip-factor 1.0
:slide-factor 1.0
:slope-up-factor 1.0
:slope-down-factor 1.0
:slope-slip-angle 1.0
:impact-fric 1.0
:bend-factor 1.0
:bend-speed 1.0
:alignv 1.0
:slope-up-traction 1.0
:align-speed 1.0
:flags (surface-flag look-around)
)
)
(define *walk-no-turn-mods* (new 'static 'surface
:name 'run
:tiltv 65536.0
:tiltvf 150.0
:tiltvv 262144.0
:tiltvvf 15.0
:transv-max 40960.0
:target-speed 40960.0
:seek0 1.0
:seek90 1.0
:seek180 1.0
:fric 1.0
:nonlin-fric-dist 1.0
:slip-factor 1.0
:slide-factor 1.0
:slope-up-factor 1.0
:slope-down-factor 1.0
:slope-slip-angle 1.0
:impact-fric 1.0
:bend-factor 1.0
:bend-speed 1.0
:alignv 1.0
:slope-up-traction 1.0
:align-speed 1.0
)
)
(define *turn-around-mods* (new 'static 'surface
:name 'run
:tiltv 65536.0
:tiltvf 150.0
:tiltvv 262144.0
:tiltvvf 15.0
:transv-max 40960.0
:target-speed 40960.0
:fric 0.1
:nonlin-fric-dist 1.0
:slip-factor 1.0
:slide-factor 1.0
:slope-up-factor 1.0
:slope-down-factor 1.0
:slope-slip-angle 1.0
:impact-fric 1.0
:bend-factor 1.0
:bend-speed 1.0
:alignv 1.0
:slope-up-traction 1.0
:align-speed 1.0
:flags (surface-flag no-turn-around)
)
)
(define *jump-mods* (new 'static 'surface
:name 'jump
:turnv 131072.0
:turnvf 30.0
:turnvv 18204.445
:turnvvf 30.0
:tiltv 32768.0
:tiltvf 150.0
:tiltvv 262144.0
:tiltvvf 15.0
:transv-max 40960.0
:target-speed 40960.0
:seek0 0.3
:seek90 0.3
:seek180 0.3
:fric 0.2
:nonlin-fric-dist 1.0
:slip-factor 1.0
:slide-factor 1.0
:slope-up-factor 1.0
:slope-down-factor 1.0
:slope-slip-angle 1.0
:impact-fric 1.0
:bend-factor 1.0
:bend-speed 1.0
:alignv 1.0
:slope-up-traction 1.0
:align-speed 1.0
:mode 'air
:flags (surface-flag check-edge air)
)
)
(define *double-jump-mods* (new 'static 'surface
:name 'jump-double
:turnv 131072.0
:turnvf 30.0
:turnvv 18204.445
:turnvvf 30.0
:tiltv 32768.0
:tiltvf 150.0
:tiltvv 262144.0
:tiltvvf 15.0
:transv-max 32768.0
:target-speed 32768.0
:seek0 0.3
:seek90 0.3
:seek180 0.3
:fric 0.2
:nonlin-fric-dist 1.0
:slip-factor 1.0
:slide-factor 1.0
:slope-up-factor 1.0
:slope-down-factor 1.0
:slope-slip-angle 1.0
:impact-fric 1.0
:bend-factor 1.0
:bend-speed 1.0
:alignv 1.0
:slope-up-traction 1.0
:align-speed 1.0
:mode 'air
:flags (surface-flag check-edge air)
)
)
(define *smack-jump-mods* (new 'static 'surface
:name 'jump
:turnv 131072.0
:turnvf 30.0
:turnvv 18204.445
:turnvvf 30.0
:tiltv 32768.0
:tiltvf 150.0
:tiltvv 262144.0
:tiltvvf 15.0
:transv-max 40960.0
:target-speed 40960.0
:seek0 0.3
:seek90 0.3
:seek180 0.3
:fric 0.05
:nonlin-fric-dist 1.0
:slip-factor 1.0
:slide-factor 1.0
:slope-up-factor 1.0
:slope-down-factor 1.0
:slope-slip-angle 1.0
:impact-fric 1.0
:bend-factor 1.0
:bend-speed 1.0
:alignv 1.0
:slope-up-traction 1.0
:align-speed 1.0
:mode 'air
:flags (surface-flag check-edge air gun-inactive)
)
)
(define *high-jump-mods* (new 'static 'surface
:name 'high-jump
:turnv 131072.0
:turnvf 30.0
:turnvv 65536.0
:turnvvf 30.0
:tiltv 32768.0
:tiltvf 150.0
:tiltvv 262144.0
:tiltvvf 15.0
:transv-max 26624.0
:target-speed 26624.0
:seek0 0.9
:seek90 0.9
:seek180 0.9
:fric 0.3
:nonlin-fric-dist 1.0
:slip-factor 1.0
:slide-factor 1.0
:slope-up-factor 1.0
:slope-down-factor 1.0
:slope-slip-angle 1.0
:impact-fric 1.0
:bend-factor 1.0
:bend-speed 1.0
:alignv 1.0
:slope-up-traction 1.0
:align-speed 1.0
:mode 'air
:flags (surface-flag check-edge air)
)
)
(define *launch-jump-mods* (new 'static 'surface
:name 'launch-jump
:turnv 131072.0
:turnvf 30.0
:turnvv 65536.0
:turnvvf 30.0
:tiltv 32768.0
:tiltvf 150.0
:tiltvv 262144.0
:tiltvvf 15.0
:transv-max 61440.0
:target-speed 61440.0
:seek0 0.9
:seek90 0.9
:seek180 0.9
:fric 0.3
:nonlin-fric-dist 1.0
:slip-factor 1.0
:slide-factor 1.0
:slope-up-factor 1.0
:slope-down-factor 1.0
:slope-slip-angle 1.0
:impact-fric 1.0
:bend-factor 1.0
:bend-speed 1.0
:alignv 1.0
:slope-up-traction 1.0
:align-speed 1.0
:mode 'air
:flags (surface-flag no-attack check-edge air)
)
)
(define *forward-high-jump-mods* (new 'static 'surface
:name 'high-jump
:turnv 131072.0
:turnvf 30.0
:turnvv 65536.0
:turnvvf 30.0
:tiltv 32768.0
:tiltvf 150.0
:tiltvv 262144.0
:tiltvvf 15.0
:transv-max 45056.0
:target-speed 45056.0
:seek0 0.9
:seek90 0.9
:seek180 0.9
:fric 0.3
:nonlin-fric-dist 1.0
:slip-factor 1.0
:slide-factor 1.0
:slope-up-factor 1.0
:slope-down-factor 1.0
:slope-slip-angle 1.0
:impact-fric 1.0
:bend-factor 1.0
:bend-speed 1.0
:alignv 1.0
:slope-up-traction 1.0
:align-speed 1.0
:mode 'air
:flags (surface-flag check-edge air)
)
)
(define *flip-jump-mods* (new 'static 'surface
:name 'high-jump
:turnv 131072.0
:turnvf 30.0
:turnvv 65536.0
:turnvvf 30.0
:tiltv 32768.0
:tiltvf 150.0
:tiltvv 262144.0
:tiltvvf 15.0
:transv-max 80281.6
:target-speed 51200.0
:seek0 0.9
:seek90 0.9
:seek180 0.9
:fric 0.3
:nonlin-fric-dist 1.0
:slip-factor 1.0
:slide-factor 1.0
:slope-up-factor 1.0
:slope-down-factor 1.0
:slope-slip-angle 1.0
:impact-fric 1.0
:bend-factor 1.0
:bend-speed 1.0
:alignv 1.0
:slope-up-traction 1.0
:align-speed 1.0
:mode 'air
:flags (surface-flag check-edge air)
)
)
(define *forward-jump-mods* (new 'static 'surface
:name 'jump
:turnv 131072.0
:turnvf 30.0
:turnvv 18204.445
:turnvvf 30.0
:tiltv 32768.0
:tiltvf 150.0
:tiltvv 262144.0
:tiltvvf 15.0
:transv-max 65536.0
:target-speed 65536.0
:seek0 0.3
:seek90 0.3
:seek180 0.3
:fric 0.05
:nonlin-fric-dist 1.0
:slip-factor 1.0
:slide-factor 1.0
:slope-up-factor 1.0
:slope-down-factor 1.0
:slope-slip-angle 1.0
:impact-fric 1.0
:bend-factor 1.0
:bend-speed 1.0
:alignv 1.0
:slope-up-traction 1.0
:align-speed 1.0
:mode 'air
:flags (surface-flag check-edge air)
)
)
(define *forward-pole-jump-mods* (new 'static 'surface
:name 'jump
:turnv 131072.0
:turnvf 30.0
:turnvv 18204.445
:turnvvf 30.0
:tiltv 32768.0
:tiltvf 150.0
:tiltvv 262144.0
:tiltvvf 15.0
:transv-max 53248.0
:target-speed 53248.0
:seek0 0.3
:seek90 0.3
:seek180 0.3
:fric 0.05
:nonlin-fric-dist 1.0
:slip-factor 1.0
:slide-factor 1.0
:slope-up-factor 1.0
:slope-down-factor 1.0
:slope-slip-angle 1.0
:impact-fric 1.0
:bend-factor 1.0
:bend-speed 1.0
:alignv 1.0
:slope-up-traction 1.0
:align-speed 1.0
:mode 'air
:flags (surface-flag check-edge air gun-hide gun-fast-exit)
)
)
(let ((v1-20 (copy *jump-mods* 'global)))
(set! (-> v1-20 flags) (surface-flag check-edge air super))
(set! (-> v1-20 name) 'high-jump)
(set! (-> v1-20 target-speed) 245760.0)
(set! (-> v1-20 transv-max) 245760.0)
(set! (-> v1-20 seek0) 0.9)
(set! *dark-jump-mods* v1-20)
)
(define *roll-mods* (new 'static 'surface
:name 'roll
:turnv 131072.0
:turnvf 30.0
:turnvv 5461.3335
:turnvvf 30.0
:tiltv 32768.0
:tiltvf 150.0
:tiltvv 262144.0
:tiltvvf 15.0
:transv-max 91750.4
:target-speed 11468.8
:seek0 1.0
:seek90 1.0
:seek180 1.0
:slip-factor 1.0
:slide-factor 1.0
:slope-up-factor 0.25
:slope-down-factor 1.0
:slope-slip-angle 1.0
:impact-fric 1.0
:bend-factor 1.0
:bend-speed 1.0
:alignv 1.0
:slope-up-traction 1.0
:align-speed 1.0
:mode 'attack
:flags (surface-flag no-turn-around attack gun-inactive gun-no-twist no-board)
)
)
(define *roll-flip-mods*
(new 'static 'surface
:name 'roll-flip
:tiltv 32768.0
:tiltvf 150.0
:tiltvv 262144.0
:tiltvvf 15.0
:transv-max 91750.4
:target-speed 103219.195
:seek90 0.5
:seek180 0.15
:slip-factor 1.0
:slide-factor 1.0
:slope-up-factor 0.25
:slope-down-factor 1.0
:slope-slip-angle 1.0
:impact-fric 1.0
:bend-factor 1.0
:bend-speed 1.0
:alignv 1.0
:slope-up-traction 1.0
:align-speed 1.0
:mode 'attack
:flags (surface-flag no-turn-around check-edge air attack gun-inactive gun-no-twist no-board)
)
)
(define *flop-mods* (new 'static 'surface
:name 'flop
:tiltv 32768.0
:tiltvf 150.0
:tiltvv 262144.0
:tiltvvf 15.0
:transv-max 40960.0
:target-speed 40960.0
:seek0 1.0
:seek90 0.3
:seek180 1.5
:slip-factor 1.0
:slide-factor 1.0
:slope-up-factor 0.25
:slope-down-factor 1.0
:slope-slip-angle 1.0
:impact-fric 1.0
:bend-factor 1.0
:bend-speed 1.0
:alignv 1.0
:slope-up-traction 1.0
:align-speed 1.0
:mode 'attack
:flags (surface-flag air attack gun-inactive gun-no-twist)
)
)
(let ((a0-9 (new 'static 'surface
:name 'flop
:turnv 9102.223
:turnvf 30.0
:turnvv 9102.223
:turnvvf 30.0
:tiltv 32768.0
:tiltvf 150.0
:tiltvv 262144.0
:tiltvvf 15.0
:transv-max 40960.0
:target-speed 40960.0
:seek0 0.3
:seek90 0.1
:seek180 0.15
:fric 0.2
:nonlin-fric-dist 1.0
:slip-factor 1.0
:slide-factor 1.0
:slope-up-factor 0.25
:slope-down-factor 1.0
:slope-slip-angle 1.0
:impact-fric 1.0
:bend-factor 1.0
:bend-speed 1.0
:alignv 1.0
:slope-up-traction 1.0
:align-speed 1.0
:mode 'air
:flags (surface-flag air gun-inactive gun-no-twist)
)
)
)
(set! (-> a0-9 mult-hook) surface-clamp-speed)
(set! *flop-land-mods* a0-9)
)
(define *wade-mods* (new 'static 'surface
:name 'wade
:turnv 131072.0
:turnvf 30.0
:turnvv 524288.0
:turnvvf 30.0
:tiltv 65536.0
:tiltvf 150.0
:tiltvv 262144.0
:tiltvvf 15.0
:transv-max 40960.0
:target-speed 40960.0
:seek0 1.0
:seek90 0.5
:seek180 0.5
:fric 1.0
:nonlin-fric-dist 1.0
:slip-factor 1.0
:slide-factor 1.0
:slope-up-factor 1.0
:slope-down-factor 1.0
:slope-slip-angle 1.0
:impact-fric 1.0
:bend-factor 1.0
:bend-speed 1.0
:alignv 1.0
:slope-up-traction 1.0
:align-speed 1.0
:mode 'wade
:flags (surface-flag look-around)
)
)
(define *swim-mods* (new 'static 'surface
:name 'swim
:turnv 49152.0
:turnvf 30.0
:turnvv 524288.0
:turnvvf 30.0
:tiltv 65536.0
:tiltvf 150.0
:tiltvv 262144.0
:tiltvvf 15.0
:transv-max 28672.0
:target-speed 28672.0
:seek0 0.75
:seek90 0.2
:seek180 0.2
:fric 0.05
:nonlin-fric-dist 1.0
:slip-factor 1.0
:slide-factor 1.0
:slope-up-factor 1.0
:slope-down-factor 1.0
:slope-slip-angle 1.0
:impact-fric 1.0
:bend-factor 1.0
:bend-speed 1.0
:alignv 1.0
:slope-up-traction 1.0
:align-speed 1.0
:mode 'swim
:flags (surface-flag gun-off)
)
)
(define *dive-mods* (new 'static 'surface
:name 'swim
:turnv 21845.334
:turnvf 30.0
:turnvv 32768.0
:turnvvf 30.0
:tiltv 65536.0
:tiltvf 150.0
:tiltvv 262144.0
:tiltvvf 15.0
:transv-max 20480.0
:target-speed 20480.0
:seek0 0.05
:seek90 0.05
:seek180 0.05
:fric 1.0
:nonlin-fric-dist 1.0
:impact-fric 1.0
:bend-factor 1.0
:bend-speed 1.0
:alignv 1.0
:align-speed 1.0
:mode 'dive
:flags (surface-flag xz-local gun-off gun-fast-exit)
)
)
(define *dive-bottom-mods* (new 'static 'surface
:name 'swim-bottom
:turnv 21845.334
:turnvf 30.0
:turnvv 32768.0
:turnvvf 30.0
:tiltv 65536.0
:tiltvf 150.0
:tiltvv 262144.0
:tiltvvf 15.0
:transv-max 20480.0
:target-speed 20480.0
:seek0 0.1
:seek90 0.05
:seek180 0.05
:fric 1.0
:nonlin-fric-dist 1.0
:slip-factor 1.0
:slide-factor 1.0
:slope-up-factor 1.0
:slope-down-factor 1.0
:slope-slip-angle 1.0
:impact-fric 1.0
:bend-factor 1.0
:bend-speed 1.0
:alignv 1.0
:slope-up-traction 1.0
:align-speed 1.0
:mode 'dive
:flags (surface-flag xz-local gun-off gun-fast-exit)
)
)
(let ((v1-30 (copy *walk-mods* 'global)))
(set! (-> v1-30 name) 'pole)
(set! (-> v1-30 flags) (surface-flag gun-hide gun-fast-exit))
(set! *pole-mods* v1-30)
)
(let ((v1-32 (copy *walk-mods* 'global)))
(set! (-> v1-32 name) 'grab)
(set! (-> v1-32 flags) (surface-flag sf29))
(set! *grab-mods* v1-32)
)
(let ((v1-34 (copy *walk-mods* 'global)))
(set! (-> v1-34 name) 'edge-grab)
(set! (-> v1-34 flags) (surface-flag gun-inactive gun-no-twist sf29))
(set! *edge-grab-mods* v1-34)
)
(define *empty-mods* (new 'static 'surface
:name 'empty
:seek0 1.0
:seek90 1.0
:seek180 1.0
:fric 1.0
:flags (surface-flag gun-off)
)
)
(define *empty-mods-allow-gun* (new 'static 'surface
:name 'empty
:seek0 1.0
:seek90 1.0
:seek180 1.0
:fric 1.0
:flags (surface-flag gun-inactive gun-no-twist sf29)
)
)
(define *neutral-mods* (new 'static 'surface
:name 'walk
:turnv 131072.0
:turnvf 30.0
:turnvv 524288.0
:turnvvf 30.0
:tiltv 65536.0
:tiltvf 150.0
:tiltvv 262144.0
:tiltvvf 15.0
:transv-max 40960.0
:target-speed 40960.0
:slip-factor 1.0
:slide-factor 1.0
:slope-up-factor 1.0
:slope-down-factor 1.0
:slope-slip-angle 1.0
:impact-fric 1.0
:bend-factor 1.0
:bend-speed 1.0
:slope-up-traction 1.0
:align-speed 1.0
)
)
(let ((v1-38 (new 'static 'surface
:name '*stone-surface*
:turnv 1.0
:turnvf 1.0
:turnvv 1.0
:turnvvf 1.0
:tiltv 1.0
:tiltvf 1.0
:tiltvv 1.0
:tiltvvf 1.0
:vel-turn 1.0
:transv-max 1.0
:target-speed 1.0
:seek0 153600.0
:seek90 153600.0
:seek180 256000.0
:fric 153600.0
:nonlin-fric-dist 5120.0
:slip-factor 1.0
:slope-down-factor 10240.0
:slope-slip-angle 10922.667
:impact-fric 1.0
:bend-factor 0.8
:bend-speed 4.0
:alignv 1.0
:slope-up-traction 1.0
:align-speed 1.0
:slope-change-preserve 1.0
)
)
)
(set! *stone-surface* v1-38)
(set! (-> v1-38 exit-hook) nothing)
(set! (-> v1-38 mult-hook) (the-as (function surface surface surface int none) nothing))
(set! (-> v1-38 touch-hook) nothing)
(set! (-> v1-38 active-hook) nothing)
)
(let ((v1-39 (new 'static 'surface
:name '*mushroom-surface*
:turnv 1.0
:turnvf 1.0
:turnvv 1.0
:turnvvf 1.0
:tiltv 1.0
:tiltvf 1.0
:tiltvv 1.0
:tiltvvf 1.0
:vel-turn 1.0
:transv-max 1.0
:target-speed 1.0
:seek0 153600.0
:seek90 153600.0
:seek180 256000.0
:fric 153600.0
:nonlin-fric-dist 5120.0
:slip-factor 0.25
:slope-down-factor 10240.0
:slope-slip-angle 10922.667
:impact-fric 1.0
:bend-factor 0.8
:bend-speed 4.0
:alignv 1.0
:slope-up-traction 1.0
:align-speed 1.0
:slope-change-preserve 1.0
)
)
)
(set! *mushroom-surface* v1-39)
(set! (-> v1-39 exit-hook) nothing)
(set! (-> v1-39 mult-hook) (the-as (function surface surface surface int none) nothing))
(set! (-> v1-39 touch-hook) (lambda () (mushroom-surface-touch) (none)))
(set! (-> v1-39 active-hook) nothing)
)
(let ((v1-40 (new 'static 'surface
:name '*gravel-surface*
:turnv 1.0
:turnvf 1.0
:turnvv 1.0
:turnvvf 1.0
:tiltv 1.0
:tiltvf 1.0
:tiltvv 1.0
:tiltvvf 1.0
:vel-turn 1.0
:transv-max 1.0
:target-speed 1.0
:seek0 153600.0
:seek90 153600.0
:seek180 256000.0
:fric 153600.0
:nonlin-fric-dist 5120.0
:slip-factor 1.0
:slide-factor 1.0
:slope-down-factor 32768.0
:slope-slip-angle 10922.667
:impact-fric 1.0
:bend-factor 0.8
:bend-speed 4.0
:alignv 1.0
:slope-up-traction 1.0
:align-speed 1.0
:slope-change-preserve 1.0
)
)
)
(set! *gravel-surface* v1-40)
(set! (-> v1-40 exit-hook) nothing)
(set! (-> v1-40 mult-hook) (the-as (function surface surface surface int none) nothing))
(set! (-> v1-40 touch-hook) (lambda () (gravel-surface-touch) (none)))
(set! (-> v1-40 active-hook) nothing)
)
(let ((v1-41 (new 'static 'surface
:name '*edge-surface*
:turnv 1.0
:turnvf 1.0
:turnvv 1.0
:turnvvf 1.0
:tiltv 1.0
:tiltvf 1.0
:tiltvv 1.0
:tiltvvf 1.0
:vel-turn 1.0
:transv-max 1.0
:target-speed 1.0
:seek0 153600.0
:seek90 153600.0
:seek180 256000.0
:fric 30720.0
:nonlin-fric-dist 5120.0
:slip-factor 1.0
:slope-down-factor 18432.0
:slope-slip-angle 10922.667
:bend-factor 0.8
:bend-speed 4.0
:alignv 1.0
:align-speed 1.0
)
)
)
(set! *edge-surface* v1-41)
(set! (-> v1-41 exit-hook) nothing)
(set! (-> v1-41 mult-hook) (the-as (function surface surface surface int none) nothing))
(set! (-> v1-41 touch-hook) nothing)
(set! (-> v1-41 active-hook) nothing)
)
(let ((v1-42 (new 'static 'surface
:name '*wade-surface*
:turnv 1.0
:turnvf 1.0
:turnvv 1.0
:turnvvf 1.0
:tiltv 1.0
:tiltvf 1.0
:tiltvv 1.0
:tiltvvf 1.0
:vel-turn 1.0
:transv-max 0.7
:target-speed 0.7
:seek0 153600.0
:seek90 153600.0
:seek180 256000.0
:fric 153600.0
:nonlin-fric-dist 5120.0
:slip-factor 1.0
:slope-down-factor 10240.0
:slope-slip-angle 10922.667
:impact-fric 1.0
:bend-factor 0.8
:bend-speed 4.0
:alignv 0.6
:slope-up-traction 1.0
:align-speed 0.6
)
)
)
(set! *wade-surface* v1-42)
(set! (-> v1-42 exit-hook) nothing)
(set! (-> v1-42 mult-hook) (the-as (function surface surface surface int none) nothing))
(set! (-> v1-42 touch-hook) nothing)
(set! (-> v1-42 active-hook) nothing)
)
(let ((v1-43 (new 'static 'surface
:name '*quicksand-surface*
:turnv 0.25
:turnvf 1.0
:turnvv 1.0
:turnvvf 1.0
:tiltv 1.0
:tiltvf 1.0
:tiltvv 1.0
:tiltvvf 1.0
:vel-turn 1.0
:transv-max 0.5
:target-speed 0.5
:seek0 81920.0
:seek90 83968.0
:seek180 165888.0
:fric 329728.0
:nonlin-fric-dist 5120.0
:slip-factor 1.0
:slope-down-factor 10240.0
:slope-slip-angle 10922.667
:impact-fric 1.0
:bend-factor 0.8
:bend-speed 4.0
:alignv 0.5
:slope-up-traction 1.0
:align-speed 0.5
)
)
)
(set! *quicksand-surface* v1-43)
(set! (-> v1-43 exit-hook) nothing)
(set! (-> v1-43 mult-hook) (the-as (function surface surface surface int none) nothing))
(set! (-> v1-43 touch-hook) nothing)
(set! (-> v1-43 active-hook) nothing)
)
(let ((v1-44 (new 'static 'surface
:name '*tar-surface*
:turnv 0.25
:turnvf 1.0
:turnvv 1.0
:turnvvf 1.0
:tiltv 1.0
:tiltvf 1.0
:tiltvv 1.0
:tiltvvf 1.0
:vel-turn 1.0
:transv-max 0.4
:target-speed 0.4
:seek0 81920.0
:seek90 83968.0
:seek180 165888.0
:fric 329728.0
:nonlin-fric-dist 5120.0
:slip-factor 1.0
:slope-down-factor 10240.0
:slope-slip-angle 10922.667
:impact-fric 1.0
:bend-factor 0.8
:bend-speed 4.0
:alignv 0.5
:slope-up-traction 1.0
:align-speed 0.5
)
)
)
(set! *tar-surface* v1-44)
(set! (-> v1-44 exit-hook) nothing)
(set! (-> v1-44 mult-hook) (the-as (function surface surface surface int none) nothing))
(set! (-> v1-44 touch-hook) nothing)
(set! (-> v1-44 active-hook) nothing)
)
(let ((v1-45 (new 'static 'surface
:name '*ice-surface*
:turnv 0.5
:turnvf 1.0
:turnvv 1.0
:turnvvf 1.0
:tiltv 1.0
:tiltvf 1.0
:tiltvv 1.0
:tiltvvf 1.0
:vel-turn 1.0
:transv-max 1.5
:target-speed 1.5
:seek0 24576.0
:seek90 24576.0
:seek180 24576.0
:fric 23756.8
:nonlin-fric-dist 4091904.0
:slip-factor 0.7
:slope-slip-angle 16384.0
:bend-speed 4.0
:alignv 1.0
:slope-up-traction 1.0
:align-speed 1.0
:flags (surface-flag no-turn-around turn-to-pad)
)
)
)
(set! *ice-surface* v1-45)
(set! (-> v1-45 exit-hook) nothing)
(set! (-> v1-45 mult-hook) (the-as (function surface surface surface int none) nothing))
(set! (-> v1-45 touch-hook) nothing)
(set! (-> v1-45 active-hook) nothing)
)
(let ((v1-46 (new 'static 'surface
:name '*rail-surface*
:turnv 1.0
:turnvf 1.0
:turnvv 1.0
:turnvvf 1.0
:tiltv 1.0
:tiltvf 1.0
:tiltvv 1.0
:tiltvvf 1.0
:vel-turn 1.0
:transv-max 1.0
:target-speed 1.0
:seek0 153600.0
:seek90 153600.0
:seek180 256000.0
:fric 153600.0
:nonlin-fric-dist 5120.0
:slip-factor 1.0
:slope-down-factor 10240.0
:slope-slip-angle 10922.667
:impact-fric 1.0
:bend-factor 0.8
:bend-speed 4.0
:alignv 1.0
:slope-up-traction 1.0
:align-speed 1.0
:slope-change-preserve 1.0
:flags (surface-flag no-attack)
)
)
)
(set! *rail-surface* v1-46)
(set! (-> v1-46 exit-hook) nothing)
(set! (-> v1-46 mult-hook) (the-as (function surface surface surface int none) nothing))
(set! (-> v1-46 touch-hook) (lambda () (rail-surface-touch) (none)))
(set! (-> v1-46 active-hook) nothing)
)
(define *standard-ground-surface* *stone-surface*)
(define *swim-surface* *stone-surface*)