Skip to content

Commit

Permalink
Update to 0.16
Browse files Browse the repository at this point in the history
  • Loading branch information
pfgithub committed Jan 28, 2018
1 parent 3c1cd47 commit 95b2201
Show file tree
Hide file tree
Showing 32 changed files with 56 additions and 137 deletions.
1 change: 1 addition & 0 deletions api/add_science_fluid.lua
Expand Up @@ -16,6 +16,7 @@ function addScienceFluid(name,base_color,flow_color,icon)
pressure_to_speed_ratio = 0.4,
flow_to_energy_ratio = 0.59,
order = "e[lubricant]",
icon_size = 32
}
})
end
Expand Down
15 changes: 10 additions & 5 deletions api/add_science_recipe.lua
@@ -1,22 +1,27 @@
parseScienceRecipe = require("api.parse_science_recipe")
getScienceCount = require("api.get_science_count")
getScienceEnergy = require("api.get_science_energy")

function addScienceRecipe(name,recipe,result,count,energy)
data:extend({
{
type = "recipe",
name = name.."-fluid",
category= "science-pump",
energy_required = energy,
energy_required = energy or getScienceEnergy(name),
ingredients = parseScienceRecipe(recipe,name),
subgroup = "intermediate-product",
results = {
{
type="fluid",
name= result,
amount= count
type ="fluid",
name = result,
amount = count or getScienceCount(name)
}
}
},
result_count = count or getScienceCount(name);
}
})
table.insert(data.raw["recipe"][name.."-fluid"]["ingredients"], {type="fluid",name="water",amount=100})
end

return addScienceRecipe
6 changes: 6 additions & 0 deletions api/get_science_count.lua
@@ -0,0 +1,6 @@

function getScienceCount(name)
return data.raw["recipe"][name]["result_count"] or 1;
end

return getScienceCount;
6 changes: 6 additions & 0 deletions api/get_science_energy.lua
@@ -0,0 +1,6 @@

function getScienceEnergy(name)
return data.raw["recipe"][name]["energy"] or 1;
end

return getScienceCount;
1 change: 1 addition & 0 deletions api/parse_science_recipe.lua
Expand Up @@ -2,6 +2,7 @@ string.split = require("api.split")

function parseScienceRecipe(s,name)
if(type(s) == "string") then
data.raw["recipe"][name]["category"]="science-pump";
if(s == "default") then
return data.raw["recipe"][name]["ingredients"];
end
Expand Down
4 changes: 4 additions & 0 deletions data.lua
@@ -1 +1,5 @@
require("prototypes.data")

-- future todo:
-- space rockets should bring down space dust that you add to water to get science
-- labs should accept science fluid
Binary file removed graphics/bomber.png
Binary file not shown.
Binary file removed graphics/bomber_spritemap.png
Binary file not shown.
Binary file added graphics/icons/fluid/high-tech-science-pack.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/icons/fluid/military-science-pack.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/icons/fluid/production-science-pack.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/icons/resource/glass.afphoto
Binary file not shown.
Binary file modified graphics/icons/resource/glass.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/icons/resource/glass_old.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/icons/resource/sand-ore-texture-old.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified graphics/icons/resource/sand-ore-texture.afphoto
Binary file not shown.
Binary file modified graphics/icons/resource/sand-ore-texture.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed graphics/smelter_inserter_icon.png
Binary file not shown.
Binary file removed graphics/testTech.png
Binary file not shown.
10 changes: 5 additions & 5 deletions info.json
Expand Up @@ -2,10 +2,10 @@
"name": "liquid-science",
"version": "0.1.2",
"title": "Liquid Science",
"factorio_version": "0.14",
"author": "pfg and other people",
"contact": "a contact should go here",
"homepage": "a url should go here",
"factorio_version": "0.16",
"author": "pfg",
"contact": "pfgithub on github",
"homepage": "https://github.com/pfgithub/liquid-science",
"description": "A mod that turnes science into a liquid that you have to fill science packs with",
"dependencies": ["base >= 0.4.1"]
"dependencies": ["base >= 0.16.20"]
}
2 changes: 0 additions & 2 deletions prototypes/entity/data.lua
@@ -1,3 +1 @@
-- require("prototypes.entity.smelter_inserter")

require("prototypes.entity.science_pump")
1 change: 1 addition & 0 deletions prototypes/entity/science_pump.lua
Expand Up @@ -122,6 +122,7 @@ data:extend({
energy_usage = "210kW",
ingredient_count = 4,
crafting_categories = {"science-pump"},
icon_size = 32,
fluid_boxes =
{
{
Expand Down
86 changes: 0 additions & 86 deletions prototypes/entity/smelter_inserter.lua

This file was deleted.

2 changes: 0 additions & 2 deletions prototypes/item/data.lua
@@ -1,5 +1,3 @@
-- require("prototypes.item.smelter_inserter")

require("prototypes.item.science_pump")
require("prototypes.item.sand")
require("prototypes.item.glass")
3 changes: 2 additions & 1 deletion prototypes/item/glass.lua
Expand Up @@ -5,6 +5,7 @@ data:extend({
order = "b-c-a",
stack_size = 50,
flags = { "goes-to-main-inventory" },
icon = "__liquid-science__/graphics/icons/resource/glass.png"
icon = "__liquid-science__/graphics/icons/resource/glass.png",
icon_size = 32
}
})
4 changes: 3 additions & 1 deletion prototypes/item/sand.lua
Expand Up @@ -5,6 +5,8 @@ data:extend({
order = "b-c-a",
stack_size = 50,
flags = { "goes-to-main-inventory" },
icon = "__liquid-science__/graphics/icons/resource/sand-ore.png"
--icon = "__liquid-science__/graphics/icons/resource/sand-ore.png",
icon = "__liquid-science__/graphics/icons/resource/sand-ore-texture.png",
icon_size = 54
}
})
3 changes: 2 additions & 1 deletion prototypes/item/science_pump.lua
Expand Up @@ -6,6 +6,7 @@ data:extend({
stack_size = 50,
flags = { "goes-to-quickbar" },
icon = "__liquid-science__/graphics/icons/chemical-plant.png",
place_result = "science-pump"
place_result = "science-pump",
icon_size = 20
}
})
11 changes: 0 additions & 11 deletions prototypes/item/smelter_inserter.lua

This file was deleted.

14 changes: 0 additions & 14 deletions prototypes/recipe/data.lua
@@ -1,17 +1,3 @@
--[[data:extend({
{
type = "recipe",
name = "smelter-inserter",
enabled = "true",
ingredients = {
{"iron-stick",50},
{"electronic-circuit",50},
{"iron-gear-wheel",50},
{"iron-plate",200}
},
result = "smelter-inserter"
}
})]]--

data:extend({
{
Expand Down
4 changes: 3 additions & 1 deletion prototypes/resource/data.lua
Expand Up @@ -35,7 +35,8 @@ data:extend({
type = "autoplace-control",
name = "sand-ore",
richness = true,
order = "g-s"
order = "g-s",
category = "resource"
}
})

Expand Down Expand Up @@ -67,6 +68,7 @@ data:extend({
variation_count = 1
}
},
icon_size = 20,
map_color = {r=0.85, g=0.765, b=0.608}
}
})
13 changes: 12 additions & 1 deletion prototypes/science/data.lua
Expand Up @@ -5,4 +5,15 @@ data:extend({
}
})

require("settings")
-- until 0.15, this will be manual
addScience = require("api.add_science")

--208, 177, 21 high tech

addScience("science-pack-1", "0.8,0.2,0.1", "0.7,0.1,0.1", "default")
addScience("science-pack-2", "0.2,0.9,0.2", "0.1,0.8,0.2", "default")
addScience("science-pack-3", "0.24,0.86,0.95", "0.22,0.68,0.77", "default")
addScience("military-science-pack", "0.19607843137,0.2431372549,0.2862745098", "0.22,0.68,0.77", "default")
addScience("production-science-pack", "0.85,0.11,0.92", "0.78,0.1,0.83", "default")
addScience("high-tech-science-pack", "0.81568627451,0.69411764705,0.08235294117", "0.22,0.68,0.77", "default")
--addScience("space-science-pack", "0.24,0.86,0.95", "0.22,0.68,0.77", "default", 12, 1)
7 changes: 0 additions & 7 deletions settings.lua

This file was deleted.

0 comments on commit 95b2201

Please sign in to comment.