Bump version to 0.1.6, add player kill tracking, and enhance power/lab stats handling
This commit is contained in:
@@ -1,21 +1,33 @@
|
||||
storage.totalLabCount = 0
|
||||
local labBaseSpeed = 1
|
||||
local biolabBaseSpeed = 2
|
||||
|
||||
LabsScanned = false
|
||||
|
||||
|
||||
function GenerateLabInfo()
|
||||
function ScanLabs()
|
||||
storage.labs = {}
|
||||
for _, surface in pairs(game.surfaces) do
|
||||
local labs = surface.find_entities_filtered({type="lab"})
|
||||
for index, lab in pairs(labs) do
|
||||
if lab.valid then
|
||||
storage.labs[index] = lab
|
||||
end
|
||||
for _, lab in pairs(labs) do
|
||||
storage.labs[lab.unit_number] = lab
|
||||
end
|
||||
end
|
||||
LabsScanned = true
|
||||
storage.scannedLabs = true
|
||||
end
|
||||
|
||||
|
||||
|
||||
function UpdateLabs(event)
|
||||
local lab = event.entity
|
||||
if lab and lab.valid then
|
||||
storage.labs[lab.unit_number] = lab
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function RemoveLab(event)
|
||||
local lab = event.entity
|
||||
if lab and lab.valid then
|
||||
storage.labs[lab.unit_number] = nil
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -58,7 +70,6 @@ function UpdateLabInfos()
|
||||
end
|
||||
local labSpeed = (labBase + (labBase * game.forces["player"].laboratory_speed_modifier)) * (lab.effects.speed or 1)
|
||||
totalSpeed = totalSpeed + (labSpeed* (1+(lab.effects.productivity or 0)))
|
||||
--local labSpeed = labBaseSpeed * lab.effects.speed
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user