mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-02-11 13:39:14 +02:00
commit
d83bc8dff6
@ -12,6 +12,7 @@ first_to_reach=[color=blue]Mapkeeper:[/color]\n__1__ was the first to reach zone
|
||||
artillery_warning=[color=blue]Mapkeeper:[/color]\nWarning, Artillery have been spotted north!
|
||||
cheating_through=[color=blue]Mapkeeper:[/color] __1__ tried to cheat their way north with their spidertron!
|
||||
hinder=[color=blue]Mapkeeper:[/color] You are too far away from the main locomotive. You cannot go beyond this point.
|
||||
hinder_collapse=[color=blue]Mapkeeper:[/color] Collapse is too far away. You cannot go beyond this point.
|
||||
warning=Breaching the far side wall will start collapse.
|
||||
warning_teleport=[color=blue]Mapkeeper:[/color] __1__ wants to go north, but was given a last chance to rethink their choice. The next player that does this will trigger collapse!
|
||||
|
||||
|
@ -153,19 +153,17 @@ local check_distance_between_player_and_locomotive = function(player)
|
||||
return
|
||||
end
|
||||
|
||||
local collapse_position = Collapse.get_position()
|
||||
|
||||
local gap_between_locomotive = Public.get('gap_between_locomotive')
|
||||
|
||||
if not gap_between_locomotive.highest_pos then
|
||||
gap_between_locomotive.highest_pos = locomotive.position
|
||||
end
|
||||
|
||||
gap_between_locomotive.highest_pos = locomotive.position
|
||||
gap_between_locomotive = Public.get('gap_between_locomotive')
|
||||
|
||||
local c_y = position.y
|
||||
local p_y = position.y
|
||||
local t_y = gap_between_locomotive.highest_pos.y
|
||||
local c_y = collapse_position.y
|
||||
|
||||
if c_y - t_y <= gap_between_locomotive.neg_gap then
|
||||
if p_y - t_y <= gap_between_locomotive.neg_gap then
|
||||
player.teleport({position.x, locomotive.position.y + gap_between_locomotive.neg_gap + 2}, surface)
|
||||
player.print(({'breached_wall.hinder'}), Color.warning)
|
||||
if player.driving then
|
||||
@ -179,6 +177,21 @@ local check_distance_between_player_and_locomotive = function(player)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if p_y - c_y <= gap_between_locomotive.neg_gap_collapse then
|
||||
player.teleport({position.x, c_y + gap_between_locomotive.neg_gap_collapse + 2}, surface)
|
||||
player.print(({'breached_wall.hinder_collapse'}), Color.warning)
|
||||
if player.driving then
|
||||
player.driving = false
|
||||
end
|
||||
if player.character then
|
||||
player.character.health = player.character.health - 5
|
||||
player.character.surface.create_entity({name = 'water-splash', position = position})
|
||||
if player.character.health <= 0 then
|
||||
player.character.die('enemy')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local compare_player_pos = function(player)
|
||||
|
@ -660,50 +660,64 @@ local function built_entity_robot(event)
|
||||
return
|
||||
end
|
||||
|
||||
local active_surface_index = WPT.get('active_surface_index')
|
||||
local disable_link_chest_cheese_mode = WPT.get('disable_link_chest_cheese_mode')
|
||||
|
||||
local net_point = robot.logistic_network
|
||||
if net_point and net_point.storage_points and net_point.storage_points[1] and net_point.storage_points[1].owner and net_point.storage_points[1].owner.valid then
|
||||
if (net_point.storage_points[1].owner.name == 'character') then
|
||||
local player = net_point.storage_points[1].owner.player
|
||||
if not player or not player.valid then
|
||||
return
|
||||
end
|
||||
if net_point and net_point.storage_points then
|
||||
for _, point in pairs(net_point.storage_points) do
|
||||
if point then
|
||||
if point.owner and point.owner.valid and point.owner.name == 'character' then
|
||||
local player = point.owner.player
|
||||
if not player or not player.valid then
|
||||
return
|
||||
end
|
||||
|
||||
local active_surface_index = WPT.get('active_surface_index')
|
||||
if player.surface.index ~= active_surface_index then
|
||||
if entity.type ~= 'entity-ghost' then
|
||||
player.insert({name = 'linked-chest', count = 1})
|
||||
end
|
||||
entity.destroy()
|
||||
player.print(module_name .. 'Linked chests only work on the main surface.', Color.warning)
|
||||
return
|
||||
end
|
||||
|
||||
if player.surface.index ~= active_surface_index then
|
||||
if entity.type ~= 'entity-ghost' then
|
||||
player.insert({name = 'linked-chest', count = 1})
|
||||
if not WPT.locomotive.is_around_train(entity) then
|
||||
if entity.type ~= 'entity-ghost' then
|
||||
player.insert({name = 'linked-chest', count = 1})
|
||||
end
|
||||
entity.destroy()
|
||||
player.print(module_name .. 'Linked chests only work inside the locomotive aura.', Color.warning)
|
||||
return
|
||||
end
|
||||
|
||||
local trusted_player = Session.get_trusted_player(player)
|
||||
|
||||
if not trusted_player then
|
||||
if entity.type ~= 'entity-ghost' then
|
||||
player.insert({name = 'linked-chest', count = 1})
|
||||
end
|
||||
entity.destroy()
|
||||
player.print('[Antigrief] You have not grown accustomed to this technology yet.', Color.warning)
|
||||
return
|
||||
end
|
||||
|
||||
local s = create_chest(entity)
|
||||
if s then
|
||||
gui_opened(event)
|
||||
end
|
||||
else
|
||||
local created = event.created_entity
|
||||
if created and created.valid then
|
||||
local inventory = robot.get_inventory(defines.inventory.robot_cargo)
|
||||
inventory.insert({name = created.name, count = 1})
|
||||
created.destroy()
|
||||
end
|
||||
end
|
||||
entity.destroy()
|
||||
player.print(module_name .. 'Linked chests only work on the main surface.', Color.warning)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
if not WPT.locomotive.is_around_train(entity) then
|
||||
if entity.type ~= 'entity-ghost' then
|
||||
player.insert({name = 'linked-chest', count = 1})
|
||||
end
|
||||
entity.destroy()
|
||||
player.print(module_name .. 'Linked chests only work inside the locomotive aura.', Color.warning)
|
||||
return
|
||||
end
|
||||
|
||||
local trusted_player = Session.get_trusted_player(player)
|
||||
|
||||
if not trusted_player then
|
||||
if entity.type ~= 'entity-ghost' then
|
||||
player.insert({name = 'linked-chest', count = 1})
|
||||
end
|
||||
entity.destroy()
|
||||
player.print('[Antigrief] You have not grown accustomed to this technology yet.', Color.warning)
|
||||
return
|
||||
end
|
||||
|
||||
local s = create_chest(entity)
|
||||
if s then
|
||||
gui_opened(event)
|
||||
end
|
||||
else
|
||||
if disable_link_chest_cheese_mode then
|
||||
local created = event.created_entity
|
||||
if created and created.valid then
|
||||
local inventory = robot.get_inventory(defines.inventory.robot_cargo)
|
||||
|
@ -442,7 +442,7 @@ local compare_collapse_and_train = function()
|
||||
Public.set_difficulty()
|
||||
else
|
||||
Collapse.set_speed(1)
|
||||
Collapse.set_amount(4)
|
||||
Collapse.set_amount(40)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -191,7 +191,7 @@ local function get_random_buff()
|
||||
modifier = 'starting_items',
|
||||
limit = nil,
|
||||
items = {
|
||||
{name = 'assembling-machine', count = 1}
|
||||
{name = 'assembling-machine-1', count = 1}
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -708,6 +708,10 @@ local apply_settings_token =
|
||||
return
|
||||
end
|
||||
|
||||
if not settings.current_date then
|
||||
settings.current_date = tonumber(current_time)
|
||||
end
|
||||
|
||||
this.current_date = settings.current_date
|
||||
this.buffs = settings.buffs
|
||||
|
||||
|
@ -125,6 +125,7 @@ function Public.reset_main_table()
|
||||
hinders = {},
|
||||
gap = 900,
|
||||
neg_gap = -3520, -- earlier 2112 (3 zones, whereas 704 is one zone)
|
||||
neg_gap_collapse = -5520, -- earlier 2112 (3 zones, whereas 704 is one zone)
|
||||
highest_pos = nil
|
||||
}
|
||||
this.force_chunk = false
|
||||
|
Loading…
x
Reference in New Issue
Block a user