1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2024-12-28 23:06:38 +02:00

Fix fish defender v2 (again?)

This commit is contained in:
Gerkiz 2024-11-06 19:44:18 +01:00
parent 72eb140f83
commit cb2cd16e2a
4 changed files with 71 additions and 66 deletions

View File

@ -490,18 +490,20 @@ local function send_unit_group(unit_group)
if not (market and market.valid) then
return
end
commands[#commands + 1] = {
type = defines.command.attack_area,
destination = { x = market.position.x, y = unit_group.position.y },
radius = 16,
distraction = defines.distraction.by_enemy
}
commands[#commands + 1] = {
type = defines.command.attack,
target = market,
distraction = defines.distraction.by_enemy
}
commands[#commands + 1] = {
type = defines.command.attack_area,
destination = { x = market.position.x, y = market.position.y },
radius = 256,
distraction = defines.distraction.by_anything
}
unit_group.set_command(
{
type = defines.command.compound,
@ -606,9 +608,10 @@ local function wake_up_the_biters(surface)
surface.set_multi_command(
{
command = {
type = defines.command.attack,
target = market,
distraction = defines.distraction.none
type = defines.command.attack_area,
destination = { x = market.position.x, y = market.position.y },
radius = 32,
distraction = defines.distraction.by_enemy
},
unit_count = 16,
force = 'enemy',

View File

@ -24,7 +24,7 @@ local function refresh_market_offers()
if not market or not market.valid then
return
end
for i = 1, 100, 1 do
for _ = 1, 100, 1 do
local a = market.remove_market_item(1)
if a == false then
break
@ -58,52 +58,52 @@ local function refresh_market_offers()
{ price = {}, offer = { type = 'nothing', effect_description = str3 } },
{ price = {}, offer = { type = 'nothing', effect_description = str4 } },
{ price = {}, offer = { type = 'nothing', effect_description = str5 } },
{ price = { name = { 'coin', count = 5 } }, offer = { type = 'give-item', item = 'raw-fish', count = 1 } },
{ price = { name = { 'coin', count = 1 } }, offer = { type = 'give-item', item = 'wood', count = 8 } },
{ price = { name = { 'coin', count = 8 } }, offer = { type = 'give-item', item = 'grenade', count = 1 } },
{ price = { name = { 'coin', count = 32 } }, offer = { type = 'give-item', item = 'cluster-grenade', count = 1 } },
{ price = { name = { 'coin', count = 1 } }, offer = { type = 'give-item', item = 'land-mine', count = 1 } },
{ price = { name = { 'coin', count = 80 } }, offer = { type = 'give-item', item = 'car', count = 1 } },
{ price = { name = { 'coin', count = 1200 } }, offer = { type = 'give-item', item = 'tank', count = 1 } },
{ price = { name = { 'coin', count = 3 } }, offer = { type = 'give-item', item = 'cannon-shell', count = 1 } },
{ price = { name = { 'coin', count = 7 } }, offer = { type = 'give-item', item = 'explosive-cannon-shell', count = 1 } },
{ price = { name = { 'coin', count = 50 } }, offer = { type = 'give-item', item = 'gun-turret', count = 1 } },
{ price = { name = { 'coin', count = 300 } }, offer = { type = 'give-item', item = 'laser-turret', count = 1 } },
{ price = { name = { 'coin', count = 450 } }, offer = { type = 'give-item', item = 'artillery-turret', count = 1 } },
{ price = { name = { 'coin', count = 10 } }, offer = { type = 'give-item', item = 'artillery-shell', count = 1 } },
{ price = { name = { 'coin', count = 25 } }, offer = { type = 'give-item', item = 'artillery-targeting-remote', count = 1 } },
{ price = { name = { 'coin', count = 1 } }, offer = { type = 'give-item', item = 'firearm-magazine', count = 1 } },
{ price = { name = { 'coin', count = 4 } }, offer = { type = 'give-item', item = 'piercing-rounds-magazine', count = 1 } },
{ price = { name = { 'coin', count = 2 } }, offer = { type = 'give-item', item = 'shotgun-shell', count = 1 } },
{ price = { name = { 'coin', count = 6 } }, offer = { type = 'give-item', item = 'piercing-shotgun-shell', count = 1 } },
{ price = { name = { 'coin', count = 30 } }, offer = { type = 'give-item', item = 'submachine-gun', count = 1 } },
{ price = { name = { 'coin', count = 250 } }, offer = { type = 'give-item', item = 'combat-shotgun', count = 1 } },
{ price = { name = { 'coin', count = 450 } }, offer = { type = 'give-item', item = 'flamethrower', count = 1 } },
{ price = { name = { 'coin', count = 25 } }, offer = { type = 'give-item', item = 'flamethrower-ammo', count = 1 } },
{ price = { name = { 'coin', count = 125 } }, offer = { type = 'give-item', item = 'rocket-launcher', count = 1 } },
{ price = { name = { 'coin', count = 2 } }, offer = { type = 'give-item', item = 'rocket', count = 1 } },
{ price = { name = { 'coin', count = 7 } }, offer = { type = 'give-item', item = 'explosive-rocket', count = 1 } },
{ price = { name = { 'coin', count = 7500 } }, offer = { type = 'give-item', item = 'atomic-bomb', count = 1 } },
{ price = { name = { 'coin', count = 40 } }, offer = { type = 'give-item', item = 'poison-capsule', count = 1 } },
{ price = { name = { 'coin', count = 4 } }, offer = { type = 'give-item', item = 'defender-capsule', count = 1 } },
{ price = { name = { 'coin', count = 10 } }, offer = { type = 'give-item', item = 'light-armor', count = 1 } },
{ price = { name = { 'coin', count = 125 } }, offer = { type = 'give-item', item = 'heavy-armor', count = 1 } },
{ price = { name = { 'coin', count = 350 } }, offer = { type = 'give-item', item = 'modular-armor', count = 1 } },
{ price = { name = { 'coin', count = 1500 } }, offer = { type = 'give-item', item = 'power-armor', count = 1 } },
{ price = { name = { 'coin', count = 12000 } }, offer = { type = 'give-item', item = 'power-armor-mk2', count = 1 } },
{ price = { name = { 'coin', count = 50 } }, offer = { type = 'give-item', item = 'solar-panel-equipment', count = 1 } },
{ price = { name = { 'coin', count = 2250 } }, offer = { type = 'give-item', item = 'fission-reactor-equipment', count = 1 } },
{ price = { name = { 'coin', count = 100 } }, offer = { type = 'give-item', item = 'battery-equipment', count = 1 } },
{ price = { name = { 'coin', count = 200 } }, offer = { type = 'give-item', item = 'energy-shield-equipment', count = 1 } },
{ price = { name = { 'coin', count = 850 } }, offer = { type = 'give-item', item = 'personal-laser-defense-equipment', count = 1 } },
{ price = { name = { 'coin', count = 175 } }, offer = { type = 'give-item', item = 'exoskeleton-equipment', count = 1 } },
{ price = { name = { 'coin', count = 125 } }, offer = { type = 'give-item', item = 'night-vision-equipment', count = 1 } },
{ price = { name = { 'coin', count = 200 } }, offer = { type = 'give-item', item = 'belt-immunity-equipment', count = 1 } },
{ price = { name = { 'coin', count = 250 } }, offer = { type = 'give-item', item = 'personal-roboport-equipment', count = 1 } },
{ price = { name = { 'coin', count = 350 } }, offer = { type = 'give-item', item = 'roboport', count = 1 } },
{ price = { name = { 'coin', count = 50 } }, offer = { type = 'give-item', item = 'storage-chest', count = 1 } },
{ price = { name = { 'coin', count = 35 } }, offer = { type = 'give-item', item = 'construction-robot', count = 1 } },
{ price = { name = { 'coin', count = 25 } }, offer = { type = 'give-item', item = 'cliff-explosives', count = 1 } }
{ price = { { name = 'coin', count = 5 } }, offer = { type = 'give-item', item = 'raw-fish', count = 1 } },
{ price = { { name = 'coin', count = 1 } }, offer = { type = 'give-item', item = 'wood', count = 8 } },
{ price = { { name = 'coin', count = 8 } }, offer = { type = 'give-item', item = 'grenade', count = 1 } },
{ price = { { name = 'coin', count = 32 } }, offer = { type = 'give-item', item = 'cluster-grenade', count = 1 } },
{ price = { { name = 'coin', count = 1 } }, offer = { type = 'give-item', item = 'land-mine', count = 1 } },
{ price = { { name = 'coin', count = 80 } }, offer = { type = 'give-item', item = 'car', count = 1 } },
{ price = { { name = 'coin', count = 1200 } }, offer = { type = 'give-item', item = 'tank', count = 1 } },
{ price = { { name = 'coin', count = 3 } }, offer = { type = 'give-item', item = 'cannon-shell', count = 1 } },
{ price = { { name = 'coin', count = 7 } }, offer = { type = 'give-item', item = 'explosive-cannon-shell', count = 1 } },
{ price = { { name = 'coin', count = 50 } }, offer = { type = 'give-item', item = 'gun-turret', count = 1 } },
{ price = { { name = 'coin', count = 300 } }, offer = { type = 'give-item', item = 'laser-turret', count = 1 } },
{ price = { { name = 'coin', count = 450 } }, offer = { type = 'give-item', item = 'artillery-turret', count = 1 } },
{ price = { { name = 'coin', count = 10 } }, offer = { type = 'give-item', item = 'artillery-shell', count = 1 } },
{ price = { { name = 'coin', count = 25 } }, offer = { type = 'give-item', item = 'artillery-targeting-remote', count = 1 } },
{ price = { { name = 'coin', count = 1 } }, offer = { type = 'give-item', item = 'firearm-magazine', count = 1 } },
{ price = { { name = 'coin', count = 4 } }, offer = { type = 'give-item', item = 'piercing-rounds-magazine', count = 1 } },
{ price = { { name = 'coin', count = 2 } }, offer = { type = 'give-item', item = 'shotgun-shell', count = 1 } },
{ price = { { name = 'coin', count = 6 } }, offer = { type = 'give-item', item = 'piercing-shotgun-shell', count = 1 } },
{ price = { { name = 'coin', count = 30 } }, offer = { type = 'give-item', item = 'submachine-gun', count = 1 } },
{ price = { { name = 'coin', count = 250 } }, offer = { type = 'give-item', item = 'combat-shotgun', count = 1 } },
{ price = { { name = 'coin', count = 450 } }, offer = { type = 'give-item', item = 'flamethrower', count = 1 } },
{ price = { { name = 'coin', count = 25 } }, offer = { type = 'give-item', item = 'flamethrower-ammo', count = 1 } },
{ price = { { name = 'coin', count = 125 } }, offer = { type = 'give-item', item = 'rocket-launcher', count = 1 } },
{ price = { { name = 'coin', count = 2 } }, offer = { type = 'give-item', item = 'rocket', count = 1 } },
{ price = { { name = 'coin', count = 7 } }, offer = { type = 'give-item', item = 'explosive-rocket', count = 1 } },
{ price = { { name = 'coin', count = 7500 } }, offer = { type = 'give-item', item = 'atomic-bomb', count = 1 } },
{ price = { { name = 'coin', count = 40 } }, offer = { type = 'give-item', item = 'poison-capsule', count = 1 } },
{ price = { { name = 'coin', count = 4 } }, offer = { type = 'give-item', item = 'defender-capsule', count = 1 } },
{ price = { { name = 'coin', count = 10 } }, offer = { type = 'give-item', item = 'light-armor', count = 1 } },
{ price = { { name = 'coin', count = 125 } }, offer = { type = 'give-item', item = 'heavy-armor', count = 1 } },
{ price = { { name = 'coin', count = 350 } }, offer = { type = 'give-item', item = 'modular-armor', count = 1 } },
{ price = { { name = 'coin', count = 1500 } }, offer = { type = 'give-item', item = 'power-armor', count = 1 } },
{ price = { { name = 'coin', count = 12000 } }, offer = { type = 'give-item', item = 'power-armor-mk2', count = 1 } },
{ price = { { name = 'coin', count = 50 } }, offer = { type = 'give-item', item = 'solar-panel-equipment', count = 1 } },
{ price = { { name = 'coin', count = 2250 } }, offer = { type = 'give-item', item = 'fission-reactor-equipment', count = 1 } },
{ price = { { name = 'coin', count = 100 } }, offer = { type = 'give-item', item = 'battery-equipment', count = 1 } },
{ price = { { name = 'coin', count = 200 } }, offer = { type = 'give-item', item = 'energy-shield-equipment', count = 1 } },
{ price = { { name = 'coin', count = 850 } }, offer = { type = 'give-item', item = 'personal-laser-defense-equipment', count = 1 } },
{ price = { { name = 'coin', count = 175 } }, offer = { type = 'give-item', item = 'exoskeleton-equipment', count = 1 } },
{ price = { { name = 'coin', count = 125 } }, offer = { type = 'give-item', item = 'night-vision-equipment', count = 1 } },
{ price = { { name = 'coin', count = 200 } }, offer = { type = 'give-item', item = 'belt-immunity-equipment', count = 1 } },
{ price = { { name = 'coin', count = 250 } }, offer = { type = 'give-item', item = 'personal-roboport-equipment', count = 1 } },
{ price = { { name = 'coin', count = 350 } }, offer = { type = 'give-item', item = 'roboport', count = 1 } },
{ price = { { name = 'coin', count = 50 } }, offer = { type = 'give-item', item = 'storage-chest', count = 1 } },
{ price = { { name = 'coin', count = 35 } }, offer = { type = 'give-item', item = 'construction-robot', count = 1 } },
{ price = { { name = 'coin', count = 25 } }, offer = { type = 'give-item', item = 'cliff-explosives', count = 1 } }
}

View File

@ -44,7 +44,7 @@ function Public.reset_table()
this.market_age = nil
this.last_reset = game.tick
this.wave_interval = 3600
this.wave_grace_period = game.tick + 7200
this.wave_grace_period = game.tick + 72000
-- this.wave_grace_period = game.tick + 3600
this.boss_biters = {}
this.acid_lines_delay = {}

View File

@ -45,10 +45,12 @@ function Public.init_player_table(player, reset)
return
end
if not this.score_table then return end
if not this.score_table[player.force.name] then return end
if not this.score_table[player.force.name].players then return end
if not this.score_table[player.force.name] then this.score_table[player.force.name] = { players = {} } end
local tbl_force = this.score_table[player.force.name]
if reset then
this.score_table[player.force.name].players[player.name] = {
tbl_force.players[player.name] = {
built_entities = 0,
deaths = 0,
killscore = 0,
@ -57,18 +59,18 @@ function Public.init_player_table(player, reset)
}
end
if not this.score_table[player.force.name] then
this.score_table[player.force.name] = {}
if not tbl_force then
tbl_force = {}
end
if not this.score_table[player.force.name].players then
this.score_table[player.force.name].players = {}
if not tbl_force.players then
tbl_force.players = {}
end
if not player.name then return end
if not this.score_table[player.force.name].players[player.name] then
this.score_table[player.force.name].players[player.name] = {
if not tbl_force.players[player.name] then
tbl_force.players[player.name] = {
built_entities = 0,
deaths = 0,
killscore = 0,