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

Merge remote-tracking branch 'upstream/develop' into develop

This commit is contained in:
Piratux 2022-06-02 22:14:19 +03:00
commit 4b1f9a7f8c
15 changed files with 266 additions and 220 deletions

View File

@ -15,12 +15,13 @@ softmod_info_new_players_2=Mine coal and other resources and bring them to the s
softmod_info_tips_1=Features of the game that are hard to work out alone
softmod_info_tips_2=• The captain can steer the boat from the crow's nest by placing 100 rail signals in one of the blue boxes.\n• Resources granted to the ship appear in the captain's cabin.\n• Charging a silo drains power from everything else on its network.\n• The quantity of ore available on an island is independent of the order in which you break rocks.\n• Passive pollution ramps up over time on each island.\n• The strength of attacks is proportional to the number of remaining nests. (The time-based rate of evolution is proportional to nests too, but destroying a nest will immediately jump evolution by most of the amount it 'would have' made had it survived.)\n• Lab productivity increases with each league.\n• item-on-ground entities on the deck are moved to the cabin when the boat moves, for performance reasons.\n• Commands: /ccolor gives you a fun color. /classinfo {classname} gives the description of the named class. To manage your class, use /take {classname} or /giveup.
softmod_info_updates_1=Recent changes
softmod_info_updates_2=v1.2.11\n• Unlimited time can now be spent at sea between each destination.\n\nv1.2.8\n• Poison damage against players buffed\n• Maze treasure buffed\n• Biter waves slightly more concentrated into groups\n\nv1.2.3\n• Rework of 'quest buildings' that appear on islands.\n• Fixed stutter when loading certain maps, such as swamp.\n• Various new player-friendly visual renderings.\n• Mod prepared for translation into other languages.\n• Expanded Gourmet's sense of taste.\n\nv1.2\n• Mod portal release.\n• Some rebalancing of Nightmare difficulty.
softmod_info_updates_1=Significant recent changes
softmod_info_updates_2=v1.2.11\n• Class costs reduced at quest structures.\n• Unlimited time can now be spent at sea between each destination.\n\nv1.2.8\n• Poison damage against players buffed\n• Maze treasure buffed\n• Biter waves slightly more concentrated into groups\n\nv1.2.3\n• Rework of 'quest buildings' that appear on islands.\n• Fixed stutter when loading certain maps, such as swamp.\n• Various new player-friendly visual renderings.\n• Mod prepared for translation into other languages.\n• Expanded Gourmet's sense of taste.\n\nv1.2\n• Mod portal release.\n• Some rebalancing of Nightmare difficulty.
softmod_info_credits_1=Credits
softmod_info_credits_2=Pirate Ship designed and coded by thesixthroc. Comfy codebase and help from Gerkiz, Hanakocz and Mew @ Comfy Industries (https://getcomfy.eu). Some island structure blueprints contributed by Mattisso.\n\nCome chat with us: https://getcomfy.eu/discord\n\n"Those white gloves. I'll never forget them 'till the day I die." - Dr. John
softmod_info_credits_2_old=Softmod designed and written by thesixthroc. Comfy codebase help from Gerkiz, Hanakocz and Mew @ Comfy Industries (https://getcomfy.eu). Some island structure blueprints were contributed by Mattisso. Gold sprite by Clint Bellanger. Parrot sprites by @pixelthen.\n\n"Those white gloves. I'll never forget them 'till the day I die." - Dr. John
thesixthroc_support_toast=Support Pirate Ship scenario design at ko-fi.com/thesixthroc
softmod_info_body_promote=by thesixthroc
softmod_info_body_promote_old2=patreon.com/thesixthroc
@ -121,9 +122,14 @@ recover_offline_player_items=Offline player's items recovered to cabin.
death_froze=__1__ froze to death.
death_pushed_into_water_by_cannon=__1__ was pushed into water by a cannon.
granted_1=Granted: __1__.
granted_2=Granted: __1__, __2__.
granted_3=Granted: __1__, __2__, __3__.
granted_rocket_launch=Rocket launched.
granted_kraken_kill=Kraken killed.
granted_periodic_barrel=
granted_quest_complete=Quest completed.
granted_1=__1__ Granted: __2__.
granted_2=__1__ Granted: __2__, __3__.
granted_3=__1__ Granted: __2__, __3__, __4__.
approaching_destination=Approaching destination __1__, __2__.
loading_destination=Loading destination __1__, __2__.

View File

@ -129,10 +129,9 @@ end
function Public.wave_size_rng() -- random variance in attack sizes
local memory = Memory.get_crew_memory()
local wave_percentage_chance = Math.clamp(0, 70, 20 + 10 * memory.floating_pollution/1400) --trying this out
local wave_percentage_chance = Math.clamp(0, 36, 15 + 7 * memory.floating_pollution/1500) --trying this out
local wave_size_multiplier = 1
local memory = Memory.get_crew_memory()
local rng1 = Math.random(100)
if rng1 > wave_percentage_chance then
wave_size_multiplier = 0

View File

@ -668,21 +668,21 @@ end
local function event_pre_player_mined_item(event)
-- figure out which crew this is about:
-- local crew_id = nil
-- if event.player_index and game.players[event.player_index].valid then crew_id = tonumber(string.sub(game.players[event.player_index].force.name, -3, -1)) or nil end
-- Memory.set_working_id(crew_id)
-- local memory = Memory.get_crew_memory()
-- local function event_pre_player_mined_item(event)
-- -- figure out which crew this is about:
-- -- local crew_id = nil
-- -- if event.player_index and game.players[event.player_index].valid then crew_id = tonumber(string.sub(game.players[event.player_index].force.name, -3, -1)) or nil end
-- -- Memory.set_working_id(crew_id)
-- -- local memory = Memory.get_crew_memory()
-- if memory.planet[1].type.id == 11 then --rocky planet
-- if event.entity.name == 'rock-huge' or event.entity.name == 'rock-big' or event.entity.name == 'sand-rock-big' then
-- Event_functions.trap(event.entity, false)
-- event.entity.destroy()
-- Event_functions.rocky_loot(event)
-- end
-- end
end
-- -- if memory.planet[1].type.id == 11 then --rocky planet
-- -- if event.entity.name == 'rock-huge' or event.entity.name == 'rock-big' or event.entity.name == 'sand-rock-big' then
-- -- Event_functions.trap(event.entity, false)
-- -- event.entity.destroy()
-- -- Event_functions.rocky_loot(event)
-- -- end
-- -- end
-- end
local function event_on_player_mined_entity(event)
if not event.player_index then return end
@ -1197,7 +1197,7 @@ local function event_on_player_joined_game(event)
--figure out if we should drop them back into a crew:
if (not Server.get_current_time()) then -- don't run this on servers because I'd need to negotiate that with the rest of Comfy
player.print('Support Pirate Ship scenario design at ko-fi.com/thesixthroc', {r=1, g=0.4, b=0.9})
player.print({'pirates.thesixthroc_support_toast'}, {r=1, g=0.4, b=0.9})
end
if _DEBUG then
@ -1637,7 +1637,7 @@ local function event_on_rocket_launched(event)
end
local force = memory.force
local message = {'pirates.granted_2', Math.floor(Balance.rocket_launch_coin_reward/100)/10 .. 'k [item=coin]', Math.floor(destination.dynamic_data.rocketcoalreward/100)/10 .. 'k [item=coal]'}
local message = {'pirates.granted_2', {'pirates.granted_rocket_launch'}, Math.floor(Balance.rocket_launch_coin_reward/100)/10 .. 'k [item=coin]', Math.floor(destination.dynamic_data.rocketcoalreward/100)/10 .. 'k [item=coal]'}
Common.notify_force_light(force,message)
if destination.dynamic_data.quest_type == Quest.enum.TIME and (not destination.dynamic_data.quest_complete) then
@ -1649,9 +1649,14 @@ local function event_on_rocket_launched(event)
destination.dynamic_data.quest_progress = destination.dynamic_data.rocketsilohp
Quest.try_resolve_quest()
end
if destination.dynamic_data.rocketsilos and destination.dynamic_data.rocketsilos[1] and destination.dynamic_data.rocketsilos[1].valid then
destination.dynamic_data.rocketsilos[1].die()
if destination.dynamic_data.rocketsilos then
for i = 1, #destination.dynamic_data.rocketsilos do
local s = destination.dynamic_data.rocketsilos[i]
if s and s.valid then
s.die()
end
end
destination.dynamic_data.rocketsilos = nil
end
end
@ -1820,7 +1825,7 @@ event.add(defines.events.on_entity_died, event_on_entity_died)
event.add(defines.events.on_player_joined_game, event_on_player_joined_game)
event.add(defines.events.on_pre_player_left_game, event_on_pre_player_left_game)
-- event.add(defines.events.on_player_left_game, event_on_player_left_game)
event.add(defines.events.on_pre_player_mined_item, event_pre_player_mined_item)
-- event.add(defines.events.on_pre_player_mined_item, event_pre_player_mined_item)
event.add(defines.events.on_player_mined_entity, event_on_player_mined_entity)
event.add(defines.events.on_research_finished, event_on_research_finished)
event.add(defines.events.on_player_changed_surface, on_player_changed_surface)

View File

@ -286,7 +286,7 @@ function Public.periodic_free_resources(tickinterval)
Common.give_items_to_crew{{name = 'sulfuric-acid-barrel', count = count}}
local force = memory.force
if not (force and force.valid) then return end
local message = {'pirates.granted_1', count .. ' [item=sulfuric-acid-barrel]'}
local message = {'pirates.granted_1', {'pirates.granted_periodic_barrel'}, count .. ' [item=sulfuric-acid-barrel]'}
Common.notify_force_light(force, message)
end
end
@ -919,8 +919,10 @@ function Public.loading_update(tickinterval)
local eta_ticks = total - (memory.loadingticks - (memory.extra_time_at_sea or 0))
-- log(_inspect{eta_ticks, (memory.active_sea_enemies.krakens and #memory.active_sea_enemies.krakens or 'nil'), memory.loadingticks})
if eta_ticks < 60*20 and memory.active_sea_enemies and (memory.active_sea_enemies.krakens and #memory.active_sea_enemies.krakens > 0) then
memory.loadingticks = memory.loadingticks - tickinterval
memory.loadingticks = memory.loadingticks - tickinterval --reverse the change
else
local fraction = memory.loadingticks / (total + (memory.extra_time_at_sea or 0))

View File

@ -386,8 +386,8 @@ function Public.quest_structure_entry_price_scale()
end
function Public.apply_crew_buffs_per_x(force)
force.laboratory_productivity_bonus = Math.max(0, 7/100 * (Common.overworldx()/40) - (10*(Common.difficulty_scale()) - 5)) --difficulty causes lab productivity boosts to start later
function Public.apply_crew_buffs_per_league(force, leagues_travelled)
force.laboratory_productivity_bonus = force.laboratory_productivity_bonus + Math.max(0, 6/100 * leagues_travelled/40)
end
function Public.class_cost(at_dock)

View File

@ -40,14 +40,172 @@ local Classes = require 'maps.pirates.roles.classes'
local GUIcolor = require 'maps.pirates.gui.color'
local function cmd_set_memory(cmd)
local crew_id = tonumber(string.sub(game.players[cmd.player_index].force.name, -3, -1)) or nil
Memory.set_working_id(crew_id)
end
local function check_admin(cmd)
local Session = require 'utils.datastore.session_data'
local player = game.players[cmd.player_index]
local trusted = Session.get_trusted_table()
local p
if player then
if player ~= nil then
p = player.print
if not player.admin then
p('[ERROR] Only admins are allowed to run this command!', Color.fail)
return false
end
else
p = log
end
end
return true
end
local function check_captain(cmd)
local player = game.players[cmd.player_index]
local p
if player then
if player ~= nil then
p = player.print
if not Common.validate_player(player) then return end
if not (Roles.player_privilege_level(player) >= Roles.privilege_levels.CAPTAIN) then
p('[ERROR] Only captains are allowed to run this command!', Color.fail)
return false
end
else
p = log
end
end
return true
end
local function check_captain_or_admin(cmd)
local player = game.players[cmd.player_index]
local p
if player then
if player ~= nil then
p = player.print
if not Common.validate_player(player) then return end
if not (player.admin or Roles.player_privilege_level(player) >= Roles.privilege_levels.CAPTAIN) then
p('[ERROR] Only captains are allowed to run this command!', Color.fail)
return false
end
else
p = log
end
end
return true
end
local function check_trusted(cmd)
local Session = require 'utils.datastore.session_data'
local player = game.players[cmd.player_index]
local trusted = Session.get_trusted_table()
local p
if player then
if player ~= nil then
p = player.print
if not (trusted[player.name] or player.admin) then
p('[ERROR] Only admins and trusted weebs are allowed to run this command!', Color.fail)
return false
end
else
p = log
end
end
return true
end
commands.add_command(
'set_max_crews',
'is an admin command to set the maximum number of concurrent crews allowed on the server.',
function(cmd)
local param = tostring(cmd.parameter)
if check_admin(cmd) then
local player = game.players[cmd.player_index]
local global_memory = Memory.get_global_memory()
if tonumber(param) then
global_memory.active_crews_cap = tonumber(param)
Common.notify_player_expected(player, 'The maximum number of concurrent crews has been set to ' .. param .. '.')
end
end
end)
commands.add_command(
'sail',
'is an admin command to set the ship sailing after an island, in case there\'s a problem with the captain doing so.',
function(cmd)
cmd_set_memory(cmd)
local param = tostring(cmd.parameter)
if check_admin(cmd) then
local player = game.players[cmd.player_index]
local memory = Memory.get_crew_memory()
Crew.summon_crew()
if memory.boat.state == Boats.enum_state.ATSEA_WAITING_TO_SAIL then
Progression.at_sea_begin_to_set_sail()
end
end
end)
commands.add_command(
'setcaptain',
'{player} is an admin command to set the crew\'s captain to {player}.',
function(cmd)
cmd_set_memory(cmd)
local param = tostring(cmd.parameter)
if check_admin(cmd) then
local player = game.players[cmd.player_index]
if param and game.players[param] and game.players[param].index then
Roles.make_captain(game.players[param])
else
Common.notify_player_error(player, 'Command error: Invalid player name.')
end
end
end)
commands.add_command(
'summoncrew',
'is an admin command to summon the crew to the ship.',
function(cmd)
cmd_set_memory(cmd)
local param = tostring(cmd.parameter)
if check_admin(cmd) then
local player = game.players[cmd.player_index]
local crew_id = tonumber(string.sub(player.force.name, -3, -1)) or nil
Memory.set_working_id(crew_id)
Crew.summon_crew()
end
end)
commands.add_command(
'ok',
'is used to accept captainhood.',
function(cmd)
local player = game.players[cmd.player_index]
cmd_set_memory(cmd)
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()
Roles.player_confirm_captainhood(player)
end)
@ -106,9 +264,11 @@ commands.add_command(
'take',
'{classname} takes a spare class with the given name for yourself.',
function(cmd)
cmd_set_memory(cmd)
local param = tostring(cmd.parameter)
local player = game.players[cmd.player_index]
if not Common.validate_player(player) then return end
if param and param ~= 'nil' then
for _, class in pairs(Classes.enum) do
if Classes.eng_form[class]:lower() == param:lower() then
@ -128,9 +288,11 @@ commands.add_command(
'giveup',
'gives up your current class, making it available for others.',
function(cmd)
cmd_set_memory(cmd)
local param = tostring(cmd.parameter)
local player = game.players[cmd.player_index]
if not Common.validate_player(player) then return end
if param and param == 'nil' then
Classes.try_renounce_class(player, true)
else
@ -207,115 +369,12 @@ local go_1 = Token.register(
local function check_admin(cmd)
local Session = require 'utils.datastore.session_data'
local player = game.players[cmd.player_index]
local trusted = Session.get_trusted_table()
local p
if player then
if player ~= nil then
p = player.print
if not player.admin then
p('[ERROR] Only admins are allowed to run this command!', Color.fail)
return false
end
else
p = log
end
end
return true
end
local function check_captain(cmd)
local player = game.players[cmd.player_index]
local p
if player then
if player ~= nil then
p = player.print
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 not (Roles.player_privilege_level(player) >= Roles.privilege_levels.CAPTAIN) then
p('[ERROR] Only captains are allowed to run this command!', Color.fail)
return false
end
else
p = log
end
end
return true
end
local function check_captain_or_admin(cmd)
local player = game.players[cmd.player_index]
local p
if player then
if player ~= nil then
p = player.print
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 not (player.admin or Roles.player_privilege_level(player) >= Roles.privilege_levels.CAPTAIN) then
p('[ERROR] Only captains are allowed to run this command!', Color.fail)
return false
end
else
p = log
end
end
return true
end
local function check_trusted(cmd)
local Session = require 'utils.datastore.session_data'
local player = game.players[cmd.player_index]
local trusted = Session.get_trusted_table()
local p
if player then
if player ~= nil then
p = player.print
if not (trusted[player.name] or player.admin) then
p('[ERROR] Only admins and trusted weebs are allowed to run this command!', Color.fail)
return false
end
else
p = log
end
end
return true
end
commands.add_command(
'set_max_crews',
'is an admin command to set the maximum number of concurrent crews allowed on the server.',
function(cmd)
local param = tostring(cmd.parameter)
if check_admin(cmd) then
local player = game.players[cmd.player_index]
local global_memory = Memory.get_global_memory()
if tonumber(param) then
global_memory.active_crews_cap = tonumber(param)
Common.notify_player_expected(player, 'The maximum number of concurrent crews has been set to ' .. param .. '.')
end
end
end)
commands.add_command(
'plank',
'is a captain command to remove a player by making them a spectator.',
function(cmd)
cmd_set_memory(cmd)
local player = game.players[cmd.player_index]
local param = tostring(cmd.parameter)
if check_captain_or_admin(cmd) then
@ -331,6 +390,8 @@ commands.add_command(
'officer',
'is a captain command to make a player into an officer, or remove them as one.',
function(cmd)
cmd_set_memory(cmd)
local player = game.players[cmd.player_index]
local param = tostring(cmd.parameter)
if check_captain_or_admin(cmd) then
@ -351,6 +412,8 @@ commands.add_command(
'undock',
'is a captain command to undock the ship.',
function(cmd)
cmd_set_memory(cmd)
local param = tostring(cmd.parameter)
if check_captain_or_admin(cmd) then
local player = game.players[cmd.player_index]
@ -367,69 +430,39 @@ commands.add_command(
'tax',
'is a captain command to take a quarter of all coins, plus other game-critical items from the crew, into your inventory.',
function(cmd)
cmd_set_memory(cmd)
local param = tostring(cmd.parameter)
if check_captain(cmd) then
local player = game.players[cmd.player_index]
local memory = Memory.get_crew_memory()
Roles.captain_tax(memory.playerindex_captain)
end
end --@TODO: else
end)
commands.add_command(
'dump_highscores',
'is a dev command.',
function(cmd)
cmd_set_memory(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()
Highscore.dump_highscores()
player.print('Highscores dumped.')
end
end)
commands.add_command(
'setcaptain',
'{player} is an admin command to set the crew\'s captain to {player}.',
function(cmd)
local param = tostring(cmd.parameter)
if check_admin(cmd) then
local player = game.players[cmd.player_index]
local crew_id = tonumber(string.sub(player.force.name, -3, -1)) or nil
Memory.set_working_id(crew_id)
local memory = Memory.get_crew_memory()
if param and game.players[param] and game.players[param].index then
Roles.make_captain(game.players[param])
else
Common.notify_player_error(player, 'Command error: Invalid player name.')
end
end
end)
commands.add_command(
'summoncrew',
'is an admin command to summon the crew to the ship.',
function(cmd)
local param = tostring(cmd.parameter)
if check_admin(cmd) then
local player = game.players[cmd.player_index]
local crew_id = tonumber(string.sub(player.force.name, -3, -1)) or nil
Memory.set_working_id(crew_id)
Crew.summon_crew()
end
end)
commands.add_command(
'setclass',
'is a dev command.',
function(cmd)
cmd_set_memory(cmd)
local param = tostring(cmd.parameter)
if check_admin(cmd) then
local player = game.players[cmd.player_index]
local crew_id = tonumber(string.sub(player.force.name, -3, -1)) or nil
Memory.set_working_id(crew_id)
local memory = Memory.get_crew_memory()
if not Common.validate_player(player) then return end
if not memory.classes_table then memory.classes_table = {} end
@ -442,11 +475,11 @@ commands.add_command(
'setevo',
'is a dev command.',
function(cmd)
cmd_set_memory(cmd)
local param = tostring(cmd.parameter)
if check_admin(cmd) then
local player = game.players[cmd.player_index]
local crew_id = tonumber(string.sub(player.force.name, -3, -1)) or nil
Memory.set_working_id(crew_id)
Common.set_evo(tonumber(param))
end
end)
@ -455,11 +488,11 @@ commands.add_command(
'modi',
'is a dev command.',
function(cmd)
cmd_set_memory(cmd)
local param = tostring(cmd.parameter)
if check_admin(cmd) then
local player = game.players[cmd.player_index]
local crew_id = tonumber(string.sub(player.force.name, -3, -1)) or nil
Memory.set_working_id(crew_id)
local memory = Memory.get_crew_memory()
local surface = game.surfaces[Common.current_destination().surface_name]
local entities = surface.find_entities_filtered{position = player.position, radius = 500}
@ -479,11 +512,11 @@ commands.add_command(
'ret',
'is a dev command.',
function(cmd)
cmd_set_memory(cmd)
local param = tostring(cmd.parameter)
if check_admin(cmd) then
local player = game.players[cmd.player_index]
local crew_id = tonumber(string.sub(player.force.name, -3, -1)) or nil
Memory.set_working_id(crew_id)
Progression.retreat_from_island(true)
end
end)
@ -492,11 +525,11 @@ commands.add_command(
'jump',
'is a dev command.',
function(cmd)
cmd_set_memory(cmd)
local param = tostring(cmd.parameter)
if check_admin(cmd) then
local player = game.players[cmd.player_index]
local crew_id = tonumber(string.sub(player.force.name, -3, -1)) or nil
Memory.set_working_id(crew_id)
Overworld.try_overworld_move_v2({x = 40, y = 0})
end
end)
@ -505,11 +538,11 @@ commands.add_command(
'advu',
'is a dev command.',
function(cmd)
cmd_set_memory(cmd)
local param = tostring(cmd.parameter)
if check_admin(cmd) then
local player = game.players[cmd.player_index]
local crew_id = tonumber(string.sub(player.force.name, -3, -1)) or nil
Memory.set_working_id(crew_id)
Overworld.try_overworld_move_v2{x = 0, y = -24}
end
end)
@ -518,11 +551,11 @@ commands.add_command(
'advd',
'is a dev command.',
function(cmd)
cmd_set_memory(cmd)
local param = tostring(cmd.parameter)
if check_admin(cmd) then
local player = game.players[cmd.player_index]
local crew_id = tonumber(string.sub(player.force.name, -3, -1)) or nil
Memory.set_working_id(crew_id)
Overworld.try_overworld_move_v2{x = 0, y = 24}
end
end)
@ -532,11 +565,11 @@ commands.add_command(
'overwrite_scores_specific',
'is a dev command.',
function(cmd)
cmd_set_memory(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
@ -590,11 +623,11 @@ if _DEBUG then
'chnk',
'is a dev command.',
function(cmd)
cmd_set_memory(cmd)
local param = tostring(cmd.parameter)
if check_admin(cmd) then
local player = game.players[cmd.player_index]
local crew_id = tonumber(string.sub(player.force.name, -3, -1)) or nil
Memory.set_working_id(crew_id)
local memory = Memory.get_crew_memory()
for i = 0, 13 do
@ -610,11 +643,11 @@ if _DEBUG then
'spd',
'is a dev command.',
function(cmd)
cmd_set_memory(cmd)
local param = tostring(cmd.parameter)
if check_admin(cmd) then
local player = game.players[cmd.player_index]
local crew_id = tonumber(string.sub(player.force.name, -3, -1)) or nil
Memory.set_working_id(crew_id)
local memory = Memory.get_crew_memory()
memory.boat.speed = 60
end
@ -624,11 +657,11 @@ if _DEBUG then
'stp',
'is a dev command.',
function(cmd)
cmd_set_memory(cmd)
local param = tostring(cmd.parameter)
if check_admin(cmd) then
local player = game.players[cmd.player_index]
local crew_id = tonumber(string.sub(player.force.name, -3, -1)) or nil
Memory.set_working_id(crew_id)
local memory = Memory.get_crew_memory()
memory.boat.speed = 0
end
@ -719,11 +752,11 @@ if _DEBUG then
'score',
'is a dev command.',
function(cmd)
cmd_set_memory(cmd)
local param = tostring(cmd.parameter)
if check_admin(cmd) then
local player = game.players[cmd.player_index]
local crew_id = tonumber(string.sub(player.force.name, -3, -1)) or nil
Memory.set_working_id(crew_id)
local memory = Memory.get_crew_memory()
game.print('faking a highscore...')
@ -931,11 +964,11 @@ if _DEBUG then
'ef1',
'is a dev command.',
function(cmd)
cmd_set_memory(cmd)
local param = tostring(cmd.parameter)
if check_admin(cmd) then
local player = game.players[cmd.player_index]
local crew_id = tonumber(string.sub(player.force.name, -3, -1)) or nil
Memory.set_working_id(crew_id)
local memory = Memory.get_crew_memory()
local surface = game.surfaces[Common.current_destination().surface_name]
Effects.worm_movement_effect(surface, {x = -45, y = 0}, false, true)
@ -946,11 +979,11 @@ if _DEBUG then
'ef2',
'is a dev command.',
function(cmd)
cmd_set_memory(cmd)
local param = tostring(cmd.parameter)
if check_admin(cmd) then
local player = game.players[cmd.player_index]
local crew_id = tonumber(string.sub(player.force.name, -3, -1)) or nil
Memory.set_working_id(crew_id)
local memory = Memory.get_crew_memory()
local surface = game.surfaces[Common.current_destination().surface_name]
Effects.worm_movement_effect(surface, {x = -45, y = 0}, false, false)
@ -961,11 +994,11 @@ if _DEBUG then
'ef3',
'is a dev command.',
function(cmd)
cmd_set_memory(cmd)
local param = tostring(cmd.parameter)
if check_admin(cmd) then
local player = game.players[cmd.player_index]
local crew_id = tonumber(string.sub(player.force.name, -3, -1)) or nil
Memory.set_working_id(crew_id)
local memory = Memory.get_crew_memory()
local surface = game.surfaces[Common.current_destination().surface_name]
Effects.worm_movement_effect(surface, {x = -45, y = 0}, true, false)
@ -976,11 +1009,11 @@ if _DEBUG then
'ef4',
'is a dev command.',
function(cmd)
cmd_set_memory(cmd)
local param = tostring(cmd.parameter)
if check_admin(cmd) then
local player = game.players[cmd.player_index]
local crew_id = tonumber(string.sub(player.force.name, -3, -1)) or nil
Memory.set_working_id(crew_id)
local memory = Memory.get_crew_memory()
local surface = game.surfaces[Common.current_destination().surface_name]
Effects.worm_emerge_effect(surface, {x = -45, y = 0})
@ -991,11 +1024,11 @@ if _DEBUG then
'ef5',
'is a dev command.',
function(cmd)
cmd_set_memory(cmd)
local param = tostring(cmd.parameter)
if check_admin(cmd) then
local player = game.players[cmd.player_index]
local crew_id = tonumber(string.sub(player.force.name, -3, -1)) or nil
Memory.set_working_id(crew_id)
local memory = Memory.get_crew_memory()
local surface = game.surfaces[Common.current_destination().surface_name]
Effects.biters_emerge(surface, {x = -30, y = 0})

View File

@ -172,7 +172,7 @@ function Public.parrot_speak(force, message)
force.print({"", {'pirates.notify_parrot'}, ' ', message}, CoreData.colors.parrot)
local memory = Memory.get_crew_memory()
Server.to_discord_embed_raw({"", '[' .. memory.name .. ']', {'pirates.notify_parrot'}, ' ', message}, true)
Server.to_discord_embed_raw({"", '[' .. memory.name .. '] ', {'pirates.notify_parrot'}, ' ', message}, true)
end

View File

@ -7,7 +7,7 @@ local _inspect = require 'utils.inspect'.inspect
local Public = {}
Public.scenario_id_name = 'pirates'
Public.version_string = '1.2.11' --major.minor.patch versioning, to match factorio mod portal
Public.version_string = '1.2.12' --major.minor.patch versioning, to match factorio mod portal
Public.blueprint_library_allowed = true
Public.blueprint_importing_allowed = true

View File

@ -120,7 +120,7 @@ local function create_gui(player)
flow2 = GuiCommon.flow_add_floating_sprite_button(flow1, 'evo_piratebutton')
flow2.sprite = 'entity/small-biter'
flow2.mouse_button_filter = {'middle'} --hack to avoid press visual
flow2.show_percent_for_small_numbers = true
flow2.show_percent_for_small_numbers = true --as of factorio v1.1.59, there is a bug in which 1.002 displays as like 1e-2% or something. but after 1.01 it's ok
flow2 = GuiCommon.flow_add_floating_sprite_button(flow1, 'minimap_piratebutton')
flow2.tooltip = {'pirates.gui_minimap_main_tooltip'}

View File

@ -226,11 +226,11 @@ function Public.full_update(player)
if flow2.selected_tab_index == 1 then
flow2.style.height = 400
elseif flow2.selected_tab_index == 2 then
flow2.style.height = 520
flow2.style.height = 570
elseif flow2.selected_tab_index == 3 then
flow2.style.height = 580
elseif flow2.selected_tab_index == 4 then
flow2.style.height = 360
flow2.style.height = 340
end
end

View File

@ -682,9 +682,10 @@ function Public.try_overworld_move_v2(vector) --islands stay, crowsnest moves
-- other freebies:
for i=1,vector.x do
Common.give_items_to_crew(Balance.periodic_free_resources_per_x())
Balance.apply_crew_buffs_per_x(memory.force)
end
Balance.apply_crew_buffs_per_league(memory.force, vector.x)
-- add some evo: (this will get reset upon arriving at a destination anyway, so this is just relevant for sea monsters and the like:)
local extra_evo = Balance.base_evolution_leagues(memory.overworldx) - Balance.base_evolution_leagues(memory.overworldx - vector.x)
Common.increment_evo(extra_evo)

View File

@ -241,7 +241,7 @@ function Public.try_resolve_quest()
local force = memory.force
if not (force and force.valid) then return end
Common.notify_force_light(force, {'pirates.granted_1', destination.dynamic_data.quest_reward.display_amount .. destination.dynamic_data.quest_reward.chat_name})
Common.notify_force_light(force, {'pirates.granted_1', {'pirates.granted_quest_complete'}, destination.dynamic_data.quest_reward.display_amount .. destination.dynamic_data.quest_reward.chat_name})
local name = destination.dynamic_data.quest_reward.name
local count = destination.dynamic_data.quest_reward.count

View File

@ -27,7 +27,7 @@ function Public.base_ores() --here, just for the visualisation:
return {
['copper-ore'] = 5,
['iron-ore'] = 5,
['coal'] = 5,
['coal'] = 3,
}
end

View File

@ -118,14 +118,14 @@ function Public.terrain(args)
if noises.forest_abs_suppressed(p) < 0.8 and noises.mood(p) > -0.3 then
if noises.height(p) > 0.27 then
if noises.ore(p) > 1.55 then
if noises.ore(p) > 1.5 then
local name = 'iron-ore'
if (args.p.x + args.p.y) % 2 < 1 then
name = 'copper-ore'
end
args.entities[#args.entities + 1] = {name = name, position = args.p, amount = 24}
args.entities[#args.entities + 1] = {name = name, position = args.p, amount = 20}
elseif noises.ore(p) < -1.6 then
args.entities[#args.entities + 1] = {name = 'coal', position = args.p, amount = 24}
args.entities[#args.entities + 1] = {name = 'coal', position = args.p, amount = 20}
elseif noises.ore(p) < 0.041 and noises.ore(p) > -0.041 then
args.entities[#args.entities + 1] = {name = 'stone', position = args.p, amount = 10}
end

View File

@ -303,7 +303,7 @@ function Public.kraken_die(kraken_id)
local reward_fuel = Balance.kraken_kill_reward_fuel()
memory.stored_fuel = memory.stored_fuel + reward_fuel
local message = {'pirates.granted_3', Math.floor(reward_items[2].count/100)/10 .. 'k [item=coin]', reward_fuel .. ' [item=coal]', reward_items[1].count .. ' [item=sulfuric-acid-barrel]'}
local message = {'pirates.granted_3', {'pirates.granted_kraken_kill'}, Math.floor(reward_items[2].count/100)/10 .. 'k [item=coin]', reward_fuel .. ' [item=coal]', reward_items[1].count .. ' [item=sulfuric-acid-barrel]'}
Common.notify_force_light(memory.force,message)
memory.playtesting_stats.coins_gained_by_krakens = memory.playtesting_stats.coins_gained_by_krakens + reward_items[2].count