From f365dd87b48a7e0bf9e6ec3a1426c95f0b98b2b6 Mon Sep 17 00:00:00 2001 From: danielmartin0 Date: Sun, 29 May 2022 16:27:04 +0100 Subject: [PATCH] bugfixes --- control.lua | 2 +- locale/en/pirates.cfg | 4 ++-- maps/pirates/api_events.lua | 2 +- maps/pirates/api_on_tick.lua | 5 ++++- maps/pirates/balance.lua | 4 ++-- maps/pirates/boat_upgrades.lua | 2 +- maps/pirates/coredata.lua | 2 +- maps/pirates/crew.lua | 2 +- maps/pirates/gui/crew.lua | 8 ++++++-- maps/pirates/gui/info.lua | 2 +- maps/pirates/quest.lua | 2 +- 11 files changed, 21 insertions(+), 14 deletions(-) diff --git a/control.lua b/control.lua index df144849..21182d2e 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/locale/en/pirates.cfg b/locale/en/pirates.cfg index f52fd497..0d3d0740 100644 --- a/locale/en/pirates.cfg +++ b/locale/en/pirates.cfg @@ -4,7 +4,7 @@ softmod_info_header_after_version_number= === softmod_info_body_1=News and chat: getcomfy.eu/discord softmod_info_game_description_1=Game Description -softmod_info_game_description_2=Set sail in this intended-for-multiplayer scenario. Collect resources and fuel the ship in order to survive as many leagues as possible. The ship moves with code magic. Each crew has a captain, who performs actions such as deciding when the boat leaves. Doubloons can be spent at various markets throughout the game.\n\nGame progression is significantly slowed the smaller the crew.\n\n[font=default-bold]Win condition:[/font] Travel 1000 leagues.\n[font=default-bold]Lose condition:[/font] The ship runs out of fuel, or a cannon is destroyed. +softmod_info_game_description_2=Set sail in this multiplayer scenario. Collect resources and fuel the ship in order to survive as many leagues as possible. The ship moves with code magic. Each crew has a captain, who performs actions such as deciding when the boat leaves. Doubloons can be spent at various markets throughout the game.\n\nGame progression is significantly slowed the smaller the crew.\n\n[font=default-bold]Win condition:[/font] Travel 1000 leagues.\n[font=default-bold]Lose condition:[/font] The ship runs out of fuel, or a cannon is destroyed. # softmod_info_bugs_1=Known issues # softmod_info_bugs_2=• @@ -16,7 +16,7 @@ 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• Logged-out players keep their items with them for a while — except 'important' items that are returned to the crew immediately.\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. Captains also have /tax, /undock, /officer, /plank. softmod_info_updates_1=Recent changes -softmod_info_updates_2=v1.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.2\n• Fixed crashes introduced in 1.2.1.\n• Kraken kill reward buffed.\n\nv1.2\n• Mod portal release.\n• Some rebalancing of Nightmare difficulty. +softmod_info_updates_2=v1.2.4-v1.2.6\n• String-related hotfixes.\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.2\n• Fixed crashes introduced in 1.2.1.\n• Kraken kill reward buffed.\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\nthesixthroc is looking for translators and coders to help with this mod. Come 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/api_events.lua b/maps/pirates/api_events.lua index 6191e8e9..aca2f057 100644 --- a/maps/pirates/api_events.lua +++ b/maps/pirates/api_events.lua @@ -1180,7 +1180,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 design at ko-fi.com/thesixthroc', {r=1, g=0.4, b=0.9}) + player.print('Support Pirate Ship scenario design at ko-fi.com/thesixthroc', {r=1, g=0.4, b=0.9}) end local crew_to_put_back_in = nil diff --git a/maps/pirates/api_on_tick.lua b/maps/pirates/api_on_tick.lua index ae9e0e29..990a754e 100644 --- a/maps/pirates/api_on_tick.lua +++ b/maps/pirates/api_on_tick.lua @@ -1024,7 +1024,10 @@ function Public.silo_update(tickinterval) if memory.overworldx >= 0 and dynamic_data.rocketsiloenergyconsumed >= 0.25 * dynamic_data.rocketsiloenergyneeded and (not dynamic_data.parrot_silo_warned) then dynamic_data.parrot_silo_warned = true - Common.parrot_speak(memory.force, {'pirates.parrot_silo_warning'}) + local spawnerscount = Common.spawner_count(surface) + if spawnerscount > 0 then + Common.parrot_speak(memory.force, {'pirates.parrot_silo_warning'}) + end elseif dynamic_data.rocketsiloenergyconsumed >= dynamic_data.rocketsiloenergyneeded and (not (silo.rocket_parts == 100)) and (dynamic_data.silocharged == false) and (not memory.game_lost) then -- silo.energy = 0 silo.rocket_parts = 100 diff --git a/maps/pirates/balance.lua b/maps/pirates/balance.lua index 86c9803b..1fdb61f0 100644 --- a/maps/pirates/balance.lua +++ b/maps/pirates/balance.lua @@ -79,8 +79,8 @@ end function Public.silo_count() local E = Public.silo_energy_needed_MJ() - return Math.ceil(E/(16.8 * 300)) --no more than this many seconds to charge it. Players can in fact go even faster using beacons - -- return Math.ceil(E/(16.8 * 210)) --no more than this many seconds to charge it. Players can in fact go even faster using beacons + return Math.min(Math.ceil(E/(16.8 * 300)),6) + -- return Math.ceil(E/(16.8 * 300)) --no more than this many seconds to charge it. Players can in fact go even faster using beacons end diff --git a/maps/pirates/boat_upgrades.lua b/maps/pirates/boat_upgrades.lua index 711dcb19..acf0025c 100644 --- a/maps/pirates/boat_upgrades.lua +++ b/maps/pirates/boat_upgrades.lua @@ -75,7 +75,7 @@ function Public.execute_upgade(upgrade_type, player) memory.merchant_ships_unlocked = true elseif upgrade_type == enum.ROCKETS_FOR_SALE then if player then - Common.notify_force(player.force,{'pirates.upgrade_rocket',player.name}) + Common.notify_force(player.force,{'pirates.upgrade_rockets',player.name}) end memory.rockets_for_sale = true end diff --git a/maps/pirates/coredata.lua b/maps/pirates/coredata.lua index 65dd943a..29e4eed1 100644 --- a/maps/pirates/coredata.lua +++ b/maps/pirates/coredata.lua @@ -5,7 +5,7 @@ local _inspect = require 'utils.inspect'.inspect local Public = {} Public.scenario_id_name = 'pirates' -Public.version_string = '1.2.3' --will now try to stick to major.minor.patch versioning, to match factorio mod portal +Public.version_string = '1.2.6' --will now try to stick to major.minor.patch versioning, to match factorio mod portal Public.blueprint_library_allowed = true Public.blueprint_importing_allowed = true diff --git a/maps/pirates/crew.lua b/maps/pirates/crew.lua index 204feaff..d89d804a 100644 --- a/maps/pirates/crew.lua +++ b/maps/pirates/crew.lua @@ -153,7 +153,7 @@ function Public.try_win() Server.to_discord_embed_raw(CoreData.comfy_emojis.goldenobese .. '[' .. memory.name .. '] Victory, on v' .. CoreData.version_string .. ', ' .. CoreData.difficulty_options[memory.difficulty_option].text .. ', capacity ' .. CoreData.capacity_options[memory.capacity_option].text3 .. '. Playtime: ' .. speedrun_time_str .. ' since 1st island. Crewmembers: ' .. Public.get_crewmembers_printable_string()) - Common.notify_game({'','[' .. memory.name .. '] ',{'pirates.victory',CoreData.version_string, CoreData.difficulty_options[memory.difficulty_option].text, speedrun_time_str, Public.get_crewmembers_printable_string()}}, CoreData.colors.notify_victory) + Common.notify_game({'','[' .. memory.name .. '] ',{'pirates.victory',CoreData.version_string, CoreData.difficulty_options[memory.difficulty_option].text, CoreData.capacity_options[memory.capacity_option].text3, speedrun_time_str, Public.get_crewmembers_printable_string()}}, CoreData.colors.notify_victory) game.play_sound{path='utility/game_won', volume_modifier=0.9} diff --git a/maps/pirates/gui/crew.lua b/maps/pirates/gui/crew.lua index 0137dddb..2d52a3ff 100644 --- a/maps/pirates/gui/crew.lua +++ b/maps/pirates/gui/crew.lua @@ -475,8 +475,12 @@ function Public.full_update(player) local str = {''} for i, c in ipairs(memory.spare_classes) do - if i>1 then str[#str+1] = {'pirates.separator_1'} end - str[#str+1] = Classes.display_form(c) + if i>1 then + str[#str+1] = {'', 'pirates.separator_1', Classes.display_form(c)} -- we need to do nesting here, because you can't contanenate more than 20 localised strings. Watch out! + --@TODO: In fact we should nest iteratively, as this still caps out around 19 classes. + else + str[#str+1] = {'', Classes.display_form(c)} + end end str[#str+1] = '.' diff --git a/maps/pirates/gui/info.lua b/maps/pirates/gui/info.lua index bc4b124e..87558de1 100644 --- a/maps/pirates/gui/info.lua +++ b/maps/pirates/gui/info.lua @@ -224,7 +224,7 @@ 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 = 440 + flow2.style.height = 500 elseif flow2.selected_tab_index == 3 then flow2.style.height = 620 elseif flow2.selected_tab_index == 4 then diff --git a/maps/pirates/quest.lua b/maps/pirates/quest.lua index 8c878e4e..8345d3c3 100644 --- a/maps/pirates/quest.lua +++ b/maps/pirates/quest.lua @@ -240,7 +240,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_2', destination.dynamic_data.quest_reward.display_amount .. destination.dynamic_data.quest_reward.chat_name}) + Common.notify_force_light(force, {'pirates.granted_1', 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