require ("prototypes.entity.demo-spawner-animation") require ("prototypes.entity.demo-biter-animations") require ("prototypes.entity.demo-enemy-sounds") local enemy_autoplace = require ("prototypes.entity.demo-enemy-autoplace-utils") require ("prototypes.entity.demo-biter-ai-settings") small_biter_scale = 0.5 small_biter_tint1 = {r=0.60, g=0.58, b=0.51, a=1} small_biter_tint2 = {r=0.9 , g=0.83, b=0.54, a=1} biter_spawner_tint = {r=0.92, g=0.54, b=0, a=0.5} data:extend( { { type = "unit", name = "small-biter", icon = "__base__/graphics/icons/small-biter.png", icon_size = 32, flags = {"placeable-player", "placeable-enemy", "placeable-off-grid", "not-repairable", "breaths-air"}, max_health = 15, order = "b-b-a", subgroup="enemies", resistances = { { type = "acid", percent = 100 } }, healing_per_tick = 0.01, collision_box = {{-0.2, -0.2}, {0.2, 0.2}}, selection_box = {{-0.4, -0.7}, {0.7, 0.4}}, attack_parameters = { type = "projectile", range = 0.5, cooldown = 35, ammo_type = make_unit_melee_ammo_type(7), sound = make_biter_roars(0.4), animation = biterattackanimation(small_biter_scale, small_biter_tint1, small_biter_tint2) }, vision_distance = 30, movement_speed = 0.2, distance_per_frame = 0.125, pollution_to_join_attack = 200, distraction_cooldown = 300, min_pursue_time = 10 * 60, max_pursue_distance = 50, corpse = "small-biter-corpse", dying_explosion = "blood-explosion-small", dying_sound = make_biter_dying_sounds(0.4), working_sound = make_biter_calls(0.3), run_animation = biterrunanimation(small_biter_scale, small_biter_tint1, small_biter_tint2), --idle_animation = biteridleanimation(small_biter_scale, small_biter_tint1, small_biter_tint2), ai_settings = biter_ai_settings }, add_biter_die_animation(small_biter_scale, small_biter_tint1, small_biter_tint2, { type = "corpse", name = "small-biter-corpse", icon = "__base__/graphics/icons/small-biter-corpse.png", icon_size = 32, selection_box = {{-0.8, -0.8}, {0.8, 0.8}}, selectable_in_game = false, subgroup="corpses", order = "c[corpse]-a[biter]-a[small]", flags = {"placeable-neutral", "placeable-off-grid", "building-direction-8-way", "not-repairable", "not-on-map"} }), { type = "unit-spawner", name = "biter-spawner", icon = "__base__/graphics/icons/biter-spawner.png", icon_size = 32, flags = {"placeable-player", "placeable-enemy", "not-repairable"}, max_health = 350, order="b-b-g", subgroup="enemies", resistances = { { type = "physical", decrease = 2, percent = 15 }, { type = "explosion", decrease = 5, percent = 15 }, { type = "fire", decrease = 3, percent = 60 } }, working_sound = { sound = { { filename = "__base__/sound/creatures/spawner.ogg", volume = 1.0 } }, apparent_volume = 2 }, dying_sound = { { filename = "__base__/sound/creatures/spawner-death-1.ogg", volume = 1.0 }, { filename = "__base__/sound/creatures/spawner-death-2.ogg", volume = 1.0 } }, healing_per_tick = 0.02, collision_box = {{-3.2, -2.2}, {2.2, 2.2}}, map_generator_bounding_box = {{-4.2, -3.2}, {3.2, 3.2}}, selection_box = {{-3.5, -2.5}, {2.5, 2.5}}, -- in ticks per 1 pu pollution_absorbtion_absolute = 20, pollution_absorbtion_proportional = 0.01, corpse = "biter-spawner-corpse", dying_explosion = "blood-explosion-huge", max_count_of_owned_units = 7, max_friends_around_to_spawn = 5, animations = { spawner_idle_animation(0, biter_spawner_tint), spawner_idle_animation(1, biter_spawner_tint), spawner_idle_animation(2, biter_spawner_tint), spawner_idle_animation(3, biter_spawner_tint) }, integration = { sheet = spawner_integration() }, result_units = (function() local res = {} res[1] = {"small-biter", {{0.0, 0.3}, {0.6, 0.0}}} if not data.is_demo then -- from evolution_factor 0.3 the weight for medium-biter is linearly rising from 0 to 0.3 -- this means for example that when the evolution_factor is 0.45 the probability of spawning -- a small biter is 66% while probability for medium biter is 33%. res[2] = {"medium-biter", {{0.2, 0.0}, {0.6, 0.3}, {0.7, 0.1}}} -- for evolution factor of 1 the spawning probabilities are: small-biter 0%, medium-biter 1/8, big-biter 4/8, behemoth biter 3/8 res[3] = {"big-biter", {{0.5, 0.0}, {1.0, 0.4}}} res[4] = {"behemoth-biter", {{0.9, 0.0}, {1.0, 0.3}}} end return res end)(), -- With zero evolution the spawn rate is 6 seconds, with max evolution it is 2.5 seconds spawning_cooldown = {360, 150}, spawning_radius = 10, spawning_spacing = 3, max_spawn_shift = 0, max_richness_for_spawn_shift = 100, autoplace = enemy_autoplace.enemy_spawner_autoplace(0), call_for_help_radius = 50 }, { type = "corpse", name = "biter-spawner-corpse", flags = {"placeable-neutral", "placeable-off-grid", "not-on-map"}, icon = "__base__/graphics/icons/biter-spawner-corpse.png", icon_size = 32, collision_box = {{-2, -2}, {2, 2}}, selection_box = {{-2, -2}, {2, 2}}, selectable_in_game = false, dying_speed = 0.04, time_before_removed = 15 * 60 * 60, subgroup="corpses", order = "c[corpse]-b[biter-spawner]", final_render_layer = "remnants", animation = { spawner_die_animation(0, biter_spawner_tint), spawner_die_animation(1, biter_spawner_tint), spawner_die_animation(2, biter_spawner_tint), spawner_die_animation(3, biter_spawner_tint) }, ground_patch = { sheet = spawner_integration() } } })