]> git.somenet.org - factorio/Waterbomb.git/commitdiff
RELEASE 2.0.0 - Initial compatibility with Factorio 2.0 master
authorSomeone <someone@somenet.org>
Tue, 22 Oct 2024 13:32:02 +0000 (15:32 +0200)
committerSomeone <someone@somenet.org>
Tue, 22 Oct 2024 13:32:02 +0000 (15:32 +0200)
changelog.txt
control.lua
info.json
migrations/Waterbomb_0.16.5.json [deleted file]
migrations/Waterbomb_0.16.5.lua [deleted file]
prototypes/recipes.lua

index 36b3a9b7d53a38424396c814e81583d82ac42d1b..1f508b9cc51969e4bd242f37b6bfd4295317f5d8 100644 (file)
@@ -1,3 +1,10 @@
+---------------------------------------------------------------------------------------------------
+Version: 2.0.0
+Date: 2024-10-21
+
+  Changed:
+    - Initial compatibility with Factorio 2.0
+
 ---------------------------------------------------------------------------------------------------
 Version: 1.1.3
 Date: 2024-01-02
index b27e0b3b15e6172fda995fa94d82953199dfb7f7..649c008121e064940a0eecf0d37a164c85154856 100644 (file)
@@ -1,5 +1,5 @@
 
-local bombs
+local waterbombs
 local replaceableTiles = {
     ["water"] = "grass-1",
     ["deepwater"] = "grass-1",
@@ -9,25 +9,25 @@ local replaceableTiles = {
 
 
 script.on_configuration_changed(function(data)
-    if global.waterbombs ~= nil then
+    if waterbombs ~= nil then
         script.on_event(defines.events.on_tick, tickBombs)
     end
 end)
 
 
 script.on_load(function(event)
-    if global.waterbombs ~= nil then
+    if waterbombs ~= nil then
         script.on_event(defines.events.on_tick, tickBombs)
     end
 end)
 
 
 script.on_event(defines.events.on_built_entity, function(event)
-    if event.created_entity.name == "waterbomb" then
-        global.waterbombs = {}
+    if event.entity.name == "waterbomb" then
+        waterbombs = {}
         for _, surface in pairs(game.surfaces) do
             for _, entity in pairs(surface.find_entities_filtered{name="waterbomb"}) do
-                table.insert(global.waterbombs, entity)
+                table.insert(waterbombs, entity)
             end
         end
         script.on_event(defines.events.on_tick, tickBombs)
@@ -37,9 +37,9 @@ end)
 
 function tickBombs(event)
     if event.tick % 20 == 0 then
-        for k,e in pairs(global.waterbombs) do
+        for k,e in pairs(waterbombs) do
             if not e.valid then
-                table.remove(global.waterbombs, k)
+                table.remove(waterbombs, k)
 
             elseif e.energy > 49000000 then
                 local epos, x, y, distX, distY, surface
@@ -67,7 +67,7 @@ function tickBombs(event)
 
                 -- bomb explodes
                 e.destroy()
-                table.remove(global.waterbombs, k)
+                table.remove(waterbombs, k)
 
                 -- water is created
                 createWater(x, y, explosionRadius, surface)
@@ -82,8 +82,8 @@ function tickBombs(event)
         end
 
         -- nothing more to be exploded. Stop ticking.
-        if #global.waterbombs == 0 then
-            global.waterbombs = nil
+        if #waterbombs == 0 then
+            waterbombs = nil
             script.on_event(defines.events.on_tick, nil)
         end
     end
index 4ab7d668ec99208cadc41fb8bd59c07ef0ab27a3..14f067b190aae1ec7ca8b1b3a73d592cfde0354b 100644 (file)
--- a/info.json
+++ b/info.json
@@ -1,10 +1,10 @@
 {
     "name": "Waterbomb",
-    "version": "1.1.3",
+    "version": "2.0.0",
     "title": "Dihydrogen Monoxide Bomb (Waterbomb)",
     "author": "someone1337",
     "homepage": "https://git.somenet.org/factorio/Waterbomb.git",
     "description": "Use explosions/bombs to create water. (Originally 'Landfill' by Rseding91)",
-    "dependencies": ["base>=1.1.0"],
-    "factorio_version": "1.1"
+    "factorio_version": "2.0",
+    "dependencies": ["base>=2.0.0"]
 }
diff --git a/migrations/Waterbomb_0.16.5.json b/migrations/Waterbomb_0.16.5.json
deleted file mode 100644 (file)
index bf022a7..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-{
-    "entity":
-    [
-        ["water-bomb", "waterbomb"],
-        ["water-bomb-area", "waterbomb"]
-    ],
-    "item":
-    [
-        ["water-bomb", "waterbomb"],
-        ["water-bomb-area", "waterbomb"]
-    ]
-}
diff --git a/migrations/Waterbomb_0.16.5.lua b/migrations/Waterbomb_0.16.5.lua
deleted file mode 100644 (file)
index 85a319c..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-for index, force in pairs(game.forces) do
-    force.recipes["waterbomb"].enabled = true
-end
index 8474431db01f28f0b9b881d59b1c3c72536a1d38..32119bf37e4dea4e007e561d8eb38631ce9a1967 100644 (file)
@@ -3,17 +3,17 @@ data:extend({
         type = "recipe",
         name = "waterbomb",
         energy_required = 5,
-        enabled = "false",
+        enabled = false,
         category = "crafting-with-fluid",
         ingredients =
         {
-            {"steel-plate", 32},
-            {"electric-engine-unit", 4},
-            {"processing-unit", 1},
+            {type="item", name="steel-plate", amount=32},
+            {type="item", name="electric-engine-unit", amount=4},
+            {type="item", name="processing-unit", amount=1},
             {type="fluid", name="water", amount=32},
-            {"explosives", 24},
+            {type="item", name="explosives", amount=24}
         },
-        result = "waterbomb"
+        results = {{type="item", name="waterbomb", amount=1}}
     }
 })