diff --git a/Localized_Charging_1.0.0/control.lua b/Localized_Charging_1.0.0/control.lua index 0a8b29c..07a1e46 100644 --- a/Localized_Charging_1.0.0/control.lua +++ b/Localized_Charging_1.0.0/control.lua @@ -6,10 +6,25 @@ script.on_init(function() end) local charging_info = { - ["localized-charging-pole"] = { - ['interface'] = 'localized-charging-pole-interface', - ['range'] = 10, - ['efficiency'] = 0.5, + ["localized-charging-pole-1"] = { + ['interface'] = 'localized-charging-pole-interface-1', + ['range'] = 10, + ['efficiency'] = 0.5, + }, + ["localized-charging-pole-2"] = { + ['interface'] = 'localized-charging-pole-interface-2', + ['range'] = 10, + ['efficiency'] = 0.5, + }, + ["localized-charging-pole-3"] = { + ['interface'] = 'localized-charging-pole-interface-3', + ['range'] = 10, + ['efficiency'] = 0.5, + }, + ["localized-charging-pole-4"] = { + ['interface'] = 'localized-charging-pole-interface-4', + ['range'] = 10, + ['efficiency'] = 0.5, }, } @@ -240,7 +255,7 @@ local function on_entity_created(entity) if(charging_info[entity.name] ~= nil) then local uid = entity.unit_number local interface = entity.surface.create_entity{ - name = "localized-charging-pole-interface", + name = charging_info[entity.name].interface, position = {entity.position['x'], entity.position['y']}, -- stop ai in everything mode from attacking this invulnerable building force=game.forces['enemy'] --entity.force @@ -313,4 +328,4 @@ end) -- entity.energy = entity.energy + 1000 -- game.print('added: ' .. tostring(entity.energy - current)) -- end --- end) \ No newline at end of file +-- end) diff --git a/Localized_Charging_1.0.0/locale/en.cfg b/Localized_Charging_1.0.0/locale/en.cfg index 9b08dbf..d0ab71f 100644 --- a/Localized_Charging_1.0.0/locale/en.cfg +++ b/Localized_Charging_1.0.0/locale/en.cfg @@ -1,5 +1,8 @@ [entity-name] -localized-charging-pole=Localized Charging Pole +localized-charging-pole-1=Localized Charging Pole (2.5MW/s) +localized-charging-pole-2=Localized Charging Pole (5MW/s) +localized-charging-pole-3=Localized Charging Pole (10MW/s) +localized-charging-pole-4=Localized Charging Pole (20MW/s) [vehicles] electric-locomotive=Electric Locomotive @@ -10,4 +13,4 @@ voltage-wireless-energy-distribution=Wireless Energy Distribution [technology-description] voltage-electric-trains=Higher powered trains that run off of electric batteries. -voltage-wireless-energy-distribution=A powerful charging system that will charge nearby power armor and certain electric vehicles at 20MW/s. It will use 40MW/s because the charging is inefficient. +voltage-wireless-energy-distribution=A powerful charging system that will charge nearby power armor and certain electric vehicles at between 2.5 and 20MW/s, depending on the charging pole used. It will use twice the amount charged because the charging is inefficient. diff --git a/Localized_Charging_1.0.0/migrations/Localized_Charging_1.0.0.json b/Localized_Charging_1.0.0/migrations/Localized_Charging_1.0.0.json new file mode 100644 index 0000000..46c4593 --- /dev/null +++ b/Localized_Charging_1.0.0/migrations/Localized_Charging_1.0.0.json @@ -0,0 +1,12 @@ +{ + "entity": + [ + ["localized-charging-pole-interface", "localized-charging-pole-interface-4"], + ["localized-charging-pole", "localized-charging-pole-4"] + ], + + "item": + [ + ["localized-charging-pole", "localized-charging-pole-4"] + ] +} diff --git a/Localized_Charging_1.0.0/migrations/Localized_Charging_1.0.0.lua b/Localized_Charging_1.0.0/migrations/Localized_Charging_1.0.0.lua new file mode 100644 index 0000000..b776ed9 --- /dev/null +++ b/Localized_Charging_1.0.0/migrations/Localized_Charging_1.0.0.lua @@ -0,0 +1,10 @@ +for i, force in pairs(game.forces) do + force.reset_recipes() + force.reset_technologies() + if force.technologies["voltage-wireless-energy-distribution"].researched then + force.recipes["localized-charging-pole-1"].enabled = true + force.recipes["localized-charging-pole-2"].enabled = true + force.recipes["localized-charging-pole-3"].enabled = true + force.recipes["localized-charging-pole-4"].enabled = true + end +end diff --git a/Localized_Charging_1.0.0/prototypes/charger.lua b/Localized_Charging_1.0.0/prototypes/charger.lua index b2a0b17..662c620 100644 --- a/Localized_Charging_1.0.0/prototypes/charger.lua +++ b/Localized_Charging_1.0.0/prototypes/charger.lua @@ -33,9 +33,93 @@ data:extend({ }, { type = "electric-energy-interface", - name = "localized-charging-pole-interface", + name = "localized-charging-pole-interface-1", icon = "__Localized_Charging__/graphics/icons/localized-charging-pole.png", - localised_name = {'entity-name.localized-charging-pole'}, + localised_name = {'entity-name.localized-charging-pole-1'}, + collision_box = {{-0.65, -0.65}, {0.65, 0.65}}, + flags = {"not-blueprintable", "not-deconstructable", "not-on-map", "placeable-off-grid"}, + max_health = 0, + corpse = "medium-remnants", + collision_mask = {}, + energy_source = + { + type = "electric", + buffer_capacity = (((charging_output / 8) * scan_tick) / 60) .. 'MJ', + usage_priority = "secondary-input", + input_flow_limit = ((charging_output / 8) * scan_tick) .. 'MW', + output_flow_limit = "0W" + }, + energy_production = "0W", + energy_usage = "0kW", + picture = + { + filename = "__core__/graphics/empty.png", + priority = "low", + width = 1, + height = 1, + }, + }, + { + type = "electric-energy-interface", + name = "localized-charging-pole-interface-2", + icon = "__Localized_Charging__/graphics/icons/localized-charging-pole.png", + localised_name = {'entity-name.localized-charging-pole-2'}, + collision_box = {{-0.65, -0.65}, {0.65, 0.65}}, + flags = {"not-blueprintable", "not-deconstructable", "not-on-map", "placeable-off-grid"}, + max_health = 0, + corpse = "medium-remnants", + collision_mask = {}, + energy_source = + { + type = "electric", + buffer_capacity = (((charging_output / 4) * scan_tick) / 60) .. 'MJ', + usage_priority = "secondary-input", + input_flow_limit = ((charging_output / 4) * scan_tick) .. 'MW', + output_flow_limit = "0W" + }, + energy_production = "0W", + energy_usage = "0kW", + picture = + { + filename = "__core__/graphics/empty.png", + priority = "low", + width = 1, + height = 1, + }, + }, + { + type = "electric-energy-interface", + name = "localized-charging-pole-interface-3", + icon = "__Localized_Charging__/graphics/icons/localized-charging-pole.png", + localised_name = {'entity-name.localized-charging-pole-3'}, + collision_box = {{-0.65, -0.65}, {0.65, 0.65}}, + flags = {"not-blueprintable", "not-deconstructable", "not-on-map", "placeable-off-grid"}, + max_health = 0, + corpse = "medium-remnants", + collision_mask = {}, + energy_source = + { + type = "electric", + buffer_capacity = (((charging_output / 2) * scan_tick) / 60) .. 'MJ', + usage_priority = "secondary-input", + input_flow_limit = ((charging_output / 2) * scan_tick) .. 'MW', + output_flow_limit = "0W" + }, + energy_production = "0W", + energy_usage = "0kW", + picture = + { + filename = "__core__/graphics/empty.png", + priority = "low", + width = 1, + height = 1, + }, + }, + { + type = "electric-energy-interface", + name = "localized-charging-pole-interface-4", + icon = "__Localized_Charging__/graphics/icons/localized-charging-pole.png", + localised_name = {'entity-name.localized-charging-pole-4'}, collision_box = {{-0.65, -0.65}, {0.65, 0.65}}, flags = {"not-blueprintable", "not-deconstructable", "not-on-map", "placeable-off-grid"}, max_health = 0, @@ -61,11 +145,257 @@ data:extend({ }, { type = "electric-pole", - name = 'localized-charging-pole', - localised_name = {'entity-name.localized-charging-pole'}, + name = 'localized-charging-pole-1', + localised_name = {'entity-name.localized-charging-pole-1'}, + icon = "__Localized_Charging__/graphics/icons/localized-charging-pole.png", + flags = {"placeable-neutral", "player-creation"}, + minable = {hardness = 0.2, mining_time = 0.5, result = "localized-charging-pole-1"}, + max_health = 400, + corpse = "medium-remnants", + resistances = + { + { + type = "fire", + percent = 100 + } + }, + collision_box = {{-0.65, -0.65}, {0.65, 0.65}}, + selection_box = {{-1, -1}, {1, 1}}, + drawing_box = {{-1, -3}, {1, 0.5}}, + maximum_wire_distance = 30, + supply_area_distance = 0, + vehicle_impact_sound = { filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65 }, + pictures = + { + filename = '__Localized_Charging__/graphics/entity/localized-charging-pole/powered.png', + priority = "high", + width = 168, + height = 165, + direction_count = 4, + shift = {1.6, -1.1} + }, + connection_points = + { + { + shadow = + { + copper = {2.7, 0}, + }, + wire = + { + copper = {0, -3.125}, + } + }, + { + shadow = + { + copper = {3.1, 0.2}, + }, + wire = + { + copper = {-0.0625, -3.125}, + } + }, + { + shadow = + { + copper = {2.9, 0.06}, + }, + wire = + { + copper = {-0.09375, -3.09375}, + } + }, + { + shadow = + { + copper = {3.1, 0.2}, + }, + wire = + { + copper = {-0.0625, -3.1875}, + } + } + }, + radius_visualisation_picture = + { + filename = "__base__/graphics/entity/small-electric-pole/electric-pole-radius-visualization.png", + width = 12, + height = 12, + priority = "extra-high-no-scale" + }, + }, + { + type = "electric-pole", + name = 'localized-charging-pole-2', + localised_name = {'entity-name.localized-charging-pole-2'}, + icon = "__Localized_Charging__/graphics/icons/localized-charging-pole.png", + flags = {"placeable-neutral", "player-creation"}, + minable = {hardness = 0.2, mining_time = 0.5, result = "localized-charging-pole-2"}, + max_health = 400, + corpse = "medium-remnants", + resistances = + { + { + type = "fire", + percent = 100 + } + }, + collision_box = {{-0.65, -0.65}, {0.65, 0.65}}, + selection_box = {{-1, -1}, {1, 1}}, + drawing_box = {{-1, -3}, {1, 0.5}}, + maximum_wire_distance = 30, + supply_area_distance = 0, + vehicle_impact_sound = { filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65 }, + pictures = + { + filename = '__Localized_Charging__/graphics/entity/localized-charging-pole/powered.png', + priority = "high", + width = 168, + height = 165, + direction_count = 4, + shift = {1.6, -1.1} + }, + connection_points = + { + { + shadow = + { + copper = {2.7, 0}, + }, + wire = + { + copper = {0, -3.125}, + } + }, + { + shadow = + { + copper = {3.1, 0.2}, + }, + wire = + { + copper = {-0.0625, -3.125}, + } + }, + { + shadow = + { + copper = {2.9, 0.06}, + }, + wire = + { + copper = {-0.09375, -3.09375}, + } + }, + { + shadow = + { + copper = {3.1, 0.2}, + }, + wire = + { + copper = {-0.0625, -3.1875}, + } + } + }, + radius_visualisation_picture = + { + filename = "__base__/graphics/entity/small-electric-pole/electric-pole-radius-visualization.png", + width = 12, + height = 12, + priority = "extra-high-no-scale" + }, + }, + { + type = "electric-pole", + name = 'localized-charging-pole-3', + localised_name = {'entity-name.localized-charging-pole-3'}, + icon = "__Localized_Charging__/graphics/icons/localized-charging-pole.png", + flags = {"placeable-neutral", "player-creation"}, + minable = {hardness = 0.2, mining_time = 0.5, result = "localized-charging-pole-3"}, + max_health = 400, + corpse = "medium-remnants", + resistances = + { + { + type = "fire", + percent = 100 + } + }, + collision_box = {{-0.65, -0.65}, {0.65, 0.65}}, + selection_box = {{-1, -1}, {1, 1}}, + drawing_box = {{-1, -3}, {1, 0.5}}, + maximum_wire_distance = 30, + supply_area_distance = 0, + vehicle_impact_sound = { filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65 }, + pictures = + { + filename = '__Localized_Charging__/graphics/entity/localized-charging-pole/powered.png', + priority = "high", + width = 168, + height = 165, + direction_count = 4, + shift = {1.6, -1.1} + }, + connection_points = + { + { + shadow = + { + copper = {2.7, 0}, + }, + wire = + { + copper = {0, -3.125}, + } + }, + { + shadow = + { + copper = {3.1, 0.2}, + }, + wire = + { + copper = {-0.0625, -3.125}, + } + }, + { + shadow = + { + copper = {2.9, 0.06}, + }, + wire = + { + copper = {-0.09375, -3.09375}, + } + }, + { + shadow = + { + copper = {3.1, 0.2}, + }, + wire = + { + copper = {-0.0625, -3.1875}, + } + } + }, + radius_visualisation_picture = + { + filename = "__base__/graphics/entity/small-electric-pole/electric-pole-radius-visualization.png", + width = 12, + height = 12, + priority = "extra-high-no-scale" + }, + }, + { + type = "electric-pole", + name = 'localized-charging-pole-4', + localised_name = {'entity-name.localized-charging-pole-4'}, icon = "__Localized_Charging__/graphics/icons/localized-charging-pole.png", flags = {"placeable-neutral", "player-creation"}, - minable = {hardness = 0.2, mining_time = 0.5, result = "localized-charging-pole"}, + minable = {hardness = 0.2, mining_time = 0.5, result = "localized-charging-pole-4"}, max_health = 400, corpse = "medium-remnants", resistances = @@ -141,4 +471,4 @@ data:extend({ priority = "extra-high-no-scale" }, }, -}) \ No newline at end of file +}) diff --git a/Localized_Charging_1.0.0/prototypes/items.lua b/Localized_Charging_1.0.0/prototypes/items.lua index 3f6299f..28e2074 100644 --- a/Localized_Charging_1.0.0/prototypes/items.lua +++ b/Localized_Charging_1.0.0/prototypes/items.lua @@ -3,13 +3,49 @@ require('volt_util') data:extend({ { type = "item", - name = "localized-charging-pole", - localised_name = {'entity-name.localized-charging-pole'}, + name = "localized-charging-pole-1", + localised_name = {'entity-name.localized-charging-pole-1'}, icon = "__Localized_Charging__/graphics/icons/localized-charging-pole.png", flags = {"goes-to-quickbar"}, subgroup = "energy-pipe-distribution", - order = "a[energy]-b[localized-charging-pole]", - place_result = "localized-charging-pole", + order = "a[energy]-z[localized-charging-pole-1]", + place_result = "localized-charging-pole-1", + stack_size = 10 + }, + + { + type = "item", + name = "localized-charging-pole-2", + localised_name = {'entity-name.localized-charging-pole-2'}, + icon = "__Localized_Charging__/graphics/icons/localized-charging-pole.png", + flags = {"goes-to-quickbar"}, + subgroup = "energy-pipe-distribution", + order = "a[energy]-z[localized-charging-pole-2]", + place_result = "localized-charging-pole-2", + stack_size = 10 + }, + + { + type = "item", + name = "localized-charging-pole-3", + localised_name = {'entity-name.localized-charging-pole-3'}, + icon = "__Localized_Charging__/graphics/icons/localized-charging-pole.png", + flags = {"goes-to-quickbar"}, + subgroup = "energy-pipe-distribution", + order = "a[energy]-z[localized-charging-pole-3]", + place_result = "localized-charging-pole-3", + stack_size = 10 + }, + + { + type = "item", + name = "localized-charging-pole-4", + localised_name = {'entity-name.localized-charging-pole-4'}, + icon = "__Localized_Charging__/graphics/icons/localized-charging-pole.png", + flags = {"goes-to-quickbar"}, + subgroup = "energy-pipe-distribution", + order = "a[energy]-z[localized-charging-pole-4]", + place_result = "localized-charging-pole-4", stack_size = 10 }, clone_existing_data(data.raw['item-with-entity-data']['diesel-locomotive'], { @@ -19,7 +55,7 @@ data:extend({ order = "a[train-system]-f[electric-locomotive]", place_result = "electric-locomotive", }), - + { type = "item", name = "test-battery-please-ignore", @@ -57,4 +93,4 @@ data:extend({ }, categories = {"armor"} }, -}) \ No newline at end of file +}) diff --git a/Localized_Charging_1.0.0/prototypes/recipes.lua b/Localized_Charging_1.0.0/prototypes/recipes.lua index 5f15d30..fdda83a 100644 --- a/Localized_Charging_1.0.0/prototypes/recipes.lua +++ b/Localized_Charging_1.0.0/prototypes/recipes.lua @@ -1,18 +1,66 @@ data:extend({ { type = "recipe", - name = "localized-charging-pole", - localised_name = {'entity-name.localized-charging-pole'}, + name = "localized-charging-pole-1", + localised_name = {'entity-name.localized-charging-pole-1'}, enabled = false, ingredients = { - {"advanced-circuit", 50}, - {"electronic-circuit", 125}, - {"iron-plate", 150}, - {"steel-plate", 30}, + {"advanced-circuit", 20}, + {"electronic-circuit", 40}, + {"iron-plate", 90}, + {"steel-plate", 15}, {"wood", 5}, - {"battery", 50}, + {"battery", 15}, }, - result = "localized-charging-pole", + result = "localized-charging-pole-1", + }, + + { + type = "recipe", + name = "localized-charging-pole-2", + localised_name = {'entity-name.localized-charging-pole-2'}, + enabled = false, + ingredients = { + {"advanced-circuit", 5}, + {"electronic-circuit", 20}, + {"iron-plate", 10}, + {"steel-plate", 5}, + {"battery", 5}, + {"localized-charging-pole-1", 1}, + }, + result = "localized-charging-pole-2", + }, + + { + type = "recipe", + name = "localized-charging-pole-3", + localised_name = {'entity-name.localized-charging-pole-3'}, + enabled = false, + ingredients = { + {"advanced-circuit", 10}, + {"electronic-circuit", 30}, + {"iron-plate", 20}, + {"steel-plate", 5}, + {"battery", 10}, + {"localized-charging-pole-2", 1}, + }, + result = "localized-charging-pole-3", + }, + + { + type = "recipe", + name = "localized-charging-pole-4", + localised_name = {'entity-name.localized-charging-pole-4'}, + enabled = false, + ingredients = { + {"advanced-circuit", 15}, + {"electronic-circuit", 35}, + {"iron-plate", 30}, + {"steel-plate", 5}, + {"battery", 20}, + {"localized-charging-pole-3", 1}, + }, + result = "localized-charging-pole-4", }, { type = "recipe", @@ -27,4 +75,4 @@ data:extend({ }, result = "electric-locomotive" }, -}) \ No newline at end of file +}) diff --git a/Localized_Charging_1.0.0/prototypes/technologies.lua b/Localized_Charging_1.0.0/prototypes/technologies.lua index 0ee861f..0b909dc 100644 --- a/Localized_Charging_1.0.0/prototypes/technologies.lua +++ b/Localized_Charging_1.0.0/prototypes/technologies.lua @@ -29,8 +29,20 @@ data:extend({ effects = { { type = "unlock-recipe", - recipe = "localized-charging-pole", - } + recipe = "localized-charging-pole-1", + }, + { + type = "unlock-recipe", + recipe = "localized-charging-pole-2", + }, + { + type = "unlock-recipe", + recipe = "localized-charging-pole-3", + }, + { + type = "unlock-recipe", + recipe = "localized-charging-pole-4", + }, }, prerequisites = {"electric-energy-distribution-2"}, unit = {