Skip to content

Commit

Permalink
Zoomステコンにstageboundパラメータを追加
Browse files Browse the repository at this point in the history
・Zoomステコンにstageboundパラメータを追加
デフォルトは1
これを0にするとステージ端の限界を無視してズームするようになる
また、cameraboundが無効になる
・P2の敵情報がラウンド間でリセットされていなかったのを修正
  • Loading branch information
NeatUnsou committed Jan 15, 2023
1 parent 6d925c2 commit efc7c8d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/bytecode.go
Original file line number Diff line number Diff line change
Expand Up @@ -6590,6 +6590,7 @@ const (
zoom_redirectid
zoom_camerabound
zoom_time
zoom_stagebound
)

func (sc zoom) Run(c *Char, _ []int32) bool {
Expand All @@ -6607,6 +6608,8 @@ func (sc zoom) Run(c *Char, _ []int32) bool {
sys.zoomScale = exp[0].evalF(c)
case zoom_camerabound:
sys.zoomCameraBound = exp[0].evalB(c)
case zoom_stagebound:
sys.zoomStageBound = exp[0].evalB(c)
case zoom_lag:
sys.zoomlag = exp[0].evalF(c)
case zoom_time:
Expand Down
1 change: 1 addition & 0 deletions src/char.go
Original file line number Diff line number Diff line change
Expand Up @@ -1869,6 +1869,7 @@ func (c *Char) clear2() {
}
c.aimg.timegap = -1
c.enemyNearClear()
c.p2enemy = c.p2enemy[:0]
c.targets = c.targets[:0]
c.cpucmd = -1
}
Expand Down
4 changes: 4 additions & 0 deletions src/compiler_functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -3458,6 +3458,10 @@ func (c *Compiler) zoom(is IniSection, sc *StateControllerBase, _ int8) (StateCo
zoom_time, VT_Int, 1, false); err != nil {
return err
}
if err := c.paramValue(is, sc, "stagebound",
zoom_stagebound, VT_Bool, 1, false); err != nil {
return err
}
return nil
})
return *ret, err
Expand Down
11 changes: 9 additions & 2 deletions src/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ type System struct {
zoomPosYLag float32
enableZoomtime int32
zoomCameraBound bool
zoomStageBound bool
zoomPos [2]float32
debugWC *Char
cam Camera
Expand Down Expand Up @@ -1017,6 +1018,7 @@ func (s *System) action() {
s.enableZoomtime--
} else {
s.zoomCameraBound = true
s.zoomStageBound = true
}
if s.super > 0 {
s.super--
Expand Down Expand Up @@ -2024,9 +2026,14 @@ func (s *System) fight() (reload bool) {
s.zoomPosYLag += ((s.zoomPos[1] - s.zoomPosYLag) * (1 - s.zoomlag))
s.drawScale = s.drawScale / (s.drawScale + (s.zoomScale*scl-s.drawScale)*s.zoomlag) * s.zoomScale * scl
}
if s.zoomCameraBound {
if s.zoomStageBound {
dscl = MaxF(s.cam.MinScale, s.drawScale/s.cam.BaseScale())
dx = s.cam.XBound(dscl, x+ClampF(s.zoomPosXLag/scl, -s.cam.halfWidth/scl*2*(1-1/s.zoomScale), s.cam.halfWidth/scl*2*(1-1/s.zoomScale)))
if s.zoomCameraBound {
dx = x + ClampF(s.zoomPosXLag/scl, -s.cam.halfWidth/scl*2*(1-1/s.zoomScale), s.cam.halfWidth/scl*2*(1-1/s.zoomScale))
} else {
dx = x + s.zoomPosXLag/scl
}
dx = s.cam.XBound(dscl, dx)
} else {
dscl = s.drawScale / s.cam.BaseScale()
dx = x + s.zoomPosXLag/scl
Expand Down

0 comments on commit efc7c8d

Please sign in to comment.