Go で書き直した Ikemen
Revision | 525e7a53f411afc2c170ad718e9753718452a799 (tree) |
---|---|
Time | 2019-04-26 22:15:45 |
Author | neatunsou <sisiy4excite@gmai...> |
Commiter | neatunsou |
1フレーム以内に複数のダメージが入ると最後のダメージしか反映されない不具合を修正
Projectileが射出者のHelperに当たらない不具合を修正
360コントローラ判定を修正
@@ -4893,9 +4893,10 @@ func (cl *CharList) clsn(getter *Char, proj bool) { | ||
4893 | 4893 | ghv := &getter.ghv |
4894 | 4894 | cmb := (getter.ss.moveType == MT_H || getter.sf(CSF_gethit)) && |
4895 | 4895 | !ghv.guarded |
4896 | - fall, hc, fc, by := ghv.fallf, ghv.hitcount, ghv.fallcount, ghv.hitBy | |
4896 | + fall, hc, fc, by, dmg := ghv.fallf, ghv.hitcount, ghv.fallcount, ghv.hitBy, ghv.damage | |
4897 | 4897 | ghv.clear() |
4898 | 4898 | ghv.hitBy = by |
4899 | + ghv.damage = dmg | |
4899 | 4900 | ghv.attr = hd.attr |
4900 | 4901 | ghv.hitid = hd.id |
4901 | 4902 | ghv.playerNo = hd.playerNo |
@@ -5252,7 +5253,7 @@ func (cl *CharList) clsn(getter *Char, proj bool) { | ||
5252 | 5253 | sys.envShake.time = hd.envshake_time |
5253 | 5254 | sys.envShake.freq = hd.envshake_freq * float32(math.Pi) / 180 |
5254 | 5255 | sys.envShake.ampl = int32(float32(hd.envshake_ampl) * c.localscl) |
5255 | - sys.envShake.phase = hd.envshake_phase * c.localscl | |
5256 | + sys.envShake.phase = hd.envshake_phase | |
5256 | 5257 | sys.envShake.setDefPhase() |
5257 | 5258 | } |
5258 | 5259 | getter.getcombo += hd.numhits * hits |
@@ -5300,7 +5301,7 @@ func (cl *CharList) clsn(getter *Char, proj bool) { | ||
5300 | 5301 | } |
5301 | 5302 | if proj { |
5302 | 5303 | for i, pr := range sys.projs { |
5303 | - if i == getter.playerNo || len(sys.projs[i]) == 0 { | |
5304 | + if i == getter.playerNo && getter.helperIndex == 0 || len(sys.projs[i]) == 0 { | |
5304 | 5305 | continue |
5305 | 5306 | } |
5306 | 5307 | c := sys.chars[i][0] |
@@ -625,7 +625,7 @@ func JoystickState(joy, button int) bool { | ||
625 | 625 | if len(axes)*2 <= button { |
626 | 626 | return false |
627 | 627 | } |
628 | - if (button == 8 || button == 10) && len(axes) == 6 && len(btns) == 14 { //XboxコントローラーのLRトリガー判定(glfwがバージョンアップすればもっとちゃんと判別できるようになるはず) | |
628 | + if (button == 8 || button == 10) && glfw.GetJoystickName(joystick[joy]) == "Xbox 360 Controller" { //Xbox360コントローラーのLRトリガー判定 | |
629 | 629 | return axes[button/2] > 0 |
630 | 630 | } |
631 | 631 | switch button & 1 { |
@@ -324,14 +324,14 @@ func systemScriptInit(l *lua.LState) { | ||
324 | 324 | ts.text = strArg(l, 2) |
325 | 325 | return 0 |
326 | 326 | }) |
327 | - luaRegister(l, "textImgSetColor", func(*lua.LState) int { | |
328 | - ts, ok := toUserData(l, 1).(*TextSprite) | |
329 | - if !ok { | |
330 | - userDataError(l, 1, ts) | |
331 | - } | |
332 | - ts.SetColor(float32(numArg(l, 2)), float32(numArg(l, 3)), float32(numArg(l, 4)), 255, 0) | |
333 | - return 0 | |
334 | - }) | |
327 | + luaRegister(l, "textImgSetColor", func(*lua.LState) int { | |
328 | + ts, ok := toUserData(l, 1).(*TextSprite) | |
329 | + if !ok { | |
330 | + userDataError(l, 1, ts) | |
331 | + } | |
332 | + ts.SetColor(float32(numArg(l, 2)), float32(numArg(l, 3)), float32(numArg(l, 4)), 255, 0) | |
333 | + return 0 | |
334 | + }) | |
335 | 335 | luaRegister(l, "textImgSetPos", func(*lua.LState) int { |
336 | 336 | ts, ok := toUserData(l, 1).(*TextSprite) |
337 | 337 | if !ok { |
@@ -1132,13 +1132,12 @@ func systemScriptInit(l *lua.LState) { | ||
1132 | 1132 | if sys.keyInput != glfw.KeyUnknown { |
1133 | 1133 | s = KeyToString(sys.keyInput) |
1134 | 1134 | } |
1135 | - | |
1136 | 1135 | for j := 0; j < 2; j++ { |
1137 | 1136 | if glfw.JoystickPresent(joystick[j]) { |
1138 | 1137 | axes := glfw.GetJoystickAxes(joystick[j]) |
1139 | 1138 | btns := glfw.GetJoystickButtons(joystick[j]) |
1140 | 1139 | for i := range axes { |
1141 | - if i > 3 && len(axes) == 6 && len(btns) == 14 { //Xboxコントローラー判定(glfwがバージョンアップすればもっとちゃんと判別できるようになるはず) | |
1140 | + if glfw.GetJoystickName(joystick[j]) == "Xbox 360 Controller" { //Xbox360コントローラー判定 | |
1142 | 1141 | if axes[i] > 0 { |
1143 | 1142 | s = strconv.Itoa(-i*2 - 1) |
1144 | 1143 | } |