jak-project/goal_src/jak2/engine/target/surface-h.gc
ManDude cd68cb671e
deftype and defmethod syntax major changes (#3094)
Major change to how `deftype` shows up in our code:
- the decompiler will no longer emit the `offset-assert`,
`method-count-assert`, `size-assert` and `flag-assert` parameters. There
are extremely few cases where having this in the decompiled code is
helpful, as the types there come from `all-types` which already has
those parameters. This also doesn't break type consistency because:
  - the asserts aren't compared.
- the first step of the test uses `all-types`, which has the asserts,
which will throw an error if they're bad.
- the decompiler won't emit the `heap-base` parameter unless necessary
now.
- the decompiler will try its hardest to turn a fixed-offset field into
an `overlay-at` field. It falls back to the old offset if all else
fails.
- `overlay-at` now supports field "dereferencing" to specify the offset
that's within a field that's a structure, e.g.:
```lisp
(deftype foobar (structure)
  ((vec    vector  :inline)
   (flags  int32   :overlay-at (-> vec w))
   )
  )
```
in this structure, the offset of `flags` will be 12 because that is the
final offset of `vec`'s `w` field within this structure.
- **removed ID from all method declarations.** IDs are only ever
automatically assigned now. Fixes #3068.
- added an `:overlay` parameter to method declarations, in order to
declare a new method that goes on top of a previously-defined method.
Syntax is `:overlay <method-name>`. Please do not ever use this.
- added `state-methods` list parameter. This lets you quickly specify a
list of states to be put in the method table. Same syntax as the
`states` list parameter. The decompiler will try to put as many states
in this as it can without messing with the method ID order.

Also changes `defmethod` to make the first type definition (before the
arguments) optional. The type can now be inferred from the first
argument. Fixes #3093.

---------

Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
2023-10-30 03:20:02 +00:00

1195 lines
42 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: surface-h.gc
;; name in dgo: surface-h
;; dgos: ENGINE, GAME
(declare-type target process-focusable)
(define-extern rail-surface-touch (function none :behavior target))
(define-extern gravel-surface-touch (function none))
(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
)
(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)
;; DECOMP BEGINS
(deftype surface (basic)
((name symbol)
(turnv float)
(turnvv float)
(tiltv float)
(tiltvv float)
(transv-max float)
(target-speed float)
(seek0 float)
(seek90 float)
(seek180 float)
(fric float)
(nonlin-fric-dist float)
(slip-factor float)
(slide-factor float)
(slope-up-factor float)
(slope-down-factor float)
(slope-slip-angle float)
(impact-fric float)
(bend-factor float)
(bend-speed float)
(alignv float)
(slope-up-traction float)
(align-speed float)
(slope-change-preserve float)
(turnvf float)
(turnvvf float)
(tiltvf float)
(tiltvvf float)
(vel-turn float)
(active-hook (function none) :offset 128)
(touch-hook (function none) :offset 132)
(impact-hook (function control-info (pointer float) vector none) :offset 136)
(mult-hook (function surface surface surface int none))
(exit-hook function)
(mode symbol)
(flags surface-flag)
(data float 30 :overlay-at turnv)
(hook function 4 :overlay-at active-hook)
(dataw uint32 2 :overlay-at mode)
)
)
(defun calc-terminal-vel ((arg0 float) (arg1 float) (arg2 float))
(- (* (/ (- (* 0.016666668 arg0) arg1) arg2) (- 1.0 arg2)) arg1)
)
(defun calc-terminal2-vel ((arg0 float) (arg1 float) (arg2 float) (arg3 float))
(let ((f0-4 (sqrtf (/ (- (* 0.016666668 arg0) arg1) arg2))))
(- f0-4 (+ arg1 (* arg2 (* f0-4 f0-4))))
)
)
(defun calc-terminal4-vel ((arg0 float) (arg1 float) (arg2 float))
(let ((f0-5 (sqrtf (sqrtf (/ (- (* 0.016666668 arg0) arg1) arg2)))))
(- f0-5 (+ arg1 (* arg2 (* f0-5 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
:turnvv 524288.0
:tiltv 65536.0
:tiltvv 262144.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
:turnvf 30.0
:turnvvf 30.0
:tiltvf 150.0
:tiltvvf 15.0
:flags (surface-flag look-around)
)
)
(define *walk-no-turn-mods* (new 'static 'surface
:name 'run
:tiltv 65536.0
:tiltvv 262144.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
:tiltvf 150.0
:tiltvvf 15.0
)
)
(define *turn-around-mods* (new 'static 'surface
:name 'run
:tiltv 65536.0
:tiltvv 262144.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
:tiltvf 150.0
:tiltvvf 15.0
)
)
(define *jump-mods* (new 'static 'surface
:name 'jump
:turnv 131072.0
:turnvv 18204.445
:tiltv 32768.0
:tiltvv 262144.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
:turnvf 30.0
:turnvvf 30.0
:tiltvf 150.0
:tiltvvf 15.0
:mode 'air
:flags (surface-flag check-edge air)
)
)
(define *double-jump-mods* (new 'static 'surface
:name 'jump-double
:turnv 131072.0
:turnvv 18204.445
:tiltv 32768.0
:tiltvv 262144.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
:turnvf 30.0
:turnvvf 30.0
:tiltvf 150.0
:tiltvvf 15.0
:mode 'air
:flags (surface-flag check-edge air)
)
)
(define *smack-jump-mods* (new 'static 'surface
:name 'jump
:turnv 131072.0
:turnvv 18204.445
:tiltv 32768.0
:tiltvv 262144.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
:turnvf 30.0
:turnvvf 30.0
:tiltvf 150.0
:tiltvvf 15.0
:mode 'air
:flags (surface-flag check-edge air gun-inactive)
)
)
(define *high-jump-mods* (new 'static 'surface
:name 'high-jump
:turnv 131072.0
:turnvv 65536.0
:tiltv 32768.0
:tiltvv 262144.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
:turnvf 30.0
:turnvvf 30.0
:tiltvf 150.0
:tiltvvf 15.0
:mode 'air
:flags (surface-flag check-edge air)
)
)
(define *launch-jump-mods* (new 'static 'surface
:name 'launch-jump
:turnv 131072.0
:turnvv 65536.0
:tiltv 32768.0
:tiltvv 262144.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
:turnvf 30.0
:turnvvf 30.0
:tiltvf 150.0
:tiltvvf 15.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
:turnvv 65536.0
:tiltv 32768.0
:tiltvv 262144.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
:turnvf 30.0
:turnvvf 30.0
:tiltvf 150.0
:tiltvvf 15.0
:mode 'air
:flags (surface-flag check-edge air)
)
)
(define *flip-jump-mods* (new 'static 'surface
:name 'high-jump
:turnv 131072.0
:turnvv 65536.0
:tiltv 32768.0
:tiltvv 262144.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
:turnvf 30.0
:turnvvf 30.0
:tiltvf 150.0
:tiltvvf 15.0
:mode 'air
:flags (surface-flag check-edge air)
)
)
(define *forward-jump-mods* (new 'static 'surface
:name 'jump
:turnv 131072.0
:turnvv 18204.445
:tiltv 32768.0
:tiltvv 262144.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
:turnvf 30.0
:turnvvf 30.0
:tiltvf 150.0
:tiltvvf 15.0
:mode 'air
:flags (surface-flag check-edge air)
)
)
(define *forward-pole-jump-mods* (new 'static 'surface
:name 'jump
:turnv 131072.0
:turnvv 18204.445
:tiltv 32768.0
:tiltvv 262144.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
:turnvf 30.0
:turnvvf 30.0
:tiltvf 150.0
:tiltvvf 15.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
:turnvv 5461.3335
:tiltv 32768.0
:tiltvv 262144.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
:turnvf 30.0
:turnvvf 30.0
:tiltvf 150.0
:tiltvvf 15.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
:tiltvv 262144.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
:tiltvf 150.0
:tiltvvf 15.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
:tiltvv 262144.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
:tiltvf 150.0
:tiltvvf 15.0
:mode 'attack
:flags (surface-flag air attack gun-inactive gun-no-twist)
)
)
(let ((a0-9 (new 'static 'surface
:name 'flop
:turnv 9102.223
:turnvv 9102.223
:tiltv 32768.0
:tiltvv 262144.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
:turnvf 30.0
:turnvvf 30.0
:tiltvf 150.0
:tiltvvf 15.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
:turnvv 524288.0
:tiltv 65536.0
:tiltvv 262144.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
:turnvf 30.0
:turnvvf 30.0
:tiltvf 150.0
:tiltvvf 15.0
:mode 'wade
:flags (surface-flag look-around)
)
)
(define *swim-mods* (new 'static 'surface
:name 'swim
:turnv 49152.0
:turnvv 524288.0
:tiltv 65536.0
:tiltvv 262144.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
:turnvf 30.0
:turnvvf 30.0
:tiltvf 150.0
:tiltvvf 15.0
:mode 'swim
:flags (surface-flag gun-off)
)
)
(define *dive-mods* (new 'static 'surface
:name 'swim
:turnv 21845.334
:turnvv 32768.0
:tiltv 65536.0
:tiltvv 262144.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
:turnvf 30.0
:turnvvf 30.0
:tiltvf 150.0
:tiltvvf 15.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
:turnvv 32768.0
:tiltv 65536.0
:tiltvv 262144.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
:turnvf 30.0
:turnvvf 30.0
:tiltvf 150.0
:tiltvvf 15.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 ((a0-14 (copy *walk-mods* 'global)))
(set! (-> a0-14 name) 'grab)
(set! (-> a0-14 flags) (surface-flag))
(set! *grab-mods* a0-14)
)
(let ((v1-34 (copy *walk-mods* 'global)))
(set! (-> v1-34 name) 'edge-grab)
(set! (-> v1-34 flags) (surface-flag gun-inactive gun-no-twist))
(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 *neutral-mods* (new 'static 'surface
:name 'walk
:turnv 131072.0
:turnvv 524288.0
:tiltv 65536.0
:tiltvv 262144.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
:turnvf 30.0
:turnvvf 30.0
:tiltvf 150.0
:tiltvvf 15.0
)
)
(let ((v1-37 (new 'static 'surface
:name '*stone-surface*
:turnv 1.0
:turnvv 1.0
:tiltv 1.0
:tiltvv 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 8192.0
: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
:turnvf 1.0
:turnvvf 1.0
:tiltvf 1.0
:tiltvvf 1.0
:vel-turn 1.0
)
)
)
(set! *stone-surface* v1-37)
(set! (-> v1-37 exit-hook) nothing)
(set! (-> v1-37 mult-hook) (the-as (function surface surface surface int none) nothing))
(set! (-> v1-37 touch-hook) nothing)
(set! (-> v1-37 active-hook) nothing)
)
(let ((v1-38 (new 'static 'surface
:name '*gravel-surface*
:turnv 1.0
:turnvv 1.0
:tiltv 1.0
:tiltvv 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 8192.0
: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
:turnvf 1.0
:turnvvf 1.0
:tiltvf 1.0
:tiltvvf 1.0
:vel-turn 1.0
)
)
)
(set! *gravel-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) (lambda () (gravel-surface-touch) (none)))
(set! (-> v1-38 active-hook) nothing)
)
(let ((v1-39 (new 'static 'surface
:name '*edge-surface*
:turnv 1.0
:turnvv 1.0
:tiltv 1.0
:tiltvv 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 8192.0
:bend-factor 0.8
:bend-speed 4.0
:alignv 1.0
:align-speed 1.0
:turnvf 1.0
:turnvvf 1.0
:tiltvf 1.0
:tiltvvf 1.0
:vel-turn 1.0
)
)
)
(set! *edge-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) nothing)
(set! (-> v1-39 active-hook) nothing)
)
(let ((v1-40 (new 'static 'surface
:name '*wade-surface*
:turnv 1.0
:turnvv 1.0
:tiltv 1.0
:tiltvv 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 8192.0
:impact-fric 1.0
:bend-factor 0.8
:bend-speed 4.0
:alignv 0.6
:slope-up-traction 1.0
:align-speed 0.6
:turnvf 1.0
:turnvvf 1.0
:tiltvf 1.0
:tiltvvf 1.0
:vel-turn 1.0
)
)
)
(set! *wade-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) nothing)
(set! (-> v1-40 active-hook) nothing)
)
(let ((v1-41 (new 'static 'surface
:name '*quicksand-surface*
:turnv 0.25
:turnvv 1.0
:tiltv 1.0
:tiltvv 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 8192.0
:impact-fric 1.0
:bend-factor 0.8
:bend-speed 4.0
:alignv 0.5
:slope-up-traction 1.0
:align-speed 0.5
:turnvf 1.0
:turnvvf 1.0
:tiltvf 1.0
:tiltvvf 1.0
:vel-turn 1.0
)
)
)
(set! *quicksand-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 '*tar-surface*
:turnv 0.25
:turnvv 1.0
:tiltv 1.0
:tiltvv 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 8192.0
:impact-fric 1.0
:bend-factor 0.8
:bend-speed 4.0
:alignv 0.5
:slope-up-traction 1.0
:align-speed 0.5
:turnvf 1.0
:turnvvf 1.0
:tiltvf 1.0
:tiltvvf 1.0
:vel-turn 1.0
)
)
)
(set! *tar-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 '*ice-surface*
:turnv 0.5
:turnvv 1.0
:tiltv 1.0
:tiltvv 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
:turnvf 1.0
:turnvvf 1.0
:tiltvf 1.0
:tiltvvf 1.0
:vel-turn 1.0
:flags (surface-flag no-turn-around turn-to-pad)
)
)
)
(set! *ice-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 '*rail-surface*
:turnv 1.0
:turnvv 1.0
:tiltv 1.0
:tiltvv 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 8192.0
: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
:turnvf 1.0
:turnvvf 1.0
:tiltvf 1.0
:tiltvvf 1.0
:vel-turn 1.0
:flags (surface-flag no-attack)
)
)
)
(set! *rail-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) (lambda () (rail-surface-touch) (none)))
(set! (-> v1-44 active-hook) nothing)
)
(define *standard-ground-surface* *stone-surface*)
(define *swim-surface* *stone-surface*)