enables basic generation for objectives

This commit is contained in:
duncathan 2020-02-26 01:34:19 -06:00
parent 09e4883acf
commit 3035764ad4
4 changed files with 29 additions and 7 deletions

View file

@ -15,7 +15,8 @@ function firstCave:new(worldGraph)
self.locations = {
firstCapsule = Location("First Cave Life Capsule", "Cave", "0401", self),
gunsmithChest = Location("Hermit Gunsmith Chest", "Pole", "0202", self),
gunsmith = Location("Tetsuzou", "Pole", "0303", self)
gunsmith = Location("Tetsuzou", "Pole", "0303", self),
gameMode = Location("Game Mode Setup Script", "Start", "0201", self)
}
self.locations.gunsmith.requirements = function(self, items)
@ -441,6 +442,10 @@ function worldGraph:getLocations()
return locations
end
function worldGraph:getGameModeSpot()
return {self.regions.firstCave.locations.gameMode}
end
function worldGraph:getPuppySpots()
return {
self.regions.upperSandZone.locations.curly,

View file

@ -34,6 +34,7 @@ function C:new()
self.worldGraph = WorldGraph(self.itemDeck)
self.customseed = nil
self.puppy = false
self.game = ""
end
function C:setPath(path)
@ -128,7 +129,14 @@ function C:_writePlaintext(tscFiles)
end
end
function C:getGameMode()
return {self.itemDeck:getByKey(self.game)}
end
function C:_shuffleItems(tscFiles)
-- place the game mode scripts in Start Point
self:_fastFillItems(self:getGameMode(), self.worldGraph:getGameModeSpot())
local mandatory = _.compact(_.shuffle(self.itemDeck:getMandatoryItems(true)))
local optional = _.compact(_.shuffle(self.itemDeck:getOptionalItems(true)))
local puppies = _.compact(_.shuffle(self.itemDeck:getItemsByAttribute("puppy")))
@ -143,8 +151,6 @@ function C:_shuffleItems(tscFiles)
-- 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()))

View file

@ -28,6 +28,17 @@ layout.go:onPress(function()
if settings.seedselect.value and settings.customseed.value ~= "" then
Randomizer.customseed = settings.customseed.value
end
if settings.bad.value then
Randomizer.game = "gameBadEnd"
else if settings.norm.value then
Randomizer.game = "gameNormalEnd"
else if settings.boss.value then
Randomizer.game = "gameAllBosses"
else
Randomizer.game = "gameBestEnd"
end
Randomizer.puppy = settings.puppy.value
C:setStatus(Randomizer:randomize())
Randomizer:new()

View file

@ -13,10 +13,10 @@ return { style = 'dialog',
},
{
{ type = 'label', text = 'Objective' },
{ type = 'radio', group = 'objective', text = 'Bad ending' },
{ type = 'radio', group = 'objective', text = 'Normal ending' },
{ type = 'radio', group = 'objective', text = 'Best ending', value = true },
{ type = 'radio', group = 'objective', text = 'All bosses' },
{ type = 'radio', group = 'objective', text = 'Bad ending', id = 'bad' },
{ type = 'radio', group = 'objective', text = 'Normal ending', id = 'norm'},
{ type = 'radio', group = 'objective', text = 'Best ending', id = 'best', value = true },
{ type = 'radio', group = 'objective', text = 'All bosses', id = 'boss' },
},
},
{ style = 'dialogFoot',