Go で書き直した Ikemen
Révision | 51300d189cd17b3cac1152af43c9d14668c9d563 (tree) |
---|---|
l'heure | 2018-12-25 21:31:44 |
Auteur | neatunsou <sisiy4excite@gmai...> |
Commiter | neatunsou |
palfxでライフバーのポトレが消えていたのを修正
P3以降のキャラでP2以前のキャラが死んでるとP2系トリガーが機能しない場合があったのを修正
チーム戦でゲージを持ち越すようにした
@@ -5448,12 +5448,14 @@ func (cl *CharList) enemyNear(c *Char, n int32, p2 bool) *Char { | ||
5448 | 5448 | var add func(*Char, int) |
5449 | 5449 | add = func(e *Char, idx int) { |
5450 | 5450 | for i := idx; i <= int(n); i++ { |
5451 | + if p2 && e.scf(SCF_ko_round_middle) || !p2 && e.helperIndex > 0 { | |
5452 | + return | |
5453 | + } | |
5451 | 5454 | if i >= len(*cache) { |
5452 | 5455 | *cache = append(*cache, e) |
5453 | 5456 | return |
5454 | 5457 | } |
5455 | - if (p2 && !e.scf(SCF_ko_round_middle) || !p2 && e.helperIndex == 0) && | |
5456 | - AbsF(c.distX(e, c)) < AbsF(c.distX((*cache)[i], c)) { | |
5458 | + if AbsF(c.distX(e, c)) < AbsF(c.distX((*cache)[i], c)) { | |
5457 | 5459 | add((*cache)[i], i+1) |
5458 | 5460 | (*cache)[i] = e |
5459 | 5461 | } |
@@ -571,11 +571,9 @@ func (l *Layout) DrawSprite(x, y float32, ln int16, s *Sprite, fx *PalFX, fscale | ||
571 | 571 | y += sys.lifebarFontScale |
572 | 572 | } |
573 | 573 | pal := s.Pal |
574 | - if pal != nil { | |
575 | - pal = fx.getFxPal(pal, false) | |
576 | - } | |
574 | + | |
577 | 575 | s.Draw(x+l.offset[0], y+l.offset[1], |
578 | - l.scale[0]*float32(l.facing)*fscale, l.scale[1]*float32(l.vfacing)*fscale, pal) | |
576 | + l.scale[0]*float32(l.facing)*fscale, l.scale[1]*float32(l.vfacing)*fscale, pal, fx) | |
579 | 577 | } |
580 | 578 | } |
581 | 579 | func (l *Layout) DrawAnim(r *[4]int32, x, y, scl float32, ln int16, |
@@ -1004,7 +1004,7 @@ func (s *Sprite) glDraw(pal []uint32, mask int32, x, y float32, tile *[4]int32, | ||
1004 | 1004 | } |
1005 | 1005 | } |
1006 | 1006 | } |
1007 | -func (s *Sprite) Draw(x, y, xscale, yscale float32, pal []uint32) { | |
1007 | +func (s *Sprite) Draw(x, y, xscale, yscale float32, pal []uint32, fx *PalFX) { | |
1008 | 1008 | x += float32(sys.gameWidth-320)/2 - xscale*float32(s.Offset[0]) |
1009 | 1009 | y += float32(sys.gameHeight-240) - yscale*float32(s.Offset[1]) |
1010 | 1010 | if xscale < 0 { |
@@ -1015,7 +1015,7 @@ func (s *Sprite) Draw(x, y, xscale, yscale float32, pal []uint32) { | ||
1015 | 1015 | } |
1016 | 1016 | s.glDraw(pal, 0, -x*sys.widthScale, -y*sys.heightScale, ¬iling, |
1017 | 1017 | xscale*sys.widthScale, xscale*sys.widthScale, yscale*sys.heightScale, 0, 0, 0, 0, |
1018 | - sys.brightness*255>>8|1<<9, &sys.scrrect, 0, 0, nil) | |
1018 | + sys.brightness*255>>8|1<<9, &sys.scrrect, 0, 0, fx) | |
1019 | 1019 | } |
1020 | 1020 | |
1021 | 1021 | type Sff struct { |
@@ -621,7 +621,7 @@ func systemScriptInit(l *lua.LState) { | ||
621 | 621 | xscl *= c.portrait_scale |
622 | 622 | yscl *= c.portrait_scale |
623 | 623 | } |
624 | - c.lportrait.Draw(x, y, xscl, yscl, c.lportrait.Pal) | |
624 | + c.lportrait.Draw(x, y, xscl, yscl, c.lportrait.Pal, nil) | |
625 | 625 | } |
626 | 626 | } |
627 | 627 | return 0 |
@@ -641,11 +641,11 @@ func systemScriptInit(l *lua.LState) { | ||
641 | 641 | if c.sportrait != nil { |
642 | 642 | c.sportrait.Draw(x+float32(i)*sys.sel.cellsize[0], |
643 | 643 | y+float32(j)*sys.sel.cellsize[1], sys.sel.cellscale[0]*c.portrait_scale, |
644 | - sys.sel.cellscale[1]*c.portrait_scale, c.sportrait.Pal) | |
644 | + sys.sel.cellscale[1]*c.portrait_scale, c.sportrait.Pal, nil) | |
645 | 645 | } else if c.def == "randomselect" && sys.sel.randomspr != nil { |
646 | 646 | sys.sel.randomspr.Draw(x+float32(i)*sys.sel.cellsize[0], |
647 | 647 | y+float32(j)*sys.sel.cellsize[1], sys.sel.randomscl[0], |
648 | - sys.sel.randomscl[1], sys.sel.randomspr.Pal) | |
648 | + sys.sel.randomscl[1], sys.sel.randomspr.Pal, nil) | |
649 | 649 | } |
650 | 650 | } |
651 | 651 | } |
@@ -986,7 +986,7 @@ func systemScriptInit(l *lua.LState) { | ||
986 | 986 | xscl *= c.portrait_scale |
987 | 987 | yscl *= c.portrait_scale |
988 | 988 | } |
989 | - c.sportrait.Draw(x, y, xscl, yscl, c.sportrait.Pal) | |
989 | + c.sportrait.Draw(x, y, xscl, yscl, c.sportrait.Pal, nil) | |
990 | 990 | } |
991 | 991 | } |
992 | 992 | return 0 |
@@ -1007,7 +1007,7 @@ func systemScriptInit(l *lua.LState) { | ||
1007 | 1007 | xscl *= c.portrait_scale |
1008 | 1008 | yscl *= c.portrait_scale |
1009 | 1009 | } |
1010 | - c.vsportrait.Draw(x, y, xscl, yscl, c.vsportrait.Pal) | |
1010 | + c.vsportrait.Draw(x, y, xscl, yscl, c.vsportrait.Pal, nil) | |
1011 | 1011 | } |
1012 | 1012 | } |
1013 | 1013 | return 0 |
@@ -1028,7 +1028,7 @@ func systemScriptInit(l *lua.LState) { | ||
1028 | 1028 | xscl *= c.portrait_scale |
1029 | 1029 | yscl *= c.portrait_scale |
1030 | 1030 | } |
1031 | - c.vportrait.Draw(x, y, xscl, yscl, c.vportrait.Pal) | |
1031 | + c.vportrait.Draw(x, y, xscl, yscl, c.vportrait.Pal, nil) | |
1032 | 1032 | } |
1033 | 1033 | } |
1034 | 1034 | return 0 |
@@ -1981,6 +1981,9 @@ func (l *Loader) loadChar(pn int) int { | ||
1981 | 1981 | } else { |
1982 | 1982 | p = newChar(pn, 0) |
1983 | 1983 | sys.cgi[pn].sff = nil |
1984 | + if len(sys.chars[pn]) > 0 { | |
1985 | + p.power = sys.chars[pn][0].power | |
1986 | + } | |
1984 | 1987 | } |
1985 | 1988 | p.memberNo = memberNo |
1986 | 1989 | p.selectNo = sys.sel.selected[pn&1][memberNo][0] |