mirror of
https://github.com/peter-tanner/1.git
synced 2024-11-30 10:50:15 +08:00
Add files
This commit is contained in:
parent
c287bb9cda
commit
8dc0fe7a05
67
mod/control.lua
Normal file
67
mod/control.lua
Normal file
|
@ -0,0 +1,67 @@
|
|||
|
||||
require "util"
|
||||
|
||||
|
||||
--[[///////////////////
|
||||
UNIVERSAL FUNCTIONS
|
||||
///////////////////]]
|
||||
|
||||
|
||||
--verify state of entity and call the appropriate functions
|
||||
function entity_placed(event)
|
||||
local entity = event.created_entity
|
||||
if entity and entity.valid then
|
||||
if entity.name == "excavation-site" then
|
||||
make_target(event)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function check_cursor_stack(player_index)
|
||||
local player = game.players[player_index]
|
||||
local cursor_item = player.cursor_stack
|
||||
return cursor_item
|
||||
end
|
||||
|
||||
script.on_event(defines.events.on_built_entity, entity_placed)
|
||||
script.on_event(defines.events.on_robot_built_entity, entity_placed)
|
||||
|
||||
|
||||
--[[/////////////////////////
|
||||
ENTITY-SPECIFIC FUNCTIONS
|
||||
/////////////////////////]]
|
||||
|
||||
|
||||
--neutron target
|
||||
function Position.add(pos1, pos2)
|
||||
pos1 = Position.new(pos1)
|
||||
pos2 = Position.new(pos2)
|
||||
|
||||
return Position.new({x = pos1.x + pos2.x, y = pos1.y + pos2.y})
|
||||
end
|
||||
|
||||
function make_target(event)
|
||||
local range = 1
|
||||
local offsets = {{0, range}, {range, 0}, {0, -range}, {-range, 0}}
|
||||
local entity = event.created_entity
|
||||
local entity_position = entity.position
|
||||
for _, offset in pairs(offsets) do
|
||||
local adj_pos = {x = entity_position.x + offset.x, y = entity_position.y + offset.y}
|
||||
local adjacent_reactor = surface.get_tile(adj_pos.x, adj_pos.y)
|
||||
if adjacent_reactor and adjacent_reactor.name == "nuclear-reactor" then
|
||||
--true
|
||||
else
|
||||
--false
|
||||
end
|
||||
end
|
||||
return adjacent_tiles
|
||||
end
|
||||
--neutron target - neutron manager
|
||||
|
||||
script.on_event(defines.events.on_gui_opened, function(event) if event.entity.name == "neutron-target" then neutron_target_gui_open = true end end)
|
||||
script.on_event(defines.events.on_gui_closed, function(event) if event.entity.name == "neutron-target" then neutron_target_gui_open = false end end)
|
||||
|
||||
function remove_neutrons()
|
||||
|
||||
end
|
||||
script.on_tick(remove_neutrons)
|
75
mod/control.old
Normal file
75
mod/control.old
Normal file
|
@ -0,0 +1,75 @@
|
|||
|
||||
--Acidic fluids
|
||||
acidic =
|
||||
{
|
||||
"sulfuric-acid"
|
||||
}
|
||||
|
||||
--Whitelisted pipes
|
||||
resistant_pipes =
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
require "util"
|
||||
|
||||
--How frequently events should be executed. Will effect gameplay
|
||||
|
||||
local interval = 5
|
||||
|
||||
function contains_item(item, table)
|
||||
for k, item in ipairs(table) do
|
||||
if item == table then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function build_acid_pipe(event)
|
||||
local entity = event.entity
|
||||
if entity and entity.valid and entity.name == "acid-pipe" then
|
||||
if global.acid_pipes == nil then
|
||||
global.acid_pipes = {}
|
||||
end
|
||||
global.acid_pipes[#global.acid_pipes+1] = entity
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--[[function remove_acid_pipe(event)
|
||||
if event.entity.name == "acid-pipe" then
|
||||
if global.acid_pipes == nil then
|
||||
global.acid_pipes = {}
|
||||
end
|
||||
global.acid_pipes[#global.acid_pipes+1] = event.entity
|
||||
end
|
||||
end]]
|
||||
|
||||
|
||||
function check_acid()
|
||||
for k, acid_pipes in ipairs(global.acid_pipes) do
|
||||
if global.acid_pipes[k].entity.valid then
|
||||
local entity = acid_pipes[k]
|
||||
local fluid = entity.fluidbox[1]
|
||||
if contains_item(entity.name, resistant_pipes) == true then
|
||||
if contains_item(fluid.name, acidic) == true then
|
||||
|
||||
end
|
||||
end
|
||||
else
|
||||
global.acid_pipes[k] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--events
|
||||
script.on_nth_tick(interval, check_acid)
|
||||
|
||||
script.on_event(defines.events.on_built_entity, build_acid_pipe)
|
||||
script.on_event(defines.events.on_robot_built_entity, build_acid_pipe)
|
||||
|
||||
--script.on_event(defines.events.on_player_mined_entity, remove_acid_pipe)
|
||||
--script.on_event(defines.events.on_robot_mined_entity, remove_acid_pipe)
|
4
mod/data.lua
Normal file
4
mod/data.lua
Normal file
|
@ -0,0 +1,4 @@
|
|||
|
||||
--Item Prototypes
|
||||
require("prototypes.items.nuclear_innovators")
|
||||
require("prototypes.items.science_innovators")
|
11
mod/documents.txt
Normal file
11
mod/documents.txt
Normal file
|
@ -0,0 +1,11 @@
|
|||
Document Sources:
|
||||
|
||||
http://www.iaea.org/inis/collection/NCLCollectionStore/_Public/06/212/6212682.pdf
|
||||
|
||||
http://www.oecd-nea.org/pt/docs/iem/mol98/session2/SIIpaper9.pdf
|
||||
|
||||
http://www.freepatentsonline.com/3615267.html
|
||||
|
||||
https://patents.google.com/patent/US8192704
|
||||
|
||||
http://ieeexplore.ieee.org/document/5299321/
|
10
mod/info.json
Normal file
10
mod/info.json
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"name": "Aperture_Nuclear_Innovators",
|
||||
"version": "0.1.0",
|
||||
"factorio_version": "0.16",
|
||||
"title": "Aperture Nuclear Innovators",
|
||||
"author": "npc_strider(morley376)",
|
||||
"contact": "",
|
||||
"homepage": "http://steamcommunity.com/id/morley376",
|
||||
"description": "test mod, 080418"
|
||||
}
|
20
mod/prototypes/fluids/fluid.lua
Normal file
20
mod/prototypes/fluids/fluid.lua
Normal file
|
@ -0,0 +1,20 @@
|
|||
|
||||
data:extend(
|
||||
{
|
||||
{
|
||||
type = "fluid",
|
||||
name = "gas-fluorine",
|
||||
default_temperature = 25,
|
||||
heat_capacity = "0.1KJ",
|
||||
base_color = {r=0, g=0, b=0},
|
||||
flow_color = {r=0.5, g=0.5, b=0.5},
|
||||
max_temperature = 100,
|
||||
icon = "__base__/graphics/icons/fluid/crude-oil.png",
|
||||
icon_size = 32,
|
||||
pressure_to_speed_ratio = 0.4,
|
||||
flow_to_energy_ratio = 0.59,
|
||||
-- fuel_value = "8MJ",
|
||||
order = "a[fluid]-b[gas-fluorine]"
|
||||
}
|
||||
})
|
||||
|
35
mod/prototypes/fluids/nuclear_innovators.lua
Normal file
35
mod/prototypes/fluids/nuclear_innovators.lua
Normal file
|
@ -0,0 +1,35 @@
|
|||
data:extend(
|
||||
{
|
||||
{
|
||||
type = "fluid",
|
||||
name = "crude-oil",
|
||||
default_temperature = 25,
|
||||
heat_capacity = "0.1KJ",
|
||||
base_color = {r=0, g=0, b=0},
|
||||
flow_color = {r=0.5, g=0.5, b=0.5},
|
||||
max_temperature = 100,
|
||||
icon = "__base__/graphics/icons/fluid/crude-oil.png",
|
||||
icon_size = 32,
|
||||
pressure_to_speed_ratio = 0.4,
|
||||
flow_to_energy_ratio = 0.59,
|
||||
order = "a[fluid]-b[crude-oil]"
|
||||
},
|
||||
|
||||
--urex fluids
|
||||
|
||||
|
||||
{
|
||||
type = "fluid",
|
||||
name = "crude-oil",
|
||||
default_temperature = 25,
|
||||
heat_capacity = "0.1KJ",
|
||||
base_color = {r=0, g=0, b=0},
|
||||
flow_color = {r=0.5, g=0.5, b=0.5},
|
||||
max_temperature = 100,
|
||||
icon = "__base__/graphics/icons/fluid/crude-oil.png",
|
||||
icon_size = 32,
|
||||
pressure_to_speed_ratio = 0.4,
|
||||
flow_to_energy_ratio = 0.59,
|
||||
order = "a[fluid]-b[crude-oil]"
|
||||
}
|
||||
})
|
105
mod/prototypes/items/nuclear_innovators.lua
Normal file
105
mod/prototypes/items/nuclear_innovators.lua
Normal file
|
@ -0,0 +1,105 @@
|
|||
data:extend(
|
||||
{
|
||||
{
|
||||
type = "item",
|
||||
name = "test-item",
|
||||
icon = "__Aperture_Nuclear_Innovators__/graphics/icons/test.png",
|
||||
icon_size = 32,
|
||||
flags = {"goes-to-main-inventory"},
|
||||
subgroup = "nuclear_innovators",
|
||||
order = "a-b-c",
|
||||
stack_size = 100,
|
||||
},
|
||||
|
||||
--fuel assemblies
|
||||
|
||||
{
|
||||
type = "item",
|
||||
name = "spent-fuel-assembly",
|
||||
icon = "__Aperture_Nuclear_Innovators__/graphics/icons/nuclear_innovators/spent-fuel-assembly.png",
|
||||
icon_size = 32,
|
||||
flags = {"goes-to-main-inventory"},
|
||||
subgroup = "nuclear_innovators",
|
||||
order = "a-b-c",
|
||||
stack_size = 1,
|
||||
},
|
||||
{
|
||||
type = "item",
|
||||
name = "mox-fuel-assembly",
|
||||
icon = "__Aperture_Nuclear_Innovators__/graphics/icons/nuclear_innovators/mox-fuel-assembly.png",
|
||||
icon_size = 32,
|
||||
flags = {"goes-to-main-inventory"},
|
||||
subgroup = "nuclear_innovators",
|
||||
order = "a-b-c",
|
||||
stack_size = 1,
|
||||
},
|
||||
{
|
||||
type = "item",
|
||||
name = "spent-mox-fuel-assembly",
|
||||
icon = "__Aperture_Nuclear_Innovators__/graphics/icons/nuclear_innovators/spent-mox-fuel-assembly.png",
|
||||
icon_size = 32,
|
||||
flags = {"goes-to-main-inventory"},
|
||||
subgroup = "nuclear_innovators",
|
||||
order = "a-b-c",
|
||||
stack_size = 1,
|
||||
},
|
||||
|
||||
--radioactive elements
|
||||
|
||||
{
|
||||
type = "item",
|
||||
name = "neptunium-237",
|
||||
icon = "__Aperture_Nuclear_Innovators__/graphics/icons/nuclear_innovators/neptunium-237.png",
|
||||
icon_size = 32,
|
||||
flags = {"goes-to-main-inventory"},
|
||||
subgroup = "nuclear_innovators",
|
||||
order = "a-b-c",
|
||||
stack_size = 100,
|
||||
},
|
||||
{
|
||||
type = "item",
|
||||
name = "plutonium-239",
|
||||
icon = "__Aperture_Nuclear_Innovators__/graphics/icons/nuclear_innovators/plutonium-239.png",
|
||||
icon_size = 32,
|
||||
flags = {"goes-to-main-inventory"},
|
||||
subgroup = "nuclear_innovators",
|
||||
order = "a-b-c",
|
||||
stack_size = 100,
|
||||
},
|
||||
{
|
||||
type = "item",
|
||||
name = "plutonium-238",
|
||||
icon = "__Aperture_Nuclear_Innovators__/graphics/icons/nuclear_innovators/plutonium-238.png",
|
||||
icon_size = 32,
|
||||
flags = {"goes-to-main-inventory"},
|
||||
subgroup = "nuclear_innovators",
|
||||
order = "a-b-c",
|
||||
stack_size = 100,
|
||||
},
|
||||
|
||||
--processed resources
|
||||
|
||||
{
|
||||
type = "item",
|
||||
name = "yellowcake",
|
||||
icon = "__Aperture_Nuclear_Innovators__/graphics/icons/nuclear_innovators/yellowcake.png",
|
||||
icon_size = 32,
|
||||
flags = {"goes-to-main-inventory"},
|
||||
subgroup = "nuclear_innovators",
|
||||
order = "a-b-c",
|
||||
stack_size = 100,
|
||||
},
|
||||
|
||||
--waste byproducts
|
||||
|
||||
{
|
||||
type = "item",
|
||||
name = "solid-radioactive-waste",
|
||||
icon = "__Aperture_Nuclear_Innovators__/graphics/icons/nuclear_innovators/irradiated-ash.png",
|
||||
icon_size = 32,
|
||||
flags = {"goes-to-main-inventory"},
|
||||
subgroup = "nuclear_innovators",
|
||||
order = "a-b-c",
|
||||
stack_size = 100,
|
||||
}
|
||||
})
|
147
mod/prototypes/items/science_innovators.lua
Normal file
147
mod/prototypes/items/science_innovators.lua
Normal file
|
@ -0,0 +1,147 @@
|
|||
data:extend(
|
||||
{
|
||||
{
|
||||
type = "item",
|
||||
name = "test-item",
|
||||
icon = "__Aperture_Nuclear_Innovators__/graphics/icons/test.png",
|
||||
icon_size = 32,
|
||||
flags = {"goes-to-main-inventory"},
|
||||
subgroup = "science_innovators",
|
||||
order = "a-b-c",
|
||||
stack_size = 100,
|
||||
},
|
||||
|
||||
--resources
|
||||
|
||||
{
|
||||
type = "item",
|
||||
name = "raw-asbestos",
|
||||
icon = "__Aperture_Nuclear_Innovators__/graphics/icons/science_innovators/raw-asbestos.png",
|
||||
icon_size = 32,
|
||||
flags = {"goes-to-main-inventory"},
|
||||
subgroup = "science_innovators",
|
||||
order = "a-b-c",
|
||||
stack_size = 100,
|
||||
},
|
||||
{
|
||||
type = "item",
|
||||
name = "raw-fluorite",
|
||||
icon = "__Aperture_Nuclear_Innovators__/graphics/icons/science_innovators/raw-fluorite.png",
|
||||
icon_size = 32,
|
||||
flags = {"goes-to-main-inventory"},
|
||||
subgroup = "science_innovators",
|
||||
order = "a-b-c",
|
||||
stack_size = 100,
|
||||
},
|
||||
{
|
||||
type = "item",
|
||||
name = "coke",
|
||||
icon = "__Aperture_Nuclear_Innovators__/graphics/icons/science_innovators/coke.png",
|
||||
icon_size = 32,
|
||||
flags = {"goes-to-main-inventory"},
|
||||
subgroup = "science_innovators",
|
||||
order = "a-b-c",
|
||||
stack_size = 100,
|
||||
},
|
||||
{
|
||||
type = "item",
|
||||
name = "calcium",
|
||||
icon = "__Aperture_Nuclear_Innovators__/graphics/icons/science_innovators/coke.png",
|
||||
icon_size = 32,
|
||||
flags = {"goes-to-main-inventory"},
|
||||
subgroup = "science_innovators",
|
||||
order = "a-b-c",
|
||||
stack_size = 100,
|
||||
},
|
||||
|
||||
--refined resources
|
||||
|
||||
{
|
||||
type = "item",
|
||||
name = "asbestos-cement",
|
||||
icon = "__Aperture_Nuclear_Innovators__/graphics/icons/science_innovators/asbestos-cement.png",
|
||||
icon_size = 32,
|
||||
flags = {"goes-to-main-inventory"},
|
||||
subgroup = "science_innovators",
|
||||
order = "a-b-c",
|
||||
stack_size = 100,
|
||||
},
|
||||
{
|
||||
type = "item",
|
||||
name = "pure-coke",
|
||||
icon = "__Aperture_Nuclear_Innovators__/graphics/icons/science_innovators/graphite.png",
|
||||
icon_size = 32,
|
||||
flags = {"goes-to-main-inventory"},
|
||||
subgroup = "science_innovators",
|
||||
order = "a-b-c",
|
||||
stack_size = 100,
|
||||
},
|
||||
{
|
||||
type = "item",
|
||||
name = "graphite",
|
||||
icon = "__Aperture_Nuclear_Innovators__/graphics/icons/science_innovators/graphite.png",
|
||||
icon_size = 32,
|
||||
flags = {"goes-to-main-inventory"},
|
||||
subgroup = "science_innovators",
|
||||
order = "a-b-c",
|
||||
stack_size = 100,
|
||||
},
|
||||
|
||||
--science
|
||||
|
||||
{
|
||||
type = "item",
|
||||
name = "reactor-test-report-page",
|
||||
icon = "__Aperture_Nuclear_Innovators__/graphics/icons/science_innovators/reactor-test-report-page.png",
|
||||
icon_size = 32,
|
||||
flags = {"goes-to-main-inventory"},
|
||||
subgroup = "science_innovators",
|
||||
order = "a-b-c",
|
||||
stack_size = 1,
|
||||
},
|
||||
{
|
||||
type = "item",
|
||||
name = "aperture-science-pack",
|
||||
icon = "__Aperture_Nuclear_Innovators__/graphics/icons/science_innovators/aperture-science-pack.png",
|
||||
icon_size = 32,
|
||||
flags = {"goes-to-main-inventory"},
|
||||
subgroup = "science_innovators",
|
||||
order = "a-b-c",
|
||||
stack_size = 100,
|
||||
},
|
||||
|
||||
--intermediate items
|
||||
|
||||
{
|
||||
type = "item",
|
||||
name = "reactor-control-server",
|
||||
icon = "__Aperture_Nuclear_Innovators__/graphics/icons/science_innovators/reactor-control-server.png",
|
||||
icon_size = 32,
|
||||
flags = {"goes-to-main-inventory"},
|
||||
subgroup = "science_innovators",
|
||||
order = "a-b-c",
|
||||
stack_size = 5,
|
||||
},
|
||||
{
|
||||
type = "item",
|
||||
name = "steel-rebar",
|
||||
icon = "__Aperture_Nuclear_Innovators__/graphics/icons/science_innovators/steel-rebar.png",
|
||||
icon_size = 32,
|
||||
flags = {"goes-to-main-inventory"},
|
||||
subgroup = "science_innovators",
|
||||
order = "a-b-c",
|
||||
stack_size = 100,
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
type = "item",
|
||||
name = "raw-fluorite",
|
||||
icon = "__Aperture_Nuclear_Innovators__/graphics/icons/science_innovators/raw-fluorite.png",
|
||||
icon_size = 32,
|
||||
flags = {"goes-to-main-inventory"},
|
||||
subgroup = "science_innovators",
|
||||
order = "a-b-c",
|
||||
stack_size = 100,
|
||||
}
|
||||
})
|
Loading…
Reference in New Issue
Block a user