Skip to content
This repository has been archived by the owner on Apr 6, 2022. It is now read-only.

Commit

Permalink
lifebar D.KO and round.default bugs
Browse files Browse the repository at this point in the history
- draw game anim / text should not appear after D.KO
- in mugen 'round.default.' values are not used as default values for 'roundX.' assignments (for example you need 'round1.displaytime' set even if 'round.default.displaytime' is already set)
- 'roundX.' didn't support animations (Read instead of ReadAnimTextSnd used to read the data)
- 'round.default' should always trigger alongside 'roundX', not one or another like it did before this change
  • Loading branch information
K4thos committed Jan 20, 2020
1 parent 7ae0141 commit bb5d5fc
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions src/lifebar.go
Expand Up @@ -766,8 +766,7 @@ func readLifeBarRound(is IniSection,
is.ReadI32("round.sndtime", &r.round_sndtime)
r.round_default = *ReadAnimTextSnd("round.default.", is, sff, at, 2)
for i := range r.round {
r.round[i] = r.round_default
r.round[i].Read(fmt.Sprintf("round%v.", i+1), is, at, 2)
r.round[i] = *ReadAnimTextSnd(fmt.Sprintf("round%v.", i+1), is, sff, at, 2)
}
is.ReadI32("fight.time", &r.fight_time)
is.ReadI32("fight.sndtime", &r.fight_sndtime)
Expand Down Expand Up @@ -818,17 +817,17 @@ func (r *LifeBarRound) act() bool {
if r.swt[0] == 0 {
if int(sys.round) <= len(r.round) {
r.snd.play(r.round[sys.round-1].snd)
} else {
r.snd.play(r.round_default.snd)
}
r.snd.play(r.round_default.snd)
}
r.swt[0]--
if r.wt[0] <= 0 {
r.dt[0]++
end := false
if int(sys.round) <= len(r.round) {
r.round[sys.round-1].Action()
end = r.round[sys.round-1].End(r.dt[0])
r.round_default.Action()
end = r.round[sys.round-1].End(r.dt[0]) && r.round_default.End(r.dt[0])
} else {
r.round_default.Action()
end = r.round_default.End(r.dt[0])
Expand Down Expand Up @@ -891,7 +890,7 @@ func (r *LifeBarRound) act() bool {
f(&r.to, 0)
}
if sys.intro < -(r.over_hittime + r.over_waittime + r.over_wintime) {
if sys.finish == FT_DKO || sys.finish == FT_TODraw {
if /*sys.finish == FT_DKO ||*/ sys.finish == FT_TODraw {
f(&r.drawn, 1)
} else if sys.winTeam >= 0 && (sys.tmode[sys.winTeam] == TM_Simul || sys.tmode[sys.winTeam] == TM_Tag) {
f(&r.win2, 1)
Expand Down Expand Up @@ -927,13 +926,12 @@ func (r *LifeBarRound) draw(layerno int16) {
r.round[sys.round-1].DrawScaled(float32(r.pos[0])+sys.lifebarOffsetX, float32(r.pos[1]),
layerno, r.fnt, sys.lifebarScale)
r.round[sys.round-1].text = tmp
} else {
tmp := r.round_default.text
r.round_default.text = OldSprintf(tmp, sys.round)
r.round_default.DrawScaled(float32(r.pos[0])+sys.lifebarOffsetX, float32(r.pos[1]),
layerno, r.fnt, sys.lifebarScale)
r.round_default.text = tmp
}
tmp := r.round_default.text
r.round_default.text = OldSprintf(tmp, sys.round)
r.round_default.DrawScaled(float32(r.pos[0])+sys.lifebarOffsetX, float32(r.pos[1]),
layerno, r.fnt, sys.lifebarScale)
r.round_default.text = tmp
}
case 1:
if r.wt[0] < 0 {
Expand All @@ -951,7 +949,7 @@ func (r *LifeBarRound) draw(layerno int16) {
}
}
if r.wt[1] < 0 {
if sys.finish == FT_DKO || sys.finish == FT_TODraw {
if /*sys.finish == FT_DKO ||*/ sys.finish == FT_TODraw {
r.drawn.DrawScaled(float32(r.pos[0])+sys.lifebarOffsetX, float32(r.pos[1]), layerno, r.fnt, sys.lifebarScale)
} else if sys.winTeam >= 0 && (sys.tmode[sys.winTeam] == TM_Simul || sys.tmode[sys.winTeam] == TM_Tag) {
tmp := r.win2.text
Expand Down

0 comments on commit bb5d5fc

Please sign in to comment.