1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-02-03 13:12:11 +02:00
This commit is contained in:
danielmartin0 2022-03-15 18:50:19 +00:00
parent 81db6a80bc
commit e757c82661
19 changed files with 193 additions and 122 deletions

View File

@ -124,7 +124,7 @@ end
function Public.fuel_depletion_rate_sailing()
if (not Common.overworldx()) then return 0 end
return - 7.5 * (1 + 0.13 * (Common.overworldx()/40)^(100/100)) * Math.sloped(Common.difficulty(), 1/5) --shouldn't depend on difficulty much, as available resources don't depend much on difficulty
return - 7.0 * (1 + 0.13 * (Common.overworldx()/40)^(100/100)) * Math.sloped(Common.difficulty(), 1/20) --shouldn't depend on difficulty much if at all, as available resources don't depend much on difficulty
end
function Public.silo_total_pollution()

View File

@ -502,6 +502,20 @@ function(cmd)
end)
commands.add_command(
'overwrite_scores_specific',
'is a dev command.',
function(cmd)
if check_admin(cmd) then
local player = game.players[cmd.player_index]
if not Common.validate_player(player) then return end
local crew_id = tonumber(string.sub(game.players[cmd.player_index].force.name, -3, -1)) or nil
Memory.set_working_id(crew_id)
local memory = Memory.get_crew_memory()
if Highscore.overwrite_scores_specific() then player.print('Highscores overwritten.') end
end
end)
if _DEBUG then
@ -545,20 +559,6 @@ if _DEBUG then
Task.set_timeout_in_ticks(120, go_1, {})
end
end)
commands.add_command(
'overwrite_scores_specific',
'is a dev command.',
function(cmd)
if check_admin(cmd) then
local player = game.players[cmd.player_index]
if not Common.validate_player(player) then return end
local crew_id = tonumber(string.sub(game.players[cmd.player_index].force.name, -3, -1)) or nil
Memory.set_working_id(crew_id)
local memory = Memory.get_crew_memory()
if Highscore.overwrite_scores_specific() then player.print('Highscores overwritten.') end
end
end)
commands.add_command(
'chnk',

View File

@ -143,6 +143,11 @@ function Public.notify_player_expected(player, message, color_override)
player.print('>> [Whisper] ' .. message, color_override)
end
function Public.notify_player_announce(player, message, color_override)
color_override = color_override or CoreData.colors.notify_player_announce
player.print('>> [Whisper] ' .. message, color_override)
end
function Public.parrot_speak(force, message)
force.print('Parrot: ' .. message, CoreData.colors.parrot)
end
@ -621,7 +626,7 @@ function Public.spend_stored_resources(to_spend)
end
function Public.new_healthbar(id, text, target_entity, max_health, health, size)
function Public.new_healthbar(text, target_entity, max_health, optional_id, health, size)
health = health or max_health
size = size or 0.5
text = text or false
@ -660,7 +665,7 @@ function Public.new_healthbar(id, text, target_entity, max_health, health, size)
max_health = max_health,
render1 = render1,
render2 = render2,
id = id,
id = optional_id,
}
memory.healthbars[target_entity.unit_number] = new_healthbar
@ -670,6 +675,24 @@ function Public.new_healthbar(id, text, target_entity, max_health, health, size)
return new_healthbar
end
function Public.entity_damage_healthbar(entity, damage)
local memory = Memory.get_crew_memory()
local unit_number = entity.unit_number
local healthbar = memory.healthbars[unit_number]
if not healthbar then return 0 end
local new_health = healthbar.health - damage
healthbar.health = new_health
Public.update_healthbar_rendering(healthbar, new_health)
if entity and entity.valid then
entity.health = entity.prototype.max_health
end
return healthbar.health
end
function Public.update_healthbar_rendering(new_healthbar, health)
local max_health = new_healthbar.max_health
local render1 = new_healthbar.render1

View File

@ -5,8 +5,8 @@ local inspect = require 'utils.inspect'.inspect
local Public = {}
Public.scenario_id_name = 'pirates'
Public.version_string = '1.1.1.2'
Public.version_float = 1.112
Public.version_string = '1.1.1.4'
Public.version_float = 1.114
Public.blueprint_library_allowed = true
Public.blueprint_importing_allowed = true
@ -31,6 +31,7 @@ Public.colors = {
['copper-ore'] = {r=219, g=149, b=96},
notify_error = {r=170, g=170, b=170},
notify_player_expected = {r=255, g=231, b=46},
notify_player_announce = {r=244, g=255, b=145},
notify_game = {r=249, g=103, b=56},
notify_lobby = {r=249, g=153, b=56},
notify_force = {r=249, g=153, b=56},
@ -98,6 +99,7 @@ Public.comfy_emojis = {
}
Public.capacity_options = {
{value = 2, icon = 'virtual-signal/signal-2', text = '2', text2 = '/2', text3 = '2'},
{value = 4, icon = 'virtual-signal/signal-4', text = '4', text2 = '/4', text3 = '4'},
{value = 8, icon = 'virtual-signal/signal-8', text = '8', text2 = '/8', text3 = '8'},
{value = 24, icon = 'virtual-signal/signal-blue', text = '24', text2 = '/24', text3 = '24'},
@ -105,28 +107,32 @@ Public.capacity_options = {
-- {value = 64, icon = 'item/storage-tank', text = '64'},
}
Public.difficulty_options = {
{value = 0.6, icon = 'item/firearm-magazine', text = 'Easy', associated_color = {r = 50, g = 255, b = 50}},
{value = 1, icon = 'item/piercing-rounds-magazine', text = 'Normal', associated_color = {r = 255, g = 255, b = 50}},
{value = 1.4, icon = 'item/uranium-rounds-magazine', text = 'Hard', associated_color = {r = 255, g = 50, b = 50}},
{value = 3, icon = 'item/atomic-bomb', text = 'Nightmare', associated_color = {r = 50, g = 10, b = 10}},
}
-- Public.mode_options = {
-- left = {value = 'speedrun', icon = 'achievement/watch-your-step', text = 'Speedrun'},
-- right = {value = 'infinity', icon = 'achievement/mass-production-1', text = 'Infinity'},
-- }
-- The difficulty values we currently offer
function Public.highscore_difficulty_displayform(difficulty_value)
if difficulty_value < 1 then
--For the value of Easy difficulty, we are pulled in two directions: We wish to make the game comfy to play for those who haven't played it, but we also wish to represent the game mechanics faithfully so that Normal is not a crazy distance away.
{value = 0.55, icon = 'item/firearm-magazine', text = 'Easy', associated_color = {r = 50, g = 255, b = 50}},
{value = 0.9, icon = 'item/piercing-rounds-magazine', text = 'Normal', associated_color = {r = 255, g = 255, b = 50}},
{value = 1.5, icon = 'item/uranium-rounds-magazine', text = 'Hard', associated_color = {r = 255, g = 50, b = 50}},
{value = 3, icon = 'item/atomic-bomb', text = 'Nightmare', associated_color = {r = 120, g = 35, b = 35}},
}
function Public.get_difficulty_name_from_value(difficulty_value)
-- Functions will reference this when given a difficulty value and want to present a difficulty name to the player; just make it consistent with the above
if difficulty_value <= 0.7 then
return 'Easy'
elseif difficulty_value == 1 then
elseif difficulty_value < 1.3 then
return 'Normal'
elseif difficulty_value <= 1.5 then
elseif difficulty_value <= 2 then
return 'Hard'
else
return 'Nightmare'
end
end
-- Public.mode_options = {
-- left = {value = 'speedrun', icon = 'achievement/watch-your-step', text = 'Speedrun'},
-- right = {value = 'infinity', icon = 'achievement/mass-production-1', text = 'Infinity'},
-- }
Public.daynightcycle_types = {
{displayname = 'Static', 0},
{displayname = 'Slow Cyclic', ticksperday = 100000},

View File

@ -146,9 +146,9 @@ function Public.try_win()
memory.game_won = true
-- memory.crew_disband_tick = game.tick + 1200
Server.to_discord_embed_raw(CoreData.comfy_emojis.goldenobese .. '[' .. memory.name .. '] Victory, on v' .. CoreData.version_string .. ', ' .. CoreData.difficulty_options[memory.difficulty_option].text .. ', cap ' .. CoreData.capacity_options[memory.capacity_option].text3 .. '. Playtime: ' .. speedrun_time_str .. '[/font] since 1st island. Crewmembers: ' .. Public.get_crewmembers_printable_string())
Server.to_discord_embed_raw(CoreData.comfy_emojis.goldenobese .. '[' .. memory.name .. '] Victory, on v' .. CoreData.version_string .. ', ' .. CoreData.difficulty_options[memory.difficulty_option].text .. ', capacity ' .. CoreData.capacity_options[memory.capacity_option].text3 .. '. Playtime: ' .. speedrun_time_str .. ' since 1st island. Crewmembers: ' .. Public.get_crewmembers_printable_string())
Common.notify_game('[' .. memory.name .. '] Victory, on v' .. CoreData.version_string .. ', ' .. CoreData.difficulty_options[memory.difficulty_option].text .. ', cap ' .. CoreData.capacity_options[memory.capacity_option].text3 .. '. Playtime: [font=default-large-semibold]' .. speedrun_time_str .. '[/font] since 1st island. Crewmembers: ' .. Public.get_crewmembers_printable_string(), CoreData.colors.notify_victory)
Common.notify_game('[' .. memory.name .. '] Victory, on v' .. CoreData.version_string .. ', ' .. CoreData.difficulty_options[memory.difficulty_option].text .. ', capacity ' .. CoreData.capacity_options[memory.capacity_option].text3 .. '. Playtime: [font=default-large-semibold]' .. speedrun_time_str .. '[/font] since 1st island. Crewmembers: ' .. Public.get_crewmembers_printable_string(), CoreData.colors.notify_victory)
game.play_sound{path='utility/game_won', volume_modifier=0.9}
@ -380,6 +380,17 @@ function Public.join_crew(player, crewid, rejoin)
if #Common.crew_get_crew_members() == 1 and memory.crew_disband_tick then
memory.crew_disband_tick = nil --to prevent disbanding the crew after saving the game (booting everyone) and loading it again (joining the crew as the only member)
end
local personal_str = 'You have joined the crew ' .. memory.name
if memory.overworldx > 0 then
local color = CoreData.difficulty_options[memory.difficulty_option].associated_color
personal_str = personal_str .. ' [Capacity ' .. CoreData.capacity_options[memory.capacity_option].text3 .. ', Difficulty [color=' .. color.r .. ',' .. color.g .. ',' .. color.b .. ']' .. CoreData.difficulty_options[memory.difficulty_option].text .. '[/color]].'
else
personal_str = personal_str .. ' [Capacity ' .. CoreData.capacity_options[memory.capacity_option].text3 .. '].'
end
Common.notify_player_announce(player, personal_str)
end
end
@ -722,7 +733,7 @@ function Public.initialise_crew(accepted_proposal)
local crew_force = game.forces[string.format('crew-%03d', new_id)]
crew_force.set_spawn_position(memory.spawnpoint, surface)
local message = '[' .. accepted_proposal.name .. '] Launched.'
Common.notify_game(message)
-- Server.to_discord_embed_raw(CoreData.comfy_emojis.pogkot .. message .. ' Difficulty: ' .. CoreData.difficulty_options[memory.difficulty_option].text .. ', Capacity: ' .. CoreData.capacity_options[memory.capacity_option].text3 .. '.')

View File

@ -32,31 +32,40 @@ function Public.toggle_window(player)
flow = GuiCommon.new_window(player, window_name)
flow.caption = 'Crew'
--*** RUN AGE ***--
--*** PARAMETERS OF RUN ***--
flow2 = flow.add({
name = 'crew_capacity_and_difficulty',
type = 'label',
})
flow2.style.left_margin = 5
flow2.style.top_margin = 0
flow2.style.bottom_margin = -3
flow2.style.single_line = false
flow2.style.maximal_width = 190
flow2.style.font = 'default'
flow2 = flow.add({
name = 'crew_age',
type = 'label',
})
flow2.style.left_margin = 5
flow2.style.top_margin = 0
flow2.style.bottom_margin = -3
flow2.style.top_margin = -3
flow2.style.bottom_margin = 0
flow2.style.single_line = true
flow2.style.maximal_width = 200
flow2.style.font = 'default'
--*** RUN DIFFICULTY ***--
flow2 = flow.add({
name = 'crew_difficulty',
type = 'label',
})
flow2.style.left_margin = 5
flow2.style.top_margin = -3
flow2.style.bottom_margin = 0
flow2.style.single_line = false
flow2.style.maximal_width = 190
flow2.style.font = 'default'
-- flow2 = flow.add({
-- name = 'crew_difficulty',
-- type = 'label',
-- })
-- flow2.style.left_margin = 5
-- flow2.style.top_margin = -3
-- flow2.style.bottom_margin = 0
-- flow2.style.single_line = false
-- flow2.style.maximal_width = 190
-- flow2.style.font = 'default'
--*** MEMBERSHIP BUTTONS ***--
@ -460,7 +469,8 @@ function Public.full_update(player)
flow.caption = memory.name
flow.crew_age.caption = 'Age: ' .. Utils.time_mediumform((memory.age or 0)/60)
flow.crew_difficulty.caption = 'Difficulty: ' .. CoreData.difficulty_options[memory.difficulty_option].text
-- flow.crew_difficulty.caption = 'Difficulty: ' .. CoreData.difficulty_options[memory.difficulty_option].text
flow.crew_capacity_and_difficulty.caption = CoreData.difficulty_options[memory.difficulty_option].text .. ', Capacity ' .. CoreData.capacity_options[memory.capacity_option].text
if flow.spare_classes.visible then
local str = ''

View File

@ -320,7 +320,7 @@ function Public.toggle_window(player)
flow5.style.width = 200
flow5.style.margin = 0
flow_add_proposal_slider(flow5, 'capacity', 'Capacity', #CoreData.capacity_options, 4, {'pirates.capacity_tooltip'})
flow_add_proposal_slider(flow5, 'capacity', 'Capacity', #CoreData.capacity_options, 5, {'pirates.capacity_tooltip'})
-- flow_add_proposal_slider(flow5, 'difficulty', 'Difficulty', #CoreData.difficulty_options, 2, {'pirates.difficulty_tooltip'})
-- flow_add_proposal_switch(flow5, 'mode', 'Mode', 'left', {'pirates.mode_tooltip'})

View File

@ -255,9 +255,10 @@ function Public.dump_highscores()
end
function Public.overwrite_scores_specific()
return nil
-- the correct format is to put _everything_ from a dump into the third argument:
-- Server.set_data(score_dataset, score_key, {})
-- Server.set_data(score_dataset, score_key, )
-- return true
return nil
end
function Public.write_score(crew_secs_id, name, captain_name, completion_time, leagues_travelled, version, difficulty, max_players)
@ -438,7 +439,7 @@ local function score_gui(data)
local n = entry.completion_time > 0 and Utils.time_mediumform(entry.completion_time or 0) or 'N/A'
local l = entry.leagues_travelled > 0 and entry.leagues_travelled or '?'
local v = entry.version > 0 and entry.version or '?'
local d = entry.difficulty > 0 and CoreData.highscore_difficulty_displayform(entry.difficulty) or '?'
local d = entry.difficulty > 0 and CoreData.get_difficulty_name_from_value(entry.difficulty) or '?'
local c = entry.max_players > 0 and entry.max_players or '?'
local line = {
{caption = entry.name, color = special_color},

View File

@ -152,16 +152,24 @@ local function silo_damage(event)
end
local function enemyboat_spawners_invulnerable(event)
local function damage_to_enemyboat_spawners(event)
local memory = Memory.get_crew_memory()
if event.cause and event.cause.valid and event.entity and event.entity.valid then
if event.entity.force.name == memory.enemy_force_name then
if memory.enemyboats then
if memory.enemyboats and #memory.enemyboats > 0 then
if event.cause and event.cause.valid and event.entity and event.entity.valid then
if event.entity.force.name == memory.enemy_force_name then
for i = 1, #memory.enemyboats do
local eb = memory.enemyboats[i]
if eb.spawner and eb.spawner.valid and event.entity == eb.spawner and eb.state == Structures.Boats.enum_state.APPROACHING then
event.entity.health = event.entity.health + event.final_damage_amount
if eb.spawner and eb.spawner.valid and event.entity == eb.spawner then
-- if eb.spawner and eb.spawner.valid and event.entity == eb.spawner and eb.state == Structures.Boats.enum_state.APPROACHING then
local damage = event.final_damage_amount
local adjusted_damage = damage
adjusted_damage = adjusted_damage / 5
if Common.entity_damage_healthbar(event.entity, adjusted_damage) < 0 then
event.entity.die()
end
end
end
end
@ -224,16 +232,8 @@ local function damage_to_krakens(event)
adjusted_damage = adjusted_damage / 8 --laser turrets are in range
end
local healthbar = memory.healthbars[unit_number]
if not healthbar then return end
event.entity.health = 350 --set to full hp
local new_health = healthbar.health - adjusted_damage
healthbar.health = new_health
Common.update_healthbar_rendering(healthbar, new_health)
if new_health < 0 then
Kraken.kraken_die(healthbar.id)
if Common.entity_damage_healthbar(event.entity, adjusted_damage) < 0 then
Kraken.kraken_die(memory.healthbars[unit_number].id)
end
end
@ -449,7 +449,7 @@ local function event_on_entity_damaged(event)
damage_to_players_changes(event)
enemyboat_spawners_invulnerable(event)
damage_to_enemyboat_spawners(event)
biters_chew_stuff_faster(event)
damage_to_artillery(event)
swamp_resist_poison(event)
@ -1078,10 +1078,7 @@ local function event_on_player_joined_game(event)
if ages[1] then
Crew.join_crew(player, ages[1].id)
if ages[2] then
Common.notify_player_expected(player, 'There are multiple crews on this server. You have been placed in the oldest.')
end
if global_memory.crew_memories[ages[1].id] and global_memory.crew_memories[ages[1].id].id == ages[1].id and global_memory.crew_memories[ages[1].id].capacity and global_memory.crew_memories[ages[1].id].capacity < Common.minimum_run_capacity_to_enforce_space_for then
Common.notify_player_expected(player, 'NOTE: Your crew has a reduced capacity of ' .. global_memory.crew_memories[ages[1].id].capacity .. ' maximum players.')
Common.notify_player_announce(player, 'There are multiple crews on this server. You have been placed in the oldest.')
end
end
end

View File

@ -282,10 +282,10 @@ function Public.generate_overworld_destination(p)
-- -- debug override:
if _DEBUG then
base_cost_to_undock = {
['electronic-circuit'] = 200,
['launch_rocket'] = true,
}
-- base_cost_to_undock = {
-- ['electronic-circuit'] = 200,
-- ['launch_rocket'] = true,
-- }
end
static_params.base_cost_to_undock = base_cost_to_undock -- Multiplication by Balance.cost_to_leave_multiplier() happens later, in destination_on_collide.

View File

@ -340,13 +340,13 @@ function Public.check_for_end_of_boat_movement(boat)
return true
elseif boat.spawner and boat.spawner.valid and boat.spawner.destructible then
-- This code seems to make the spawner destructible a little earlier than when it hits the shore
local boat2 = Utils.deepcopy(boat)
boat2.position = {x = boat.position.x + 6, y = boat.position.y}
if Boats.collision_infront(boat2) then
boat.spawner.destructible = false
end
-- elseif boat.spawner and boat.spawner.valid and boat.spawner.destructible then
-- -- This code was somehow making the spawners destructible but still able to be shot at.
-- local boat2 = Utils.deepcopy(boat)
-- boat2.position = {x = boat.position.x + 6, y = boat.position.y}
-- if Boats.collision_infront(boat2) then
-- boat.spawner.destructible = false
-- end
end
end
@ -514,18 +514,20 @@ function Public.go_from_currentdestination_to_sea()
Boats.teleport_boat(boat, seaname, new_boatposition, CoreData.static_boat_floor, 'water')
if memory.overworldx == 0 and memory.boat then
if Common.difficulty() >= 1 and Common.difficulty() < 2 then
Boats.upgrade_chests(boat, 'iron-chest')
Hold.upgrade_chests(1, 'iron-chest')
Crowsnest.upgrade_chests('iron-chest')
Common.parrot_speak(memory.force, 'The harbor upgraded our ship\'s chests, due to our choice of difficulty.')
elseif Common.difficulty() >= 2 then
local difficulty_name = CoreData.get_difficulty_name_from_value(Common.difficulty())
if difficulty_name == CoreData.difficulty_options[#CoreData.difficulty_options].text then
Boats.upgrade_chests(boat, 'steel-chest')
Hold.upgrade_chests(1, 'steel-chest')
Crowsnest.upgrade_chests('steel-chest')
Common.parrot_speak(memory.force, 'The harbor upgraded our ship\'s chests, due to our choice of difficulty.')
Common.parrot_speak(memory.force, 'Steel chests for steel players! Squawk!')
elseif difficulty_name ~= CoreData.difficulty_options[1].text then
Boats.upgrade_chests(boat, 'iron-chest')
Hold.upgrade_chests(1, 'iron-chest')
Crowsnest.upgrade_chests('iron-chest')
Common.parrot_speak(memory.force, 'Iron chests for iron players! Squawk!')
end
end

View File

@ -6,6 +6,7 @@ local Common = require 'maps.pirates.common'
local Utils = require 'maps.pirates.utils_local'
local Math = require 'maps.pirates.math'
local Loot = require 'maps.pirates.loot'
local CoreData = require 'maps.pirates.coredata'
local inspect = require 'utils.inspect'.inspect
@ -208,6 +209,13 @@ function Public.initialise_worms_quest()
if Common.difficulty() < 1 then needed = Math.max(1, needed - 3) end
if Common.difficulty() > 1 then needed = Math.max(1, needed + 2) end
local difficulty_name = CoreData.get_difficulty_name_from_value(Common.difficulty())
if difficulty_name == CoreData.difficulty_options[1].text then
needed = Math.max(1, needed - 3)
elseif difficulty_name ~= CoreData.difficulty_options[2].text then
needed = Math.max(1, needed + 2)
end
if needed >= 5 then
destination.dynamic_data.quest_type = enum.WORMS
destination.dynamic_data.quest_reward = Public.quest_reward()

View File

@ -436,29 +436,32 @@ function Public.captain_requisition(captain_index)
if any_taken then
local str = 'The captain requisitioned '
local j = 1
for i = 1, #items_to_req do
local item = items_to_req[i]
local count = item_count_table[item]
if i > 1 then
if i == #items_to_req then
str = str .. ' and '
else
str = str .. ', '
if count > 0 then
if j > 1 then
if i == #items_to_req then
str = str .. ' and '
else
str = str .. ', '
end
end
end
local display_name = item .. 's'
if display_name == 'coins' then display_name = 'doubloons' end
if display_name == 'uranium-235s' then display_name = 'uranium-235' end
if count >= 1000 then
str = str .. Utils.bignumber_abbrevform2(count) .. ' ' .. display_name
else
str = str .. count .. ' ' .. display_name
local display_name = item
if display_name == 'coin' then display_name = 'doubloons' end
if count >= 1000 then
str = str .. Utils.bignumber_abbrevform2(count) .. ' ' .. display_name
else
str = str .. count .. ' ' .. display_name
end
j = j + 1
end
end
str = str .. '.'
Common.notify_force(memory.force, str)
else
Common.notify_player_error(captain, 'No important items found in crewmates\' inventories.')
Common.notify_player_error(captain, 'No important items found in crewmates\' inventories or cursor stacks.')
end
end
end

View File

@ -1051,7 +1051,7 @@ function Public.teleport_boat(boat, newsurface_name, newposition, new_floor_tile
local wire = v.wire
local source_circuit_id = v.source_circuit_id
local target_circuit_id = v.target_circuit_id
if e2 and e2.valid and e2.position then
if e2 and e2.valid and e2.position and (wire == defines.wire_type.red or wire == defines.wire_type.green) then --observed an error "Expected source_wire_id for entities with more than one wire connection" in the .connect_neighbour() function called later, so putting the red/green wire check in to try and catch it
local e2p = e2.position
if not circuit_neighbours_matrix[e2p.x] then
circuit_neighbours_matrix[e2p.x] = {}

View File

@ -182,10 +182,11 @@ function Public.create_hold_surface(nth)
end
if subtype == enum.SECONDARY then
if Common.difficulty() >= 1 and Common.difficulty() < 2 then
Public.upgrade_chests(nth, 'iron-chest')
elseif Common.difficulty() >= 2 then
local difficulty_name = CoreData.get_difficulty_name_from_value(Common.difficulty())
if difficulty_name == CoreData.difficulty_options[#CoreData.difficulty_options].text then
Public.upgrade_chests(nth, 'steel-chest')
elseif difficulty_name ~= CoreData.difficulty_options[1].text then
Public.upgrade_chests(nth, 'iron-chest')
end
Public.nth_hold_connect_linked_belts(nth)

View File

@ -383,7 +383,13 @@ function Public.spawn_enemy_boat(type)
Boats.place_boat(boat, CoreData.static_boat_floor, true, true)
local e = surface.create_entity({name = 'biter-spawner', force = boat.force_name, position = {boat.position.x + Boats.get_scope(boat).Data.spawn_point.x, boat.position.y + Boats.get_scope(boat).Data.spawn_point.y}})
boat.spawner = e
if e and e.valid then
-- e.destructible = false
boat.spawner = e
Common.new_healthbar(false, e, 400, nil, 400, 0.3)
end
return enemyboats[#enemyboats]
end

View File

@ -242,7 +242,7 @@ function Public.kraken_move(kraken_id, new_p, new_frame)
kraken_data.spawner_entity.teleport(new_p_2.x - old_p_2.x, new_p_2.y - old_p_2.y)
else
kraken_data.spawner_entity = surface.create_entity{name = 'biter-spawner', position = new_p_2, force = memory.enemy_force_name}
Common.new_healthbar(kraken_id, true, kraken_data.spawner_entity, kraken_data.max_health)
Common.new_healthbar(true, kraken_data.spawner_entity, kraken_data.max_health, kraken_id)
end
if old_frame then --cleanup old tiles

View File

@ -168,19 +168,21 @@ function Public.destination_on_collide(destination)
-- temporarily placed this back here, as moving it to shorehit broke things:
local playercount = Common.activecrewcount()
local max_evo
if Common.difficulty() < 1 then
local difficulty_name = CoreData.get_difficulty_name_from_value(Common.difficulty())
if difficulty_name == CoreData.difficulty_options[1].text then
if memory.overworldx/40 < 20 then
max_evo = 0.9 - (20 - memory.overworldx/40) * 1/100
else
max_evo = 0.91 + (memory.overworldx/40 - 20) * 0.25/100
end
elseif Common.difficulty() == 1 then
elseif difficulty_name == CoreData.difficulty_options[2].text then
if memory.overworldx/40 < 15 then
max_evo = 0.9 - (15 - memory.overworldx/40) * 0.5/100
else
max_evo = 0.91 + (memory.overworldx/40 - 15) * 0.25/100
end
elseif Common.difficulty() > 1 then
else
if memory.overworldx/40 < 12 then
max_evo = 0.9
else

View File

@ -218,7 +218,7 @@ function Public.captain_warn_afk(tickinterval)
if memory.playerindex_captain then
for _, player in pairs(game.connected_players) do
if Common.is_captain(player) and #Common.crew_get_nonafk_crew_members() > 1 and player.afk_time >= Common.afk_time - 20*60 - 60 - tickinterval and player.afk_time < Common.afk_time - 20*60 then
Common.notify_player_expected(player, 'Note: If you go idle as captain for too long, the role passes to another crewmember.')
Common.notify_player_announce(player, 'Note: If you go idle as captain for too long, the role passes to another crewmember.')
player.play_sound{path = 'utility/scenario_message'}
end
end
@ -1205,10 +1205,11 @@ function Public.slower_boat_tick(tickinterval)
for i = 1, #memory.enemyboats do
local b = memory.enemyboats[i]
if b.landing_time and destination.dynamic_data.timer and destination.dynamic_data.timer >= b.landing_time + 3 and b.spawner and b.spawner.valid then
b.spawner.destructible = true
b.landing_time = nil
end
-- if b.landing_time and destination.dynamic_data.timer and destination.dynamic_data.timer >= b.landing_time and b.spawner and b.spawner.valid then
-- -- if b.landing_time and destination.dynamic_data.timer and destination.dynamic_data.timer >= b.landing_time + 3 and b.spawner and b.spawner.valid then
-- b.spawner.destructible = true
-- b.landing_time = nil
-- end
end
end
end