仅在开局和退出当前游戏时更新统计

This commit is contained in:
MrZ_26
2020-08-05 00:58:43 +08:00
parent d7136d0f1c
commit d888db9195
2 changed files with 13 additions and 1 deletions

View File

@@ -294,7 +294,9 @@ function sceneBack.load()
end end
function sceneBack.pause() function sceneBack.pause()
love.keyboard.setKeyRepeat(true) love.keyboard.setKeyRepeat(true)
mergeStat(stat,players[1].stat) if not game.replaying then
mergeStat(stat,players[1].stat)
end
TASK.clear("play") TASK.clear("play")
end end
function sceneBack.setting_game() function sceneBack.setting_game()

View File

@@ -161,6 +161,7 @@ function mergeStat(stat,delta)
end end
end end
end end
function randomTarget(P)--Return a random opponent for P function randomTarget(P)--Return a random opponent for P
if #players.alive>1 then if #players.alive>1 then
local R local R
@@ -236,6 +237,7 @@ function royaleLevelup()
end end
end end
end end
function pauseGame() function pauseGame()
if not SCN.swapping then if not SCN.swapping then
restartCount=0--Avoid strange darkness restartCount=0--Avoid strange darkness
@@ -267,6 +269,10 @@ function loadGame(M,ifQuickPlay)
SFX.play("enter") SFX.play("enter")
end end
function resetGameData() function resetGameData()
if players[1]and not game.replaying then
mergeStat(stat,players[1].stat)
end
game.frame=150-setting.reTime*15 game.frame=150-setting.reTime*15
game.result=false game.result=false
game.pauseTime=0 game.pauseTime=0
@@ -309,6 +315,10 @@ function resetGameData()
collectgarbage() collectgarbage()
end end
function resetPartGameData(replaying) function resetPartGameData(replaying)
if players[1]and not game.replaying then
mergeStat(stat,players[1].stat)
end
game.result=false game.result=false
game.garbageSpeed=1 game.garbageSpeed=1
if replaying then if replaying then