Skip to content

Commit

Permalink
Merge pull request #3617 from Kukagres/master
Browse files Browse the repository at this point in the history
GPS now shows prohibited biomes if requirements are met.
  • Loading branch information
sayterdarkwynd authored Jan 3, 2025
2 parents 33b53d8 + 3331bff commit a83f95a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
27 changes: 19 additions & 8 deletions interface/kukagps/kukagps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ function populateMaterialsList()
local parameters = celestial.visitableParameters(planet)
addText(" ^green;BIOMES:^reset; ")

local forbiddenBiomes={"atropuselder","atropuselderunderground","elder","elderunderground","precursorsurface","precursorunderground","shoggothbiome"}
local anomaliesFound=false
local worldSize = world.size() or {0,0}

Expand Down Expand Up @@ -131,7 +130,7 @@ function populateMaterialsList()

local listedBiomeNames = {}
for _, biomeCode in ipairs(uniqueBiomeCodes) do
if BiomeCheck(forbiddenBiomes, biomeCode) then
if isHiddenBiome(biomeCode) then
-- Semi-secret biomes like Precursor Underground are not listed.
anomaliesFound = true
else
Expand Down Expand Up @@ -401,12 +400,24 @@ function getDate(days)
return "Year "..year..", Month "..month.." and Day "..days
end

-- check list of biomes already printed
function BiomeCheck(tbl, biome)
for _, value in pairs(tbl) do
if (value == biome) then
return true
end
local precursorBiomes = {
precursorsurface = true,
precursorunderground = true
}
local elderBiomes = {
atropuselder = true,
atropuselderunderground = true,
elder = true,
elderunderground = true,
shoggothbiome = true
}

function isHiddenBiome(biomeCode)
if precursorBiomes[biomeCode] then
return not player.hasCompletedQuest("precursor_unlock")
elseif elderBiomes[biomeCode] then
return not player.hasQuest('create_elder')
end

return false
end
2 changes: 1 addition & 1 deletion scripts/actions/monsters/farmable.lua
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ end

function removeFood(args)
storage.food = math.max((storage.food or 100) - 0.277777778/config.getParameter('hungerTime',20),0)
storage.mateTimer = math.max((storage.mateTimer or 120) - 5/config.getParameter('mateTimer',120),0)
storage.mateTimer = math.max((storage.mateTimer or 120) - 5/config.getParameter('mateTime',120),0)
self.timerPoop = (self.timerPoop or 90) - 1

if self.timerPoop <= 0 and storage.food >= 50 then
Expand Down

0 comments on commit a83f95a

Please sign in to comment.