Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions config.lua
Original file line number Diff line number Diff line change
@@ -1,2 +1,30 @@
USECREOSOTE_RAIL = true
USECREOSOTE_POLE = true
--luacheck: ignore
PYC = {}
PYC.TAILINGS_POND = {}


--Messages and stuff for developers
PYC.DEBUG = true

--Changes some vanilla/mod recipes to use Creosate
--USE_CREOSOTE_RECIPES, if false will disable use of creosote in vanilla recipes. if true
--then any recipes that are true in USE_CREOSOTE_IN will use creosote.
PYC.USE_CREOSOTE_RECIPES = true
PYC.USE_CREOSOTE_IN = {
--Rail tracks
rail = true,
--Medium power pole, big wooden power pole
power_poles = true,
}

--Tank size, how much of a fluid the tank can hold
PYC.TAILINGS_POND.TANK_SIZE = 5000

--Does gas entering the tailings pond cause pollution when vented
--default=.15 off=0
PYC.TAILINGS_POND.GAS_POLLUTE_MODIFIER = .15

--Tailings ponds that contain non water liquids pollute the ground they are on
--Disabled for now until it can be refined some more
PYC.TAILINGS_POND.SCORCH = true
PYC.TAILINGS_POND.SCORCH_TICKS = 30 --default: 360?
64 changes: 27 additions & 37 deletions control.lua
Original file line number Diff line number Diff line change
@@ -1,48 +1,38 @@
require "util"
require "scripts.gasturbinemk01"
require("config")
require("stdlib.utils.utils")
_G.Event=require("stdlib.event.event")

MOD = {}
MOD.name = "pycoalprocessing"
MOD.IF = "PYC"
MOD.path = "__pycoalprocessing__"
MOD.debugpath = "/logs/"..MOD.name .. "/debug.log"


script.on_event(defines.events.on_tick, function(event)
local t = event.tick
check_generators()
recheck_archived_generators()
end)
local generator = require("scripts.gasturbinemk01")
local tailings_pond = require("scripts.tailings-pond")

function BuiltEntity(event)
if event.created_entity.name == "gasturbinemk01" then

if global.gasturbinemk01 == nil then global.gasturbinemk01 = {} end
if global.archived_gasturbinemk01 == nil then global.archived_gasturbinemk01 = {} end
local gasturbinemk01 = event.created_entity
if global.gasturbinemk01 == nil
then global.gasturbinemk01 = {}
end
table.insert(global.archived_gasturbinemk01, gasturbinemk01)
if _G.PYC.DEBUG then
require("stdlib.utils.quickstart")
end

end
script.on_init(function ()
tailings_pond.on_init()
end)

script.on_event(defines.events.on_tick, function (event)
tailings_pond.on_tick(event)
generator.on_tick(event)
end)

end

function MinedEntity(event)
if event.entity.name == "burner-generator" then
local b = event.entity
local X = b.position.x
local Y = b.position.y


local power = {}
lid = b.surface.find_entity("burner-generator-power",{X, Y})
if lid ~= nil then
lid.destroy() end

end
Event.register({defines.events.on_robot_built_entity, defines.events.on_built_entity}, tailings_pond.create)
Event.register({defines.events.on_preplayer_mined_item, defines.events.on_robot_pre_mined, defines.events.on_entity_died}, tailings_pond.destroy)

Event.register({defines.events.on_built_entity, defines.events.on_robot_built_entity}, generator.on_built_entity)
-- local mined_table = {defines.events.on_preplayer_mined_item, defines.events.on_entity_died, defines.events.on_robot_pre_mined}
-- Event.register(mined_table , MinedEntity)

end

script.on_event(defines.events.on_built_entity, BuiltEntity)
script.on_event(defines.events.on_robot_built_entity, BuiltEntity)
script.on_event(defines.events.on_preplayer_mined_item , MinedEntity)
script.on_event(defines.events.on_entity_died , MinedEntity)
script.on_event(defines.events.on_robot_pre_mined , MinedEntity)
remote.add_interface(MOD.IF, require("interface"))
1 change: 1 addition & 0 deletions data-updates.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require("prototypes.updates.recipe-updates") -- The recipes we want to update.
66 changes: 43 additions & 23 deletions data.lua
Original file line number Diff line number Diff line change
@@ -1,43 +1,63 @@
if not pysmods then pysmods = {} end
if not pysmods.coalpro then pysmods.coalpro = {} end
if not bobmods then bobmods = {false} end

pysmods.coalpro = true
require("config") --Config variables
require("stdlib.utils.utils") --Usefull helper functions

if pysmods.coalpro then
--Categories
require("prototypes.coal-processing-category")

require("prototypes.items.items")

--Technolgies
require("prototypes.technology.technology")

--Items without entities
require("prototypes.items.items")
require("prototypes.items.recipes")

--Tiles and Terrain
require ("prototypes.tiles.py-asphalt")
require ("prototypes.tiles.polluted-ground")

--Fluids
require("prototypes.fluids.acidgas")
require("prototypes.fluids.carbon-dioxide")
require("prototypes.fluids.coal-gas")
require("prototypes.fluids.creosote")
require("prototypes.fluids.methanol")
require("prototypes.fluids.refsyngas")
require("prototypes.fluids.syngas")
require("prototypes.fluids.tar")
require("prototypes.fluids.dirty-water")
require("prototypes.fluids.flue-gas")

--Buildings
require("prototypes.buildings.distilator")
require("prototypes.buildings.gasturbinemk01")
require("prototypes.buildings.gasifier")
require("prototypes.buildings.carbon-filter")
require("prototypes.buildings.tar-processing-unit")
require("prototypes.buildings.rectisol")
require("prototypes.buildings.methanol-reactor")
require("prototypes.buildings.tailings-pond")
require("prototypes.buildings.quenching-tower")
require("prototypes.buildings.hpf")


require("prototypes.objects.tiles")

require("prototypes.recipes.recipes-entity")
require("util") --require some helper functions
require("config") -- require our config values from config.lua
require("prototypes.recipes.recipes_updates") -- The recipes we want to update.

if bobmods.plates then
require("prototypes.recipes.recipes-bob")
require("prototypes.technology.technology-bob")
else
require("prototypes.recipes.recipes")

require("prototypes.technology.technology")
end
end

for k, v in pairs(data.raw.module) do
--Some of this stuff should be moved to data-updates?
-- if bobmods and bobmods.plates then
-- require("prototypes.recipes.recipes-bob")
-- require("prototypes.technology.technology-bob")
-- else
-- require("prototypes.recipes.recipes")
-- require("prototypes.technology.technology")
-- end

--move to syngas recipe stuff in data-updates?
for _, v in pairs(data.raw.module) do
if v.name:find("productivity%-module") and v.limitation then
for _, recipe in ipairs({"syngas"}) do
table.insert(v.limitation, recipe)
end
end
end
end
3 changes: 0 additions & 3 deletions data_updates.lua

This file was deleted.

Binary file modified graphics/entity/distilator/distilator.png
Loading
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/entity/hpf/hpf-anim.png
Loading
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/entity/hpf/hpf-off.png
Loading
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/entity/hpf/smoke-anim.png
Loading
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/entity/methanol-reactor/methanol-anim.png
Loading
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/entity/methanol-reactor/methanol-off.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
138 changes: 138 additions & 0 deletions graphics/entity/tailings-pond/old/tailings-pond-empty-window-2.pdn

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
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/entity/tailings-pond/spinner-shadow.png
Loading
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/entity/tailings-pond/spinner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
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/active-carbon.png
Loading
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/dirty-water.png
Loading
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/flue-gas.png
Loading
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/hpf.png
Loading
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/quenching-tower.png
Binary file added graphics/icons/tailings-pond.png
Binary file added graphics/icons/zinc-chloride.png
2 changes: 1 addition & 1 deletion info.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.2.1",
"factorio_version": "0.14",
"title": "Pyanodons Coal Processing",
"author": "Pyanodon",
"author": "Pyanodon,Nexela",
"contact": "",
"homepage": "",
"description": "Adds coal processing lines to the game.",
Expand Down
27 changes: 27 additions & 0 deletions interface.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
local interface = {}

function interface.resetMod()
end

function interface.resetUser()
end

function interface.recoverItems()
end

if _G.PYC.DEBUG then
interface.console = require("stdlib.utils.console")
end

function interface.printGlob(name) --Dumps the global to player and logfile
if name then
game.print(serpent.block(global[name], {comment=false, sparse=true}))
game.write_file(MOD.debugpath, serpent.block(global[name], {comment=false, sparse=true}))
else
game.print(serpent.block(global, {comment=false, sparse=true}))
game.write_file("/logs/"..MOD.name .. "/debug.log", serpent.block(global, {comment=false, sparse=true}))
end
end


return interface
48 changes: 40 additions & 8 deletions locale/en/locale.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ iron-oxide = Iron Oxide
ash = Ash
py-asphalt = Asphalt
canister = Methanol
active-carbon = Activated Carbon
zinc-chloride = Zinc Chloride

[item-description]

[fluid-name]
coal-gas = Coal gas
Expand All @@ -14,15 +18,21 @@ refsyngas = Refined SynGas
acidgas = Acid Gas
carbon-dioxide = Carbon Dioxide
methanol = Methanol
dirty-water = Tailings
flue-gas = Flue Gas

[recipe-name]
coal-gas = Coal gas
syngas = SynGas
syngas2 = more SynGas
filtersyngas = Refined SynGas
recsyngas = Refined SynGas
canister = Methanol
canister2 = Methanol
canister = Methanol from Syngas
canister2 = Methanol from Hydrogen
zinc-chloride = Zinc Chloride
recsyngas-meth = Refined Syngas from liq.Methanol
methanol-from-syngas = liq.Methanol from Syngas
methanol-from-hydrogen = liq.Methanol from Hydrogen

[entity-name]
distilator = Destructive Distillation Column
Expand All @@ -32,20 +42,42 @@ gasturbinemk01 = Gas Turbine MK01
carbon-filter = Carbon Filter
rectisol = Rectisol
methanol-reactor = Methanol Reactor
tailings-pond = Tailings Pond
quenching-tower = Quenching Tower
hpf = High-pressure Furnace

[entity-description]
tailings-pond = Tailings Pond store mining waste and cause lots of pollution.
distilator = Process coal into more valuable products.
gasifier = Process coal gas in the useful Syngas.
tar-processing-unit = Break tar into more valuable products.
gasturbinemk01 = Generates high polutuion, but high energy by burning syngas.
carbon-filter = Remove impurities and delivers a more refined product.
rectisol = Key building to produce good quantities of refined SynGas.
methanol-reactor = Convert syngas or raw materials into methanol.
quenching-tower = Process tar to extract few materials and dump large quantities of coal slurry.
hpf = Cook and burn ingredients in a sealed chamber with inert gas.

[technology-name]
coal-processing1 = Coal Processing MK01
coal-processing2 = Coal Processing MK02
py-asphalt = Asphalt
methanol-processing1 = Methanol Processing MK01
methanol-processing2 = Methanol Processing MK02

[technology-descripion]
distilator = Process coal into more valuable products
gasifier = Process coal gas in the useful Syngas
tar-processing-unit = Break tar into more valuable products
[technology-description]
py-asphalt = Make asphalt tiles with tar.
distilator = Process coal into more valuable products.
gasifier = Process coal gas in the useful Syngas.
tar-processing-unit = Break tar into more valuable products.
gasturbinemk01 = Generates high polutuion, but high energy by burning syngas.
carbon-filter = Remove impurities and delivers a more refined product.
rectisol = Key building to produce good quantities of refined SynGas.
methanol-reactor = Convert syngas or raw materials into canned methanol
methanol-reactor = Convert syngas or raw materials into methanol.
hpf = Cook and burn ingredients in a sealed chamber with inert gas.

[item-group-name]
coal-processing = Coal Processing
coal-processing = Coal Processing

[tile-name]
py-ashpalt=Asphalt
Loading