Skip to content

Commit

Permalink
improve special attack control
Browse files Browse the repository at this point in the history
  • Loading branch information
dallmeyer committed Nov 27, 2023
1 parent 4b82bae commit ffc1880
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 13 deletions.
39 changes: 26 additions & 13 deletions goal_src/jak2/engine/target/target-darkjak.gc
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@
;; (logtest? (-> self darkjak stage) (darkjak-stage giant))
;; )
;; )
(or (logtest? (-> self control status) (collide-status on-surface touch-surface))
(= (-> self state) target-stance)
)
(logtest? (game-feature darkjak-giant) (-> self game features))
)
)
Expand Down Expand Up @@ -126,14 +129,19 @@
;; )
;; (go target-darkjak-get-off)
;; )
;; (if (cpad-pressed? 0 l2)
;; (set! *l2-start-hold* (current-time))
;; )
;; (when (and (focus-test? self dark) (nonzero? (-> self darkjak))
;; (not (focus-test? self board mech pilot in-head))
;; (cpad-hold? 0 l2) (> (- (current-time) *l2-start-hold*) (seconds 1.5)))
;; (go target-darkjak-get-off)
;; )
(if (cpad-pressed? 0 l2)
(set! *l2-start-hold* (current-time))
)
(when (and (focus-test? self dark) (nonzero? (-> self darkjak))
(logtest? (-> self darkjak stage) (darkjak-stage giant))
(not (focus-test? self board mech pilot in-head))
(cpad-hold? 0 l2) (> (- (current-time) *l2-start-hold*) (seconds 2.0)))
(set! *giant-scale* 1.0)
(logclear! (-> *target* darkjak stage) (darkjak-stage giant))
(set! (-> *target* darkjak want-stage) (-> *target* darkjak stage))
(set! (-> *target* darkjak-giant-interp) 1.0)

)
)
(else
(seek! (-> self darkjak-interp) 0.0 (* 2.0 (seconds-per-frame)))
Expand Down Expand Up @@ -298,10 +306,13 @@
)
:code (behavior ((arg0 darkjak-stage))
(send-event (handle->process (-> self notify)) 'notify 'attack 15)
(if (and (focus-test? self dark) (nonzero? (-> self darkjak)))
(go target-darkjak-giant)
(when (and (focus-test? self dark) (nonzero? (-> self darkjak)))
(when (not (logtest? (-> self darkjak stage) (darkjak-stage giant)))
(set! *giant-scale* 1.0)
)
(set! (-> self darkjak stage) (logior arg0 (darkjak-stage active)))
(go target-darkjak-giant)
)
(logior! (-> self darkjak stage) (logior arg0 (darkjak-stage active)))
(if (logtest? (game-feature darkjak-bomb0) (-> self game features))
(logior! (-> self darkjak stage) (darkjak-stage bomb0))
)
Expand All @@ -319,7 +330,6 @@
(set! (-> self darkjak-giant-interp) 1.0)
(set-setting! 'sound-flava #f 30.0 4)
(logior! (-> self focus-status) (focus-status dark))
(set! *giant-scale* 0.0)
(set-time! (-> (the-as fact-info-target (-> self fact)) darkjak-start-time))
(set! (-> (the-as fact-info-target (-> self fact)) darkjak-effect-time) (seconds 20))
(if (logtest? (-> self darkjak stage) (darkjak-stage invinc))
Expand Down Expand Up @@ -1871,6 +1881,7 @@
(when (= (the-as float (-> self control unknown-word04)) 1.0)
(logclear! (-> self darkjak stage) (darkjak-stage giant))
(set! (-> self darkjak want-stage) (-> self darkjak stage))
(set! *giant-scale* 1.0)
)
)
:code (behavior ()
Expand All @@ -1879,8 +1890,10 @@
(logior! (-> self state-flags) (state-flags sf4))
(set! (-> self neck flex-blend) 0.0)
(set! (-> self control mod-surface) *darkjak-trans-mods*)
(when (logtest? (-> self darkjak stage) (darkjak-stage giant))
(+! *giant-scale* 1.0)
)
(logior! (-> self darkjak stage) (darkjak-stage giant))
(+! *giant-scale* 1.0)
(set! (-> self darkjak want-stage) (-> self darkjak stage))
(sound-play "djak-transform")
(let ((gp-1 (new 'stack-no-clear 'collide-query)))
Expand Down
2 changes: 2 additions & 0 deletions goal_src/jak2/engine/target/target.gc
Original file line number Diff line number Diff line change
Expand Up @@ -2974,6 +2974,7 @@
)
((and (focus-test? self dark)
(nonzero? (-> self darkjak))
(cpad-hold? 0 l2)
(logtest? (-> self darkjak stage) (darkjak-stage bomb1))
)
(set! (-> self control unknown-sound-id00)
Expand Down Expand Up @@ -3215,6 +3216,7 @@
)
((and (focus-test? self dark)
(nonzero? (-> self darkjak))
(cpad-hold? 0 l2)
(logtest? (-> self darkjak stage) (darkjak-stage bomb0))
)
(go target-darkjak-bomb0)
Expand Down

0 comments on commit ffc1880

Please sign in to comment.