Skip to content

Commit dae32eb

Browse files
committed
Update 17
1 parent 3001d42 commit dae32eb

File tree

11 files changed

+128
-1
lines changed

11 files changed

+128
-1
lines changed

config.lua

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Config.geothermalColor = settings.startup["geothermal-color"].value
1414

1515
Config.geothermalSpawnRules = settings.startup["geothermal-spawn-rules"].value
1616

17+
Config.thermalWagon = settings.startup["thermal-wagon"].value
18+
1719
Config.retrogenDistance = -1
1820

1921
Config.seedMixin = 7865

control.lua

+30
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,36 @@ script.on_event(defines.events.on_tick, function(event)
269269
--game.print("Ran load code")
270270
end
271271

272+
if event.tick%60 == 0 then
273+
for name,force in pairs(game.forces) do
274+
for _,train in pairs(force.get_trains()) do
275+
for __,car in pairs(train.fluid_wagons) do
276+
if car.prototype.name ~= "insulated-wagon" then
277+
--[[
278+
for name,amt in pairs(car.get_fluid_contents()) do
279+
if string.find(name, "geothermal-water", 1, true) then
280+
car.remove_fluid{name=name, amount=100}
281+
end
282+
end
283+
--]]
284+
for i = 1,#car.fluidbox do
285+
local box = car.fluidbox[i]
286+
if box and string.find(box.name, "geothermal-water", 1, true) then
287+
if box.temperature > 30 then
288+
box.name = "cooling-geothermal-water"
289+
else
290+
box.name = "water"
291+
box.temperature = 25
292+
end
293+
car.fluidbox[i] = {name = box.name, temperature = box.temperature, amount = box.amount}
294+
end
295+
end
296+
end
297+
end
298+
end
299+
end
300+
end
301+
272302
--local pos=game.players[1].position
273303
--for k,v in pairs(game.surfaces.nauvis.find_entities_filtered{area={{pos.x-1,pos.y-1},{pos.x+1,pos.y+1}}, type="resource"}) do v.destroy() end
274304
end)

data.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ require("config")
33
require("prototypes.turbine")
44
require("prototypes.well")
55
require("prototypes.tech")
6-
require("prototypes.fluid")
6+
require("prototypes.fluid")
7+
require("prototypes.insulated-wagon")

graphics/icons/fluid-wagon.png

8.77 KB
Loading

graphics/technology/wagon.png

17.7 KB
Loading

locale/en/names.cfg

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
geothermal-turbine=Geothermal Turbine
33
geothermal-well=Geothermal Well
44
geothermal-heat-exchanger=Geothermal Water Heat Exchanger
5+
insulated-wagon=Insulated Fluid Wagon
56

67

78
[fluid-name]
@@ -13,6 +14,7 @@ geothermal-turbine=Geothermal Turbine
1314
geothermal-heat-exchanger=Geothermal Water Heat Exchanger
1415
geothermal-well=Geothermal Well
1516
geothermal=Geothermal Patch__1__
17+
insulated-wagon=Insulated Fluid Wagon
1618

1719

1820
[recipe-name]
@@ -44,6 +46,7 @@ geothermal-frequency=Generation Frequency
4446
geothermal-size=Generation Patch Size
4547
geothermal-color=Enable colored geothermal patches
4648
geothermal-spawn-rules=Geothermal biome rules
49+
thermal-wagon=Enable Insulated Fluid Wagon
4750

4851

4952
[mod-setting-description]
@@ -54,6 +57,7 @@ geothermal-frequency=A multiplier to control how often geothermal patches will g
5457
geothermal-size=A multiplier to control how large geothermal regions are. Has no effect with AlienBiomes installed.
5558
geothermal-color=AlienBiomes compatibility; Whether the geothermal patches spawning in colored magma biomes take on that color, as well as a chemical impurity representing that color.
5659
geothermal-spawn-rules=Which biomes the geothermal patches are permitted to spawn in. Note that they have hardcoded per-biome frequencies as well, and restricting to biomes that do not actually exist will be the same as selecting "everywhere".
60+
thermal-wagon=Whether a thermally insulated version of the fluid wagon should be enabled, to permit carrying heated water without it losing its temperature.
5761

5862

5963
[string-mod-setting]

prototypes/fluid.lua

+18
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,24 @@ data:extend(
3333
}
3434
})
3535

36+
data:extend({
37+
{
38+
type = "fluid",
39+
name = "cooling-geothermal-water",
40+
default_temperature = 20,
41+
max_temperature = 350,
42+
heat_capacity = "0J",
43+
base_color = colors[""].base,
44+
flow_color = {r=math.sqrt(colors[""].base.r), g = math.sqrt(colors[""].base.g), b=math.sqrt(colors[""].base.b)},--{r=0.8, g=0.7, b=0.7},
45+
icon = "__Geothermal__/graphics/icons/water.png",
46+
icon_size = 32,
47+
order = "a[fluid]-a[water]",
48+
pressure_to_speed_ratio = 0.3,
49+
flow_to_energy_ratio = 0,
50+
localised_name = {"fluid-name.geothermal-water", "", "", ""},
51+
}
52+
})
53+
3654
for color,params in pairs(colors) do
3755

3856
local display = color == "" and "" or " (" .. string.upper(string.sub(color, 2, 2)) .. string.sub(color, 3) .. ")"

prototypes/insulated-wagon.lua

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
require "config"
2+
3+
require "__DragonIndustries__.cloning"
4+
5+
if not Config.thermalWagon then return end
6+
7+
local wagon = copyObject("fluid-wagon", "fluid-wagon", "insulated-wagon")
8+
local item = copyObject("item-with-entity-data", "fluid-wagon", "insulated-wagon")
9+
--adds 22MB to mod - reparentSprites("base", "Geothermal", wagon)
10+
reparentSprites("base", "Geothermal", item)
11+
12+
local recipe = {
13+
type = "recipe",
14+
name = "insulated-wagon",
15+
enabled = false,
16+
energy_required = 30,
17+
ingredients =
18+
{
19+
{"low-density-structure", 25},
20+
{"fluid-wagon", 1}
21+
},
22+
result = "insulated-wagon"
23+
}
24+
25+
local tech = {
26+
type = "technology",
27+
name = "insulated-wagon",
28+
prerequisites =
29+
{
30+
"fluid-wagon",
31+
"geothermal",
32+
"low-density-structure"
33+
},
34+
icon = "__Geothermal__/graphics/technology/wagon.png",
35+
effects =
36+
{
37+
{
38+
type = "unlock-recipe",
39+
recipe = "insulated-wagon"
40+
}
41+
},
42+
unit =
43+
{
44+
count = 150,
45+
ingredients =
46+
{
47+
{"automation-science-pack", 1},
48+
{"logistic-science-pack", 1},
49+
{"chemical-science-pack", 1},
50+
},
51+
time = 40
52+
},
53+
order = "[steam]-2",
54+
icon_size = 128,
55+
}
56+
57+
data:extend({wagon, item, recipe, tech})

prototypes/recipe-updates.lua

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
require "config"
2+
3+
require "__DragonIndustries__.recipe"
4+
5+
if Config.thermalWagon and data.raw.item.rubber then
6+
addItemToRecipe("insulated-wagon", "rubber", 30, 50, false)
7+
end

prototypes/well.lua

+1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ data:extend(
9898
{
9999
module_slots = 2
100100
},--]]
101+
allowed_effects = {},
101102
radius_visualisation_picture =
102103
{
103104
filename = "__Geothermal__/graphics/entity/geothermal/geothermal-well-radius-visualization.png",

settings.lua

+7
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,11 @@ data:extend({
5959
allowed_values = {"volcanic", "volcanic-and-snow", "volcanic-snow-and-red-desert", "everywhere"},
6060
order = "r",
6161
},
62+
{
63+
type = "bool-setting",
64+
name = "thermal-wagon",
65+
setting_type = "startup",
66+
default_value = true,
67+
order = "r",
68+
},
6269
})

0 commit comments

Comments
 (0)