Skip to content

Commit

Permalink
Merge pull request #3590 from Kherae/master
Browse files Browse the repository at this point in the history
backend fixes and stuff
  • Loading branch information
sayterdarkwynd authored Sep 4, 2024
2 parents ce65219 + 87e3ce2 commit 232ceb4
Show file tree
Hide file tree
Showing 121 changed files with 987 additions and 956 deletions.
68 changes: 34 additions & 34 deletions bees/apiary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ specialFrameFunctions = {
end
end,
copperFrame = function(data)
self.randAmount = math.random(1,2)
self.randAmount = math.random(1,2)
if isHiveQueenActive(true) and areDronesActive() then
if not ironFrameTimer then
ironFrameTimer = data[1]
Expand All @@ -105,7 +105,7 @@ specialFrameFunctions = {
end
end,
ironFrame = function(data)
self.randAmount = math.random(1,2)
self.randAmount = math.random(1,2)
if isHiveQueenActive(true) and areDronesActive() then
if not ironFrameTimer then
ironFrameTimer = data[1]
Expand All @@ -118,7 +118,7 @@ specialFrameFunctions = {
end
end,
tungstenFrame = function(data)
self.randAmount = math.random(1,2)
self.randAmount = math.random(1,2)
if isHiveQueenActive(true) and areDronesActive() then
if not ironFrameTimer then
ironFrameTimer = data[1]
Expand All @@ -131,7 +131,7 @@ specialFrameFunctions = {
end
end,
titaniumFrame = function(data)
self.randAmount = math.random(1,2)
self.randAmount = math.random(1,2)
if isHiveQueenActive(true) and areDronesActive() then
if not ironFrameTimer then
ironFrameTimer = data[1]
Expand All @@ -144,7 +144,7 @@ specialFrameFunctions = {
end
end,
durasteelFrame = function(data)
self.randAmount = math.random(1,2)
self.randAmount = math.random(1,2)
if isHiveQueenActive(true) and areDronesActive() then
if not ironFrameTimer then
ironFrameTimer = data[1]
Expand Down Expand Up @@ -172,7 +172,7 @@ function init()
biome = world.type()

-- Disabled on ship and player space stations
if biome == "unknown" then --or biome == "playerstation" then
if biome == "unknown" then --or biome == "playerstation" then
script.setUpdateDelta(-1)
return
end
Expand Down Expand Up @@ -527,7 +527,7 @@ function getFrames(dt)
frameBonuses[stat] = true
end
elseif cfg.config[stat] then
-- the total frame count influences the overall stats. Take the current frame bonus and add the amount in the stack to the provided bonus
-- the total frame count influences the overall stats. Take the current frame bonus and add the amount in the stack to the provided bonus
frameBonuses[stat] = (frameBonuses[stat] + cfg.config[stat]) * (1 + ((contents[frameSlot].count/100) * 0.5 )) --add total frames to total
end
end
Expand Down Expand Up @@ -655,7 +655,7 @@ function queenProduction()
--youngQueenProgress = youngQueenProgress + productionQueen * (math.random(beeData.productionRandomModifierRange[1],beeData.productionRandomModifierRange[2]) * 0.01) * 0.25
youngQueenProgress = youngQueenProgress + productionQueen * (math.random(beeData.productionRandomModifierRange[1],beeData.productionRandomModifierRange[2]) * 0.01) * 0.5
--sb.logInfo(youngQueenProgress)
droneProgress = droneProgress + productionDrone * (math.random(beeData.productionRandomModifierRange[1],beeData.productionRandomModifierRange[2]) * 0.01) * 0.25
droneProgress = droneProgress + productionDrone * (math.random(beeData.productionRandomModifierRange[1],beeData.productionRandomModifierRange[2]) * 0.01) * 0.25

if youngQueenProgress >= beeData.youngQueenProductionRequirement then
local produced = math.floor(youngQueenProgress / beeData.youngQueenProductionRequirement)
Expand Down Expand Up @@ -736,11 +736,11 @@ end
-- Can be called from other places (Like the frame scripts)
function ageQueen(amount)
--if changing this, make sure it matches in beeBuilder.lua
local fullLifespan = genelib.statFromGenomeToValue(queen.parameters.genome, "queenLifespan") * ((frameBonuses.queenLifespan or 0 / 8) + 1)
--sb.logInfo(fullLifespan)
local fullLifespan = genelib.statFromGenomeToValue(queen.parameters.genome, "queenLifespan") * ((frameBonuses.queenLifespan or 0 / 8) + 1)
--sb.logInfo(fullLifespan)

if not queen.parameters.lifespan or queen.parameters.lifespan < 0 then
queen.parameters.lifespan = fullLifespan
queen.parameters.lifespan = fullLifespan
end


Expand Down Expand Up @@ -993,21 +993,21 @@ function miteGrowth()
--sb.logInfo("%s",sDBG)

--display an infested hive image over the normal hive appearance if its infested enough
if storage.mites > 20 then --if mites pass 20, display a really rotten looking apiary
animator.setAnimationState("base", "infested2", true)
animator.setAnimationState("warning", "on", true)
elseif storage.mites > 6 then --if mites pass 6, display a rotten looking apiary
animator.setAnimationState("base", "infested", true)
animator.setAnimationState("warning", "on", true)
if storage.mites > 20 then --if mites pass 20, display a really rotten looking apiary
animator.setAnimationState("base", "infested2", true)
animator.setAnimationState("warning", "on", true)
elseif storage.mites > 6 then --if mites pass 6, display a rotten looking apiary
animator.setAnimationState("base", "infested", true)
animator.setAnimationState("warning", "on", true)
elseif storage.mites > 0.98 then
animator.setAnimationState("warning", "on", true) --show symbol for mite infestation, but dont change apiary look
animator.setAnimationState("warning", "on", true) --show symbol for mite infestation, but dont change apiary look
else
animator.setAnimationState("base", "default", true)
animator.setAnimationState("warning", "off", true)
animator.setAnimationState("base", "default", true)
animator.setAnimationState("warning", "off", true)
end
-- elseif fartstick <= beeData.mites.infestationChance then
elseif math.random() <= beeData.mites.infestationChance then
storage.mites = beeData.mites.growthStatic --storage.mites = storage.mites + (storage.mites*mult) - (hiveMiteResistance)
storage.mites = beeData.mites.growthStatic --storage.mites = storage.mites + (storage.mites*mult) - (hiveMiteResistance)
end
end

Expand Down Expand Up @@ -1120,27 +1120,27 @@ function getBiomeFavor(name)
--frame immunity to biomes
if frameBonuses.radResistance then
if (biome == "alien") or (biome == "jungle") or (biome == "barren") or (biome == "barren2") or (biome == "barren3") or (biome == "chromatic") or (biome == "irradiated") or (biome == "metallicmoon") then
if (favor < 2) then
favor = 2
end
if (favor < 2) then
favor = 2
end
end
elseif frameBonuses.coldResistance then
if (biome == "snow") or (biome == "arctic") or (biome == "snowdark") or (biome == "arcticdark") or (biome == "tundra") or (biome == "tundradark") or (biome == "crystalmoon") or (biome == "frozenvolcanic") or (biome == "icemoon") or (biome == "icewaste") or (biome == "icewastedark") or (biome == "nitrogensea") then
if (favor < 2) then
favor = 2
end
if (favor < 2) then
favor = 2
end
end
elseif frameBonuses.heatResistance then
if (biome == "desert") or (biome == "volcanic") or (biome == "volcanicdark") or (biome == "magma") or (biome == "magmadark") or (biome == "desertwastes") or (biome == "desertwastesdark") or (biome == "infernus") or (biome == "infernusdark") or (biome == "frozenvolcanic") then
if (favor < 2) then
favor = 2
end
if (favor < 2) then
favor = 2
end
end
elseif frameBonuses.physicalResistance then
if (biome == "toxic") or (biome == "moon") or (biome == "scorched") or (biome == "scorchedcity") or (biome == "volcanic") or (biome == "volcanicdark") or (biome == "savannah") or (biome == "jungle") or (biome == "thickjungle") or (biome == "sulphuric") or (biome == "sulphuricdark") or (biome == "tidewater") then
if (favor < 2) then
favor = 2
end
if (biome == "toxic") or (biome == "moon") or (biome == "scorched") or (biome == "scorchedcity") or (biome == "volcanic") or (biome == "volcanicdark") or (biome == "savannah") or (biome == "jungle") or (biome == "thickjungle") or (biome == "sulphuric") or (biome == "sulphuricdark") or (biome == "tidewater") then
if (favor < 2) then
favor = 2
end
end
end

Expand Down
52 changes: 28 additions & 24 deletions interface/scripted/fu_upgradetable/fu_upgradetable.lua
Original file line number Diff line number Diff line change
Expand Up @@ -169,40 +169,44 @@ function populateItemList(forceRepop)
local upgradableItems={}

for i = 1, #upgradeableWeaponItems do
local monkeys=deepSizeOf(upgradeableWeaponItems[i])
if monkeys <=250 then
upgradeableWeaponItems[i].count = 1
local itemLevel
if upgradeableWeaponItems[i].parameters.level then
itemLevel = upgradeableWeaponItems[i].parameters.level
else
local itemConfig = root.itemConfig(upgradeableWeaponItems[i])
if itemConfig.config.level then
itemLevel = itemConfig.config.level
if (not upgradeableWeaponItems[i].parameters.itemTags) or contains(upgradeableWeaponItems[i].parameters.itemTags,"upgradeableWeapon") then
local monkeys=deepSizeOf(upgradeableWeaponItems[i])
if monkeys <=250 then
upgradeableWeaponItems[i].count = 1
local itemLevel
if upgradeableWeaponItems[i].parameters.level then
itemLevel = upgradeableWeaponItems[i].parameters.level
else
itemLevel = 1
local itemConfig = root.itemConfig(upgradeableWeaponItems[i])
if itemConfig.config.level then
itemLevel = itemConfig.config.level
else
itemLevel = 1
end
end
table.insert(upgradableItems,{itemData=upgradeableWeaponItems[i],itemType="weapon",itemLevel=itemLevel})
end
table.insert(upgradableItems,{itemData=upgradeableWeaponItems[i],itemType="weapon",itemLevel=itemLevel})
end
end

for i = 1, #upgradeableToolItems do
local monkeys=deepSizeOf(upgradeableToolItems[i])
if monkeys <=250 then
upgradeableToolItems[i].count = 1
local itemLevel
if upgradeableToolItems[i].parameters.level then
itemLevel = upgradeableToolItems[i].parameters.level
else
local itemConfig = root.itemConfig(upgradeableToolItems[i])
if itemConfig.config.level then
itemLevel = itemConfig.config.level
if (not upgradeableToolItems[i].parameters.itemTags) or contains(upgradeableToolItems[i].parameters.itemTags,"upgradeableWeapon") then
local monkeys=deepSizeOf(upgradeableToolItems[i])
if monkeys <=250 then
upgradeableToolItems[i].count = 1
local itemLevel
if upgradeableToolItems[i].parameters.level then
itemLevel = upgradeableToolItems[i].parameters.level
else
itemLevel = 1
local itemConfig = root.itemConfig(upgradeableToolItems[i])
if itemConfig.config.level then
itemLevel = itemConfig.config.level
else
itemLevel = 1
end
end
table.insert(upgradableItems,{itemData=upgradeableToolItems[i],itemType="tool", itemLevel=itemLevel})
end
table.insert(upgradableItems,{itemData=upgradeableToolItems[i],itemType="tool", itemLevel=itemLevel})
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ require "/scripts/util.lua"

local originalUpdate = update
local originalInit = init
local cacheHarvestTime

function init()
originalInit()
Expand All @@ -12,51 +13,63 @@ function init()
return math.max(storage.harvestTime - (world.time() - storage.lastHarvest), 0)
end
end)
cacheHarvestTime=config.getParameter("harvestTime")
end

function resetMonsterHarvest()
storage.lastHarvest = world.time()
harvestTimeLeft = config.getParameter("pandorasboxHarvestTimeLeft")
if not storage.harvestTime and harvestTimeLeft then
storage.harvestTime = harvestTimeLeft
else
storage.harvestTime = util.randomInRange(config.getParameter("harvestTime"))
end
cacheHarvestTime=config.getParameter("harvestTime")
storage.lastHarvest = world.time()
harvestTimeLeft = config.getParameter("pandorasboxHarvestTimeLeft")
if not storage.harvestTime and harvestTimeLeft then
storage.harvestTime = harvestTimeLeft
else
storage.harvestTime = util.randomInRange(cacheHarvestTime)
end
end

function resolveStageDuration(dur)
if type(dur)=="table" then
return math.max(unpack(dur))
else
return dur
end
end

function hasMonsterHarvest(args, board)
if not storage.lastHarvest then
resetMonsterHarvest()
end

if world.time() - storage.lastHarvest >= storage.harvestTime then
return true
else
return false
end
local harvestMath=(world.time() - storage.lastHarvest)
if (not storage.lastHarvest) or ((not cacheHarvestTime) or (harvestMath<0) or (harvestMath>=(resolveStageDuration(cacheHarvestTime))*100)) then
resetMonsterHarvest()
return false
end

if harvestMath >= storage.harvestTime then
return true
else
return false
end
end

function update(dt)
originalUpdate(dt)
if config.getParameter("wildHarvestable") or config.getParameter("ownerUuid") then
monster.setInteractive(hasMonsterHarvest())
end
originalUpdate(dt)
if config.getParameter("wildHarvestable") or config.getParameter("ownerUuid") then
monster.setInteractive(hasMonsterHarvest())
end
end

function dropMonsterHarvest(args, board)
local treasurePool = config.getParameter("harvestPool")
local treasure = root.createTreasure(treasurePool, monster.level())
local spawnPosition = vec2.add(mcontroller.position(), config.getParameter("harvestSpawnOffset", {0, 0}))

for _,item in pairs(treasure) do
world.spawnItem(item, spawnPosition)
end
resetMonsterHarvest()
return true
local treasurePool = config.getParameter("harvestPool")
local treasure = root.createTreasure(treasurePool, monster.level())
local spawnPosition = vec2.add(mcontroller.position(), config.getParameter("harvestSpawnOffset", {0, 0}))

for _,item in pairs(treasure) do
world.spawnItem(item, spawnPosition)
end
resetMonsterHarvest()
return true
end

function interact()
if hasMonsterHarvest() then
dropMonsterHarvest()
end
if hasMonsterHarvest() then
dropMonsterHarvest()
end
end
21 changes: 12 additions & 9 deletions objects/gels/isn_accelgel/isn_accelgel.lua
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
require "/stats/effects/fu_statusUtil.lua"

function init()
animator.setParticleEmitterOffsetRegion("yellow", mcontroller.boundBox())
animator.setParticleEmitterActive("yellow", true)
animator.setParticleEmitterOffsetRegion("cyan", mcontroller.boundBox())
animator.setParticleEmitterActive("cyan", true)
animator.setParticleEmitterOffsetRegion("yellow", mcontroller.boundBox())
animator.setParticleEmitterActive("yellow", true)
animator.setParticleEmitterOffsetRegion("cyan", mcontroller.boundBox())
animator.setParticleEmitterActive("cyan", true)
end

function update(dt)
mcontroller.controlModifiers({
groundMovementModifier = 0.75,
runModifier = 0.75,
jumpModifier = 0.5
})
applyFilteredModifiers({
groundMovementModifier = 0.75,
speedModifier = 0.75,
airJumpModifier = 0.5
})
end

function uninit()
filterModifiers({},true)
end
Loading

0 comments on commit 232ceb4

Please sign in to comment.