Skip to content

Instantly share code, notes, and snippets.

@PpChailley
Last active September 1, 2020 10:04
Show Gist options
  • Save PpChailley/b3901a80de5310016ddc31c10a30872a to your computer and use it in GitHub Desktop.
Save PpChailley/b3901a80de5310016ddc31c10a30872a to your computer and use it in GitHub Desktop.
diff --git a/mods/AlienLootRevisited_0.18.6/control.lua b/mods/AlienLootRevisited_0.18.6/control.lua
index f55d5a8..d912de6 100644
--- a/mods/AlienLootRevisited_0.18.6/control.lua
+++ b/mods/AlienLootRevisited_0.18.6/control.lua
@@ -118,7 +118,7 @@ function update_modules(entities, entityType)
--and its level is not equal the "new" one
local stacksize = inventory[i].count --record amount
inventory[i].clear() --clear the slot
- inventory[i].set_stack({ name = "alien-hyper-module-" .. math.min(global.modulelevel, 20), count = stacksize }) --add the updated level modules with whatever amount we recorded
+ inventory[i].set_stack({ name = "alien-hyper-module-" .. math.min(global.modulelevel, 99), count = stacksize }) --add the updated level modules with whatever amount we recorded
end
end
end)
@@ -156,9 +156,21 @@ end
function update_enabled_recipe()
for _, force in pairs(game.forces) do
if force.technologies["modules"].researched then
- if global.modulelevel > 1 then
+ if global.modulelevel > 1 and global.modulelevel < 100 then
force.recipes["alien-hyper-module-1"].enabled = false
force.recipes["alien-hyper-module-" .. global.currentmodulelevel].enabled = false
+
+
+ -- for _,r in pairs(force.recipes) do
+ -- if r.name:sub(1, #"alien-hyper-module-") == "alien-hyper-module-" then
+ -- game.print("Recipe " .. r.name .. " : " .. force.recipes[r.name].name)
+ -- end
+ -- end
+
+ -- game.print("Recipe " .. global.modulelevel .. " : " .. force.recipes["alien-hyper-module-" .. global.modulelevel].name)
+ -- game.print(" enabled: " .. tostring(force.recipes["alien-hyper-module-" .. global.modulelevel].enabled))
+
+
force.recipes["alien-hyper-module-" .. global.modulelevel].enabled = true
end
end
@@ -169,7 +181,7 @@ end
function update_modules_on_surface(surface)
local names = {}
local modulesOnGround = surface.find_entities_filtered { name = 'item-on-ground' }
- local current_module_name = 'alien-hyper-module-' .. tostring(math.min(global.modulelevel, 20))
+ local current_module_name = 'alien-hyper-module-' .. tostring(math.min(global.modulelevel, 99))
for index, module_on_ground in pairs(modulesOnGround) do
--game.print(module_on_ground.stack.name)
diff --git a/mods/AlienLootRevisited_0.18.6/prototypes/item/alien-module.lua b/mods/AlienLootRevisited_0.18.6/prototypes/item/alien-module.lua
index 44a763c..d2bfa01 100644
--- a/mods/AlienLootRevisited_0.18.6/prototypes/item/alien-module.lua
+++ b/mods/AlienLootRevisited_0.18.6/prototypes/item/alien-module.lua
@@ -119,7 +119,7 @@ data:extend({
},
})--]]
-for i = 1, 20, 1 do
+for i = 1, 99, 1 do
local levelbonus = i * 0.01001
data:extend({
{
diff --git a/mods/AlienLootRevisited_0.18.6/prototypes/recipe/alien-module.lua b/mods/AlienLootRevisited_0.18.6/prototypes/recipe/alien-module.lua
index b52270a..ac9ba35 100644
--- a/mods/AlienLootRevisited_0.18.6/prototypes/recipe/alien-module.lua
+++ b/mods/AlienLootRevisited_0.18.6/prototypes/recipe/alien-module.lua
@@ -240,7 +240,7 @@ data:extend({
},
})
-for i = 1, 20, 1 do
+for i = 1, 99, 1 do
data:extend({
{
type = "recipe",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment