mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-16 16:21:30 +02:00
feat: capture data-only battle checkpoints
This commit is contained in:
@@ -5,6 +5,7 @@ local SaveSerializer = require("src.core.SaveSerializer")
|
||||
local SaveData = require("src.core.SaveData")
|
||||
local Version = require("src.core.Version")
|
||||
local BattleState = require("src.battle.BattleState")
|
||||
local BattleCheckpoint = require("src.core.BattleCheckpoint")
|
||||
|
||||
local Checkpoint = {}
|
||||
|
||||
@@ -172,6 +173,25 @@ function Checkpoint.capture(game)
|
||||
.. tostring(err)
|
||||
end
|
||||
|
||||
if capability.kind == "battle" then
|
||||
local battle = game.stack:top()
|
||||
local runtime, rngOrCode, battleMessage =
|
||||
BattleCheckpoint.capture(game, battle, progress, dataCopy)
|
||||
if not runtime then return nil, rngOrCode, battleMessage end
|
||||
return {
|
||||
format = Checkpoint.FORMAT,
|
||||
kind = "battle",
|
||||
identity = {
|
||||
engineVersion = Version.engine,
|
||||
gameVersion = game.save.version,
|
||||
playthroughId = game.save.meta.playthroughId,
|
||||
},
|
||||
save = progress,
|
||||
runtime = runtime,
|
||||
rng = rngOrCode,
|
||||
}
|
||||
end
|
||||
|
||||
local player = game.overworld.player
|
||||
return {
|
||||
format = Checkpoint.FORMAT,
|
||||
|
||||
Reference in New Issue
Block a user