adamo-nuclear/combat.lua
2023-12-19 23:27:07 -05:00

405 lines
8.9 KiB
Lua

plutonium_rocket_recipe = {
type = "recipe",
name = "adamo-nuclear-thermonuclear-rocket",
energy_required = 50,
order = "d[rocket-launcher]-n[adamo-nuclear-thermonuclear-rocket]",
enabled = false,
-- main_product = "adamo-nuclear-thermonuclear-rocket",
ingredients = {
{"rocket",1},
{"explosives",1},
{"rocket-control-unit",1},
{WGPu_fuel_item.name,1}
},
result = "atomic-bomb",
}
plutonium_explosion_wave = {
type = "projectile",
name = "adamo-nuclear-atomic-explosion-wave",
flags = {"not-on-map"},
acceleration = 0,
action =
{
{
type = "direct",
action_delivery =
{
type = "instant",
target_effects =
{
{
type = "create-entity",
entity_name = "explosion"
}
}
}
},
{
type = "area",
radius = 3,
action_delivery =
{
type = "instant",
target_effects =
{
type = "damage",
damage = {amount = 1000, type = "explosion"}
}
}
}
},
animation =
{
filename = "__core__/graphics/empty.png",
frame_count = 1,
width = 1,
height = 1,
priority = "high"
},
shadow =
{
filename = "__core__/graphics/empty.png",
frame_count = 1,
width = 1,
height = 1,
priority = "high"
}
}
plutonium_rocket_projectile = {
type = "projectile",
name = "adamo-nuclear-thermonuclear-rocket-projectile",
flags = {"not-on-map"},
acceleration = 0.005,
action =
{
type = "direct",
action_delivery =
{
type = "instant",
target_effects =
{
{
type = "set-tile",
tile_name = "nuclear-ground",
radius = 20,
apply_projection = true,
tile_collision_mask = { "water-tile" }
},
{
type = "destroy-cliffs",
radius = 16,
explosion = "explosion"
},
{
type = "create-entity",
entity_name = "nuke-explosion"
},
{
type = "camera-effect",
effect = "screen-burn",
duration = 60,
ease_in_duration = 5,
ease_out_duration = 60,
delay = 0,
strength = 6,
full_strength_max_distance = 200,
max_distance = 800
},
{
type = "play-sound",
sound = require("__base__/prototypes/entity/sounds").nuclear_explosion(0.9),
play_on_target_position = false,
-- min_distance = 200,
max_distance = 1000,
-- volume_modifier = 1,
audible_distance_modifier = 3
},
{
type = "play-sound",
sound = require("__base__/prototypes/entity/sounds").nuclear_explosion_aftershock(0.4),
play_on_target_position = false,
-- min_distance = 200,
max_distance = 1000,
-- volume_modifier = 1,
audible_distance_modifier = 3
},
{
type = "create-entity",
entity_name = "huge-scorchmark",
offsets = {{ 0, -0.5 }},
check_buildability = true
},
{
type = "invoke-tile-trigger",
repeat_count = 1
},
{
type = "destroy-decoratives",
include_soft_decoratives = true, -- soft decoratives are decoratives with grows_through_rail_path = true
include_decals = true,
invoke_decorative_trigger = true,
decoratives_with_trigger_only = false, -- if true, destroys only decoratives that have trigger_effect set
radius = 14 -- large radius for demostrative purposes
},
{
type = "create-decorative",
decorative = "nuclear-ground-patch",
spawn_min_radius = 11.5,
spawn_max_radius = 12.5,
spawn_min = 30,
spawn_max = 40,
apply_projection = true,
spread_evenly = true
},
{
type = "nested-result",
action =
{
type = "area",
target_entities = false,
trigger_from_target = true,
repeat_count = 1000,
radius = 7,
action_delivery =
{
type = "projectile",
projectile = "atomic-bomb-ground-zero-projectile",
starting_speed = 0.6 * 0.8,
starting_speed_deviation = nuke_shockwave_starting_speed_deviation
}
}
},
{
type = "nested-result",
action =
{
type = "area",
target_entities = false,
trigger_from_target = true,
repeat_count = 1000,
radius = 35,
action_delivery =
{
type = "projectile",
projectile = "atomic-bomb-wave",
starting_speed = 0.5 * 0.7,
starting_speed_deviation = nuke_shockwave_starting_speed_deviation
}
}
},
{
type = "nested-result",
action =
{
type = "area",
show_in_tooltip = false,
target_entities = false,
trigger_from_target = true,
repeat_count = 1000,
radius = 26,
action_delivery =
{
type = "projectile",
projectile = "atomic-bomb-wave-spawns-cluster-nuke-explosion",
starting_speed = 0.5 * 0.7,
starting_speed_deviation = nuke_shockwave_starting_speed_deviation
}
}
},
{
type = "nested-result",
action =
{
type = "area",
show_in_tooltip = false,
target_entities = false,
trigger_from_target = true,
repeat_count = 700,
radius = 4,
action_delivery =
{
type = "projectile",
projectile = "atomic-bomb-wave-spawns-fire-smoke-explosion",
starting_speed = 0.5 * 0.65,
starting_speed_deviation = nuke_shockwave_starting_speed_deviation
}
}
},
{
type = "nested-result",
action =
{
type = "area",
show_in_tooltip = false,
target_entities = false,
trigger_from_target = true,
repeat_count = 1000,
radius = 8,
action_delivery =
{
type = "projectile",
projectile = "atomic-bomb-wave-spawns-nuke-shockwave-explosion",
starting_speed = 0.5 * 0.65,
starting_speed_deviation = nuke_shockwave_starting_speed_deviation
}
}
},
{
type = "nested-result",
action =
{
type = "area",
show_in_tooltip = false,
target_entities = false,
trigger_from_target = true,
repeat_count = 300,
radius = 26,
action_delivery =
{
type = "projectile",
projectile = "atomic-bomb-wave-spawns-nuclear-smoke",
starting_speed = 0.5 * 0.65,
starting_speed_deviation = nuke_shockwave_starting_speed_deviation
}
}
},
{
type = "nested-result",
action =
{
type = "area",
show_in_tooltip = false,
target_entities = false,
trigger_from_target = true,
repeat_count = 10,
radius = 8,
action_delivery =
{
type = "instant",
target_effects =
{
{
type = "create-entity",
entity_name = "nuclear-smouldering-smoke-source",
tile_collision_mask = { "water-tile" }
}
}
}
}
},
{
repeat_count = 150,
type = "create-trivial-smoke",
smoke_name = "nuclear-smoke",
offset_deviation = {{-1, -1}, {1, 1}},
starting_frame = 3,
starting_frame_deviation = 5,
starting_frame_speed = 0,
starting_frame_speed_deviation = 5,
speed_from_center = 0.5
},
-- {
-- type = "create-entity",
-- entity_name = "explosion"
-- },
{
type = "damage",
damage = {amount = 1000, type = "explosion"}
},
{
type = "create-entity",
entity_name = "small-scorchmark",
check_buildability = true
},
{
type = "nested-result",
action =
{
type = "area",
target_entities = false,
trigger_from_target = true,
repeat_count = 2000,
radius = 35,
action_delivery =
{
type = "projectile",
projectile = "adamo-nuclear-atomic-explosion-wave",
starting_speed = 0.5
}
}
}
}
}
},
light = {intensity = 0.8, size = 15},
animation =
{
filename =
"__base__/graphics/entity/"
.."rocket/rocket.png",
frame_count = 8,
line_length = 8,
width = 9,
height = 35,
shift = {0, 0},
priority = "high"
},
shadow =
{
filename =
"__base__/graphics/entity/"
.."rocket/rocket-shadow.png",
frame_count = 1,
width = 7,
height = 24,
priority = "high",
shift = {0, 0}
},
smoke =
{
{
name = "smoke-fast",
deviation = {0.15, 0.15},
frequency = 1,
position = {0, 1},
slow_down_factor = 1,
starting_frame = 3,
starting_frame_deviation = 5,
starting_frame_speed = 0,
starting_frame_speed_deviation = 5
}
}
}
plutonium_rocket_ammo = {
type = "ammo",
name = "adamo-nuclear-thermonuclear-rocket",
subgroup = "ammo",
order = "d[rocket-launcher]-r[adamo-nuclear-thermonuclear-rocket]",
stack_size = 10,
icon = "__base__/graphics/icons/atomic-bomb.png",
icon_size = 64,
icon_mipmaps = 4,
ammo_type =
{
range_modifier = 3,
cooldown_modifier = 3,
target_type = "position",
category = "rocket",
action =
{
type = "direct",
action_delivery =
{
type = "projectile",
projectile = "adamo-nuclear-thermonuclear-rocket-projectile",
starting_speed = 0.05,
source_effects =
{
type = "create-entity",
entity_name = "explosion-hit"
}
}
}
}
}