From 032c4d9d4f3e32bb677adfbd23f8f276b712bc68 Mon Sep 17 00:00:00 2001 From: Piratux <58703216+Piratux@users.noreply.github.com> Date: Wed, 1 Feb 2023 22:17:22 +0200 Subject: [PATCH] Small tweaks and fixes Changes: - Fixed an issue that caused player items to disappear when player left the game. But now offline player's items immediately go to captain's cabin. - Added additional tiles around furnace quest structure. - Veteran class now has 100% chance to slow an enemy. - An error is printed to player now, when he is trying to create crew proposal with max crew limit. --- locale/en/pirates.cfg | 1 + maps/pirates/api_events.lua | 4 ++-- maps/pirates/balance.lua | 2 +- maps/pirates/common.lua | 1 + maps/pirates/crew.lua | 2 +- maps/pirates/gui/classes.lua | 2 +- maps/pirates/gui/common.lua | 2 -- maps/pirates/gui/crew.lua | 2 +- maps/pirates/gui/runs.lua | 9 +++++++-- .../structures/quest_structures/furnace1/data.lua | 4 ++-- 10 files changed, 17 insertions(+), 12 deletions(-) diff --git a/locale/en/pirates.cfg b/locale/en/pirates.cfg index d379896b..d605daf0 100644 --- a/locale/en/pirates.cfg +++ b/locale/en/pirates.cfg @@ -553,6 +553,7 @@ gui_runs_launch_error_1=Gather endorsements from more pirates. gui_runs_launch_error_2=The number of concurrent runs on the server has reached the cap set by the admins. gui_runs_launch_error_3=Can't launch; at least one run needs high player capacity. gui_runs_launch_error_4=No sloops available. Join an existing run instead. +gui_runs_launch_error_5=Can't create the proposal, because there are too many crews. Join some existing crew run instead. gui_runs_wait_to_join=Wait to join... __1__ diff --git a/maps/pirates/api_events.lua b/maps/pirates/api_events.lua index 7b42c9ee..87e5dc82 100644 --- a/maps/pirates/api_events.lua +++ b/maps/pirates/api_events.lua @@ -810,11 +810,11 @@ local function event_on_player_mined_entity(event) destination.dynamic_data.wood_remaining = destination.dynamic_data.wood_remaining - amount + give[#give + 1] = {name = 'wood', count = amount} + if class == Classes.enum.LUMBERJACK then - give[#give + 1] = {name = 'wood', count = amount} Classes.lumberjack_bonus_items(give) else - give[#give + 1] = {name = 'wood', count = amount} if Math.random(Balance.every_nth_tree_gives_coins) == 1 then --tuned local a = 5 give[#give + 1] = {name = 'coin', count = a} diff --git a/maps/pirates/balance.lua b/maps/pirates/balance.lua index 40029fa3..16968427 100644 --- a/maps/pirates/balance.lua +++ b/maps/pirates/balance.lua @@ -74,7 +74,7 @@ Public.rock_eater_damage_taken_multiplier = 0.8 Public.rock_eater_required_stone_furnace_to_heal_count = 1 Public.soldier_defender_summon_chance = 0.2 Public.veteran_destroyer_summon_chance = 0.2 -Public.veteran_on_hit_slow_chance = 0.1 +Public.veteran_on_hit_slow_chance = 1 Public.medic_heal_radius = 15 Public.medic_heal_percentage_amount = 0.1 Public.doctor_heal_radius = 20 diff --git a/maps/pirates/common.lua b/maps/pirates/common.lua index 01074ed3..7333cd0a 100644 --- a/maps/pirates/common.lua +++ b/maps/pirates/common.lua @@ -1292,6 +1292,7 @@ function Public.validate_player_and_character(player) end +-- Players complained that when "all_items" is false, the items dissapear (perhaps code sending items from dead character to cabin is wrong?). function Public.send_important_items_from_player_to_crew(player, all_items) local player_inv = {} player_inv[1] = game.players[player.index].get_inventory(defines.inventory.character_main) diff --git a/maps/pirates/crew.lua b/maps/pirates/crew.lua index f4ea2203..37fcdc29 100644 --- a/maps/pirates/crew.lua +++ b/maps/pirates/crew.lua @@ -434,7 +434,7 @@ function Public.leave_crew(player, to_lobby, quiet) Common.send_important_items_from_player_to_crew(player, true) char.die(memory.force_name) else - Common.send_important_items_from_player_to_crew(player) + Common.send_important_items_from_player_to_crew(player, true) memory.temporarily_logged_off_characters[player.index] = game.tick end -- else diff --git a/maps/pirates/gui/classes.lua b/maps/pirates/gui/classes.lua index 0b170a5f..0d64d885 100644 --- a/maps/pirates/gui/classes.lua +++ b/maps/pirates/gui/classes.lua @@ -147,7 +147,7 @@ function Public.toggle_window(player) vertical_scroll_policy = 'auto' } scroll_pane.style.maximal_height = 500 - scroll_pane.style.bottom_padding = 20 + scroll_pane.style.bottom_margin = 10 scroll_pane.add{ type = 'table', diff --git a/maps/pirates/gui/common.lua b/maps/pirates/gui/common.lua index 99f6d35f..f91c3ee5 100644 --- a/maps/pirates/gui/common.lua +++ b/maps/pirates/gui/common.lua @@ -311,8 +311,6 @@ function Public.flow_add_close_button(flow, close_button_name) type = 'flow', direction = 'vertical', }) - flow2.style.top_margin = -3 - flow2.style.bottom_margin = -3 flow3 = flow2.add{type="flow", name='hflow', direction="horizontal"} flow3.style.vertical_align = 'center' diff --git a/maps/pirates/gui/crew.lua b/maps/pirates/gui/crew.lua index 6e35e33b..e2cc4c8a 100644 --- a/maps/pirates/gui/crew.lua +++ b/maps/pirates/gui/crew.lua @@ -47,7 +47,7 @@ function Public.toggle_window(player) vertical_scroll_policy = 'auto' } flow.style.maximal_height = 500 - flow.style.bottom_padding = 20 + flow.style.bottom_margin = 10 --*** PARAMETERS OF RUN ***-- diff --git a/maps/pirates/gui/runs.lua b/maps/pirates/gui/runs.lua index 86675509..480c7f05 100644 --- a/maps/pirates/gui/runs.lua +++ b/maps/pirates/gui/runs.lua @@ -180,7 +180,7 @@ function Public.toggle_window(player) vertical_scroll_policy = 'auto' } flow.style.maximal_height = 500 - flow.style.bottom_padding = 20 + flow.style.bottom_margin = 10 --*** ONGOING RUNS ***-- @@ -474,7 +474,7 @@ function Public.toggle_window(player) flow4.style.font_color = {r=0.10, g=0.10, b=0.10} - GuiCommon.flow_add_close_button(flow, window_name .. '_piratebutton') + GuiCommon.flow_add_close_button(window, window_name .. '_piratebutton') end @@ -695,6 +695,11 @@ function Public.click(event) end if eventname == 'propose_crew' then + if #global_memory.crew_active_ids >= global_memory.active_crews_cap then + Common.notify_player_error(player, {'pirates.gui_runs_launch_error_5'}) + return + end + -- If proposal was set as private local run_is_private = flow.proposals.body.proposal_maker.body.private_checkbox.state if run_is_private then diff --git a/maps/pirates/structures/quest_structures/furnace1/data.lua b/maps/pirates/structures/quest_structures/furnace1/data.lua index 07b8f3a7..539f26bc 100644 --- a/maps/pirates/structures/quest_structures/furnace1/data.lua +++ b/maps/pirates/structures/quest_structures/furnace1/data.lua @@ -11,8 +11,8 @@ Public.step1 = { { type = 'tiles', tile_name = 'orange-refined-concrete', - offset = {x = 0, y = 0}, - bp_string = [[0eNqVmM1qwkAYRd9l1ink+5n8vUpxYXWQAU1CTEtF8u412kUXbfGsQuB4E7gH7phreDu+p3HK/Ry6azj32/FlHl4OU96v95+hEy/C5XaJSxHybujPoXu9gfnQb48rMl/GFLqQ53QKRei3p/Xuxu2mNKew/qjfpzVn2RRhzsf0CBiHc57z0H8/pXw8ZPkt4Q9YCWwEdgJHAlcErgncELglsJSIRh0KKlGebFHudElgIbASGL2zEzgSuCJwTeCGwC0qhVWIOhRUIjNPnqxRiadKPFXiqRJPlXiqxFMlnirxVImnSjxV5KkiTxV5qshTRZ4a8dSIp0Y8NeKpEU+NeGrEUyOeGvHUiKeGPDXkqSFPDXlqyFMn6jlRz4l6TtRzop6Tzh117qhzR5076jySFiOKrkh0haJrEl2j6IZENyi6JdEtOwqhv3QCT/js1A4PceioJWx5Be2joIEUtJCCJlLQRgoaSUErKWgmBe2ksKEUtpTCplL+28pN8fjk0v34gFOEjzSd7wHaiNet1tHFYhmX5QubhLg2]], + offset = {x = -1, y = 0}, + bp_string = [[0eNqV2M1Kw0AUhuF7mXUKPT+Tv1sRF1WHMlCTkExFkdy7iXXhQsV3UUrh60npOQ+cmffwcLmmac5DCf17WIbTdCjj4Tznp/3za+glVuFte2vWKpwelvFyLemw56Y8nENf5muqQn4chyX0d1uFfB5Ol/275W1KoQ+5pOdQheH0vH/aco9zKils1fLwlPYHrPdVKPmSbgWmccklj8PX44+3p68/VfglrCRsJOwkHEm4JuGGhFsS7khYjiiNeiioiYK6KKiN8s8+ymf6SMJCwkrCRsJOwujfqEm4IeGWhDvUFNZC1ENBTRTURUFtZFMt/2ykEgNKDCgxoMSAEgNKDCgxoMSAEgNKDCgyoMiAIgOKDCgyoMiAIgNGDBgxYMSAEQNGDBgxYMSAEQNGDBgxYMiAIQOGDBgyYMiAIQOGDDgx4MSAEwNODDgx4MSAEwNODDgx4MSAIwOODDgy4MiAIwOODDgyEImBSAxEYiASA5EYiMRAJAYiGr6Ihi+i4Yto+CIavoiGL6Lhq8mI1OhnN6R0g0q3pHSLSnekdMcOVOjWSdgdhLDDPzwKolOVsB1b0LoqbHkRtAcIWgQEbQKCVgFBu4CgZUDQNiBoHRC2DwhbCIRtBMJWAvlrJ7ivbhfU/bd78Cq8pHn5LKCteNNpU8ftJc26fgDbkmjB]], }, { type = 'tiles',