Go で書き直した Ikemen
リビジョン | 05da12163c8dd8500acbb65f9ef94c3e0af3f5bf (tree) |
---|---|
日時 | 2019-05-27 21:16:52 |
作者 | neatunsou <sisiy4excite@gmai...> |
コミッター | neatunsou |
roundstateが3になるタイミングを修正
winkoがtrueになるタイミングを修正
KO時のスローになるタイミングを修正
試合終了時のKO等の表示タイミングを修正
コンボカウンターで存在しないフォントを指定すると落ちるのを修正
@@ -2552,7 +2552,7 @@ func (c *Char) roundState() int32 { | ||
2552 | 2552 | return 0 |
2553 | 2553 | case sys.lifebar.ro.cur == 0: |
2554 | 2554 | return 1 |
2555 | - case !sys.roundEnd(): | |
2555 | + case sys.intro >= 0: | |
2556 | 2556 | return 2 |
2557 | 2557 | case sys.intro < -(sys.lifebar.ro.over_hittime+ |
2558 | 2558 | sys.lifebar.ro.over_waittime) && (sys.chars[c.playerNo][0].scf(SCF_over) || |
@@ -730,7 +730,8 @@ func (ats *AnimTextSnd) NoDisplay() bool { | ||
730 | 730 | } |
731 | 731 | func (ats *AnimTextSnd) End(dt int32) bool { |
732 | 732 | 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)) | |
734 | 735 | } |
735 | 736 | return dt >= ats.displaytime |
736 | 737 | } |
@@ -651,14 +651,13 @@ func (c *LifeBarCombo) reset() { | ||
651 | 651 | func (c *LifeBarCombo) draw(layerno int16, f []*Fnt) { |
652 | 652 | for i := range c.cur { |
653 | 653 | 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) { | |
655 | 655 | return 0 |
656 | 656 | } |
657 | 657 | return float32(f[c.counter_font[i][0]].TextWidth(fmt.Sprintf("%v", n))) * |
658 | 658 | c.text_lay[i].scale[0] |
659 | 659 | } |
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 { | |
662 | 661 | continue |
663 | 662 | } |
664 | 663 | var x float32 |
@@ -695,7 +694,7 @@ func (c *LifeBarCombo) draw(layerno int16, f []*Fnt) { | ||
695 | 694 | c.text_lay[i].DrawText(x+sys.lifebarOffsetX, float32(c.pos[i][1]), sys.lifebarScale, layerno, |
696 | 695 | text, f[c.text_font[i][0]], c.text_font[i][1], 1) |
697 | 696 | } |
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) { | |
699 | 698 | z := 1 + float32(c.shaketime[i])*(1.0/20)* |
700 | 699 | float32(math.Sin(float64(c.shaketime[i])*(math.Pi/2.5))) |
701 | 700 | 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 { | ||
851 | 850 | } |
852 | 851 | r.wt[0]-- |
853 | 852 | } |
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) { | |
855 | 854 | if r.timerActive { |
856 | 855 | if sys.gameTime-sys.timerCount[sys.round-1] > 0 { |
857 | 856 | sys.timerCount[sys.round-1] = sys.gameTime - sys.timerCount[sys.round-1] |
@@ -861,14 +860,17 @@ func (r *LifeBarRound) act() bool { | ||
861 | 860 | r.timerActive = false |
862 | 861 | } |
863 | 862 | f := func(ats *AnimTextSnd, t int) { |
864 | - if r.swt[t] == 0 { | |
863 | + if -r.swt[t]-10 == 0 { | |
865 | 864 | r.snd.play(ats.snd) |
865 | + r.swt[t]-- | |
866 | + } | |
867 | + if sys.tickNextFrame() { | |
868 | + r.swt[t]-- | |
866 | 869 | } |
867 | - r.swt[t]-- | |
868 | 870 | if ats.End(r.dt[t]) { |
869 | 871 | r.wt[t] = 2 |
870 | 872 | } |
871 | - if r.wt[t] <= 0 { | |
873 | + if sys.intro < -r.ko_time-10 { | |
872 | 874 | r.dt[t]++ |
873 | 875 | ats.Action() |
874 | 876 | } |
@@ -932,7 +934,7 @@ func (r *LifeBarRound) draw(layerno int16) { | ||
932 | 934 | r.fight.DrawScaled(float32(r.pos[0])+sys.lifebarOffsetX, float32(r.pos[1]), layerno, r.fnt, sys.lifebarScale) |
933 | 935 | } |
934 | 936 | case 2: |
935 | - if r.wt[0] < 0 { | |
937 | + if r.wt[0] < 0 && sys.intro < -r.ko_time-10 { | |
936 | 938 | switch sys.finish { |
937 | 939 | case FT_KO: |
938 | 940 | r.ko.DrawScaled(float32(r.pos[0])+sys.lifebarOffsetX, float32(r.pos[1]), layerno, r.fnt, sys.lifebarScale) |
@@ -2099,7 +2099,7 @@ func triggerScriptInit(l *lua.LState) { | ||
2099 | 2099 | return 1 |
2100 | 2100 | }) |
2101 | 2101 | 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)) | |
2103 | 2103 | return 1 |
2104 | 2104 | }) |
2105 | 2105 | luaRegister(l, "tickspersecond", func(*lua.LState) int { |
@@ -250,8 +250,8 @@ type System struct { | ||
250 | 250 | luaBigPortraitScale float32 |
251 | 251 | luaSpriteOffsetX float64 |
252 | 252 | |
253 | - lifebarScale float32 | |
254 | - lifebarOffsetX float32 | |
253 | + lifebarScale float32 | |
254 | + lifebarOffsetX float32 | |
255 | 255 | LocalcoordScalingType int32 |
256 | 256 | |
257 | 257 | PostProcessingShader int32 |
@@ -988,12 +988,12 @@ func (s *System) action(x, y *float32, scl float32) (leftest, rightest, | ||
988 | 988 | } |
989 | 989 | } |
990 | 990 | if s.time == 0 { |
991 | - s.intro = -s.lifebar.ro.over_hittime | |
991 | + //s.intro = -s.lifebar.ro.over_hittime | |
992 | 992 | if !(ko[0] || ko[1]) { |
993 | 993 | s.winType[0], s.winType[1] = WT_T, WT_T |
994 | 994 | } |
995 | 995 | } |
996 | - if s.intro == -s.lifebar.ro.over_hittime && (ko[0] || ko[1]) { | |
996 | + if s.intro == -1 && (ko[0] || ko[1]) { | |
997 | 997 | if ko[0] && ko[1] { |
998 | 998 | s.finish, s.winTeam = FT_DKO, -1 |
999 | 999 | } else { |
@@ -1140,7 +1140,7 @@ func (s *System) action(x, y *float32, scl float32) (leftest, rightest, | ||
1140 | 1140 | _else := s.sf(GSF_nokoslow) || s.time == 0 |
1141 | 1141 | if !_else { |
1142 | 1142 | 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 { | |
1144 | 1144 | s.turbo = spd * 0.25 |
1145 | 1145 | } else { |
1146 | 1146 | slowfade := s.lifebar.ro.slow_time * 2 / 5 |
@@ -2137,6 +2137,7 @@ func (l *Loader) loadStage() bool { | ||
2137 | 2137 | if sys.sel.selectedStageNo == 0 { |
2138 | 2138 | randomstageno := Rand(0, int32(len(sys.sel.stagelist))-1) |
2139 | 2139 | def = sys.sel.stagelist[randomstageno].def |
2140 | + l.loadAttachedChar(0, sys.sel.stagelist[randomstageno].attachedchardef) | |
2140 | 2141 | } else { |
2141 | 2142 | def = sys.sel.stagelist[sys.sel.selectedStageNo-1].def |
2142 | 2143 | l.loadAttachedChar(0, sys.sel.stagelist[sys.sel.selectedStageNo-1].attachedchardef) |