diff --git a/changelog.txt b/changelog.txt index 0bda332..1c3ebcd 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,10 @@ --------------------------------------------------------------------------------------------------- +Version: 0.18.1 +Date: 21. 2. 2020 + Changes: + - Merged Bob version (this one) with vanilla version + (will load tiered turrets, when bobplates is present) +--------------------------------------------------------------------------------------------------- Version: 0.18.0 Date: 18. 2. 2020 Changes: diff --git a/data.lua b/data.lua index 05f8b9d..fb04bfd 100644 --- a/data.lua +++ b/data.lua @@ -4,3 +4,27 @@ require("prototypes.entity") require("prototypes.item") require("prototypes.recipe") require("prototypes.technology") + +local bob_flag = data.raw.item["steel-gear-wheel"] and data.raw.item["steel-bearing"] and data.raw.item["invar-alloy"] and data.raw.item["titanium-plate"] and data.raw.item["titanium-gear-wheel"] and data.raw.item["nitinol-alloy"] and data.raw.item["nitinol-gear-wheel"] and data.raw.technology["invar-processing"] and data.raw.technology["titanium-processing"] and data.raw.technology["nitinol-processing"] +local adv_flag = data.raw.item["advanced-processing-unit"] + +if bob_flag then + -- if bobplates enabled, load tiered turrets + data:extend({ + entity1,item1,recipe1,tech1, + entity2,item2,recipe2,tech2, + entity3,item3,recipe3,tech3, + entity4,item4,recipe4,tech4, + entity5,item5,tech5 + }) + if adv_flag then + data:extend({recipe5_2}) + else + data:extend({recipe5_1}) + end +else + -- if not, load single boring gray turret + data:extend({ + entity0,item0,recipe0,tech0 + }) +end \ No newline at end of file diff --git a/graphics/entity/rocket-sheet.png b/graphics/entity/rocket-sheet.png new file mode 100644 index 0000000..68e1006 Binary files /dev/null and b/graphics/entity/rocket-sheet.png differ diff --git a/graphics/icon/turret-rocket-icon.png b/graphics/icon/turret-rocket-icon.png new file mode 100644 index 0000000..262dbde Binary files /dev/null and b/graphics/icon/turret-rocket-icon.png differ diff --git a/graphics/technology/rocket-turret.png b/graphics/technology/rocket-turret.png new file mode 100644 index 0000000..37c9afc Binary files /dev/null and b/graphics/technology/rocket-turret.png differ diff --git a/info.json b/info.json index 99b946a..1fd4c58 100644 --- a/info.json +++ b/info.json @@ -1,11 +1,11 @@ { "name": "Rocket_Turrets", - "version": "0.18.0", + "version": "0.18.1", "title": "RocketTurrets", "author": "Wyrrrd", "contact": "", "homepage": "", "factorio_version": "0.18", - "dependencies": ["base >= 0.18.0", "boblibrary >= 0.18.0", "bobplates >= 0.18.0", "bobelectronics >= 0.18.0"], + "dependencies": ["base >= 0.18.0", "? bobplates >= 0.18.1"], "description": "Adds rocket turrets" } \ No newline at end of file diff --git a/locale/de/locale.cfg b/locale/de/locale.cfg index 3b8247f..ed6450a 100644 --- a/locale/de/locale.cfg +++ b/locale/de/locale.cfg @@ -1,4 +1,5 @@ [item-name] +rocket-turret=Raketen-Geschützturm rocket-turret-mk1=Raketen-Geschützturm MK1 rocket-turret-mk2=Raketen-Geschützturm MK2 rocket-turret-mk3=Raketen-Geschützturm MK3 @@ -6,6 +7,7 @@ rocket-turret-mk4=Raketen-Geschützturm MK4 rocket-turret-mk5=Raketen-Geschützturm MK5 [entity-name] +rocket-turret=Raketen-Geschützturm rocket-turret-mk1=Raketen-Geschützturm MK1 rocket-turret-mk2=Raketen-Geschützturm MK2 rocket-turret-mk3=Raketen-Geschützturm MK3 @@ -13,6 +15,7 @@ rocket-turret-mk4=Raketen-Geschützturm MK4 rocket-turret-mk5=Raketen-Geschützturm MK5 [technology-name] +rocket-turret=Raketen-Geschützturm rocket-turret-mk1=Raketen-Geschützturm MK1 rocket-turret-mk2=Raketen-Geschützturm MK2 rocket-turret-mk3=Raketen-Geschützturm MK3 diff --git a/locale/en/locale.cfg b/locale/en/locale.cfg index e0ef8c0..e3ad5de 100644 --- a/locale/en/locale.cfg +++ b/locale/en/locale.cfg @@ -1,4 +1,5 @@ [item-name] +rocket-turret=Rocket turret rocket-turret-mk1=Rocket turret MK1 rocket-turret-mk2=Rocket turret MK2 rocket-turret-mk3=Rocket turret MK3 @@ -6,6 +7,7 @@ rocket-turret-mk4=Rocket turret MK4 rocket-turret-mk5=Rocket turret MK5 [entity-name] +rocket-turret=Rocket turret rocket-turret-mk1=Rocket turret MK1 rocket-turret-mk2=Rocket turret MK2 rocket-turret-mk3=Rocket turret MK3 @@ -13,6 +15,7 @@ rocket-turret-mk4=Rocket turret MK4 rocket-turret-mk5=Rocket turret MK5 [technology-name] +rocket-turret=Rocket turret rocket-turret-mk1=Rocket turret MK1 rocket-turret-mk2=Rocket turret MK2 rocket-turret-mk3=Rocket turret MK3 diff --git a/locale/pl/locale.cfg b/locale/pl/locale.cfg index 1d0e9e7..c4da11d 100644 --- a/locale/pl/locale.cfg +++ b/locale/pl/locale.cfg @@ -1,4 +1,5 @@ [item-name] +rocket-turret=Działko rakietowe rocket-turret-mk1=Działko rakietowe MK1 rocket-turret-mk2=Działko rakietowe MK2 rocket-turret-mk3=Działko rakietowe MK3 @@ -6,6 +7,7 @@ rocket-turret-mk4=Działko rakietowe MK4 rocket-turret-mk5=Działko rakietowe MK5 [entity-name] +rocket-turret=Działko rakietowe rocket-turret-mk1=Działko rakietowe MK1 rocket-turret-mk2=Działko rakietowe MK2 rocket-turret-mk3=Działko rakietowe MK3 @@ -13,6 +15,7 @@ rocket-turret-mk4=Działko rakietowe MK4 rocket-turret-mk5=Działko rakietowe MK5 [technology-name] +rocket-turret=Działko rakietowe rocket-turret-mk1=Działko rakietowe MK1 rocket-turret-mk2=Działko rakietowe MK2 rocket-turret-mk3=Działko rakietowe MK3 diff --git a/prototypes/entity.lua b/prototypes/entity.lua index a6aacf5..8c26f25 100644 --- a/prototypes/entity.lua +++ b/prototypes/entity.lua @@ -1,4 +1,28 @@ +-- Sheet definition + +function rocket_sheet(inputs) +return +{ + layers = + { + { + filename = "__Rocket_Turrets__/graphics/entity/rocket-sheet.png", + priority = "medium", + scale = 1, + width = 72, + height = 80, + direction_count = inputs.direction_count and inputs.direction_count or 64, + frame_count = 1, + line_length = inputs.line_length and inputs.line_length or 16, + axially_symmetrical = false, + run_mode = inputs.run_mode and inputs.run_mode or "forward", + shift = { 0.25, -0.5 }, + } + } +} +end + function rocket_mk1_sheet(inputs) return { @@ -179,8 +203,70 @@ return } end -data:extend({ -{ + +-- Entity definition + +entity0 = { + type = "ammo-turret", + name = "rocket-turret", + icon = "__Rocket_Turrets__/graphics/icon/turret-rocket-icon.png", + icon_size = 32, + flags = {"placeable-player", "player-creation"}, + minable = {mining_time = 0.7, result = "rocket-turret"}, + max_health = 400, + corpse = "small-remnants", + collision_box = {{-0.7, -0.7 }, {0.7, 0.7}}, + selection_box = {{-1, -1 }, {1, 1}}, + rotation_speed = 0.008, + preparing_speed = 0.04, + folding_speed = 0.04, + dying_explosion = "medium-explosion", + inventory_size = 1, + automated_ammo_count = 10, + attacking_speed = 0.09, + + folded_animation = rocket_sheet{direction_count = 4, line_length = 1}, + preparing_animation = rocket_sheet{direction_count = 4, line_length = 1}, + prepared_animation = rocket_sheet{}, + attacking_animation = rocket_sheet{}, + folding_animation = rocket_sheet{direction_count = 4, line_length = 1, run_mode = "backward"}, + + vehicle_impact_sound = { filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65 }, + + attack_parameters = + { + type = "projectile", + ammo_category = "rocket", + cooldown = 75, + projectile_creation_distance = 1.2, + projectile_center = {-0.15625, -0.07812}, + damage_modifier = 1, + shell_particle = + { + name = "shell-particle", + direction_deviation = 0.1, + speed = 0.1, + speed_deviation = 0.03, + center = {0, 0}, + creation_distance = -1.925, + starting_frame_speed = 0.2, + starting_frame_speed_deviation = 0.1 + }, + range = 35, + min_range = 15, + sound = + { + { + filename = "__base__/sound/fight/rocket-launcher.ogg", + volume = 0.8 + } + }, + }, + + call_for_help_radius = 40 +} + +entity1 = { type = "ammo-turret", name = "rocket-turret-mk1", icon = "__Rocket_Turrets__/graphics/icon/turret-rocket-mk1-icon.png", @@ -238,8 +324,9 @@ data:extend({ }, call_for_help_radius = 40 -}, -{ +} + +entity2 = { type = "ammo-turret", name = "rocket-turret-mk2", icon = "__Rocket_Turrets__/graphics/icon/turret-rocket-mk2-icon.png", @@ -297,8 +384,9 @@ data:extend({ }, call_for_help_radius = 40 -}, -{ +} + +entity3 = { type = "ammo-turret", name = "rocket-turret-mk3", icon = "__Rocket_Turrets__/graphics/icon/turret-rocket-mk3-icon.png", @@ -356,8 +444,9 @@ data:extend({ }, call_for_help_radius = 40 -}, -{ +} + +entity4 = { type = "ammo-turret", name = "rocket-turret-mk4", icon = "__Rocket_Turrets__/graphics/icon/turret-rocket-mk4-icon.png", @@ -415,8 +504,9 @@ data:extend({ }, call_for_help_radius = 40 -}, -{ +} + +entity5 = { type = "ammo-turret", name = "rocket-turret-mk5", icon = "__Rocket_Turrets__/graphics/icon/turret-rocket-mk5-icon.png", @@ -474,5 +564,4 @@ data:extend({ }, call_for_help_radius = 40 -}, -}) \ No newline at end of file +} \ No newline at end of file diff --git a/prototypes/item.lua b/prototypes/item.lua index 145c601..c5c7af1 100644 --- a/prototypes/item.lua +++ b/prototypes/item.lua @@ -1,6 +1,17 @@ --item -data:extend({ -{ + +item0 = { + type = "item", + name = "rocket-turret", + icon = "__Rocket_Turrets__/graphics/icon/turret-rocket-icon.png", + icon_size = 32, + subgroup = "defensive-structure", + order = "b[turret]-c[base]-d[rocket]", + place_result = "rocket-turret", + stack_size = 50, +} + +item1 = { type = "item", name = "rocket-turret-mk1", icon = "__Rocket_Turrets__/graphics/icon/turret-rocket-mk1-icon.png", @@ -9,8 +20,9 @@ data:extend({ order = "b[turret]-c[base]-d[rocket-mk1]", place_result = "rocket-turret-mk1", stack_size = 50, -}, -{ +} + +item2 = { type = "item", name = "rocket-turret-mk2", icon = "__Rocket_Turrets__/graphics/icon/turret-rocket-mk2-icon.png", @@ -19,8 +31,9 @@ data:extend({ order = "b[turret]-c[base]-d[rocket-mk2]", place_result = "rocket-turret-mk2", stack_size = 50, -}, -{ +} + +item3 = { type = "item", name = "rocket-turret-mk3", icon = "__Rocket_Turrets__/graphics/icon/turret-rocket-mk3-icon.png", @@ -29,8 +42,9 @@ data:extend({ order = "b[turret]-c[base]-d[rocket-mk3]", place_result = "rocket-turret-mk3", stack_size = 50, -}, -{ +} + +item4 = { type = "item", name = "rocket-turret-mk4", icon = "__Rocket_Turrets__/graphics/icon/turret-rocket-mk4-icon.png", @@ -39,8 +53,9 @@ data:extend({ order = "b[turret]-c[base]-d[rocket-mk4]", place_result = "rocket-turret-mk4", stack_size = 50, -}, -{ +} + +item5 = { type = "item", name = "rocket-turret-mk5", icon = "__Rocket_Turrets__/graphics/icon/turret-rocket-mk5-icon.png", @@ -49,5 +64,4 @@ data:extend({ order = "b[turret]-c[base]-d[rocket-mk5]", place_result = "rocket-turret-mk5", stack_size = 50, -}, -}) +} diff --git a/prototypes/recipe.lua b/prototypes/recipe.lua index dfa0786..32a4ee8 100644 --- a/prototypes/recipe.lua +++ b/prototypes/recipe.lua @@ -1,6 +1,21 @@ --recipe -data:extend({ -{ + +recipe0 = { + type = "recipe", + name = "rocket-turret", + enabled = false, + energy_required = 10, + ingredients = + { + {"rocket-launcher", 10}, + {"iron-gear-wheel", 5}, + {"steel-plate", 20}, + {"advanced-circuit", 15}, + }, + result = "rocket-turret", +} + +recipe1 = { type = "recipe", name = "rocket-turret-mk1", enabled = false, @@ -13,8 +28,9 @@ data:extend({ {"electronic-circuit", 15}, }, result = "rocket-turret-mk1", -}, -{ +} + +recipe2 = { type = "recipe", name = "rocket-turret-mk2", enabled = false, @@ -28,8 +44,9 @@ data:extend({ {"electronic-circuit", 5}, }, result = "rocket-turret-mk2", -}, -{ +} + +recipe3 = { type = "recipe", name = "rocket-turret-mk3", enabled = false, @@ -42,8 +59,9 @@ data:extend({ {"advanced-circuit", 20}, }, result = "rocket-turret-mk3", -}, -{ +} + +recipe4 = { type = "recipe", name = "rocket-turret-mk4", enabled = false, @@ -56,8 +74,9 @@ data:extend({ {"processing-unit", 20}, }, result = "rocket-turret-mk4", -}, -{ +} + +recipe5_1 = { type = "recipe", name = "rocket-turret-mk5", enabled = false, @@ -70,14 +89,19 @@ data:extend({ {"processing-unit", 20}, }, result = "rocket-turret-mk5", -}, -}) +} -if data.raw.item["advanced-processing-unit"] then - data.raw.recipe["rocket-turret-mk5"].ingredients = { +recipe5_2 = { + type = "recipe", + name = "rocket-turret-mk5", + enabled = false, + energy_required = 10, + ingredients = + { {"rocket-turret-mk4", 1}, {"nitinol-gear-wheel", 10}, {"nitinol-alloy", 20}, {"advanced-processing-unit", 20}, -} -end \ No newline at end of file + }, + result = "rocket-turret-mk5", +} \ No newline at end of file diff --git a/prototypes/technology.lua b/prototypes/technology.lua index d644777..cefa365 100644 --- a/prototypes/technology.lua +++ b/prototypes/technology.lua @@ -1,157 +1,190 @@ -data:extend( -{ +tech0 = { + type = "technology", + name = "rocket-turret", + icon = "__Rocket_Turrets__/graphics/technology/rocket-turret.png", + icon_size = 128, + effects = { - type = "technology", - name = "rocket-turret-mk1", - icon = "__Rocket_Turrets__/graphics/technology/rocket-turret-mk1.png", - icon_size = 128, - effects = { - { - type = "unlock-recipe", - recipe = "rocket-turret-mk1", - }, + type = "unlock-recipe", + recipe = "rocket-turret", }, - prerequisites = - { - "rocketry", - "turrets", - "steel-processing", - }, - unit = - { - count = 75, - ingredients = - { - {"automation-science-pack", 1}, - {"logistic-science-pack", 1}, - {"military-science-pack", 1}, - }, - time = 20 - }, - order = "c-a" }, + prerequisites = { - type = "technology", - name = "rocket-turret-mk2", - icon = "__Rocket_Turrets__/graphics/technology/rocket-turret-mk2.png", - icon_size = 128, - effects = - { - { - type = "unlock-recipe", - recipe = "rocket-turret-mk2", - }, - }, - prerequisites = - { - "rocket-turret-mk1", - }, - unit = - { - count = 75, - ingredients = - { - {"automation-science-pack", 1}, - {"logistic-science-pack", 1}, - {"chemical-science-pack", 1}, - {"military-science-pack", 1}, - }, - time = 20 - }, - order = "c-a" + "rocketry", + "turrets", + "steel-processing", }, + unit = { - type = "technology", - name = "rocket-turret-mk3", - icon = "__Rocket_Turrets__/graphics/technology/rocket-turret-mk3.png", - icon_size = 128, - effects = + count = 75, + ingredients = { - { - type = "unlock-recipe", - recipe = "rocket-turret-mk3", - }, + {"automation-science-pack", 1}, + {"logistic-science-pack", 1}, + {"military-science-pack", 1}, }, - prerequisites = - { - "rocket-turret-mk2", - "invar-processing", - }, - unit = - { - count = 100, - ingredients = - { - {"automation-science-pack", 1}, - {"logistic-science-pack", 1}, - {"chemical-science-pack", 1}, - {"production-science-pack", 1} - }, - time = 30 - }, - order = "c-a" + time = 20 }, + order = "c-a" +} + +tech1 = { + type = "technology", + name = "rocket-turret-mk1", + icon = "__Rocket_Turrets__/graphics/technology/rocket-turret-mk1.png", + icon_size = 128, + effects = { - type = "technology", - name = "rocket-turret-mk4", - icon = "__Rocket_Turrets__/graphics/technology/rocket-turret-mk4.png", - icon_size = 128, - effects = { - { - type = "unlock-recipe", - recipe = "rocket-turret-mk4", - }, + type = "unlock-recipe", + recipe = "rocket-turret-mk1", }, - prerequisites = - { - "rocket-turret-mk3", - "titanium-processing", - }, - unit = - { - count = 100, - ingredients = - { - {"automation-science-pack", 1}, - {"logistic-science-pack", 1}, - {"chemical-science-pack", 1}, - {"production-science-pack", 1} - }, - time = 30 - }, - order = "c-a" }, + prerequisites = { - type = "technology", - name = "rocket-turret-mk5", - icon = "__Rocket_Turrets__/graphics/technology/rocket-turret-mk5.png", - icon_size = 128, - effects = - { - { - type = "unlock-recipe", - recipe = "rocket-turret-mk5", - }, - }, - prerequisites = - { - "rocket-turret-mk4", - "nitinol-processing", - }, - unit = - { - count = 125, - ingredients = - { - {"automation-science-pack", 1}, - {"logistic-science-pack", 1}, - {"chemical-science-pack", 1}, - {"production-science-pack", 1}, - }, - time = 30 - }, - order = "c-a" + "rocketry", + "turrets", + "steel-processing", }, -}) + unit = + { + count = 75, + ingredients = + { + {"automation-science-pack", 1}, + {"logistic-science-pack", 1}, + {"military-science-pack", 1}, + }, + time = 20 + }, + order = "c-a" +} + +tech2 = { + type = "technology", + name = "rocket-turret-mk2", + icon = "__Rocket_Turrets__/graphics/technology/rocket-turret-mk2.png", + icon_size = 128, + effects = + { + { + type = "unlock-recipe", + recipe = "rocket-turret-mk2", + }, + }, + prerequisites = + { + "rocket-turret-mk1", + }, + unit = + { + count = 75, + ingredients = + { + {"automation-science-pack", 1}, + {"logistic-science-pack", 1}, + {"chemical-science-pack", 1}, + {"military-science-pack", 1}, + }, + time = 20 + }, + order = "c-a" +} + +tech3 = { + type = "technology", + name = "rocket-turret-mk3", + icon = "__Rocket_Turrets__/graphics/technology/rocket-turret-mk3.png", + icon_size = 128, + effects = + { + { + type = "unlock-recipe", + recipe = "rocket-turret-mk3", + }, + }, + prerequisites = + { + "rocket-turret-mk2", + "invar-processing", + }, + unit = + { + count = 100, + ingredients = + { + {"automation-science-pack", 1}, + {"logistic-science-pack", 1}, + {"chemical-science-pack", 1}, + {"production-science-pack", 1} + }, + time = 30 + }, + order = "c-a" +} + +tech4 = { + type = "technology", + name = "rocket-turret-mk4", + icon = "__Rocket_Turrets__/graphics/technology/rocket-turret-mk4.png", + icon_size = 128, + effects = + { + { + type = "unlock-recipe", + recipe = "rocket-turret-mk4", + }, + }, + prerequisites = + { + "rocket-turret-mk3", + "titanium-processing", + }, + unit = + { + count = 100, + ingredients = + { + {"automation-science-pack", 1}, + {"logistic-science-pack", 1}, + {"chemical-science-pack", 1}, + {"production-science-pack", 1} + }, + time = 30 + }, + order = "c-a" +} + +tech5 = { + type = "technology", + name = "rocket-turret-mk5", + icon = "__Rocket_Turrets__/graphics/technology/rocket-turret-mk5.png", + icon_size = 128, + effects = + { + { + type = "unlock-recipe", + recipe = "rocket-turret-mk5", + }, + }, + prerequisites = + { + "rocket-turret-mk4", + "nitinol-processing", + }, + unit = + { + count = 125, + ingredients = + { + {"automation-science-pack", 1}, + {"logistic-science-pack", 1}, + {"chemical-science-pack", 1}, + {"production-science-pack", 1}, + }, + time = 30 + }, + order = "c-a" +} \ No newline at end of file