From b728cad8bcf1d98ddb4768997fae0933a74dc0fb Mon Sep 17 00:00:00 2001 From: danielmartin0 Date: Thu, 2 Jun 2022 14:47:23 +0100 Subject: [PATCH 01/14] add: new admin command to force the ship to set sail --- maps/pirates/commands.lua | 291 ++++++++++++++++++++------------------ 1 file changed, 155 insertions(+), 136 deletions(-) diff --git a/maps/pirates/commands.lua b/maps/pirates/commands.lua index 1c7fa4b9..3d69ebe9 100644 --- a/maps/pirates/commands.lua +++ b/maps/pirates/commands.lua @@ -40,6 +40,161 @@ local Classes = require 'maps.pirates.roles.classes' local GUIcolor = require 'maps.pirates.gui.color' + +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( +'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) + 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() + 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) + 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) + 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( 'ok', 'is used to accept captainhood.', @@ -187,111 +342,6 @@ 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.', @@ -370,37 +420,6 @@ function(cmd) 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.', From 7f5fc7f5e5227aa31d17a161a9d9a84d6f312642 Mon Sep 17 00:00:00 2001 From: danielmartin0 Date: Thu, 2 Jun 2022 14:49:18 +0100 Subject: [PATCH 02/14] luacheck --- maps/pirates/ai.lua | 1 - maps/pirates/api_events.lua | 30 +++++++++++++++--------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/maps/pirates/ai.lua b/maps/pirates/ai.lua index 865c9603..e986c7b6 100644 --- a/maps/pirates/ai.lua +++ b/maps/pirates/ai.lua @@ -132,7 +132,6 @@ function Public.wave_size_rng() -- random variance in attack sizes local wave_percentage_chance = Math.clamp(0, 70, 20 + 10 * memory.floating_pollution/1400) --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 diff --git a/maps/pirates/api_events.lua b/maps/pirates/api_events.lua index 4e6d1e49..fe52e7d6 100644 --- a/maps/pirates/api_events.lua +++ b/maps/pirates/api_events.lua @@ -644,21 +644,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 Public.every_nth_tree_gives_coins = 6 @@ -1793,7 +1793,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) From 4aa59d687b95fa5c02ea8c612c8eda3b2924cc0a Mon Sep 17 00:00:00 2001 From: danielmartin0 Date: Thu, 2 Jun 2022 14:51:56 +0100 Subject: [PATCH 03/14] locale for support toast --- locale/en/pirates.cfg | 1 + maps/pirates/api_events.lua | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/locale/en/pirates.cfg b/locale/en/pirates.cfg index 1e5a1246..711dbe17 100644 --- a/locale/en/pirates.cfg +++ b/locale/en/pirates.cfg @@ -21,6 +21,7 @@ softmod_info_updates_2=v1.2.11\n• Unlimited time can now be spent at sea betwe 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 diff --git a/maps/pirates/api_events.lua b/maps/pirates/api_events.lua index fe52e7d6..58c187f6 100644 --- a/maps/pirates/api_events.lua +++ b/maps/pirates/api_events.lua @@ -1177,7 +1177,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 From 2b1055dfec2ca062e5b72aa09cf57a28b8a05c8c Mon Sep 17 00:00:00 2001 From: danielmartin0 Date: Thu, 2 Jun 2022 15:29:24 +0100 Subject: [PATCH 04/14] rebalance red_desert ores --- maps/pirates/surfaces/islands/red_desert/data.lua | 2 +- maps/pirates/surfaces/islands/red_desert/red_desert.lua | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/maps/pirates/surfaces/islands/red_desert/data.lua b/maps/pirates/surfaces/islands/red_desert/data.lua index b7fb8f04..723b2b0a 100644 --- a/maps/pirates/surfaces/islands/red_desert/data.lua +++ b/maps/pirates/surfaces/islands/red_desert/data.lua @@ -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 diff --git a/maps/pirates/surfaces/islands/red_desert/red_desert.lua b/maps/pirates/surfaces/islands/red_desert/red_desert.lua index 2a879c9b..cd6856c9 100644 --- a/maps/pirates/surfaces/islands/red_desert/red_desert.lua +++ b/maps/pirates/surfaces/islands/red_desert/red_desert.lua @@ -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 From a170a05bc975f1df3bfbb5132cacd75794ac66f4 Mon Sep 17 00:00:00 2001 From: danielmartin0 Date: Thu, 2 Jun 2022 15:32:27 +0100 Subject: [PATCH 05/14] fix: all silos should die, not just one --- maps/pirates/api_events.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/maps/pirates/api_events.lua b/maps/pirates/api_events.lua index 58c187f6..70256e68 100644 --- a/maps/pirates/api_events.lua +++ b/maps/pirates/api_events.lua @@ -1626,8 +1626,13 @@ local function event_on_rocket_launched(event) 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 From 84e98435d3bed7d19e31946c28bf4aedca8487b0 Mon Sep 17 00:00:00 2001 From: danielmartin0 Date: Thu, 2 Jun 2022 16:11:45 +0100 Subject: [PATCH 06/14] more specific 'Granted' messages --- locale/en/pirates.cfg | 11 ++++++++--- maps/pirates/api_events.lua | 2 +- maps/pirates/api_on_tick.lua | 2 +- maps/pirates/quest.lua | 2 +- maps/pirates/surfaces/sea/kraken.lua | 2 +- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/locale/en/pirates.cfg b/locale/en/pirates.cfg index 711dbe17..3e4e6e10 100644 --- a/locale/en/pirates.cfg +++ b/locale/en/pirates.cfg @@ -122,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__. diff --git a/maps/pirates/api_events.lua b/maps/pirates/api_events.lua index 70256e68..b2043c38 100644 --- a/maps/pirates/api_events.lua +++ b/maps/pirates/api_events.lua @@ -1613,7 +1613,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 diff --git a/maps/pirates/api_on_tick.lua b/maps/pirates/api_on_tick.lua index fb188417..64328007 100644 --- a/maps/pirates/api_on_tick.lua +++ b/maps/pirates/api_on_tick.lua @@ -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 diff --git a/maps/pirates/quest.lua b/maps/pirates/quest.lua index aee0f7bd..208de105 100644 --- a/maps/pirates/quest.lua +++ b/maps/pirates/quest.lua @@ -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 diff --git a/maps/pirates/surfaces/sea/kraken.lua b/maps/pirates/surfaces/sea/kraken.lua index 6c360f05..0a7d2e2e 100644 --- a/maps/pirates/surfaces/sea/kraken.lua +++ b/maps/pirates/surfaces/sea/kraken.lua @@ -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 From 513c9559bf6c3ded7d1f517c73e98c849dbda1c8 Mon Sep 17 00:00:00 2001 From: danielmartin0 Date: Thu, 2 Jun 2022 16:15:28 +0100 Subject: [PATCH 07/14] version update: v1.2.12 --- locale/en/pirates.cfg | 4 ++-- maps/pirates/coredata.lua | 2 +- maps/pirates/gui/info.lua | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/locale/en/pirates.cfg b/locale/en/pirates.cfg index 3e4e6e10..10ca01dd 100644 --- a/locale/en/pirates.cfg +++ b/locale/en/pirates.cfg @@ -15,8 +15,8 @@ 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 diff --git a/maps/pirates/coredata.lua b/maps/pirates/coredata.lua index 6695de79..6a114fe0 100644 --- a/maps/pirates/coredata.lua +++ b/maps/pirates/coredata.lua @@ -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 diff --git a/maps/pirates/gui/info.lua b/maps/pirates/gui/info.lua index d441a6ce..408532e8 100644 --- a/maps/pirates/gui/info.lua +++ b/maps/pirates/gui/info.lua @@ -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 From e9854f358e7d8109d14acb41341f214decb577c3 Mon Sep 17 00:00:00 2001 From: danielmartin0 Date: Thu, 2 Jun 2022 16:31:30 +0100 Subject: [PATCH 08/14] balance wave frequency --- maps/pirates/ai.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maps/pirates/ai.lua b/maps/pirates/ai.lua index e986c7b6..77ad6bd4 100644 --- a/maps/pirates/ai.lua +++ b/maps/pirates/ai.lua @@ -129,7 +129,7 @@ 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, 40, 20 + 10 * memory.floating_pollution/1500) --trying this out local wave_size_multiplier = 1 local rng1 = Math.random(100) From 3224e5b6143b02c715054171af6b18ec5e96f621 Mon Sep 17 00:00:00 2001 From: danielmartin0 Date: Thu, 2 Jun 2022 17:25:04 +0100 Subject: [PATCH 09/14] balance --- maps/pirates/ai.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maps/pirates/ai.lua b/maps/pirates/ai.lua index 77ad6bd4..7cf42319 100644 --- a/maps/pirates/ai.lua +++ b/maps/pirates/ai.lua @@ -129,7 +129,7 @@ end function Public.wave_size_rng() -- random variance in attack sizes local memory = Memory.get_crew_memory() - local wave_percentage_chance = Math.clamp(0, 40, 20 + 10 * memory.floating_pollution/1500) --trying this out + local wave_percentage_chance = Math.clamp(0, 35, 15 + 10 * memory.floating_pollution/1500) --trying this out local wave_size_multiplier = 1 local rng1 = Math.random(100) From f10094d57e7190e8d90cdaa5c0dbdd9855e29123 Mon Sep 17 00:00:00 2001 From: danielmartin0 Date: Thu, 2 Jun 2022 17:47:32 +0100 Subject: [PATCH 10/14] small rewrite --- maps/pirates/balance.lua | 2 +- maps/pirates/overworld.lua | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/maps/pirates/balance.lua b/maps/pirates/balance.lua index 4ba351ac..c18f6913 100644 --- a/maps/pirates/balance.lua +++ b/maps/pirates/balance.lua @@ -342,7 +342,7 @@ function Public.quest_structure_entry_price_scale() end -function Public.apply_crew_buffs_per_x(force) +function Public.apply_crew_buffs_at_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 end diff --git a/maps/pirates/overworld.lua b/maps/pirates/overworld.lua index aa9798fc..cdd27968 100644 --- a/maps/pirates/overworld.lua +++ b/maps/pirates/overworld.lua @@ -682,8 +682,9 @@ 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_at_x(memory.force) -- 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) From afc155da132d68208db44aa18da9bb3caae5de03 Mon Sep 17 00:00:00 2001 From: danielmartin0 Date: Thu, 2 Jun 2022 17:49:05 +0100 Subject: [PATCH 11/14] luacheck --- maps/pirates/overworld.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maps/pirates/overworld.lua b/maps/pirates/overworld.lua index cdd27968..ba4c5b5d 100644 --- a/maps/pirates/overworld.lua +++ b/maps/pirates/overworld.lua @@ -683,7 +683,7 @@ function Public.try_overworld_move_v2(vector) --islands stay, crowsnest moves for i=1,vector.x do Common.give_items_to_crew(Balance.periodic_free_resources_per_x()) end - + Balance.apply_crew_buffs_at_x(memory.force) -- add some evo: (this will get reset upon arriving at a destination anyway, so this is just relevant for sea monsters and the like:) From b817512a43de701e74eed5704135a17b3a431f21 Mon Sep 17 00:00:00 2001 From: danielmartin0 Date: Thu, 2 Jun 2022 17:55:56 +0100 Subject: [PATCH 12/14] lab productivity fix --- maps/pirates/balance.lua | 4 ++-- maps/pirates/overworld.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/maps/pirates/balance.lua b/maps/pirates/balance.lua index c18f6913..a7773647 100644 --- a/maps/pirates/balance.lua +++ b/maps/pirates/balance.lua @@ -342,8 +342,8 @@ function Public.quest_structure_entry_price_scale() end -function Public.apply_crew_buffs_at_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) diff --git a/maps/pirates/overworld.lua b/maps/pirates/overworld.lua index ba4c5b5d..e926bed6 100644 --- a/maps/pirates/overworld.lua +++ b/maps/pirates/overworld.lua @@ -684,7 +684,7 @@ function Public.try_overworld_move_v2(vector) --islands stay, crowsnest moves Common.give_items_to_crew(Balance.periodic_free_resources_per_x()) end - Balance.apply_crew_buffs_at_x(memory.force) + 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) From eb9dcbc60ff73c61a885044efd2a72cd4ba0880d Mon Sep 17 00:00:00 2001 From: danielmartin0 Date: Thu, 2 Jun 2022 18:06:38 +0100 Subject: [PATCH 13/14] wave frequency patch --- maps/pirates/ai.lua | 2 +- maps/pirates/commands.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/maps/pirates/ai.lua b/maps/pirates/ai.lua index 7cf42319..c715f97b 100644 --- a/maps/pirates/ai.lua +++ b/maps/pirates/ai.lua @@ -129,7 +129,7 @@ end function Public.wave_size_rng() -- random variance in attack sizes local memory = Memory.get_crew_memory() - local wave_percentage_chance = Math.clamp(0, 35, 15 + 10 * memory.floating_pollution/1500) --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 rng1 = Math.random(100) diff --git a/maps/pirates/commands.lua b/maps/pirates/commands.lua index 3d69ebe9..08fe3e16 100644 --- a/maps/pirates/commands.lua +++ b/maps/pirates/commands.lua @@ -402,7 +402,7 @@ function(cmd) 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( From d331c665f5ce5905de3399895a3ded16171fbbe1 Mon Sep 17 00:00:00 2001 From: danielmartin0 Date: Thu, 2 Jun 2022 19:54:47 +0100 Subject: [PATCH 14/14] fix: command memory setting --- maps/pirates/api_on_tick.lua | 4 +- maps/pirates/commands.lua | 114 ++++++++++++++++++++--------------- maps/pirates/common.lua | 2 +- maps/pirates/gui/gui.lua | 2 +- 4 files changed, 69 insertions(+), 53 deletions(-) diff --git a/maps/pirates/api_on_tick.lua b/maps/pirates/api_on_tick.lua index 64328007..a0048205 100644 --- a/maps/pirates/api_on_tick.lua +++ b/maps/pirates/api_on_tick.lua @@ -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)) diff --git a/maps/pirates/commands.lua b/maps/pirates/commands.lua index 08fe3e16..3de84ebf 100644 --- a/maps/pirates/commands.lua +++ b/maps/pirates/commands.lua @@ -41,6 +41,13 @@ 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] @@ -69,9 +76,6 @@ local function check_captain(cmd) 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 @@ -92,9 +96,6 @@ local function check_captain_or_admin(cmd) 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 @@ -148,11 +149,11 @@ 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 crew_id = tonumber(string.sub(player.force.name, -3, -1)) or nil - Memory.set_working_id(crew_id) local memory = Memory.get_crew_memory() Crew.summon_crew() if memory.boat.state == Boats.enum_state.ATSEA_WAITING_TO_SAIL then @@ -165,11 +166,11 @@ 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] - local crew_id = tonumber(string.sub(player.force.name, -3, -1)) or nil - Memory.set_working_id(crew_id) if param and game.players[param] and game.players[param].index then Roles.make_captain(game.players[param]) else @@ -182,6 +183,8 @@ 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] @@ -199,10 +202,10 @@ 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) @@ -241,9 +244,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 @@ -263,9 +268,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 @@ -346,6 +353,8 @@ 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 @@ -361,6 +370,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 @@ -381,6 +392,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] @@ -397,6 +410,8 @@ 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] @@ -409,12 +424,11 @@ 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 @@ -424,11 +438,11 @@ 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 @@ -441,11 +455,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) @@ -454,11 +468,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} @@ -478,11 +492,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) @@ -491,11 +505,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) @@ -504,11 +518,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) @@ -517,11 +531,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) @@ -531,11 +545,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 @@ -589,11 +603,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 @@ -609,11 +623,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 @@ -623,11 +637,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 @@ -718,11 +732,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...') @@ -930,11 +944,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) @@ -945,11 +959,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) @@ -960,11 +974,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) @@ -975,11 +989,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}) @@ -990,11 +1004,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}) diff --git a/maps/pirates/common.lua b/maps/pirates/common.lua index 09bac3b4..0dd09b24 100644 --- a/maps/pirates/common.lua +++ b/maps/pirates/common.lua @@ -173,7 +173,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 diff --git a/maps/pirates/gui/gui.lua b/maps/pirates/gui/gui.lua index d94f6c59..3e7340b8 100644 --- a/maps/pirates/gui/gui.lua +++ b/maps/pirates/gui/gui.lua @@ -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'}