• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Go で書き直した Ikemen


Commit MetaInfo

Revision08f6dcd0479e4afa16d7077c5bf35f52a82a3d0a (tree)
Time2019-08-24 16:49:17
Authorneatunsou <sisiy4excite@gmai...>
Commiterneatunsou

Log Message

Hitoverrideで背後から攻撃された際のGetHitVar(Xvel)が反転していなかったのを修正
方向キーのコマンド入力の途中で~が入る処理があると入力がリセットされる場合があったのを修正
ZSSでhelperをリダイレクトした変数代入ができなかったのを修正
Loadfileで存在しないファイルを指定するとエラーではなく無視をするようにした

Change Summary

Incremental Difference

--- a/src/bytecode.go
+++ b/src/bytecode.go
@@ -5966,10 +5966,10 @@ func (sc loadFile) Run(c *Char, _ []int32) bool {
59665966 })
59675967 if path != "" {
59685968 decodeFile, err := os.Open(filepath.Dir(c.gi().def) + "/" + path)
5969+ defer decodeFile.Close()
59695970 if err != nil {
5970- panic(err)
5971+ return false
59715972 }
5972- defer decodeFile.Close()
59735973 decoder := gob.NewDecoder(decodeFile)
59745974 switch data {
59755975 case SaveData_map:
--- a/src/char.go
+++ b/src/char.go
@@ -5283,7 +5283,26 @@ func (cl *CharList) clsn(getter *Char, proj bool) {
52835283 return
52845284 }
52855285 getter.p1facing = 0
5286+ invertXvel := func(byf float32) {
5287+ if !proj {
5288+ if c.p1facing != 0 {
5289+ byf = c.p1facing
5290+ } else {
5291+ byf = c.facing
5292+ }
5293+ }
5294+ if (getter.facing < 0) == (byf < 0) {
5295+ getter.ghv.xvel *= -1
5296+ if getter.ghv.groundtype == 1 || getter.ghv.groundtype == 2 {
5297+ getter.ghv.groundtype += 3 - getter.ghv.groundtype*2
5298+ }
5299+ if getter.ghv.airtype == 1 || getter.ghv.airtype == 2 {
5300+ getter.ghv.airtype += 3 - getter.ghv.airtype*2
5301+ }
5302+ }
5303+ }
52865304 if getter.hoIdx >= 0 {
5305+ invertXvel(byf)
52875306 return
52885307 }
52895308 if !proj && hd.hitonce > 0 {
@@ -5359,22 +5378,7 @@ func (cl *CharList) clsn(getter *Char, proj bool) {
53595378 }
53605379 }
53615380 }
5362- if !proj {
5363- if c.p1facing != 0 {
5364- byf = c.p1facing
5365- } else {
5366- byf = c.facing
5367- }
5368- }
5369- if (getter.facing < 0) == (byf < 0) {
5370- getter.ghv.xvel *= -1
5371- if getter.ghv.groundtype == 1 || getter.ghv.groundtype == 2 {
5372- getter.ghv.groundtype += 3 - getter.ghv.groundtype*2
5373- }
5374- if getter.ghv.airtype == 1 || getter.ghv.airtype == 2 {
5375- getter.ghv.airtype += 3 - getter.ghv.airtype*2
5376- }
5377- }
5381+ invertXvel(byf)
53785382 return
53795383 }
53805384 if proj {
--- a/src/compiler.go
+++ b/src/compiler.go
@@ -7180,7 +7180,12 @@ func (c *Compiler) stateBlock(line *string, bl *StateBlock, root bool,
71807180 }
71817181 continue
71827182 default:
7183- if scf, ok := c.scmap[c.token]; ok {
7183+ scf, ok := c.scmap[c.token]
7184+ //helperはステコンとリダイレクトの両方で使う名称なのでチェックする
7185+ if c.token == "helper" && ((*line)[0] == ',' || (*line)[0] == '(') {
7186+ ok = false
7187+ }
7188+ if ok {
71847189 scname := c.token
71857190 c.scan(line)
71867191 if err := c.needToken("{"); err != nil {
--- a/src/input.go
+++ b/src/input.go
@@ -1421,7 +1421,8 @@ type cmdElem struct {
14211421 }
14221422
14231423 func (ce *cmdElem) IsDirection() bool {
1424- return !ce.slash && len(ce.key) == 1 && ce.key[0] < CK_a
1424+ //ここで~は方向コマンドとして返さない
1425+ return !ce.slash && len(ce.key) == 1 && ce.key[0] < CK_nBs && (ce.key[0] < CK_nB || ce.key[0] > CK_nUF)
14251426 }
14261427 func (ce *cmdElem) IsDToB(next cmdElem) bool {
14271428 if next.slash {