Skip to content

Commit

Permalink
fix: RoundTime behaviour on F4
Browse files Browse the repository at this point in the history
  • Loading branch information
K4thos committed Jan 15, 2025
1 parent b5c515d commit 2165c38
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion data/dizzy.zss
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ if !dizzy || time > 300 {

if !const(Default.Enable.Dizzy) || isHelper || teamSide = 0 {
# Do nothing, global code disabled locally or executed by helper/stage
} else if roundState = 0 {
} else if roundTime = 0 {
# Initialize points and variables
dizzyPointsSet{value: dizzyPointsMax}
map(_iksys_dizzyPointsTimer) := 0;
Expand Down
2 changes: 1 addition & 1 deletion data/functions.zss
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ ignoreHitPause{

if teamSide = 0 {
# Do nothing, global code executed by stage
} else if roundState = 0 {
} else if roundTime = 0 {
map(_iksys_firstAttackFlag) := 0;
map(_iksys_counterHitFlag) := 0;
map(_iksys_technicalFlag) := 0;
Expand Down
2 changes: 1 addition & 1 deletion data/guardbreak.zss
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ if time >= 60 {

if !const(Default.Enable.GuardBreak) || isHelper || teamSide = 0 {
# Do nothing, global code disabled locally or executed by helper/stage
} else if roundState = 0 {
} else if roundTime = 0 {
# Initialize points and variables
guardPointsSet{value: guardPointsMax}
map(_iksys_guardPointsTimer) := 0;
Expand Down
2 changes: 1 addition & 1 deletion data/score.zss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

if !const(Default.Enable.Score) || teamSide = 0 {
# do nothing, global code disabled locally or executed by stage
} else if roundState = 0 {
} else if roundTime = 0 {
map(_iksys_scoreTimeVitalFlag) := 0;
} else if roundState = 4 && !isHelper {
# score: time vital bonus
Expand Down
2 changes: 1 addition & 1 deletion data/tag.zss
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ if animTime >= 0 {

if !const(Default.Enable.Tag) || isHelper || teamSide = 0 {
# do nothing, global code disabled locally or executed by helper/stage
} else if roundState = 0 && teamMode = Tag {
} else if roundTime = 0 && teamMode = Tag {
map(_iksys_tagActive) := 1;
map(_iksys_tagLastId) := 0;
map(_iksys_tagPartnerId) := 0;
Expand Down
8 changes: 7 additions & 1 deletion data/training.zss
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,14 @@ if player($pn),ctrl = 0 {
[StateDef -4]

ignoreHitPause if gameMode = "training" && teamSide = 2 && !isHelper {
if roundState = 0 {
if roundTime = 0 {
# Round start reset
map(_iksys_trainingDummyControl) := 0;
map(_iksys_trainingDummyMode) := 0;
map(_iksys_trainingGuardMode) := 0;
map(_iksys_trainingFallRecovery) := 0;
map(_iksys_trainingDistance) := 0;
map(_iksys_trainingButtonJam) := 0;
powerSet{value: player(1),powerMax; redirectid: player(1),id}
powerSet{value: player(2),powerMax; redirectid: player(2),id}
map(_iksys_trainingLifeTimer) := 0;
Expand Down
10 changes: 8 additions & 2 deletions src/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -1167,8 +1167,14 @@ func (s *System) addFrameTime(t float32) bool {
return true
}
func (s *System) resetFrameTime() {
s.tickCount, s.oldTickCount, s.tickCountF, s.lastTick, s.absTickCountF = 0, -1, 0, 0, 0
s.nextAddTime, s.oldNextAddTime = 1, 1
// Without this workaround, for some reason, sys.tickCount (RoundTime trigger) starts with 1 when the round is restarted via F4.
if s.roundResetFlg {
s.tickCount, s.oldTickCount, s.tickCountF, s.lastTick, s.absTickCountF = -1, -2, -1, -1, -1
s.nextAddTime, s.oldNextAddTime = 0, 0
} else {
s.tickCount, s.oldTickCount, s.tickCountF, s.lastTick, s.absTickCountF = 0, -1, 0, 0, 0
s.nextAddTime, s.oldNextAddTime = 1, 1
}
}

func (s *System) charUpdate() {
Expand Down

0 comments on commit 2165c38

Please sign in to comment.