1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-03-17 20:58:13 +02:00

v1.0.3.9.4

This commit is contained in:
danielmartin0 2022-03-01 15:57:23 +00:00
parent 6b49234f4c
commit 2e0b514889
21 changed files with 93 additions and 92 deletions

View File

@ -13,7 +13,7 @@ softmod_info_new_players_1=For New Players
softmod_info_new_players_2=Mine coal and other resources and bring them to the ship to keep things going, or try asking the captain for more specific tasks.
softmod_info_tips_1=Features of the game that are hard to work out alone
softmod_info_tips_2=• Resources granted to the ship appear in the captain's cabin.\n• Charging a silo launches a rocket. This causes pollution and evo, but each launch gives a reward of fuel and coins.\n• Charging a silo drains power from everything else on its network.\n• Once a silo has launched a rocket, biters will ignore it.\n• You can steer the boat from the crow's nest by placing 100 rail signals in one of the blue boxes.\n• Lab productivity increases with each league.\n• Passive pollution ramps up over time on each island.\n• The strength of attacks is proportional to the number of remaining nests. (Technically the time-based rate of evolution is proportional to nests too, but destroying a nest will immediately jump evolution by roughly the amount it 'would have' made had it survived.) \n• At Abandoned Labs, biters don't care if you emit pollution. They only care how long you stay.\n• To launch a second parallel run, you need a fifth of the server's pirates to endorse it.\n• Help commands: /class
softmod_info_tips_2=• Resources granted to the ship appear in the captain's cabin.\n• Charging a silo launches a rocket. This causes pollution and evo, but each launch gives a reward of fuel and coins.\n• Charging a silo drains power from everything else on its network.\n• Once a silo has launched a rocket, biters will ignore it.\n• You can steer the boat from the crow's nest by placing 100 rail signals in one of the blue boxes.\n• Lab productivity increases with each league.\n• Passive pollution ramps up over time on each island.\n• The strength of attacks is proportional to the number of remaining nests. (Technically the time-based rate of evolution is proportional to nests too, but destroying a nest will immediately jump evolution by roughly the amount it 'would have' made had it survived.)\n• To launch a second parallel run, you need a fifth of the server's pirates to endorse it.\n• Help commands: /class
softmod_info_updates_1=Development
softmod_info_updates_2=Pirate Ship 1.0.3 is currently in testing! The gameplay is reworked to center around a fuel mechanic. This should make for a clear central objective. Please play and help us tune the gameplay. \n\nRecent significant changes: Fuel mechanic replaces gold. Silo death is no longer a lose condition. Additional silos can appear to deconstrain power input. Weakened chest/furnace/pipe resistance to biters. Dock trades revamped. Game made much easier for small crews.

View File

@ -136,10 +136,6 @@ function Public.try_main_attack()
if Math.random(500) == 1 then wave_size_multiplier = 5 end --variance in attack sizes
end
local memory = Memory.get_crew_memory()
local surface = game.surfaces[Common.current_destination().surface_name]
local group = Public.spawn_group_of_scripted_biters(2/3, 6, 128, wave_size_multiplier)
local target = Public.generate_main_attack_target()
if not group or not group.valid or not target or not target.valid then return end
@ -161,7 +157,6 @@ function Public.try_secondary_attack()
if Math.random(500) == 1 then wave_size_multiplier = 5 end --variance in attack sizes
end
local memory = Memory.get_crew_memory()
local surface = game.surfaces[Common.current_destination().surface_name]
@ -193,7 +188,6 @@ function Public.try_rogue_attack()
if Math.random(500) == 1 then wave_size_multiplier = 5 end --variance in attack sizes
end
local memory = Memory.get_crew_memory()
local surface = game.surfaces[Common.current_destination().surface_name]
local group = Public.spawn_group_of_scripted_biters(1/2, 6, 128, wave_size_multiplier)

View File

@ -71,7 +71,7 @@ end
function Public.silo_total_pollution()
return (
300 * (Common.difficulty()^(1.2)) * Public.crew_scale()^(2/5) * (3.2 + 0.7 * (Common.overworldx()/40)^(1.5)) --shape of the curve with x is tuned
400 * (Common.difficulty()^(1.2)) * Public.crew_scale()^(2/5) * (3.2 + 0.7 * (Common.overworldx()/40)^(1.5)) --shape of the curve with x is tuned
)
end
@ -79,7 +79,7 @@ end
function Public.max_time_on_island_formula() --always >0 --tuned
return 60 * (
(32 + 2 * (Common.overworldx()/40)^(1/3))
) / Public.crew_scale()^(3/5) / Math.sloped(Common.difficulty(), 1/4) --changed crew_scale factor significantly to help smaller crews
) / Public.crew_scale()^(65/100) / Math.sloped(Common.difficulty(), 1/4) --changed crew_scale factor significantly to help smaller crews
end
@ -102,7 +102,7 @@ function Public.fuel_depletion_rate_static()
local rate
if Common.overworldx() > 0 then
rate = 380 * (2.5 + (Common.overworldx()/40)^(10/10)) * Public.crew_scale()^(1/6) * Math.sloped(Common.difficulty(), 3/4) / T --the extra player dependency accounts for the fact that even in compressed time, more players get more resources...
rate = 380 * (0 + (Common.overworldx()/40)^(10/10)) * Public.crew_scale()^(1/6) * Math.sloped(Common.difficulty(), 3/5) / T --the extra player dependency accounts for the fact that even in compressed time, more players get more resources...
else
rate = 0
end
@ -119,20 +119,26 @@ end
function Public.boat_passive_pollution_per_minute(time)
local boost = 1
local T = Public.max_time_on_island_formula()
if time and time >= 90/100 * T then
boost = 15
elseif time and time >= 85/100 * T then
boost = 8
elseif time and time >= 75/100 * T then
boost = 5
elseif time and time >= 55/100 * T then
boost = 3
elseif time and time >= 40/100 * T then
boost = 2
if time then
if time >= 90/100 * T then
boost = 15
elseif time >= 85/100 * T then
boost = 8
elseif time >= 80/100 * T then
boost = 6
elseif time >= 70/100 * T then
boost = 4
elseif time >= 55/100 * T then
boost = 3
elseif time >= 40/100 * T then
boost = 2
elseif time >= 25/100 * T then
boost = 1.5
end
end
return boost * (
6 * Common.difficulty() * (Common.overworldx()/40)^(16/10) * (Public.crew_scale())^(1/2)
6 * Common.difficulty() * (Common.overworldx()/40)^(16/10) * (Public.crew_scale())^(60/100)
) -- No T dependence! Is that the right idea? I wrote it this way earlier, and it can make sense, but I'm not 100% sure.
end
@ -168,7 +174,7 @@ function Public.evolution_per_second()
return rate
end
function Public.evolution_per_biter_base_kill()
function Public.evolution_per_biter_base_kill() --it's important to have evo go up with biter base kills, to provide resistance if you try to plow through all the bases
local destination = Common.current_destination()
if Common.overworldx() == 0 then return 0 end
@ -190,7 +196,7 @@ function Public.evolution_per_biter_base_kill()
end
function Public.evolution_per_full_silo_charge()
return 0.07
return 0.06 --too low and you always charge immediately, too high and you always charge late
end
function Public.bonus_damage_to_humans()
@ -270,7 +276,7 @@ function Public.pistol_damage_multiplier() return 1.95 end
Public.kraken_spawns_base_extra_evo = 0.2
function Public.kraken_evo_increase_per_shot()
return 1/100 * 0.02
return 1/100 * 0.04 --started off low, currently slowly upping to see
end
function Public.kraken_kill_reward()
@ -281,7 +287,7 @@ function Public.kraken_health()
return Math.ceil(2500 * Math.max(1, 1 + 0.1 * ((Common.overworldx()/40)^(13/10)-6)) * (Public.crew_scale()^(5/8)) * Math.sloped(Common.difficulty(), 1/2))
end
Public.kraken_regen_scale = 0.5
Public.kraken_regen_scale = 0.1 --starting off low
function Public.krakens_per_slot(overworldx)
local rng = Math.random()

View File

@ -43,7 +43,7 @@ function(cmd)
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()
Roles.try_accept_captainhood(player)
Roles.player_confirm_captainhood(player)
end)
-- Disabled for information-flow reasons:

View File

@ -5,8 +5,8 @@ local inspect = require 'utils.inspect'.inspect
local Public = {}
Public.scenario_id_name = 'pirates'
Public.version_string = '1.0.3.9.2'
Public.version_float = 1.0392
Public.version_string = '1.0.3.9.4'
Public.version_float = 1.0394
Public.blueprint_library_allowed = false
Public.blueprint_importing_allowed = true
@ -133,7 +133,7 @@ Public.cost_items = {
{name = 'advanced-circuit', display_name = 'Advanced circuit', sprite_name = 'item/advanced-circuit', color={r=0,g=0,b=255}},
{name = 'electric-engine-unit', display_name = 'Electric engine unit', sprite_name = 'item/electric-engine-unit', color={r=0,g=255,b=255}},
{name = 'uranium-235', display_name = 'Uranium-235', sprite_name = 'item/uranium-235', color={r=0,g=255,b=0}},
{name = 'satellite', display_name = 'Satellite', sprite_name = 'item/satellite', color={r=255,g=255,b=255}},
{name = 'fluid-wagon', display_name = 'Fluid Wagon', sprite_name = 'item/fluid-wagon', color={r=255,g=255,b=255}},
}
Public.fallthrough_destination = {

View File

@ -119,12 +119,12 @@ function Public.toggle_window(player)
flow3 = flow2.add({
name = 'class_renounce',
type = 'button',
caption = 'Renounce Class',
caption = 'Give Up Class',
})
flow3.style.minimal_width = 95
flow3.style.font = 'default-bold'
flow3.style.font_color = {r=0.10, g=0.10, b=0.10}
flow3.tooltip = 'Give up this class. The class will then be available for other crewmembers to take.'
flow3.tooltip = 'The class will become available for other crewmembers to take.'
flow3 = flow2.add({
name = 'officer_resign',
@ -316,7 +316,7 @@ function Public.toggle_window(player)
flow3.style.minimal_width = 95
flow3.style.font = 'default-bold'
flow3.style.font_color = {r=0.10, g=0.10, b=0.10}
flow3.tooltip = 'Take coins from each crewmembers.'
flow3.tooltip = 'Take all the coins from each non-officer.'
flow2 = flow.add({

View File

@ -159,8 +159,8 @@ local function create_gui(player)
flow3.style.font = 'default-large-semibold'
flow3.style.font_color = GuiCommon.bold_font_color
flow3 = flow2.add({type = 'table', name = 'cost_table', column_count = 5})
for i = 1, 5 do
flow3 = flow2.add({type = 'table', name = 'cost_table', column_count = #CoreData.cost_items})
for i = 1, #CoreData.cost_items do
flow4 = flow3.add({type = 'sprite-button', name = 'cost_' .. i, number = 0})
-- flow4.mouse_button_filter = {'middle'}
flow4.enabled = false
@ -633,7 +633,7 @@ function Public.update_gui(player)
for i = 1, #CoreData.cost_items do
local item_name = CoreData.cost_items[i].name
if costs[item_name] then
if costs[item_name] and flow2.cost_table['cost_' .. i] then
local stored = (memory.boat.stored_resources and memory.boat.stored_resources[item_name]) or 0
flow2.cost_table['cost_' .. i].sprite = CoreData.cost_items[i].sprite_name
if atsea_loading_bool then
@ -931,7 +931,7 @@ function Public.update_gui(player)
flow1 = pirates_flow.covering_line_frame
if flow1 then
if not eta_bool and not retreating_bool and not quest_bool and not silo_bool and not atsea_loading_bool and not cost_bool and not leave_anytime_bool and not approaching_dock_bool and not leaving_dock_bool then
if not eta_bool and not retreating_bool and not quest_bool and not silo_bool and not atsea_loading_bool and not leave_anytime_bool and not approaching_dock_bool and not leaving_dock_bool then
flow1.visible = true
else
flow1.visible = false

View File

@ -202,7 +202,7 @@ function Public.update(player)
elseif flow2.selected_tab_index == 2 then
flow2.style.height = 420
elseif flow2.selected_tab_index == 3 then
flow2.style.height = 610
flow2.style.height = 590
elseif flow2.selected_tab_index == 4 then
flow2.style.height = 280
end

View File

@ -57,7 +57,7 @@ Public.chest_loot_data_raw = {
-- {10, 0, 1, false, 'fast-underground-belt', 2, 5},
{10, 0, 1, false, 'fast-splitter', 2, 5},
{12, 0, 1, false, 'artillery-shell', 1, 1},
{40, 0, 1, false, 'rail-signal', 10, 30},
{40, 0, 1, false, 'rail-signal', 20, 70},
{40, 0, 1, false, 'medium-electric-pole', 2, 5},
{2, 0.2, 1, false, 'electric-engine-unit', 1, 1},

View File

@ -20,7 +20,7 @@ function Public.global_reset_memory()
pirates_global_memory.config = {}
pirates_global_memory.afk_player_indices = {}
pirates_global_memory.playerindex_to_time_played_continuously = {}
pirates_global_memory.playerindex_to_priority = {}
pirates_global_memory.playerindex_to_captainhood_priority = {}
pirates_global_memory.player_gui_memories = {}
pirates_global_memory.offline_players = {}
pirates_global_memory.crew_memories = {}

View File

@ -70,7 +70,7 @@ function Public.try_ore_spawn(surface, realp, source_name, density_bonus)
local density = (density_bonus + 17 + 4 * Math.random()) -- not too big, and not too much variation; it makes players have to stay longer
local radius_squared = (destination.static_params and destination.static_params.radius_squared_modifier or 1) * (11 + 45 * Math.slopefromto(Common.ore_abstract_to_real(choices[choice]), 800, 20000)) * (0.6 + Math.random()) --tuned
local radius_squared = (destination.static_params and destination.static_params.radius_squared_modifier or 1) * (12 + 45 * Math.slopefromto(Common.ore_abstract_to_real(choices[choice]), 800, 20000)) * (0.6 + Math.random()) --tuned
if source_name == 'rock-huge' then
radius_squared = radius_squared * 1.5

View File

@ -86,15 +86,12 @@ function Public.generate_overworld_destination(p)
subtype = Surfaces.Island.enum.STANDARD_VARIANT
elseif macrop.y == 1 and (((macrop.x % 4) == 3 and macrop.x ~= 15) or macrop.x == 14) then --avoid x=15 because radioactive is there
type = Surfaces.enum.DOCK
elseif macrop.x == 4 then --biter boats appear
elseif macrop.x == 5 then --biter boats appear
type = Surfaces.enum.ISLAND
subtype = Surfaces.Island.enum.STANDARD
elseif macrop.x == 5 then
type = Surfaces.enum.ISLAND
subtype = Surfaces.Island.enum.RED_DESERT
elseif macrop.x == 9 then --just before krakens
type = Surfaces.enum.ISLAND
subtype = Surfaces.Island.enum.HORSESHOE
subtype = Surfaces.Island.enum.RED_DESERT
elseif macrop.x == 10 then --krakens appear
type = nil
elseif macrop.x == 12 then --just after krakens, but dock is here too, so there's a choice
@ -142,7 +139,7 @@ function Public.generate_overworld_destination(p)
if Common.difficulty() < 1 then max_evo = 0.72 end
if Common.difficulty() > 1 then max_evo = 0.90 end
if macrop.x > 4 then
if macrop.x > 5 then
scheduled_raft_raids = {}
local times = {600, 360, 215, 210, 120, 30, 10, 5}
for i = 1, #times do
@ -152,7 +149,7 @@ function Public.generate_overworld_destination(p)
-- scheduled_raft_raids[#scheduled_raft_raids + 1] = {timeinseconds = t, max_bonus_evolution = 0.52}
end
end
elseif macrop.x == 4 then
elseif macrop.x == 5 then
local times
if playercount <= 2 then
times = {1, 5, 10, 15}

View File

@ -63,7 +63,7 @@ function Public.parrot_80()
end
function Public.parrot_boats_warning()
local memory = Memory.get_crew_memory()
Common.parrot_speak(game.forces[memory.force_name], '160 leagues? I think we\'re being chased...')
Common.parrot_speak(game.forces[memory.force_name], '200 leagues? I think we\'re being chased...')
end
function Public.parrot_kraken_warning()
local memory = Memory.get_crew_memory()
@ -75,7 +75,7 @@ function Public.parrot_radioactive_tip_1()
end
function Public.parrot_radioactive_tip_2()
local memory = Memory.get_crew_memory()
Common.parrot_speak(game.forces[memory.force_name], 'Oo, our ship is making sulfuric acid...')
Common.parrot_speak(game.forces[memory.force_name], 'The biters don\'t care if we pollute here, they only care how long we stay...')
end
function Public.parrot_800_tip()
local memory = Memory.get_crew_memory()

View File

@ -227,7 +227,7 @@ function Public.try_resolve_quest()
local force = game.forces[memory.force_name]
if not (force and force.valid) then return end
Common.notify_force(force,'Granted ' .. destination.dynamic_data.quest_reward.display_amount .. ' ' .. destination.dynamic_data.quest_reward.display_sprite)
Common.notify_force_light(force,'Granted ' .. destination.dynamic_data.quest_reward.display_amount .. ' ' .. destination.dynamic_data.quest_reward.display_sprite)
local name = destination.dynamic_data.quest_reward.name
local count = destination.dynamic_data.quest_reward.count

View File

@ -131,7 +131,23 @@ function Public.player_privilege_level(player)
end
end
function Public.try_accept_captainhood(player)
function Public.make_captain(player)
local global_memory = Memory.get_global_memory()
local memory = Memory.get_crew_memory()
if memory.playerindex_captain then
Public.update_privileges(game.players[memory.playerindex_captain])
end
memory.playerindex_captain = player.index
global_memory.playerindex_to_captainhood_priority[player.index] = nil
memory.captain_acceptance_timer = nil
Public.reset_officers()
Public.update_privileges(player)
end
function Public.player_confirm_captainhood(player)
local memory = Memory.get_crew_memory()
local captain_index = memory.playerindex_captain
@ -180,7 +196,7 @@ function Public.renounce_captainhood(player)
else
local force = game.forces[memory.force_name]
global_memory.playerindex_to_priority[player.index] = nil
global_memory.playerindex_to_captainhood_priority[player.index] = nil
if force and force.valid then
local message = (player.name .. ' renounces their title of captain.')
Common.notify_force(force, message)
@ -252,22 +268,6 @@ function Public.try_renounce_class(player, override_message)
end
end
function Public.make_captain(player)
local global_memory = Memory.get_global_memory()
local memory = Memory.get_crew_memory()
if memory.playerindex_captain then
Public.update_privileges(game.players[memory.playerindex_captain])
end
memory.playerindex_captain = player.index
global_memory.playerindex_to_priority[player.index] = nil
memory.captain_acceptance_timer = nil
Public.reset_officers()
Public.update_privileges(player)
end
function Public.confirm_captain_exists(player_to_make_captain_otherwise)
local memory = Memory.get_crew_memory()
@ -344,7 +344,7 @@ function Public.assign_captain_based_on_priorities(excluded_player_index)
if only_found_afk_players or player_active then
only_found_afk_players = player_active
local player_priority = global_memory.playerindex_to_priority[player_index]
local player_priority = global_memory.playerindex_to_captainhood_priority[player_index]
if player_priority and player_priority > best_priority_so_far then
best_priority_so_far = player_priority
captain_index = player_index
@ -401,7 +401,7 @@ function Public.captain_requisition_coins(captain_index)
for _, player_index in pairs(crew_members) do
if player_index ~= captain_index then
local player = game.players[player_index]
if player then
if player and not (memory.officers_table and memory.officers_table[player.index]) then
local inv = player.get_inventory(defines.inventory.character_main)
if inv and inv.valid then
local coin_amount = inv.get_item_count('coin')

View File

@ -62,17 +62,17 @@ Public.main_shop_data_1 = {
[Upgrades.enum.EXTRA_HOLD] = {
tooltip = 'Upgrade the ship\'s hold.',
what_you_get_sprite_buttons = {['item/steel-chest'] = false},
base_cost = {coins = 10000, fuel = 2500},
base_cost = {coins = 10000, fuel = 2000},
},
[Upgrades.enum.ROCKETS_FOR_SALE] = {
tooltip = 'Unlock rockets for sale at covered-up markets.',
what_you_get_sprite_buttons = {['item/rocket-launcher'] = false},
base_cost = {coins = 10000, fuel = 3000},
base_cost = {coins = 10000, fuel = 2500},
},
[Upgrades.enum.UNLOCK_MERCHANTS] = {
tooltip = 'Unlock merchant ships.',
what_you_get_sprite_buttons = {['entity/market'] = false},
base_cost = {coins = 10000, fuel = 4000},
base_cost = {coins = 10000, fuel = 2500},
},
}

View File

@ -53,11 +53,11 @@ Public.Data.cabin_splitters = {
{x = -5, y = -0.5, direction = defines.direction.north, type = 5},
{x = -4, y = -1.5, direction = defines.direction.north, type = 5},
{x = -3, y = -2.5, direction = defines.direction.north, type = 5},
{x = -5, y = 1.5, direction = defines.direction.north, type = 6},
{x = -4, y = 0.5, direction = defines.direction.north, type = 6},
{x = -3, y = -0.5, direction = defines.direction.north, type = 6},
{x = -5, y = -0.5, direction = defines.direction.north, type = 7},
{x = -4, y = -1.5, direction = defines.direction.north, type = 7},
{x = -5, y = -2.5, direction = defines.direction.north, type = 6},
{x = -4, y = -3.5, direction = defines.direction.north, type = 6},
{x = -3, y = -4.5, direction = defines.direction.north, type = 6},
{x = -5, y = -4.5, direction = defines.direction.north, type = 7},
{x = -4, y = -5.5, direction = defines.direction.north, type = 7},
{x = -4, y = -8.5, direction = defines.direction.north, type = 7},
{x = -5, y = -9.5, direction = defines.direction.north, type = 7},
{x = -3, y = -7.5, direction = defines.direction.north, type = 8},
@ -86,7 +86,7 @@ end
function Public.get_cabin_surface()
local name = Public.get_cabin_surface_name()
if name then return game.surfaces[Public.get_cabin_surface_name()] end
if name and game.surfaces[name] and game.surfaces[name].valid then return game.surfaces[Public.get_cabin_surface_name()] end
end
function Public.create_cabin_surface()

View File

@ -85,7 +85,7 @@ end
function Public.get_hold_surface(nth)
nth = nth or 1
local name = Public.get_hold_surface_name(nth)
if name then return game.surfaces[name] end
if name and game.surfaces[name] and game.surfaces[name].valid then return game.surfaces[name] end
end
function Public.create_hold_surface(nth)

View File

@ -24,7 +24,7 @@ function Public.base_ores()
return {
['copper-ore'] = 2.0,
['iron-ore'] = 4.1,
['coal'] = 2.2,
['coal'] = 3.1,
['stone'] = 0.4,
}
end

View File

@ -190,7 +190,7 @@ function Public.destination_on_collide(destination)
-- destination.static_params.scheduled_raft_raids = scheduled_raft_raids
end
if memory.overworldx == 40*4 then Parrot.parrot_boats_warning() end
if memory.overworldx == 40*5 then Parrot.parrot_boats_warning() end
if memory.overworldx == 600 then
Parrot.parrot_radioactive_tip_1()
elseif memory.overworldx == 800 then

View File

@ -224,9 +224,13 @@ function Public.periodic_free_resources(tickinterval)
Common.give_reward_items(Balance.periodic_free_resources_per_destination_5_seconds())
if game.tick % 300*5 == 0 and (destination and destination.subtype and destination.subtype == Islands.enum.RADIOACTIVE) then
-- every 30 seconds
Common.give_reward_items{{name = 'sulfuric-acid-barrel', count = 1}}
if game.tick % (300*12) == 0 and (destination and destination.subtype and destination.subtype == Islands.enum.RADIOACTIVE) then
-- every 60 seconds
local count = 2
Common.give_reward_items{{name = 'sulfuric-acid-barrel', count = count}}
local force = game.forces[memory.force_name]
if not (force and force.valid) then return end
Common.notify_force_light(force, 'Granted ' .. count .. ' [item=sulfuric-acid-barrel]')
end
end
@ -1214,7 +1218,7 @@ function Public.update_players_second()
local connected_players = game.connected_players
local playerindex_to_time_played_continuously = {}
local playerindex_to_priority = {}
local playerindex_to_captainhood_priority = {}
for playerindex, time in pairs(global_memory.playerindex_to_time_played_continuously) do
local player = game.players[playerindex]
@ -1223,12 +1227,12 @@ function Public.update_players_second()
playerindex_to_time_played_continuously[playerindex] = time
end
end
for playerindex, time in pairs(global_memory.playerindex_to_priority) do
for playerindex, time in pairs(global_memory.playerindex_to_captainhood_priority) do
local player = game.players[playerindex]
if player and Common.validate_player(player) then
-- port over
playerindex_to_priority[playerindex] = time
playerindex_to_captainhood_priority[playerindex] = time
end
end
@ -1238,15 +1242,15 @@ function Public.update_players_second()
playerindex_to_time_played_continuously[player.index] = playerindex_to_time_played_continuously[player.index] + 1
playerindex_to_priority[player.index] = playerindex_to_priority[player.index] or 0
playerindex_to_captainhood_priority[player.index] = playerindex_to_captainhood_priority[player.index] or 0
playerindex_to_priority[player.index] = playerindex_to_priority[player.index] + 1
playerindex_to_captainhood_priority[player.index] = playerindex_to_captainhood_priority[player.index] + 1
else
playerindex_to_time_played_continuously[player.index] = nil
playerindex_to_priority[player.index] = nil
playerindex_to_captainhood_priority[player.index] = nil
end
end
global_memory.playerindex_to_priority = playerindex_to_priority
global_memory.playerindex_to_captainhood_priority = playerindex_to_captainhood_priority
global_memory.playerindex_to_time_played_continuously = playerindex_to_time_played_continuously
local afk_player_indices = {}