gyro
This commit is contained in:
parent
aa24b4c8e8
commit
e7c9c224fa
10 changed files with 97 additions and 7 deletions
|
|
@ -1,4 +1,9 @@
|
||||||
---------------------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------------------
|
||||||
|
Version: 0.9.0
|
||||||
|
Date: 2022-01-08
|
||||||
|
Features:
|
||||||
|
- Added a new optional gyroscope intermediate
|
||||||
|
---------------------------------------------------------------------------------------------------
|
||||||
Version: 0.8.3
|
Version: 0.8.3
|
||||||
Date: 2022-01-06
|
Date: 2022-01-06
|
||||||
Changes:
|
Changes:
|
||||||
|
|
|
||||||
|
|
@ -77,14 +77,33 @@ function util.remove_prerequisite(technology_name, prerequisite)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- Add an effect to a given technology
|
-- Add an effect to a given technology
|
||||||
function util.add_effect(technology_name, effect)
|
function util.add_effect(technology_name, effect)
|
||||||
local technology = data.raw.technology[technology_name]
|
local technology = data.raw.technology[technology_name]
|
||||||
if technology then
|
if technology then
|
||||||
|
if not technology.effects then technology.effects = {} end
|
||||||
table.insert(technology.effects, effect)
|
table.insert(technology.effects, effect)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- remove recipe unlock effect from a given technology
|
||||||
|
function util.remove_recipe_effect(technology_name, recipe_name)
|
||||||
|
local technology = data.raw.technology[technology_name]
|
||||||
|
local index = -1
|
||||||
|
if technology then
|
||||||
|
for i, effect in pairs(technology.effects) do
|
||||||
|
if effect.type == "unlock-recipe" and effect.recipe == recipe_name then
|
||||||
|
index = i
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if index > -1 then
|
||||||
|
table.remove(technology.effects, index)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Set technology ingredients
|
-- Set technology ingredients
|
||||||
function util.set_tech_recipe(technology_name, ingredients)
|
function util.set_tech_recipe(technology_name, ingredients)
|
||||||
local technology = data.raw.technology[technology_name]
|
local technology = data.raw.technology[technology_name]
|
||||||
|
|
@ -93,6 +112,14 @@ function util.set_tech_recipe(technology_name, ingredients)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function util.set_enabled(recipe_name, enabled)
|
||||||
|
if data.raw.recipe[recipe_name] then
|
||||||
|
if data.raw.recipe[recipe_name].normal then data.raw.recipe[recipe_name].normal.enabled = enabled end
|
||||||
|
if data.raw.recipe[recipe_name].expensive then data.raw.recipe[recipe_name].expensive.enabled = enabled end
|
||||||
|
if not data.raw.recipe[recipe_name].normal then data.raw.recipe[recipe_name].enabled = enabled end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Add a given quantity of ingredient to a given recipe
|
-- Add a given quantity of ingredient to a given recipe
|
||||||
function util.add_ingredient(recipe_name, ingredient, quantity)
|
function util.add_ingredient(recipe_name, ingredient, quantity)
|
||||||
if me.bypass[recipe_name] then return end
|
if me.bypass[recipe_name] then return end
|
||||||
|
|
|
||||||
1
data.lua
1
data.lua
|
|
@ -1,5 +1,6 @@
|
||||||
require("prototypes/silica-recipe")
|
require("prototypes/silica-recipe")
|
||||||
require("prototypes/silicon-recipe")
|
require("prototypes/silicon-recipe")
|
||||||
require("prototypes/optical-fiber")
|
require("prototypes/optical-fiber")
|
||||||
|
require("prototypes/gyro")
|
||||||
require("recipes/silica-matter")
|
require("recipes/silica-matter")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,9 @@ if deadlock then
|
||||||
deadlock.add_stack("silicon-wafer", "__bzsilicon__/graphics/icons/stacked/silicon-wafer-stacked.png" , "deadlock-stacking-2", 64)
|
deadlock.add_stack("silicon-wafer", "__bzsilicon__/graphics/icons/stacked/silicon-wafer-stacked.png" , "deadlock-stacking-2", 64)
|
||||||
deadlock.add_stack("solar-cell", "__bzsilicon__/graphics/icons/stacked/solar-cell-stacked.png" , "deadlock-stacking-2", 64)
|
deadlock.add_stack("solar-cell", "__bzsilicon__/graphics/icons/stacked/solar-cell-stacked.png" , "deadlock-stacking-2", 64)
|
||||||
end
|
end
|
||||||
|
if util.me.use_gyros() then
|
||||||
|
deadlock.add_stack("gyro", "__bzsilicon__/graphics/icons/stacked/gyro-stacked.png", "deadlock-stacking-3", 128)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Deadlock crating recipes
|
-- Deadlock crating recipes
|
||||||
|
|
@ -21,8 +24,11 @@ if deadlock_crating then
|
||||||
deadlock_crating.add_crate("silicon", "deadlock-crating-2")
|
deadlock_crating.add_crate("silicon", "deadlock-crating-2")
|
||||||
end
|
end
|
||||||
if util.me.more_intermediates() then
|
if util.me.more_intermediates() then
|
||||||
deadlock_crating.add_crate("silicon-wafer", "deadlock-crating-2", 64)
|
deadlock_crating.add_crate("silicon-wafer", "deadlock-crating-2")
|
||||||
deadlock_crating.add_crate("solar-cell", "deadlock-crating-2", 64)
|
deadlock_crating.add_crate("solar-cell", "deadlock-crating-2")
|
||||||
|
end
|
||||||
|
if util.me.use_gyros() then
|
||||||
|
deadlock_crating.add_crate("gyro", "deadlock-crating-3")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "bzsilicon",
|
"name": "bzsilicon",
|
||||||
"version": "0.8.3",
|
"version": "0.9.0",
|
||||||
"factorio_version": "1.1",
|
"factorio_version": "1.1",
|
||||||
"title": "Silica & Silicon",
|
"title": "Silica & Silicon",
|
||||||
"author": "Brevven",
|
"author": "Brevven",
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ silicon=Silicon
|
||||||
silicon-wafer=Silicon wafer
|
silicon-wafer=Silicon wafer
|
||||||
solar-cell=Solar cell
|
solar-cell=Solar cell
|
||||||
optical-fiber=Optical Fiber
|
optical-fiber=Optical Fiber
|
||||||
|
gyro=MEMS gyroscope
|
||||||
|
|
||||||
[item-description]
|
[item-description]
|
||||||
silica=Can be used directly or processed further.
|
silica=Can be used directly or processed further.
|
||||||
|
|
@ -23,11 +24,13 @@ optical-fiber=Cable used for fiber optics, including circuit network.
|
||||||
silica-processing=Silica processing
|
silica-processing=Silica processing
|
||||||
silicon-processing=Silicon processing
|
silicon-processing=Silicon processing
|
||||||
fiber-optics=Fiber optics
|
fiber-optics=Fiber optics
|
||||||
|
gyro=Microelectromechanical systems
|
||||||
|
|
||||||
[technology-description]
|
[technology-description]
|
||||||
silica-processing=Process stone brick into silica.
|
silica-processing=Process stone brick into silica.
|
||||||
silicon-processing=Process silica insto silcon.
|
silicon-processing=Process silica insto silcon.
|
||||||
fiber-optics=Optical fiber for circuit network
|
fiber-optics=Optical fiber for circuit network
|
||||||
|
gyro=Learn to handle tiny moving electronics
|
||||||
|
|
||||||
[recipe-name]
|
[recipe-name]
|
||||||
silica=__ITEM__silica__
|
silica=__ITEM__silica__
|
||||||
|
|
@ -46,3 +49,8 @@ bzsilicon-bio-crushed-stone=When using Bio Industries, use crushed stone to make
|
||||||
bzsilicon-recipe-bypass=Skip modifying these recipes (comma-separated list).
|
bzsilicon-recipe-bypass=Skip modifying these recipes (comma-separated list).
|
||||||
bzsilicon-more-intermediates=More complex production chains. Optional in vanilla, Krastorio 2, etc. [color=red]Required for Bio Industries.[/color]
|
bzsilicon-more-intermediates=More complex production chains. Optional in vanilla, Krastorio 2, etc. [color=red]Required for Bio Industries.[/color]
|
||||||
bzsilicon-bio-crushed-stone=This setting is experimental, and may be removed in a future update. It's strongly recommended to keep it enabled. Only disable if your UPS is dropping due to inserter count. Added per user request.
|
bzsilicon-bio-crushed-stone=This setting is experimental, and may be removed in a future update. It's strongly recommended to keep it enabled. Only disable if your UPS is dropping due to inserter count. Added per user request.
|
||||||
|
|
||||||
|
[string-mod-setting]
|
||||||
|
bzsilicon-more-intermediates-no=no
|
||||||
|
bzsilicon-more-intermediates-yes=Yes: wafer, solar cell
|
||||||
|
bzsilicon-more-intermediates-more=More (Experimental): wafer, solar cell, MEMS gyroscope
|
||||||
|
|
|
||||||
9
me.lua
9
me.lua
|
|
@ -1,10 +1,13 @@
|
||||||
local me = {}
|
local me = {}
|
||||||
|
|
||||||
me.name = "bzsilicon"
|
me.name = "bzsilicon"
|
||||||
me.silicon_processing = mods["Krastorio2"] and "kr-silicon-processing" or "silicon-processing"
|
me.silicon_processing = mods["Krastorio2"] and "kr-silicon-processing" or "silicon-processing"
|
||||||
|
|
||||||
|
function me.use_gyros()
|
||||||
|
return me.get_setting("bzsilicon-more-intermediates") == "more"
|
||||||
|
end
|
||||||
|
|
||||||
function me.more_intermediates()
|
function me.more_intermediates()
|
||||||
return mods["Bio_Industries"] or me.get_setting("bzsilicon-more-intermediates") == "yes"
|
return mods["Bio_Industries"] or me.get_setting("bzsilicon-more-intermediates") == "yes" or me.use_gyros()
|
||||||
end
|
end
|
||||||
|
|
||||||
function me.use_bio_crushed_stone()
|
function me.use_bio_crushed_stone()
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,9 @@ if util.me.more_intermediates() then
|
||||||
table.insert(recipes, "silicon-wafer")
|
table.insert(recipes, "silicon-wafer")
|
||||||
table.insert(recipes, "solar-cell")
|
table.insert(recipes, "solar-cell")
|
||||||
end
|
end
|
||||||
|
if util.me.use_gyros() then
|
||||||
|
table.insert(recipes, "gyro")
|
||||||
|
end
|
||||||
|
|
||||||
if mods["space-exploration"] then
|
if mods["space-exploration"] then
|
||||||
table.insert(recipes, "silicon-smelting-vulcanite")
|
table.insert(recipes, "silicon-smelting-vulcanite")
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,42 @@
|
||||||
local util = require("__bzsilicon__.data-util");
|
local util = require("__bzsilicon__.data-util");
|
||||||
|
|
||||||
|
if util.me.use_gyros() then
|
||||||
|
util.add_ingredient("flying-robot-frame", "gyro", 1)
|
||||||
|
util.add_prerequisite("robotics", "gyro")
|
||||||
|
|
||||||
|
util.add_ingredient("distractor-capsule", "gyro", 3)
|
||||||
|
util.add_prerequisite("distractor", "gyro")
|
||||||
|
|
||||||
|
util.add_ingredient("laser-turret", "gyro", 1)
|
||||||
|
util.add_prerequisite("laser-turret", "gyro")
|
||||||
|
|
||||||
|
util.add_ingredient("artillery-shell", "gyro", 1)
|
||||||
|
util.add_ingredient("rocket-control-unit", "gyro", 1)
|
||||||
|
|
||||||
|
util.add_ingredient("gunship", "gyro", 1)
|
||||||
|
util.add_prerequisite("gunships", "gyro")
|
||||||
|
util.add_ingredient("flying-fortress", "gyro", 4)
|
||||||
|
util.add_ingredient("jet", "gyro", 4)
|
||||||
|
|
||||||
|
util.add_ingredient("jetpack-2", "gyro", 2)
|
||||||
|
util.add_prerequisite("jetpack-2", "gyro")
|
||||||
|
|
||||||
|
--K2
|
||||||
|
util.add_ingredient("advanced-exoskeleton-equipment", "gyro", 4)
|
||||||
|
util.add_ingredient("kr-laser-artillery-turret", "gyro", 4)
|
||||||
|
util.add_ingredient("kr-railgun-turret", "gyro", 4)
|
||||||
|
util.add_ingredient("kr-advanced-tank", "gyro", 4)
|
||||||
|
util.add_ingredient("kr-rocket-turret", "gyro", 1)
|
||||||
|
util.add_ingredient("kr-nuclear-locomotive", "gyro", 1)
|
||||||
|
|
||||||
|
--SE
|
||||||
|
util.add_ingredient("se-spaceship-console", "gyro", 4)
|
||||||
|
util.add_ingredient("se-space-mechanical-laboratory", "gyro", 14)
|
||||||
|
util.add_ingredient("se-space-gravimetrics-laboratory", "gyro", 8)
|
||||||
|
util.add_ingredient("se-delivery-cannon", "gyro", 2)
|
||||||
|
util.add_ingredient("se-thruster-suit-2", "gyro", 2)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
if not mods["Krastorio2"] then
|
if not mods["Krastorio2"] then
|
||||||
util.remove_ingredient("concrete", "stone-brick");
|
util.remove_ingredient("concrete", "stone-brick");
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ data:extend( {
|
||||||
name = "bzsilicon-more-intermediates",
|
name = "bzsilicon-more-intermediates",
|
||||||
setting_type = "startup",
|
setting_type = "startup",
|
||||||
default_value = "no",
|
default_value = "no",
|
||||||
allowed_values = {"yes", "no"},
|
allowed_values = {"more", "yes", "no"},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type = "bool-setting",
|
type = "bool-setting",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue