From 664db4919632cb08e332d574a6a2628fbc0d53f2 Mon Sep 17 00:00:00 2001 From: danielmartin0 Date: Wed, 9 Mar 2022 21:39:47 +0000 Subject: [PATCH] v1.0.4.7.2 --- locale/en/pirates.cfg | 4 +-- maps/pirates/ai.lua | 12 ++++----- maps/pirates/balance.lua | 25 ++++++++++-------- maps/pirates/common.lua | 10 +++---- maps/pirates/coredata.lua | 6 ++--- maps/pirates/crew.lua | 26 +++++++++++-------- maps/pirates/gui/gui.lua | 7 ++--- maps/pirates/interface.lua | 10 +++---- maps/pirates/main.lua | 4 +-- maps/pirates/roles/classes.lua | 1 - maps/pirates/roles/roles.lua | 3 ++- maps/pirates/shop/covered.lua | 3 +++ maps/pirates/shop/dock.lua | 2 +- maps/pirates/shop/shop.lua | 3 ++- maps/pirates/structures/boats/boats.lua | 16 ++++++++---- .../island_structures/mattisso/data.lua | 2 +- maps/pirates/surfaces/dock.lua | 2 +- .../surfaces/islands/standard/data.lua | 4 +-- .../surfaces/islands/standard/standard.lua | 4 +-- .../islands/standard_variant/data.lua | 4 +-- .../standard_variant/standard_variant.lua | 2 +- maps/pirates/tick_functions.lua | 2 +- maps/pirates/tick_functions_classes.lua | 2 +- 23 files changed, 86 insertions(+), 68 deletions(-) diff --git a/locale/en/pirates.cfg b/locale/en/pirates.cfg index 1b1f8a15..62996d8d 100644 --- a/locale/en/pirates.cfg +++ b/locale/en/pirates.cfg @@ -16,7 +16,7 @@ softmod_info_tips_1=Features of the game that are hard to work out alone softmod_info_tips_2=• Electric networks upstairs and downstairs are separate.\n• You can steer the boat from the crow's nest by placing 100 rail signals in one of the blue boxes.\n• Resources granted to the ship appear in the captain's cabin.\n• Charging a silo launches a rocket. This causes pollution and evo, but gives a reward of fuel and coins.\n• Charging a silo drains power from everything else on its network.\n• The quantity of ore available on an island is independent of the order in which you break rocks.\n• Passive pollution ramps up over time on each island.\n• The strength of attacks is proportional to the number of remaining nests. (The time-based rate of evolution is proportional to nests too, but destroying a nest will immediately jump evolution by the amount it 'would have' made had it survived.)\n• Covered markets give back any plates spent to unlock them.\n• Lab productivity increases with each league.\n• The player who spent the longest as captain between leagues 0 and 1000 (exclusive) is written into the highscores table.\n• Logged-out players keep their items with them for a while — except 'important' items that are returned to the crew immediately.\n• /class {classname} is a command that whispers to you what a class does. softmod_info_updates_1=Development -softmod_info_updates_2=Pirate Ship 1.0.4 is currently stable. Recent significant changes: Fuel mechanic replaces gold. Silo death is no longer a lose condition. Game made much easier for small crews. New islands and classes. +softmod_info_updates_2=Recent significant changes: Fuel mechanic replaces gold. Silo death is no longer a lose condition. Game made much easier for small crews. New islands and classes. softmod_info_credits_1=Credits softmod_info_credits_2=Pirate Ship designed and written by thesixthroc. Comfy codebase and help from Gerkiz, Hanakocz and Mew @ Comfy Industries (https://getcomfy.eu). Most island structure blueprints contributed by Mattisso.\n\nContact us via Discord: https://getcomfy.eu/discord\n\n"Those white gloves. I'll never forget them 'till the day I die." - Dr. John @@ -32,7 +32,7 @@ softmod_info_body_some_old_stuff="Those white gloves. I'll never forget them 'ti proposal_displayform=__1__ — __2__ run_displayform= __2__ crewmember_displayform=[color=__2__,__3__,__4__]__5__[/color] [color=1,1,1]__6__[/color] -capacity_tooltip=Capacity. Sets the maximum number of crewmembers allowed.\n\n(Unlike in Beta, the capacity option does not affect pollution and evo; instead, the number of non-afk crewmates does.) +capacity_tooltip=Capacity. Sets the maximum number of crewmembers allowed. difficulty_tooltip=Difficulty.\n\nHigher difficulties have higher pollution and evo, higher biter damage, lower gold loot, but higher chest loot, along with small effects on the time per island, quest requirements, and silo position.\n\nDifficulty also determines the material the ship is made out of. mode_tooltip=Mode. diff --git a/maps/pirates/ai.lua b/maps/pirates/ai.lua index b79c264a..00d054ea 100644 --- a/maps/pirates/ai.lua +++ b/maps/pirates/ai.lua @@ -134,8 +134,8 @@ function Public.try_main_attack() -- log('attack aborted by chance') return nil end --variance in attack sizes - if Math.random(10) == 1 then wave_size_multiplier = 1.8 end --variance in attack sizes - if Math.random(60) == 1 then wave_size_multiplier = 3.2 end --variance in attack sizes + if Math.random(10) == 1 then wave_size_multiplier = 1.7 end --variance in attack sizes + if Math.random(70) == 1 then wave_size_multiplier = 3.2 end --variance in attack sizes if Math.random(500) == 1 then wave_size_multiplier = 5 end --variance in attack sizes end @@ -157,8 +157,8 @@ function Public.try_secondary_attack() if Math.random(2) == 1 then log('attack aborted by chance') end --variance in attack sizes - if Math.random(10) == 1 then wave_size_multiplier = 1.8 end --variance in attack sizes - if Math.random(60) == 1 then wave_size_multiplier = 3.2 end --variance in attack sizes + if Math.random(10) == 1 then wave_size_multiplier = 1.7 end --variance in attack sizes + if Math.random(70) == 1 then wave_size_multiplier = 3.2 end --variance in attack sizes if Math.random(500) == 1 then wave_size_multiplier = 5 end --variance in attack sizes end @@ -190,8 +190,8 @@ function Public.try_rogue_attack() if Math.random(2) == 1 then log('attack aborted by chance') end --variance in attack sizes - if Math.random(10) == 1 then wave_size_multiplier = 1.8 end --variance in attack sizes - if Math.random(60) == 1 then wave_size_multiplier = 3.2 end --variance in attack sizes + if Math.random(10) == 1 then wave_size_multiplier = 1.7 end --variance in attack sizes + if Math.random(70) == 1 then wave_size_multiplier = 3.2 end --variance in attack sizes if Math.random(500) == 1 then wave_size_multiplier = 5 end --variance in attack sizes end diff --git a/maps/pirates/balance.lua b/maps/pirates/balance.lua index ea3f02dd..726c1bc6 100644 --- a/maps/pirates/balance.lua +++ b/maps/pirates/balance.lua @@ -108,7 +108,7 @@ function Public.fuel_depletion_rate_static() local rate if Common.overworldx() > 0 then - rate = 500 * (0 + (Common.overworldx()/40)^(9/10)) * Public.crew_scale()^(1/6) * Math.sloped(Common.difficulty(), 4/5) / T --most of the crewsize dependence is through T, i.e. the coal cost per island stays the same... but the extra player dependency accounts for the fact that even in compressed time, more players seem to get more resources per island + rate = 550 * (0 + (Common.overworldx()/40)^(9/10)) * Public.crew_scale()^(1/6) * Math.sloped(Common.difficulty(), 4/5) / T --most of the crewsize dependence is through T, i.e. the coal cost per island stays the same... but the extra player dependency accounts for the fact that even in compressed time, more players seem to get more resources per island else rate = 0 end @@ -452,7 +452,7 @@ end function Public.covered_entry_price_scale() - return 0.9 * (1 + 0.025 * (Common.overworldx()/40 - 1)) * ((1 + Public.crew_scale())^(1/3)) * Math.sloped(Common.difficulty(), 1/2) --whilst resource scales tend to be held fixed with crew size, we account slightly for the fact that more players tend to handcraft more + return 0.85 * (1 + 0.033 * (Common.overworldx()/40 - 1)) * ((1 + Public.crew_scale())^(1/3)) * Math.sloped(Common.difficulty(), 1/2) --whilst resource scales tend to be held fixed with crew size, we account slightly for the fact that more players tend to handcraft more end -- if the prices are too high, players will accidentally throw too much in when they can't do it @@ -462,11 +462,11 @@ Public.covered1_entry_price_data_raw = { --watch out that the raw_materials ches {1, 0, 1, false, { price = {name = 'iron-stick', count = 1500}, raw_materials = {{name = 'iron-plate', count = 750}}}, {}}, - {0.8, 0, 1, false, { + {0.85, 0, 1, false, { price = {name = 'copper-cable', count = 1500}, raw_materials = {{name = 'copper-plate', count = 750}}}, {}}, - {1, 0, 0.3, true, { + {1, 0, 0.3, false, { price = {name = 'small-electric-pole', count = 450}, raw_materials = {{name = 'copper-plate', count = 900}}}, {}}, {1, 0.1, 1, false, { @@ -475,22 +475,25 @@ Public.covered1_entry_price_data_raw = { --watch out that the raw_materials ches {1, 0, 0.15, false, { price = {name = 'burner-mining-drill', count = 150}, raw_materials = {{name = 'iron-plate', count = 1350}}}, {}}, - {0.5, 0, 0.6, false, { + {0.75, 0, 0.6, false, { price = {name = 'burner-inserter', count = 300}, raw_materials = {{name = 'iron-plate', count = 900}}}, {}}, - {1, 0.1, 0.7, false, { + {1.15, 0.05, 0.7, false, { price = {name = 'electronic-circuit', count = 800}, raw_materials = {{name = 'iron-plate', count = 800}, {name = 'copper-plate', count = 1200}}}, {}}, {1, 0, 1, false, { price = {name = 'firearm-magazine', count = 700}, raw_materials = {{name = 'iron-plate', count = 2800}}}, {}}, + {1.15, 0, 1, false, { + price = {name = 'constant-combinator', count = 300}, + raw_materials = {{name = 'iron-plate', count = 600}, {name = 'copper-plate', count = 1550}}}, {}}, - {1, 0.1, 1, false, { + {1, 0.05, 1, false, { price = {name = 'stone-furnace', count = 350}, raw_materials = {}}, {}}, - {1, 0.5, 1, false, { - price = {name = 'advanced-circuit', count = 100}, - raw_materials = {{name = 'iron-plate', count = 200}, {name = 'copper-plate', count = 500}, {name = 'plastic-bar', count = 200}}}, {}}, + {1, 0.4, 1.6, true, { + price = {name = 'advanced-circuit', count = 180}, + raw_materials = {{name = 'iron-plate', count = 360}, {name = 'copper-plate', count = 900}, {name = 'plastic-bar', count = 360}}}, {}}, {0.5, -0.5, 0.5, true, { price = {name = 'wooden-chest', count = 400}, @@ -527,7 +530,7 @@ function Public.covered1_entry_price() local overworldx = memory.overworldx or 0 - local game_completion_progress = Math.min(Math.sloped(Common.difficulty(),1/2) * Common.game_completion_progress(), 1) + local game_completion_progress = Math.max(Math.min(Math.sloped(Common.difficulty(),1/2) * Common.game_completion_progress(), 1), 0) local data = Public.covered1_entry_price_data() local types, weights = {}, {} diff --git a/maps/pirates/common.lua b/maps/pirates/common.lua index 76a8f572..e4fd9fa0 100644 --- a/maps/pirates/common.lua +++ b/maps/pirates/common.lua @@ -24,7 +24,7 @@ Public.mapedge_distance_from_boat_starting_position = 272 -- to accommodate hors Public.deepwater_distance_from_leftmost_shore = 32 Public.lobby_spawnpoint = {x = -72, y = -8} -Public.quartermaster_range = 16 +Public.quartermaster_range = 17 Public.fraction_of_map_loaded_atsea = 1 Public.map_loading_ticks_atsea = 68 * 60 @@ -39,10 +39,10 @@ Public.maze_minimap_jam_start_league = 280 Public.ban_from_rejoining_crew_ticks = 45 * 60 --to prevent observing map and rejoining -Public.afk_time = 60 * 60 * 4.5 -Public.afk_warning_time = 60 * 60 * 4 -Public.logged_off_items_preserved_seconds = 60 * 5 -Public.important_items = {'coin', 'uranium-235', 'uranium-238', 'fluid-wagon', 'coal', 'electric-engine-unit', 'advanced-circuit', 'beacon', 'speed-module-3', 'speed-module-2'} +Public.afk_time = 60 * 60 * 5.5 +Public.afk_warning_time = 60 * 60 * 5 +Public.logged_off_items_preserved_minutes = 5 +Public.important_items = {'coin', 'uranium-235', 'uranium-238', 'fluid-wagon', 'coal', 'electric-engine-unit', 'advanced-circuit', 'beacon', 'speed-module-3', 'speed-module-2'} --internal inventories of these will not be preserved Public.autodisband_ticks = 30*60*60 -- Public.autodisband_ticks = 30 --the reason this is low is because the comfy server runs very slowly when no-one is on it diff --git a/maps/pirates/coredata.lua b/maps/pirates/coredata.lua index 4df3b7c7..d1d95378 100644 --- a/maps/pirates/coredata.lua +++ b/maps/pirates/coredata.lua @@ -5,8 +5,8 @@ local inspect = require 'utils.inspect'.inspect local Public = {} Public.scenario_id_name = 'pirates' -Public.version_string = '1.0.4.7' -Public.version_float = 1.047 +Public.version_string = '1.0.4.7.2' +Public.version_float = 1.0472 Public.blueprint_library_allowed = true Public.blueprint_importing_allowed = true @@ -40,7 +40,7 @@ Public.colors = { notify_gameover = {r=249, g=84, b=84}, renderingtext_green = {r=88, g=219, b=88}, renderingtext_yellow = {r=79, g=136, b=209}, - quartermaster_rendering = {r=237, g=157, b=45, a=0.3}, + quartermaster_rendering = {r=237, g=157, b=45, a=0.15}, } Public.static_boat_floor = 'brown-refined-concrete' diff --git a/maps/pirates/crew.lua b/maps/pirates/crew.lua index 7127b2da..a64fb407 100644 --- a/maps/pirates/crew.lua +++ b/maps/pirates/crew.lua @@ -236,8 +236,8 @@ function Public.join_spectators(player, crewid) -- -- Server.to_discord_embed_raw(CoreData.comfy_emojis.feel .. '[' .. memory.name .. '] ' .. message) -- end - -- char.die(memory.force_name) Common.send_important_items_from_player_to_crew(player, true) + char.die(memory.force_name) player.set_controller{type = defines.controllers.spectator} else @@ -269,10 +269,10 @@ function Public.join_spectators(player, crewid) end memory.spectatorplayerindices[#memory.spectatorplayerindices + 1] = player.index memory.tempbanned_from_joining_data[player.index] = game.tick - if #Common.crew_get_crew_members() == 0 then - memory.crew_disband_tick = game.tick + 30 - -- memory.crew_disband_tick = game.tick + 60*60*2 --give players time to log back in after a crash or save - end + -- if #Common.crew_get_crew_members() == 0 then + -- memory.crew_disband_tick = game.tick + 30 + -- -- memory.crew_disband_tick = game.tick + 60*60*2 --give players time to log back in after a crash or save + -- end if not (memory.difficulty_votes) then memory.difficulty_votes = {} end memory.difficulty_votes[player.index] = nil end @@ -293,6 +293,7 @@ function Public.leave_spectators(player, quiet) local chars = player.get_associated_characters() if #chars > 0 then + game.print('hi') player.teleport(chars[1].position, surface) player.set_controller{type = defines.controllers.character, character = chars[1]} else @@ -304,14 +305,14 @@ function Public.leave_spectators(player, quiet) memory.spectatorplayerindices = Utils.ordered_table_with_values_removed(memory.spectatorplayerindices, player.index) if #Common.crew_get_crew_members() == 0 then - Public.disband_crew() + memory.crew_disband_tick = game.tick + Common.autodisband_ticks end player.force = 'player' end -function Public.join_crew(player, crewid) +function Public.join_crew(player, crewid, rejoin) if crewid then Memory.set_working_id(crewid) local memory = Memory.get_crew_memory() @@ -355,17 +356,18 @@ function Public.join_crew(player, crewid) Public.player_abandon_endorsements(player) player.force = game.forces[string.format('crew-%03d', memory.id)] player.teleport(surface.find_non_colliding_position('character', memory.spawnpoint, 32, 0.5) or memory.spawnpoint, surface) + + Common.notify_lobby(player.name .. ' left the lobby to join ' .. memory.name .. '.') end local message = player.name .. ' joined the crew.' Common.notify_force(player.force, message) -- Server.to_discord_embed_raw(CoreData.comfy_emojis.yum1 .. '[' .. memory.name .. '] ' .. message) - Common.notify_lobby(player.name .. ' left the lobby to join ' .. memory.name .. '.') memory.crewplayerindices[#memory.crewplayerindices + 1] = player.index -- don't give them items if they've been in the crew recently: - if not (memory.tempbanned_from_joining_data and memory.tempbanned_from_joining_data[player.index] and game.tick < memory.tempbanned_from_joining_data[player.index] + 8 * Common.ban_from_rejoining_crew_ticks) then + if not (memory.tempbanned_from_joining_data and memory.tempbanned_from_joining_data[player.index] and game.tick < memory.tempbanned_from_joining_data[player.index] + 8 * Common.ban_from_rejoining_crew_ticks) and (not rejoin) then for item, amount in pairs(Balance.starting_items_player_late) do player.insert({name = item, count = amount}) end @@ -399,9 +401,11 @@ function Public.leave_crew(player, to_lobby, quiet) -- Common.notify_force(player.force, message .. ' [gps=' .. Math.ceil(p.x) .. ',' .. Math.ceil(p.y) .. ',' .. surface_name ..']') -- -- Server.to_discord_embed_raw(CoreData.comfy_emojis.feel .. '[' .. memory.name .. '] ' .. message) -- end - -- char.die(memory.force_name) - if (not to_lobby) then + if to_lobby then + Common.send_important_items_from_player_to_crew(player, true) + char.die(memory.force_name) + else Common.send_important_items_from_player_to_crew(player) memory.temporarily_logged_off_characters[player.index] = game.tick end diff --git a/maps/pirates/gui/gui.lua b/maps/pirates/gui/gui.lua index 8bc56633..745b6244 100644 --- a/maps/pirates/gui/gui.lua +++ b/maps/pirates/gui/gui.lua @@ -817,7 +817,7 @@ function Public.update_gui(player) -- flow1.silo_label_1.caption = string.format('Launched for %.0f[item=coal] , ' .. Balance.rocket_launch_coin_reward .. '[item=coin]', destination.dynamic_data.rocketcoalreward) flow1.silo_label_1.style.font_color = GuiCommon.achieved_font_color - flow1.silo_label_3.caption = string.format('for %.0f[item=coal] , ' .. Balance.rocket_launch_coin_reward .. '[item=coin]', destination.dynamic_data.rocketcoalreward) + flow1.silo_label_3.caption = 'for ' .. Math.floor(destination.dynamic_data.rocketcoalreward/100)/10 .. 'k[item=coal], ' .. Math.floor(Balance.rocket_launch_coin_reward/100)/10 .. 'k[item=coin]' local tooltip = 'The rocket has launched, and this is the reward.' flow1.tooltip = tooltip @@ -895,10 +895,11 @@ function Public.update_gui(player) if quest_complete then tooltip = 'The quest is complete, and this is the reward.' - flow1.quest_label_1.caption = 'Quest: ' .. quest_reward.display_amount .. ' ' .. quest_reward.display_sprite - flow1.quest_label_2.visible = false + flow1.quest_label_1.caption = 'Quest:' + flow1.quest_label_2.visible = true flow1.quest_label_3.visible = false flow1.quest_label_4.visible = false + flow1.quest_label_2.caption = quest_reward.display_amount .. ' ' .. quest_reward.display_sprite elseif quest_progress < quest_progressneeded then flow1.quest_label_1.caption = 'Quest:' flow1.quest_label_2.visible = true diff --git a/maps/pirates/interface.lua b/maps/pirates/interface.lua index 44e95b3d..bac78e7d 100644 --- a/maps/pirates/interface.lua +++ b/maps/pirates/interface.lua @@ -203,7 +203,7 @@ local function kraken_damage(event) -- if event.cause.name == 'artillery-turret' then adjusted_damage = adjusted_damage / 3 elseif event.damage_type.name and (event.damage_type.name == 'fire') then - adjusted_damage = adjusted_damage / 2 + adjusted_damage = adjusted_damage / 1.5 end -- and additionally: if event.cause.name == 'artillery-turret' then @@ -252,7 +252,7 @@ local function extra_damage_to_players(event) if not (inv and inv.valid) then return end local count = inv.get_item_count('iron-ore') if count and count >= 2500 then - event.entity.health = event.entity.health + event.final_damage_amount * 0.75 + event.entity.health = event.entity.health + event.final_damage_amount * 0.8 end end --samurai health buff is elsewhere end @@ -287,7 +287,7 @@ local function samurai_damage_dealt_changes(event) local player_index = player.index - if memory.classes_table and memory.classes_table[player_index] then + if player and memory.classes_table and memory.classes_table[player_index] then local samurai = memory.classes_table[player_index] == Classes.enum.SAMURAI local hatamoto = memory.classes_table[player_index] == Classes.enum.HATAMOTO @@ -354,7 +354,7 @@ local function quartermaster_damage_dealt_changes(event) local p2_index = p2.player.index if player_index ~= p2_index and memory.classes_table[p2_index] and memory.classes_table[p2_index] == Classes.enum.QUARTERMASTER then if event.damage_type.name == 'physical' then - event.entity.damage(0.1 * event.original_damage_amount, character.force, 'impact', character) --triggers this function again, but not physical this time + event.entity.damage(0.1 * event.final_damage_amount, character.force, 'impact', character) --triggers this function again, but not physical this time end end end @@ -1010,7 +1010,7 @@ local function event_on_player_joined_game(event) end if crew_to_put_back_in then - Crew.join_crew(player, crew_to_put_back_in) + Crew.join_crew(player, crew_to_put_back_in, true) if _DEBUG then log('putting player back in their old crew') end else diff --git a/maps/pirates/main.lua b/maps/pirates/main.lua index a62ae948..9fa9b077 100644 --- a/maps/pirates/main.lua +++ b/maps/pirates/main.lua @@ -301,8 +301,8 @@ local function crew_tick() TickFunctions.transfer_pollution(1800) end - if tick % 1800 == 0 then - TickFunctions.prune_offline_characters_list(1800) + if tick % 3600 == 0 then + TickFunctions.prune_offline_characters_list(3600) end -- if tick % (60*60*60) == 0 then diff --git a/maps/pirates/roles/classes.lua b/maps/pirates/roles/classes.lua index 0aad307e..15471c06 100644 --- a/maps/pirates/roles/classes.lua +++ b/maps/pirates/roles/classes.lua @@ -116,7 +116,6 @@ function Public.initial_class_pool() enum.SHORESMAN, enum.SHORESMAN, enum.QUARTERMASTER, - enum.QUARTERMASTER, enum.FISHERMAN, enum.SCOUT, enum.SAMURAI, diff --git a/maps/pirates/roles/roles.lua b/maps/pirates/roles/roles.lua index a4dbc45d..22168061 100644 --- a/maps/pirates/roles/roles.lua +++ b/maps/pirates/roles/roles.lua @@ -132,10 +132,11 @@ function Public.get_class_print_string(class) for _, class2 in ipairs(Classes.Class_List) do if Classes.display_form[class2]:lower() == class:lower() then local str = '' + str = str .. Classes.display_form[class2] .. ': ' if Classes.class_purchase_requirement[class2] then str = str .. 'An upgrade of ' .. Classes.display_form[Classes.class_purchase_requirement[class2]] .. '. ' end - str = str .. Classes.display_form[class2] .. ': ' .. Classes.explanation[class2] + str = str .. Classes.explanation[class2] return str end end diff --git a/maps/pirates/shop/covered.lua b/maps/pirates/shop/covered.lua index 6c5ec604..b4bf115e 100644 --- a/maps/pirates/shop/covered.lua +++ b/maps/pirates/shop/covered.lua @@ -62,10 +62,13 @@ function Public.market_generate_coin_offers(how_many) if game_completion_progress < 0.2 then ret[#ret + 1] = loaderoffers[1] + ret[#ret + 1] = loaderoffers[1] elseif game_completion_progress < 0.6 then ret[#ret + 1] = loaderoffers[2] + ret[#ret + 1] = loaderoffers[2] else ret[#ret + 1] = loaderoffers[3] + ret[#ret + 1] = loaderoffers[3] end local toaddcount = how_many diff --git a/maps/pirates/shop/dock.lua b/maps/pirates/shop/dock.lua index ceab4f6d..51426f2b 100644 --- a/maps/pirates/shop/dock.lua +++ b/maps/pirates/shop/dock.lua @@ -55,7 +55,7 @@ Public.market_sales = { {price = {{'coin', 2000}}, offer = {type = 'give-item', item = 'laser-turret', count = 2}}, {price = {{'coin', 2000}}, offer = {type = 'give-item', item = 'vehicle-machine-gun', count = 3}}, {price = {{'coin', 2000}}, offer = {type = 'give-item', item = 'substation', count = 6}}, - {price = {{'coin', 2000}}, offer = {type = 'give-item', item = 'modular-armor', count = 1}}, + {price = {{'coin', 3000}}, offer = {type = 'give-item', item = 'modular-armor', count = 1}}, {price = {{'coin', 2000}}, offer = {type = 'give-item', item = 'distractor-capsule', count = 20}}, {price = {{'coin', 2000}}, offer = {type = 'give-item', item = 'poison-capsule', count = 20}}, {price = {{'coin', 2000}}, offer = {type = 'give-item', item = 'slowdown-capsule', count = 20}}, diff --git a/maps/pirates/shop/shop.lua b/maps/pirates/shop/shop.lua index 05d3e983..fe8daafd 100644 --- a/maps/pirates/shop/shop.lua +++ b/maps/pirates/shop/shop.lua @@ -53,7 +53,8 @@ function Public.event_on_market_item_purchased(event) local island_bool = destination.type == SurfacesCommon.enum.ISLAND local purchase_bool = (price and price[1] and price[1].name and (price[1].name == 'coin')) local simple_efficiency_trade_bool = (price and price[1] and price[1].name and (price[1].name == 'pistol' or price[1].name == 'burner-mining-drill')) - 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')) + 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 decay_type = 'one-off' diff --git a/maps/pirates/structures/boats/boats.lua b/maps/pirates/structures/boats/boats.lua index 5f64d204..00fa1170 100644 --- a/maps/pirates/structures/boats/boats.lua +++ b/maps/pirates/structures/boats/boats.lua @@ -872,15 +872,16 @@ function Public.teleport_boat(boat, newsurface_name, newposition, new_floor_tile -- log(inspect{'hi', name, e.position}) -- end - if name == 'character' then + if name == 'character' and e.player then -- associated player required to teleport it across surfaces if oldsurface_name == newsurface_name then e.teleport(vector.x, vector.y) else local p = {e.position.x + vector.x, e.position.y + vector.y} - e.player.teleport(newsurface.find_non_colliding_position('character', p, 1.2, 0.2) or p, newsurface) + if e.player then --e.player being nil caused a bug once! + e.player.teleport(newsurface.find_non_colliding_position('character', p, 1.2, 0.2) or p, newsurface) + end end - elseif Utils.contains(CoreData.unteleportable_names, name) or (name == 'entity-ghost' and Utils.contains(CoreData.unteleportable_names, e.ghost_name)) then local p = e.position @@ -950,12 +951,12 @@ function Public.teleport_boat(boat, newsurface_name, newposition, new_floor_tile if Utils.contains(CoreData.water_tile_names, t.name) then watercount = watercount + 1 end end if watercount > 5 then - local name = char.player.name + local name2 = char.player and char.player.name or 'unknown-character' char.die(char.force) local force = memory.force if not (force and force.valid) then return end - Common.notify_force(force,string.format('%s was pushed into water by a cannon.', name), {r = 0.98, g = 0.66, b = 0.22}) + Common.notify_force(force,string.format('%s was pushed into water by a cannon.', name2), {r = 0.98, g = 0.66, b = 0.22}) end end end @@ -1039,6 +1040,11 @@ function Public.teleport_boat(boat, newsurface_name, newposition, new_floor_tile local ee = e.clone{position = p2, surface = newsurface, create_build_effect_smoke = false} e.destroy() + -- Right now in the game we don't expect any non-player characters, so let's kill them to make a point: + if ee and ee.valid and ee.name and ee.name == 'character' and (not ee.player) then + ee.die() + end + if ee and ee.valid and ee.name then if ee.name == 'blue-chest' then if p2.y < newposition.y then diff --git a/maps/pirates/structures/island_structures/mattisso/data.lua b/maps/pirates/structures/island_structures/mattisso/data.lua index b32b4608..a3c55272 100644 --- a/maps/pirates/structures/island_structures/mattisso/data.lua +++ b/maps/pirates/structures/island_structures/mattisso/data.lua @@ -198,7 +198,7 @@ Public.small_oilrig_base = { type = 'entities', name = 'pumpjack', force = 'ancient-friendly', - offset = {x = 0, y = 0}, + offset = {x = -0.5, y = 0}, instances = {{position = {x = 3, y = -4}, direction = defines.direction.south}, {position = {x = -6, y = 1}, direction = defines.direction.south}, {position = {x = 6, y = 4}, direction = defines.direction.north}} }, }, diff --git a/maps/pirates/surfaces/dock.lua b/maps/pirates/surfaces/dock.lua index 090955dc..bd6ba7cc 100644 --- a/maps/pirates/surfaces/dock.lua +++ b/maps/pirates/surfaces/dock.lua @@ -36,7 +36,7 @@ Public.Data.static_params_default = { Public.PurchaseableBoats = { [Boats.enum.SLOOP] = { type = Boats.enum.SLOOP, - position = Utils.snap_coordinates_for_rails({x = -24 - Boats[Boats.enum.SLOOP].Data.leftmost_gate_position, y = Public.Data.static_boat_bottom - Boats[Boats.enum.SLOOP].Data.height/2}), + position = Utils.snap_coordinates_for_rails({x = -23 - Boats[Boats.enum.SLOOP].Data.leftmost_gate_position, y = Public.Data.static_boat_bottom - Boats[Boats.enum.SLOOP].Data.height/2}), }, -- [Boats.enum.CUTTER] = { -- type = Boats.enum.CUTTER, diff --git a/maps/pirates/surfaces/islands/standard/data.lua b/maps/pirates/surfaces/islands/standard/data.lua index 2eaeb041..fbe86f7d 100644 --- a/maps/pirates/surfaces/islands/standard/data.lua +++ b/maps/pirates/surfaces/islands/standard/data.lua @@ -21,8 +21,8 @@ Public.static_params_default = { function Public.base_ores() return { - ['copper-ore'] = 1.2, - ['iron-ore'] = 5.6, + ['copper-ore'] = 1.1, + ['iron-ore'] = 5.7, ['coal'] = 4.4, ['stone'] = 0.6, } diff --git a/maps/pirates/surfaces/islands/standard/standard.lua b/maps/pirates/surfaces/islands/standard/standard.lua index b4ea2d6f..449d5676 100644 --- a/maps/pirates/surfaces/islands/standard/standard.lua +++ b/maps/pirates/surfaces/islands/standard/standard.lua @@ -62,7 +62,7 @@ function Public.terrain(args) if noises.height(p) > 0.06 then if noises.forest_abs_suppressed(p) > 0.5 then - if (not args.iconized_generation) and noises.forest_abs_suppressed(p) < 0.75 and Math.random(2500) == 1 then + if (not args.iconized_generation) and noises.forest_abs_suppressed(p) < 0.75 and Math.random(2000) == 1 then args.specials[#args.specials + 1] = {name = 'chest', position = args.p} else local forest_noise = noises.forest(p) @@ -103,7 +103,7 @@ function Public.terrain(args) if noises.height(p) > 0.18 and noises.mood(p) > 0.6 then if noises.forest_abs(p) < 0.2 and noises.rock_abs(p) > 1.5 then - args.entities[#args.entities + 1] = {name = 'coal', position = args.p, amount = 8} + args.entities[#args.entities + 1] = {name = 'coal', position = args.p, amount = 7} end end end diff --git a/maps/pirates/surfaces/islands/standard_variant/data.lua b/maps/pirates/surfaces/islands/standard_variant/data.lua index c4fc084b..28be26e8 100644 --- a/maps/pirates/surfaces/islands/standard_variant/data.lua +++ b/maps/pirates/surfaces/islands/standard_variant/data.lua @@ -21,8 +21,8 @@ Public.static_params_default = { function Public.base_ores() return { - ['copper-ore'] = 3.9, - ['iron-ore'] = 3.9, + ['copper-ore'] = 3.8, + ['iron-ore'] = 4.0, ['coal'] = 4.5, ['stone'] = 1.6, } diff --git a/maps/pirates/surfaces/islands/standard_variant/standard_variant.lua b/maps/pirates/surfaces/islands/standard_variant/standard_variant.lua index 10878ec1..d43a3dd5 100644 --- a/maps/pirates/surfaces/islands/standard_variant/standard_variant.lua +++ b/maps/pirates/surfaces/islands/standard_variant/standard_variant.lua @@ -107,7 +107,7 @@ function Public.terrain(args) if noises.height(p) > 0.18 and noises.mood(p) > 0.3 then if noises.forest_abs(p) < 0.2 and noises.rock_abs(p) > 1.5 then - args.entities[#args.entities + 1] = {name = 'coal', position = args.p, amount = 8} + args.entities[#args.entities + 1] = {name = 'coal', position = args.p, amount = 7} end end end diff --git a/maps/pirates/tick_functions.lua b/maps/pirates/tick_functions.lua index daa7ecab..42129a06 100644 --- a/maps/pirates/tick_functions.lua +++ b/maps/pirates/tick_functions.lua @@ -226,7 +226,7 @@ function Public.prune_offline_characters_list(tickinterval) --game.print("deleting already online character from list") memory.temporarily_logged_off_characters[player_index] = nil else - if player_index and tick < game.tick - 60 * Common.logged_off_items_preserved_seconds then + if player_index and tick < game.tick - 60 * 60 * Common.logged_off_items_preserved_minutes then local player_inv = {} player_inv[1] = game.players[player_index].get_inventory(defines.inventory.character_main) player_inv[2] = game.players[player_index].get_inventory(defines.inventory.character_armor) diff --git a/maps/pirates/tick_functions_classes.lua b/maps/pirates/tick_functions_classes.lua index 4debc5fa..94bb9f13 100644 --- a/maps/pirates/tick_functions_classes.lua +++ b/maps/pirates/tick_functions_classes.lua @@ -214,7 +214,7 @@ function Public.class_rewards_tick(tickinterval) local nearby_players = #player.surface.find_entities_filtered{position = player.position, radius = Common.quartermaster_range, name = 'character'} if nearby_players > 1 then - Classes.class_ore_grant(player, nearby_players - 1) + Classes.class_ore_grant(player, nearby_players - 1, true) end end end