1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-02-11 13:39:14 +02:00

v.1.12; Since other people are now expected to read these, some changelogs will be provided

- Biters now drop coins on death
- Boat input/output expanded to 4-lanes
- Captain's store removed and replaced by physical markets
- Resolved highscore table conflict with base comfy code
This commit is contained in:
danielmartin0 2022-04-29 23:48:34 +01:00
parent b6316644eb
commit a059ebe8fc
20 changed files with 514 additions and 280 deletions

View File

@ -45,4 +45,4 @@ resources_needed_tooltip_3=The captain can undock by clicking this button, but o
resources_needed_tooltip_1_rocketvariant=At the next destination, these resources will be needed in order to undock early.\n\nFewer resources will be needed the longer you stay, eventually dropping to zero..\n\nThe silo represents a rocket launch.
resources_needed_tooltip_2_rocketvariant=The captain can undock early by clicking this button, but only if enough resources have been stored in the captain's cabin.\n\nThe silo represents a rocket launch rather than a resource.\n\nnCost on arrival: __1__\nLeaving now will spend: __2__
resources_needed_tooltip_3_rocketvariant=The captain can undock by clicking this button, but only if enough resources are stored in the captain's cabin.\n\nThe silo represents a rocket launch rather than a resource.
fuel_tooltip=Stored fuel: __1__.\n\nTo store more, send it to the captain's cabin. If the ship runs out of fuel, the crew loses.\n\n*Click* to open the Captain's Store, which only the captain and their officers are authorised to use.
fuel_tooltip=Stored fuel: __1__.\n\nTo store more, send it to the captain's cabin. If the ship runs out of fuel, the crew loses.

View File

@ -315,7 +315,7 @@ function Public.apply_crew_buffs_per_x(force)
end
function Public.class_cost()
return 8000
return 9000
-- return Math.ceil(10000 / (Public.crew_scale()*10/4)^(1/6))
end

View File

@ -2,7 +2,7 @@
local Memory = require 'maps.pirates.memory'
-- local Roles = require 'maps.pirates.roles.roles'
-- local Balance = require 'maps.pirates.balance'
-- local Common = require 'maps.pirates.common'
local Common = require 'maps.pirates.common'
-- local Utils = require 'maps.pirates.utils_local'
-- local Math = require 'maps.pirates.math'
-- local Loot = require 'maps.pirates.loot'
@ -44,19 +44,39 @@ Public.crowsnest_display_form = {
[enum.ROCKETS_FOR_SALE] = 'Unlock Rockets',
}
function Public.execute_upgade(upgrade_type)
-- WARNING: The dock market pulls from these values, but the Crowsnest caption pulls data from main_shop_data_1. So don't change one without the other
Public.market_offer_form = {
[enum.EXTRA_HOLD] = {price = {{'coin', 5000}, {'coal', 500}}, offer = {type='nothing', effect_description='Purchase an extra hold.'}},
[enum.MORE_POWER] = {price = {{'coin', 10000}, {'coal', 2000}}, offer = {type='nothing', effect_description='Upgrade the ship\'s passive power generators.'}},
[enum.UNLOCK_MERCHANTS] = {price = {{'coin', 10000}, {'coal', 2000}}, offer = {type='nothing', effect_description='Unlock merchant ships on future islands.'}},
[enum.ROCKETS_FOR_SALE] = {price = {{'coin', 15000}, {'coal', 2000}}, offer = {type='nothing', effect_description='Unlock the sale of rockets at covered markets.'}},
}
function Public.execute_upgade(upgrade_type, player)
local memory = Memory.get_crew_memory()
local boat = memory.boat
if upgrade_type == enum.EXTRA_HOLD then
if player then
Common.notify_force(player.force,string.format('[font=heading-1]%s upgraded the ship\'s hold.[/font]', player.name))
end
Hold.add_another_hold_surface()
elseif upgrade_type == enum.MORE_POWER then
if player then
Common.notify_force(player.force, string.format('[font=heading-1]%s upgraded the ship\'s power.[/font]', player.name))
end
boat.EEI_stage = boat.EEI_stage + 1
Boats.update_EEIs(boat)
elseif upgrade_type == enum.UNLOCK_MERCHANTS then
if player then
Common.notify_force(player.force,string.format('[font=heading-1]%s unlocked merchant ships.[/font]', player.name))
end
memory.merchant_ships_unlocked = true
elseif upgrade_type == enum.ROCKETS_FOR_SALE then
if player then
Common.notify_force(player.force,string.format('[font=heading-1]%s unlocked the sale of rockets at covered-up markets.[/font]', player.name))
end
memory.rockets_for_sale = true
end

View File

@ -289,40 +289,48 @@ function Public.give(player, stacks, spill_position, spill_surface)
end
end
if itemcount > 0 then
if itemcount < 5 then
-- if itemcount < 5 then
-- spill_surface.spill_item_stack(spill_position, {name = itemname, count = itemcount}, true)
-- else
-- local e = spill_surface.create_entity{name = 'item-on-ground', position = spill_position, stack = {name = itemname, count = itemcount}}
-- if e and e.valid then
-- e.to_be_looted = true
-- end
-- end
spill_surface.spill_item_stack(spill_position, {name = itemname, count = itemcount}, true)
else
local e = spill_surface.create_entity{name = 'item-on-ground', position = spill_position, stack = {name = itemname, count = itemcount}}
if e and e.valid then
e.to_be_looted = true
end
end
end
else
local e = spill_surface.create_entity{name = 'item-on-ground', position = spill_position, stack = {name = itemname, count = itemcount}}
if e and e.valid then
e.to_be_looted = true
end
-- local e = spill_surface.create_entity{name = 'item-on-ground', position = spill_position, stack = {name = itemname, count = itemcount}}
-- if e and e.valid then
-- e.to_be_looted = true
-- end
spill_surface.spill_item_stack(spill_position, {name = itemname, count = itemcount}, true)
end
end
text1 = text1 .. '[color=1,1,1]'
if itemcount_remember > 0 then
if #stacks2 == 1 and itemcount_remember == 1 then
text1 = text1 .. '[item=' .. itemname .. ']'
else
text1 = text1 .. '[color=1,1,1]'
text1 = text1 .. '+'
text1 = text1 .. itemcount_remember .. '[/color] [item=' .. itemname .. ']'
end
else
text1 = text1 .. '[color=1,1,1]'
text1 = text1 .. '-'
text1 = text1 .. -itemcount_remember .. '[/color] [item=' .. itemname .. ']'
end
if player and not (#stacks2 == 1 and itemcount_remember == 1) then
-- count total of that item they have:
local new_total_count = 0
if player then
local cursor_stack = player.cursor_stack
if cursor_stack and cursor_stack.valid_for_read and cursor_stack.name == itemname and cursor_stack.count and cursor_stack.count > 0 then
new_total_count = new_total_count + cursor_stack.count
end
end
if inv and inv.get_item_count(itemname) and inv.get_item_count(itemname) > 0 then
new_total_count = new_total_count + inv.get_item_count(itemname)
end
@ -335,6 +343,7 @@ function Public.give(player, stacks, spill_position, spill_surface)
if j < #stacks2 then
text2 = text2 .. ', '
end
end
if j < #stacks2 then
text1 = text1 .. ', '

View File

@ -5,8 +5,8 @@ local _inspect = require 'utils.inspect'.inspect
local Public = {}
Public.scenario_id_name = 'pirates'
Public.version_string = '1.1.1.5.6'
Public.version_float = 1.1156
Public.version_string = '1.1.2.0.0'
Public.version_float = 1.1200
Public.blueprint_library_allowed = true
Public.blueprint_importing_allowed = true
@ -24,6 +24,7 @@ Public.colors = {
wood = {r=204, g=158, b=67},
stone = {r=230, g=220, b=190},
coin = {r=242, g=193, b=97},
oil = {r=181, g=107, b=91},
['raw-fish'] = {r=0, g=237, b=170},
['iron-plate'] = {r=170, g=180, b=190},
['iron-ore'] = {r=170, g=180, b=190},

View File

@ -425,8 +425,8 @@ function Public.player_and_crew_state_bools(player)
atsea_sailing_bool = memory.boat and memory.boat.state == Boats.enum_state.ATSEA_SAILING
landed_bool = memory.boat and memory.boat.state == Boats.enum_state.LANDED
quest_bool = (dynamic_data.quest_type ~= nil) and onmap_bool
silo_bool = dynamic_data.rocketsilos and dynamic_data.rocketsilos[1] and dynamic_data.rocketsilos[1].valid and onmap_bool
charged_bool = dynamic_data.silocharged
silo_bool = dynamic_data.rocketsilos and onmap_bool and ((dynamic_data.rocketsilos[1] and dynamic_data.rocketsilos[1].valid) or charged_bool)
launched_bool = dynamic_data.rocketlaunched
cost_bool = destination.static_params.base_cost_to_undock and (not atsea_sailing_bool) and (not retreating_bool)

View File

@ -131,8 +131,21 @@ local function create_gui(player)
flow2 = GuiCommon.flow_add_floating_button(flow1, 'fuel_piratebutton')
-- flow2.style.right_padding = -100
flow2 = flow1.add({
name = 'fuel_flow',
type = 'frame',
})
flow2.style.minimal_width = 80
flow2.style.natural_width = 80
flow2.style.minimal_height = 40
flow2.style.maximal_height = 40
flow2.style.left_padding = 4
flow2.style.right_padding = 4
flow2.style.top_padding = 3
-- interactive version:
-- flow2 = GuiCommon.flow_add_floating_button(flow1, 'fuel_piratebutton')
flow3 = flow2.add({
name = 'fuel_label_0',
@ -902,12 +915,16 @@ function Public.update_gui(player)
-- button.number = 3
-- end
flow1 = pirates_flow.fuel_piratebutton_flow_1
flow1 = pirates_flow.fuel_flow
-- flow1 = pirates_flow.fuel_piratebutton_flow_1
flow1.fuel_piratebutton.tooltip = {'pirates.fuel_tooltip', Math.floor(memory.stored_fuel or 0)}
local tooltip = {'pirates.fuel_tooltip', Math.floor(memory.stored_fuel or 0)}
flow1.tooltip = tooltip
-- flow1.fuel_piratebutton.tooltip = {'pirates.fuel_tooltip', Math.floor(memory.stored_fuel or 0)}
flow2 = flow1.fuel_piratebutton_flow_2
flow2 = flow1
-- flow2 = flow1.fuel_piratebutton_flow_2
flow2.fuel_label_1.caption = Utils.bignumber_abbrevform(memory.stored_fuel or 0) .. '[item=coal]'
flow2.fuel_label_2.caption = Utils.negative_rate_abbrevform(memory.fuel_depletion_rate_memoized or 0)
@ -917,6 +934,9 @@ function Public.update_gui(player)
g = GuiCommon.fuel_color_1.g * (1-color_scale) + GuiCommon.fuel_color_2.g * color_scale,
b = GuiCommon.fuel_color_1.b * (1-color_scale) + GuiCommon.fuel_color_2.b * color_scale,
}
flow2.fuel_label_0.tooltip = tooltip
flow2.fuel_label_1.tooltip = tooltip
flow2.fuel_label_2.tooltip = tooltip
flow1 = pirates_flow.progress_piratebutton_frame.progress_piratebutton
@ -936,7 +956,8 @@ function Public.update_gui(player)
--== Update Gui ==--
flow1 = pirates_flow.fuel_piratebutton_flow_1
flow1 = pirates_flow.fuel_flow
-- flow1 = pirates_flow.fuel_piratebutton_flow_1
if memory.crewstatus == nil then
flow1.visible = false

View File

@ -637,13 +637,15 @@ local function event_on_player_mined_entity(event)
local give = {}
if memory.classes_table and memory.classes_table[event.player_index] then
if memory.classes_table[event.player_index] == Classes.enum.LUMBERJACK then
give[#give + 1] = {name = 'wood', count = 1}
if Math.random(7) == 1 then
give[#give + 1] = {name = 'coin', count = 15}
end
elseif memory.classes_table[event.player_index] == Classes.enum.WOOD_LORD then
give[#give + 1] = {name = 'iron-ore', count = 2}
give[#give + 1] = {name = 'copper-ore', count = 2}
give[#give + 1] = {name = 'coal', count = 2}
give[#give + 1] = {name = 'wood', count = 1}
give[#give + 1] = {name = 'iron-ore', count = 1}
give[#give + 1] = {name = 'copper-ore', count = 1}
give[#give + 1] = {name = 'coal', count = 1}
if Math.random(7) == 1 then
give[#give + 1] = {name = 'coin', count = 15}
end
@ -748,24 +750,23 @@ local function event_on_player_mined_entity(event)
if memory.overworldx >= 0 then --used to be only later levels
if entity.name == 'rock-huge' then
c2[#c2 + 1] = {name = 'coin', count = 45, color = CoreData.colors.coin}
if Math.random(1, 35) == 1 then
c2[#c2 + 1] = {name = 'crude-oil-barrel', count = 1, color = CoreData.colors.oil}
end
else
c2[#c2 + 1] = {name = 'coin', count = 30, color = CoreData.colors.coin}
if Math.random(1, 35*3) == 1 then
c2[#c2 + 1] = {name = 'crude-oil-barrel', count = 1, color = CoreData.colors.oil}
end
end
end
for k, v in pairs(c) do
local color
if k == 'coal' then
color = CoreData.colors.coal
if k == 'coal' and #c2 <= 1 then --if oil, then no coal
c2[#c2 + 1] = {name = k, count = v, color = CoreData.colors.coal}
elseif k == 'stone' then
color = CoreData.colors.stone
c2[#c2 + 1] = {name = k, count = v, color = CoreData.colors.stone}
end
--old version:
-- local amount = Math.max(Math.min(available,Math.ceil(v * available/starting)),1)
local amount = v
c2[#c2 + 1] = {name = k, count = amount, color = color}
end
Common.give(player, c2, entity.position)
@ -800,52 +801,75 @@ local function base_kill_rewards(event)
local entity = event.entity
if not (entity and entity.valid) then return end
if not (event.force and event.force.valid) then return end
local entity_name = entity.name
-- no worm loot in the maze:
local maze = (destination and destination.subtype and destination.subtype == Islands.enum.MAZE)
if maze and not (entity.name == 'biter-spawner' or entity.name == 'spitter-spawner') then return end
local maze = (destination.subtype and destination.subtype == Islands.enum.MAZE)
if maze and not (entity_name == 'biter-spawner' or entity_name == 'spitter-spawner') then return end
local revenge_target
if event.cause and event.cause.valid and event.cause.name == 'character' then
revenge_target = event.cause
end
local iron_amount = 0
local coin_amount = 0
local iron_amount
local coin_amount
if memory.overworldx >= 0 then
if entity.name == 'small-worm-turret' then
if entity_name == 'small-worm-turret' then
iron_amount = 5
coin_amount = 40
elseif entity.name == 'medium-worm-turret' then
elseif entity_name == 'medium-worm-turret' then
iron_amount = 20
coin_amount = 70
elseif entity.name == 'biter-spawner' or entity.name == 'spitter-spawner'
then
elseif entity_name == 'biter-spawner' or entity_name == 'spitter-spawner' then
iron_amount = 30
coin_amount = 70
elseif entity.name == 'big-worm-turret'
then
elseif entity_name == 'big-worm-turret' then
iron_amount = 30
coin_amount = 100
elseif entity.name == 'behemoth-worm-turret'
then
elseif entity_name == 'behemoth-worm-turret' then
iron_amount = 50
coin_amount = 200
elseif memory.overworldx > 0 then
if entity_name == 'small-biter' then
coin_amount = 1
elseif entity_name == 'small-spitter' then
coin_amount = 1
elseif entity_name == 'medium-biter' then
coin_amount = 2
elseif entity_name == 'medium-spitter' then
coin_amount = 2
elseif entity_name == 'big-biter' then
coin_amount = 3
elseif entity_name == 'big-spitter' then
coin_amount = 3
elseif entity_name == 'behemoth-biter' then
coin_amount = 5
elseif entity_name == 'behemoth-spitter' then
coin_amount = 5
end
end
if iron_amount > 0 then
local stack = {{name = 'iron-plate', count = iron_amount}, {name = 'coin', count = coin_amount}}
if coin_amount then
local stack
if iron_amount then
stack = {{name = 'iron-plate', count = iron_amount}, {name = 'coin', count = coin_amount}}
else
stack = {{name = 'coin', count = coin_amount}}
end
if revenge_target then
Common.give(event.cause.player, stack)
else
if event.cause.position then
Common.give(nil, stack, event.cause.position, entity.surface)
else
Common.give(nil, stack, entity.position, entity.surface)
end
end
end
if (entity.name == 'biter-spawner' or entity.name == 'spitter-spawner') and entity.position and entity.surface and entity.surface.valid then
if (entity_name == 'biter-spawner' or entity_name == 'spitter-spawner') and entity.position and entity.surface and entity.surface.valid then
--check if its a boat biter entity
local boat_spawner = false
if memory.enemyboats then
@ -859,7 +883,7 @@ local function base_kill_rewards(event)
end
if boat_spawner then
Ai.revenge_group(entity.surface, entity.position, revenge_target, 'biter', 0.3, 2)
elseif entity.name == 'biter-spawner' then
elseif entity_name == 'biter-spawner' then
Ai.revenge_group(entity.surface, entity.position, revenge_target, 'biter')
else
Ai.revenge_group(entity.surface, entity.position, revenge_target, 'spitter')

View File

@ -95,7 +95,7 @@ Public.explanation = {
Public.class_unlocks = {
[enum.FISHERMAN] = {enum.MASTER_ANGLER},
[enum.LUMBERJACK] = {enum.WOOD_LORD},
-- [enum.LUMBERJACK] = {enum.WOOD_LORD}, --not that interesting
-- [enum.PROSPECTOR] = {enum.CHIEF_EXCAVATOR}, --breaks the resource pressure in the game too strongly I think
[enum.SAMURAI] = {enum.HATAMOTO},
[enum.MASTER_ANGLER] = {enum.DREDGER},

View File

@ -18,9 +18,13 @@ local Public = {}
-- Note! This file is deprecated. It is replaced with a dedicated market at the dock and inside the captain's cabin. The exception is main_shop_data_1 as noted below, which is consulted for the Crowsnest caption. (Haven't had time to unify this yet.)
--== Warning: If something only costs fuel, then we need to check the player can't buy it whilst they're dead
-- 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.',
@ -258,22 +262,18 @@ function Public.main_shop_try_purchase(player, purchase_name)
elseif purchase_name == Upgrades.enum.MORE_POWER then
Upgrades.execute_upgade(Upgrades.enum.MORE_POWER)
Common.notify_force(force,string.format('[font=heading-1]%s upgraded the ship\'s power.[/font]', player.name))
memory.mainshop_availability_bools[purchase_name] = false
elseif purchase_name == Upgrades.enum.EXTRA_HOLD then
Upgrades.execute_upgade(Upgrades.enum.EXTRA_HOLD)
Common.notify_force(force,string.format('[font=heading-1]%s upgraded the ship\'s hold.[/font]', player.name))
memory.mainshop_availability_bools[purchase_name] = false
elseif purchase_name == Upgrades.enum.UNLOCK_MERCHANTS then
Upgrades.execute_upgade(Upgrades.enum.UNLOCK_MERCHANTS)
Common.notify_force(force,string.format('[font=heading-1]%s unlocked merchant ships.[/font]', player.name))
memory.mainshop_availability_bools[purchase_name] = false
elseif purchase_name == Upgrades.enum.ROCKETS_FOR_SALE then
Upgrades.execute_upgade(Upgrades.enum.ROCKETS_FOR_SALE)
Common.notify_force(force,string.format('[font=heading-1]%s unlocked the sale of rockets at covered-up markets.[/font]', player.name))
memory.mainshop_availability_bools[purchase_name] = false
elseif purchase_name == 'sell_iron' then

View File

@ -1,5 +1,5 @@
-- local Memory = require 'maps.pirates.memory'
local Memory = require 'maps.pirates.memory'
-- local Roles = require 'maps.pirates.roles.roles'
local CoreData = require 'maps.pirates.coredata'
local Classes = require 'maps.pirates.roles.classes'
@ -10,6 +10,7 @@ local Balance = require 'maps.pirates.balance'
local Common = require 'maps.pirates.common'
local Utils = require 'maps.pirates.utils_local'
local Math = require 'maps.pirates.math'
local Upgrades = require 'maps.pirates.boat_upgrades'
local _inspect = require 'utils.inspect'.inspect
-- local Upgrades = require 'maps.pirates.boat_upgrades'
@ -109,12 +110,28 @@ Public.market_sales = {
function Public.create_dock_markets(surface, p)
-- local memory = Memory.get_crew_memory()
local destination = Common.current_destination()
if not (surface and p) then return end
local e
e = surface.create_entity{name = 'market', position = {x = p.x - 22, y = p.y - 1}}
if e and e.valid then
e.minable = false
e.rotatable = false
e.destructible = false
e.add_market_item{price = {{'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
e.add_market_item(Upgrades.market_offer_form[upgrade_for_sale])
end
destination.dynamic_data.dock_captains_market = e
end
e = surface.create_entity{name = 'market', position = {x = p.x - 7, y = p.y}}
if e and e.valid then
e.minable = false
@ -148,19 +165,18 @@ function Public.create_dock_markets(surface, p)
end
-- new class offerings:
local destination = Common.current_destination()
if destination.static_params.class_for_sale then
e.add_market_item{price={{'coin', Balance.class_cost()}}, offer={type="nothing"}}
e.add_market_item{price={{'coin', Balance.class_cost()}}, offer={type="nothing", effect_description = 'Purchase the class ' .. Classes.display_form[destination.static_params.class_for_sale] .. '.'}}
destination.dynamic_data.market_class_offer_rendering = rendering.draw_text{
text = 'Class available: ' .. Classes.display_form[destination.static_params.class_for_sale],
surface = surface,
target = Utils.psum{e.position, {x = 0, y = -4}},
color = CoreData.colors.renderingtext_green,
scale = 2.5,
font = 'default-game',
alignment = 'center'
}
-- destination.dynamic_data.market_class_offer_rendering = rendering.draw_text{
-- text = 'Class available: ' .. Classes.display_form[destination.static_params.class_for_sale],
-- surface = surface,
-- target = Utils.psum{e.position, {x = 0, y = -4}},
-- color = CoreData.colors.renderingtext_green,
-- scale = 2.5,
-- font = 'default-game',
-- alignment = 'center'
-- }
end
end

View File

@ -2,15 +2,17 @@
local Memory = require 'maps.pirates.memory'
-- local Roles = require 'maps.pirates.roles.roles'
local Classes = require 'maps.pirates.roles.classes'
-- local Crew = require 'maps.pirates.crew'
local Crew = require 'maps.pirates.crew'
-- local Boats = require 'maps.pirates.structures.boats.boats'
-- local Dock = require 'maps.pirates.surfaces.dock'
local Balance = require 'maps.pirates.balance'
local Common = require 'maps.pirates.common'
local Utils = require 'maps.pirates.utils_local'
local Roles = require 'maps.pirates.roles.roles'
local Math = require 'maps.pirates.math'
local _inspect = require 'utils.inspect'.inspect
local SurfacesCommon = require 'maps.pirates.surfaces.common'
local Upgrades = require 'maps.pirates.boat_upgrades'
-- local Upgrades = require 'maps.pirates.boat_upgrades'
local Public = {}
@ -56,7 +58,16 @@ function Public.event_on_market_item_purchased(event)
local special_purchase_bool = (offer_giveitem_name == 'rocket-launcher')
-- local special_purchase_bool = (offer_giveitem_name and (offer_giveitem_name == 'loader' or offer_giveitem_name == 'fast-loader' or offer_giveitem_name == 'express-loader' or offer_giveitem_name == 'rocket-launcher'))
if offer_type == 'nothing' then
local surface_name_decoded = SurfacesCommon.decode_surface_name(player.surface.name)
local type = surface_name_decoded.type
local in_captains_cabin = type and type == SurfacesCommon.enum.CABIN
local dock_upgrades_market = destination.dynamic_data.dock_captains_market and (destination.dynamic_data.dock_captains_market == market)
local permission_level_fail = (in_captains_cabin and Roles.player_privilege_level(player) < Roles.privilege_levels.OFFICER) or (dock_upgrades_market and Roles.player_privilege_level(player) < Roles.privilege_levels.OFFICER)
if in_captains_cabin then
decay_type = 'static'
elseif offer_type == 'nothing' then
decay_type = 'one-off'
elseif simple_efficiency_trade_bool or special_purchase_bool then
decay_type = 'static'
@ -70,8 +81,8 @@ function Public.event_on_market_item_purchased(event)
decay_type = 'decay'
end
-- For everything but static, we want to disallow multi-purchases in this game, so refund any additional purchases:
if decay_type ~= 'static' and player and trade_count and trade_count > 1 then
-- Normally we want to disallow multi-purchases in this game (with the exception of static trades for items), so refund any additional purchases:
if (decay_type ~= 'static' or offer_type == 'nothing') and player and trade_count and trade_count > 1 then
inv = player.get_inventory(defines.inventory.character_main)
if not inv then return end
for _, p in pairs(price) do
@ -85,6 +96,40 @@ function Public.event_on_market_item_purchased(event)
if decay_type == 'one-off' then
local force = player.force
if dock_upgrades_market then
if offer_type == 'give-item' then
-- this is the dummy artillery purchase
inv.remove{name = offer_giveitem_name, count = offer_giveitem_count}
end
if permission_level_fail then
Common.notify_player_error(player, string.format('Purchase error: You need to be a captain or officer to buy this.', player.name))
-- refund:
inv = player.get_inventory(defines.inventory.character_main)
if not inv then return end
for _, p in pairs(price) do
inv.insert{name = p.name, count = p.amount}
end
else
if offer_type == 'give-item' then
-- heal all cannons:
local cannons = game.surfaces[destination.surface_name].find_entities_filtered({type = 'artillery-turret'})
for _, c in pairs(cannons) do
c.health = c.prototype.max_health
end
Common.notify_force(force,string.format('[font=heading-1]%s repaired the ship\'s cannons.[/font]', player.name))
market.remove_market_item(offer_index)
else
local upgrade_type = Common.current_destination().static_params.upgrade_for_sale
if upgrade_type then
Upgrades.execute_upgade(upgrade_type, player)
end
market.remove_market_item(offer_index)
end
end
else
if offer_type == 'nothing' and destination.static_params.class_for_sale then
local class_for_sale = destination.static_params.class_for_sale
@ -120,9 +165,9 @@ function Public.event_on_market_item_purchased(event)
memory.available_classes_pool = Utils.ordered_table_with_single_value_removed(memory.available_classes_pool, class_for_sale)
if destination.dynamic_data and destination.dynamic_data.market_class_offer_rendering then
rendering.destroy(destination.dynamic_data.market_class_offer_rendering)
end
-- if destination.dynamic_data and destination.dynamic_data.market_class_offer_rendering then
-- rendering.destroy(destination.dynamic_data.market_class_offer_rendering)
-- end
market.remove_market_item(offer_index)
@ -144,29 +189,61 @@ function Public.event_on_market_item_purchased(event)
market.remove_market_item(offer_index)
end
end
else
if in_captains_cabin and permission_level_fail then
Common.notify_player_error(player, string.format('Purchase error: You need to be a captain or officer to buy this.', player.name))
-- refund:
inv = player.get_inventory(defines.inventory.character_main)
if not inv then return end
for _, p in pairs(price) do
inv.insert{name = p.name, count = p.amount}
end
if offer_type == 'give-item' then
inv.remove{name = offer_giveitem_name, count = offer_giveitem_count}
end
else
-- print:
if (price and price[1]) then
if not (price[1].name and price[1].name == 'burner-mining-drill') then --this one is too boring to announce
if price[2] then
local fish = price[2].name
if fish == 'raw-fish' then fish = 'fish' end
Common.notify_force_light(player.force, player.name .. ' traded away ' .. price[1].amount .. ' ' .. price[1].name .. ' and ' .. fish .. ' for ' .. this_offer.offer.count .. ' ' .. this_offer.offer.item .. '.')
if in_captains_cabin and offer_type == 'nothing' then
local price_name = price[1].name
Common.notify_force_light(player.force, player.name .. ' bought extra time at sea for ' .. price[1].amount .. ' ' .. price_name .. '.')
else
if price[1].name == 'coin' then
Common.notify_force_light(player.force, player.name .. ' bought ' ..this_offer.offer.count .. ' ' .. this_offer.offer.item .. ' for ' .. price[1].amount .. ' ' .. price[1].name .. '.')
if price[2] then
local price_name = price[2].name
if price_name == 'raw-fish' then price_name = 'fish' end
Common.notify_force_light(player.force, player.name .. ' traded away ' .. price[1].amount .. ' ' .. price[1].name .. ' and ' .. price_name .. ' for ' .. this_offer.offer.count .. ' ' .. this_offer.offer.item .. '.')
else
local price_name = price[1].name
if price_name == 'raw-fish' then price_name = 'fish' end
if price_name == 'coin' then
Common.notify_force_light(player.force, player.name .. ' bought ' ..this_offer.offer.count .. ' ' .. this_offer.offer.item .. ' for ' .. price[1].amount .. ' ' .. price_name .. '.')
elseif this_offer.offer.item == 'coin' then
local sold_amount = price[1].amount
if sold_amount == 1 then sold_amount = 'a' end
Common.notify_force_light(player.force, player.name .. ' sold ' .. sold_amount .. ' ' .. price[1].name .. ' for ' .. this_offer.offer.count .. ' ' .. this_offer.offer.item .. '.')
Common.notify_force_light(player.force, player.name .. ' sold ' .. sold_amount .. ' ' .. price_name .. ' for ' .. this_offer.offer.count .. ' ' .. this_offer.offer.item .. '.')
else
Common.notify_force_light(player.force, player.name .. ' traded away ' .. price[1].amount .. ' ' .. price[1].name .. ' for ' .. this_offer.offer.count .. ' ' .. this_offer.offer.item .. '.')
Common.notify_force_light(player.force, player.name .. ' traded away ' .. price[1].amount .. ' ' .. price_name .. ' for ' .. this_offer.offer.count .. ' ' .. this_offer.offer.item .. '.')
end
end
end
end
end
if in_captains_cabin and offer_type == 'nothing' then
local success = Crew.try_add_extra_time_at_sea(60 * 60)
if not success then
Common.notify_player_error(player, string.format('Purchase error: Reached the maximum allowed loading time.', player.name))
-- refund:
inv = player.get_inventory(defines.inventory.character_main)
if not inv then return end
for _, p in pairs(price) do
inv.insert{name = p.name, count = p.amount}
end
end
else
if decay_type == 'static' then
if not inv then return end
@ -196,6 +273,8 @@ function Public.event_on_market_item_purchased(event)
end
end
end
end
end
return Public

View File

@ -111,7 +111,7 @@ Public.areas_offleft = {
Public.entities = {
static = {
pos = { x = -34, y = 0},
bp_str = [[0eNqVmu1u2zAMRd/Fv93CJPWZVxmKoR9GF6B1iiTdVhR59yXtgA3Yrsn704B9QMlHEiXxfbh7ep1f9tvlOGzeh8Ny+3J13F097rcPl+efw6bUcXgbNppO47C93y2HYfPl/OL2cbl9urxyfHuZh82wPc7Pwzgst8+Xpx+73cO8XN1/mw/H4fLh8jCfWXK6GYd5OW6P2/mT8/Hw9nV5fb6b9+cX/k8Yh5fd4fzRbvkdlFznj6im63w6jf9gNIiZ1jEWxNg6JgUxuo7JQUxex5QgJq1jahBT1zEtiCnrmB7E9HWMTEFOczhhjx2RJWqyOCpL1GVxZJaozeLoLFGf1YsoarQ6I0OiTqszNiRqtXo+Rr02b0KMim2ORxo125y/plGzzfF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2tTZzFIyqt2MbJ6CUfRbIEYpm6ugmZIx0kbBqBKbZuCoMo2CUdF7eUMk+l2wIlJjXyxwUJ1WAUXlLlQWc6rctcpizpWwOafC+imbdEpHJPqVEAdFvxPiqOiXQhwV/VaIo2I3dVVEYnd1FVQAH9mXeRiUu3b5RwUYldKv8zCqSKNgVIlsn9GISOz1HJMK2USDSZXso8GkRrbSYFInu2kgyV3HrCZJyJ4aTFKyrQaTItlYg0mJba3BqMw212BUYdtrMKqyDTYY1dgWG4zqbJMNRCU6FcUoOhfFKDoZxSg6G8WoxLbbYFRmM1uMKmzLDUZVtukGoxrbdoNRnW28gSh3xTOatrtrntG03V31TKbt7rpnMm13Vz6Tqai7+JnNheOuf2Y7qkpfZiGqsa04n6i74bNVe/NX4/cQvk/H08dPtF2WZNeaNMaWy/n8C9A5zAo=]],
},
inaccessible = {
@ -149,18 +149,24 @@ Public.deck_whitebelts_lrtp_order = {
{x = -52.5, y = -11.5, direction = defines.direction.north, type = 'input'},
{x = -51.5, y = -11.5, direction = defines.direction.north, type = 'input'},
{x = -50.5, y = -11.5, direction = defines.direction.north, type = 'input'},
{x = -49.5, y = -11.5, direction = defines.direction.north, type = 'input'},
{x = -18.5, y = -11.5, direction = defines.direction.south, type = 'input'},
{x = -17.5, y = -11.5, direction = defines.direction.south, type = 'input'},
{x = -16.5, y = -11.5, direction = defines.direction.south, type = 'input'},
{x = -15.5, y = -11.5, direction = defines.direction.south, type = 'input'},
{x = -52.5, y = -2.5, direction = defines.direction.south, type = 'output'},
{x = -51.5, y = -2.5, direction = defines.direction.south, type = 'output'},
{x = -50.5, y = -2.5, direction = defines.direction.south, type = 'output'},
{x = -49.5, y = -2.5, direction = defines.direction.south, type = 'output'},
{x = -52.5, y = 2.5, direction = defines.direction.north, type = 'input'},
{x = -51.5, y = 2.5, direction = defines.direction.north, type = 'input'},
{x = -50.5, y = 2.5, direction = defines.direction.north, type = 'input'},
{x = -49.5, y = 2.5, direction = defines.direction.north, type = 'input'},
{x = -52.5, y = 11.5, direction = defines.direction.south, type = 'output'},
{x = -51.5, y = 11.5, direction = defines.direction.south, type = 'output'},
{x = -50.5, y = 11.5, direction = defines.direction.south, type = 'output'},
{x = -49.5, y = 11.5, direction = defines.direction.south, type = 'output'},
{x = -18.5, y = 11.5, direction = defines.direction.south, type = 'output'},
{x = -17.5, y = 11.5, direction = defines.direction.south, type = 'output'},
{x = -16.5, y = 11.5, direction = defines.direction.south, type = 'output'},
{x = -15.5, y = 11.5, direction = defines.direction.south, type = 'output'},

View File

@ -16,69 +16,104 @@ Public.enum = enum
Public.Data = {}
Public.Data.width = 16
Public.Data.width = 18
Public.Data.height = 24
Public.Data.cabin_whitebelts_lrtp_order = {
{x = -7.5, y = -10.5, direction = defines.direction.north, type = 'input'},
{x = -6.5, y = -10.5, direction = defines.direction.north, type = 'input'},
{x = -5.5, y = -10.5, direction = defines.direction.north, type = 'input'},
{x = -4.5, y = -10.5, direction = defines.direction.north, type = 'input'},
{x = -3.5, y = -10.5, direction = defines.direction.north, type = 'input'},
{x = -7.5, y = 10.5, direction = defines.direction.south, type = 'output'},
{x = -6.5, y = 10.5, direction = defines.direction.south, type = 'output'},
{x = -5.5, y = 10.5, direction = defines.direction.south, type = 'output'},
{x = -4.5, y = 10.5, direction = defines.direction.south, type = 'output'},
{x = -3.5, y = 10.5, direction = defines.direction.south, type = 'output'},
}
Public.Data.car_pos = {x = 7, y = 0}
Public.Data.car_pos = {x = 9, y = 0}
Public.Data.static_entities_bp = [[0eNqlmt1u4jAQhd/F16HKOP4Lr1JVK1qsbiSaoCTstqp49yWwW9EtJ/FxLyPIx9g+4zP28K4ed4e475t2VOt3NbSb/WrsVs99s52eX9VaXKHe1FqbY6Gap64d1Pr+9MXmud3spq+Mb/uo1qoZ44sqVLt5mZ5+d902tqunn3EY1fRiu40T61gsvhpf930chtXYb9ph3/Xj6jHuriH6+FCo2I7N2MRLMOeHtx/t4eUx9qdfuR1GofbdcHqpa/+N7M6eh1be2eMU2H8YnYg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rDDRXQbGTDg5rQbMgcHwMplw9KDZbrh6do57gWPXoEvV4dtJRPgILQnMV6VUMhBRremUFMUWhY0Ik2hvgmBBpb4CDS7zBGyi2G7xhc7wRaW/YAm9E2hsoH7Q30Fzx3rCoilfTKIdQbEVaAiLR7vCIpMtVDaMz5bLOOhRKbVldlxwLpWZf7+KU0BaBE0a/4cUo3iVofMK+5lWw2k2bJCJS+QteHJ0ur1VCpmGrlZDEljVw7lxJxfItsOSrTeFr4zhO2g04eWzFQ6FKu6LNIIgk5cV2yCyvDGImWyjHuaPNAGOiK+MYxdfG4fjY6rjSiBTIxjRMimRvGiTpmmxPwyQhO9QwSZFNapikyT41TDJkqxomsUs+Jjmy7w2TPNtohlGBbX7DqMg2m0FUdlFbko4xwjacYZRim+Awii5AXFB3q0v/7uZDI/Gq+tUM4+WZO4jxUXlrZt3W8/V/ACz9dUA=]]
Public.Data.operable_entities_bp = [[0eNqVkeFqwzAMhN9Fv51Ru8nS+lVKGWkjOkMiG0vZGkrefbZXRhljbX+Jg7vPJ/kCh2HCEB0J2AswdaESX52i67M+gzUrBXMa9aLAHT0x2F0yuhN1Q7bIHBAsOMERFFA3ZvXpfY9UHd+RBXKQekwsvai7UTyHiMwVh8GJYLyJm2WvAEmcOPyuUcT8RtN4SE6rfygsiMP1fQXBc8p4uq6kX1+aslSaS670C2MexLT/Y9ZPtmn/xtRPtimYdKhyVnvzvwo+MHJJmI2u261pm1qvm1XyfwG7QKjd]]
Public.Data.cabin_splitters = {
{x = -5, y = 9.5, direction = defines.direction.north, type = 0},
{x = -4, y = 8.5, direction = defines.direction.north, type = 0},
{x = -3, y = 7.5, direction = defines.direction.north, type = 0},
{x = -5, y = 7.5, direction = defines.direction.north, type = 1},
{x = -4, y = 6.5, direction = defines.direction.north, type = 1},
{x = -3, y = 5.5, direction = defines.direction.north, type = 1},
{x = -5, y = 5.5, direction = defines.direction.north, type = 2},
{x = -4, y = 4.5, direction = defines.direction.north, type = 2},
{x = -3, y = 3.5, direction = defines.direction.north, type = 2},
{x = -5, y = 3.5, direction = defines.direction.north, type = 3},
{x = -4, y = 2.5, direction = defines.direction.north, type = 3},
{x = -3, y = 1.5, direction = defines.direction.north, type = 3},
{x = -5, y = 1.5, direction = defines.direction.north, type = 4},
{x = -4, y = 0.5, direction = defines.direction.north, type = 4},
{x = -3, y = -0.5, direction = defines.direction.north, type = 4},
{x = -5, y = -0.5, direction = defines.direction.north, type = 5},
{x = -4, y = -1.5, direction = defines.direction.north, type = 5},
{x = -3, y = -2.5, direction = defines.direction.north, type = 5},
{x = -5, y = -2.5, direction = defines.direction.north, type = 6},
{x = -4, y = -3.5, direction = defines.direction.north, type = 6},
{x = -3, y = -4.5, direction = defines.direction.north, type = 6},
{x = -7, y = 9.5, direction = defines.direction.north, type = 0},
{x = -6, y = 8.5, direction = defines.direction.north, type = 0},
{x = -5, y = 7.5, direction = defines.direction.north, type = 0},
{x = -4, y = 6.5, direction = defines.direction.north, type = 0},
{x = -7, y = 7.5, direction = defines.direction.north, type = 1},
{x = -6, y = 6.5, direction = defines.direction.north, type = 1},
{x = -5, y = 5.5, direction = defines.direction.north, type = 1},
{x = -4, y = 4.5, direction = defines.direction.north, type = 1},
{x = -7, y = 5.5, direction = defines.direction.north, type = 2},
{x = -6, y = 4.5, direction = defines.direction.north, type = 2},
{x = -5, y = 3.5, direction = defines.direction.north, type = 2},
{x = -4, y = 2.5, direction = defines.direction.north, type = 2},
{x = -7, y = 3.5, direction = defines.direction.north, type = 3},
{x = -6, y = 2.5, direction = defines.direction.north, type = 3},
{x = -5, y = 1.5, direction = defines.direction.north, type = 3},
{x = -4, y = 0.5, direction = defines.direction.north, type = 3},
{x = -7, y = 1.5, direction = defines.direction.north, type = 4},
{x = -6, y = 0.5, direction = defines.direction.north, type = 4},
{x = -5, y = -0.5, direction = defines.direction.north, type = 4},
{x = -4, y = -1.5, direction = defines.direction.north, type = 4},
{x = -7, y = -0.5, direction = defines.direction.north, type = 5},
{x = -6, y = -1.5, direction = defines.direction.north, type = 5},
{x = -5, y = -2.5, direction = defines.direction.north, type = 5},
{x = -4, y = -3.5, direction = defines.direction.north, type = 5},
-- {x = -7, y = -2.5, direction = defines.direction.north, type = 6},
-- {x = -6, y = -3.5, direction = defines.direction.north, type = 6},
-- {x = -5, y = -4.5, direction = defines.direction.north, type = 6},
-- {x = -4, y = -5.5, direction = defines.direction.north, type = 6},
{x = -7, y = -2.5, direction = defines.direction.north, type = 7},
{x = -6, y = -3.5, direction = defines.direction.north, type = 7},
{x = -5, y = -4.5, direction = defines.direction.north, type = 7},
{x = -4, y = -5.5, direction = defines.direction.north, type = 7},
{x = -4, y = -8.5, direction = defines.direction.north, type = 7},
{x = -5, y = -9.5, direction = defines.direction.north, type = 7},
{x = -3, y = -7.5, direction = defines.direction.north, type = 8},
{x = 0.5, y = -7, direction = defines.direction.west, type = 8},
{x = -5, y = -7.5, direction = defines.direction.north, type = 7},
{x = -6, y = -8.5, direction = defines.direction.north, type = 7},
{x = -7, y = -9.5, direction = defines.direction.north, type = 7},
{x = -4, y = -6.5, direction = defines.direction.north, type = 8},
{x = -2, y = -6.5, direction = defines.direction.south, type = 9},
}
Public.Data.output_chest = {x = 3.5, y = -6.5}
Public.Data.backup_output_chest = {x = 3.5, y = -7.5}
Public.Data.output_chest = {x = -2.5, y = -9.5}
Public.Data.backup_output_chest = {x = -1.5, y = -9.5}
Public.Data.input_chests = {
{x = 0.5, y = 6.5},
{x = 0.5, y = 4.5},
{x = 0.5, y = 2.5},
{x = 0.5, y = 0.5},
{x = 0.5, y = -1.5},
{x = 0.5, y = -3.5},
{x = 0.5, y = -5.5},
{x = -0.5, y = 5.5},
{x = -0.5, y = 3.5},
{x = -0.5, y = 1.5},
{x = -0.5, y = -0.5},
{x = -0.5, y = -2.5},
{x = -0.5, y = -4.5},
-- {x = 0.5, y = -6.5},
}
Public.Data.surfacename_rendering_pos = {x = -0.5, y = -15}
Public.cabin_shop_data = {
{
price = {{'coin', 1000}},
offer = {type='give-item', item = 'rail-signal', count = 100},
},
{
price = {{'coal', 30}, {'coin', 800}},
offer = {type='give-item', item = 'artillery-shell', count = 8},
},
{
price = {{'stone-brick', 100}, {'coin', 1000}},
offer = {type='give-item', item = 'uranium-238', count = 10},
},
{
price = {{'coin', 20}},
offer = {type='nothing', effect_description='Relax at sea for an extra minute: Increase the next destination\'s loading time by 60 seconds.'},
},
}
function Public.get_cabin_surface_name()
local memory = Memory.get_crew_memory()
return SurfacesCommon.encode_surface_name(memory.id, 1, SurfacesCommon.enum.CABIN, enum.DEFAULT)
@ -142,6 +177,9 @@ function Public.create_cabin_surface()
elseif splitter.type == 8 then
priority = 'right'
filter = 'landfill'
elseif splitter.type == 9 then
priority = 'left'
filter = 'landfill'
end
local e = surface.create_entity({name = name, position = p, force = boat.force_name, create_build_effect_smoke = false, direction = splitter.direction})
if e and e.valid then
@ -197,7 +235,7 @@ function Public.create_cabin_surface()
e2.operable = false
end
end
local es2 = Common.build_from_blueprint(Public.Data.operable_entities_bp, surface, {x=4, y=0}, boat.force_name)
local es2 = Common.build_from_blueprint(Public.Data.operable_entities_bp, surface, {x=5, y=-4}, boat.force_name)
for _, e2 in pairs(es2) do
if e2 and e2.valid then
e2.destructible = false
@ -215,6 +253,16 @@ function Public.create_cabin_surface()
e.operable = false
end
e = surface.create_entity({name = 'market', position = Public.Data.market_position, force = boat.force_name, create_build_effect_smoke = false})
if e and e.valid then
e.destructible = false
e.minable = false
e.rotatable = false
for _, offer in pairs(Public.cabin_shop_data) do
e.add_market_item(offer)
end
end
rendering.draw_text{
text = 'Captain\'s Cabin',
surface = surface,
@ -234,12 +282,14 @@ function Public.connect_up_linked_belts_to_deck() --assumes both are in standard
if boat and boat.deck_whitebelts and #boat.deck_whitebelts > 0 and boat.cabin_whitebelts and #boat.cabin_whitebelts > 0 then
local connections = {
{1,7},
{2,8},
{3,9},
{4,10},
{5,11},
{6,12},
{1,9},
{2,10},
{3,11},
{4,12},
{5,13},
{6,14},
{7,15},
{8,16},
}
for _, c in pairs(connections) do

View File

@ -150,8 +150,8 @@ end
Public.Data.jetty_offset = {x = -20, y = -38}
Public.Data.jetty_bp = [[0eNqVmcFO4zAYhN/F5yBl5ncSJ6+y4lAgQpFKWrUBgVDenZZw4LC76nesNHVGHs/nxP5MD/vX8Xia5iUNn+k87453y+Hu+TQ9XX+/pyFylT7SkNu1StPjYT6n4c9FOD3Pu/1VsnwcxzSkaRlfUpXm3cv110X3eBqXMV3/ND+Nl3G03ldpmfbjNsDxcJ6W6TD/PKXeHhLr34b4lzojdXObWsiJkBMhJ0ZOjJwYOQnkJJCTQE4ycpKRk4ycNMhJg5w0yEmLnLTISYucdMhJh5x0yElBTgpyUpCTHjnpkZOekY1BVoyygpiFnIWgZaQVQ60Ya8VgK0ZbMdyK8VYMuGLEFUOuGHPFoCtGXTHsinFXDLxi5BVDrxh7xeArRl8x/IrxVwzAYgQ2I7AZgc0IbEZgMwIbvuvCl134tssIbEZgMwKbEdiMwGYENiOwGYHNCGxGYDMCmxHYjMDeGNkidYfUBakDynskzzWTB5NnJr81o4IyKiijgjIqLKPCMiosI7Zfm+3XZvu1tx21RmohtZE6kDojNZuTFqk7pC5sTqC8Z3PIws8s/czizzB/tgBuPoCrSSt+1EJqI3UgdUZqNictUndIXdicQHnP5pCFn1n6mcWfYf5sAdzcCqFWCLVCqBVCrRBqhVArhFoh1AqhVoi1QqwVYq0Qa4VYK9indLBP6WCf0mG0AoxWgNEKMFsBZivAbAWwE4ZgJwwBL9QCZRQoo0AZBcsoWEbBMoIXjfCm8X8HL/fVdoU9/LoQr9LbeDp/D+Ci3PXuGjWKtl7XLyUP5fs=]]
Public.Data.stone_bp_1_offset = {x = -5, y = -49}
Public.Data.stone_bp_1 = [[0eNqd2cFq4zAURuF30dqB/FeWZPtVShdpKjqiqW1st7QUv/skbRZDoYNPloEb2ToEog99uofTax6n0i+u+3Rzfxh3y7B7msrj5fO768xX7sN1aa1cOQ797Lq781x56g+ny8TyMWbXubLkF1e5/vBy+TQvQ593D1M5PrvL9/rHfF5J633llnLK32uMw1yWMvTX5+y/HrNffywyHpY/5zV+GRcbNzbut46LvbvYu4u9u25593rruLGtGtuqsa0a26rdstWwddyzMp6V8ayMZ2U8K+NvKRO3jtcsZM1C1ixkzULWLGTNQtYsZGAhAwsZWMjAQoafIc//PccpL/n34cDW3pwxsoyRZYwsY2QZI/s9RhYyspCJhUwsZGIhEwuZWMjEQiYWsmEhGxayYSEbFrJhIRsWsmEhWxayZSFbFrJlIVsWsmUhWxZS8PgueH4XPMCLnuD3rOZ1PsD57T0pKagpKCqoKiArrvMBzm/vCd0iCBdBuQjSRdAugni5zm/vCbUjyB1B7wiCR1A8guQRNI8gegTVI8geQfcIwkdQPoL0EbSPIH4E9SPIHwXYExJI0ECCCBJUkCCDBB0kCCFBCQlSSNBCghgS1JAghwQ9JAgiQREJkkjQRIIoElSRIIsEXSQII0EZCdJI0EaCOBLUkSCPBH1k0EcGfWTQRwZ9ZNBHBn1k0DsGvWPQOwa9Y/Qahd6j0IsUepPyX4/cV98XfN0/t4WVe8vT/LWCNapTaykoyMf9uv4FIKIUeQ==]]
Public.Data.stone_bp_1_offset = {x = -19, y = -49}
Public.Data.stone_bp_1 = [[0eNqd2t1q20AUxPF32WsZfGa0+nqVkgsnEamoIxtbKQ3B71470UUptOzfl4aT9c5wCPohf6TH/dt4PE3zkoaPdJ53x81y2Lycpufb519pcFul9zS0lypNT4f5nIZv17npZd7tbxPL+3FMQ5qW8TVVad693j6dl8M8bh5P09OPdPu7+Xm8nhSXhyot0378OuN4OE/LdJjX79l+fs328tchx93y/XrGP8aDjYuNu3Q82N2D3T3Y3eOeu9el42JRxaKKRRWLKhbVLKpZVLOoZlHNotYsas2i1ixqzaLWLGpmUTOLmlnUzKJmFrVhURsWtWFRG/hvCa5kwJ0MuJQBtzLgngVctICbFvmu+xfvWsBlC7htAdct6L41d+XNxfMt7KeF/bSwnxb208J+2rv6aYrnO9hnB/vsYJ8d7LODfXawzw722cM+e9hnD/vsYZ897LOHffasT0HPCIJGUDSCpFnnazif4Xx5n9BYgsgSVJYgs0SdFbDPgH1SyFHJUcpRy0HMrfMZzpf3CbUoyEVBLwqCUVCM63yG8+V9wud/wed/wed/wed/QZau8xnOl/cJPSLoEUGPCHpE0CPrfIbz5X1C7wh6R9A7gt4R9I6gd9b58j6hjwR9JOgjQR8J+kjQR4I+EvSRoI8EfSToI0EfCfpI0EeCPhL0kaCPBH0k6CNBHwn6yNBHhj4y9JGhjwx9ZOgjQx8Z+sjQR4Y+MvSRoY8MfWToI0MfGfrI0EeGPjJ92QV9ZOgj07dp9HUafZ9GX6hBHxn6yNBHhj4y9JGhjwx9ZOgjQx8ZesfQO4beMfSOoXcMPWLoEUOP+L8eeai+fjEy/PHzkyr9HE/nzxPURd32anMdztt8ufwGAFgVOg==]]
Public.Data.ground_bp_1_offset = {x = -122, y = -49}

View File

@ -38,7 +38,9 @@ Public[enum.INITIAL].Data.hold_whitebelts_lrtp_order = {
{x = -19.5, y = -21.5, direction = defines.direction.north, type = 'output'},
{x = -18.5, y = -21.5, direction = defines.direction.north, type = 'output'},
{x = -17.5, y = -21.5, direction = defines.direction.north, type = 'output'},
{x = -16.5, y = -21.5, direction = defines.direction.north, type = 'output'},
{x = 16.5, y = -21.5, direction = defines.direction.north, type = 'output'},
{x = 17.5, y = -21.5, direction = defines.direction.north, type = 'output'},
{x = 18.5, y = -21.5, direction = defines.direction.north, type = 'output'},
{x = 19.5, y = -21.5, direction = defines.direction.north, type = 'output'},
@ -55,7 +57,9 @@ Public[enum.INITIAL].Data.hold_whitebelts_lrtp_order = {
{x = -19.5, y = 21.5, direction = defines.direction.south, type = 'input'},
{x = -18.5, y = 21.5, direction = defines.direction.south, type = 'input'},
{x = -17.5, y = 21.5, direction = defines.direction.south, type = 'input'},
{x = -16.5, y = 21.5, direction = defines.direction.south, type = 'input'},
{x = 16.5, y = 21.5, direction = defines.direction.south, type = 'input'},
{x = 17.5, y = 21.5, direction = defines.direction.south, type = 'input'},
{x = 18.5, y = 21.5, direction = defines.direction.south, type = 'input'},
{x = 19.5, y = 21.5, direction = defines.direction.south, type = 'input'},
@ -271,12 +275,16 @@ function Public.connect_up_linked_belts_to_deck() --assumes both are in standard
{4,4},
{5,5},
{6,6},
{15,13},
{16,14},
{17,15},
{18,16},
{19,17},
{20,18},
{7,7},
{8,8},
{17,17},
{18,18},
{19,19},
{20,20},
{21,21},
{22,22},
{23,23},
{24,24},
}
for _, c in pairs(connections) do
@ -298,10 +306,10 @@ function Public.nth_hold_connect_linked_belts(nth) --assumes both are in standar
if nth % 2 == 0 then
if nth == 2 then
connections = {
{5,11},
{6,12},
{7,13},
{8,14},
{5,13},
{6,14},
{7,15},
{8,16},
}
for _, c in pairs(connections) do
local b1 = boat.hold_whitebelts[nth][c[1]]
@ -322,10 +330,10 @@ function Public.nth_hold_connect_linked_belts(nth) --assumes both are in standar
end
end
connections = {
{1,7},
{2,8},
{3,9},
{4,10},
{1,9},
{2,10},
{3,11},
{4,12},
}
for _, c in pairs(connections) do
local b1 = boat.hold_whitebelts[nth][c[1]]
@ -345,10 +353,10 @@ function Public.nth_hold_connect_linked_belts(nth) --assumes both are in standar
b1.connect_linked_belts(b2)
end
connections = {
{5,7},
{6,8},
{7,9},
{8,10},
{5,9},
{6,10},
{7,11},
{8,12},
}
for _, c in pairs(connections) do
local b1 = boat.hold_whitebelts[nth][c[1]]

View File

@ -25,7 +25,7 @@ function Public.base_ores()
['iron-ore'] = 6.5,
['coal'] = 4.0,
['stone'] = 2.0,
['crude-oil'] = 25,
['crude-oil'] = 30,
}
end

View File

@ -319,9 +319,9 @@ function Public.destination_on_arrival(destination)
if not (#memory.destinationsvisited_indices and #memory.destinationsvisited_indices == 1) then --don't need to notify for the first island
Server.to_discord_embed_raw((destination.static_params.discord_emoji or CoreData.comfy_emojis.wut) .. '[' .. memory.name .. '] Approaching ' .. name .. ', ' .. memory.overworldx .. ' leagues.')
end
if destination.static_params.name == 'Dock' then
message = message .. ' ' .. 'New trades are available in the Captain\'s Store.'
end
-- if destination.static_params.name == 'Dock' then
-- message = message .. ' ' .. 'New trades are available in the Captain\'s Store.'
-- end
Common.notify_force(memory.force, message)
if destination.type == enum.ISLAND then

View File

@ -633,17 +633,17 @@ function Public.place_cached_structures(tickinterval)
end
if destination.static_params.class_for_sale then
covered_data.market.add_market_item{price={{'coin', Balance.class_cost()}}, offer={type="nothing"}}
covered_data.market.add_market_item{price={{'coin', Balance.class_cost()}}, offer={type="nothing", effect_description = 'Purchase the class ' .. Classes.display_form[destination.static_params.class_for_sale] .. '.'}}
destination.dynamic_data.market_class_offer_rendering = rendering.draw_text{
text = 'Class available: ' .. Classes.display_form[destination.static_params.class_for_sale],
surface = surface,
target = Utils.psum{special.position, hardcoded_data.market, {x = 1, y = -3.9}},
color = CoreData.colors.renderingtext_green,
scale = 2.5,
font = 'default-game',
alignment = 'center'
}
-- destination.dynamic_data.market_class_offer_rendering = rendering.draw_text{
-- text = 'Class available: ' .. Classes.display_form[destination.static_params.class_for_sale],
-- surface = surface,
-- target = Utils.psum{special.position, hardcoded_data.market, {x = 1, y = -3.9}},
-- color = CoreData.colors.renderingtext_green,
-- scale = 2.5,
-- font = 'default-game',
-- alignment = 'center'
-- }
end
end