mirror of
https://github.com/cave-story-randomizer/cave-story-randomizer
synced 2025-02-06 11:17:14 +00:00
adds support for puppysanity to randomizer
This commit is contained in:
parent
4b5b26824d
commit
df3aff4628
|
@ -33,6 +33,7 @@ function C:new()
|
|||
self.itemDeck = Items()
|
||||
self.worldGraph = WorldGraph(self.itemDeck)
|
||||
self.customseed = nil
|
||||
self.puppy = false
|
||||
end
|
||||
|
||||
function C:setPath(path)
|
||||
|
@ -128,13 +129,22 @@ function C:_writePlaintext(tscFiles)
|
|||
end
|
||||
|
||||
function C:_shuffleItems(tscFiles)
|
||||
-- first fill puppies
|
||||
self:_fastFillItems(self.itemDeck:getItemsByAttribute("puppy"), _.shuffle(self.worldGraph:getPuppySpots()))
|
||||
-- then fill one of the first cave spots with a weapon that can break blocks
|
||||
_.shuffle(self.worldGraph:getFirstCaveSpots())[1]:setItem(_.shuffle(self.itemDeck:getItemsByAttribute("weaponSN"))[1])
|
||||
|
||||
local mandatory = _.compact(_.shuffle(self.itemDeck:getMandatoryItems(true)))
|
||||
local optional = _.compact(_.shuffle(self.itemDeck:getOptionalItems(true)))
|
||||
local puppies = _.compact(_.shuffle(self.itemDeck:getItemsByAttribute("puppy")))
|
||||
|
||||
if not self.puppy then
|
||||
-- first fill puppies
|
||||
self:_fastFillItems(puppies, _.shuffle(self.worldGraph:getPuppySpots()))
|
||||
else
|
||||
-- for puppysanity, shuffle puppies in with the mandatory items
|
||||
mandatory = _.shuffle(_.append(mandatory, puppies))
|
||||
end
|
||||
|
||||
-- then fill one of the first cave spots with a weapon that can break blocks
|
||||
_.shuffle(self.worldGraph:getFirstCaveSpots())[1]:setItem(_.shuffle(self.itemDeck:getItemsByAttribute("weaponSN"))[1])
|
||||
|
||||
|
||||
|
||||
-- next fill hell chests, which cannot have mandatory items
|
||||
self:_fastFillItems(optional, _.shuffle(self.worldGraph:getHellSpots()))
|
||||
|
|
|
@ -28,6 +28,7 @@ layout.go:onPress(function()
|
|||
if settings.seedselect.value and settings.customseed.value ~= "" then
|
||||
Randomizer.customseed = settings.customseed.value
|
||||
end
|
||||
Randomizer.puppy = settings.puppy.value
|
||||
C:setStatus(Randomizer:randomize())
|
||||
Randomizer:new()
|
||||
else
|
||||
|
|
|
@ -6,6 +6,9 @@ return { style = 'dialog',
|
|||
{ type = 'radio', group = 'seed', text = 'Use random seed', value = true },
|
||||
{ flow = 'y', { type = 'radio', group = 'seed', text = 'Use custom seed', id = 'seedselect'}, { type = 'text', id = 'customseed', width = 150 }, {height = false} }
|
||||
},
|
||||
{ type = 'label', text = 'Randomization Options' },
|
||||
{ type = 'check', value = false, id = 'puppy', text = "Puppysanity"},
|
||||
{ height = false },
|
||||
},
|
||||
{ style = 'dialogFoot',
|
||||
{},
|
||||
|
|
Loading…
Reference in a new issue