diff --git a/changelog.txt b/changelog.txt index 00bb625..9490cfe 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,9 @@ --------------------------------------------------------------------------------------------------- +Version: 1.1.11 +Date: 2022-07-12 + Change: + - drones pollute more, and pollution scales with mining actions +--------------------------------------------------------------------------------------------------- Version: 1.1.10 Date: 2021-03-09 Changes: diff --git a/info.json b/info.json index 2bf10f2..c0fddab 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "Mining_Drones", - "version": "1.1.10", + "version": "1.1.11", "title": "Mining Drones", "author": "Klonan", "contact": "", diff --git a/script/mining_drone.lua b/script/mining_drone.lua index 887c890..b2d50ad 100644 --- a/script/mining_drone.lua +++ b/script/mining_drone.lua @@ -1,5 +1,5 @@ local mining_technologies = require("script/mining_technologies") -local pollution_per_mine = 0.2 +local pollution_per_mine = 0.35 -- 0.2 local default_bot_name = shared.drone_name local mining_interval = shared.mining_interval local mining_damage = shared.mining_damage @@ -163,28 +163,29 @@ function mining_drone:process_mining() return end - - local pollute = self.entity.surface.pollute - local pollution_flow = game.pollution_statistics.on_flow - - pollute(target.position, pollution_per_mine) - pollution_flow(default_bot_name, pollution_per_mine) - if target.type ~= "resource" then error("HUEHRUEH") end + local pollution_value = 0 local mine_opts = {inventory = self.inventory} local mine = target.mine for k = 1, self.mining_count do if target.valid then mine(mine_opts) + pollution_value = pollution_value + 1 else self:clear_mining_target() break end end self.mining_count = nil - self:return_to_depot() + pollution_value = pollution_value * pollution_per_mine + + local drone = self.entity + drone.surface.pollute(drone.position, pollution_value) + game.pollution_statistics.on_flow.pollution_flow(default_bot_name, pollution_value) + + self:return_to_depot() end function mining_drone:request_order()