From 0cfa6e34f16b3927346c207beab9db3c27ae4e44 Mon Sep 17 00:00:00 2001 From: danielmartin0 Date: Fri, 13 Sep 2024 12:38:24 +0100 Subject: [PATCH] scale up weapon damage upgrade cost --- maps/pirates/balance.lua | 5 ++++- maps/pirates/shop/shop.lua | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/maps/pirates/balance.lua b/maps/pirates/balance.lua index a06682e3..e33d6a8d 100644 --- a/maps/pirates/balance.lua +++ b/maps/pirates/balance.lua @@ -514,7 +514,10 @@ function Public.weapon_damage_upgrade_percentage() end function Public.weapon_damage_upgrade_price() - return { { name = 'coin', amount = 2000 }, { name = 'steel-plate', amount = 100 } } --NOTE: Should be different to other 'nothing' costs. See the use of this function in shop.lua. + -- local steel_plate_cost = 100 + local steel_plate_cost = 100 * (1 + 0.1 * (Common.overworldx() / 40)) + + return { { name = 'coin', amount = 2000 }, { name = 'steel-plate', amount = steel_plate_cost } } --NOTE: Coin cost should be different to other 'nothing' costs. See the use of this function in shop.lua. end Public.quest_structures_first_appear_at = 40 diff --git a/maps/pirates/shop/shop.lua b/maps/pirates/shop/shop.lua index 64af9525..a6da1da4 100644 --- a/maps/pirates/shop/shop.lua +++ b/maps/pirates/shop/shop.lua @@ -216,7 +216,7 @@ function Public.event_on_market_item_purchased(event) end else if thisPurchaseData.offer_type == 'nothing' then - local isDamageUpgrade = thisPurchaseData.price[1].amount == Balance.weapon_damage_upgrade_price()[1].amount and thisPurchaseData.price[1].name == Balance.weapon_damage_upgrade_price()[1].name and thisPurchaseData.price[2] and thisPurchaseData.price[2].amount == Balance.weapon_damage_upgrade_price()[2].amount and thisPurchaseData.price[2].name == Balance.weapon_damage_upgrade_price()[2].name + local isDamageUpgrade = thisPurchaseData.price[1].amount == Balance.weapon_damage_upgrade_price()[1].amount and thisPurchaseData.price[1].name == Balance.weapon_damage_upgrade_price()[1].name if isDamageUpgrade then Common.notify_force_light(player.force, { 'pirates.market_event_attack_upgrade_purchased', player.name, Balance.weapon_damage_upgrade_percentage() })