• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
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

修订版c7bd9fbcd7a217b524fc7c326075c2262f0d07aa (tree)
时间2020-01-15 01:50:37
作者neatunsou <sisiy4excite@gmai...>
Commiterneatunsou

Log Message

ishelperで-1を指定すると無指定と同じ挙動になっていたのを修正
QuickLaunchの設定が無かったのを修正
QuickLaunchモードでVS画面ポトレが表示されないのを修正
KOが表示されないのを修正
ScreenPackのBGdefにlocalcoordが反映されるようにした(暫定)

更改概述

差异

--- a/script/motif.lua
+++ b/script/motif.lua
@@ -827,7 +827,6 @@ local motif =
827827 menu_itemname_main_video = 'Video Settings', --Ikemen feature
828828 menu_itemname_main_audio = 'Audio Settings', --Ikemen feature
829829 menu_itemname_main_input = 'Input Settings', --Ikemen feature
830- menu_itemname_main_quicklaunch = 'Quick Launch', --Ikemen feature
831830 menu_itemname_main_port = 'Port Change', --Ikemen feature
832831 menu_itemname_main_default = 'Default Values', --Ikemen feature
833832 menu_itemname_main_save = 'Save and Return', --Ikemen feature
@@ -888,6 +887,7 @@ local motif =
888887 menu_itemname_gameplay_advanced = 'Advanced Settings', --Ikemen feature
889888 menu_itemname_gameplay_back = 'Back', --Ikemen feature
890889 menu_itemname_engine_allowdebugkeys = 'Debug Keys', --Ikemen feature
890+ menu_itemname_engine_quicklaunch = 'Quick Launch', --Ikemen feature
891891 menu_itemname_engine_simulmode = 'Legacy Tag Mode', --Ikemen feature
892892 menu_itemname_engine_helpermax = 'HelperMax', --Ikemen feature
893893 menu_itemname_engine_playerprojectilemax = 'PlayerProjectileMax', --Ikemen feature
--- a/script/options.lua
+++ b/script/options.lua
@@ -1271,8 +1271,14 @@ end
12711271 --;===========================================================
12721272 --; ENGINE SETTINGS
12731273 --;===========================================================
1274+local t_quicklaunchNames = {}
1275+t_quicklaunchNames[0] = "Disabled"
1276+t_quicklaunchNames[1] = "Level1"
1277+t_quicklaunchNames[2] = "Level2"
1278+
12741279 options.t_engineCfg = {
12751280 {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]},
12761282 {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)},
12771283 {data = textImgNew(), itemname = 'lifebarfontscale', displayname = motif.option_info.menu_itemname_engine_lifebarfontscale, vardata = textImgNew(), vardisplay = config.LifebarFontScale},
12781284 {data = textImgNew(), itemname = 'empty', displayname = ' '},
@@ -1314,6 +1320,16 @@ function options.f_engineCfg()
13141320 t[item].vardisplay = options.f_boolDisplay(config.AllowDebugKeys, motif.option_info.menu_itemname_enabled, motif.option_info.menu_itemname_disabled)
13151321 setAllowDebugKeys(config.AllowDebugKeys)
13161322 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
13171333 --Legacy Tag Mode
13181334 elseif t[item].itemname == 'simulmode' and (commandGetState(main.p1Cmd, 'r') or commandGetState(main.p1Cmd, 'l') or main.f_btnPalNo(main.p1Cmd) > 0) then
13191335 sndPlay(motif.files.snd_data, motif.option_info.cursor_move_snd[1], motif.option_info.cursor_move_snd[2])
--- a/script/select.lua
+++ b/script/select.lua
@@ -2704,7 +2704,7 @@ function select.f_selectVersus()
27042704 end
27052705 t_portrait = main.f_reversedTable(t_portrait)
27062706 for n = #t_portrait, 1, -1 do
2707- drawPortrait(
2707+ drawVersusPortrait(
27082708 t_portrait[n],
27092709 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),
27102710 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()
27212721 end
27222722 t_portrait = main.f_reversedTable(t_portrait)
27232723 for n = #t_portrait, 1, -1 do
2724- drawPortrait(
2724+ drawVersusPortrait(
27252725 t_portrait[n],
27262726 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),
27272727 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],
--- a/src/bgdef.go
+++ b/src/bgdef.go
@@ -174,9 +174,9 @@ func loadBGDef(def string, bgname string, sffloc string) (int, error) {
174174 s.bgc = append(s.bgc, *bgc)
175175 }
176176 }
177- //s.localscl = float32(sys.gameWidth) / float32(sys.cam.localcoord[0])
177+ s.localscl = 240 / s.localcoord[1]
178178 sys.bgdef = append(sys.bgdef, s)
179- return len(sys.bgdef)-1, nil
179+ return len(sys.bgdef) - 1, nil
180180 }
181181 func (s *BGDef) getBg(id int32) (bg []*backGround) {
182182 if id >= 0 {
@@ -318,12 +318,12 @@ func (s *BGDef) draw(top bool, x, y, scl float32) {
318318 if !top {
319319 s.action()
320320 }
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
323323 pos := [...]float32{x, y}
324324 for _, b := range s.bg {
325325 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)
327327 }
328328 }
329329 }
--- a/src/char.go
+++ b/src/char.go
@@ -2414,7 +2414,7 @@ func (c *Char) isHelper(hid BytecodeValue) BytecodeValue {
24142414 return BytecodeSF()
24152415 }
24162416 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))
24182418 }
24192419 func (c *Char) leftEdge() float32 {
24202420 return sys.cam.ScreenPos[0] / c.localscl
--- a/src/compiler.go
+++ b/src/compiler.go
@@ -1570,7 +1570,7 @@ func (c *Compiler) expValue(out *BytecodeExp, in *string,
15701570 case "inguarddist":
15711571 out.append(OC_inguarddist)
15721572 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 {
15741574 return bvNone(), err
15751575 }
15761576 out.append(OC_ishelper)
--- a/src/lifebar.go
+++ b/src/lifebar.go
@@ -885,7 +885,8 @@ func (r *LifeBarRound) act() bool {
885885 if sys.tickNextFrame() {
886886 r.swt[t]--
887887 }
888- if ats.End(r.dt[t]) {
888+ //animが終了したら数値を固定して再度animを再生しないようにする
889+ if ats.anim.anim.spr != nil && ats.End(r.dt[t]) {
889890 r.wt[t] = 2
890891 }
891892 if sys.intro < -r.ko_time-10 {
@@ -1015,8 +1016,7 @@ func (r *LifeBarRound) draw(layerno int16) {
10151016 r.win.text = tmp
10161017 }
10171018 }
1018-
1019-
1019+
10201020 if (sys.finish != FT_NotYet || sys.time == 0) && sys.winTeam >= 0 {
10211021 switch sys.winType[sys.winTeam] {
10221022 case WT_N, WT_PN:
@@ -1040,22 +1040,21 @@ func (r *LifeBarRound) draw(layerno int16) {
10401040 r.perfect.DrawScaled(float32(r.pos[0])+sys.lifebarOffsetX, float32(r.pos[1]), layerno, r.fnt, sys.lifebarScale)
10411041 }
10421042 }
1043-
1044-
1043+
10451044 }
10461045 sys.brightness = ob
10471046 }
10481047
10491048 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
10591058 }
10601059
10611060 func newLifeBarChallenger(snd *Snd, fnt []*Fnt) *LifeBarChallenger {
@@ -1077,7 +1076,7 @@ func readLifeBarChallenger(is IniSection,
10771076 ch.bg = *ReadAnimLayout("bg.", is, sff, at, 0)
10781077 return ch
10791078 }
1080-func (ch *LifeBarChallenger) step() {
1079+func (ch *LifeBarChallenger) step() {
10811080 if sys.challenger > 0 {
10821081 if ch.cnt == ch.sndtime {
10831082 ch.snd.play(ch.challenger.snd)
@@ -1145,7 +1144,7 @@ func loadLifebar(deffile string) (*Lifebar, error) {
11451144 "[tag name]": -1, "[challenger]": -1}
11461145 strc := strings.ToLower(strings.TrimSpace(str))
11471146 for k, _ := range missing {
1148- strc = strings.Replace(strc, ";" + k, "", -1)
1147+ strc = strings.Replace(strc, ";"+k, "", -1)
11491148 if strings.Contains(strc, k) {
11501149 delete(missing, k)
11511150 } else {