1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-20 03:29:47 +02:00

market rendering, allows cannons to be fortified when at max hp

This commit is contained in:
danielmartin0 2022-07-30 15:09:53 +01:00
parent 3b84445d34
commit 732d52ca3d
3 changed files with 30 additions and 16 deletions

View File

@ -185,7 +185,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]
upgraded_cannons=[font=heading-1]__1__ repaired and fortified 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]

View File

@ -142,22 +142,24 @@ function Public.create_dock_markets(surface, p)
e.rotatable = false
e.destructible = false
-- check if cannons need healing:
local need_healing
local cannons = game.surfaces[destination.surface_name].find_entities_filtered({type = 'artillery-turret'})
for _, c in pairs(cannons) do
local unit_number = c.unit_number
-- -- check if cannons need healing:
-- local need_healing
-- local cannons = game.surfaces[destination.surface_name].find_entities_filtered({type = 'artillery-turret'})
-- for _, c in pairs(cannons) do
-- local unit_number = c.unit_number
local healthbar = memory.boat.healthbars[unit_number]
if healthbar and healthbar.health < healthbar.max_health then
need_healing = true
break
end
end
-- local healthbar = memory.boat.healthbars[unit_number]
-- if healthbar and healthbar.health < healthbar.max_health then
-- need_healing = true
-- break
-- end
-- end
if need_healing then
e.add_market_item{price = {{'repair-pack', 20}, {'coin', 1000}}, offer = {type = 'give-item', item = 'artillery-turret', count = 1}}
end
-- if need_healing then
-- e.add_market_item{price = {{'repair-pack', 20}, {'coin', 1000}}, offer = {type = 'give-item', item = 'artillery-turret', count = 1}}
-- end
e.add_market_item{price = {{'repair-pack', 20}, {'coin', 1000}}, offer = {type = 'give-item', item = 'artillery-turret', count = 1}}
local upgrade_for_sale = Common.current_destination().static_params.upgrade_for_sale
if upgrade_for_sale then

View File

@ -34,7 +34,7 @@ Public.Data.cabin_whitebelts_lrtp_order = {
Public.Data.car_pos = {x = 9, y = 0}
Public.Data.market_position = {x = 4.5, y = 3.5}
Public.Data.market_position = {x = 3.5, y = -0.5}
Public.Data.static_entities_bp = [[0eNqlmu9u2jAUxd8ln2HK9X/zKlM10RJ1kWiCkrAVVX33hVJtXcuJfcwnhEh+XF+fY8e596W63x+bw9B2U7V5qcZue1hP/fpxaHfn78/VRsKqOlUbZV5XVfvQd2O1+T5f2D522/35kul0aKpN1U7NU7Wquu3T+dvvvt813frhZzNO1fnGbtecWa+r5K3N82FoxnE9HvbtNDXDh9vV692qarqpndrmEsbbl9OP7vh0P1+5kesBrKpDP8439d37mOpv9m1Q8+frOaRPGJWJkWWMzsSoZYzJxOhljM3EmGWMy8TYZYzPxLhlTMjE+GVMzMSEZYzUmZyY4OTqWBJClmwlJ6QsuVqWhJglV82SkLPk6lkSgpZcRUtC0pKraUmIWgK5jCnAiSRHwHJYf1mcp2HbjYd+mNb3zX5hLQKRKaGJJkFUpPUQR5MclLN/Ot8OU7vfN8NpPR2HoVmS6Jy2ebfbtUPzcPnZXUNbVmcoRseCUNI8KTQDOKzwNeBEWl6yTNR1MRGMVfMWUAmiKjYVGrX+Qtz32938E9ynzf/6nV3w/pDXH6fD8fws+PVfTPa/+Bv+xZLGRll2JAfllt4tECiwIDQydrtw4Hm1JjkWcKTYc4ioiolorLrYxYhoiolo1LZ4+0YxumIiitEXr10oxkATbYLI7yruAzG5r1v29ADitEJywJxYxS4sCKRZEBqZIVeWADiW5HjAccXrCSL6YiIaayheT1CMsdhZ/rMP1LU3DHX+8wCg/n0eaDvwOOBYk4D0OvbcAZLqaI8gkGFBaGSsSQS9MXIkKAJOuTdgaOWbRMySciSlHAuk7Nl9A2XDs54AE+XpjQOBsk3hU0OjXQFJtC3AodmzthBwjPc3+ALFVu6LtyiTxvCsMa5g084ItDNAPgLrDDRXQbGTDg5rQbMgcHwMplw9KDZbrh6do57gWPXoEvV4dtJRPgILQnMV6VUMhBRremUFMUWhY0Ik2hvgmBBpb4CDS7zBGyi2G7xhc7wRaW/YAm9E2hsoH7Q30Fzx3rCoilfTKIdQbEVaAiLR7vCIpMtVDaMz5bLOOhRKbVldlxwLpWZf7+KU0BaBE0a/4cUo3iVofMK+5lWw2k2bJCJS+QteHJ0ur1VCpmGrlZDEljVw7lxJxfItsOSrTeFr4zhO2g04eWzFQ6FKu6LNIIgk5cV2yCyvDGImWyjHuaPNAGOiK+MYxdfG4fjY6rjSiBTIxjRMimRvGiTpmmxPwyQhO9QwSZFNapikyT41TDJkqxomsUs+Jjmy7w2TPNtohlGBbX7DqMg2m0FUdlFbko4xwjacYZRim+Awii5AXFB3q0v/7uZDI/Gq+tUM4+WZO4jxUXlrZt3W8/V/ACz9dUA=]]
@ -270,6 +270,18 @@ function Public.create_cabin_surface()
end
end
rendering.draw_text(
{
color = {60, 255, 124},
scale = 1.6,
render_layer = 'light-effect',
target = e,
target_offset = {0, -2.7},
surface = e.surface,
alignment = 'center',
text = "Captain's Market"
})
rendering.draw_text{
text = {'pirates.surface_label_cabin'},
surface = surface,