mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-01-14 02:34:09 +02:00
biter battles update
This commit is contained in:
parent
57770c8817
commit
92fa0a76df
@ -11,14 +11,15 @@ require "score"
|
||||
--require "maps.tools.cheat_mode"
|
||||
|
||||
---- enable maps here ----
|
||||
--require "maps.biter_battles"
|
||||
require "maps.biter_battles"
|
||||
--require "maps.cave_miner"
|
||||
--require "maps.deep_jungle"
|
||||
--require "maps.lost_desert"
|
||||
--require "maps.labyrinth"
|
||||
--require "maps.spaghettorio"
|
||||
--require "maps.spiral_troopers"
|
||||
require "maps.fish_defender"
|
||||
--require "maps.fish_defender"
|
||||
--require "maps.crossing"
|
||||
--require "maps.empty_map"
|
||||
-----------------------------
|
||||
|
||||
|
@ -718,17 +718,6 @@ local function on_entity_died(event)
|
||||
damage_entities_in_radius(event.entity.position, 1, damage)
|
||||
end
|
||||
|
||||
if event.entity.name == "big-biter" then
|
||||
event.entity.surface.create_entity({name = "uranium-cannon-shell-explosion", position = event.entity.position})
|
||||
local damage = 35
|
||||
damage_entities_in_radius(event.entity.position, 2, damage)
|
||||
end
|
||||
|
||||
if event.entity.name == "behemoth-biter" then
|
||||
event.entity.surface.create_entity({name = "uranium-cannon-shell-explosion", position = event.entity.position})
|
||||
local damage = 45
|
||||
damage_entities_in_radius(event.entity.position, 3, damage)
|
||||
end
|
||||
end
|
||||
|
||||
local function get_valid_biters(requested_amount, y_modifier, pos_x, pos_y, radius_inc)
|
||||
@ -1190,6 +1179,23 @@ end
|
||||
|
||||
--Silo grief prevention--
|
||||
local function on_entity_damaged(event)
|
||||
|
||||
--flamethrower turret nerf
|
||||
if event.cause then
|
||||
if event.cause.name == "flamethrower-turret" and event.entity.force.name == "enemy" then
|
||||
for i = 1, 2, 1 do
|
||||
if event.cause.fluidbox[i] then
|
||||
if event.cause.fluidbox[i].amount > 0.1 then
|
||||
local fluid_name = event.cause.fluidbox[i].name
|
||||
local new_amount = event.cause.fluidbox[i].amount - 0.30
|
||||
if new_amount < 0 then new_amount = 0 end
|
||||
event.cause.fluidbox[i] = {name = fluid_name, amount = new_amount}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--biter rage damage modifier
|
||||
if event.entity.force.name == "north" then
|
||||
if event.force.name == "enemy" then
|
||||
|
@ -1,6 +1,7 @@
|
||||
0.31
|
||||
map generation fixes
|
||||
medium, big and behemoth biters now explode with a visual effect
|
||||
medium biters now explode with a visual effect
|
||||
flamethrower turrets consume alot more fuel
|
||||
|
||||
0.30
|
||||
join team message fixed
|
||||
|
122
maps/crossing.lua
Normal file
122
maps/crossing.lua
Normal file
@ -0,0 +1,122 @@
|
||||
-- crossing -- by mewmew --
|
||||
|
||||
local event = require 'utils.event'
|
||||
local math_random = math.random
|
||||
local insert = table.insert
|
||||
local map_functions = require "maps.tools.map_functions"
|
||||
local simplex_noise = require 'utils.simplex_noise'
|
||||
local simplex_noise = simplex_noise.d2
|
||||
|
||||
local function on_player_joined_game(event)
|
||||
local player = game.players[event.player_index]
|
||||
if player.online_time < 1 then
|
||||
player.insert({name = "pistol", count = 1})
|
||||
player.insert({name = "iron-axe", count = 1})
|
||||
player.insert({name = "raw-fish", count = 1})
|
||||
player.insert({name = "firearm-magazine", count = 16})
|
||||
player.insert({name = "iron-plate", count = 32})
|
||||
|
||||
pos = player.character.surface.find_non_colliding_position("player",{0, -40}, 50, 1)
|
||||
game.forces.player.set_spawn_position(pos, player.character.surface)
|
||||
player.teleport(pos, player.character.surface)
|
||||
|
||||
if global.show_floating_killscore then global.show_floating_killscore[player.name] = false end
|
||||
end
|
||||
end
|
||||
|
||||
local function on_chunk_generated(event)
|
||||
local surface = game.surfaces[1]
|
||||
local seed = game.surfaces[1].map_gen_settings.seed
|
||||
if event.surface.name ~= surface.name then return end
|
||||
local left_top = event.area.left_top
|
||||
|
||||
local entities = surface.find_entities_filtered({area = event.area, name = {"iron-ore", "copper-ore", "coal", "stone"}})
|
||||
for _, entity in pairs(entities) do
|
||||
entity.destroy()
|
||||
end
|
||||
|
||||
if left_top.x > 128 then
|
||||
if not global.spawn_ores_generated then
|
||||
map_functions.draw_noise_tile_circle({x = 0, y = 0}, "water", surface, 24)
|
||||
global.spawn_ores_generated = true
|
||||
end
|
||||
end
|
||||
|
||||
if left_top.x < 64 and left_top.x > -64 then
|
||||
for x = 0, 31, 1 do
|
||||
for y = 0, 31, 1 do
|
||||
|
||||
local pos = {x = left_top.x + x, y = left_top.y + y}
|
||||
local noise_1 = simplex_noise(pos.x * 0.02, pos.y * 0.02, seed)
|
||||
|
||||
if pos.x > -80 + (noise_1 * 8) and pos.x < 80 + (noise_1 * 8) then
|
||||
local tile = surface.get_tile(pos)
|
||||
if tile.name == "water" or tile.name == "deepwater" then
|
||||
surface.set_tiles({{name = "grass-2", position = pos}})
|
||||
end
|
||||
end
|
||||
|
||||
if pos.x > -14 + (noise_1 * 8) and pos.x < 14 + (noise_1 * 8) then
|
||||
if pos.y > 0 then
|
||||
surface.create_entity({name = "stone", position = pos, amount = 1 + pos.y * 0.5})
|
||||
else
|
||||
surface.create_entity({name = "coal", position = pos, amount = 1 + pos.y * -1 * 0.5})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if left_top.y < 64 and left_top.y > -64 then
|
||||
for x = 0, 31, 1 do
|
||||
for y = 0, 31, 1 do
|
||||
local pos = {x = left_top.x + x, y = left_top.y + y}
|
||||
local noise_1 = simplex_noise(pos.x * 0.015, pos.y * 0.015, seed)
|
||||
|
||||
if pos.y > -80 + (noise_1 * 8) and pos.y < 80 + (noise_1 * 8) then
|
||||
local tile = surface.get_tile(pos)
|
||||
if tile.name == "water" or tile.name == "deepwater" then
|
||||
surface.set_tiles({{name = "grass-2", position = pos}})
|
||||
end
|
||||
end
|
||||
|
||||
if pos.y > -14 + (noise_1 * 8) and pos.y < 14 + (noise_1 * 8) then
|
||||
if pos.x > 0 then
|
||||
surface.create_entity({name = "copper-ore", position = pos, amount = 1 + pos.x * 0.5})
|
||||
else
|
||||
surface.create_entity({name = "iron-ore", position = pos, amount = 1 + pos.x * -1 * 0.5})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local biter_building_inhabitants = {
|
||||
[1] = {{"small-biter",8,16}},
|
||||
[2] = {{"small-biter",12,24}},
|
||||
[3] = {{"small-biter",8,16},{"medium-biter",1,2}},
|
||||
[4] = {{"small-biter",4,8},{"medium-biter",4,8}},
|
||||
[5] = {{"small-biter",3,5},{"medium-biter",8,12}},
|
||||
[6] = {{"small-biter",3,5},{"medium-biter",5,7},{"big-biter",1,2}},
|
||||
[7] = {{"medium-biter",6,8},{"big-biter",3,5}},
|
||||
[8] = {{"medium-biter",2,4},{"big-biter",6,8}},
|
||||
[9] = {{"medium-biter",2,3},{"big-biter",7,9}},
|
||||
[10] = {{"big-biter",4,8},{"behemoth-biter",3,4}}
|
||||
}
|
||||
|
||||
local function on_entity_died(event)
|
||||
if event.entity.name == "biter-spawner" or event.entity.name == "spitter-spawner" then
|
||||
local e = math.ceil(game.forces.enemy.evolution_factor*10, 0)
|
||||
for _, t in pairs (biter_building_inhabitants[e]) do
|
||||
for x = 1, math.random(t[2],t[3]), 1 do
|
||||
local p = event.entity.surface.find_non_colliding_position(t[1] , event.entity.position, 6, 1)
|
||||
if p then event.entity.surface.create_entity {name=t[1], position=p} end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
event.add(defines.events.on_chunk_generated, on_chunk_generated)
|
||||
event.add(defines.events.on_player_joined_game, on_player_joined_game)
|
||||
event.add(defines.events.on_entity_died, on_entity_died)
|
Loading…
Reference in New Issue
Block a user