Fixed inertia on jumping.

This commit is contained in:
genxium 2023-01-21 11:11:48 +08:00
parent 00816fb636
commit d06cb18a08
6 changed files with 15 additions and 11 deletions

File diff suppressed because one or more lines are too long

View File

@ -362,7 +362,7 @@
"array": [
0,
0,
216.50635094610968,
210.43934936178934,
0,
0,
0,

View File

@ -537,7 +537,7 @@
"array": [
0,
0,
216.50635094610968,
210.43934936178934,
0,
0,
0,

View File

@ -38,7 +38,7 @@
"orientation": "portrait"
},
"startScene": "2ff474d9-0c9e-4fe3-87ec-fbff7cae85b4",
"title": "TreasureHunterX",
"title": "DelayNoMore",
"webOrientation": "portrait",
"wechatgame": {
"REMOTE_SERVER_ROOT": "https://bgmoba.lokcol.com/static/",

View File

@ -478,12 +478,16 @@ func deriveOpPattern(currPlayerDownsync, thatPlayerInNextFrame *PlayerDownsync,
prevBtnBLevel = prevDecodedInput.BtnBLevel
}
patternId := PATTERN_ID_NO_OP
if 0 == currPlayerDownsync.FramesToRecover || currPlayerDownsync.CapturedByInertia {
// Jumping is allowed within "CapturedByInertia", but moving is only allowed when "0 == FramesToRecover" (constrained later in "ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame")
// Jumping is partially allowed within "CapturedByInertia", but moving is only allowed when "0 == FramesToRecover" (constrained later in "ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame")
if 0 == currPlayerDownsync.FramesToRecover {
effDx, effDy = decodedInput.Dx, decodedInput.Dy
}
patternId := PATTERN_ID_NO_OP
canJumpWithinInertia := currPlayerDownsync.CapturedByInertia && ((chConfig.InertiaFramesToRecover >> 1) > currPlayerDownsync.FramesToRecover)
if 0 == currPlayerDownsync.FramesToRecover || canJumpWithinInertia {
if decodedInput.BtnBLevel > prevBtnBLevel {
if chConfig.DashingEnabled && 0 > effDy {
if chConfig.DashingEnabled && 0 > decodedInput.Dy {
// Checking "DashingEnabled" here to allow jumping when dashing-disabled players pressed "DOWN + BtnB"
patternId = 5
} else if _, existent := inAirSet[currPlayerDownsync.CharacterState]; !existent {
@ -497,9 +501,9 @@ func deriveOpPattern(currPlayerDownsync, thatPlayerInNextFrame *PlayerDownsync,
if PATTERN_ID_NO_OP == patternId {
if 0 < decodedInput.BtnALevel {
if decodedInput.BtnALevel > prevBtnALevel {
if 0 > effDy {
if 0 > decodedInput.Dy {
patternId = 3
} else if 0 < effDy {
} else if 0 < decodedInput.Dy {
patternId = 2
} else {
patternId = 1

View File

@ -511,7 +511,7 @@ var skills = map[int]*Skill{
PushbackVelX: int32(float64(2) * WORLD_TO_VIRTUAL_GRID_RATIO),
PushbackVelY: int32(0),
HitboxOffsetX: int32(float64(24) * WORLD_TO_VIRTUAL_GRID_RATIO),
HitboxOffsetY: int32(float64(5) * WORLD_TO_VIRTUAL_GRID_RATIO),
HitboxOffsetY: int32(float64(8) * WORLD_TO_VIRTUAL_GRID_RATIO),
HitboxSizeX: int32(float64(48) * WORLD_TO_VIRTUAL_GRID_RATIO),
HitboxSizeY: int32(float64(32) * WORLD_TO_VIRTUAL_GRID_RATIO),
BlowUp: false,