diff --git a/data.lua b/data.lua index c2e2321..4a25453 100644 --- a/data.lua +++ b/data.lua @@ -72,6 +72,7 @@ require('prototypes/gravitation/gr_lab') require('prototypes/248k_fluids') require('prototypes/248k_elements') +require('prototypes/grenades') require('prototypes/248k_subgroups') diff --git a/locale/en/lang_en.cfg b/locale/en/lang_en.cfg index 7d247b2..7b93841 100644 --- a/locale/en/lang_en.cfg +++ b/locale/en/lang_en.cfg @@ -174,6 +174,10 @@ gr_materials_stacked_data_item=Stacked deep data gr_materials_charge_remote=Ultimate bug zapper remote +el_grenade=Charged grenade +fi_grenade=Overcharged grenade +fu_grenade=Hypercharged grenade + #overhaul uranium-fuel-cell-updated=Uranium fuel cell (old) @@ -571,7 +575,9 @@ gr_circuit_tech=High-end circuits gr_plasma_cube_tech=Plasma containers gr_magnet_tech=High-end magnets - +el_grenade_tech=Charged grenades +fi_grenade_tech=Overcharged grenades +fu_grenade_tech=Hypercharged grenades #effects [description] diff --git a/prototypes/248k_techs.lua b/prototypes/248k_techs.lua index 29e3479..7f450cc 100644 --- a/prototypes/248k_techs.lua +++ b/prototypes/248k_techs.lua @@ -906,6 +906,27 @@ data:extend({ time = 30, }, }, + { + name = 'el_grenade_tech', + type = 'technology', + icon = sprite('el_grenade_tech.png'), + icon_size = 128, + prerequisites = {'el_charger_tech'}, + effects = { + { + type = 'unlock-recipe', + recipe = 'el_grenade_recipe', + }, + }, + unit = { + count = '50', + ingredients = { + {'automation-science-pack',1}, + {'logistic-science-pack',1}, + }, + time = 30, + }, + }, --============================================================================================================================================================ --fi @@ -1780,6 +1801,28 @@ data:extend({ time = 30, }, }, + { + name = 'fi_grenade_tech', + type = 'technology', + icon = sprite('fi_grenade_tech.png'), + icon_size = 128, + prerequisites = {'fi_crystal_tech'}, + effects = { + { + type = 'unlock-recipe', + recipe = 'fi_grenade_recipe', + }, + }, + unit = { + count = '100', + ingredients = { + {'chemical-science-pack',1}, + {'automation-science-pack',1}, + {'logistic-science-pack',1,}, + }, + time = 30, + }, + }, --============================================================================================================================================================ --fu { @@ -2816,6 +2859,29 @@ data:extend({ time = 100, }, }, + { + name = 'fu_grenade_tech', + type = 'technology', + icon = sprite('fu_grenade_tech.png'), + icon_size = 128, + prerequisites = {'fu_crystal_tech'}, + effects = { + { + type = 'unlock-recipe', + recipe = 'fu_grenade_recipe', + }, + }, + unit = { + count = '200', + ingredients = { + {'chemical-science-pack',1}, + {'automation-science-pack',1}, + {'logistic-science-pack',1}, + {'utility-science-pack',1} + }, + time = 100, + }, + }, --============================================================================================================================================================ --gravitational { diff --git a/prototypes/el_recipes.lua b/prototypes/el_recipes.lua index ae79e28..3b1ad93 100644 --- a/prototypes/el_recipes.lua +++ b/prototypes/el_recipes.lua @@ -1462,7 +1462,22 @@ data:extend({ energy_required = 2, always_show_made_in = true, }, - + { + name = 'el_grenade_recipe', + type = 'recipe', + enabled = 'false', + category = 'crafting', + main_product = 'el_grenade', + ingredients = { + {type="item", name="el_energy_crystal_charged_item", amount=1}, + {type="item", name="grenade", amount=1}, + }, + results = { + {type="item", name="el_grenade", amount=1}, + }, + result_count = 1, + energy_required = 4, + }, }) diff --git a/prototypes/electronic/el_energy_crystal.lua b/prototypes/electronic/el_energy_crystal.lua index ec06472..6ce7e20 100644 --- a/prototypes/electronic/el_energy_crystal.lua +++ b/prototypes/electronic/el_energy_crystal.lua @@ -7,6 +7,35 @@ local function sprite(name) return '__248k__/ressources/electronic/el_energy_crystal/el_energy_crystal_'..name end +throw_projectile = +{ + { + filename = "__base__/sound/fight/throw-projectile-1.ogg", + volume = 0.4 + }, + { + filename = "__base__/sound/fight/throw-projectile-2.ogg", + volume = 0.4 + }, + { + filename = "__base__/sound/fight/throw-projectile-3.ogg", + volume = 0.4 + }, + { + filename = "__base__/sound/fight/throw-projectile-4.ogg", + volume = 0.4 + }, + { + filename = "__base__/sound/fight/throw-projectile-5.ogg", + volume = 0.4 + }, + { + filename = "__base__/sound/fight/throw-projectile-6.ogg", + volume = 0.4 + } + +} + --item data:extend({ { @@ -39,5 +68,5 @@ data:extend({ fuel_top_speed_multiplier = 1, fuel_value = '20MJ', burnt_result = 'el_energy_crystal_item', - }, + } }) \ No newline at end of file diff --git a/prototypes/fi_recipes.lua b/prototypes/fi_recipes.lua index f4448f9..985dc04 100644 --- a/prototypes/fi_recipes.lua +++ b/prototypes/fi_recipes.lua @@ -1441,4 +1441,20 @@ data:extend({ subgroup = 'el_item_subgroup_a', order = 'a-c', }, + { + name = 'fi_grenade_recipe', + type = 'recipe', + enabled = 'false', + category = 'crafting', + main_product = 'fi_grenade', + ingredients = { + {type="item", name="fi_energy_crystal_charged_item", amount=1}, + {type="item", name="grenade", amount=1}, + }, + results = { + {type="item", name="fi_grenade", amount=1}, + }, + result_count = 1, + energy_required = 4, + }, }) \ No newline at end of file diff --git a/prototypes/fu_recipes.lua b/prototypes/fu_recipes.lua index 3a96fed..c1c11f7 100644 --- a/prototypes/fu_recipes.lua +++ b/prototypes/fu_recipes.lua @@ -1875,4 +1875,20 @@ data:extend({ subgroup = 'fu_item_subgroup_e', order = 'a-b-d', }, + { + name = 'fu_grenade_recipe', + type = 'recipe', + enabled = 'false', + category = 'crafting', + main_product = 'fu_grenade', + ingredients = { + {type="item", name="fu_materials_energy_charged_crystal", amount=1}, + {type="item", name="grenade", amount=1}, + }, + results = { + {type="item", name="fu_grenade", amount=1}, + }, + result_count = 1, + energy_required = 4, + }, }) \ No newline at end of file diff --git a/prototypes/grenades.lua b/prototypes/grenades.lua new file mode 100644 index 0000000..5d1c87d --- /dev/null +++ b/prototypes/grenades.lua @@ -0,0 +1,246 @@ +local function sprite(name) + return '__248k__/ressources/grenade/'..name +end + +local el_explosion = table.deepcopy(data.raw['explosion']['grenade-explosion']) +el_explosion.name = 'el_grenade-explosion' +local el_grenade = table.deepcopy(data.raw['projectile']['grenade']) +el_grenade.name = 'el_grenade' + +el_grenade.action = { + { + type = 'direct', + action_delivery = { + type = 'instant', + target_effects = { + { + type = 'create-entity', + entity_name = 'el_grenade-explosion', + trigger_created_entity = true + } + } + } + }, + ---note here + { + type = 'cluster', + cluster_count = 16, + distance = 7.5, + distance_deviation = 1, + action_delivery = { + { + type = 'beam', + add_to_shooter = false, + duration = 15, + beam = 'electric-beam-no-sound', + max_length = 16, + source_offset = {0, -0.5} + } + } + }, + { + type = 'area', + radius = 7.5, + force = 'not-same', + action_delivery = { + { + type = 'instant', + target_effects = { + { + type = 'damage', + damage = { + amount = 40, + type = 'explosion' + } + }, + { + type = 'create-sticker', + sticker = 'stun-sticker' + }, + { + type = "push-back", + distance = 4 + } + } + } + } + } +} +local el_capsule = table.deepcopy(data.raw['capsule']['grenade']) +el_capsule.name = 'el_grenade' +el_capsule.icon_size = 64 +el_capsule.icon = sprite("el_grenade.png") + +el_capsule.capsule_action.attack_parameters.ammo_type.action[3] = { + type = "direct", + action_delivery = + { + type = "projectile", + projectile = "el_grenade", + starting_speed = 0.3 + } +} + +data:extend{el_explosion, el_grenade, el_capsule} + +local fi_explosion = table.deepcopy(data.raw['explosion']['grenade-explosion']) +fi_explosion.name = 'fi_grenade-explosion' +local fi_grenade = table.deepcopy(data.raw['projectile']['grenade']) +fi_grenade.name = 'fi_grenade' + +fi_grenade.action = { + { + type = 'direct', + action_delivery = { + type = 'instant', + target_effects = { + { + type = 'create-entity', + entity_name = 'fi_grenade-explosion', + trigger_created_entity = true + } + } + } + }, + ---note here + { + type = 'cluster', + cluster_count = 24, + distance = 9, + distance_deviation = 1, + action_delivery = { + { + type = 'beam', + add_to_shooter = false, + duration = 15, + beam = 'electric-beam-no-sound', + max_length = 16, + source_offset = {0, -0.5} + } + } + }, + { + type = 'area', + radius = 9, + force = 'not-same', + action_delivery = { + { + type = 'instant', + target_effects = { + { + type = 'damage', + damage = { + amount = 200, + type = 'explosion' + } + }, + { + type = 'create-sticker', + sticker = 'stun-sticker' + }, + { + type = "push-back", + distance = 4 + } + } + } + } + } + } + local fi_capsule = table.deepcopy(data.raw['capsule']['grenade']) + fi_capsule.name = 'fi_grenade' + fi_capsule.icon_size = 64 + fi_capsule.icon = sprite("fi_grenade.png") + + fi_capsule.capsule_action.attack_parameters.ammo_type.action[3] = { + type = "direct", + action_delivery = + { + type = "projectile", + projectile = "fi_grenade", + starting_speed = 0.3 + } + } + +data:extend{fi_explosion, fi_grenade, fi_capsule} + +local fu_explosion = table.deepcopy(data.raw['explosion']['grenade-explosion']) +fu_explosion.name = 'fu_grenade-explosion' +local fu_grenade = table.deepcopy(data.raw['projectile']['grenade']) +fu_grenade.name = 'fu_grenade' + +fu_grenade.action = { + { + type = 'direct', + action_delivery = { + type = 'instant', + target_effects = { + { + type = 'create-entity', + entity_name = 'fu_grenade-explosion', + trigger_created_entity = true + } + } + } + }, + ---note here + { + type = 'cluster', + cluster_count = 32, + distance = 12, + distance_deviation = 1, + action_delivery = { + { + type = 'beam', + add_to_shooter = false, + duration = 15, + beam = 'electric-beam-no-sound', + max_length = 16, + source_offset = {0, -0.5} + } + } + }, + { + type = 'area', + radius = 12, + force = 'not-same', + action_delivery = { + { + type = 'instant', + target_effects = { + { + type = 'damage', + damage = { + amount = 1000, + type = 'explosion' + } + }, + { + type = 'create-sticker', + sticker = 'stun-sticker' + }, + { + type = "push-back", + distance = 6 + } + } + } + } + } + } + local fu_capsule = table.deepcopy(data.raw['capsule']['grenade']) + fu_capsule.name = 'fu_grenade' + fu_capsule.icon_size = 64 + fu_capsule.icon = sprite("fu_grenade.png") + + fu_capsule.capsule_action.attack_parameters.ammo_type.action[3] = { + type = "direct", + action_delivery = + { + type = "projectile", + projectile = "fu_grenade", + starting_speed = 0.3 + } + } + + data:extend{fu_explosion, fu_grenade, fu_capsule} \ No newline at end of file diff --git a/ressources/grenade/el_grenade.png b/ressources/grenade/el_grenade.png new file mode 100644 index 0000000..58c74a9 Binary files /dev/null and b/ressources/grenade/el_grenade.png differ diff --git a/ressources/grenade/fi_grenade.png b/ressources/grenade/fi_grenade.png new file mode 100644 index 0000000..0b27af8 Binary files /dev/null and b/ressources/grenade/fi_grenade.png differ diff --git a/ressources/grenade/fu_grenade.png b/ressources/grenade/fu_grenade.png new file mode 100644 index 0000000..633b99a Binary files /dev/null and b/ressources/grenade/fu_grenade.png differ diff --git a/ressources/techs/el_grenade_tech.png b/ressources/techs/el_grenade_tech.png new file mode 100644 index 0000000..c0a699a Binary files /dev/null and b/ressources/techs/el_grenade_tech.png differ diff --git a/ressources/techs/fi_grenade_tech.png b/ressources/techs/fi_grenade_tech.png new file mode 100644 index 0000000..fdd3081 Binary files /dev/null and b/ressources/techs/fi_grenade_tech.png differ diff --git a/ressources/techs/fu_grenade_tech.png b/ressources/techs/fu_grenade_tech.png new file mode 100644 index 0000000..1aa8d2f Binary files /dev/null and b/ressources/techs/fu_grenade_tech.png differ