From 4dc9dbfdca035b29fb8be1cf6c91cc039af9f655 Mon Sep 17 00:00:00 2001 From: Piratux <58703216+Piratux@users.noreply.github.com> Date: Sat, 4 Jun 2022 21:52:55 +0300 Subject: [PATCH] purchasing artillery also increases max artillery hp --- locale/en/pirates.cfg | 1 + maps/pirates/balance.lua | 3 ++- maps/pirates/progression.lua | 4 ++-- maps/pirates/shop/captains.lua | 6 +++--- maps/pirates/shop/shop.lua | 3 ++- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/locale/en/pirates.cfg b/locale/en/pirates.cfg index d90b0da1..fbcdf992 100644 --- a/locale/en/pirates.cfg +++ b/locale/en/pirates.cfg @@ -182,6 +182,7 @@ market_error_not_captain_or_officer=Purchase error: You need to be a captain or market_error_maximum_loading_time=Purchase error: Reached the maximum allowed loading time. repaired_cannons=[font=heading-1]__1__ repaired the ship's cannons.[/font] +upgraded_cannons=[font=heading-1]__1__ repaired and upgraded the ship's cannons.[/font] upgrade_hold=[font=heading-1]__1__ upgraded the ship's hold.[/font] upgrade_power=[font=heading-1]__1__ upgraded the ship's power.[/font] upgrade_merchants=[font=heading-1]__1__ unlocked merchant ships at future islands.[/font] diff --git a/maps/pirates/balance.lua b/maps/pirates/balance.lua index 65215c81..d7734326 100644 --- a/maps/pirates/balance.lua +++ b/maps/pirates/balance.lua @@ -27,8 +27,9 @@ local _inspect = require 'utils.inspect'.inspect Public.base_extra_character_speed = 1.44 Public.respawn_speed_boost = 1.75 +Public.cannon_extra_hp_for_upgrade = 1000 Public.cannon_starting_hp = 2000 -Public.cannon_resistance_factor = 2.5 +Public.cannon_resistance_factor = 2 Public.technology_price_multiplier = 1 Public.rocket_launch_coin_reward = 5000 diff --git a/maps/pirates/progression.lua b/maps/pirates/progression.lua index b86364dc..fc01c447 100644 --- a/maps/pirates/progression.lua +++ b/maps/pirates/progression.lua @@ -233,7 +233,7 @@ function Public.progress_to_destination(destination_index) -- memory.mainshop_availability_bools.buy_fast_loader = true -- memory.mainshop_availability_bools.sell_copper = true - memory.mainshop_availability_bools.repair_cannons = true + memory.mainshop_availability_bools.upgrade_cannons = true local boat_for_sale_type = Common.current_destination().static_params.boat_for_sale_type if boat_for_sale_type then @@ -412,7 +412,7 @@ function Public.check_for_end_of_boat_movement(boat) memory.mainshop_availability_bools.buy_copper = false -- memory.mainshop_availability_bools.buy_fast_loader = false -- memory.mainshop_availability_bools.sell_copper = false - memory.mainshop_availability_bools.repair_cannons = false + memory.mainshop_availability_bools.upgrade_cannons = false memory.mainshop_availability_bools.extra_hold = false memory.mainshop_availability_bools.upgrade_power = false diff --git a/maps/pirates/shop/captains.lua b/maps/pirates/shop/captains.lua index 5db6c547..2246b554 100644 --- a/maps/pirates/shop/captains.lua +++ b/maps/pirates/shop/captains.lua @@ -28,8 +28,8 @@ local Public = {} -- WARNING: The Crowsnest caption pulls data from this data. But the actual dock market pulls from boat_upgrades.lua. Public.main_shop_data_1 = { - repair_cannons = { - tooltip = 'Repair the cannons.', + upgrade_cannons = { + tooltip = 'Increase cannons max health. This will also repair them.', what_you_get_sprite_buttons = {['item/artillery-turret'] = false}, base_cost = {coins = 1000}, }, @@ -139,7 +139,7 @@ function Public.initialise_captains_shop() new_boat_cutter_with_hold = false, new_boat_cutter = false, buy_iron = false, - repair_cannons = false, + upgrade_cannons = false, -- sell_iron = false, -- buy_fast_loader = true, -- sell_copper = false, diff --git a/maps/pirates/shop/shop.lua b/maps/pirates/shop/shop.lua index 1ea4f01b..6b017f46 100644 --- a/maps/pirates/shop/shop.lua +++ b/maps/pirates/shop/shop.lua @@ -185,13 +185,14 @@ function Public.event_on_market_item_purchased(event) local healthbar = memory.boat.healthbars[unit_number] if healthbar then + healthbar.max_health = healthbar.max_health + Balance.cannon_extra_hp_for_upgrade healthbar.health = healthbar.max_health Common.update_healthbar_rendering(healthbar, healthbar.max_health) else log('error: healthbar ' .. unit_number .. ' not found') end end - Common.notify_force(force,{'pirates.repaired_cannons', player.name}) + Common.notify_force(force,{'pirates.upgraded_cannons', player.name}) market.remove_market_item(offer_index) else local upgrade_type = Common.current_destination().static_params.upgrade_for_sale