[high fps] Increase input buffer for jak1 and jak3 (#3578)

Applying https://github.com/open-goal/jak-project/pull/3178 to jak1 and
jak3

This also fixes cloud speed in jak3

---------

Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
This commit is contained in:
Brent Hickey
2024-07-14 17:56:10 -07:00
committed by GitHub
parent bdded9ad8c
commit b8f1ee5289
21 changed files with 482 additions and 881 deletions
+97 -2
View File
@@ -156,6 +156,36 @@
(set! (-> gp-0 cpads 3) (new 'global 'cpad-info 3))
gp-0))
;; Allocates enough input frames to support counting 50ms of time at 300fps.
(deftype cpad-history (basic)
((button0-abs pad-buttons 15) ;; bitmask of buttons, pressed or not, with history
(button0-rel pad-buttons 15) ;; bitmask of if button going down.
)
)
;; List of extended history for controllers at high fps. It always has 4 controllers.
(deftype cpad-history-list (basic)
((num-cpads int32)
(cpads cpad-history 4) ;; modified from 2->4 for PC 4-pad support
)
(:methods
(new (symbol type) _type_)
)
)
(defmethod new cpad-history-list ((allocation symbol) (type-to-make type))
"Create a cpad-history-list for 4 controllers. It's fine to do this even if controllers
aren't connected yet. "
(let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
(set! (-> this num-cpads) 4)
(set! (-> this cpads 0) (new 'global 'cpad-history))
(set! (-> this cpads 1) (new 'global 'cpad-history))
(set! (-> this cpads 2) (new 'global 'cpad-history))
(set! (-> this cpads 3) (new 'global 'cpad-history))
this
)
)
(defun analog-input ((in int) (offset float) (center-val float) (max-val float) (out-range float))
"Convert integer input from pad into a float between -out-range and +out-range.
The offset is applied directly to the input.
@@ -215,6 +245,17 @@
;; the four controllers
(define *cpad-list* (new 'global 'cpad-list))
;; the cpad-history for each controller
(define *cpad-history-list* (new 'global 'cpad-history-list))
(desfun generate-frame-checks (pad-idx frames)
(if (= frames 0)
0
`(logior (-> *cpad-history-list* cpads ,pad-idx button0-rel ,(- frames 1))
,(generate-frame-checks pad-idx (- frames 1))
)
)
)
;; weird leftover debug thing, enabling overrides the x position of both sticks on all controllers.
(define *cpad-debug* #f)
@@ -226,7 +267,8 @@
;; iterate over pads
(let ((pad-list *cpad-list*))
(dotimes (pad-idx (-> pad-list num-cpads))
(let ((pad (-> *cpad-list* cpads pad-idx)))
(let ((pad (-> *cpad-list* cpads pad-idx))
(history (-> *cpad-history-list* cpads pad-idx)))
;; read from hardware.
(cpad-get-data pad)
(cond
@@ -253,12 +295,61 @@
(set! (-> pad button0-abs 1) (-> pad button0-shadow-abs 0))
(set! (-> pad button0-rel 2) (-> pad button0-rel 1))
(set! (-> pad button0-rel 1) (-> pad button0-rel 0))
;; og:preserve-this high fps fix
(when (>= (-> *pc-settings* target-fps) 300)
(set! (-> history button0-abs 14) (-> history button0-abs 13))
(set! (-> history button0-abs 13) (-> history button0-abs 12))
(set! (-> history button0-abs 12) (-> history button0-abs 11))
(set! (-> history button0-rel 14) (-> history button0-rel 13))
(set! (-> history button0-rel 13) (-> history button0-rel 12))
(set! (-> history button0-rel 12) (-> history button0-rel 11))
)
(when (>= (-> *pc-settings* target-fps) 240)
(set! (-> history button0-abs 11) (-> history button0-abs 10))
(set! (-> history button0-abs 10) (-> history button0-abs 9))
(set! (-> history button0-abs 9) (-> history button0-abs 8))
(set! (-> history button0-rel 11) (-> history button0-rel 10))
(set! (-> history button0-rel 10) (-> history button0-rel 9))
(set! (-> history button0-rel 9) (-> history button0-rel 8))
)
(when (>= (-> *pc-settings* target-fps) 165)
(set! (-> history button0-abs 8) (-> history button0-abs 7))
(set! (-> history button0-rel 8) (-> history button0-rel 7))
)
(when (>= (-> *pc-settings* target-fps) 150)
(set! (-> history button0-abs 7) (-> history button0-abs 6))
(set! (-> history button0-abs 6) (-> history button0-abs 5))
(set! (-> history button0-rel 7) (-> history button0-rel 6))
(set! (-> history button0-rel 6) (-> history button0-rel 5))
)
(when (>= (-> *pc-settings* target-fps) 120)
(set! (-> history button0-abs 5) (-> history button0-abs 4))
(set! (-> history button0-abs 4) (-> history button0-abs 3))
(set! (-> history button0-rel 5) (-> history button0-rel 4))
(set! (-> history button0-rel 4) (-> history button0-rel 3))
)
(when (>= (-> *pc-settings* target-fps) 75)
(set! (-> history button0-abs 3) (-> history button0-abs 2))
(set! (-> history button0-rel 3) (-> history button0-rel 2))
)
(set! (-> history button0-abs 2) (-> history button0-abs 1))
(set! (-> history button0-abs 1) (-> pad button0-shadow-abs 0))
(set! (-> history button0-rel 2) (-> history button0-rel 1))
(set! (-> history button0-rel 1) (-> pad button0-rel 0))
;; we might want to clear a button after it is pressed, so we back it up in a "shadow" field
(let ((current-button0 (-> pad button0)))
(set! (-> pad button0-shadow-abs 0) (the-as pad-buttons current-button0))
(set! (-> pad button0-abs 0) (the-as pad-buttons current-button0)))
(set! (-> pad button0-abs 0) (the-as pad-buttons current-button0))
(set! (-> history button0-abs 0) (-> pad button0-abs 0))
)
;; buttons going down
(set! (-> pad button0-rel 0) (logclear (-> pad button0-abs 0) (-> pad button0-abs 1)))
(set! (-> history button0-rel 0) (-> pad button0-rel 0))
;; some debugging thing they wrote at some point
(when *cpad-debug*
(set! (-> pad leftx) (the-as uint 255))
@@ -314,6 +405,10 @@
(defmacro cpad-hold? (pad-idx &rest buttons)
`(logtest? (cpad-hold ,pad-idx) (pad-buttons ,@buttons)))
(defmacro recently-pressed? (&key (pad-idx (-> self control unknown-cpad-info00 number)) &key (frames 15) &rest buttons)
"Checks if a (pad-button) was pressed within the last 50ms, based on frames"
`(logtest? ,(generate-frame-checks pad-idx frames) (pad-buttons ,@buttons)))
(defmacro cpad-clear! (pad-idx &rest buttons)
`(begin
(logclear! (cpad-pressed ,pad-idx) (pad-buttons ,@buttons))
+29 -57
View File
@@ -83,10 +83,8 @@
(defbehavior target-falling-trans target ((arg0 basic) (arg1 time-frame))
(if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) circle) (can-feet?)) (go target-attack-air #f))
(when (= arg0 'target-eco-powerup)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons x))
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(not (logtest? (-> self water flags) (water-flags wt09)))
(not (time-elapsed? (-> self state-time) (seconds 3)))
(not (logtest? (-> self state-flags) (state-flags prevent-jump))))
@@ -246,16 +244,12 @@
(set! (-> self control unknown-float81) 0.0)
(remove-exit)
(go target-duck-stance))
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons x))
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f))
(go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)))
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons circle))
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? circle)
(can-feet?))
(go target-attack))
(if (can-hands? #t) (go target-running-attack))
@@ -397,10 +391,8 @@
(target-effect-exit)
(remove-exit)
(go target-ice-walk))
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons l1 r1))
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? l1 r1)
(and (time-elapsed? (-> *TARGET-bank* wheel-timeout) (-> self control unknown-dword30))
(and (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) (can-wheel?))))
(go target-wheel))
@@ -412,16 +404,12 @@
(target-effect-exit)
(remove-exit)
(go target-stance))
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons x))
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f))
(go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)))
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons circle))
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? circle)
(can-feet?))
(go target-attack))
(if (can-hands? #t) (go target-running-attack))
@@ -623,10 +611,8 @@
:trans
(behavior ()
((-> self state-hook))
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons x))
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f))
(go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)))
(if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) circle) (can-feet?)) (go target-attack))
@@ -775,10 +761,8 @@
(and (not (or (= v1-13 eichar-duck-roll-end-ja) (= v1-13 eichar-duck-roll-ja))) (can-exit-duck?))))
(go target-stance))
(if (move-legs?) (go target-duck-walk))
(when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons x))
;; og:preserve-this - High FPS Fix
(when (and (recently-pressed? x)
(can-jump? #f))
(if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0)
(go target-high-jump (-> *TARGET-bank* duck-jump-height-min) (-> *TARGET-bank* duck-jump-height-max) 'duck)
@@ -830,10 +814,8 @@
(can-exit-duck?))
(go target-walk))
(if (not (move-legs?)) (go target-duck-stance))
(when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons x))
;; og:preserve-this - High FPS Fix
(when (and (recently-pressed? x)
(can-jump? #f))
(if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0)
(go target-high-jump (-> *TARGET-bank* duck-jump-height-min) (-> *TARGET-bank* duck-jump-height-max) 'duck)
@@ -1038,10 +1020,8 @@
:trans
(behavior ()
(target-falling-trans #f (the-as time-frame (if (ja-group? eichar-jump-loop-ja) 15 -1)))
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons square))
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? square)
(< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 73728.0)
(and (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))
(time-elapsed? (-> self control unknown-dword36) (the-as time-frame (-> *TARGET-bank* stuck-timeout)))
@@ -1209,11 +1189,9 @@
600
1500))
:trans
(behavior ()
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons x))
(behavior ()
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f))
(go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)))
(if (and (not (can-exit-duck?)) (can-duck?)) (go target-duck-stance))
@@ -1258,10 +1236,8 @@
(effect-control-method-10 (-> self skel effect) 'group-red-eco-spinkick (ja-frame-num 0) 74)
(cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1))
(level-hint-spawn (text-id misty-eco-red-first-use) "sksp0072" (the-as entity #f) *entity-pool* (game-task none)))
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons x))
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f))
(go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)))
(suspend)
@@ -1876,10 +1852,8 @@
((time-elapsed? (-> self state-hook-time) (-> *TARGET-bank* wheel-jump-post-window))
(set! (-> self state-hook) (the-as (function none :behavior target) nothing)))
(else
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons x))
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? 'target-wheel-flip))
(go target-wheel-flip (-> *TARGET-bank* wheel-flip-height) (-> *TARGET-bank* wheel-flip-dist)))))
(none)))
@@ -1959,10 +1933,8 @@
((time-elapsed? (-> self state-hook-time) (seconds 0.1))
(set! (-> self state-hook) (the-as (function none :behavior target) nothing)))
(else
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons x))
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f))
(go target-high-jump (-> *TARGET-bank* flip-jump-height-min) (-> *TARGET-bank* flip-jump-height-max) 'flip))))
(none)))
+24 -46
View File
@@ -345,11 +345,9 @@
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf))
(init-vf0-vector)
(when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons r2 circle square))
(init-vf0-vector)
;; og:preserve-this - High FPS Fix
(when (and (recently-pressed? r2 circle square)
(and (= (-> self fact eco-type) (pickup-type eco-yellow)) (>= (-> self fact eco-level) 1.0))
(time-elapsed? (-> self control unknown-dword82) (seconds 0.5))
(not *pause-lock*))
@@ -427,10 +425,8 @@
(vf5 :class vf)
(vf6 :class vf))
(init-vf0-vector)
(when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons r2 circle square))
;; og:preserve-this - High FPS Fix
(when (and (recently-pressed? r2 circle square)
(time-elapsed? (-> self control unknown-dword82) (seconds 0.45))
(and (= (-> self fact eco-type) (pickup-type eco-yellow)) (>= (-> self fact eco-level) 1.0))
(not *pause-lock*))
@@ -592,11 +588,9 @@
(logclear! (-> self control root-prim prim-core action) (collide-action swingpole-active))
(set! (-> self control unknown-handle10) (the-as handle #f)))
:trans
(behavior ()
(when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons x))
(behavior ()
;; og:preserve-this - High FPS Fix
(when (and (recently-pressed? x)
(not (logtest? (-> self state-flags) (state-flags prevent-jump)))
(time-elapsed? (-> self state-time) (seconds 0.1)))
(set! (-> self control transv quad) (the-as uint128 0))
@@ -752,10 +746,8 @@
:trans
(behavior ()
(when (and (time-elapsed? (-> self state-time) (seconds 0.2))
(logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons x))
;; og:preserve-this - High FPS Fix
(recently-pressed? x)
(not (logtest? (-> self state-flags) (state-flags prevent-jump))))
(cond
((or (< -0.2 (local-pad-angle)) (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0))
@@ -1042,10 +1034,8 @@
:frame-num
(ja-aframe (the-as float (if (= arg1 (-> *FACT-bank* eco-full-inc)) 0.0 6.0)) 0))
(until (ja-done? 0)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons x))
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(not (logtest? (-> self water flags) (water-flags wt09)))
(not (logtest? (-> self state-flags) (state-flags prevent-jump))))
(go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)))
@@ -1085,10 +1075,8 @@
(if (logtest? (-> self water flags) (water-flags wt11)) (go target-swim-stance) (go target-stance)))
(if (and (cpad-hold? (-> self control unknown-cpad-info00 number) l1 r1) (can-duck?)) (go target-duck-stance))
(if (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) (go target-wade-walk))
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons x))
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f))
(go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)))
(when (and (cpad-pressed? (-> self control unknown-cpad-info00 number) circle) (can-feet?))
@@ -1116,10 +1104,8 @@
(if (logtest? (-> self water flags) (water-flags wt11)) (go target-swim-stance) (go target-stance)))
(if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) (go target-wade-stance))
(if (and (cpad-hold? (-> self control unknown-cpad-info00 number) l1 r1) (can-duck?)) (go target-duck-walk))
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons x))
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f))
(go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)))
(when (and (cpad-pressed? (-> self control unknown-cpad-info00 number) circle) (can-feet?))
@@ -1266,17 +1252,13 @@
(set-zero! (-> self water bob)))
(when (and (not (logtest? (-> self water flags) (water-flags wt11))) (time-elapsed? (-> self state-time) (seconds 0.1)))
(if (logtest? (-> self water flags) (water-flags wt10)) (go target-wade-stance) (go target-stance)))
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons x))
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f)
(time-elapsed? (-> self water enter-swim-time) (seconds 0.1)))
(go target-swim-jump (-> *TARGET-bank* swim-jump-height-min) (-> *TARGET-bank* swim-jump-height-max)))
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons square))
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? square)
(< (-> *TARGET-bank* min-dive-depth) (target-height-above-ground)))
(go target-swim-down))
(if (and (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0)
@@ -1331,17 +1313,13 @@
(set-zero! (-> self water bob)))
(when (and (not (logtest? (-> self water flags) (water-flags wt11))) (time-elapsed? (-> self water swim-time) (seconds 0.1)))
(if (logtest? (-> self water flags) (water-flags wt10)) (go target-wade-stance) (go target-stance)))
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons x))
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f)
(time-elapsed? (-> self water enter-swim-time) (seconds 0.1)))
(go target-swim-jump (-> *TARGET-bank* swim-jump-height-min) (-> *TARGET-bank* swim-jump-height-max)))
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons square))
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? square)
(< (-> *TARGET-bank* min-dive-depth) (target-height-above-ground)))
(go target-swim-down))
(cond
@@ -384,10 +384,8 @@
:trans
(behavior ()
(if (move-legs?) (go target-flut-walk))
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons x))
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f))
(go target-flut-jump (-> *FLUT-bank* jump-height-min) (-> *FLUT-bank* jump-height-max)))
(if (can-hands? #t) (go target-flut-running-attack))
@@ -438,10 +436,8 @@
:trans
(behavior ()
(if (not (move-legs?)) (go target-flut-stance))
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons x))
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f))
(go target-flut-jump (-> *FLUT-bank* jump-height-min) (-> *FLUT-bank* jump-height-max)))
(if (can-hands? #t) (go target-flut-running-attack))
@@ -626,10 +622,8 @@
:trans
(behavior ()
(if (logtest? (-> self control status) (cshape-moving-flags onsurf)) (go target-flut-hit-ground))
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons square))
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? square)
(and (not (logtest? (-> self state-flags) (state-flags prevent-attack)))
(not (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)))
(time-elapsed? (-> self control unknown-dword36) (the-as time-frame (-> *TARGET-bank* stuck-timeout)))
@@ -696,11 +690,9 @@
(-> target-flut-start
exit)
:trans
(behavior ()
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons x))
(behavior ()
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f))
(go target-flut-jump (-> *FLUT-bank* jump-height-min) (-> *FLUT-bank* jump-height-max)))
(if (move-legs?) (go target-flut-walk))
@@ -248,11 +248,9 @@
(target-racing-center-anim)
((-> target-racing-start exit)))
:trans
(behavior ()
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons l1 r1))
(behavior ()
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? l1 r1)
(or (not (time-elapsed? (-> self control unknown-dword11) (seconds 0.1)))
(< (vector-dot (-> self control dynam gravity-normal)
(vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control shadow-pos)))
@@ -435,10 +433,8 @@
(set! (-> self control unknown-float123)
(fmax (-> self control unknown-float123)
(* 0.003921569 (the float (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) abutton 6)))))
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons l1 r1))
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? l1 r1)
(or (not (time-elapsed? (-> self control unknown-dword11) (seconds 0.2)))
(< (vector-dot (-> self control dynam gravity-normal)
(vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control shadow-pos)))
+10 -20
View File
@@ -21,16 +21,12 @@
(when (and (cpad-hold? (-> self control unknown-cpad-info00 number) l1 r1) (can-duck?))
(remove-exit)
(go target-duck-stance))
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons x))
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f))
(go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)))
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons circle))
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? circle)
(can-feet?))
(go target-attack))
(if (can-hands? #t) (go target-running-attack))
@@ -121,10 +117,8 @@
(when (!= (-> self control ground-pat material) (pat-material ice))
(remove-exit)
(go target-walk))
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons l1 r1))
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? l1 r1)
(and (time-elapsed? (-> *TARGET-bank* wheel-timeout) (-> self control unknown-dword30))
(and (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) (can-wheel?))))
(go target-wheel))
@@ -139,16 +133,12 @@
(target-effect-exit)
(remove-exit)
(go target-ice-stance))
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons x))
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f))
(go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)))
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons circle))
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? circle)
(can-feet?))
(go target-attack))
(if (can-hands? #t) (go target-running-attack))
+3 -5
View File
@@ -435,11 +435,9 @@
(-> target-tube-start
exit)
:trans
(behavior ()
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1))
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2))
(pad-buttons x))
(behavior ()
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f))
(go target-tube-jump (-> *TARGET-bank* tube-jump-height-min) (-> *TARGET-bank* tube-jump-height-max))))
:code
+18 -63
View File
@@ -68,13 +68,8 @@
(if (and (cpad-pressed? (-> self control cpad number) circle square) (can-hands? #t))
(go target-mech-punch)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f)
)
(go
@@ -84,13 +79,8 @@
(the-as surface #f)
)
)
(if (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons r1)
)
;; og:preserve-this - High FPS Fix
(if (recently-pressed? r1)
(go target-mech-carry-pickup)
)
(if (and (or (cpad-pressed? (-> self control cpad number) triangle) (not (-> *setting-control* user-current pilot)))
@@ -189,13 +179,8 @@
(if (and (cpad-pressed? (-> self control cpad number) circle square) (can-hands? #t))
(go target-mech-punch)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f)
)
(go
@@ -242,13 +227,8 @@
)
)
)
(if (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons r1)
)
;; og:preserve-this - High FPS Fix
(if (recently-pressed? r1)
(go target-mech-carry-pickup)
)
(fall-test target-mech-falling (-> *TARGET-bank* fall-height))
@@ -925,13 +905,8 @@
(if (move-legs?)
(go target-mech-walk)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f)
)
(go
@@ -941,13 +916,8 @@
(the-as surface #f)
)
)
(if (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons r1)
)
;; og:preserve-this - High FPS Fix
(if (recently-pressed? r1)
(go target-mech-carry-pickup)
)
)
@@ -1793,13 +1763,8 @@
)
(go target-mech-carry-drop)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f)
)
(go
@@ -1888,13 +1853,8 @@
)
(go target-mech-carry-drop)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f)
)
(go
@@ -2272,13 +2232,8 @@
((-> target-mech-carry-pickup exit))
)
:trans (behavior ()
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f)
)
(go
+22 -77
View File
@@ -468,13 +468,8 @@
(remove-exit)
(go target-indax-walk)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f)
)
(go
@@ -484,24 +479,14 @@
(the-as surface #f)
)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons square)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? square)
(can-hands? #t)
)
(go target-indax-running-attack)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons circle)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? circle)
(can-feet? #t)
)
(go target-indax-attack)
@@ -576,13 +561,8 @@
(remove-exit)
(go target-indax-stance)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f)
)
(go
@@ -592,24 +572,14 @@
(the-as surface #f)
)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons square)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? square)
(can-hands? #t)
)
(go target-indax-running-attack)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons circle)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? circle)
(can-feet? #t)
)
(go target-indax-attack)
@@ -919,13 +889,8 @@
)
:exit target-indax-exit
:trans (behavior ()
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f)
)
(go
@@ -938,24 +903,14 @@
(if (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0)
(go target-indax-walk)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons square)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? square)
(can-hands? #t)
)
(go target-indax-running-attack)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons circle)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? circle)
(can-feet? #t)
)
(go target-indax-attack)
@@ -1024,13 +979,8 @@
(until (ja-done? 0)
(compute-alignment! (-> self align))
(align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0)
(when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(when (and (recently-pressed? x)
(can-jump? #f)
)
(set-quaternion! (-> self control) (-> self control dir-targ))
@@ -1068,13 +1018,8 @@
(until (ja-done? 0)
(compute-alignment! (-> self align))
(align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0)
(when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(when (and (recently-pressed? x)
(can-jump? #f)
)
(set-quaternion! (-> self control) (-> self control dir-targ))
+2 -1
View File
@@ -136,7 +136,8 @@
(set! (-> self green-sun-count) 0)
(set! (-> self moon-count) 0)
(set! (-> self day-star-count) 0)
(update-time-and-speed *sky-work* (-> self time-of-day) (-> self time-ratio))
;; og:preserve-this - High FPS Fix
(update-time-and-speed *sky-work* (-> self time-of-day) (* (-> self time-ratio) DISPLAY_FPS_RATIO))
0
(none)
)
+98 -7
View File
@@ -224,6 +224,36 @@
)
)
;; Allocates enough input frames to support counting 50ms of time at 300fps.
(deftype cpad-history (basic)
((button0-abs pad-buttons 15) ;; bitmask of buttons, pressed or not, with history
(button0-rel pad-buttons 15) ;; bitmask of if button going down.
)
)
;; List of extended history for controllers at high fps. It always has 4 controllers.
(deftype cpad-history-list (basic)
((num-cpads int32)
(cpads cpad-history 4) ;; modified from 2->4 for PC 4-pad support
)
(:methods
(new (symbol type) _type_)
)
)
(defmethod new cpad-history-list ((allocation symbol) (type-to-make type))
"Create a cpad-history-list for 4 controllers. It's fine to do this even if controllers
aren't connected yet. "
(let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
(set! (-> this num-cpads) 4)
(set! (-> this cpads 0) (new 'global 'cpad-history))
(set! (-> this cpads 1) (new 'global 'cpad-history))
(set! (-> this cpads 2) (new 'global 'cpad-history))
(set! (-> this cpads 3) (new 'global 'cpad-history))
this
)
)
(defun analog-input ((arg0 int) (arg1 float) (arg2 float) (arg3 float) (arg4 float))
"Convert integer input from pad into a float between -out-range and +out-range.
The offset is applied directly to the input.
@@ -308,20 +338,32 @@
(define *cpad-list* (new 'global 'cpad-list))
;; the cpad-history for each controller
(define *cpad-history-list* (new 'global 'cpad-history-list))
(desfun generate-frame-checks (pad-idx frames)
(if (= frames 0)
0
`(logior (-> *cpad-history-list* cpads ,pad-idx button0-rel ,(- frames 1))
,(generate-frame-checks pad-idx (- frames 1))
)
)
)
(define *cpad-debug* #f)
;; TODO
;; (#if PC_PORT
;; (defconstant STICK_DEADZONE (-> *pc-settings* stick-deadzone))
;; (defconstant STICK_DEADZONE 0.3)
;; )
(defconstant STICK_DEADZONE 0.3)
(#if PC_PORT
(defconstant STICK_DEADZONE (-> *pc-settings* stick-deadzone))
(defconstant STICK_DEADZONE 0.3)
)
(defun service-cpads ()
"Read from cpads and update vibration."
(let ((pads *cpad-list*))
(dotimes (pad-idx (-> pads num-cpads))
(let ((pad (-> *cpad-list* cpads pad-idx)))
(let ((pad (-> *cpad-list* cpads pad-idx))
;; og:preserve-this high fps fix
(history (-> *cpad-history-list* cpads pad-idx)))
(set! (-> pad old-leftx 1) (-> pad old-leftx 0))
(set! (-> pad old-leftx 0) (-> pad leftx))
(set! (-> pad old-lefty 1) (-> pad old-lefty 0))
@@ -374,6 +416,48 @@
(set! (-> pad button0-abs 1) (-> pad button0-shadow-abs 0))
(set! (-> pad button0-rel 2) (-> pad button0-rel 1))
(set! (-> pad button0-rel 1) (-> pad button0-rel 0))
;; og:preserve-this high fps fix
(when (>= (-> *pc-settings* target-fps) 300)
(set! (-> history button0-abs 14) (-> history button0-abs 13))
(set! (-> history button0-abs 13) (-> history button0-abs 12))
(set! (-> history button0-abs 12) (-> history button0-abs 11))
(set! (-> history button0-rel 14) (-> history button0-rel 13))
(set! (-> history button0-rel 13) (-> history button0-rel 12))
(set! (-> history button0-rel 12) (-> history button0-rel 11))
)
(when (>= (-> *pc-settings* target-fps) 240)
(set! (-> history button0-abs 11) (-> history button0-abs 10))
(set! (-> history button0-abs 10) (-> history button0-abs 9))
(set! (-> history button0-abs 9) (-> history button0-abs 8))
(set! (-> history button0-rel 11) (-> history button0-rel 10))
(set! (-> history button0-rel 10) (-> history button0-rel 9))
(set! (-> history button0-rel 9) (-> history button0-rel 8))
)
(when (>= (-> *pc-settings* target-fps) 165)
(set! (-> history button0-abs 8) (-> history button0-abs 7))
(set! (-> history button0-abs 7) (-> history button0-abs 6))
(set! (-> history button0-abs 6) (-> history button0-abs 5))
(set! (-> history button0-rel 8) (-> history button0-rel 7))
(set! (-> history button0-rel 7) (-> history button0-rel 6))
(set! (-> history button0-rel 6) (-> history button0-rel 5))
)
(when (>= (-> *pc-settings* target-fps) 120)
(set! (-> history button0-abs 5) (-> history button0-abs 4))
(set! (-> history button0-abs 4) (-> history button0-abs 3))
(set! (-> history button0-rel 5) (-> history button0-rel 4))
(set! (-> history button0-rel 4) (-> history button0-rel 3))
)
(when (>= (-> *pc-settings* target-fps) 75)
(set! (-> history button0-abs 3) (-> history button0-abs 2))
(set! (-> history button0-rel 3) (-> history button0-rel 2))
)
(set! (-> history button0-abs 2) (-> history button0-abs 1))
(set! (-> history button0-abs 1) (-> pad button0-shadow-abs 0))
(set! (-> history button0-rel 2) (-> history button0-rel 1))
(set! (-> history button0-rel 1) (-> pad button0-rel 0))
(when (= (-> pad status) 115)
(set! (-> pad abutton 0) (the-as uint (if (logtest? (-> pad button0-abs 0) (pad-buttons right))
255
@@ -513,8 +597,10 @@
)
(set! (-> pad button0-shadow-abs 0) buttons-pressed)
(set! (-> pad button0-abs 0) buttons-pressed)
(set! (-> history button0-abs 0) (-> pad button0-abs 0))
)
(set! (-> pad button0-rel 0) (logclear (-> pad button0-abs 0) (-> pad button0-abs 1)))
(set! (-> history button0-rel 0) (-> pad button0-rel 0))
(when *cpad-debug*
(set! (-> pad leftx) (the-as uint 255))
(set! (-> pad rightx) (the-as uint 255))
@@ -578,6 +664,11 @@
`(logtest? (cpad-pressed ,pad-idx) (pad-buttons ,@buttons))
)
(defmacro recently-pressed? (&key (pad-idx (-> self control cpad number)) &key (frames 15) &rest buttons)
"Checks if a (pad-button) was pressed within the last 50ms, based on frames"
`(logtest? ,(generate-frame-checks pad-idx frames) (pad-buttons ,@buttons))
)
(defmacro cpad-hold? (pad-idx &rest buttons)
`(logtest? (cpad-hold ,pad-idx) (pad-buttons ,@buttons))
)
@@ -622,13 +622,8 @@
)
(go target-board-duck-stance)
)
(when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(when (and (recently-pressed? x)
(can-jump? 'board)
)
(let ((gp-0 (vector-flatten!
@@ -814,13 +809,8 @@
)
(go target-board-stance)
)
(when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(when (and (recently-pressed? x)
(can-jump? 'board)
)
(let ((gp-0 (vector-flatten!
@@ -2271,13 +2261,8 @@
)
(go target-board-duck-stance)
)
(when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(when (and (recently-pressed? x)
(can-jump? 'board)
)
(flush-trick-list (-> self board))
@@ -2366,13 +2351,8 @@
)
:exit target-board-exit
:trans (behavior ()
(when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(when (and (recently-pressed? x)
(can-jump? 'board)
)
(flush-trick-list (-> self board))
@@ -2410,13 +2390,8 @@
(target-board-exit)
)
:trans (behavior ()
(when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(when (and (recently-pressed? x)
(can-jump? 'board)
)
(flush-trick-list (-> self board))
@@ -2625,13 +2600,8 @@
)
)
:trans (behavior ()
(when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(when (and (recently-pressed? x)
(can-jump? 'board)
)
(let ((v1-15 (/ (- (current-time) (-> self board ride-start-time)) 300)))
+10 -35
View File
@@ -1324,13 +1324,8 @@
(if (move-legs?)
(go target-flut-walk)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? 'flut)
)
(go target-flut-jump (-> *FLUT-bank* jump-height-min) (-> *FLUT-bank* jump-height-max))
@@ -1457,13 +1452,8 @@
(if (not (move-legs?))
(go target-flut-stance)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? 'flut)
)
(go target-flut-jump (-> *FLUT-bank* jump-height-min) (-> *FLUT-bank* jump-height-max))
@@ -1635,13 +1625,8 @@
((-> target-flut-start exit))
)
:trans (behavior ()
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? 'flut)
)
(go target-flut-jump (-> *FLUT-bank* jump-height-min) (-> *FLUT-bank* jump-height-max))
@@ -2140,13 +2125,8 @@
)
:trans (behavior ()
((-> target-flut-falling trans))
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons square)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? square)
(not (logtest? (-> self target-flags) (target-flags prevent-attack)))
(not (logtest? (-> self control current-surface flags) (surface-flag no-attack no-hands)))
(time-elapsed? (-> self control last-time-of-stuck) (the-as time-frame (-> *TARGET-bank* stuck-timeout)))
@@ -2231,13 +2211,8 @@
((-> target-flut-start exit))
)
:trans (behavior ()
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? 'flut)
)
(go target-flut-jump (-> *FLUT-bank* jump-height-min) (-> *FLUT-bank* jump-height-max))
+14 -49
View File
@@ -94,35 +94,20 @@
(remove-exit)
(go target-duck-stance #f)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f)
)
(target-jump-go)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons circle)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? circle)
(can-feet? #t)
)
(go target-attack)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons square)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? square)
(can-hands? #t)
)
(go target-running-attack)
@@ -420,13 +405,8 @@
(if (want-to-powerjak?)
(go target-powerjak-get-on)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons l1)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? l1)
(and (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) (can-roll?))
)
(go target-roll)
@@ -436,35 +416,20 @@
(remove-exit)
(go target-duck-walk #f)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f)
)
(target-jump-go)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons circle)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? circle)
(can-feet? #t)
)
(go target-attack)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons square)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? square)
(can-hands? #t)
)
(go target-running-attack)
@@ -179,13 +179,8 @@
(set! (-> self control mod-surface) *indax-hang-walk-mods*)
)
:trans (behavior ()
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(not (logtest? (-> self control current-surface flags) (surface-flag no-jump)))
(not (logtest? (-> self target-flags) (target-flags prevent-jump)))
)
@@ -199,13 +194,8 @@
(if (cpad-hold? (-> self control cpad number) l1)
(go target-indax-hang-dodge)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons circle)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? circle)
(can-feet? #t)
)
(go target-indax-hang-attack)
@@ -268,13 +258,8 @@
:parent target-indax-hang
:enter (-> target-indax-hang-stance enter)
:trans (behavior ()
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(not (logtest? (-> self control current-surface flags) (surface-flag no-jump)))
(not (logtest? (-> self target-flags) (target-flags prevent-jump)))
)
@@ -342,13 +327,8 @@
(set! (-> self control mod-surface) *indax-hang-dodge-mods*)
)
:trans (behavior ()
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(not (logtest? (-> self control current-surface flags) (surface-flag no-jump)))
(not (logtest? (-> self target-flags) (target-flags prevent-jump)))
)
@@ -411,13 +391,8 @@
)
)
:trans (behavior ()
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(not (logtest? (-> self control current-surface flags) (surface-flag no-jump)))
(not (logtest? (-> self target-flags) (target-flags prevent-jump)))
)
@@ -475,13 +450,8 @@
)
)
:trans (behavior ()
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(not (logtest? (-> self control current-surface flags) (surface-flag no-jump)))
(not (logtest? (-> self target-flags) (target-flags prevent-jump)))
)
@@ -629,13 +629,8 @@
(remove-exit)
(go target-indax-walk)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f)
)
(go
@@ -645,24 +640,14 @@
(the-as surface #f)
)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons square)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? square)
(can-hands? #t)
)
(go target-indax-running-attack)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons circle)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? circle)
(can-feet? #t)
)
(go target-indax-attack)
@@ -717,7 +702,7 @@
#f
)
:post target-indax-post
)
)
(defstate target-indax-walk (target)
:event target-indax-handler
@@ -737,13 +722,8 @@
(remove-exit)
(go target-indax-stance)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f)
)
(go
@@ -753,24 +733,14 @@
(the-as surface #f)
)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons square)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? square)
(can-hands? #t)
)
(go target-indax-running-attack)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons circle)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? circle)
(can-feet? #t)
)
(go target-indax-attack)
@@ -1122,13 +1092,8 @@
)
:exit target-indax-exit
:trans (behavior ()
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f)
)
(go
@@ -1141,24 +1106,14 @@
(if (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0)
(go target-indax-walk)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons square)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? square)
(can-hands? #t)
)
(go target-indax-running-attack)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons circle)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? circle)
(can-feet? #t)
)
(go target-indax-attack)
@@ -1227,13 +1182,8 @@
(until (ja-done? 0)
(compute-alignment! (-> self align))
(align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0)
(when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(when (and (recently-pressed? x)
(can-jump? #f)
)
(set-quaternion! (-> self control) (-> self control dir-targ))
@@ -1271,13 +1221,8 @@
(until (ja-done? 0)
(compute-alignment! (-> self align))
(align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0)
(when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(when (and (recently-pressed? x)
(can-jump? #f)
)
(set-quaternion! (-> self control) (-> self control dir-targ))
+18 -63
View File
@@ -86,13 +86,8 @@
(if (and (cpad-pressed? (-> self control cpad number) square) (can-hands? #t))
(go target-mech-punch)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f)
)
(go
@@ -102,13 +97,8 @@
(the-as surface #f)
)
)
(if (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons r1)
)
;; og:preserve-this - High FPS Fix
(if (recently-pressed? r1)
(go target-mech-carry-pickup)
)
(if (and (or (cpad-pressed? (-> self control cpad number) triangle) (not (-> *setting-control* user-current pilot)))
@@ -209,13 +199,8 @@
(if (and (cpad-pressed? (-> self control cpad number) square) (can-hands? #t))
(go target-mech-punch)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f)
)
(go
@@ -262,13 +247,8 @@
)
)
)
(if (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons r1)
)
;; og:preserve-this - High FPS Fix
(if (recently-pressed? r1)
(go target-mech-carry-pickup)
)
(fall-test target-mech-falling (-> *TARGET-bank* fall-height))
@@ -925,13 +905,8 @@
(if (move-legs?)
(go target-mech-walk)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f)
)
(go
@@ -941,13 +916,8 @@
(the-as surface #f)
)
)
(if (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons r1)
)
;; og:preserve-this - High FPS Fix
(if (recently-pressed? r1)
(go target-mech-carry-pickup)
)
)
@@ -1784,13 +1754,8 @@
)
(go target-mech-carry-drop)
)
(when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(when (and (recently-pressed? x)
(can-jump? #f)
)
enter-state
@@ -1879,13 +1844,8 @@
)
(go target-mech-carry-drop)
)
(when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(when (and (recently-pressed? x)
(can-jump? #f)
)
enter-state
@@ -2256,13 +2216,8 @@
((-> target-mech-carry-pickup exit))
)
:trans (behavior ()
(when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(when (and (recently-pressed? x)
(can-jump? #f)
)
enter-state
+12 -42
View File
@@ -41,13 +41,8 @@
(if (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0)
(go target-wade-walk)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f)
)
(target-jump-go)
@@ -96,13 +91,8 @@
(if (and (cpad-hold? (-> self control cpad number) l1) (can-duck?))
(go target-duck-walk #f)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f)
)
(target-jump-go)
@@ -411,25 +401,15 @@
(go target-stance)
)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f)
(time-elapsed? (-> self water enter-swim-time) (seconds 0.1))
)
(go target-swim-jump (-> *TARGET-bank* swim-jump-height-min) (-> *TARGET-bank* swim-jump-height-max))
)
(when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons circle square)
)
;; og:preserve-this - High FPS Fix
(when (and (recently-pressed? circle square)
(-> *setting-control* user-current dive)
(< (-> *TARGET-bank* min-dive-depth) (target-height-above-ground))
)
@@ -528,25 +508,15 @@
(go target-stance)
)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f)
(time-elapsed? (-> self water enter-swim-time) (seconds 0.1))
)
(go target-swim-jump (-> *TARGET-bank* swim-jump-height-min) (-> *TARGET-bank* swim-jump-height-max))
)
(when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons circle square)
)
;; og:preserve-this - High FPS Fix
(when (and (recently-pressed? circle square)
(-> *setting-control* user-current dive)
(< (-> *TARGET-bank* min-dive-depth) (target-height-above-ground))
)
+2 -7
View File
@@ -648,13 +648,8 @@
(set! (-> self control surf) *tube-surface*)
)
:trans (behavior ()
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f)
)
(go target-tube-jump (-> *TARGET-bank* tube-jump-height-min) (-> *TARGET-bank* tube-jump-height-max))
+48 -170
View File
@@ -13,13 +13,8 @@
(go target-attack-air #f)
)
(when (= arg0 'target-eco-powerup)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(not (logtest? (water-flag touch-water) (-> self water flags)))
(not (time-elapsed? (-> self state-time) (seconds 3)))
(not (logtest? (-> self target-flags) (target-flags prevent-jump)))
@@ -135,35 +130,20 @@
(set! (-> self lightjak lightjak-before-powerjak) #t)
(go target-lightjak-regen 0)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f)
)
(target-jump-go)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons circle)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? circle)
(can-feet? #t)
)
(go target-attack)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons square)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? square)
(can-hands? #t)
)
(go target-running-attack)
@@ -177,13 +157,8 @@
(go target-gun-stance)
)
(if (and (logtest? (game-feature feature19) (-> self game features))
(logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons r1)
)
;; og:preserve-this - High FPS Fix
(recently-pressed? r1)
)
(go target-carry-pickup)
)
@@ -217,13 +192,8 @@
(remove-exit)
(go target-ice-walk)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons l1)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? l1)
(and (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) (can-roll?))
)
(go target-roll)
@@ -271,35 +241,20 @@
(set! (-> self lightjak lightjak-before-powerjak) #t)
(go target-lightjak-regen 0)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f)
)
(target-jump-go)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons circle)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? circle)
(can-feet? #t)
)
(go target-attack)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons square)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? square)
(can-hands? #t)
)
(go target-running-attack)
@@ -312,13 +267,8 @@
(go target-turn-around)
)
(if (and (logtest? (game-feature feature19) (-> self game features))
(logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons r1)
)
;; og:preserve-this - High FPS Fix
(recently-pressed? r1)
)
(go target-carry-pickup)
)
@@ -350,13 +300,8 @@
)
:trans (behavior ()
((-> self state-hook))
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f)
)
(target-jump-go)
@@ -560,13 +505,8 @@
)
(set-time! (-> self control sliding-start-time))
)
(when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(when (and (recently-pressed? x)
(can-jump? #f)
(!= (-> self state-time) (current-time))
)
@@ -578,25 +518,15 @@
(vector-normalize-copy! (-> self control transv) (-> self control force-turn-to-direction) 40960.0)
(go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) *slide-jump-mods*)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons circle)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? circle)
(can-feet? #t)
(!= (-> self state-time) (current-time))
)
(go target-attack)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons square)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? square)
(can-hands? #t)
(time-elapsed? (-> self control last-running-attack-end-time) (seconds 0.7))
(!= (-> self state-time) (current-time))
@@ -915,13 +845,8 @@
)
(go target-darkjak-smack-charge)
)
(when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(when (and (recently-pressed? x)
(can-jump? #f)
)
(if (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0)
@@ -1078,13 +1003,8 @@
(if (want-to-powerjak?)
(go target-powerjak-get-on)
)
(when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(when (and (recently-pressed? x)
(can-jump? #f)
)
(if (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0)
@@ -1622,13 +1542,8 @@
#t
)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons square)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? square)
(< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 73728.0)
(< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))
(and (time-elapsed? (-> self control last-time-of-stuck) (the-as time-frame (-> *TARGET-bank* stuck-timeout)))
@@ -1991,13 +1906,8 @@
(logclear! (-> self target-flags) (target-flags lleg-still rleg-still lleg-no-ik rleg-no-ik))
)
:trans (behavior ()
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f)
)
(target-jump-go)
@@ -2034,24 +1944,14 @@
(send-event self 'get-pickup (pickup-type eco-pill-dark) (- (-> *FACT-bank* darkjak-button-invis-inc)))
)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons circle)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? circle)
(can-feet? #t)
)
(go target-attack)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons square)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? square)
(can-hands? #t)
)
(go target-running-attack)
@@ -2358,13 +2258,8 @@
(cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1))
(talker-spawn-func (-> *talker-speech* 47) *entity-pool* (target-pos 0) (the-as region #f))
)
(when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(when (and (recently-pressed? x)
(can-jump? #f)
)
(set-quaternion! (-> self control) (-> self control dir-targ))
@@ -3805,19 +3700,12 @@
)
:exit target-exit
:trans (behavior ()
(when (and (!= (-> self control unknown-spool-anim00) 'stuck) (!= (-> self state-time) (current-time)))
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons circle)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? circle)
(can-feet? #f)
)
(go target-attack-air 'flop)
)
)
(when (and (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0))
(not (time-elapsed? (-> self state-time) (seconds 0.25)))
)
@@ -3983,13 +3871,8 @@
)
)
(else
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? 'target-roll-flip)
)
(go target-roll-flip (-> *TARGET-bank* roll-flip-height) (-> *TARGET-bank* roll-flip-dist))
@@ -4152,13 +4035,8 @@
)
)
(else
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f)
(or (not (-> *TARGET-bank* strafe-duck-jump)) (not (enabled-gun? self)))
)
+14 -49
View File
@@ -696,13 +696,8 @@
(set! (-> self control anim-handle) (the-as handle #f))
)
:trans (behavior ()
(when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(when (and (recently-pressed? x)
(not (logtest? (-> self target-flags) (target-flags prevent-jump)))
(time-elapsed? (-> self state-time) (seconds 0.4))
)
@@ -942,13 +937,8 @@
)
:trans (behavior ()
(when (and (time-elapsed? (-> self state-time) (seconds 0.2))
(logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(recently-pressed? x)
(not (logtest? (-> self target-flags) (target-flags prevent-jump)))
)
(cond
@@ -1241,13 +1231,8 @@
)
(let ((gp-0 (lambda :behavior target
()
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(not (logtest? (water-flag touch-water) (-> self water flags)))
(not (logtest? (-> self target-flags) (target-flags prevent-jump)))
)
@@ -1480,35 +1465,20 @@
(if (and (cpad-hold? (-> self control cpad number) l1) (can-duck?))
(go target-duck-stance #f)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons x)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? x)
(can-jump? #f)
)
(target-jump-go)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons circle)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? circle)
(can-feet? #t)
)
(go target-attack)
)
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons square)
)
;; og:preserve-this - High FPS Fix
(if (and (recently-pressed? square)
(can-hands? #t)
)
(go target-running-attack)
@@ -1522,13 +1492,8 @@
(go target-gun-stance)
)
(if (and (logtest? (game-feature feature19) (-> self game features))
(logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 1)
)
(-> *cpad-list* cpads (-> self control cpad number) button0-rel 2)
)
(pad-buttons r1)
)
;; og:preserve-this - High FPS Fix
(recently-pressed? r1)
)
(go target-carry-pickup)
)