1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-28 03:57:22 +02:00

more tweaks

This commit is contained in:
Gerkiz 2020-08-26 12:09:06 +02:00
parent b5990868e4
commit 450909d0ee
4 changed files with 40 additions and 74 deletions

View File

@ -61,13 +61,6 @@ local defeated_messages = {
"Looks like we're resetting cause you did not defend the train ._."
}
local entity_type = {
['unit'] = true,
['unit-spawner'] = true,
['simple-entity'] = true,
['tree'] = true
}
local protect_types = {
['cargo-wagon'] = true,
['artillery-wagon'] = true,
@ -670,12 +663,40 @@ local function on_entity_died(event)
return
end
if entity.type == 'unit' or entity.type == 'unit-spawner' then
this.biters_killed = this.biters_killed + 1
if Locomotive.is_around_train(entity) then
entity.destroy()
return
end
if random(1, 512) == 1 then
Traps(entity.surface, entity.position)
return
end
end
local data = {
entity = entity,
surface = entity.surface
}
if entity.type == 'tree' then
for _, e in pairs(
event.entity.surface.find_entities_filtered(
{
area = {
{entity.position.x - 4, entity.position.y - 4},
{entity.position.x + 4, entity.position.y + 4}
},
name = 'fire-flame-on-tree'
}
)
) do
if e.valid then
e.destroy()
return
end
end
if Locomotive.is_around_train(entity) then
entity.destroy()
return
@ -684,31 +705,28 @@ local function on_entity_died(event)
return
end
if entity_type[entity.type] then
if entity.type == 'simple-entity' then
if Locomotive.is_around_train(entity) then
entity.destroy()
return
end
if entity.type == 'unit' or entity_type == 'unit-spawner' then
this.biters_killed = this.biters_killed + 1
end
if random(1, 32) == 1 then
hidden_biter(entity)
Mining.entity_died_randomness(data)
entity.destroy()
return
end
if random(1, 368) == 1 then
if random(1, 64) == 1 then
hidden_worm(entity)
Mining.entity_died_randomness(data)
entity.destroy()
return
end
if random(1, 368) == 1 then
if random(1, 512) == 1 then
Traps(entity.surface, entity.position)
Mining.entity_died_randomness(data)
return
end
end
if entity.type == 'simple-entity' then
Mining.entity_died_randomness(data)
entity.destroy()
return

View File

@ -407,7 +407,9 @@ local function redraw_market_items(gui, player, search_text)
end
local players = WPT.get('players')
gui.clear()
if gui and gui.valid then
gui.clear()
end
local inventory = player.get_main_inventory()
local player_item_count
@ -587,7 +589,8 @@ local function text_changed(event)
if not data then
return
end
if not data.text_input then
if not data.text_input or not data.text_input.valid then
return
end

View File

@ -931,17 +931,6 @@ local function process_level_9_position(x, y, data)
return
end
local value = WPT.get('math_difficulty')
if random(1, value) == 1 then
entities[#entities + 1] = {
name = spawner[random(1, size_of_spawner)],
position = p,
force = 'protectors'
}
return
end
--Resource Spots
if smol_areas < -0.72 then
if random(1, 8) == 1 then
@ -989,17 +978,6 @@ local function process_level_8_position(x, y, data, void_or_lab)
end
end
local value = WPT.get('math_difficulty')
if random(1, value) == 1 then
entities[#entities + 1] = {
name = spawner[random(1, size_of_spawner)],
position = p,
force = 'protectors'
}
return
end
if scrapyard < -0.25 or scrapyard > 0.25 then
if random(1, 256) == 1 then
if random(1, 8) == 1 then
@ -1373,17 +1351,6 @@ local function process_level_5_position(x, y, data, void_or_lab)
end
end
local value = WPT.get('math_difficulty')
if random(1, value) == 1 then
entities[#entities + 1] = {
name = spawner[random(1, size_of_spawner)],
position = p,
force = 'protectors'
}
return
end
if small_caves > -0.40 and small_caves < 0.40 then
if noise_cave_ponds > 0.35 then
local success = place_wagon(data)
@ -1565,17 +1532,6 @@ local function process_level_3_position(x, y, data, void_or_lab)
return
end
local value = WPT.get('math_difficulty')
if random(1, value) == 1 then
entities[#entities + 1] = {
name = spawner[random(1, size_of_spawner)],
position = p,
force = 'protectors'
}
return
end
if noise_large_caves > -0.15 and noise_large_caves < 0.15 or small_caves_2 > 0 then
--Green Water Ponds
if noise_cave_ponds > 0.80 then
@ -2048,17 +2004,6 @@ local function process_level_1_position(x, y, data, void_or_lab)
return
end
local value = WPT.get('math_difficulty')
if random(1, value) == 1 then
entities[#entities + 1] = {
name = spawner[random(1, size_of_spawner)],
position = p,
force = 'protectors'
}
return
end
--Rivers
local cave_rivers = get_noise('cave_rivers', p, seed + 300000)
if cave_rivers < 0.042 and cave_rivers > -0.042 then

View File

@ -3,7 +3,7 @@ local WPT = require 'maps.mountain_fortress_v3.table'
local random = math.random
local tick_tacks = {'*tick*', '*tick*', '*tack*', '*tak*', '*tik*', '*tok*', '( ͡° ͜ʖ ͡°)'}
local tick_tacks = {'*tick*', '*tick*', '*tack*', '*tak*', '*tik*', '*tok*', 'OOF'}
local kaboom_weights = {
{name = 'grenade', chance = 7},