mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-03-17 20:58:13 +02:00
Biter Battles Update
This commit is contained in:
parent
b9f0893496
commit
5bfbc53d1e
@ -9,17 +9,17 @@ require "player_list"
|
||||
require "poll"
|
||||
require "score"
|
||||
|
||||
require "maps.tools.cheat_mode"
|
||||
--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.spooky_forest"
|
||||
--require "maps.empty_map"
|
||||
|
@ -510,39 +510,37 @@ local function on_player_joined_game(event)
|
||||
global.game_lobby_timeout = 599940
|
||||
global.biter_battle_view_players = {}
|
||||
global.spectator_spam_protection = {}
|
||||
global.force_area = {}
|
||||
game.forces["north"].technologies["artillery-shell-range-1"].enabled = false
|
||||
game.forces["south"].technologies["artillery-shell-range-1"].enabled = false
|
||||
game.forces["north"].technologies["artillery-shell-speed-1"].enabled = false
|
||||
game.forces["south"].technologies["artillery-shell-speed-1"].enabled = false
|
||||
game.forces["north"].technologies["atomic-bomb"].enabled = false
|
||||
game.forces["south"].technologies["atomic-bomb"].enabled = false
|
||||
game.forces["spectator"].technologies["toolbelt"].researched=true
|
||||
global.force_area = {}
|
||||
|
||||
global.team_chosen = {}
|
||||
global.team_nerf = {}
|
||||
global.team_nerf["north"] = 0
|
||||
global.team_nerf["south"] = 0
|
||||
global.team_nerf = {}
|
||||
global.biter_rage = {}
|
||||
global.biter_rage["north"] = 0
|
||||
global.biter_rage["south"] = 0
|
||||
|
||||
|
||||
--global.biter_buildings_fragmentation[5] = {"small-worm-turret","small-spitter",2,3}
|
||||
--global.biter_buildings_fragmentation[6] = {"medium-worm-turret","medium-spitter",2,3}
|
||||
--global.biter_buildings_fragmentation[7] = {"big-worm-turret","big-spitter",1,2}
|
||||
|
||||
game.forces["north"].set_turret_attack_modifier("flamethrower-turret", -0.75)
|
||||
game.forces["south"].set_turret_attack_modifier("flamethrower-turret", -0.75)
|
||||
game.forces["north"].set_ammo_damage_modifier("artillery-shell", -0.95)
|
||||
game.forces["south"].set_ammo_damage_modifier("artillery-shell", -0.95)
|
||||
game.forces["north"].set_ammo_damage_modifier("shotgun-shell", 0.5)
|
||||
game.forces["south"].set_ammo_damage_modifier("shotgun-shell", 0.5)
|
||||
|
||||
|
||||
|
||||
global.spy_fish_timeout = {}
|
||||
|
||||
local force_names = {"north", "south"}
|
||||
for _, name in pairs(force_names) do
|
||||
game.forces[name].technologies["artillery"].enabled = false
|
||||
game.forces[name].technologies["artillery-shell-range-1"].enabled = false
|
||||
game.forces[name].technologies["artillery-shell-speed-1"].enabled = false
|
||||
game.forces[name].technologies["flamethrower-damage-1"].enabled = false
|
||||
game.forces[name].technologies["flamethrower-damage-2"].enabled = false
|
||||
game.forces[name].technologies["flamethrower-damage-3"].enabled = false
|
||||
game.forces[name].technologies["flamethrower-damage-4"].enabled = false
|
||||
game.forces[name].technologies["flamethrower-damage-5"].enabled = false
|
||||
game.forces[name].technologies["flamethrower-damage-6"].enabled = false
|
||||
game.forces[name].technologies["flamethrower-damage-7"].enabled = false
|
||||
game.forces[name].technologies["atomic-bomb"].enabled = false
|
||||
|
||||
global.team_nerf[name] = 0
|
||||
global.biter_rage[name] = 0
|
||||
|
||||
game.forces[name].set_turret_attack_modifier("flamethrower-turret", -0.5)
|
||||
--game.forces[name].set_ammo_damage_modifier("artillery-shell", -0.95)
|
||||
game.forces[name].set_ammo_damage_modifier("shotgun-shell", 0.5)
|
||||
end
|
||||
|
||||
game.forces["spectator"].technologies["toolbelt"].researched=true
|
||||
|
||||
local f = game.forces['north']
|
||||
f.set_cease_fire('player', true)
|
||||
f.set_friend('spectator', true)
|
||||
@ -1287,7 +1285,8 @@ 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
|
||||
@ -1302,7 +1301,7 @@ local function on_entity_damaged(event)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end]]
|
||||
|
||||
--biter rage damage modifier
|
||||
if event.entity.force.name == "north" then
|
||||
|
@ -1,3 +1,8 @@
|
||||
0.32
|
||||
flamethrower damage upgrade research removed
|
||||
flamethrower fuel consumption reverted to normal
|
||||
artillery disabled
|
||||
|
||||
0.31
|
||||
map generation fixes
|
||||
medium biters now explode with a visual effect
|
||||
|
@ -279,13 +279,7 @@ local function spawn_boss_units(surface)
|
||||
})
|
||||
end
|
||||
|
||||
local function biter_attack_wave()
|
||||
if not global.market then return end
|
||||
if global.wave_grace_period then return end
|
||||
local surface = game.surfaces["fish_defender"]
|
||||
|
||||
clear_corpses(surface)
|
||||
|
||||
local function wake_up_idle_biters(surface)
|
||||
surface.set_multi_command({
|
||||
command={
|
||||
type=defines.command.attack,
|
||||
@ -316,10 +310,16 @@ local function biter_attack_wave()
|
||||
commands = {
|
||||
{
|
||||
type=defines.command.attack_area,
|
||||
destination={x = -32, y = 0},
|
||||
destination={x = -160, y = 0},
|
||||
radius=16,
|
||||
distraction=defines.distraction.by_anything
|
||||
},
|
||||
},
|
||||
{
|
||||
type=defines.command.attack_area,
|
||||
destination={x = -80, y = 0},
|
||||
radius=16,
|
||||
distraction=defines.distraction.by_anything
|
||||
},
|
||||
{
|
||||
type=defines.command.attack,
|
||||
target=global.market,
|
||||
@ -328,6 +328,15 @@ local function biter_attack_wave()
|
||||
}
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
local function biter_attack_wave()
|
||||
if not global.market then return end
|
||||
if global.wave_grace_period then return end
|
||||
local surface = game.surfaces["fish_defender"]
|
||||
|
||||
clear_corpses(surface)
|
||||
wake_up_idle_biters(surface)
|
||||
|
||||
if surface.count_entities_filtered({type = "unit", area = {{-128,-256},{360, 256}}}) > biter_count_limit then
|
||||
game.print("Biter limit reached, wave stalled.", {r = 0.7, g = 0.1, b = 0.1})
|
||||
@ -733,16 +742,16 @@ local function on_entity_died(event)
|
||||
if event.entity.name == "medium-biter" then
|
||||
event.entity.surface.create_entity({name = "explosion", position = event.entity.position})
|
||||
local damage = 25
|
||||
if global.endgame_modifier then damage = 25 + math.ceil((global.endgame_modifier * 0.005), 0) end
|
||||
if damage > 50 then damage = 50 end
|
||||
if global.endgame_modifier then damage = 25 + math.ceil((global.endgame_modifier * 0.025), 0) end
|
||||
if damage > 75 then damage = 75 end
|
||||
damage_entities_in_radius(event.entity.position, 1 + math.floor(global.wave_count * 0.001), 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
|
||||
if global.endgame_modifier then damage = 50 + math.ceil((global.endgame_modifier * 0.01), 0) end
|
||||
if damage > 100 then damage = 100 end
|
||||
if global.endgame_modifier then damage = 50 + math.ceil((global.endgame_modifier * 0.05), 0) end
|
||||
if damage > 150 then damage = 150 end
|
||||
damage_entities_in_radius(event.entity.position, 2 + math.floor(global.wave_count * 0.001), damage)
|
||||
end
|
||||
|
||||
@ -785,7 +794,7 @@ local function on_entity_damaged(event)
|
||||
local surface = event.cause.surface
|
||||
local area = {{event.entity.position.x - 3, event.entity.position.y - 3}, {event.entity.position.x + 3, event.entity.position.y + 3}}
|
||||
if surface.count_entities_filtered({area = area, name = "small-biter", limit = 3}) < 3 then
|
||||
local pos = surface.find_non_colliding_position("small-biter", event.entity.position, 3, 0.5)
|
||||
local pos = surface.find_non_colliding_position("small-biter", event.entity.position, 4, 0.5)
|
||||
if pos then surface.create_entity({name = "small-biter", position = pos}) end
|
||||
end
|
||||
end
|
||||
@ -794,7 +803,7 @@ local function on_entity_damaged(event)
|
||||
local surface = event.cause.surface
|
||||
local area = {{event.entity.position.x - 3, event.entity.position.y - 3}, {event.entity.position.x + 3, event.entity.position.y + 3}}
|
||||
if surface.count_entities_filtered({area = area, name = "medium-biter", limit = 3}) < 3 then
|
||||
local pos = surface.find_non_colliding_position("medium-biter", event.entity.position, 3, 0.5)
|
||||
local pos = surface.find_non_colliding_position("medium-biter", event.entity.position, 4, 0.5)
|
||||
if pos then surface.create_entity({name = "medium-biter", position = pos}) end
|
||||
end
|
||||
end
|
||||
@ -871,7 +880,7 @@ local function on_player_joined_game(event)
|
||||
["laser-turret"] = {placed = 0, limit = 1, str = "laser turret", slot_price = 250},
|
||||
["artillery-turret"] = {placed = 0, limit = 1, str = "artillery turret", slot_price = 500},
|
||||
["flamethrower-turret"] = {placed = 0, limit = 0, str = "flamethrower turret", slot_price = 50000},
|
||||
["land-mine"] = {placed = 0, limit = 1, str = "landmine", slot_price = 1}
|
||||
["land-mine"] = {placed = 0, limit = 1, str = "mine", slot_price = 1}
|
||||
}
|
||||
|
||||
global.wave_grace_period = wave_interval * 21
|
||||
@ -896,14 +905,7 @@ local function on_player_joined_game(event)
|
||||
player.teleport({-50, 0}, "fish_defender")
|
||||
end
|
||||
end
|
||||
|
||||
--[[
|
||||
if global.wave_grace_period then
|
||||
global.wave_grace_period = global.wave_grace_period - 3600
|
||||
if global.wave_grace_period <= 0 then global.wave_grace_period = nil end
|
||||
end
|
||||
]]
|
||||
|
||||
|
||||
create_wave_gui(player)
|
||||
|
||||
if game.tick > 900 then
|
||||
@ -1017,30 +1019,7 @@ local function on_chunk_generated(event)
|
||||
|
||||
global.spawn_ores_generated = true
|
||||
end
|
||||
end
|
||||
|
||||
--[[
|
||||
if left_top.x <= -352 then
|
||||
if math_random(1, 128) == 1 then
|
||||
local positions = {}
|
||||
for x = 0, 31, 1 do
|
||||
for y = 0, 31, 1 do
|
||||
insert(positions, {x = left_top.x + x, y = left_top.y + y})
|
||||
end
|
||||
end
|
||||
positions = shuffle(positions)
|
||||
for _, pos in pairs(positions) do
|
||||
if surface.can_place_entity({name = "biter-spawner", force = "enemy", position = pos}) then
|
||||
if math_random(1,4) == 1 then
|
||||
local entity = surface.create_entity({name = "spitter-spawner", force = "enemy", position = pos})
|
||||
else
|
||||
local entity = surface.create_entity({name = "biter-spawner", force = "enemy", position = pos})
|
||||
end
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end]]
|
||||
end
|
||||
|
||||
local tiles = {}
|
||||
local hourglass_center_piece_length = 64
|
||||
|
Loading…
x
Reference in New Issue
Block a user