From e553658e0961ce9d5e8103b826d07a9ee3b62a58 Mon Sep 17 00:00:00 2001
From: danielmartin0 <danielmartin111@gmail.com>
Date: Mon, 9 May 2022 00:36:48 +0100
Subject: [PATCH 1/9] adjustments

---
 control.lua                     |  2 +-
 maps/pirates/balance.lua        |  4 +++-
 maps/pirates/common.lua         |  3 +++
 maps/pirates/coredata.lua       |  4 ++--
 maps/pirates/crew.lua           |  2 +-
 maps/pirates/gui/gui.lua        | 16 ++++++++--------
 maps/pirates/highscore.lua      |  3 +++
 maps/pirates/loot.lua           |  4 ++--
 maps/pirates/memory.lua         |  2 +-
 maps/pirates/surfaces/cabin.lua |  2 +-
 10 files changed, 25 insertions(+), 17 deletions(-)

diff --git a/control.lua b/control.lua
index db3cb2c0..18b312d8 100644
--- a/control.lua
+++ b/control.lua
@@ -111,7 +111,7 @@ require 'utils.freeplay'
 --require 'maps.chronosphere.main'
 
 --![[Adventure as a crew of pirates]]--
---require 'maps.pirates.main'
+require 'maps.pirates.main'
 
 --![[Launch rockets in increasingly harder getting worlds.]]--
 --require 'maps.journey.main'
diff --git a/maps/pirates/balance.lua b/maps/pirates/balance.lua
index 58556b8a..de9b273c 100644
--- a/maps/pirates/balance.lua
+++ b/maps/pirates/balance.lua
@@ -45,7 +45,9 @@ Public.rocket_launch_coin_reward = 6000
 function Public.crew_scale()
 	local ret = Common.activecrewcount()/10
 	if ret == 0 then ret = 1/10 end --if all players are afk
-	if ret > 2.4 then ret = 2.4 end --we have to cap this because you need time to mine the ore... and big crews are a mess anyway. currently this value matches the 24 player capacity setting
+	if ret > 2.1 then ret = 2.1 end --An upper cap on this is important, for two reasons:
+	-- large crews become disorganised
+	-- Higher values of this scale lower the amount of time you get on each island. But the amount of time certain island tasks take is fixed; e.g. the amount of ore is mostly invariant, and you need time to mine it.
 	return ret
 end
 
diff --git a/maps/pirates/common.lua b/maps/pirates/common.lua
index e65ad571..945dc897 100644
--- a/maps/pirates/common.lua
+++ b/maps/pirates/common.lua
@@ -9,6 +9,9 @@ local _inspect = require 'utils.inspect'.inspect
 -- local perlin_noise = require 'utils.perlin_noise'
 -- local Force_health_booster = require 'modules.force_health_booster'
 
+-- == Common variables and functions used throughout pirate ship files
+
+
 local Public = {}
 
 -- Public.active_crews_cap = 1
diff --git a/maps/pirates/coredata.lua b/maps/pirates/coredata.lua
index 6283324a..c6ae6170 100644
--- a/maps/pirates/coredata.lua
+++ b/maps/pirates/coredata.lua
@@ -5,8 +5,8 @@ local _inspect = require 'utils.inspect'.inspect
 local Public = {}
 
 Public.scenario_id_name = 'pirates'
-Public.version_string = '1.1.2.2.2'
-Public.version_float = 1.1222
+Public.version_string = '1.2.1' --will now try to stick to major.minor.patch versioning, to match factorio mod portal
+Public.version_float = 1.21
 
 Public.blueprint_library_allowed = true
 Public.blueprint_importing_allowed = true
diff --git a/maps/pirates/crew.lua b/maps/pirates/crew.lua
index 519382cb..7a7bcb2a 100644
--- a/maps/pirates/crew.lua
+++ b/maps/pirates/crew.lua
@@ -664,7 +664,7 @@ function Public.initialise_crew(accepted_proposal)
 
 	global_memory.crew_active_ids[#global_memory.crew_active_ids + 1] = new_id
 
-	Memory.reset_crew_memory(new_id)
+	Memory.initialise_crew_memory(new_id)
 	Memory.set_working_id(new_id)
 
 	game.reset_time_played() -- affects the multiplayer lobby view
diff --git a/maps/pirates/gui/gui.lua b/maps/pirates/gui/gui.lua
index adccbf9d..4c5b27fa 100644
--- a/maps/pirates/gui/gui.lua
+++ b/maps/pirates/gui/gui.lua
@@ -779,7 +779,7 @@ function Public.process_siloframe_and_questframe_updates(flowsilo, flowquest, bo
 
 				if quest_complete and quest_reward then
 					tooltip = 'This island\'s quest is complete, and this is the reward.'
-					flow1.quest_label_1.caption = 'Quest:'
+					flow1.quest_label_1.caption = 'Island Quest:'
 					flow1.quest_label_1.style.font_color = GuiCommon.achieved_font_color
 					flow1.quest_label_2.visible = true
 					flow1.quest_label_3.visible = false
@@ -787,7 +787,7 @@ function Public.process_siloframe_and_questframe_updates(flowsilo, flowquest, bo
 					flow1.quest_label_2.caption = quest_reward.display_amount .. ' ' .. quest_reward.display_sprite
 				elseif quest_reward then
 					if quest_progress < quest_progressneeded then
-						flow1.quest_label_1.caption = 'Quest:'
+						flow1.quest_label_1.caption = 'Island Quest:'
 						flow1.quest_label_1.style.font_color = GuiCommon.bold_font_color
 						flow1.quest_label_2.visible = true
 						flow1.quest_label_3.visible = true
@@ -801,7 +801,7 @@ function Public.process_siloframe_and_questframe_updates(flowsilo, flowquest, bo
 					end
 
 					if quest_type == Quest.enum.TIME then
-						if tooltip == '' then tooltip = 'Quest: Time\n\nLaunch a rocket before the countdown completes for a bonus.' end
+						if tooltip == '' then tooltip = 'Island Quest: Time\n\nLaunch a rocket before the countdown completes for a bonus.' end
 
 						if quest_progress >= 0 then
 							flow1.quest_label_3.caption = string.format('%.0fm%.0fs', Math.floor(quest_progress / 60), quest_progress % 60)
@@ -824,13 +824,13 @@ function Public.process_siloframe_and_questframe_updates(flowsilo, flowquest, bo
 						end
 
 					elseif quest_type == Quest.enum.WORMS then
-						if tooltip == '' then tooltip = 'Quest: Worms\n\nKill enough worms for a bonus.' end
+						if tooltip == '' then tooltip = 'Island Quest: Worms\n\nKill enough worms for a bonus.' end
 
 					elseif quest_type == Quest.enum.FIND then
-						if tooltip == '' then tooltip = 'Quest: Ghosts\n\nFind the ghosts for a bonus.' end
+						if tooltip == '' then tooltip = 'Island Quest: Ghosts\n\nFind the ghosts for a bonus.' end
 
 					elseif quest_type == Quest.enum.RESOURCEFLOW then
-						if tooltip == '' then tooltip = 'Quest: Resource Flow\n\nAchieve a production rate of a particular item for a bonus.' end
+						if tooltip == '' then tooltip = 'Island Quest: Resource Flow\n\nAchieve a production rate of a particular item for a bonus.' end
 
 						-- out of date:
 						if quest_progressneeded/60 % 1 == 0 then
@@ -842,12 +842,12 @@ function Public.process_siloframe_and_questframe_updates(flowsilo, flowquest, bo
 						end
 
 					elseif quest_type == Quest.enum.RESOURCECOUNT then
-						if tooltip == '' then tooltip = 'Quest: Item Production\n\nSimply produce a particular number of items for a bonus, anywhere on the map.' end
+						if tooltip == '' then tooltip = 'Island Quest: Item Production\n\nSimply complete production of these items for a bonus, anywhere on the map.' end
 
 						flow1.quest_label_2.caption = string.format('%s ', '[item=' .. quest_params.item .. ']')
 
 					elseif quest_type == Quest.enum.NODAMAGE then
-						if tooltip == '' then tooltip = 'Quest: No Damage\n\nLaunch a rocket without the silo taking damage.' end
+						if tooltip == '' then tooltip = 'Island Quest: No Damage\n\nLaunch a rocket without the silo taking damage.' end
 
 						if bools.approaching_bool or (dynamic_data.rocketsilos and dynamic_data.rocketsilos[1] and dynamic_data.rocketsilos[1].valid and dynamic_data.rocketsilohp == dynamic_data.rocketsilomaxhp) then
 							flow1.quest_label_3.caption = string.format('OK')
diff --git a/maps/pirates/highscore.lua b/maps/pirates/highscore.lua
index 46921996..1b427074 100644
--- a/maps/pirates/highscore.lua
+++ b/maps/pirates/highscore.lua
@@ -21,6 +21,9 @@ local score_key_debug = 'pirate_ship_scores_debug'
 local score_key_modded = 'pirate_ship_scores_modded'
 
 
+-- == This code is mostly a fork of the file from Mountain Fortress
+
+
 local Public = {}
 local insert = table.insert
 local this = {
diff --git a/maps/pirates/loot.lua b/maps/pirates/loot.lua
index 7a163ae9..ea5e1d57 100644
--- a/maps/pirates/loot.lua
+++ b/maps/pirates/loot.lua
@@ -42,7 +42,7 @@ Public.buried_treasure_loot_data_raw = {
 
 Public.chest_loot_data_raw = {
 	{80, 0, 1, false, 'coin', 400, 700},
-	{30, 0, 1, false, 'rail-signal', 25, 110},
+	{30, 0, 1, false, 'rail-signal', 50, 50},
 	{1, 0.2, 1, false, 'electric-engine-unit', 1, 2},
 	{3, 0, 1, false, 'small-lamp', 4, 16},
 	{10, 0, 1, false, 'coal', 60, 100},
@@ -336,7 +336,7 @@ Public.maze_treasure_data_raw = {
 
 	{2, 0, 1, false, 'uranium-rounds-magazine', 15, 25},
 	{2, 0, 1, false, 'artillery-shell', 5, 7},
-	{2, 0, 1, false, 'rail-signal', 400, 500},
+	{2, 0, 1, false, 'rail-signal', 400, 400},
 	{2, 0, 1, false, 'electric-engine-unit', 3, 4},
 	{2, 0, 1, false, 'cluster-grenade', 8, 12},
 
diff --git a/maps/pirates/memory.lua b/maps/pirates/memory.lua
index 4ab423aa..83f77d03 100644
--- a/maps/pirates/memory.lua
+++ b/maps/pirates/memory.lua
@@ -40,7 +40,7 @@ end
 
 
 
-function Public.reset_crew_memory(id) --mostly serves as a dev reference of memory entries
+function Public.initialise_crew_memory(id) --mostly serves as a dev reference of memory entries
 	-- but not _everything_ is stored here, it's just a guide to the most important things
 
 	pirates_global_memory.crew_memories[id] = {}
diff --git a/maps/pirates/surfaces/cabin.lua b/maps/pirates/surfaces/cabin.lua
index 51f416fc..77d968e2 100644
--- a/maps/pirates/surfaces/cabin.lua
+++ b/maps/pirates/surfaces/cabin.lua
@@ -101,7 +101,7 @@ Public.cabin_shop_data = {
 		offer = {type='give-item', item = 'artillery-shell', count = 5},
 	},
 	{
-		price = {{'coin', 1000}, {'electronic-circuit', 30}},
+		price = {{'coin', 1000}, {'electronic-circuit', 25}},
 		offer = {type='give-item', item = 'rail-signal', count = 100},
 	},
 	{

From 24c98c2b870094e53825ca654ceb3ff5ad0ece1c Mon Sep 17 00:00:00 2001
From: danielmartin0 <danielmartin111@gmail.com>
Date: Sun, 22 May 2022 23:11:52 +0100
Subject: [PATCH 2/9] v1.2.1

---
 control.lua                |  2 +-
 maps/pirates/common.lua    |  1 +
 maps/pirates/overworld.lua |  2 +-
 maps/pirates/shop/shop.lua | 20 ++++++++++----------
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/control.lua b/control.lua
index 18b312d8..82cb1f92 100644
--- a/control.lua
+++ b/control.lua
@@ -1,6 +1,6 @@
 require 'utils.data_stages'
 _LIFECYCLE = _STAGE.control -- Control stage
-_DEBUG = false
+_DEBUG = true
 _DUMP_ENV = false
 
 require 'utils.server'
diff --git a/maps/pirates/common.lua b/maps/pirates/common.lua
index 945dc897..5423bedf 100644
--- a/maps/pirates/common.lua
+++ b/maps/pirates/common.lua
@@ -738,6 +738,7 @@ end
 function Public.entity_damage_healthbar(entity, damage, location_override)
 	location_override = location_override or Memory.get_crew_memory()
 	local unit_number = entity.unit_number
+	if not (location_override.healthbars) then return end
 
 	local healthbar = location_override.healthbars[unit_number]
 	if not healthbar then return 0 end
diff --git a/maps/pirates/overworld.lua b/maps/pirates/overworld.lua
index 3ab1c50a..86a38312 100644
--- a/maps/pirates/overworld.lua
+++ b/maps/pirates/overworld.lua
@@ -246,7 +246,7 @@ function Public.generate_overworld_destination(p)
 		local base_cost_4 = {
 			['electronic-circuit'] = Math.ceil(((macro_p.x-2)^(2/3))*100),
 			['advanced-circuit'] = Math.ceil(((macro_p.x-14)^(2/3))*18),
-			['flying-robot-frame'] = Math.ceil(((macro_p.x-18)^(2/3))*10),
+			['flying-robot-frame'] = Math.ceil(((macro_p.x-18)^(2/3))*15),
 			['launch_rocket'] = true,
 		}
 		local base_cost_5 = {
diff --git a/maps/pirates/shop/shop.lua b/maps/pirates/shop/shop.lua
index c94f978c..ff4c87b5 100644
--- a/maps/pirates/shop/shop.lua
+++ b/maps/pirates/shop/shop.lua
@@ -23,11 +23,11 @@ Public.Minimarket = require 'maps.pirates.shop.dock'
 
 
 
-function Public.print_transaction(player, offer, price)
+function Public.print_transaction(player, offer_itename, offer_itemcount, price)
 	local s1 = ' traded away '
 	local s2 = ''
-	local s3 = offer.count .. ' ' .. offer.item
-	if offer.item == 'coin' then s1 = ' sold ' end
+	local s3 = offer_itemcount .. ' ' .. offer_itename
+	if offer_itename == 'coin' then s1 = ' sold ' end
 	for i, p in pairs(price) do
 		local p2 = {name = p.name, amount = p.amount}
 		if p2.name == 'raw-fish' then p2.name = 'fish' end
@@ -253,7 +253,7 @@ function Public.event_on_market_item_purchased(event)
 					refunds = refunds + 1
 				end
 			else
-				Common.notify_force_light(player.force, player.name .. ' bought ' .. thisPurchaseData.this_offer.offer.count .. ' ' .. thisPurchaseData.this_offer.offer.item .. ' for ' .. thisPurchaseData.price[1].amount .. ' ' .. thisPurchaseData.price[1].name .. '.')
+				Common.notify_force_light(player.force, player.name .. ' bought ' .. thisPurchaseData.offer_giveitem_count .. ' ' .. thisPurchaseData.offer_giveitem_name .. ' for ' .. thisPurchaseData.price[1].amount .. ' ' .. thisPurchaseData.price[1].name .. '.')
 
 				market.remove_market_item(offer_index)
 			end
@@ -280,7 +280,7 @@ function Public.event_on_market_item_purchased(event)
 						local price_name = thisPurchaseData.price[1].name
 						Common.notify_force_light(player.force, player.name .. ' bought extra time at sea for ' .. thisPurchaseData.price[1].amount .. ' ' .. price_name .. '.')
 					else
-						Public.print_transaction(player, thisPurchaseData.this_offer.offer, thisPurchaseData.price)
+						Public.print_transaction(player, thisPurchaseData.offer_giveitem_name, thisPurchaseData.offer_giveitem_count, thisPurchaseData.price)
 					end
 				end
 			end
@@ -302,7 +302,7 @@ function Public.event_on_market_item_purchased(event)
 				if thisPurchaseData.decay_type == 'static' then
 					if not inv then return end
 					local flying_text_color = {r = 255, g = 255, b = 255}
-					local text1 = '[color=1,1,1]+' .. thisPurchaseData.this_offer.offer.count .. '[/color] [item=' .. thisPurchaseData.alloffers[offer_index].offer.item .. ']'
+					local text1 = '[color=1,1,1]+' .. thisPurchaseData.offer_giveitem_count .. '[/color] [item=' .. thisPurchaseData.alloffers[offer_index].offer.item .. ']'
 					local text2 = '[color=' .. flying_text_color.r .. ',' .. flying_text_color.g .. ',' .. flying_text_color.b .. '](' .. inv.get_item_count(thisPurchaseData.alloffers[offer_index].offer.item) .. ')[/color]'
 
 					Common.flying_text(player.surface, player.position, text1 .. '  [font=count-font]' .. text2 .. '[/font]')
@@ -312,8 +312,8 @@ function Public.event_on_market_item_purchased(event)
 
 					if not inv then return end
 					local flying_text_color = {r = 255, g = 255, b = 255}
-					local text1 = '[color=1,1,1]+' .. thisPurchaseData.this_offer.offer.count .. '[/color] [item=' .. thisPurchaseData.alloffers[offer_index].offer.item .. ']'
-					local text2 = '[color=' .. flying_text_color.r .. ',' .. flying_text_color.g .. ',' .. flying_text_color.b .. '](' .. inv.get_item_count(thisPurchaseData.this_offer.offer.item) .. ')[/color]'
+					local text1 = '[color=1,1,1]+' .. thisPurchaseData.offer_giveitem_count .. '[/color] [item=' .. thisPurchaseData.alloffers[offer_index].offer.item .. ']'
+					local text2 = '[color=' .. flying_text_color.r .. ',' .. flying_text_color.g .. ',' .. flying_text_color.b .. '](' .. inv.get_item_count(thisPurchaseData.offer_giveitem_name) .. ')[/color]'
 
 					Common.flying_text(player.surface, player.position, text1 .. '  [font=count-font]' .. text2 .. '[/font]')
 
@@ -329,8 +329,8 @@ function Public.event_on_market_item_purchased(event)
 		end
 	end
 
-	if thisPurchaseData.this_offer.offer.item == 'coin' and refunds < trade_count then
-		memory.playtesting_stats.coins_gained_by_markets = memory.playtesting_stats.coins_gained_by_markets + thisPurchaseData.this_offer.offer.count
+	if thisPurchaseData.offer_giveitem_name and thisPurchaseData.offer_giveitem_name == 'coin' and refunds < trade_count then
+		memory.playtesting_stats.coins_gained_by_markets = memory.playtesting_stats.coins_gained_by_markets + thisPurchaseData.offer_giveitem_count
 	end
 end
 

From 37dd892da2a339b8d09f489a5f83f326623fc87d Mon Sep 17 00:00:00 2001
From: danielmartin0 <danielmartin111@gmail.com>
Date: Sun, 22 May 2022 23:20:30 +0100
Subject: [PATCH 3/9] patch

---
 maps/pirates/shop/shop.lua | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/maps/pirates/shop/shop.lua b/maps/pirates/shop/shop.lua
index ff4c87b5..e5c4aca6 100644
--- a/maps/pirates/shop/shop.lua
+++ b/maps/pirates/shop/shop.lua
@@ -104,6 +104,7 @@ local function purchaseData(market, player, offer_index)
 	end
 
 	return {
+		alloffers = alloffers,
 		decay_type = decay_type,
 		price = price,
 		offer_type = offer_type,
@@ -302,8 +303,8 @@ function Public.event_on_market_item_purchased(event)
 				if thisPurchaseData.decay_type == 'static' then
 					if not inv then return end
 					local flying_text_color = {r = 255, g = 255, b = 255}
-					local text1 = '[color=1,1,1]+' .. thisPurchaseData.offer_giveitem_count .. '[/color] [item=' .. thisPurchaseData.alloffers[offer_index].offer.item .. ']'
-					local text2 = '[color=' .. flying_text_color.r .. ',' .. flying_text_color.g .. ',' .. flying_text_color.b .. '](' .. inv.get_item_count(thisPurchaseData.alloffers[offer_index].offer.item) .. ')[/color]'
+					local text1 = '[color=1,1,1]+' .. thisPurchaseData.offer_giveitem_count .. '[/color] [item=' .. thisPurchaseData.offer_giveitem_name .. ']'
+					local text2 = '[color=' .. flying_text_color.r .. ',' .. flying_text_color.g .. ',' .. flying_text_color.b .. '](' .. inv.get_item_count(thisPurchaseData.offer_giveitem_name) .. ')[/color]'
 
 					Common.flying_text(player.surface, player.position, text1 .. '  [font=count-font]' .. text2 .. '[/font]')
 				else
@@ -312,7 +313,7 @@ function Public.event_on_market_item_purchased(event)
 
 					if not inv then return end
 					local flying_text_color = {r = 255, g = 255, b = 255}
-					local text1 = '[color=1,1,1]+' .. thisPurchaseData.offer_giveitem_count .. '[/color] [item=' .. thisPurchaseData.alloffers[offer_index].offer.item .. ']'
+					local text1 = '[color=1,1,1]+' .. thisPurchaseData.offer_giveitem_count .. '[/color] [item=' .. thisPurchaseData.offer_giveitem_name .. ']'
 					local text2 = '[color=' .. flying_text_color.r .. ',' .. flying_text_color.g .. ',' .. flying_text_color.b .. '](' .. inv.get_item_count(thisPurchaseData.offer_giveitem_name) .. ')[/color]'
 
 					Common.flying_text(player.surface, player.position, text1 .. '  [font=count-font]' .. text2 .. '[/font]')

From 526d25d9a183f54151df26d505044bd535bc9b3a Mon Sep 17 00:00:00 2001
From: danielmartin0 <danielmartin111@gmail.com>
Date: Sun, 22 May 2022 23:26:50 +0100
Subject: [PATCH 4/9] patch and balance

---
 control.lua                     | 2 +-
 maps/pirates/balance.lua        | 2 +-
 maps/pirates/progression.lua    | 2 +-
 maps/pirates/shop/merchants.lua | 4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/control.lua b/control.lua
index 82cb1f92..18b312d8 100644
--- a/control.lua
+++ b/control.lua
@@ -1,6 +1,6 @@
 require 'utils.data_stages'
 _LIFECYCLE = _STAGE.control -- Control stage
-_DEBUG = true
+_DEBUG = false
 _DUMP_ENV = false
 
 require 'utils.server'
diff --git a/maps/pirates/balance.lua b/maps/pirates/balance.lua
index de9b273c..e7c0bc17 100644
--- a/maps/pirates/balance.lua
+++ b/maps/pirates/balance.lua
@@ -370,7 +370,7 @@ function Public.kraken_kill_reward_items()
 	return {{name = 'sulfuric-acid-barrel', count = 5}, {name = 'coin', count = 1000}}
 end
 function Public.kraken_kill_reward_fuel()
-	return 150
+	return 200
 end
 
 function Public.kraken_health()
diff --git a/maps/pirates/progression.lua b/maps/pirates/progression.lua
index e2ce00f3..21d81df1 100644
--- a/maps/pirates/progression.lua
+++ b/maps/pirates/progression.lua
@@ -41,7 +41,7 @@ function Public.fuel_depletion_rate()
 	if state == Boats.enum_state.ATSEA_SAILING or state == Boats.enum_state.APPROACHING then
 		return Balance.fuel_depletion_rate_sailing()
 	elseif state == Boats.enum_state.LEAVING_DOCK then
-		return Balance.fuel_depletion_rate_sailing() * 2
+		return Balance.fuel_depletion_rate_sailing() * 1
 	elseif state == Boats.enum_state.RETREATING then
 		return Balance.fuel_depletion_rate_sailing() / 4
 	elseif state == Boats.enum_state.LANDED then
diff --git a/maps/pirates/shop/merchants.lua b/maps/pirates/shop/merchants.lua
index 3905c306..cd31a3f3 100644
--- a/maps/pirates/shop/merchants.lua
+++ b/maps/pirates/shop/merchants.lua
@@ -39,7 +39,7 @@ function Public.generate_merchant_trades(market)
 			market.add_market_item{price = {{'coin', 5000}, {'raw-fish', 10}}, offer = {type = 'give-item', item = 'energy-shield-mk2-equipment', count = 1}}
 			market.add_market_item{price = {{'coin', 4000}, {'raw-fish', 10}}, offer = {type = 'give-item', item = 'personal-roboport-mk2-equipment', count = 1}}
 			market.add_market_item{price = {{'coin', 8000}, {'raw-fish', 10}}, offer = {type = 'give-item', item = 'exoskeleton-equipment', count = 1}}
-			market.add_market_item{price = {{'coin', 10000}, {'raw-fish', 10}}, offer = {type = 'give-item', item = 'personal-laser-defense', count = 1}}
+			market.add_market_item{price = {{'coin', 10000}, {'raw-fish', 10}}, offer = {type = 'give-item', item = 'personal-laser-defense-equipment', count = 1}}
 		-- else
 		-- 	market.add_market_item{price = {{'coin', 18000}, {'raw-fish', 100}}, offer = {type = 'give-item', item = 'power-armor', count = 1}}
 		-- 	market.add_market_item{price = {{'coin', 24000}, {'raw-fish', 100}}, offer = {type = 'give-item', item = 'power-armor-mk2', count = 1}}
@@ -50,7 +50,7 @@ function Public.generate_merchant_trades(market)
 		-- 	market.add_market_item{price = {{'coin', 5000}, {'raw-fish', 10}}, offer = {type = 'give-item', item = 'energy-shield-mk2-equipment', count = 1}}
 		-- 	market.add_market_item{price = {{'coin', 4000}, {'raw-fish', 10}}, offer = {type = 'give-item', item = 'personal-roboport-mk2-equipment', count = 1}}
 		-- 	market.add_market_item{price = {{'coin', 8000}, {'raw-fish', 10}}, offer = {type = 'give-item', item = 'exoskeleton-equipment', count = 1}}
-		-- 	market.add_market_item{price = {{'coin', 10000}, {'raw-fish', 10}}, offer = {type = 'give-item', item = 'personal-laser-defense', count = 1}}
+		-- 	market.add_market_item{price = {{'coin', 10000}, {'raw-fish', 10}}, offer = {type = 'give-item', item = 'personal-laser-defense-equipment', count = 1}}
 		end
 
 	end

From 590cc7c17fddd5764d692f2f2f6ac1149cf02e6a Mon Sep 17 00:00:00 2001
From: danielmartin0 <danielmartin111@gmail.com>
Date: Sun, 22 May 2022 23:37:47 +0100
Subject: [PATCH 5/9] prepare for comfy merge

---
 control.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/control.lua b/control.lua
index 18b312d8..0717f6fc 100644
--- a/control.lua
+++ b/control.lua
@@ -111,7 +111,7 @@ require 'utils.freeplay'
 --require 'maps.chronosphere.main'
 
 --![[Adventure as a crew of pirates]]--
-require 'maps.pirates.main'
+-- require 'maps.pirates.main'
 
 --![[Launch rockets in increasingly harder getting worlds.]]--
 --require 'maps.journey.main'

From 389d2f2c5620e76372e24cdc05fb51a8d347d829 Mon Sep 17 00:00:00 2001
From: danielmartin0 <danielmartin111@gmail.com>
Date: Sun, 22 May 2022 23:39:25 +0100
Subject: [PATCH 6/9] nonfunctional change

---
 maps/pirates/shop/shop.lua | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/maps/pirates/shop/shop.lua b/maps/pirates/shop/shop.lua
index e5c4aca6..1ca09fe2 100644
--- a/maps/pirates/shop/shop.lua
+++ b/maps/pirates/shop/shop.lua
@@ -23,11 +23,11 @@ Public.Minimarket = require 'maps.pirates.shop.dock'
 
 
 
-function Public.print_transaction(player, offer_itename, offer_itemcount, price)
+function Public.print_transaction(player, offer_itemname, offer_itemcount, price)
 	local s1 = ' traded away '
 	local s2 = ''
-	local s3 = offer_itemcount .. ' ' .. offer_itename
-	if offer_itename == 'coin' then s1 = ' sold ' end
+	local s3 = offer_itemcount .. ' ' .. offer_itemname
+	if offer_itemname == 'coin' then s1 = ' sold ' end
 	for i, p in pairs(price) do
 		local p2 = {name = p.name, amount = p.amount}
 		if p2.name == 'raw-fish' then p2.name = 'fish' end

From a74aee906f2f9ff6164a9b6c7ed0eb295274c4f5 Mon Sep 17 00:00:00 2001
From: danielmartin0 <danielmartin111@gmail.com>
Date: Sun, 22 May 2022 23:39:46 +0100
Subject: [PATCH 7/9] nonfunctional change

---
 control.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/control.lua b/control.lua
index 0717f6fc..db3cb2c0 100644
--- a/control.lua
+++ b/control.lua
@@ -111,7 +111,7 @@ require 'utils.freeplay'
 --require 'maps.chronosphere.main'
 
 --![[Adventure as a crew of pirates]]--
--- require 'maps.pirates.main'
+--require 'maps.pirates.main'
 
 --![[Launch rockets in increasingly harder getting worlds.]]--
 --require 'maps.journey.main'

From e268c885d40d0a340a3d9e331d9c628171fa516e Mon Sep 17 00:00:00 2001
From: danielmartin0 <danielmartin111@gmail.com>
Date: Mon, 23 May 2022 01:51:18 +0100
Subject: [PATCH 8/9] v1.2.2 small balance patch

---
 maps/pirates/coredata.lua    | 4 ++--
 maps/pirates/progression.lua | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/maps/pirates/coredata.lua b/maps/pirates/coredata.lua
index c6ae6170..3bef46a9 100644
--- a/maps/pirates/coredata.lua
+++ b/maps/pirates/coredata.lua
@@ -5,8 +5,8 @@ local _inspect = require 'utils.inspect'.inspect
 local Public = {}
 
 Public.scenario_id_name = 'pirates'
-Public.version_string = '1.2.1' --will now try to stick to major.minor.patch versioning, to match factorio mod portal
-Public.version_float = 1.21
+Public.version_string = '1.2.2' --will now try to stick to major.minor.patch versioning, to match factorio mod portal
+Public.version_float = 1.22
 
 Public.blueprint_library_allowed = true
 Public.blueprint_importing_allowed = true
diff --git a/maps/pirates/progression.lua b/maps/pirates/progression.lua
index 21d81df1..cee44fa3 100644
--- a/maps/pirates/progression.lua
+++ b/maps/pirates/progression.lua
@@ -41,7 +41,7 @@ function Public.fuel_depletion_rate()
 	if state == Boats.enum_state.ATSEA_SAILING or state == Boats.enum_state.APPROACHING then
 		return Balance.fuel_depletion_rate_sailing()
 	elseif state == Boats.enum_state.LEAVING_DOCK then
-		return Balance.fuel_depletion_rate_sailing() * 1
+		return Balance.fuel_depletion_rate_sailing() * 1.25
 	elseif state == Boats.enum_state.RETREATING then
 		return Balance.fuel_depletion_rate_sailing() / 4
 	elseif state == Boats.enum_state.LANDED then

From 35ed73bf5485c0ed14dc8113c17ec12c12134ee1 Mon Sep 17 00:00:00 2001
From: danielmartin0 <danielmartin111@gmail.com>
Date: Mon, 23 May 2022 02:01:01 +0100
Subject: [PATCH 9/9] improve comments

---
 maps/pirates/balance.lua | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/maps/pirates/balance.lua b/maps/pirates/balance.lua
index e7c0bc17..821f3bc8 100644
--- a/maps/pirates/balance.lua
+++ b/maps/pirates/balance.lua
@@ -107,7 +107,7 @@ function Public.max_time_on_island()
 		return -1
 	else
 		if x == 40 then
-			return 1.1 * Math.ceil(Public.max_time_on_island_formula()) --it's important for this island to be chill, so that it's not such a shock to go here from the first chill island
+			return 1.1 * Math.ceil(Public.max_time_on_island_formula()) --it's important for this island to be somewhat chill, so that it's not such a shock to go here from the first lobby chill island
 		else
 			return Math.ceil(Public.max_time_on_island_formula())
 		end
@@ -193,7 +193,7 @@ function Public.base_evolution_leagues(leagues)
 
 		if overworldx > 600 and overworldx < 1000 then
 			evo = evo + (0.0025 * (overworldx - 600)/40)
-		elseif overworldx > 1000 then
+		elseif overworldx >= 1000 then
 			evo = evo + 0.0025 * 10
 		end --extra slope from 600 to 1000 adds 2.5% evo
 	end
@@ -270,7 +270,7 @@ end
 -- end
 
 
-function Public.biter_timeofday_bonus_damage(darkness) -- a surface having min_brightness of 0.2 will cap this at 0.8
+function Public.biter_timeofday_bonus_damage(darkness) -- a surface having min_brightness of 0.2 will cap darkness at 0.8
 	return 0.1 * darkness
 end
 
@@ -526,13 +526,12 @@ end
 
 
 function Public.covered_entry_price_scale()
-	return 0.85 * (1 + 0.033 * (Common.overworldx()/40 - 1)) * ((1 + Public.crew_scale())^(1/3)) * Math.sloped(Common.difficulty_scale(), 1/2) --whilst resource scales tend to be held fixed with crew size, we account slightly for the fact that more players tend to handcraft more
+	return 0.85 * (1 + 0.033 * (Common.overworldx()/40 - 1)) * ((1 + Public.crew_scale())^(1/3)) * Math.sloped(Common.difficulty_scale(), 1/2) --whilst the scenario philosophy says that resource scales tend to be independent of crew size, we account slightly for the fact that more players tend to handcraft more
 end
 
--- if the prices are too high, players will accidentally throw too much in when they can't do it
-
 Public.covered1_entry_price_data_raw = { --watch out that the raw_materials chest can only hold e.g. 4.8 iron-plates
 	-- choose things that are easy to make at outposts
+	-- if the prices are too high, players will accidentally throw too much in when they can't do it
 	{1, 0, 1, false, {
 		price = {name = 'iron-stick', count = 1500},
 		raw_materials = {{name = 'iron-plate', count = 750}}}, {}},