mirror of
https://github.com/cave-story-randomizer/cave-story-randomizer
synced 2024-11-09 00:14:37 +00:00
generate a hash for the title screen for easy verification in races
This commit is contained in:
parent
af8421e2a5
commit
f58357832d
Binary file not shown.
|
@ -73,6 +73,7 @@ function C:randomize()
|
||||||
local tscFiles = self:_createTscFiles(dirStage)
|
local tscFiles = self:_createTscFiles(dirStage)
|
||||||
|
|
||||||
self:_shuffleItems(tscFiles)
|
self:_shuffleItems(tscFiles)
|
||||||
|
self:_generateHash()
|
||||||
if self.shuffleMusic then self.music:shuffleMusic(tscFiles) end
|
if self.shuffleMusic then self.music:shuffleMusic(tscFiles) end
|
||||||
|
|
||||||
self:_writeModifiedData(tscFiles)
|
self:_writeModifiedData(tscFiles)
|
||||||
|
@ -286,6 +287,12 @@ function C:_copyMyChar()
|
||||||
U.writeFile(path, data)
|
U.writeFile(path, data)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function C:_generateHash()
|
||||||
|
local path = self:_getWritePath() .. '/hash.txt'
|
||||||
|
local h = {love.math.random(39), love.math.random(39), love.math.random(39), love.math.random(39), love.math.random(39)}
|
||||||
|
U.writeFile(path, ("%04d,%04d,%04d,%04d,%04d"):format(h[1], h[2], h[3], h[4], h[5]))
|
||||||
|
end
|
||||||
|
|
||||||
function C:_getWritePath()
|
function C:_getWritePath()
|
||||||
return select(1, self:_getWritePaths())
|
return select(1, self:_getWritePaths())
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue