Skip to content
Open
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
54 changes: 25 additions & 29 deletions data-updates.lua
Original file line number Diff line number Diff line change
Expand Up @@ -150,48 +150,44 @@ end

--ENERGY COSTS--

--ENERGY PRODUCTION DESCRIPTION --
for name, variance in pairs(require "scripts.wind.variation") do
variance = {"entity-description.variance", tostring(variance * 100)}
-- Handle the surrogate items that show in electric stats, too
for _, suffix in pairs {"", "-blank"} do
local entity = data.raw["electric-energy-interface"][name .. suffix]
if entity then
if entity.localised_description then
entity.localised_description = {"", entity.localised_description, "\n", variance}
else
entity.localised_description = {"?", {"", {"entity-description." .. name}, "\n", variance}, variance}
end
end
end
end

local electric_energy_interfaces = {
-- add wind data to entity tooltip fields
for _, name in pairs{
"hawt-turbine-mk01",
"hawt-turbine-mk02",
"hawt-turbine-mk03",
"hawt-turbine-mk04",
"hawt-turbine-mk01-blank",
"hawt-turbine-mk02-blank",
"hawt-turbine-mk03-blank",
"hawt-turbine-mk04-blank",
"vawt-turbine-mk01",
"vawt-turbine-mk02",
"vawt-turbine-mk03",
"vawt-turbine-mk04",
"multiblade-turbine-mk01",
"multiblade-turbine-mk03",
"multiblade-turbine-mk01-blank",
"multiblade-turbine-mk03-blank",
} do
local entity = data.raw["solar-panel"][name]
entity.custom_tooltip_fields = entity.custom_tooltip_fields or {}
entity.custom_tooltip_fields[#entity.custom_tooltip_fields+1] = {
name = {"entity-description.output-per-kmph"},
value = entity.production
}
end

-- add relevant data to custom solar panel descriptions
for _, name in pairs{
"solar-panel-mk02",
"solar-panel-mk03",
}

for _, name in pairs(electric_energy_interfaces) do
local item = data.raw.item[name]
} do
local entity = data.raw["electric-energy-interface"][name]
local output = {"entity-description.max-output", tostring(entity.energy_production)}
if item.localised_description then
item.localised_description = {"", item.localised_description, "\n", (output)}
elseif entity.localised_description then
item.localised_description = {"", entity.localised_description, "\n", output}
else
item.localised_description = {"?", {"", {"entity-description." .. name}, "\n", output}, output}
end
entity.custom_tooltip_fields = entity.custom_tooltip_fields or {}
entity.custom_tooltip_fields[#entity.custom_tooltip_fields+1] = {
name = {"entity-description.max-output"},
value = entity.energy_production
}
entity.energy_source.buffer_capacity = entity.energy_production
end

Expand Down
3 changes: 3 additions & 0 deletions data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,9 @@ require "prototypes.animations.hawt-turbine-mk04"

require "prototypes.decay.decay"

--(( OTHER ))
require "prototypes.surface-properties"

data.raw.fluid["crude-oil"].subgroup = "test"
data.raw.fluid["gasoline"].subgroup = "test"
data.raw.fluid["fatty-acids"].fuel_value = "1MJ"
Expand Down
4 changes: 2 additions & 2 deletions locale/en/entity.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ aerial-blimp-mk04=Generates energy while flying high in the atmosphere.
simik-boiler=Uses the natural heat of these creatures to generate steam.
py-rtg=Great use of isotopes to power distant outposts or small builds.
mova=Weird GMO plant that mature their seeds in low gravity.
max-output=[font=default-semibold][color=255,230,192]Avg. output: [/color][/font]__1__
variance=[font=default-semibold][color=255,230,192]Variance: [/color][/font]__1__%
max-output=Avg. output
output-per-kmph=Output per kmph
multiblade-turbine-mk01=A primitive design for a wind turbine. Cheap, but effective.
multiblade-turbine-mk03=Advanced wind generator based on the original fish turbine design.
12 changes: 11 additions & 1 deletion locale/en/extra.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,14 @@ stranded=An aerial turbine [item=__1__] was stranded @ [gps=__2__,__3__]

[entity-status]
requires-moonlight=Requires moonlight
requires-sunlight=Requires sunlight
requires-sunlight=Requires sunlight

[surface-property]
py-wind-speed=Wind speed [kmph]
py-wind-speed-min=Minimum wind speed [kmph]
py-wind-speed-max=Maximum wind speed [kmph]

[surface-property-unit]
py-wind-speed=__1__ kmph
py-wind-speed-min=__1__ kmph
py-wind-speed-max=__1__ kmph
3 changes: 1 addition & 2 deletions locale/nl/entity.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ aerial-blimp-mk04=Genereert energie terwijl het hoog in de atmosfeer vliegt.
simik-boiler=Gebruik de natuurlijke warmte van deze wezens om stoom mee te genereren.
py-rtg=Goed gebruik van isotopen om afgelegen buitenposten of kleine bouwprojecten mee van stroom te voorzien.
mova=Rare GGO plant waarvan de zaden volwassen worden als die zich in lage zwaartekracht bevinden.
max-output=[font=default-semibold][color=255,230,192]Gem. vermogen: [/color][/font]__1__
variance=[font=default-semibold][color=255,230,192]Variantie: [/color][/font]__1__%
max-output=Gem. vermogen
multiblade-turbine-mk01=Een primitief ontwerp voor een windturbine. Goedkoop maar effectief.
multiblade-turbine-mk03=Geavanceerde windgenerator gebaseerd op het orginele visturbineontwerp.
3 changes: 1 addition & 2 deletions locale/ru/entity.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -206,5 +206,4 @@ hawt-turbine-mk01-hidden=Ветряная турбина с горизонтал
hawt-turbine-mk02-hidden=Ветряная турбина с горизонтальной осью МК2.\n[font=default-semibold]Я пришёл. Я раскрутился. Я победил.[/font]
hawt-turbine-mk03-hidden=Ветряная турбина с горизонтальной осью МК3.\n[font=default-semibold]Небо взорвано.[/font]
hawt-turbine-mk04-hidden=Ветряная турбина с горизонтальной осью МК4.\n[font=default-semibold]Преследовали мое электричество? Это злоупотребление властью.[/font]
max-output=[font=default-semibold][color=255,230,192]Средний выход: [/color][/font]__1__
variance=[font=default-semibold][color=255,230,192]Расхождение: [/color][/font]__1__%
max-output=Средний выход
3 changes: 1 addition & 2 deletions locale/uk/entity.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ aerial-blimp-mk04=Виробляє енергію під час польоту
simik-boiler=Використовує природне тепло цих істот для створення пари.
py-rtg=Чудове використання ізотопів для живлення віддалених аванпостів або невеликих будівель.
mova=Дивна ГМО рослина, насіння якої дозріває в умовах низької гравітації.
max-output=[font=default-semibold][color=255,230,192]Сер. вихід: [/color][/font]__1__
variance=[font=default-semibold][color=255,230,192]Відхилення: [/color][/font]__1__%
max-output=Сер. вихід
multiblade-turbine-mk01=Примітивна конструкція для вітрової турбіни. Дешево, але ефективно.
multiblade-turbine-mk03=Удосконалений вітрогенератор на основі оригінальної конструкції турбіни "Риба".
3 changes: 1 addition & 2 deletions locale/zh-CN/pyalternativeenergy.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,7 @@ aerial-blimp-mk04=在高空飞行时产生能量。
simik-boiler=利用这些生物的天然热量来产生蒸汽。
py-rtg=大量使用同位素为远方前哨站或小型建筑提供动力。\n[font=default-small][color=green]【注】RTG:Radioisotope Thermoelectric Generator[/color][/font]
mova=奇怪的转基因植物,它们的种子在低重力下成熟。
max-output=[font=default-semibold][color=255,230,192]均值:[/color][/font]__1__
variance=[font=default-semibold][color=255,230,192]方差: [/color][/font]__1__%
max-output=均值
multiblade-turbine-mk01=风力涡轮机的原始设计。廉价,却有效。
multiblade-turbine-mk03=基于原始鱼式涡轮机设计的先进风力发电机。

Expand Down
124 changes: 55 additions & 69 deletions prototypes/buildings/hawt-turbine-mk01.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ITEM {
}

local proto = ENTITY {
type = "electric-energy-interface",
type = "solar-panel",
name = "hawt-turbine-mk01",
icon = "__pyalternativeenergygraphics__/graphics/icons/hawt-turbine-mk01.png",
icon_size = 64,
Expand All @@ -50,57 +50,48 @@ local proto = ENTITY {
selection_box = {{-3.5, -3.5}, {3.5, 3.5}},
energy_source = {
type = "electric",
usage_priority = "primary-output",
usage_priority = "solar",
buffer_capacity = "5MJ",
input_flow_limit = "0W",
render_no_power_icon = false
},
energy_production = "5MW",
energy_usage = "0kW",
production = "100kW",
solar_coefficient_property = "py-wind-speed",
performance_at_day = 1,
performance_at_night = 1,
impact_category = "metal-large",
working_sound = {
sound = {filename = "__pyalternativeenergygraphics__/sounds/hawt-turbine-mk01.ogg", volume = 0.85},
idle_sound = {filename = "__pyalternativeenergygraphics__/sounds/hawt-turbine-mk01.ogg", volume = 0.6},
apparent_volume = 2.5
},
continuous_animation = true,
animations = {
picture = {
layers = {
{
filename = "__pyalternativeenergygraphics__/graphics/entity/hawt-turbine-mk01/r4.png",
width = 224,
height = 288,
line_length = 6,
frame_count = 30,
shift = util.by_pixel(0, -20),
animation_speed = 0.4
}, {
filename = "__pyalternativeenergygraphics__/graphics/entity/hawt-turbine-mk01/a4.png",
width = 224,
height = 288,
line_length = 6,
frame_count = 30,
shift = util.by_pixel(0, -20),
animation_speed = 0.4
}, {
filename = "__pyalternativeenergygraphics__/graphics/entity/hawt-turbine-mk01/s4.png",
width = 256,
height = 224,
line_length = 6,
frame_count = 30,
shift = util.by_pixel(0, -20),
animation_speed = 0.4,
draw_as_shadow = true
}, {
filename = "__pyalternativeenergygraphics__/graphics/entity/hawt-turbine-mk01/l4.png",
width = 224,
height = 288,
line_length = 6,
frame_count = 30,
shift = util.by_pixel(0, -20),
animation_speed = 0.13,
draw_as_glow = true
},
},
{
filename = "__pyalternativeenergygraphics__/graphics/entity/hawt-turbine-mk01/a4.png",
width = 224,
height = 288,
shift = util.by_pixel(0, -20),
},
{
filename = "__pyalternativeenergygraphics__/graphics/entity/hawt-turbine-mk01/s4.png",
width = 256,
height = 224,
shift = util.by_pixel(0, -20),
draw_as_shadow = true
},
{
filename = "__pyalternativeenergygraphics__/graphics/entity/hawt-turbine-mk01/l4.png",
width = 224,
height = 288,
shift = util.by_pixel(0, -20),
draw_as_glow = true
}
}
},
localised_name = {"entity-name.hawt-turbine-mk01"},
Expand All @@ -110,41 +101,36 @@ local proto = ENTITY {
-- Make a copy with only the base animation
local new_proto = table.deepcopy(proto)
new_proto.name = proto.name .. "-blank"
new_proto.picture = table.deepcopy(proto.animations.layers[1])
new_proto.picture = table.deepcopy(proto.picture.layers[1])
new_proto.picture.filename = new_proto.picture.filename:gsub("r4", "base-mk01")
new_proto.animations = nil
new_proto.render_layer = "lower-object-above-shadow"
data:extend {new_proto}

data:extend
{
{
type = "simple-entity-with-force",
name = "hawt-turbine-mk01-collision",
render_layer = "wires-above",
icon = "__pyalternativeenergygraphics__/graphics/icons/hawt-turbine-mk01.png",
icon_size = 64,
flags = {"placeable-neutral", "player-creation", "not-on-map"},
collision_box = {{-13.4, -13.4}, {13.4, 13.4}},
data:extend {{
type = "simple-entity-with-force",
name = "hawt-turbine-mk01-collision",
render_layer = "wires-above",
icon = "__pyalternativeenergygraphics__/graphics/icons/hawt-turbine-mk01.png",
icon_size = 64,
flags = {"placeable-neutral", "player-creation", "not-on-map"},
collision_box = {{-13.4, -13.4}, {13.4, 13.4}},
collision_mask = {layers = {wind_layer = true}},
selection_box = {{-3.5, -3.5}, {3.5, 3.5}},
selectable_in_game = false,
picture = {
filename = "__pyalternativeenergygraphics__/graphics/icons/filler.png",
width = 4,
height = 4,
},
created_effect = {
type = "area",
radius = 13.4,
collision_mask = {layers = {wind_layer = true}},
selection_box = {{-3.5, -3.5}, {3.5, 3.5}},
selectable_in_game = false,
picture = {
filename = "__pyalternativeenergygraphics__/graphics/icons/filler.png",
width = 4,
height = 4,
},
created_effect = {
type = "area",
radius = 13.4,
collision_mask = {layers = {wind_layer = true}},
action_delivery = {
type = "instant",
target_effects = {{
type = "script",
effect_id = "turbine-area"
}}
}
action_delivery = {
type = "instant",
target_effects = {{
type = "script",
effect_id = "turbine-area"
}}
}
}
}
}}
Loading