1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2025-02-21 19:20:07 +02:00

Frontier fixes

This commit is contained in:
RedRafe 2024-10-27 00:21:57 +02:00
parent a52eee7f49
commit 8dc2c3e78a
3 changed files with 13 additions and 7 deletions

View File

@ -439,7 +439,11 @@ function Enemy.stop_tracking(entity)
end
function Enemy.get_target()
return Table.get_random_dictionary_entry(Public.get().target_entities, false)
local _list = Public.get().target_entities
if table_size(_list) == 0 then
return
end
return Table.get_random_dictionary_entry(_list, false)
end
function Enemy.nuclear_explosion(position)

View File

@ -213,7 +213,7 @@ function SpawnShop.draw_gui(player)
table.add {
type = 'sprite-button',
sprite = 'item/'..item_stack.name,
style = satisfied and 'recipe_slot_button' or 'yellow_slot_button',
style = satisfied and 'slot_button' or 'yellow_slot_button',
number = item_stack.count,
tooltip = {'frontier.tt_shop_item_stack', {'?', {'item-name.'..item_stack.name}, {'entity-name.'..item_stack.name}, item_stack.name}, item_stack.count, (satisfied and 'green' or 'yellow') }
}
@ -397,7 +397,9 @@ end
function SpawnShop.on_player_refresh(player)
local this = Public.get()
this.spawn_shop_funds = this.spawn_shop_funds - 1
this.spawn_shop_cooldown[player.index] = game.tick + 40 * SECOND
if not player.admin then
this.spawn_shop_cooldown[player.index] = game.tick + 40 * SECOND
end
ScoreTracker.set_for_global(Public.scores.shop_funds.name, this.spawn_shop_funds)
player.print('[color=orange][Bard][/color] ' .. bard_refresh_messages[math_random(#bard_refresh_messages)], { sound_path = 'utility/scenario_message', color = Color.dark_grey })
if this.spawn_shop_funds <= 5 then

View File

@ -203,7 +203,7 @@ function Terrain.scale_resource_richness(surface, area)
if resource.prototype.resource_category == 'basic-fluid' then
resource.amount = this.ore_base_quantity * 800 * chunks
elseif resource.prototype.resource_category == 'basic-solid' then
resource.amount = math_min(0.7 * resource.amount, this.ore_base_quantity * 10 + math_random(100))
resource.amount = math_min(1+ 0.7 * resource.amount, this.ore_base_quantity * 10 + math_random(100))
end
else
if resource.prototype.resource_category == 'basic-fluid' then
@ -449,7 +449,7 @@ function Terrain.clear_area(args)
end
local tiles = {}
for _, t in pairs(surface.find_tiles_filtered{ area = area }) do
if t.collides_with('item_layer') then
if t.collides_with('item') then
tiles[#tiles +1] = { name = 'nuclear-ground', position = t.position }
end
end
@ -461,7 +461,7 @@ function Terrain.clear_area(args)
end
local tiles = {}
for _, t in pairs(surface.find_tiles_filtered{ position = position, radius = args.radius }) do
if t.collides_with('item_layer') then
if t.collides_with('item') then
tiles[#tiles +1] = { name = 'nuclear-ground', position = t.position }
end
end
@ -484,7 +484,7 @@ function Terrain.clear_area(args)
end
local tiles = {}
for _, t in pairs(surface.find_tiles_filtered{ area = area }) do
if t.collides_with('item_layer') then
if t.collides_with('item') then
tiles[#tiles +1] = { name = 'nuclear-ground', position = t.position }
end
end