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

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
function sceneBack.pause()
love.keyboard.setKeyRepeat(true)
mergeStat(stat,players[1].stat)
if not game.replaying then
mergeStat(stat,players[1].stat)
end
TASK.clear("play")
end
function sceneBack.setting_game()

View File

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