1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-06 00:23:49 +02:00
This commit is contained in:
MewMew 2019-05-14 17:09:36 +02:00
parent 7b9103a8cc
commit 43292bd8e0
3 changed files with 9 additions and 8 deletions

View File

@ -1,4 +1,4 @@
local radius = 16
local radius = 12
local math_random = math.random
local math_sqrt = math.sqrt
@ -24,10 +24,10 @@ local function bounce(surface, position, ammo)
for _, e in pairs(surface.find_entities_filtered({area = {{position.x - radius, position.y - radius},{position.x + radius, position.y + radius}}})) do
if e.health then
if e.force.name ~= "player" then
local distance_from_center = math_sqrt((e.position.x - position.x) ^ 2 + (e.position.y - position.y) ^ 2)
if distance_from_center <= radius then
--local distance_from_center = math_sqrt((e.position.x - position.x) ^ 2 + (e.position.y - position.y) ^ 2)
--if distance_from_center <= radius then
valid_entities[#valid_entities + 1] = e
end
--end
end
end
end

View File

@ -13,7 +13,7 @@ local function init_surface()
local map_gen_settings = {}
map_gen_settings.water = "0.3"
map_gen_settings.starting_area = "2"
map_gen_settings.starting_area = "2.2"
map_gen_settings.cliff_settings = {cliff_elevation_interval = 40, cliff_elevation_0 = 40}
map_gen_settings.autoplace_controls = {
["coal"] = {frequency = "7", size = "0.5", richness = "0.5"},
@ -32,6 +32,7 @@ local function init_surface()
local surface = game.create_surface("mixed_railworld", map_gen_settings)
surface.request_to_generate_chunks({x = 0, y = 0}, 1)
surface.force_generate_chunk_requests()
surface.daytime = 0.7
game.forces["player"].set_spawn_position({0,0},game.surfaces["mixed_railworld"])
@ -39,10 +40,9 @@ local function init_surface()
end
local function on_player_joined_game(event)
local surface = init_surface()
local surface = init_surface()
local player = game.players[event.player_index]
local surface = game.surfaces["mixed_railworld"]
if player.online_time == 0 then
player.teleport(surface.find_non_colliding_position("character", {0,0}, 2, 1), "mixed_railworld")
player.insert({name = 'car', count = 1})

View File

@ -17,6 +17,7 @@ local immune_tiles = {
local function on_player_changed_position(event)
local player = game.players[event.player_index]
if not player.character then return end
if player.character.driving == true then return end
if player.surface.daytime < 0.33 then return end
if player.surface.daytime > 0.66 then return end