From 69a46dd3fc96723477291096ab44259a7b1d80fd Mon Sep 17 00:00:00 2001 From: Piratux <58703216+Piratux@users.noreply.github.com> Date: Wed, 12 Oct 2022 22:02:12 +0300 Subject: [PATCH] Tweaked quest market item count formula Changes: - Changed quest item count formula using new philosophy: start lower, scale slightly faster. This results in ~30% on average smaller requirement for items to open the market in early game. The reasoning: it was observed that new players rarely complete the market quest, since they don't make items as fast as needed. As well as when players progress, they can craft items much faster (due to speed modules) --- maps/pirates/balance.lua | 28 ++++++++++++++++++++++++++-- maps/pirates/gui/crew.lua | 8 ++++++-- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/maps/pirates/balance.lua b/maps/pirates/balance.lua index e813094c..cf62300d 100644 --- a/maps/pirates/balance.lua +++ b/maps/pirates/balance.lua @@ -396,11 +396,35 @@ function Public.resource_quest_multiplier() end function Public.quest_market_entry_price_scale() - return 0.85 * (1 + 0.030 * (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 + -- 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 + -- Idea behind formula: small scale for early islands, but scale linearly ~3-4 times every 25 islands (scaling and starting scale is more aggressive for higher difficulties) + + -- Returned value examples + -- Assuming parameters: + -- crew_size = 3 + -- difficulty = easy (0.5) + -- @NOTE: assuming starting island is 0th island + -- x = 40 (1st island): 0.419 + -- x = 200 (5th island): 0.582 + -- x = 600 (15th island): 0.992 + -- x = 1000 (25th island): 1.401 + return (1 + 0.05 * (Common.overworldx()/40 - 1)) * ((1 + Public.crew_scale())^(1/3)) * Math.sloped(Common.difficulty_scale(), 1/2) - 0.4 end function Public.quest_furnace_entry_price_scale() - return 0.85 * (1 + 0.010 * (Common.overworldx()/40 - 1)) * ((1 + Public.crew_scale())^(1/3)) * Math.sloped(Common.difficulty_scale(), 1/2) --slower increase with time, because this is more time-constrained than resource-constrained + -- Slower increase with time, because this is more time-constrained than resource-constrained + -- Idea behind formula: small scale for early islands, but scale linearly ~2-3 times every 25 islands (scaling and starting scale is more aggressive for higher difficulties) + + -- Returned value examples + -- Assuming parameters: + -- crew_size = 3 + -- difficulty = easy (0.5) + -- @NOTE: assuming starting island is 0th island + -- x = 40 (1st island): 0.419 + -- x = 200 (5th island): 0.517 + -- x = 600 (15th island): 0.762 + -- x = 1000 (25th island): 1.008 + return (1 + 0.03 * (Common.overworldx()/40 - 1)) * ((1 + Public.crew_scale())^(1/3)) * Math.sloped(Common.difficulty_scale(), 1/2) - 0.4 end function Public.apply_crew_buffs_per_league(force, leagues_travelled) diff --git a/maps/pirates/gui/crew.lua b/maps/pirates/gui/crew.lua index 0f138da9..3dbcbe29 100644 --- a/maps/pirates/gui/crew.lua +++ b/maps/pirates/gui/crew.lua @@ -15,7 +15,11 @@ local Public = {} local window_name = 'crew' local function get_selected_player_index(flow) - return tonumber(flow.members.body.members_listbox.get_item(flow.members.body.members_listbox.selected_index)[2]) + if flow.members.body.members_listbox.selected_index ~= 0 then + return tonumber(flow.members.body.members_listbox.get_item(flow.members.body.members_listbox.selected_index)[2]) + else + return nil + end end function Public.toggle_window(player) @@ -331,7 +335,7 @@ function Public.full_update(player) flow.undock_tip.visible = Common.is_captain(player) flow.captain.body.capn_pass.visible = other_player_selected - flow.captain.body.capn_plank.visible = flow.captain.body.capn_pass.visible + flow.captain.body.capn_plank.visible = other_player_selected flow.captain.body.make_officer.visible = other_player_selected and (not Common.is_officer(selected_player_index)) flow.captain.body.unmake_officer.visible = other_player_selected and Common.is_officer(selected_player_index)