• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubybathyscaphegamephpguicwindows翻訳pythonomegattwitterframeworkbtronarduinovb.net計画中(planning stage)directxpreviewertestゲームエンジンdom

Go で書き直した Ikemen


Commit MetaInfo

Revision05da12163c8dd8500acbb65f9ef94c3e0af3f5bf (tree)
Time2019-05-27 21:16:52
Authorneatunsou <sisiy4excite@gmai...>
Commiterneatunsou

Log Message

roundstateが3になるタイミングを修正
winkoがtrueになるタイミングを修正
KO時のスローになるタイミングを修正
試合終了時のKO等の表示タイミングを修正
コンボカウンターで存在しないフォントを指定すると落ちるのを修正

Change Summary

Incremental Difference

--- a/src/char.go
+++ b/src/char.go
@@ -2552,7 +2552,7 @@ func (c *Char) roundState() int32 {
25522552 return 0
25532553 case sys.lifebar.ro.cur == 0:
25542554 return 1
2555- case !sys.roundEnd():
2555+ case sys.intro >= 0:
25562556 return 2
25572557 case sys.intro < -(sys.lifebar.ro.over_hittime+
25582558 sys.lifebar.ro.over_waittime) && (sys.chars[c.playerNo][0].scf(SCF_over) ||
--- a/src/common.go
+++ b/src/common.go
@@ -730,7 +730,8 @@ func (ats *AnimTextSnd) NoDisplay() bool {
730730 }
731731 func (ats *AnimTextSnd) End(dt int32) bool {
732732 if ats.displaytime < 0 {
733- return len(ats.anim.anim.frames) == 0 || ats.anim.anim.loopend
733+ return len(ats.anim.anim.frames) == 0 || ats.anim.anim.loopend ||
734+ (ats.anim.anim.frames[ats.anim.anim.current].Time == -1 && ats.anim.anim.current == int32(len(ats.anim.anim.frames)-1))
734735 }
735736 return dt >= ats.displaytime
736737 }
--- a/src/lifebar.go
+++ b/src/lifebar.go
@@ -651,14 +651,13 @@ func (c *LifeBarCombo) reset() {
651651 func (c *LifeBarCombo) draw(layerno int16, f []*Fnt) {
652652 for i := range c.cur {
653653 haba := func(n int32) float32 {
654- if c.counter_font[i][0] < 0 || int(c.counter_font[i][0]) >= len(f) {
654+ if f[c.counter_font[i][0]] == nil || c.counter_font[i][0] < 0 || int(c.counter_font[i][0]) >= len(f) {
655655 return 0
656656 }
657657 return float32(f[c.counter_font[i][0]].TextWidth(fmt.Sprintf("%v", n))) *
658658 c.text_lay[i].scale[0]
659659 }
660-
661- if c.resttime[i] <= 0 && c.counterX[i] == c.start_x[i]*2 {
660+ if c.counter_font[i][0] < 0 || c.resttime[i] <= 0 && c.counterX[i] == c.start_x[i]*2 {
662661 continue
663662 }
664663 var x float32
@@ -695,7 +694,7 @@ func (c *LifeBarCombo) draw(layerno int16, f []*Fnt) {
695694 c.text_lay[i].DrawText(x+sys.lifebarOffsetX, float32(c.pos[i][1]), sys.lifebarScale, layerno,
696695 text, f[c.text_font[i][0]], c.text_font[i][1], 1)
697696 }
698- if c.counter_font[i][0] >= 0 && int(c.counter_font[i][0]) < len(f) {
697+ if c.counter_font[i][0] >= 0 && f[c.counter_font[i][0]] != nil && int(c.counter_font[i][0]) < len(f) {
699698 z := 1 + float32(c.shaketime[i])*(1.0/20)*
700699 float32(math.Sin(float64(c.shaketime[i])*(math.Pi/2.5)))
701700 c.counter_lay[i].DrawText((x+sys.lifebarOffsetX)/z, float32(c.pos[i][1])/z, z*sys.lifebarScale, layerno,
@@ -851,7 +850,7 @@ func (r *LifeBarRound) act() bool {
851850 }
852851 r.wt[0]--
853852 }
854- } else if r.cur == 2 && (sys.finish != FT_NotYet || sys.time == 0) {
853+ } else if r.cur == 2 && (sys.intro < 0) && (sys.finish != FT_NotYet || sys.time == 0) {
855854 if r.timerActive {
856855 if sys.gameTime-sys.timerCount[sys.round-1] > 0 {
857856 sys.timerCount[sys.round-1] = sys.gameTime - sys.timerCount[sys.round-1]
@@ -861,14 +860,17 @@ func (r *LifeBarRound) act() bool {
861860 r.timerActive = false
862861 }
863862 f := func(ats *AnimTextSnd, t int) {
864- if r.swt[t] == 0 {
863+ if -r.swt[t]-10 == 0 {
865864 r.snd.play(ats.snd)
865+ r.swt[t]--
866+ }
867+ if sys.tickNextFrame() {
868+ r.swt[t]--
866869 }
867- r.swt[t]--
868870 if ats.End(r.dt[t]) {
869871 r.wt[t] = 2
870872 }
871- if r.wt[t] <= 0 {
873+ if sys.intro < -r.ko_time-10 {
872874 r.dt[t]++
873875 ats.Action()
874876 }
@@ -932,7 +934,7 @@ func (r *LifeBarRound) draw(layerno int16) {
932934 r.fight.DrawScaled(float32(r.pos[0])+sys.lifebarOffsetX, float32(r.pos[1]), layerno, r.fnt, sys.lifebarScale)
933935 }
934936 case 2:
935- if r.wt[0] < 0 {
937+ if r.wt[0] < 0 && sys.intro < -r.ko_time-10 {
936938 switch sys.finish {
937939 case FT_KO:
938940 r.ko.DrawScaled(float32(r.pos[0])+sys.lifebarOffsetX, float32(r.pos[1]), layerno, r.fnt, sys.lifebarScale)
--- a/src/script.go
+++ b/src/script.go
@@ -2099,7 +2099,7 @@ func triggerScriptInit(l *lua.LState) {
20992099 return 1
21002100 })
21012101 luaRegister(l, "teamside", func(*lua.LState) int {
2102- l.Push(lua.LNumber(int32(sys.debugWC.playerNo)&1 + 1))
2102+ l.Push(lua.LNumber(int32(sys.debugWC.teamside) + 1))
21032103 return 1
21042104 })
21052105 luaRegister(l, "tickspersecond", func(*lua.LState) int {
--- a/src/system.go
+++ b/src/system.go
@@ -250,8 +250,8 @@ type System struct {
250250 luaBigPortraitScale float32
251251 luaSpriteOffsetX float64
252252
253- lifebarScale float32
254- lifebarOffsetX float32
253+ lifebarScale float32
254+ lifebarOffsetX float32
255255 LocalcoordScalingType int32
256256
257257 PostProcessingShader int32
@@ -988,12 +988,12 @@ func (s *System) action(x, y *float32, scl float32) (leftest, rightest,
988988 }
989989 }
990990 if s.time == 0 {
991- s.intro = -s.lifebar.ro.over_hittime
991+ //s.intro = -s.lifebar.ro.over_hittime
992992 if !(ko[0] || ko[1]) {
993993 s.winType[0], s.winType[1] = WT_T, WT_T
994994 }
995995 }
996- if s.intro == -s.lifebar.ro.over_hittime && (ko[0] || ko[1]) {
996+ if s.intro == -1 && (ko[0] || ko[1]) {
997997 if ko[0] && ko[1] {
998998 s.finish, s.winTeam = FT_DKO, -1
999999 } else {
@@ -1140,7 +1140,7 @@ func (s *System) action(x, y *float32, scl float32) (leftest, rightest,
11401140 _else := s.sf(GSF_nokoslow) || s.time == 0
11411141 if !_else {
11421142 slowt := -(s.lifebar.ro.over_hittime + (s.lifebar.ro.slow_time+3)>>2)
1143- if s.intro >= slowt && s.intro < -s.lifebar.ro.over_hittime {
1143+ if s.intro >= slowt && s.intro < 0 {
11441144 s.turbo = spd * 0.25
11451145 } else {
11461146 slowfade := s.lifebar.ro.slow_time * 2 / 5
@@ -2137,6 +2137,7 @@ func (l *Loader) loadStage() bool {
21372137 if sys.sel.selectedStageNo == 0 {
21382138 randomstageno := Rand(0, int32(len(sys.sel.stagelist))-1)
21392139 def = sys.sel.stagelist[randomstageno].def
2140+ l.loadAttachedChar(0, sys.sel.stagelist[randomstageno].attachedchardef)
21402141 } else {
21412142 def = sys.sel.stagelist[sys.sel.selectedStageNo-1].def
21422143 l.loadAttachedChar(0, sys.sel.stagelist[sys.sel.selectedStageNo-1].attachedchardef)