diff --git a/graphics/icons/electric-fuel.png b/graphics/icons/electric-fuel.png new file mode 100644 index 0000000..e8c2767 Binary files /dev/null and b/graphics/icons/electric-fuel.png differ diff --git a/locale/de/locale.cfg b/locale/de/locale.cfg index 3735a9b..d1bfe48 100644 --- a/locale/de/locale.cfg +++ b/locale/de/locale.cfg @@ -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. @@ -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 \ No newline at end of file +rail-power-system=Lass, elektrische Züge zu benutzen + +[fuel-category-name] +electrical=Strom \ No newline at end of file diff --git a/locale/en/locale.cfg b/locale/en/locale.cfg index 2bd3a7b..62a4569 100644 --- a/locale/en/locale.cfg +++ b/locale/en/locale.cfg @@ -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 @@ -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 \ No newline at end of file +rail-power-system=Allow to use electric trains + +[fuel-category-name] +electrical=electricity \ No newline at end of file diff --git a/locale/fr/locale.cfg b/locale/fr/locale.cfg index 2238e00..d9ce960 100644 --- a/locale/fr/locale.cfg +++ b/locale/fr/locale.cfg @@ -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 @@ -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 \ No newline at end of file +rail-power-system=Permet l'utilisation des trains électriques + +[fuel-category-name] +electrical=électricité \ No newline at end of file diff --git a/locale/ru/locale.cfg b/locale/ru/locale.cfg index 3a59559..5d7a1fb 100644 --- a/locale/ru/locale.cfg +++ b/locale/ru/locale.cfg @@ -2,6 +2,7 @@ electric-rail=Электрифицированные рельсы railpole-prototype=Силовой контактор electric-locomotive=электрический локомотив +electric-fuel=электричество [item-description] straight-rail-power=Подключается к электрической сети через силовой контактор. Они передают сигналы и электроэнергию (и на электровозы) по всей своей длине. @@ -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=Позволяет использовать поезда на электротяге \ No newline at end of file +rail-power-system=Позволяет использовать поезда на электротяге + +[fuel-category-name] +electrical=электричество \ No newline at end of file diff --git a/locale/uk/locale.cfg b/locale/uk/locale.cfg new file mode 100644 index 0000000..a000534 --- /dev/null +++ b/locale/uk/locale.cfg @@ -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=електрика \ No newline at end of file diff --git a/prototypes/entities.lua b/prototypes/entities.lua index dae4d24..37fa0ef 100644 --- a/prototypes/entities.lua +++ b/prototypes/entities.lua @@ -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, @@ -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) \ No newline at end of file +update_rail_pictures("curved-rail",curved_rail_power) + +data.raw["curved-rail"]["curved-rail"].fast_replaceable_group = "curved-rail" \ No newline at end of file diff --git a/prototypes/items.lua b/prototypes/items.lua index 863783f..f20b456 100644 --- a/prototypes/items.lua +++ b/prototypes/items.lua @@ -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 diff --git a/prototypes/locomotive.lua b/prototypes/locomotive.lua index b1af1e4..414b7be 100644 --- a/prototypes/locomotive.lua +++ b/prototypes/locomotive.lua @@ -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.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 \ No newline at end of file