Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Windblade-GR01 committed Nov 6, 2021
2 parents bfeced3 + 62eb6da commit c7541ed
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 64 deletions.
22 changes: 21 additions & 1 deletion data/common.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,24 @@ time = 1
[Command]
name = "menu"
command = m
time = 1
time = 1

[Command]
name = "holdfwd"
command = /$F
time = 1

[Command]
name = "holdback"
command = /$B
time = 1

[Command]
name = "holdup"
command = /$U
time = 1

[Command]
name = "holddown"
command = /$D
time = 1
1 change: 0 additions & 1 deletion data/system.base.def
Original file line number Diff line number Diff line change
Expand Up @@ -1523,7 +1523,6 @@
;menu.itemname.players = "Players"
;menu.itemname.debugkeys = "Debug Keys"
;menu.itemname.debugmode = "Debug Mode"
;menu.itemname.backgroundloading = "Background Loading"
;menu.itemname.helpermax = "HelperMax"
;menu.itemname.projectilemax = "PlayerProjectileMax"
;menu.itemname.explodmax = "ExplodMax"
Expand Down
5 changes: 1 addition & 4 deletions data/training.zss
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,8 @@ if gameMode != "training" || isHelper || teamSide != 2 {
}
# Dummy Control: Cooperative
if aiLevel = 0 && map(_iksys_trainingDummyControl) = 0 {
# Guard mode: None
if map(_iksys_trainingGuardMode) = 0 {
assertSpecial{flag: nostandguard; flag2: nocrouchguard; flag3: noairguard}
# Guard mode: Auto
} else {
if map(_iksys_trainingGuardMode) = 1 {
assertSpecial{flag: autoguard}
}
# Distance
Expand Down
2 changes: 0 additions & 2 deletions external/script/motif.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2178,7 +2178,6 @@ function motif.setBaseOptionInfo()
motif.option_info.menu_itemname_menuengine_players = "Players"
motif.option_info.menu_itemname_menuengine_debugkeys = "Debug Keys"
motif.option_info.menu_itemname_menuengine_debugmode = "Debug Mode"
motif.option_info.menu_itemname_menuengine_backgroundloading = "Background Loading"
motif.option_info.menu_itemname_menuengine_empty = ""
motif.option_info.menu_itemname_menuengine_helpermax = "HelperMax"
motif.option_info.menu_itemname_menuengine_projectilemax = "PlayerProjectileMax"
Expand Down Expand Up @@ -2295,7 +2294,6 @@ function motif.setBaseOptionInfo()
"menuengine_players",
"menuengine_debugkeys",
"menuengine_debugmode",
"menuengine_backgroundloading",
"menuengine_empty",
"menuengine_helpermax",
"menuengine_projectilemax",
Expand Down
8 changes: 4 additions & 4 deletions external/script/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ options.t_itemname = {
config.AudioDucking = false
--config.AudioSampleRate = 44100
config.AutoGuard = false
config.BackgroundLoading = false
--config.BackgroundLoading = false
config.BarGuard = false
config.BarRedLife = true
config.BarStun = false
Expand Down Expand Up @@ -1077,7 +1077,7 @@ options.t_itemname = {
return true
end,
--Background Loading
['backgroundloading'] = function(t, item, cursorPosY, moveTxt)
--[[['backgroundloading'] = function(t, item, cursorPosY, moveTxt)
if main.f_input(main.t_players, {'$F', '$B', 'pal', 's'}) then
sndPlay(motif.files.snd_data, motif.option_info.cursor_move_snd[1], motif.option_info.cursor_move_snd[2])
if config.BackgroundLoading then
Expand All @@ -1089,7 +1089,7 @@ options.t_itemname = {
modified = true
end
return true
end,
end,]]
--HelperMax
['helpermax'] = function(t, item, cursorPosY, moveTxt)
if main.f_input(main.t_players, {'$F'}) then
Expand Down Expand Up @@ -1322,7 +1322,7 @@ function options.f_vardisplay(itemname)
if itemname == 'airamping' then return options.f_boolDisplay(config.AIRamping) end
if itemname == 'audioducking' then return options.f_boolDisplay(config.AudioDucking, motif.option_info.menu_valuename_enabled, motif.option_info.menu_valuename_disabled) end
if itemname == 'autoguard' then return options.f_boolDisplay(config.AutoGuard) end
if itemname == 'backgroundloading' then return options.f_boolDisplay(config.BackgroundLoading, motif.option_info.menu_valuename_enabled, motif.option_info.menu_valuename_disabled) end
--if itemname == 'backgroundloading' then return options.f_boolDisplay(config.BackgroundLoading, motif.option_info.menu_valuename_enabled, motif.option_info.menu_valuename_disabled) end
if itemname == 'bgmvolume' then return config.VolumeBgm .. '%' end
if itemname == 'credits' then return options.f_definedDisplay(config.Credits, {[0] = motif.option_info.menu_valuename_disabled}, config.Credits) end
if itemname == 'debugkeys' then return options.f_boolDisplay(config.DebugKeys, motif.option_info.menu_valuename_enabled, motif.option_info.menu_valuename_disabled) end
Expand Down
97 changes: 48 additions & 49 deletions external/script/start.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ start.challenger = 0
local restoreCursor = false
local selScreenEnd = false
local stageEnd = false
local stageRandom = false
local stageListNo = 0
local t_aiRamp = {}
local t_gameStats = {}
Expand Down Expand Up @@ -517,6 +518,7 @@ function start.f_setStage(num, assigned)
if stageListNo == 0 then
num = main.t_selectableStages[math.random(1, #main.t_selectableStages)]
stageListNo = num -- comment out to randomize stage after each fight in survival mode, when random stage is chosen
stageRandom = true
else
num = main.t_selectableStages[stageListNo]
end
Expand Down Expand Up @@ -800,69 +802,60 @@ local function f_slideDistCalc(slide_dist, t_dist, t_speed)
end

--calculate portraits x pos
local function f_portraitsXCalc(side, t, subname, i, member)
local function f_portraitsXCalc(side, t, subname, member)
local x = t['p' .. side .. subname .. '_pos'][1] + t['p' .. side .. subname .. '_offset'][1] + (main.f_tableExists(t['p' .. side .. '_member' .. member .. subname .. '_offset'])[1] or 0)
if t['p' .. side .. subname .. '_padding'] == 1 then
return x + (2 * i - 1) * t['p' .. side .. subname .. '_spacing'][1] * t['p' .. side .. subname .. '_num'] / (2 * math.min(t['p' .. side .. subname .. '_num'], math.max(start.p[side].numChars, #start.p[side].t_selected)))
return x + (2 * member - 1) * t['p' .. side .. subname .. '_spacing'][1] * t['p' .. side .. subname .. '_num'] / (2 * math.min(t['p' .. side .. subname .. '_num'], math.max(start.p[side].numChars, #start.p[side].t_selected)))
end
return x + (i - 1) * t['p' .. side .. subname .. '_spacing'][1]
return x + (member - 1) * t['p' .. side .. subname .. '_spacing'][1]
end

--draw portraits
function start.f_drawPortraits(t_sel, side, t, subname, last, reversed, icon)
if #t_sel == 0 then
function start.f_drawPortraits(t_portraits, side, t, subname, last, icon)
if #t_portraits == 0 then
return
end
local t_portraits = {}
--not select screen or team side in coop mode
if not last or ((side == 1 and main.coop) or gamemode('versuscoop')) then
t_portraits = t_sel
--otherwise insert most recently selected chars ascending up to pX.face.num
else
for i = #t_sel, #t_sel - t['p' .. side .. subname .. '_num'] + 1, -1 do
table.insert(t_portraits, t_sel[i])
-- if next player portrait should replace previous one
if t['p' .. side .. subname .. '_num'] == 1 and last and not main.coop then
if t_portraits[#t_portraits].anim_data ~= nil then
local v = t_portraits[#t_portraits]
f_slideDistCalc(v.slide_dist, t['p' .. side .. '_member1' .. subname .. '_slide_dist'], t['p' .. side .. '_member1' .. subname .. '_slide_speed'])
main.f_animPosDraw(
v.anim_data,
f_portraitsXCalc(side, t, subname, 1) + main.f_round(v.slide_dist[1]),
t['p' .. side .. subname .. '_pos'][2] + t['p' .. side .. subname .. '_offset'][2] + (main.f_tableExists(t['p' .. side .. '_member1' .. subname .. '_offset'])[2] or 0) + main.f_round(v.slide_dist[2]),
t['p' .. side .. subname .. '_facing'],
true
)
end
return
end
--adjust order of rendering
local loopStart, loopEnd, loopStep = #t_portraits, 1, -1
if reversed then
loopStart, loopEnd, loopStep = 1, #t_portraits, 1
t_portraits = main.f_tableReverse(t_portraits)
end
--draw portraits
for i = loopStart, loopEnd, loopStep do
local member = i
if reversed then
member = #t_portraits - i + 1
end
if i <= t['p' .. side .. subname .. '_num'] then
if t_portraits[i].anim_data ~= nil then
local v = t_portraits[i]
-- otherwise render portraits in order, up to the 'num' limit
for member = #t_portraits, 1, -1 do
if member <= t['p' .. side .. subname .. '_num'] --[[or (last and main.coop)]] then
if t_portraits[member].anim_data ~= nil then
local v = t_portraits[member]
f_slideDistCalc(v.slide_dist, t['p' .. side .. '_member' .. member .. subname .. '_slide_dist'], t['p' .. side .. '_member' .. member .. subname .. '_slide_speed'])
main.f_animPosDraw(
main.f_animPosDraw(
v.anim_data,
f_portraitsXCalc(side, t, subname, i, member) + main.f_round(v.slide_dist[1]),
t['p' .. side .. subname .. '_pos'][2] + t['p' .. side .. subname .. '_offset'][2] + (main.f_tableExists(t['p' .. side .. '_member' .. member .. subname .. '_offset'])[2] or 0) + (i - 1) * t['p' .. side .. subname .. '_spacing'][2] + main.f_round(v.slide_dist[2]),
f_portraitsXCalc(side, t, subname, member) + main.f_round(v.slide_dist[1]),
t['p' .. side .. subname .. '_pos'][2] + t['p' .. side .. subname .. '_offset'][2] + (main.f_tableExists(t['p' .. side .. '_member' .. member .. subname .. '_offset'])[2] or 0) + (member - 1) * t['p' .. side .. subname .. '_spacing'][2] + main.f_round(v.slide_dist[2]),
t['p' .. side .. subname .. '_facing'],
true
)
end
end
end
--draw order icons
-- draw order icons
if icon == nil then
return
end
for i = loopStart, loopEnd, loopStep do
local member = i
if reversed then
member = #t_portraits - i + 1
end
if i <= t['p' .. side .. subname .. '_num'] and t['p' .. side .. '_member' .. member .. subname .. icon .. '_data'] ~= nil then
for member = 1, #t_portraits do
if t['p' .. side .. '_member' .. member .. subname .. icon .. '_data'] ~= nil then
main.f_animPosDraw(
t['p' .. side .. '_member' .. member .. subname .. icon .. '_data'],
f_portraitsXCalc(side, t, subname, i, member),
t['p' .. side .. subname .. '_pos'][2] + t['p' .. side .. subname .. '_offset'][2] + (main.f_tableExists(t['p' .. side .. '_member' .. member .. subname .. '_offset'])[2] or 0) + (i - 1) * t['p' .. side .. subname .. '_spacing'][2]
f_portraitsXCalc(side, t, subname, member),
t['p' .. side .. subname .. '_pos'][2] + t['p' .. side .. subname .. '_offset'][2] + (main.f_tableExists(t['p' .. side .. '_member' .. member .. subname .. '_offset'])[2] or 0) + (member - 1) * t['p' .. side .. subname .. '_spacing'][2]
)
end
end
Expand Down Expand Up @@ -1539,6 +1532,10 @@ function start.f_selectReset(hardReset)
start.c[i].randRef = nil
end
end
if stageRandom then
stageListNo = 0
stageRandom = false
end
for side = 1, 2 do
if hardReset then
start.p[side].numSimul = math.max(2, config.NumSimul[1])
Expand Down Expand Up @@ -1772,11 +1769,12 @@ function launchFight(data)
return true --continue lua code execution
end
end
if config.BackgroundLoading then
selectStart()
else
--TODO: fix config.BackgroundLoading setting
--if config.BackgroundLoading then
-- selectStart()
--else
clearSelected()
end
--end
local ok = false
local saveData = false
local loopCount = 0
Expand Down Expand Up @@ -1964,7 +1962,7 @@ function start.f_selectScreen()
--draw portraits
for side = 1, 2 do
if #start.p[side].t_selTemp > 0 then
start.f_drawPortraits(start.p[side].t_selTemp, side, motif.select_info, '_face', true, false)
start.f_drawPortraits(start.p[side].t_selTemp, side, motif.select_info, '_face', true)
end
end
--draw cell art
Expand Down Expand Up @@ -2820,7 +2818,7 @@ function start.f_selectVersus(active, t_orderSelect)
end
--draw portraits and order icons
for side = 1, 2 do
start.f_drawPortraits(start.p[side].t_selTemp, side, motif.vs_screen, '', false, true, t_icon[side])
start.f_drawPortraits(start.p[side].t_selTemp, side, motif.vs_screen, '', false, t_icon[side])
end
--draw names
for side = 1, 2 do
Expand Down Expand Up @@ -2892,9 +2890,10 @@ function start.f_selectLoading()
end
end
end
if not config.BackgroundLoading then
--TODO: fix config.BackgroundLoading setting
--if not config.BackgroundLoading then
loadStart()
end
--end
-- calling refresh() during netplay data loading can lead to synchronization error
--while motif.vs_screen.loading_data ~= nil and loading() and not network() do
-- animDraw(motif.vs_screen.loading_data)
Expand Down Expand Up @@ -3268,7 +3267,7 @@ function start.f_victory()
bgDraw(motif.victorybgdef.bg, false)
--draw portraits (starting from losers)
for side = 2, 1, -1 do
start.f_drawPortraits(start.t_victory['team' .. side], side, motif.victory_screen, '', false, false)
start.f_drawPortraits(start.t_victory['team' .. side], side, motif.victory_screen, '', false)
end
--draw winner name
t_txt_winquoteName[1]:draw()
Expand Down
2 changes: 0 additions & 2 deletions src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ type configSettings struct {
AudioDucking bool
AudioSampleRate int32
AutoGuard bool
BackgroundLoading bool
BarGuard bool
BarRedLife bool
BarStun bool
Expand Down Expand Up @@ -295,7 +294,6 @@ func setupConfig() configSettings {
"AudioDucking": false,
"AudioSampleRate": 44100,
"AutoGuard": false,
"BackgroundLoading": false,
"BarGuard": false,
"BarRedLife": true,
"BarStun": false,
Expand Down
4 changes: 3 additions & 1 deletion src/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -2808,7 +2808,9 @@ func (l *Loader) loadChar(pn int) int {
if sys.com[pn] != 0 {
p.key ^= -1
}
p.clearCachedData()
if sys.roundsExisted[pn&1] == 0 {
p.clearCachedData()
}
} else {
p = newChar(pn, 0)
sys.cgi[pn].sff = nil
Expand Down

0 comments on commit c7541ed

Please sign in to comment.