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
Binary file added graphics/icons/electric-fuel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion locale/de/locale.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
electric-rail=Strömungsschiene
railpole-prototype=Strommast für Strömungsschiene
electric-locomotive=elektrische Lokomotive
electric-fuel=Strom

[item-description]
straight-rail-power=Schiene, die mit Strommast angeschlossen werden kannn, dann wird mit Strom - und Schalt - netzwerk, verbunden. Strom kann auch vo elektrische Loko benutzt werden.
Expand All @@ -14,9 +15,13 @@ curved-rail-power=Gebogen Strömungsschiene
rail-pole=Strommast für Strömungsschiene
railpole-prototype=Strommast für Strömungsschiene
electric-locomotive=elektrische Lokomotive
rail-accu=Rail Power System

[technology-name]
rail-power-system=Strömungsschiene System

[technology-description]
rail-power-system=Lass, elektrische Züge zu benutzen
rail-power-system=Lass, elektrische Züge zu benutzen

[fuel-category-name]
electrical=Strom
7 changes: 6 additions & 1 deletion locale/en/locale.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
electric-rail=Rail with power
railpole-prototype=rail electric pole
electric-locomotive=electric locomotive
electric-fuel=electricity

[item-description]
straight-rail-power=rail that can be connected to a rail electric pole supplier, and transmit electricity and signals along its course, and to hybrid trains
Expand All @@ -14,9 +15,13 @@ curved-rail-power=Curved rail with power
rail-pole=rail electric pole
railpole-prototype=rail electric pole
electric-locomotive=electric locomotive
rail-accu=Rail Power System

[technology-name]
rail-power-system=Rail Power System

[technology-description]
rail-power-system=Allow to use electric trains
rail-power-system=Allow to use electric trains

[fuel-category-name]
electrical=electricity
7 changes: 6 additions & 1 deletion locale/fr/locale.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
powered-rail=Rail électric
railpole-prototype=pylone pour rail
electric-locomotive=locomotive électrique
electric-fuel=électricité

[item-description]
straight-rail-power=rail qui peut être connecté à une pylone pour rail et transmettre l'électricité et les signaux de circuit à tous les rails connectés, ainsi qu'aux trains électriques
Expand All @@ -14,9 +15,13 @@ curved-rail-power=Rail électric courbé
rail-pole=pylone pour rail
railpole-prototype=pylone pour rail
electric-locomotive=locomotive électrique
rail-accu=Rail Power System

[technology-name]
rail-power-system=Système de trains électriques

[technology-description]
rail-power-system=Permet l'utilisation des trains électriques
rail-power-system=Permet l'utilisation des trains électriques

[fuel-category-name]
electrical=électricité
7 changes: 6 additions & 1 deletion locale/ru/locale.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
electric-rail=Электрифицированные рельсы
railpole-prototype=Силовой контактор
electric-locomotive=электрический локомотив
electric-fuel=электричество

[item-description]
straight-rail-power=Подключается к электрической сети через силовой контактор. Они передают сигналы и электроэнергию (и на электровозы) по всей своей длине.
Expand All @@ -14,9 +15,13 @@ curved-rail-power=Электрифицированные рельсы
rail-pole=Силовой контактор
railpole-prototype=Силовой контактор
electric-locomotive=электрический локомотив
rail-accu=Rail Power System

[technology-name]
rail-power-system=Электрификация железных дорог

[technology-description]
rail-power-system=Позволяет использовать поезда на электротяге
rail-power-system=Позволяет использовать поезда на электротяге

[fuel-category-name]
electrical=электричество
27 changes: 27 additions & 0 deletions locale/uk/locale.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[item-name]
electric-rail=Електричні шківі
railpole-prototype=Силовий контактор
electric-locomotive=електричний локомотив
electric-fuel=електрика

[item-description]
straight-rail-power=Підключається до електричної мережі через силовий контактор. Вони передають сигнали та електроенергію (і на електровози) по всій своїй довжині.
electric-locomotive=Працює як на стандартному паливі, так і на електротязі (вимагає електрифіковані рейки)
railpole-prototype=Забезпечує підключення електрифікованих рейок до електромережі

[entity-name]
straight-rail-power=Електрифіковані рейки
curved-rail-power=Електрифіковані рейки
rail-pole=Силовий контактор
railpole-prototype=Силовий контактор
electric-locomotive=електричний локомотив
rail-accu=Rail Power System

[technology-name]
rail-power-system=Електрифікація залізниць

[technology-description]
rail-power-system=Дозволяє використовувати поїзди на електротязі

[fuel-category-name]
electrical=електрика
11 changes: 9 additions & 2 deletions prototypes/entities.lua
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ createdata("electric-pole","small-electric-pole",railpole,{
connection_points = connection_points
})
createdata("electric-pole",railpole,electricnode,{
minable= nil,
minable= nil,
draw_copper_wires=false,
draw_circuit_wires=false,
selectable_in_game=false,
Expand Down Expand Up @@ -132,16 +132,23 @@ createdata("electric-energy-interface","electric-energy-interface",rail_electric
}
},true)

data.raw["electric-energy-interface"][rail_electric_accu].icon="__"..modname.."__/graphics/icons/"..electric_rail..".png"

--rail
createdata("straight-rail","straight-rail",straight_rail_power,{
minable = {mining_time = 0.6, result = electric_rail},
fast_replaceable_group = "straight-rail"
})

update_rail_pictures("straight-rail",straight_rail_power)
data.raw["straight-rail"]["straight-rail"].fast_replaceable_group = "straight-rail"

createdata("curved-rail","curved-rail",curved_rail_power,{
icon = "__base__/graphics/icons/curved-rail.png",
minable = {mining_time = 0.6, result = electric_rail, count=4},
placeable_by = { item=electric_rail, count = 4},
fast_replaceable_group = "curved-rail"
})
update_rail_pictures("curved-rail",curved_rail_power)
update_rail_pictures("curved-rail",curved_rail_power)

data.raw["curved-rail"]["curved-rail"].fast_replaceable_group = "curved-rail"
4 changes: 3 additions & 1 deletion prototypes/items.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
--electrical fuel
createdata("item","solid-fuel",electricfuel,{
fuel_category="electrical",
fuel_value="20KJ"
fuel_value="20KJ",
stack_size=1,
icon="__"..modname.."__/graphics/icons/"..electricfuel..".png"
},true)

--train
Expand Down
10 changes: 4 additions & 6 deletions prototypes/locomotive.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@ function locomotive:update()
if not self.entity.valid then
return
end
local required_fuel=self.stack_size-self.entity.get_item_count()
if required_fuel>0 then
if self.burner.heat <self.burner.heat_capacity*0.1 then
local rail=global.custom_entities[(self.train.front_rail or self.train.back_rail).unit_number]
if rail and rail.accu.energy>=self.ratio_fuel then
local required_energy=required_fuel*self.ratio_fuel
local required_energy=self.burner.heat_capacity*0.99-self.burner.heat
local power_transfer = math.min(rail.accu.energy,required_energy)
local power_fuel=math.floor(power_transfer/self.ratio_fuel)
self.entity.get_fuel_inventory().insert({name=electricfuel, count=power_fuel})
rail.accu.energy=rail.accu.energy-power_fuel*self.ratio_fuel
self.burner.heat=self.burner.heat+power_transfer
rail.accu.energy=rail.accu.energy-power_transfer
end
end
end