require ("prototypes.entity.demo-spitter-projectiles") require ("prototypes.entity.demo-worm-animations") require ("prototypes.entity.demo-enemy-sounds") require ("prototypes.entity.demo-gunshot-sounds") enemy_autoplace = require ("prototypes.entity.demo-enemy-autoplace-utils") function gun_turret_extension(inputs) return { filename = "__base__/graphics/entity/gun-turret/gun-turret-raising.png", priority = "medium", width = 66, height = 64, direction_count = 4, frame_count = inputs.frame_count or 5, line_length = inputs.line_length or 0, run_mode = inputs.run_mode or "forward", shift = util.by_pixel(0, -26), axially_symmetrical = false, hr_version = { filename = "__base__/graphics/entity/gun-turret/hr-gun-turret-raising.png", priority = "medium", width = 130, height = 126, direction_count = 4, frame_count = inputs.frame_count or 5, line_length = inputs.line_length or 0, run_mode = inputs.run_mode or "forward", shift = util.by_pixel(0, -26.5), axially_symmetrical = false, scale = 0.5 } } end function gun_turret_extension_mask(inputs) return { filename = "__base__/graphics/entity/gun-turret/gun-turret-raising-mask.png", flags = { "mask" }, width = 24, height = 32, direction_count = 4, frame_count = inputs.frame_count or 5, line_length = inputs.line_length or 0, run_mode = inputs.run_mode or "forward", shift = util.by_pixel(0, -28), axially_symmetrical = false, apply_runtime_tint = true, hr_version = { filename = "__base__/graphics/entity/gun-turret/hr-gun-turret-raising-mask.png", flags = { "mask" }, width = 48, height = 62, direction_count = 4, frame_count = inputs.frame_count or 5, line_length = inputs.line_length or 0, run_mode = inputs.run_mode or "forward", shift = util.by_pixel(0, -28), axially_symmetrical = false, apply_runtime_tint = true, scale = 0.5 } } end function gun_turret_extension_shadow(inputs) return { filename = "__base__/graphics/entity/gun-turret/gun-turret-raising-shadow.png", width = 126, height = 62, direction_count = 4, frame_count = inputs.frame_count or 5, line_length = inputs.line_length or 0, run_mode = inputs.run_mode or "forward", shift = util.by_pixel(19, 2), axially_symmetrical = false, draw_as_shadow = true, hr_version = { filename = "__base__/graphics/entity/gun-turret/hr-gun-turret-raising-shadow.png", width = 250, height = 124, direction_count = 4, frame_count = inputs.frame_count or 5, line_length = inputs.line_length or 0, run_mode = inputs.run_mode or "forward", shift = util.by_pixel(19, 2.5), axially_symmetrical = false, draw_as_shadow = true, scale = 0.5 } } end function gun_turret_attack(inputs) return { layers = { { width = 66, height = 66, frame_count = inputs.frame_count or 2, axially_symmetrical = false, direction_count = 64, shift = util.by_pixel(0, -27), stripes = { { filename = "__base__/graphics/entity/gun-turret/gun-turret-shooting-1.png", width_in_frames = inputs.frame_count or 2, height_in_frames = 16 }, { filename = "__base__/graphics/entity/gun-turret/gun-turret-shooting-2.png", width_in_frames = inputs.frame_count or 2, height_in_frames = 16 }, { filename = "__base__/graphics/entity/gun-turret/gun-turret-shooting-3.png", width_in_frames = inputs.frame_count or 2, height_in_frames = 16 }, { filename = "__base__/graphics/entity/gun-turret/gun-turret-shooting-4.png", width_in_frames = inputs.frame_count or 2, height_in_frames = 16 } }, hr_version = { width = 132, height = 130, frame_count = inputs.frame_count and inputs.frame_count or 2, axially_symmetrical = false, direction_count = 64, shift = util.by_pixel(0, -27.5), stripes = { { filename = "__base__/graphics/entity/gun-turret/hr-gun-turret-shooting-1.png", width_in_frames = inputs.frame_count or 2, height_in_frames = 16 }, { filename = "__base__/graphics/entity/gun-turret/hr-gun-turret-shooting-2.png", width_in_frames = inputs.frame_count or 2, height_in_frames = 16 }, { filename = "__base__/graphics/entity/gun-turret/hr-gun-turret-shooting-3.png", width_in_frames = inputs.frame_count or 2, height_in_frames = 16 }, { filename = "__base__/graphics/entity/gun-turret/hr-gun-turret-shooting-4.png", width_in_frames = inputs.frame_count or 2, height_in_frames = 16 } }, scale = 0.5 } }, { flags = { "mask" }, line_length = inputs.frame_count or 2, width = 30, height = 28, frame_count = inputs.frame_count or 2, axially_symmetrical = false, direction_count = 64, shift = util.by_pixel(0, -32), apply_runtime_tint = true, stripes = { { filename = "__base__/graphics/entity/gun-turret/gun-turret-shooting-mask-1.png", width_in_frames = inputs.frame_count or 2, height_in_frames = 16 }, { filename = "__base__/graphics/entity/gun-turret/gun-turret-shooting-mask-2.png", width_in_frames = inputs.frame_count or 2, height_in_frames = 16 }, { filename = "__base__/graphics/entity/gun-turret/gun-turret-shooting-mask-3.png", width_in_frames = inputs.frame_count or 2, height_in_frames = 16 }, { filename = "__base__/graphics/entity/gun-turret/gun-turret-shooting-mask-4.png", width_in_frames = inputs.frame_count or 2, height_in_frames = 16 } }, hr_version = { flags = { "mask" }, line_length = inputs.frame_count or 2, width = 58, height = 54, frame_count = inputs.frame_count or 2, axially_symmetrical = false, direction_count = 64, shift = util.by_pixel(0, -32.5), apply_runtime_tint = true, stripes = { { filename = "__base__/graphics/entity/gun-turret/hr-gun-turret-shooting-mask-1.png", width_in_frames = inputs.frame_count and inputs.frame_count or 2, height_in_frames = 16 }, { filename = "__base__/graphics/entity/gun-turret/hr-gun-turret-shooting-mask-2.png", width_in_frames = inputs.frame_count and inputs.frame_count or 2, height_in_frames = 16 }, { filename = "__base__/graphics/entity/gun-turret/hr-gun-turret-shooting-mask-3.png", width_in_frames = inputs.frame_count and inputs.frame_count or 2, height_in_frames = 16 }, { filename = "__base__/graphics/entity/gun-turret/hr-gun-turret-shooting-mask-4.png", width_in_frames = inputs.frame_count and inputs.frame_count or 2, height_in_frames = 16 } }, scale = 0.5 } }, { width = 126, height = 62, frame_count = inputs.frame_count and inputs.frame_count or 2, axially_symmetrical = false, direction_count = 64, shift = util.by_pixel(23, 2), draw_as_shadow = true, stripes = { { filename = "__base__/graphics/entity/gun-turret/gun-turret-shooting-shadow-1.png", width_in_frames = inputs.frame_count or 2, height_in_frames = 16 }, { filename = "__base__/graphics/entity/gun-turret/gun-turret-shooting-shadow-2.png", width_in_frames = inputs.frame_count or 2, height_in_frames = 16 }, { filename = "__base__/graphics/entity/gun-turret/gun-turret-shooting-shadow-3.png", width_in_frames = inputs.frame_count or 2, height_in_frames = 16 }, { filename = "__base__/graphics/entity/gun-turret/gun-turret-shooting-shadow-4.png", width_in_frames = inputs.frame_count or 2, height_in_frames = 16 } }, hr_version = { width = 250, height = 124, frame_count = inputs.frame_count and inputs.frame_count or 2, axially_symmetrical = false, direction_count = 64, shift = util.by_pixel(22, 2.5), draw_as_shadow = true, stripes = { { filename = "__base__/graphics/entity/gun-turret/hr-gun-turret-shooting-shadow-1.png", width_in_frames = inputs.frame_count and inputs.frame_count or 2, height_in_frames = 16 }, { filename = "__base__/graphics/entity/gun-turret/hr-gun-turret-shooting-shadow-2.png", width_in_frames = inputs.frame_count and inputs.frame_count or 2, height_in_frames = 16 }, { filename = "__base__/graphics/entity/gun-turret/hr-gun-turret-shooting-shadow-3.png", width_in_frames = inputs.frame_count and inputs.frame_count or 2, height_in_frames = 16 }, { filename = "__base__/graphics/entity/gun-turret/hr-gun-turret-shooting-shadow-4.png", width_in_frames = inputs.frame_count and inputs.frame_count or 2, height_in_frames = 16 } }, scale = 0.5 } } } } end function shift_small_worm(shiftx, shifty) return {shiftx - 0.1, shifty + 0.1} end data:extend( { { type = "turret", name = "small-worm-turret", icon = "__base__/graphics/icons/small-worm.png", icon_size = 32, flags = {"placeable-enemy", "placeable-off-grid", "not-repairable", "breaths-air"}, order="b-b-d", max_health = 200, subgroup="enemies", resistances = { { type = "acid", percent = 100 } }, healing_per_tick = 0.01, collision_box = {{-0.9, -0.8 }, {0.9, 0.8}}, map_generator_bounding_box = {{-1.9, -1.8}, {1.9, 1.8}}, selection_box = {{-0.9, -0.8 }, {0.9, 0.8}}, shooting_cursor_size = 3, corpse = "small-worm-corpse", dying_explosion = "blood-explosion-big", dying_sound = make_worm_dying_small_sounds(0.8), folded_speed = 0.01, folded_speed_secondary = 0.024, folded_animation = worm_folded_animation(scale_worm_small, tint_worm_small), preparing_speed = 0.024, preparing_animation = worm_preparing_animation(scale_worm_small, tint_worm_small, "forward"), preparing_sound = make_worm_standup_small_sounds(1), prepared_speed = 0.024, prepared_speed_secondary = 0.012, prepared_sound = make_worm_breath(0.8), prepared_animation = worm_prepared_animation(scale_worm_small, tint_worm_small), prepared_alternative_speed = 0.024, prepared_alternative_speed_secondary = 0.018, prepared_alternative_chance = 0.2, prepared_alternative_animation = worm_prepared_alternative_animation(scale_worm_small, tint_worm_small), prepared_alternative_sound = make_worm_roar_alternative(0.8), starting_attack_speed = 0.034, starting_attack_animation = worm_start_attack_animation(scale_worm_small, tint_worm_small), starting_attack_sound = make_worm_roars(0.75), ending_attack_speed = 0.016, ending_attack_animation = worm_end_attack_animation(scale_worm_small, tint_worm_small), folding_speed = 0.015, folding_animation = worm_preparing_animation(scale_worm_small, tint_worm_small, "backward"), folding_sound = make_worm_fold_sounds(1), secondary_animation = true, random_animation_offset = true, attack_from_start_frame = true, integration = worm_integration(scale_worm_small), prepare_range = range_worm_small + prepare_range_worm_small, allow_turning_when_starting_attack = true, attack_parameters = { type = "stream", cooldown = 4, range = range_worm_small,--defined in demo-spitter-projectiles.lua damage_modifier = damage_modifier_worm_small,--defined in demo-spitter-projectiles.lua min_range = 0, projectile_creation_parameters = worm_shoot_shiftings(scale_worm_small, scale_worm_small * scale_worm_stream), use_shooter_direction = true, lead_target_for_projectile_speed = 0.2* 0.75 * 1.5 *1.5, -- this is same as particle horizontal speed of flamethrower fire stream ammo_type = { category = "biological", action = { type = "direct", action_delivery = { type = "stream", stream = "acid-stream-worm-small", duration = 160, source_offset = {0.15, -0.5} } } }, cyclic_sound = { begin_sound = { { filename = "__base__/sound/fight/flamethrower-start.ogg", volume = 0.7 } }, middle_sound = { { filename = "__base__/sound/fight/flamethrower-mid.ogg", volume = 0.7 } }, end_sound = { { filename = "__base__/sound/fight/flamethrower-end.ogg", volume = 0.7 } } } }, --{ -- type = "stream", -- ammo_category = "bullet", -- cooldown = 15, -- range = 21, -- projectile_creation_parameters = worm_shoot_shiftings(scale_worm_small), -- use_shooter_direction = true, -- damage_modifier = 2.5, -- ammo_type = -- { -- category = "biological", -- action = -- { -- type = "direct", -- action_delivery = -- { -- type = "stream", -- stream = "acid-stream-small", -- starting_speed = 0.5, -- max_range = 50, -- } -- } -- } --}, autoplace = enemy_autoplace.enemy_worm_autoplace(0), call_for_help_radius = 40 }, { type = "ammo-turret", name = "gun-turret", icon = "__base__/graphics/icons/gun-turret.png", icon_size = 32, flags = {"placeable-player", "player-creation"}, minable = {mining_time = 0.5, result = "gun-turret"}, max_health = 400, corpse = "medium-remnants", collision_box = {{-0.7, -0.7 }, {0.7, 0.7}}, selection_box = {{-1, -1 }, {1, 1}}, rotation_speed = 0.015, preparing_speed = 0.08, folding_speed = 0.08, dying_explosion = "medium-explosion", inventory_size = 1, automated_ammo_count = 10, attacking_speed = 0.5, alert_when_attacking = true, open_sound = { filename = "__base__/sound/machine-open.ogg", volume = 0.85 }, close_sound = { filename = "__base__/sound/machine-close.ogg", volume = 0.75 }, folded_animation = { layers = { gun_turret_extension{frame_count=1, line_length = 1}, gun_turret_extension_mask{frame_count=1, line_length = 1}, gun_turret_extension_shadow{frame_count=1, line_length = 1} } }, preparing_animation = { layers = { gun_turret_extension{}, gun_turret_extension_mask{}, gun_turret_extension_shadow{} } }, prepared_animation = gun_turret_attack{frame_count=1}, attacking_animation = gun_turret_attack{}, folding_animation = { layers = { gun_turret_extension{run_mode = "backward"}, gun_turret_extension_mask{run_mode = "backward"}, gun_turret_extension_shadow{run_mode = "backward"} } }, base_picture = { layers = { { filename = "__base__/graphics/entity/gun-turret/gun-turret-base.png", priority = "high", width = 76, height = 60, axially_symmetrical = false, direction_count = 1, frame_count = 1, shift = util.by_pixel(1, -1), hr_version = { filename = "__base__/graphics/entity/gun-turret/hr-gun-turret-base.png", priority = "high", width = 150, height = 118, axially_symmetrical = false, direction_count = 1, frame_count = 1, shift = util.by_pixel(0.5, -1), scale = 0.5 } }, --{ -- filename = "__base__/graphics/entity/gun-turret/gun-turret-base-shadow.png", -- line_length = 1, -- width = 78, -- height = 62, -- axially_symmetrical = false, -- direction_count = 1, -- frame_count = 1, -- shift = util.by_pixel(5, 3), -- draw_as_shadow = true, -- hr_version = -- { -- filename = "__base__/graphics/entity/gun-turret/hr-gun-turret-base-shadow.png", -- line_length = 1, -- width = 154, -- height = 122, -- axially_symmetrical = false, -- direction_count = 1, -- frame_count = 1, -- shift = util.by_pixel(5, 2.5), -- draw_as_shadow = true, -- scale = 0.5 -- } --}, { filename = "__base__/graphics/entity/gun-turret/gun-turret-base-mask.png", flags = { "mask" }, line_length = 1, width = 62, height = 52, axially_symmetrical = false, direction_count = 1, frame_count = 1, shift = util.by_pixel(0, -4), apply_runtime_tint = true, hr_version = { filename = "__base__/graphics/entity/gun-turret/hr-gun-turret-base-mask.png", flags = { "mask" }, line_length = 1, width = 122, height = 102, axially_symmetrical = false, direction_count = 1, frame_count = 1, shift = util.by_pixel(0, -4.5), apply_runtime_tint = true, scale = 0.5 } } } }, vehicle_impact_sound = { filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65 }, attack_parameters = { type = "projectile", ammo_category = "bullet", cooldown = 6, projectile_creation_distance = 1.39375, projectile_center = {0, -0.0875}, -- same as gun_turret_attack shift shell_particle = { name = "shell-particle", direction_deviation = 0.1, speed = 0.1, speed_deviation = 0.03, center = {-0.0625, 0}, creation_distance = -1.925, starting_frame_speed = 0.2, starting_frame_speed_deviation = 0.1 }, range = 18, sound = make_heavy_gunshot_sounds() }, call_for_help_radius = 40 }, { type = "corpse", name = "small-worm-corpse", icon = "__base__/graphics/icons/small-worm-corpse.png", icon_size = 32, selection_box = {{-0.8, -0.8}, {0.8, 0.8}}, selectable_in_game = false, dying_speed = 0.01, time_before_removed = 15 * 60 * 60, subgroup="corpses", order = "c[corpse]-c[worm]-a[small]", flags = {"placeable-neutral", "placeable-off-grid", "building-direction-8-way", "not-repairable", "not-on-map"}, final_render_layer = "lower-object-above-shadow", animation = worm_die_animation(scale_worm_small, tint_worm_small), ground_patch = { sheet = worm_integration(scale_worm_small) } } } )