1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2024-12-30 23:17:53 +02:00

Fix magic loot chests

This commit is contained in:
Gerkiz 2023-12-08 13:52:17 +01:00
parent 29a1d9b3f3
commit 70c32eaec7

View File

@ -496,37 +496,19 @@ local mining_events = {
function()
end,
300000,
'Nothing'
'Nothing #1'
},
{
function()
end,
16384,
'Nothing'
'Nothing #2'
},
{
function()
end,
4096,
'Nothing'
},
{
function()
end,
300000,
'Nothing'
},
{
function()
end,
32384,
'Nothing'
},
{
function()
end,
8096,
'Nothing'
'Nothing #3'
},
{
function(entity)
@ -539,33 +521,7 @@ local mining_events = {
entity.destroy()
end,
4096,
'Angry Biter_1'
},
{
function(entity)
if Public.is_around_train(entity) then
entity.destroy()
return
end
Public.buried_biter(entity.surface, entity.position)
entity.destroy()
end,
2048,
'Angry Biter_2'
},
{
function(entity)
if Public.is_around_train(entity) then
entity.destroy()
return
end
Public.buried_biter(entity.surface, entity.position)
entity.destroy()
end,
1024,
'Angry Biter_3'
'Angry Biter #1'
},
{
function(entity)
@ -578,20 +534,7 @@ local mining_events = {
entity.destroy()
end,
512,
'Angry Biter_4'
},
{
function(entity)
if Public.is_around_train(entity) then
entity.destroy()
return
end
Public.buried_biter(entity.surface, entity.position)
entity.destroy()
end,
512,
'Angry Biter_4'
'Angry Biter #2'
},
{
function(entity)
@ -604,20 +547,7 @@ local mining_events = {
entity.destroy()
end,
2048,
'Angry Worm_1'
},
{
function(entity)
if Public.is_around_train(entity) then
entity.destroy()
return
end
Public.buried_worm(entity.surface, entity.position)
entity.destroy()
end,
4096,
'Angry Worm_2'
'Angry Worm #1'
},
{
function(entity)
@ -630,54 +560,7 @@ local mining_events = {
entity.destroy()
end,
2048,
'Dangerous Trap_1'
},
{
function(entity)
if Public.is_around_train(entity) then
entity.destroy()
return
end
Public.tick_tack_trap(entity.surface, entity.position)
entity.destroy()
end,
4096,
'Dangerous Trap_2'
},
{
function(entity, index)
if Public.is_around_train(entity) then
entity.destroy()
return
end
local player = game.get_player(index)
if entity.type == 'tree' then
angry_tree(entity, player.character, player)
entity.destroy()
end
end,
4096,
'Angry Tree_1'
},
{
function(entity, index)
if Public.is_around_train(entity) then
entity.destroy()
return
end
local player = game.get_player(index)
if entity.type == 'tree' then
angry_tree(entity, player.character, player)
entity.destroy()
end
end,
2048,
'Angry Tree_2'
'Dangerous Trap #1'
},
{
function(entity, index)
@ -694,7 +577,23 @@ local mining_events = {
end
end,
1024,
'Angry Tree_3'
'Angry Tree #1'
},
{
function(entity, index)
local player = game.get_player(index)
hidden_treasure(player, entity)
end,
1024,
'Treasure Tier #1'
},
{
function(entity, index)
local player = game.get_player(index)
hidden_treasure(player, entity)
end,
512,
'Treasure Tier #2'
},
{
function(entity, index)
@ -702,7 +601,7 @@ local mining_events = {
hidden_treasure(player, entity)
end,
256,
'Treasure_Tier_1'
'Treasure Tier #3'
},
{
function(entity, index)
@ -710,7 +609,7 @@ local mining_events = {
hidden_treasure(player, entity)
end,
128,
'Treasure_Tier_2'
'Treasure Tier #4'
},
{
function(entity, index)
@ -718,7 +617,7 @@ local mining_events = {
hidden_treasure(player, entity)
end,
64,
'Treasure_Tier_3'
'Treasure Tier #5'
},
{
function(entity, index)
@ -726,7 +625,7 @@ local mining_events = {
hidden_treasure(player, entity)
end,
32,
'Treasure_Tier_4'
'Treasure Tier #6'
},
{
function(entity, index)
@ -734,27 +633,7 @@ local mining_events = {
hidden_treasure(player, entity)
end,
16,
'Treasure_Tier_5'
},
{
function(entity, index)
if Public.is_around_train(entity) then
entity.destroy()
return
end
local ent_to_create = {'biter-spawner', 'spitter-spawner'}
local position = entity.position
local surface = entity.surface
local e = surface.create_entity({name = ent_to_create[random(1, #ent_to_create)], position = position, force = 'enemy'})
e.destructible = false
Task.set_timeout_in_ticks(300, immunity_spawner, {entity = e})
Public.unstuck_player(index)
end,
1024,
'Nest'
'Treasure Tier #7'
},
{
function(entity, index)
@ -774,7 +653,27 @@ local mining_events = {
Public.unstuck_player(index)
end,
512,
'Nest'
'Nest #1'
},
{
function(entity, index)
if Public.is_around_train(entity) then
entity.destroy()
return
end
local ent_to_create = {'biter-spawner', 'spitter-spawner'}
local position = entity.position
local surface = entity.surface
local e = surface.create_entity({name = ent_to_create[random(1, #ent_to_create)], position = position, force = 'enemy'})
e.destructible = false
Task.set_timeout_in_ticks(300, immunity_spawner, {entity = e})
Public.unstuck_player(index)
end,
512,
'Nest #2'
},
{
function(entity)
@ -783,7 +682,7 @@ local mining_events = {
surface.create_entity({name = 'compilatron', position = position, force = 'player'})
end,
64,
'Friendly Compilatron'
'Friendly Compilatron #1'
},
{
function(entity)
@ -797,7 +696,7 @@ local mining_events = {
surface.create_entity({name = 'compilatron', position = position, force = 'enemy'})
end,
128,
'Enemy Compilatron'
'Enemy Compilatron #1'
},
{
function(entity)
@ -808,8 +707,8 @@ local mining_events = {
container.health = random(1, container.health)
end
end,
32,
'VSMG'
64,
'VSMG #1'
},
{
function(entity, index)
@ -821,8 +720,8 @@ local mining_events = {
local msg = ({'entity.found_car', player.name})
Alert.alert_player(player, 15, msg)
end,
16,
'Car'
32,
'Car #1'
}
}