Skip to content

Commit

Permalink
whitespace and comment removal
Browse files Browse the repository at this point in the history
  • Loading branch information
sayterdarkwynd committed Jan 3, 2025
1 parent a153aaf commit 28cefc8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
34 changes: 17 additions & 17 deletions bees/apiary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -521,11 +521,10 @@ function getFrames(dt)
local consumed = world.containerTakeNumItemsAt(entity.id(), frameSlot-1, 1)
if consumed then
contents[frameSlot].count = contents[frameSlot].count - consumed.count
end
end
end
self.frameTakeTimers[frameCounter]=0.0
end

end
end
end
Expand Down Expand Up @@ -753,26 +752,26 @@ function youngQueenToQueen(youngQueen)
return newQueen
end

-- Kill drones based on their amount when no queen is present
function droneDecay(slot)
local toughness = math.max(genelib.statFromGenomeToValue(contents[slot].parameters.genome, "droneToughness") + frameBonuses.droneToughness, 1)
local amount = contents[slot].count -- set the amount
if (math.random( 8000 ) / 1000) > math.log( 1 + toughness ) then --toughness directly influcences chances of drones dying
-- Kill drones based on their amount when no queen is present. Use toughness to determine how bad it gets.
function droneDecay(slot)
local toughness = math.max(genelib.statFromGenomeToValue(contents[slot].parameters.genome,"droneToughness") + frameBonuses.droneToughness,1)
local amount = contents[slot].count
if (math.random( 8000 )/1000) > math.log( 1 + toughness ) then
world.containerTakeNumItemsAt(entity.id(), slot-1, math.floor(amount * beeData.droneDecayPercentile + beeData.droneDecayFlat))
contents[slot] = world.containerItemAt(entity.id(), slot-1)
end
end

-- Receives a slot and reduces the amount of drones there based on the drones mite resistance stat and the amount of mites
function miteDamage(slot)
--local toughness = math.max(genelib.statFromGenomeToValue(contents[slot].parameters.genome, "droneToughness") + frameBonuses.droneToughness, 1) -- Having this be 0 will instantly kill all drones as soon as a mite is added
function miteDamage(slot)
--local toughness = math.max(genelib.statFromGenomeToValue(contents[slot].parameters.genome, "droneToughness") + frameBonuses.droneToughness, 1)
--world.containerTakeNumItemsAt(entity.id(), slot-1, math.floor(storage.mites / toughness))
--contents[slot] = world.containerItemAt(entity.id(), slot-1)
end

-- Checks if the passed drone is active
function isDroneActive(drone)
if not hasFrame or not queen then -- No frames = no activity
function isDroneActive(drone)
if not hasFrame or not queen then
return false
end

Expand All @@ -798,8 +797,9 @@ function isDroneActive(drone)
end

-- Function to check if the hive has any currently active drones. Used by other apiary instances to determine their own drone efficiency.
function areDronesActive()
if not contents then return false end -- Return false if the object haven't even inited
function areDronesActive()
if not contents then return false end

for _, slot in ipairs(droneSlots) do
local item = contents[slot]
if item and root.itemHasTag(item.name, "bee") and root.itemHasTag(item.name, "drone") then
Expand All @@ -812,7 +812,7 @@ function areDronesActive()
end

-- Progress drones production based on the drone received
function droneProduction(drone)
function droneProduction(drone)
local biomeFavor = getBiomeFavor(drone.name) -- Get biome favor. Do nothing else if its considered deadly for the bee.
if biomeFavor == -1 then return end

Expand Down Expand Up @@ -855,11 +855,11 @@ function droneProduction(drone)
end
end

-- Removed from mod.
-- Removed from mod
function miteGrowth()
-- New (2024, November)
-- Check against a d100 roll.
-- * On a success, Drones reduce Mite total by the Bees Mite Resistance.
-- Check against a d100 roll.
-- * On a success, Drones reduce Mite total by the Bees Mite Resistance.
-- * On a failure, Mites increase by MiteTotal + (Mite Total * Growth %)
--
-- New Calculation (Resistance)
Expand Down
2 changes: 1 addition & 1 deletion bees/beeBuilder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function build(directory, config, parameters, level, seed)

--if changing this, make sure it matches in apiary.lua
---24.4992 is the total for 2 stacks of Tech frames at 64 units
local fullLifespan = genelib.statFromGenomeToValue(parameters.genome, "queenLifespan") *2
local fullLifespan = genelib.statFromGenomeToValue(parameters.genome, "queenLifespan") *2

if not parameters.lifespan then
parameters.lifespan = fullLifespan
Expand Down

0 comments on commit 28cefc8

Please sign in to comment.