Go で書き直した Ikemen
修订版 | 7c1457eeca8cfa75cb01ac5a8cea0222c77b67c5 (tree) |
---|---|
时间 | 2019-09-27 00:12:59 |
作者 | neatunsou <sisiy4excite@gmai...> |
Commiter | neatunsou |
hitflagでPを指定してProjectileに当てたときにp1statenoが機能しなかったのを修正
BONUS GAMESでAIが入らなかったのを修正
@@ -2121,6 +2121,7 @@ function main.f_bonusExtras() | ||
2121 | 2121 | else |
2122 | 2122 | sndPlay(motif.files.snd_data, motif.title_info.cursor_done_snd[1], motif.title_info.cursor_done_snd[2]) |
2123 | 2123 | main.versusScreen = false |
2124 | + main.p2In = 1 | |
2124 | 2125 | main.p1TeamMenu = {mode = 0, chars = 1} |
2125 | 2126 | main.p2TeamMenu = {mode = 0, chars = 1} |
2126 | 2127 | main.p2Char = {main.t_bonusChars[item]} |
@@ -2464,8 +2464,7 @@ function select.f_selectVictory() | ||
2464 | 2464 | winnerNum, |
2465 | 2465 | motif.victory_screen.p1_offset[1], |
2466 | 2466 | motif.victory_screen.p1_offset[2], |
2467 | - motif.victory_screen.p1_facing, | |
2468 | - motif.victory_screen.p1_scale[1], | |
2467 | + motif.victory_screen.p1_facing * motif.victory_screen.p1_scale[1], | |
2469 | 2468 | motif.victory_screen.p1_scale[2] |
2470 | 2469 | ) |
2471 | 2470 | else |
@@ -2473,16 +2472,14 @@ function select.f_selectVictory() | ||
2473 | 2472 | p1Num, |
2474 | 2473 | motif.victory_screen.p1_offset[1], |
2475 | 2474 | motif.victory_screen.p1_offset[2], |
2476 | - motif.victory_screen.p1_facing, | |
2477 | - motif.victory_screen.p1_scale[1], | |
2475 | + motif.victory_screen.p1_facing * motif.victory_screen.p1_scale[1], | |
2478 | 2476 | motif.victory_screen.p1_scale[2] |
2479 | 2477 | ) |
2480 | 2478 | drawVictoryPortrait( |
2481 | 2479 | p2Num, |
2482 | 2480 | motif.victory_screen.p2_offset[1], |
2483 | 2481 | motif.victory_screen.p2_offset[2], |
2484 | - motif.victory_screen.p2_facing, | |
2485 | - motif.victory_screen.p2_scale[1], | |
2482 | + motif.victory_screen.p2_facing * motif.victory_screen.p2_scale[1], | |
2486 | 2483 | motif.victory_screen.p2_scale[2] |
2487 | 2484 | ) |
2488 | 2485 | end |
@@ -2531,9 +2528,12 @@ local txt_credits = main.f_createTextImg( | ||
2531 | 2528 | ) |
2532 | 2529 | |
2533 | 2530 | function select.f_continue() |
2531 | + main.f_resetBG(motif.continue_screen, motif.continuebgdef, motif.music.continue_bgm, motif.music.continue_bgm_loop, motif.music.continue_bgm_volume, motif.music.continue_bgm_loopstart, motif.music.continue_bgm_loopend) | |
2532 | + animReset(motif.continue_screen.continue_anim_data) | |
2533 | + animUpdate(motif.continue_screen.continue_anim_data) | |
2534 | 2534 | continue = false |
2535 | - playBGM(motif.music.continue_bgm, true, motif.music.continue_bgm_loop, motif.music.continue_bgm_volume, motif.music.continue_bgm_loopstart or "0", motif.music.continue_bgm_loopend or "0") | |
2536 | - --textImgSetText(txt_credits, text[1]) | |
2535 | + local text = main.f_extractText(motif.continue_screen.credits_text, main.credits) | |
2536 | + textImgSetText(txt_credits, text[1]) | |
2537 | 2537 | main.f_cmdInput() |
2538 | 2538 | while true do |
2539 | 2539 | --draw clearcolor (disabled to not cover area) |
@@ -1516,27 +1516,27 @@ type Char struct { | ||
1516 | 1516 | ivar [NumVar + NumSysVar]int32 |
1517 | 1517 | fvar [NumFvar + NumSysFvar]float32 |
1518 | 1518 | CharSystemVar |
1519 | - mapArray map[string]int32 | |
1520 | - aimg AfterImage | |
1521 | - sounds Sounds | |
1522 | - p1facing float32 | |
1523 | - cpucmd int32 | |
1524 | - attackDist float32 | |
1525 | - offset [2]float32 | |
1526 | - platformPosY float32 | |
1527 | - groundAngle float32 | |
1528 | - stchtmp bool | |
1529 | - inguarddist bool | |
1530 | - pushed bool | |
1531 | - hitdefContact bool | |
1532 | - movedY bool | |
1533 | - atktmp int8 | |
1534 | - hittmp int8 | |
1535 | - acttmp int8 | |
1536 | - minus int8 | |
1537 | - winquote int32 | |
1538 | - memberNo int | |
1539 | - selectNo int | |
1519 | + mapArray map[string]int32 | |
1520 | + aimg AfterImage | |
1521 | + sounds Sounds | |
1522 | + p1facing float32 | |
1523 | + cpucmd int32 | |
1524 | + attackDist float32 | |
1525 | + offset [2]float32 | |
1526 | + platformPosY float32 | |
1527 | + groundAngle float32 | |
1528 | + stchtmp bool | |
1529 | + inguarddist bool | |
1530 | + pushed bool | |
1531 | + hitdefContact bool | |
1532 | + movedY bool | |
1533 | + atktmp int8 | |
1534 | + hittmp int8 | |
1535 | + acttmp int8 | |
1536 | + minus int8 | |
1537 | + winquote int32 | |
1538 | + memberNo int | |
1539 | + selectNo int | |
1540 | 1540 | comboExtraFrameWindow int32 |
1541 | 1541 | } |
1542 | 1542 |
@@ -5452,6 +5452,9 @@ func (cl *CharList) clsn(getter *Char, proj bool) { | ||
5452 | 5452 | (p.hitdef.teamside-1 != getter.teamside) == (getter.hitdef.affectteam > 0)) && |
5453 | 5453 | getter.hitdef.hitflag&int32(ST_P) != 0 && |
5454 | 5454 | getter.projClsnCheck(p, false) { |
5455 | + if getter.hitdef.p1stateno >= 0 && getter.stateChange1(getter.hitdef.p1stateno, getter.hitdef.playerNo) { | |
5456 | + getter.setCtrl(false) | |
5457 | + } | |
5455 | 5458 | p.hits = -2 |
5456 | 5459 | sys.cgi[i].pctype = PC_Cancel |
5457 | 5460 | sys.cgi[i].pctime = 0 |
@@ -11,7 +11,7 @@ import ( | ||
11 | 11 | "strings" |
12 | 12 | |
13 | 13 | "github.com/go-gl/glfw/v3.2/glfw" |
14 | - "github.com/yuin/gopher-lua" | |
14 | + lua "github.com/yuin/gopher-lua" | |
15 | 15 | ) |
16 | 16 | |
17 | 17 | func init() { |
@@ -143,21 +143,21 @@ func main() { | ||
143 | 143 | } |
144 | 144 | `, "\n"), "\r\n")) |
145 | 145 | tmp := struct { |
146 | - HelperMax int32 | |
147 | - PlayerProjectileMax int | |
148 | - ExplodMax int | |
149 | - AfterImageMax int32 | |
150 | - MasterVolume int | |
151 | - WavVolume int | |
152 | - BgmVolume int | |
153 | - Attack_LifeToPowerMul float32 `json:"Attack.LifeToPowerMul"` | |
154 | - GetHit_LifeToPowerMul float32 `json:"GetHit.LifeToPowerMul"` | |
155 | - Width int32 | |
156 | - Height int32 | |
157 | - Super_TargetDefenceMul float32 `json:"Super.TargetDefenceMul"` | |
158 | - LifebarFontScale float32 | |
159 | - System string | |
160 | - KeyConfig []struct { | |
146 | + HelperMax int32 | |
147 | + PlayerProjectileMax int | |
148 | + ExplodMax int | |
149 | + AfterImageMax int32 | |
150 | + MasterVolume int | |
151 | + WavVolume int | |
152 | + BgmVolume int | |
153 | + Attack_LifeToPowerMul float32 `json:"Attack.LifeToPowerMul"` | |
154 | + GetHit_LifeToPowerMul float32 `json:"GetHit.LifeToPowerMul"` | |
155 | + Width int32 | |
156 | + Height int32 | |
157 | + Super_TargetDefenceMul float32 `json:"Super.TargetDefenceMul"` | |
158 | + LifebarFontScale float32 | |
159 | + System string | |
160 | + KeyConfig []struct { | |
161 | 161 | Joystick int |
162 | 162 | Buttons []interface{} |
163 | 163 | } |
@@ -165,19 +165,19 @@ func main() { | ||
165 | 165 | Joystick int |
166 | 166 | Buttons []interface{} |
167 | 167 | } |
168 | - NumTag int | |
169 | - TeamLifeShare bool | |
170 | - AIRandomColor bool | |
171 | - ComboExtraFrameWindow int32 | |
172 | - Fullscreen bool | |
173 | - AudioDucking bool | |
174 | - AllowDebugKeys bool | |
175 | - MSAA bool | |
176 | - PostProcessingShader int32 | |
177 | - LocalcoordScalingType int32 | |
178 | - CommonAir string | |
179 | - CommonCmd string | |
180 | - QuickLaunch int | |
168 | + NumTag int | |
169 | + TeamLifeShare bool | |
170 | + AIRandomColor bool | |
171 | + ComboExtraFrameWindow int32 | |
172 | + Fullscreen bool | |
173 | + AudioDucking bool | |
174 | + AllowDebugKeys bool | |
175 | + MSAA bool | |
176 | + PostProcessingShader int32 | |
177 | + LocalcoordScalingType int32 | |
178 | + CommonAir string | |
179 | + CommonCmd string | |
180 | + QuickLaunch int | |
181 | 181 | }{} |
182 | 182 | chk(json.Unmarshal(defcfg, &tmp)) |
183 | 183 | const configFile = "save/config.json" |
@@ -49,31 +49,31 @@ var sys = System{ | ||
49 | 49 | listenPort: "7500", |
50 | 50 | loader: *newLoader(), |
51 | 51 | numSimul: [...]int32{2, 2}, numTurns: [...]int32{2, 2}, |
52 | - ignoreMostErrors: true, | |
53 | - superpmap: *newPalFX(), | |
54 | - wincnt: wincntMap(make(map[string][]int32)), | |
55 | - wincntFileName: "save/autolevel.save", | |
56 | - powerShare: [...]bool{true, true}, | |
57 | - oldNextAddTime: 1, | |
58 | - commandLine: make(chan string), | |
59 | - cam: *newCamera(), | |
60 | - mainThreadTask: make(chan func(), 65536), | |
61 | - workpal: make([]uint32, 256), | |
62 | - errLog: log.New(os.Stderr, "", 0), | |
63 | - audioClose: make(chan bool, 1), | |
64 | - keyInput: glfw.KeyUnknown, | |
65 | - keyString: "", | |
66 | - comboExtraFrameWindow: 1, | |
52 | + ignoreMostErrors: true, | |
53 | + superpmap: *newPalFX(), | |
54 | + wincnt: wincntMap(make(map[string][]int32)), | |
55 | + wincntFileName: "save/autolevel.save", | |
56 | + powerShare: [...]bool{true, true}, | |
57 | + oldNextAddTime: 1, | |
58 | + commandLine: make(chan string), | |
59 | + cam: *newCamera(), | |
60 | + mainThreadTask: make(chan func(), 65536), | |
61 | + workpal: make([]uint32, 256), | |
62 | + errLog: log.New(os.Stderr, "", 0), | |
63 | + audioClose: make(chan bool, 1), | |
64 | + keyInput: glfw.KeyUnknown, | |
65 | + keyString: "", | |
66 | + comboExtraFrameWindow: 1, | |
67 | 67 | // Localcoord sceenpack |
68 | - luaSpriteScale: 1, | |
69 | - luaSmallPortraitScale: 1, | |
70 | - luaBigPortraitScale: 1, | |
71 | - luaSpriteOffsetX: 0, | |
72 | - lifebarScale: 1, | |
73 | - lifebarOffsetX: 0, | |
68 | + luaSpriteScale: 1, | |
69 | + luaSmallPortraitScale: 1, | |
70 | + luaBigPortraitScale: 1, | |
71 | + luaSpriteOffsetX: 0, | |
72 | + lifebarScale: 1, | |
73 | + lifebarOffsetX: 0, | |
74 | 74 | //Shader vars |
75 | 75 | MultisampleAntialiasing: false, |
76 | - PostProcessingShader: 0, | |
76 | + PostProcessingShader: 0, | |
77 | 77 | } |
78 | 78 | |
79 | 79 | type TeamMode int32 |
@@ -149,7 +149,7 @@ type System struct { | ||
149 | 149 | afterImageMax int32 |
150 | 150 | attack_LifeToPowerMul float32 |
151 | 151 | getHit_LifeToPowerMul float32 |
152 | - comboExtraFrameWindow int32 | |
152 | + comboExtraFrameWindow int32 | |
153 | 153 | envShake EnvShake |
154 | 154 | pause int32 |
155 | 155 | pausetime int32 |