Go で書き直した Ikemen
修订版 | c7bd9fbcd7a217b524fc7c326075c2262f0d07aa (tree) |
---|---|
时间 | 2020-01-15 01:50:37 |
作者 | neatunsou <sisiy4excite@gmai...> |
Commiter | neatunsou |
ishelperで-1を指定すると無指定と同じ挙動になっていたのを修正
QuickLaunchの設定が無かったのを修正
QuickLaunchモードでVS画面ポトレが表示されないのを修正
KOが表示されないのを修正
ScreenPackのBGdefにlocalcoordが反映されるようにした(暫定)
@@ -827,7 +827,6 @@ local motif = | ||
827 | 827 | menu_itemname_main_video = 'Video Settings', --Ikemen feature |
828 | 828 | menu_itemname_main_audio = 'Audio Settings', --Ikemen feature |
829 | 829 | menu_itemname_main_input = 'Input Settings', --Ikemen feature |
830 | - menu_itemname_main_quicklaunch = 'Quick Launch', --Ikemen feature | |
831 | 830 | menu_itemname_main_port = 'Port Change', --Ikemen feature |
832 | 831 | menu_itemname_main_default = 'Default Values', --Ikemen feature |
833 | 832 | menu_itemname_main_save = 'Save and Return', --Ikemen feature |
@@ -888,6 +887,7 @@ local motif = | ||
888 | 887 | menu_itemname_gameplay_advanced = 'Advanced Settings', --Ikemen feature |
889 | 888 | menu_itemname_gameplay_back = 'Back', --Ikemen feature |
890 | 889 | menu_itemname_engine_allowdebugkeys = 'Debug Keys', --Ikemen feature |
890 | + menu_itemname_engine_quicklaunch = 'Quick Launch', --Ikemen feature | |
891 | 891 | menu_itemname_engine_simulmode = 'Legacy Tag Mode', --Ikemen feature |
892 | 892 | menu_itemname_engine_helpermax = 'HelperMax', --Ikemen feature |
893 | 893 | menu_itemname_engine_playerprojectilemax = 'PlayerProjectileMax', --Ikemen feature |
@@ -1271,8 +1271,14 @@ end | ||
1271 | 1271 | --;=========================================================== |
1272 | 1272 | --; ENGINE SETTINGS |
1273 | 1273 | --;=========================================================== |
1274 | +local t_quicklaunchNames = {} | |
1275 | +t_quicklaunchNames[0] = "Disabled" | |
1276 | +t_quicklaunchNames[1] = "Level1" | |
1277 | +t_quicklaunchNames[2] = "Level2" | |
1278 | + | |
1274 | 1279 | options.t_engineCfg = { |
1275 | 1280 | {data = textImgNew(), itemname = 'allowdebugkeys', displayname = motif.option_info.menu_itemname_engine_allowdebugkeys, vardata = textImgNew(), vardisplay = options.f_boolDisplay(config.AllowDebugKeys, motif.option_info.menu_itemname_enabled, motif.option_info.menu_itemname_disabled)}, |
1281 | + {data = textImgNew(), itemname = 'quicklaunch', displayname = motif.option_info.menu_itemname_engine_quicklaunch, vardata = textImgNew(), vardisplay = t_quicklaunchNames[config.QuickLaunch]}, | |
1276 | 1282 | {data = textImgNew(), itemname = 'simulmode', displayname = motif.option_info.menu_itemname_engine_simulmode, vardata = textImgNew(), vardisplay = options.f_boolDisplay(config.SimulMode, motif.option_info.menu_itemname_disabled, motif.option_info.menu_itemname_enabled)}, |
1277 | 1283 | {data = textImgNew(), itemname = 'lifebarfontscale', displayname = motif.option_info.menu_itemname_engine_lifebarfontscale, vardata = textImgNew(), vardisplay = config.LifebarFontScale}, |
1278 | 1284 | {data = textImgNew(), itemname = 'empty', displayname = ' '}, |
@@ -1314,6 +1320,16 @@ function options.f_engineCfg() | ||
1314 | 1320 | t[item].vardisplay = options.f_boolDisplay(config.AllowDebugKeys, motif.option_info.menu_itemname_enabled, motif.option_info.menu_itemname_disabled) |
1315 | 1321 | setAllowDebugKeys(config.AllowDebugKeys) |
1316 | 1322 | modified = 1 |
1323 | + -- Quick Launch | |
1324 | + elseif t[item].itemname == 'quicklaunch' and (commandGetState(main.p1Cmd, 'r') or commandGetState(main.p1Cmd, 'l') or main.f_btnPalNo(main.p1Cmd) > 0) then | |
1325 | + sndPlay(motif.files.snd_data, motif.option_info.cursor_move_snd[1], motif.option_info.cursor_move_snd[2]) | |
1326 | + if commandGetState(main.p1Cmd, 'r') and config.QuickLaunch < #t_quicklaunchNames then | |
1327 | + config.QuickLaunch = config.QuickLaunch + 1 | |
1328 | + elseif commandGetState(main.p1Cmd, 'l') and config.QuickLaunch > 0 then | |
1329 | + config.QuickLaunch = config.QuickLaunch - 1 | |
1330 | + end | |
1331 | + t[item].vardisplay = t_quicklaunchNames[config.QuickLaunch] | |
1332 | + modified = 1 | |
1317 | 1333 | --Legacy Tag Mode |
1318 | 1334 | elseif t[item].itemname == 'simulmode' and (commandGetState(main.p1Cmd, 'r') or commandGetState(main.p1Cmd, 'l') or main.f_btnPalNo(main.p1Cmd) > 0) then |
1319 | 1335 | sndPlay(motif.files.snd_data, motif.option_info.cursor_move_snd[1], motif.option_info.cursor_move_snd[2]) |
@@ -2704,7 +2704,7 @@ function select.f_selectVersus() | ||
2704 | 2704 | end |
2705 | 2705 | t_portrait = main.f_reversedTable(t_portrait) |
2706 | 2706 | for n = #t_portrait, 1, -1 do |
2707 | - drawPortrait( | |
2707 | + drawVersusPortrait( | |
2708 | 2708 | t_portrait[n], |
2709 | 2709 | motif.vs_screen.p1_pos[1] + motif.vs_screen.p1_offset[1] + motif.vs_screen['p1_c' .. n .. '_offset'][1] + (n - 1) * motif.vs_screen.p1_spacing[1] + select.f_alignOffset(motif.vs_screen.p1_facing), |
2710 | 2710 | motif.vs_screen.p1_pos[2] + motif.vs_screen.p1_offset[2] + motif.vs_screen['p1_c' .. n .. '_offset'][2] + (n - 1) * motif.vs_screen.p1_spacing[2], |
@@ -2721,7 +2721,7 @@ function select.f_selectVersus() | ||
2721 | 2721 | end |
2722 | 2722 | t_portrait = main.f_reversedTable(t_portrait) |
2723 | 2723 | for n = #t_portrait, 1, -1 do |
2724 | - drawPortrait( | |
2724 | + drawVersusPortrait( | |
2725 | 2725 | t_portrait[n], |
2726 | 2726 | motif.vs_screen.p2_pos[1] + motif.vs_screen.p2_offset[1] + motif.vs_screen['p2_c' .. n .. '_offset'][1] + (n - 1) * motif.vs_screen.p2_spacing[1] + select.f_alignOffset(motif.vs_screen.p2_facing), |
2727 | 2727 | motif.vs_screen.p2_pos[2] + motif.vs_screen.p2_offset[2] + motif.vs_screen['p2_c' .. n .. '_offset'][2] + (n - 1) * motif.vs_screen.p2_spacing[2], |
@@ -174,9 +174,9 @@ func loadBGDef(def string, bgname string, sffloc string) (int, error) { | ||
174 | 174 | s.bgc = append(s.bgc, *bgc) |
175 | 175 | } |
176 | 176 | } |
177 | - //s.localscl = float32(sys.gameWidth) / float32(sys.cam.localcoord[0]) | |
177 | + s.localscl = 240 / s.localcoord[1] | |
178 | 178 | sys.bgdef = append(sys.bgdef, s) |
179 | - return len(sys.bgdef)-1, nil | |
179 | + return len(sys.bgdef) - 1, nil | |
180 | 180 | } |
181 | 181 | func (s *BGDef) getBg(id int32) (bg []*backGround) { |
182 | 182 | if id >= 0 { |
@@ -318,12 +318,12 @@ func (s *BGDef) draw(top bool, x, y, scl float32) { | ||
318 | 318 | if !top { |
319 | 319 | s.action() |
320 | 320 | } |
321 | - x, y = x/s.localscl, y/s.localscl | |
322 | - bgscl := float32(1) | |
321 | + //x, y = x/s.localscl, y/s.localscl | |
322 | + bgscl := s.localscl | |
323 | 323 | pos := [...]float32{x, y} |
324 | 324 | for _, b := range s.bg { |
325 | 325 | if b.visible && b.toplayer == top && b.anim.spr != nil { |
326 | - b.draw(pos, scl, bgscl, s.localscl, s.scale, 0) | |
326 | + b.draw(pos, scl, bgscl, 1, s.scale, 0) | |
327 | 327 | } |
328 | 328 | } |
329 | 329 | } |
@@ -2414,7 +2414,7 @@ func (c *Char) isHelper(hid BytecodeValue) BytecodeValue { | ||
2414 | 2414 | return BytecodeSF() |
2415 | 2415 | } |
2416 | 2416 | id := hid.ToI() |
2417 | - return BytecodeBool(c.helperIndex != 0 && (id <= 0 || c.helperId == id)) | |
2417 | + return BytecodeBool(c.helperIndex != 0 && (id == math.MinInt32 || c.helperId == id)) | |
2418 | 2418 | } |
2419 | 2419 | func (c *Char) leftEdge() float32 { |
2420 | 2420 | return sys.cam.ScreenPos[0] / c.localscl |
@@ -1570,7 +1570,7 @@ func (c *Compiler) expValue(out *BytecodeExp, in *string, | ||
1570 | 1570 | case "inguarddist": |
1571 | 1571 | out.append(OC_inguarddist) |
1572 | 1572 | case "ishelper": |
1573 | - if _, err := c.oneArg(out, in, rd, true, BytecodeInt(-1)); err != nil { | |
1573 | + if _, err := c.oneArg(out, in, rd, true, BytecodeInt(math.MinInt32)); err != nil { | |
1574 | 1574 | return bvNone(), err |
1575 | 1575 | } |
1576 | 1576 | out.append(OC_ishelper) |
@@ -885,7 +885,8 @@ func (r *LifeBarRound) act() bool { | ||
885 | 885 | if sys.tickNextFrame() { |
886 | 886 | r.swt[t]-- |
887 | 887 | } |
888 | - if ats.End(r.dt[t]) { | |
888 | + //animが終了したら数値を固定して再度animを再生しないようにする | |
889 | + if ats.anim.anim.spr != nil && ats.End(r.dt[t]) { | |
889 | 890 | r.wt[t] = 2 |
890 | 891 | } |
891 | 892 | if sys.intro < -r.ko_time-10 { |
@@ -1015,8 +1016,7 @@ func (r *LifeBarRound) draw(layerno int16) { | ||
1015 | 1016 | r.win.text = tmp |
1016 | 1017 | } |
1017 | 1018 | } |
1018 | - | |
1019 | - | |
1019 | + | |
1020 | 1020 | if (sys.finish != FT_NotYet || sys.time == 0) && sys.winTeam >= 0 { |
1021 | 1021 | switch sys.winType[sys.winTeam] { |
1022 | 1022 | case WT_N, WT_PN: |
@@ -1040,22 +1040,21 @@ func (r *LifeBarRound) draw(layerno int16) { | ||
1040 | 1040 | r.perfect.DrawScaled(float32(r.pos[0])+sys.lifebarOffsetX, float32(r.pos[1]), layerno, r.fnt, sys.lifebarScale) |
1041 | 1041 | } |
1042 | 1042 | } |
1043 | - | |
1044 | - | |
1043 | + | |
1045 | 1044 | } |
1046 | 1045 | sys.brightness = ob |
1047 | 1046 | } |
1048 | 1047 | |
1049 | 1048 | type LifeBarChallenger struct { |
1050 | - cnt int32 | |
1051 | - snd *Snd | |
1052 | - pos [2]int32 | |
1053 | - challenger AnimTextSnd | |
1054 | - sndtime int32 | |
1055 | - over_pause int32 | |
1056 | - over_time int32 | |
1057 | - bg AnimLayout | |
1058 | - fnt []*Fnt | |
1049 | + cnt int32 | |
1050 | + snd *Snd | |
1051 | + pos [2]int32 | |
1052 | + challenger AnimTextSnd | |
1053 | + sndtime int32 | |
1054 | + over_pause int32 | |
1055 | + over_time int32 | |
1056 | + bg AnimLayout | |
1057 | + fnt []*Fnt | |
1059 | 1058 | } |
1060 | 1059 | |
1061 | 1060 | func newLifeBarChallenger(snd *Snd, fnt []*Fnt) *LifeBarChallenger { |
@@ -1077,7 +1076,7 @@ func readLifeBarChallenger(is IniSection, | ||
1077 | 1076 | ch.bg = *ReadAnimLayout("bg.", is, sff, at, 0) |
1078 | 1077 | return ch |
1079 | 1078 | } |
1080 | -func (ch *LifeBarChallenger) step() { | |
1079 | +func (ch *LifeBarChallenger) step() { | |
1081 | 1080 | if sys.challenger > 0 { |
1082 | 1081 | if ch.cnt == ch.sndtime { |
1083 | 1082 | ch.snd.play(ch.challenger.snd) |
@@ -1145,7 +1144,7 @@ func loadLifebar(deffile string) (*Lifebar, error) { | ||
1145 | 1144 | "[tag name]": -1, "[challenger]": -1} |
1146 | 1145 | strc := strings.ToLower(strings.TrimSpace(str)) |
1147 | 1146 | for k, _ := range missing { |
1148 | - strc = strings.Replace(strc, ";" + k, "", -1) | |
1147 | + strc = strings.Replace(strc, ";"+k, "", -1) | |
1149 | 1148 | if strings.Contains(strc, k) { |
1150 | 1149 | delete(missing, k) |
1151 | 1150 | } else { |