@@ -16,20 +16,26 @@ const jumpNsStatusTag = nightsoul.NightsoulTransmissionStatus
1616// Consume stamina.
1717// Hold defines when fall action will automatically be called.
1818func (c * char ) highJump (hold int ) (action.Info , error ) {
19- if (hold > maxJumpFrames - minCancelFrames ) || (hold < 0 ) {
20- hold = maxJumpFrames - minCancelFrames
19+ if (hold > maxJumpFrames - fallCancelFrames ) || (hold < 0 ) {
20+ hold = maxJumpFrames - fallCancelFrames
2121 }
2222
23- jumpDur := minCancelFrames + hold
23+ jumpDur := fallCancelFrames + hold
2424 c .jmpSrc = c .Core .F
2525 src := c .jmpSrc
2626 c .Core .Player .SetAirborne (player .AirborneOroron )
2727
28- // Jump cannot be cancelled before NS status is added, so no need to check src here .
28+ // Don't add NS if jump is cancelled before NS would be added .
2929 jumpNsDuration := jumpDur - jumpNsDelay
30- c .QueueCharTask (func () { c .AddStatus (jumpNsStatusTag , jumpNsDuration , true ) }, jumpNsDelay )
30+ c .QueueCharTask (func () {
31+ if src != c .jmpSrc {
32+ return
33+ }
34+ c .AddStatus (jumpNsStatusTag , jumpNsDuration , true )
35+ }, jumpNsDelay )
3136
32- jumpStamDrainCb := func () {
37+ // Consume stamina.
38+ c .QueueCharTask (func () {
3339 h := c .Core .Player
3440 // Apply stamina reduction mods.
3541 stamDrain := h .AbilStamCost (c .Index , action .ActionJump , map [string ]int {"hold" : 1 })
@@ -40,28 +46,26 @@ func (c *char) highJump(hold int) (action.Info, error) {
4046 // While in high jump, ororon cannot start resuming stamina regen until after landing.
4147 h .LastStamUse = * h .F + jumpDur + fallFrames
4248 h .Events .Emit (event .OnStamUse , action .ActionJump )
43- }
44- c .QueueCharTask (jumpStamDrainCb , jumpStamDrainDelay )
49+ }, jumpStamDrainDelay )
4550
4651 act := action.Info {
4752 Frames : frames .NewAbilFunc (jumpHoldFrames [0 ]),
4853 AnimationLength : jumpDur + fallFrames ,
49- CanQueueAfter : minCancelFrames , // earliest cancel
54+ CanQueueAfter : plungeCancelFrames , // earliest cancel
5055 State : action .JumpState ,
5156 }
5257
5358 // Trigger a fall after max jump duration
54- fallCb := func () {
59+ // TODO: Is this hitlag extended? Does this skip if the action is canceled?
60+ act .QueueAction (func () {
5561 if src != c .jmpSrc {
5662 return
5763 }
5864
5965 fallParam := map [string ]int {"fall" : 1 }
6066 // Ideally this would inject the action into the queue of actions to take from the config file, rather than calling exec directly
6167 c .Core .Player .Exec (action .ActionHighPlunge , c .Base .Key , fallParam )
62- }
63- // TODO: Is this hitlag extended? Does this skip if the action is canceled?
64- act .QueueAction (fallCb , jumpDur )
68+ }, jumpDur )
6569 // c.QueueCharTask(fallCb, jumpDur)
6670 return act , nil
6771}
0 commit comments