Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

makes angelsexploration load in 2.0 #1025

Open
wants to merge 5 commits into
base: dev2.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion angelsexploration/data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ require("prototypes.exploration-category")
require("prototypes.exploration-debug")

--LOAD FUNCTIONS
--require("prototypes.entities.biter-builder")
require("prototypes.entities.biter-builder")
require("prototypes.entities.gathering-turret-builder")

--PROTOTYPES
Expand Down
7 changes: 5 additions & 2 deletions angelsexploration/prototypes/entities/ammo-bio.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ data:extend({
--flame_alpha = 0.35,
--flame_alpha_deviation = 0.05,

emissions_per_second = 0,
emissions_per_second = { pollution = 0 },
add_fuel_cooldown = 10,
fade_in_duration = 1,
fade_out_duration = 30,
Expand Down Expand Up @@ -202,7 +202,9 @@ data:extend({
{
type = "create-fire",
entity_name = "bio-splash",
tile_collision_mask = { "water-tile" },
tile_collision_mask = { layers = {
water_tile = true,
} },
show_in_tooltip = true,
},
{
Expand Down Expand Up @@ -254,6 +256,7 @@ data:extend({
icon = "__angelsexplorationgraphics__/graphics/icons/bio-ammo.png",
icon_size = 64,
flags = {},
ammo_category = "biological",
ammo_type = {
{
source_type = "default",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ data:extend({
icon = "__angelsexplorationgraphics__/graphics/icons/turret-shell-1.png",
icon_size = 32,
flags = {},
ammo_category = "cannon-shell",
ammo_type = {
category = "cannon-turret",
action = {
Expand Down Expand Up @@ -126,6 +127,7 @@ data:extend({
icon = "__angelsexplorationgraphics__/graphics/icons/turret-shell-2.png",
icon_size = 32,
flags = {},
ammo_category = "cannon-shell",
ammo_type = {
category = "cannon-turret",
action = {
Expand Down Expand Up @@ -201,6 +203,7 @@ data:extend({
icon = "__angelsexplorationgraphics__/graphics/icons/turret-shell-3.png",
icon_size = 32,
flags = {},
ammo_category = "cannon-shell",
ammo_type = {
category = "cannon-turret",
action = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ data:extend({
},
icon_size = 64,
flags = {},
ammo_category = "cannon-shell",
ammo_type = {
category = "heavy-cannon-shell",
target_type = "direction",
Expand Down Expand Up @@ -179,6 +180,7 @@ data:extend({
},
icon_size = 64,
flags = {},
ammo_category = "cannon-shell",
ammo_type = {
category = "heavy-cannon-shell",
target_type = "direction",
Expand Down Expand Up @@ -273,6 +275,7 @@ data:extend({
},
icon_size = 64,
flags = {},
ammo_category = "cannon-shell",
ammo_type = {
category = "heavy-cannon-shell",
target_type = "direction",
Expand Down Expand Up @@ -382,6 +385,7 @@ data:extend({
},
icon_size = 64,
flags = {},
ammo_category = "cannon-shell",
ammo_type = {
category = "heavy-cannon-shell",
target_type = "direction",
Expand Down
16 changes: 10 additions & 6 deletions angelsexploration/prototypes/entities/bio-turret.lua
Original file line number Diff line number Diff line change
Expand Up @@ -353,16 +353,19 @@ data:extend({
percent = 100,
},
},
fluid_box = {
production_type = "input-output",
fluid_box =
{
production_type = "none", -- FluidTurret has its own logic
secondary_draw_order = 0,
render_layer = "lower-object",
--pipe_picture = fireutil.flamethrower_turret_pipepictures(),
pipe_covers = pipecoverspictures(),
volume = 100,
pipe_connections = {
{ position = { -1.5, 1.0 } },
{ position = { 1.5, 1.0 } },
},
pipe_connections =
{
{ direction = defines.direction.west, position = { -0.5, 1.0 } },
{ direction = defines.direction.east, position = { 0.5, 1.0 } }
}
},
fluid_buffer_size = 100,
fluid_buffer_input_flow = 250 / 60 / 5, -- 5s to fill the buffer
Expand Down Expand Up @@ -616,6 +619,7 @@ data:extend({
shoot_in_prepare_state = false,
attack_parameters = {
type = "stream",
ammo_category = "biological",
cooldown = 4,
range = 30,
min_range = 6,
Expand Down
94 changes: 35 additions & 59 deletions angelsexploration/prototypes/entities/biter-builder.lua
Original file line number Diff line number Diff line change
@@ -1,70 +1,42 @@
require("util")

local noise = require("noise")

local tne = noise.to_noise_expression
local litexp = noise.literal_expression

local onehalf_exp = tne(1) / 2
local onethird_exp = tne(1) / 3

local enemy_random_seed = 1
local function new_random_seed()
enemy_random_seed = enemy_random_seed + 1
return enemy_random_seed
end

local control_name = "enemy-base"

-- autoplace
local function enemy_autoplace(params)
local distance_factor = params.distance_factor or 1
local order = params.order or "b[enemy]-misc"
local is_turret = params.is_turret or false

local distance_unit = 312
local distance_outside_starting_area = noise.var("distance") - noise.var("starting_area_radius")

-- Units with a higher distance_factor will appear farther out by one
-- distance_unit per distance_factor
local distance_height_multiplier =
noise.max(0, 1 + (distance_outside_starting_area - distance_unit * distance_factor) * 0.002 * distance_factor)

local probability_expression = noise.var("enemy_base_probability") * distance_height_multiplier
-- limit probability so that it never quite reaches 1,
-- because that would result in stupid-looking squares of biter bases:
probability_expression = noise.min(probability_expression, 0.25 + distance_factor * 0.05)
-- Add randomness to the probability so that there's a little bit of a gradient
-- between different units:
probability_expression = noise.random_penalty(probability_expression, 0.1, {
x = noise.var("x") + new_random_seed(), -- Include distance_factor in random seed!
})
-- log("Probability expression for " .. params.order .. "#" .. distance_factor .. ":")
-- log(tostring(expression_to_ascii_math(probability_expression)))
local richness_expression = tne(1)

return {
control = control_name,
order = order,
control = params.control or control_name,
order = params.order or "b[enemy]-misc",
force = "enemy",
probability_expression = probability_expression,
richness_expression = richness_expression,
probability_expression = params.probability_expression,
richness_expression = 1,
}
end
local function enemy_spawner_autoplace(distance)

local function enemy_spawner_autoplace(probability_expression)
return enemy_autoplace({
distance_factor = distance,
probability_expression = probability_expression,
order = "b[enemy]-a[spawner]",
})
end
local function enemy_worm_autoplace(distance)

local function enemy_worm_autoplace(probability_expression)
return enemy_autoplace({
distance_factor = distance,
probability_expression = probability_expression,
order = "b[enemy]-b[worm]",
is_turret = true,
})
end


-- return
-- {
-- control_name = control_name,
-- enemy_autoplace = enemy_autoplace,
-- enemy_spawner_autoplace = enemy_spawner_autoplace,
-- enemy_worm_autoplace = enemy_worm_autoplace
-- }

-- animation
local function make_die_animation(data_die)
if data_die.type == "scarab" then
Expand Down Expand Up @@ -652,6 +624,7 @@ local function make_projectile_beam(pro_app, pro_dmg)
flags = { "not-on-map" },
width = 0.5,
damage_interval = pro_dmg.cooldown,
graphics_set = {},
action = {
type = "direct",
action_delivery = {
Expand Down Expand Up @@ -854,7 +827,7 @@ local function make_projectile_stream(pro_app, pro_dmg)
--flame_alpha = 0.35,
--flame_alpha_deviation = 0.05,

emissions_per_second = 0,
emissions_per_second = { pollution = 0 },

add_fuel_cooldown = 10,
fade_in_duration = 1,
Expand Down Expand Up @@ -1176,7 +1149,9 @@ local function make_projectile_stream(pro_app, pro_dmg)
{
type = "create-fire",
entity_name = splash_fire.name,
tile_collision_mask = { "water-tile" },
tile_collision_mask = {layers = {
water_tile=true,
} },
show_in_tooltip = true,
},
{
Expand Down Expand Up @@ -1325,7 +1300,7 @@ local function make_attack_parameter(data_app, data_dmg)
end
if data_app.type == "spitter" then
data_dmg.type = "stream"
data_dmg.ammo_category = "biological"
data_dmg.category = "biological"
data_dmg.cooldown_deviation = 0.15
data_dmg.min_attack_distance = 10 -- TODO: adapt with range parameter?
data_dmg.projectile_creation_parameters = make_shoot_shiftings(data_app.scale, data_app.scale * 20)
Expand Down Expand Up @@ -1487,7 +1462,7 @@ function angelsmods.functions.make_alien(def_data)
vision_distance = 30,
movement_speed = def_data.appearance.speed,
distance_per_frame = 0.1,
pollution_to_join_attack = 200,
absorptions_to_join_attack = { pollution = 200 },
distraction_cooldown = 300,
min_pursue_time = 10 * 60,
max_pursue_distance = 50,
Expand Down Expand Up @@ -1539,27 +1514,28 @@ function angelsmods.functions.make_alien_spawner(spawn_data)
collision_box = { { -3.2, -2.2 }, { 2.2, 2.2 } },
selection_box = { { -3.5, -2.5 }, { 2.5, 2.5 } },
-- in ticks per 1 pu
pollution_absorption_absolute = 20,
pollution_absorption_proportional = 0.01,
absorptions_per_second = { pollution = { absolute = 20, proportional = 0.01 } },
loot = {},
corpse = "biter-spawner-corpse",
loot = make_loot(spawn_data.loot),
dying_explosion = "blood-explosion-huge",
max_count_of_owned_units = 7,
max_friends_around_to_spawn = 5,
animations = {
spawner_idle_animation(0, spawn_data.appearance.tint),
spawner_idle_animation(1, spawn_data.appearance.tint),
spawner_idle_animation(2, spawn_data.appearance.tint),
spawner_idle_animation(3, spawn_data.appearance.tint),
graphics_set = {
animations = {
spawner_idle_animation(0, spawn_data.appearance.tint),
spawner_idle_animation(1, spawn_data.appearance.tint),
spawner_idle_animation(2, spawn_data.appearance.tint),
spawner_idle_animation(3, spawn_data.appearance.tint),
},
},
result_units = spawn_data.results,
spawning_cooldown = spawn_data.appearance.spawn_cooldown,
spawning_radius = 10,
spawning_spacing = 3,
max_spawn_shift = 0,
max_richness_for_spawn_shift = 100,
autoplace = enemy_spawner_autoplace(1),
autoplace = enemy_spawner_autoplace("enemy_autoplace_base(0, 6)"),
call_for_help_radius = 50,
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ end

local function create_gathering_turret_target_tech(inputs)
if type(inputs.require_tech_unlock) == "boolean" then
inputs.require_tech_unlock = "angels-gathering-turret-target[" .. inputs.name .. "]"
inputs.require_tech_unlock = "angels-gathering-turret-target_" .. inputs.name .. "_"
return create_gathering_turret_target_tech(inputs)
end

Expand Down Expand Up @@ -579,7 +579,7 @@ function angelsmods.functions.create_gathering_turret_target(inputs)
data:extend({
{
type = "land-mine",
name = "angels-gathering-turret-target[" .. inputs.name .. "]",
name = "angels-gathering-turret-target_" .. inputs.name .. "_",

icons = angelsmods.functions.get_object_icons(inputs.name),

Expand Down
1 change: 1 addition & 0 deletions angelsexploration/prototypes/entities/gathering-turret.lua
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ data:extend({
scale = 0.78,
}),
damage_modifier = 1,
ammo_category = "beam",
ammo_type = {
category = "gathering",
energy_consumption = "800kJ",
Expand Down
Loading