From d2ecd38764c6ff560df79d6e6f0488067998b831 Mon Sep 17 00:00:00 2001 From: danielmartin0 Date: Sun, 13 Mar 2022 01:44:32 +0000 Subject: [PATCH] v1.1.0.2 --- maps/pirates/balance.lua | 28 ++-- maps/pirates/commands.lua | 4 +- maps/pirates/common.lua | 20 +-- maps/pirates/coredata.lua | 4 +- maps/pirates/custom_events.lua | 13 ++ maps/pirates/gui/color.lua | 6 +- maps/pirates/gui/common.lua | 2 + maps/pirates/gui/crew.lua | 6 +- maps/pirates/gui/evo.lua | 26 ++-- maps/pirates/gui/{shop.lua => fuel.lua} | 40 +++--- maps/pirates/gui/gui.lua | 134 ++++++++++++------ maps/pirates/gui/info.lua | 8 +- maps/pirates/gui/minimap.lua | 6 +- maps/pirates/gui/progress.lua | 100 ++++++------- maps/pirates/gui/runs.lua | 6 +- maps/pirates/interface.lua | 21 ++- maps/pirates/loot.lua | 18 +-- maps/pirates/main.lua | 8 +- maps/pirates/memory.lua | 6 +- maps/pirates/ores.lua | 12 +- maps/pirates/overworld.lua | 13 +- maps/pirates/player_colors.lua | 3 +- maps/pirates/progression.lua | 15 +- maps/pirates/quest.lua | 6 +- maps/pirates/roles/classes.lua | 6 +- maps/pirates/shop/captains.lua | 4 + maps/pirates/shop/dock.lua | 8 +- maps/pirates/shop/shop.lua | 2 +- maps/pirates/structures/boats/boats.lua | 1 - .../structures/island_structures/roc/data.lua | 12 +- maps/pirates/surfaces/cabin.lua | 4 +- maps/pirates/surfaces/crowsnest.lua | 3 + maps/pirates/surfaces/dock.lua | 3 + maps/pirates/surfaces/hold.lua | 1 - maps/pirates/surfaces/islands/maze/data.lua | 2 +- maps/pirates/surfaces/islands/maze/maze.lua | 4 +- .../surfaces/islands/standard/data.lua | 2 +- .../islands/standard_variant/data.lua | 6 +- maps/pirates/surfaces/islands/swamp/data.lua | 6 +- maps/pirates/surfaces/surfaces.lua | 2 + maps/pirates/tick_functions.lua | 45 +++--- maps/pirates/tick_functions_classes.lua | 2 +- 42 files changed, 380 insertions(+), 238 deletions(-) create mode 100644 maps/pirates/custom_events.lua rename maps/pirates/gui/{shop.lua => fuel.lua} (94%) diff --git a/maps/pirates/balance.lua b/maps/pirates/balance.lua index 931531f3..43bfaf6c 100644 --- a/maps/pirates/balance.lua +++ b/maps/pirates/balance.lua @@ -23,7 +23,7 @@ function Public.starting_boatEEIelectric_buffer_size_MJ() --maybe needs to be at return 3/2 end Public.EEI_stages = { --multipliers - 1,2,5,8,12 + 1,2,4,7,11 } @@ -40,7 +40,7 @@ Public.rocket_launch_coin_reward = 5000 function Public.crew_scale() local ret = Common.activecrewcount()/10 if ret == 0 then ret = 1/10 end --if all players are afk - if ret > 3 then ret = 3 end --cap + if ret > 2.4 then ret = 2.4 end --we have to cap this because you need time to mine the ore... and big crews are a mess anyway. currently this value matches the 24 player cap return ret end @@ -109,7 +109,7 @@ function Public.fuel_depletion_rate_static() local rate if Common.overworldx() > 0 then - rate = 560 * (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 = 570 * (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 @@ -159,7 +159,14 @@ end function Public.base_evolution() + local slope = 0.0201 local evo = (0.0201 * (Common.overworldx()/40)) * Math.sloped(Common.difficulty(), 1/5) + if Common.overworldx() > 600 then + evo = evo + (0.005 * (Math.min(Common.overworldx()/40,25) - 600)) * Math.sloped(Common.difficulty(), 1/5) + end + if Common.overworldx() > 1000 then --undo this ramp: + evo = evo + (-0.005 * (Math.min(Common.overworldx()/40,25) - 1000)) * Math.sloped(Common.difficulty(), 1/5) + end if Common.overworldx()/40 == 0 then evo = 0 end return evo end @@ -221,10 +228,10 @@ function Public.evolution_per_full_silo_charge() end function Public.bonus_damage_to_humans() - local ret = 0.125 + local ret = 0.050 local diff = Common.difficulty() - if diff <= 0.7 then ret = 0.1 end - if diff >= 1.3 then ret = 0.15 end + if diff <= 0.7 then ret = 0.025 end + if diff >= 1.3 then ret = 0.075 end return ret end @@ -271,8 +278,13 @@ function Public.quest_reward_multiplier() end function Public.island_richness_avg_multiplier() - return 0.7 + 0.1 * (Common.overworldx()/40)^(7/10) -end --tuned tbh + local ret + local base = 0.7 + 0.1 * (Common.overworldx()/40)^(7/10) --tuned tbh + + ret = base * Math.sloped(Public.crew_scale(), 1/20) --we don't really have resources scaling by player count in this resource-constrained scenario, but we scale a little, to accommodate each player filling their inventory with useful tools. also, I would do 1/14, but we go even slightly lower because we're applying this somewhat sooner than players actually get there. + + return ret +end function Public.resource_quest_multiplier() return (1.0 + 0.075 * (Common.overworldx()/40)^(8/10)) * Math.sloped(Common.difficulty(), 1/3) * (Public.crew_scale())^(1/8) diff --git a/maps/pirates/commands.lua b/maps/pirates/commands.lua index 914bd11c..9c74b175 100644 --- a/maps/pirates/commands.lua +++ b/maps/pirates/commands.lua @@ -31,6 +31,7 @@ local simplex_noise = require 'utils.simplex_noise'.d2 local Token = require 'utils.token' local Task = require 'utils.task' local Highscore = require 'maps.pirates.highscore' +local CustomEvents = require 'maps.pirates.custom_events' local GUIcolor = require 'maps.pirates.gui.color' @@ -101,7 +102,7 @@ function(cmd) if not rgb then return end player.color = rgb player.chat_color = rgb - local message = '[color=' .. rgb.r .. ',' .. rgb.g .. ',' .. rgb.b .. ']' .. player.name .. '\'s color became ' .. color .. '[/color] (via /ccolor).' + local message = '[color=' .. rgb.r .. ',' .. rgb.g .. ',' .. rgb.b .. ']' .. player.name .. '\'s color randomly became ' .. color .. '[/color] (via /ccolor).' Common.notify_game(message) -- disabled due to lag: -- GUIcolor.toggle_window(player) @@ -135,6 +136,7 @@ local go_1 = Token.register( Overworld.ensure_lane_generated_up_to(24, Crowsnest.Data.visibilitywidth/2) Overworld.ensure_lane_generated_up_to(-24, Crowsnest.Data.visibilitywidth/2) memory.currentdestination_index = 1 + script.raise_event(CustomEvents.enum['update_crew_progress_gui'], {}) Surfaces.create_surface(Common.current_destination()) Task.set_timeout_in_ticks(60, go_2, {}) end diff --git a/maps/pirates/common.lua b/maps/pirates/common.lua index 3bb5e8fc..289e9d42 100644 --- a/maps/pirates/common.lua +++ b/maps/pirates/common.lua @@ -1034,14 +1034,14 @@ end function Public.validate_player(player) - local ret = false if player and player.valid and player.connected and game.players[player.name] then - ret = true + return true + else + if _DEBUG then + log('player validation fail: ' .. (player.name or 'noname')) + end + return false end - if not ret and _DEBUG then - log('player validation fail: ' .. (player.name or 'noname')) - end - return ret end @@ -1125,9 +1125,11 @@ function Public.give_items_to_crew(items) Public.notify_force(force, 'Warning: captain\'s cabin chests are full!') end else - log('give_items_to_crew: i2.name is nil. inspect:') - log(inspect(items)) - log(inspect(i2)) + if _DEBUG then + log('give_items_to_crew: i2.name is nil. inspect:') + log(inspect(items)) + log(inspect(i2)) + end end end else diff --git a/maps/pirates/coredata.lua b/maps/pirates/coredata.lua index 0719f94f..de719227 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.1.0.0' -Public.version_float = 1.1 +Public.version_string = '1.1.0.2' +Public.version_float = 1.102 Public.blueprint_library_allowed = true Public.blueprint_importing_allowed = true diff --git a/maps/pirates/custom_events.lua b/maps/pirates/custom_events.lua new file mode 100644 index 00000000..bd3f272d --- /dev/null +++ b/maps/pirates/custom_events.lua @@ -0,0 +1,13 @@ + +local Event = require 'utils.event' + +local Public = {} + +-- gotta finish reformulating the gui updates in terms of events: +local enum = { + update_crew_progress_gui = Event.generate_event_name('update_crew_progress_gui'), + update_crew_fuel_gui = Event.generate_event_name('update_crew_fuel_gui'), +} +Public.enum = enum + +return Public \ No newline at end of file diff --git a/maps/pirates/gui/color.lua b/maps/pirates/gui/color.lua index aec3eced..b441158e 100644 --- a/maps/pirates/gui/color.lua +++ b/maps/pirates/gui/color.lua @@ -45,7 +45,11 @@ end -function Public.update(player) +function Public.regular_update(player) + +end + +function Public.full_update(player) end diff --git a/maps/pirates/gui/common.lua b/maps/pirates/gui/common.lua index 6d5d0f48..9b317bc4 100644 --- a/maps/pirates/gui/common.lua +++ b/maps/pirates/gui/common.lua @@ -113,6 +113,8 @@ function Public.flow_add_floating_sprite_button(flow1, button_name, width) end + + function Public.flow_add_floating_button(flow1, button_name) local flow2, flow3 diff --git a/maps/pirates/gui/crew.lua b/maps/pirates/gui/crew.lua index 8ede812d..c8f588cf 100644 --- a/maps/pirates/gui/crew.lua +++ b/maps/pirates/gui/crew.lua @@ -351,7 +351,11 @@ end -function Public.update(player) +function Public.regular_update(player) + +end + +function Public.full_update(player) if not player.gui.screen[window_name .. '_piratewindow'] then return end local flow = player.gui.screen[window_name .. '_piratewindow'] diff --git a/maps/pirates/gui/evo.lua b/maps/pirates/gui/evo.lua index 0bf439f5..43a9ee3c 100644 --- a/maps/pirates/gui/evo.lua +++ b/maps/pirates/gui/evo.lua @@ -43,7 +43,13 @@ local GuiCommon = require 'maps.pirates.gui.common' -- return last_match -- end -function Public.update(player) + + +function Public.regular_update(player) + +end + +function Public.full_update(player) local memory = Memory.get_crew_memory() local pirates_flow = player.gui.top @@ -60,10 +66,10 @@ function Public.update(player) -- else local destination = Common.current_destination() - local evolution_base - local evolution_time - local evolution_silo - local evolution_nests + local evolution_base = 0 + local evolution_time = 0 + local evolution_silo = 0 + local evolution_nests = 0 if memory.boat and memory.boat.state and (memory.boat.state == Boats.enum_state.ATSEA_SAILING or memory.boat.state == Boats.enum_state.ATSEA_LOADING_MAP) then evolution_base = evo - (memory.kraken_evo or 0) -- here Kraken.kraken_slots @@ -81,10 +87,12 @@ function Public.update(player) button.number = evo end else - evolution_base = (destination and destination.dynamic_data and destination.dynamic_data.evolution_accrued_leagues) or 0 - evolution_time = (destination and destination.dynamic_data and destination.dynamic_data.evolution_accrued_time) or 0 - evolution_nests = (destination and destination.dynamic_data and destination.dynamic_data.evolution_accrued_nests) or 0 - evolution_silo = (destination and destination.dynamic_data and destination.dynamic_data.evolution_accrued_silo) or 0 + if destination and destination.dynamic_data then + evolution_base = destination.dynamic_data.evolution_accrued_leagues or 0 + evolution_time = destination.dynamic_data.evolution_accrued_time or 0 + evolution_nests = destination.dynamic_data.evolution_accrued_nests or 0 + evolution_silo = destination.dynamic_data.evolution_accrued_silo or 0 + end button.tooltip = string.format('Local biter evolution\n\nLeagues: %.2f\nTime: %.2f\nNests: %.2f\nSilo: %.2f\nTotal: %.2f', evolution_base, evolution_time, evolution_nests, evolution_silo, evo) button.number = evo end diff --git a/maps/pirates/gui/shop.lua b/maps/pirates/gui/fuel.lua similarity index 94% rename from maps/pirates/gui/shop.lua rename to maps/pirates/gui/fuel.lua index b22a3a3c..401f975d 100644 --- a/maps/pirates/gui/shop.lua +++ b/maps/pirates/gui/fuel.lua @@ -67,10 +67,31 @@ function Public.toggle_window(player) end +function Public.regular_update(player) + local flow, flow2, flow3, flow4, flow5, flow6 + + local memory = Memory.get_crew_memory() + + if not player.gui.screen[window_name .. '_piratewindow'] then return end + flow = player.gui.screen[window_name .. '_piratewindow'] + + if Roles.player_privilege_level(player) >= Roles.privilege_levels.OFFICER then + flow.close_button_flow.hflow.tospend.visible = true + + local inv = player.get_inventory(defines.inventory.character_main) + if inv and inv.valid then + local coin_amount = inv.get_item_count('coin') or 0 + + flow.close_button_flow.hflow.tospend.number = coin_amount + flow.close_button_flow.hflow.tospend.tooltip = string.format("You're holding " .. Utils.bignumber_abbrevform2(coin_amount) .. " doubloons.") + end + else + flow.close_button_flow.hflow.tospend.visible = false + end +end - -function Public.update(player) +function Public.full_update(player) local flow, flow2, flow3, flow4, flow5, flow6 local memory = Memory.get_crew_memory() @@ -94,20 +115,6 @@ function Public.update(player) -- flow.close_button_flow.hflow.tospend.tooltip = string.format('The crew has %01d stored coal.', 0) -- end - if Roles.player_privilege_level(player) >= Roles.privilege_levels.OFFICER then - flow.close_button_flow.hflow.tospend.visible = true - - local inv = player.get_inventory(defines.inventory.character_main) - if inv and inv.valid then - local coin_amount = inv.get_item_count('coin') or 0 - - flow.close_button_flow.hflow.tospend.number = coin_amount - flow.close_button_flow.hflow.tospend.tooltip = string.format("You're holding " .. Utils.bignumber_abbrevform2(coin_amount) .. " doubloons.") - end - else - flow.close_button_flow.hflow.tospend.visible = false - end - if memory.crewstatus == Crew.enum.ADVENTURING then @@ -159,7 +166,6 @@ function Public.update(player) end end - end diff --git a/maps/pirates/gui/gui.lua b/maps/pirates/gui/gui.lua index 8bf6965e..d6e97748 100644 --- a/maps/pirates/gui/gui.lua +++ b/maps/pirates/gui/gui.lua @@ -8,7 +8,7 @@ local GuiEvo = require 'maps.pirates.gui.evo' local GuiProgress = require 'maps.pirates.gui.progress' local GuiRuns = require 'maps.pirates.gui.runs' local GuiCrew = require 'maps.pirates.gui.crew' -local GuiShop = require 'maps.pirates.gui.shop' +local GuiFuel = require 'maps.pirates.gui.fuel' local GuiMinimap = require 'maps.pirates.gui.minimap' local GuiInfo = require 'maps.pirates.gui.info' local Quest = require 'maps.pirates.quest' @@ -22,21 +22,49 @@ local Crowsnest = require 'maps.pirates.surfaces.crowsnest' local Progression = require 'maps.pirates.progression' local Surfaces = require 'maps.pirates.surfaces.surfaces' local Roles = require 'maps.pirates.roles.roles' +local Event = require 'utils.event' +local CustomEvents = require 'maps.pirates.custom_events' local ComfyPanel = require 'comfy_panel.main' local Public = {} +local enum = { + PROGRESS = 'progress', + RUNS = 'runs', + CREW = 'crew', + FUEL = 'fuel', + MINIMAP = 'minimap', + INFO = 'info', + COLOR = 'color', +} +Public.enum = enum Public.progress = require 'maps.pirates.gui.progress' Public.runs = require 'maps.pirates.gui.runs' Public.crew = require 'maps.pirates.gui.crew' -Public.fuel = require 'maps.pirates.gui.shop' +Public.fuel = require 'maps.pirates.gui.fuel' Public.minimap = require 'maps.pirates.gui.minimap' Public.info = require 'maps.pirates.gui.info' Public.color = require 'maps.pirates.gui.color' +function Public.update_crew_gui(which_gui) + local players = Common.crew_get_crew_members_and_spectators() + for _, player in pairs(players) do + Public[which_gui].full_update(player) + end +end + +function Public.update_crew_progress_gui() + return Public.update_crew_gui('progress') +end +Event.add(CustomEvents.enum['update_crew_progress_gui'], Public.update_crew_progress_gui) +-- script.raise_event(CustomEvents.enum['update_crew_progress_gui'], {}) +function Public.update_crew_fuel_gui() + return Public.update_crew_gui('fuel') +end +Event.add(CustomEvents.enum['update_crew_fuel_gui'], Public.update_crew_fuel_gui) local function create_gui(player) @@ -362,7 +390,6 @@ local function create_gui(player) type = 'label', }) flow3.style.font = 'default-large-semibold' - flow3.style.font_color = GuiCommon.bold_font_color flow3.style.right_margin = 2 flow3 = flow2.add({ @@ -479,13 +506,13 @@ function Public.update_gui(player) end end - GuiEvo.update(player) - GuiProgress.update(player) - GuiRuns.update(player) - GuiCrew.update(player) - GuiShop.update(player) - GuiMinimap.update(player) - GuiInfo.update(player) + GuiEvo.regular_update(player) + GuiProgress.regular_update(player) --moved to event + GuiRuns.regular_update(player) + GuiCrew.regular_update(player) + GuiFuel.regular_update(player) + GuiMinimap.regular_update(player) + GuiInfo.regular_update(player) -- local lives = memory.lives or 1 -- local button = pirates_flow.lives_piratebutton_frame.lives_piratebutton @@ -500,9 +527,9 @@ function Public.update_gui(player) -- button.number = 3 -- end - pirates_flow.fuel_piratebutton_flow_1.fuel_piratebutton_flow_2.fuel_label_1.caption = '[item=coal] ' .. Utils.bignumber_abbrevform(memory.stored_fuel or 0) - pirates_flow.fuel_piratebutton_flow_1.fuel_piratebutton_flow_2.fuel_label_2.caption = Utils.negative_rate_abbrevform(Progression.fuel_depletion_rate() or 0) - local color_scale = Math.max(Math.min((- (Progression.fuel_depletion_rate() or 0))/50, 1),0) + pirates_flow.fuel_piratebutton_flow_1.fuel_piratebutton_flow_2.fuel_label_1.caption = 'Fuel: ' .. Utils.bignumber_abbrevform(memory.stored_fuel or 0) .. '[item=coal]' + pirates_flow.fuel_piratebutton_flow_1.fuel_piratebutton_flow_2.fuel_label_2.caption = Utils.negative_rate_abbrevform(memory.fuel_depletion_rate_memoized or 0) + local color_scale = Math.max(Math.min((- (memory.fuel_depletion_rate_memoized or 0))/50, 1),0) pirates_flow.fuel_piratebutton_flow_1.fuel_piratebutton_flow_2.fuel_label_2.style.font_color = { r = GuiCommon.fuel_color_1.r * (1-color_scale) + GuiCommon.fuel_color_2.r * color_scale, g = GuiCommon.fuel_color_1.g * (1-color_scale) + GuiCommon.fuel_color_2.g * color_scale, @@ -520,41 +547,55 @@ function Public.update_gui(player) --== State-checking bools ==-- - local in_crowsnest_bool = string.sub(player.surface.name, 9, 17) == 'Crowsnest' - local in_hold_bool = string.sub(player.surface.name, 9, 12) == 'Hold' - local in_cabin_bool = string.sub(player.surface.name, 9, 13) == 'Cabin' - local onmap_bool = destination.surface_name and (player.surface.name == destination.surface_name or (memory.boat and memory.boat.surface_name and - memory.boat.surface_name == destination.surface_name and (in_crowsnest_bool or in_hold_bool or in_cabin_bool) - )) + local in_crowsnest_bool, in_hold_bool, in_cabin_bool, onmap_bool, eta_bool, retreating_bool, approaching_bool, atsea_sailing_bool, landed_bool, quest_bool, silo_bool, charged_bool, launched_bool, captain_bool, atsea_loading_bool, character_on_deck_bool, on_deck_standing_near_loco_bool, on_deck_standing_near_cabin_bool, on_deck_standing_near_crowsnest_bool, cost_bool, cost_includes_rocket_launch, approaching_dock_bool, leaving_dock_bool, leave_anytime_bool - local eta_bool = destination.dynamic_data.time_remaining and destination.dynamic_data.time_remaining > 0 and onmap_bool - local retreating_bool = memory.boat and memory.boat.state and memory.boat.state == Boats.enum_state.RETREATING and onmap_bool - local approaching_bool = memory.boat and memory.boat.state and memory.boat.state == Boats.enum_state.APPROACHING - local atsea_sailing_bool = memory.boat and memory.boat.state and memory.boat.state == Boats.enum_state.ATSEA_SAILING - local landed_bool = memory.boat and memory.boat.state and memory.boat.state == Boats.enum_state.LANDED - local quest_bool = (destination.dynamic_data.quest_type ~= nil) and onmap_bool - local silo_bool = destination.dynamic_data.rocketsilos and destination.dynamic_data.rocketsilos[1] and destination.dynamic_data.rocketsilos[1].valid and onmap_bool - local charged_bool = destination.dynamic_data.silocharged - local launched_bool = destination.dynamic_data.rocketlaunched + captain_bool = Common.is_captain(player) - local captain_bool = Common.is_captain(player) + in_crowsnest_bool = string.sub(player.surface.name, 9, 17) == 'Crowsnest' + in_hold_bool = string.sub(player.surface.name, 9, 12) == 'Hold' + in_cabin_bool = string.sub(player.surface.name, 9, 13) == 'Cabin' - local atsea_loading_bool = memory.boat and memory.boat.state and memory.boat.state == Boats.enum_state.ATSEA_LOADING_MAP and memory.loadingticks + if destination and destination.dynamic_data then + eta_bool = destination.dynamic_data.time_remaining and destination.dynamic_data.time_remaining > 0 and onmap_bool + retreating_bool = memory.boat and memory.boat.state and memory.boat.state == Boats.enum_state.RETREATING and onmap_bool + approaching_bool = memory.boat and memory.boat.state and memory.boat.state == Boats.enum_state.APPROACHING + atsea_sailing_bool = memory.boat and memory.boat.state and memory.boat.state == Boats.enum_state.ATSEA_SAILING + landed_bool = memory.boat and memory.boat.state and memory.boat.state == Boats.enum_state.LANDED + quest_bool = (destination.dynamic_data.quest_type ~= nil) and onmap_bool + silo_bool = destination.dynamic_data.rocketsilos and destination.dynamic_data.rocketsilos[1] and destination.dynamic_data.rocketsilos[1].valid and onmap_bool + charged_bool = destination.dynamic_data.silocharged + launched_bool = destination.dynamic_data.rocketlaunched - local character_on_deck_bool = player.character and player.character.position and memory.boat and memory.boat.position and memory.boat.surface_name and player.surface.name and player.surface.name == memory.boat.surface_name + cost_bool = destination.static_params.cost_to_leave and (not atsea_sailing_bool) and (not retreating_bool) + cost_includes_rocket_launch = cost_bool and destination.static_params.cost_to_leave['launch_rocket'] + + leave_anytime_bool = (landed_bool and not (eta_bool or cost_bool)) + end - local on_deck_standing_near_loco_bool = character_on_deck_bool and Boats.get_scope(memory.boat) and Math.distance(player.character.position, Math.vector_sum(memory.boat.position, Boats.get_scope(memory.boat).Data.loco_pos)) < 3 - local on_deck_standing_near_cabin_bool = character_on_deck_bool and Boats.get_scope(memory.boat) and Math.distance(player.character.position, Math.vector_sum(memory.boat.position, Boats.get_scope(memory.boat).Data.cabin_car)) < 2.5 - local on_deck_standing_near_crowsnest_bool = character_on_deck_bool and Boats.get_scope(memory.boat) and Math.distance(player.character.position, Math.vector_sum(memory.boat.position, Boats.get_scope(memory.boat).Data.crowsnest_center)) < 2.7 + if memory.boat then + onmap_bool = destination.surface_name and (player.surface.name == destination.surface_name or ( + memory.boat.surface_name == destination.surface_name and (in_crowsnest_bool or in_hold_bool or in_cabin_bool) + )) - local cost_bool = destination.static_params.cost_to_leave and (not atsea_sailing_bool) and (not retreating_bool) - local cost_includes_rocket_launch = cost_bool and destination.static_params.cost_to_leave['launch_rocket'] + atsea_loading_bool = memory.boat.state == Boats.enum_state.ATSEA_LOADING_MAP and memory.loadingticks - local approaching_dock_bool = destination.type == Surfaces.enum.DOCK and memory.boat.state == Boats.enum_state.APPROACHING - local leaving_dock_bool = destination.type == Surfaces.enum.DOCK and memory.boat.state == Boats.enum_state.LEAVING_DOCK + character_on_deck_bool = player.character and player.character.position and player.surface.name and player.surface.name == memory.boat.surface_name - local leave_anytime_bool = (landed_bool and not (eta_bool or cost_bool)) + if character_on_deck_bool then + local BoatData = Boats.get_scope(memory.boat).Data + + on_deck_standing_near_loco_bool = Math.distance(player.character.position, Math.vector_sum(memory.boat.position, BoatData.loco_pos)) < 3 + + on_deck_standing_near_cabin_bool = Math.distance(player.character.position, Math.vector_sum(memory.boat.position, BoatData.cabin_car)) < 2.5 + + on_deck_standing_near_crowsnest_bool = Math.distance(player.character.position, Math.vector_sum(memory.boat.position, BoatData.crowsnest_center)) < 2.7 + end + + + approaching_dock_bool = destination.type == Surfaces.enum.DOCK and memory.boat.state == Boats.enum_state.APPROACHING + leaving_dock_bool = destination.type == Surfaces.enum.DOCK and memory.boat.state == Boats.enum_state.LEAVING_DOCK + end --== Update Gui ==-- @@ -813,11 +854,11 @@ function Public.update_gui(player) flow1.silo_label_3.visible = true -- flow1.silo_label_1.caption = string.format('[achievement=there-is-no-spoon]: +%.0f[item=sulfur]', destination.dynamic_data.rocketcoalreward) - flow1.silo_label_1.caption = string.format('Launched') + flow1.silo_label_1.caption = string.format('Launched:') -- 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 = 'for ' .. Math.floor(destination.dynamic_data.rocketcoalreward/100)/10 .. 'k[item=coal], ' .. Math.floor(Balance.rocket_launch_coin_reward/100)/10 .. 'k[item=coin]' + flow1.silo_label_3.caption = 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 @@ -896,6 +937,7 @@ 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:' + flow1.quest_label_1.style.font_color = GuiCommon.achieved_font_color flow1.quest_label_2.visible = true flow1.quest_label_3.visible = false flow1.quest_label_4.visible = false @@ -903,6 +945,7 @@ function Public.update_gui(player) else if quest_progress < quest_progressneeded then flow1.quest_label_1.caption = 'Quest:' + flow1.quest_label_1.style.font_color = GuiCommon.bold_font_color flow1.quest_label_2.visible = true flow1.quest_label_3.visible = true flow1.quest_label_4.visible = true @@ -1097,15 +1140,15 @@ local function on_gui_click(event) local name = string.sub(event.element.name, 1, -14) if Public[name] then Public[name].toggle_window(player) - Public[name].update(player) + Public[name].full_update(player) end -- elseif event.element.name == 'fuel_label_1' or event.element.name == 'fuel_label_2' then -- Public.fuel.toggle_window(player) - -- Public.fuel.update(player) + -- Public.fuel.full_update(player) else GuiRuns.click(event) GuiCrew.click(event) - GuiShop.click(event) + GuiFuel.click(event) GuiMinimap.click(event) GuiInfo.click(event) end @@ -1122,6 +1165,9 @@ local function on_gui_location_changed(event) end end + + + local event = require 'utils.event' event.add(defines.events.on_gui_click, on_gui_click) event.add(defines.events.on_gui_location_changed, on_gui_location_changed) diff --git a/maps/pirates/gui/info.lua b/maps/pirates/gui/info.lua index d3c2b56e..4afb0857 100644 --- a/maps/pirates/gui/info.lua +++ b/maps/pirates/gui/info.lua @@ -206,7 +206,13 @@ function Public.click(event) end end -function Public.update(player) + + +function Public.regular_update(player) + +end + +function Public.full_update(player) if not player.gui.screen[window_name .. '_piratewindow'] then return end local flow = player.gui.screen[window_name .. '_piratewindow'] diff --git a/maps/pirates/gui/minimap.lua b/maps/pirates/gui/minimap.lua index a85410e0..dafecdf9 100644 --- a/maps/pirates/gui/minimap.lua +++ b/maps/pirates/gui/minimap.lua @@ -114,7 +114,11 @@ end -function Public.update(player) +function Public.regular_update(player) + +end + +function Public.full_update(player) local flow, flow2, flow3, flow4, flow5, flow6 local memory = Memory.get_crew_memory() diff --git a/maps/pirates/gui/progress.lua b/maps/pirates/gui/progress.lua index 8384538f..98ee9f4b 100644 --- a/maps/pirates/gui/progress.lua +++ b/maps/pirates/gui/progress.lua @@ -48,22 +48,22 @@ function Public.toggle_window(player) -- flow3.style.maximal_width = 160 -- flow3.style.font = 'default-dropdown' - flow3 = flow2.add({type = 'label', name = 'hidden_ores_yes', caption = 'Ores detected:'}) + -- flow3 = flow2.add({type = 'label', name = 'hidden_ores_yes', caption = 'Ores detected:'}) - flow3 = flow2.add({type = 'table', name = 'hidden_ores_yes_table', column_count = 3}) - flow3.style.left_margin = 5 - flow3.style.bottom_margin = 4 + -- flow3 = flow2.add({type = 'table', name = 'hidden_ores_yes_table', column_count = 3}) + -- flow3.style.left_margin = 5 + -- flow3.style.bottom_margin = 4 - for _, ore in ipairs(CoreData.ore_types) do - flow3.add({type = 'sprite-button', name = ore.name, sprite = ore.sprite_name, enabled = false, number = 0}) - end + -- for _, ore in ipairs(CoreData.ore_types) do + -- flow3.add({type = 'sprite-button', name = ore.name, sprite = ore.sprite_name, enabled = false, number = 0}) + -- end - flow3 = flow2.add({type = 'label', name = 'hidden_ores_no', caption = 'Ores detected: None'}) + -- flow3 = flow2.add({type = 'label', name = 'hidden_ores_no', caption = 'Ores detected: None'}) - -- flow3 = flow2.add({type = 'label', name = 'daynight', caption = ''}) + -- -- flow3 = flow2.add({type = 'label', name = 'daynight', caption = ''}) - flow3 = flow2.add({type = 'label', name = 'patch_size', caption = ''}) - flow3.style.top_margin = -3 + -- flow3 = flow2.add({type = 'label', name = 'patch_size', caption = ''}) + -- flow3.style.top_margin = -3 flow3 = flow2.add({type = 'label', name = 'daynight', caption = ''}) flow3.style.top_margin = -3 @@ -83,7 +83,11 @@ function Public.toggle_window(player) end -function Public.update(player) +function Public.regular_update(player) + +end + +function Public.full_update(player) if not player.gui.screen[window_name .. '_piratewindow'] then return end local flow = player.gui.screen[window_name .. '_piratewindow'] @@ -113,21 +117,21 @@ function Public.update(player) -- end -- flow.current_location.body.daynight.caption = string.format('Day/night cycle: %s', CoreData.daynightcycle_types[daynighttype].displayname) - if destination.static_params and destination.static_params.radius_squared_modifier then - local radius_squared_modifier = destination.static_params.radius_squared_modifier - flow.current_location.body.patch_size.visible = true - if radius_squared_modifier <= 0.65 then - flow.current_location.body.patch_size.caption = 'Patch sizing: ' .. 'Nano' - elseif radius_squared_modifier <= 0.85 then - flow.current_location.body.patch_size.caption = 'Patch sizing: ' .. 'Small' - elseif radius_squared_modifier <= 1.5 then - flow.current_location.body.patch_size.caption = 'Patch sizing: ' .. 'Normal' - else - flow.current_location.body.patch_size.caption = 'Patch sizing: ' .. 'Large' - end - else - flow.current_location.body.patch_size.visible = false - end + -- if destination.static_params and destination.static_params.radius_squared_modifier then + -- local radius_squared_modifier = destination.static_params.radius_squared_modifier + -- flow.current_location.body.patch_size.visible = true + -- if radius_squared_modifier <= 0.65 then + -- flow.current_location.body.patch_size.caption = 'Patch sizing: ' .. 'Nano' + -- elseif radius_squared_modifier <= 0.85 then + -- flow.current_location.body.patch_size.caption = 'Patch sizing: ' .. 'Small' + -- elseif radius_squared_modifier <= 1.5 then + -- flow.current_location.body.patch_size.caption = 'Patch sizing: ' .. 'Normal' + -- else + -- flow.current_location.body.patch_size.caption = 'Patch sizing: ' .. 'Large' + -- end + -- else + -- flow.current_location.body.patch_size.visible = false + -- end -- if destination.static_params and destination.static_params.daynightcycletype then -- flow.current_location.body.daynight.visible = true @@ -141,29 +145,29 @@ function Public.update(player) flow.current_location.body.daynight.caption = 'Time of day: ' .. CoreData.daynightcycle_types[daynightcycletype].displayname - local ores - -- if destination.static_params and destination.static_params.abstract_ore_amounts then ores = destination.static_params.abstract_ore_amounts end - if destination.dynamic_data and destination.dynamic_data.hidden_ore_remaining_abstract then ores = destination.dynamic_data.hidden_ore_remaining_abstract end + -- local ores + -- -- if destination.static_params and destination.static_params.abstract_ore_amounts then ores = destination.static_params.abstract_ore_amounts end + -- if destination.dynamic_data and destination.dynamic_data.hidden_ore_remaining_abstract then ores = destination.dynamic_data.hidden_ore_remaining_abstract end - if ores then - flow.current_location.body.hidden_ores_yes.visible = true - flow.current_location.body.hidden_ores_yes_table.visible = true - flow.current_location.body.patch_size.visible = true - flow.current_location.body.hidden_ores_no.visible = false + -- if ores then + -- flow.current_location.body.hidden_ores_yes.visible = true + -- flow.current_location.body.hidden_ores_yes_table.visible = true + -- flow.current_location.body.patch_size.visible = true + -- flow.current_location.body.hidden_ores_no.visible = false - for _, ore in ipairs(CoreData.ore_types) do - if ores[ore.name] then - flow.current_location.body.hidden_ores_yes_table[ore.name].number = Math.ceil(ores[ore.name]) - else - flow.current_location.body.hidden_ores_yes_table[ore.name].number = 0 - end - end - else - flow.current_location.body.hidden_ores_yes.visible = false - flow.current_location.body.hidden_ores_yes_table.visible = false - flow.current_location.body.patch_size.visible = false - flow.current_location.body.hidden_ores_no.visible = true - end + -- for _, ore in ipairs(CoreData.ore_types) do + -- if ores[ore.name] then + -- flow.current_location.body.hidden_ores_yes_table[ore.name].number = Math.ceil(ores[ore.name]) + -- else + -- flow.current_location.body.hidden_ores_yes_table[ore.name].number = 0 + -- end + -- end + -- else + -- flow.current_location.body.hidden_ores_yes.visible = false + -- flow.current_location.body.hidden_ores_yes_table.visible = false + -- flow.current_location.body.patch_size.visible = false + -- flow.current_location.body.hidden_ores_no.visible = true + -- end end diff --git a/maps/pirates/gui/runs.lua b/maps/pirates/gui/runs.lua index 2e14e98f..8646795f 100644 --- a/maps/pirates/gui/runs.lua +++ b/maps/pirates/gui/runs.lua @@ -402,8 +402,12 @@ end +function Public.regular_update(player) -function Public.update(player) +end + + +function Public.full_update(player) local global_memory = Memory.get_global_memory() local memory = Memory.get_crew_memory() diff --git a/maps/pirates/interface.lua b/maps/pirates/interface.lua index cf0080b1..32d31284 100644 --- a/maps/pirates/interface.lua +++ b/maps/pirates/interface.lua @@ -204,8 +204,8 @@ local function kraken_damage(event) if event.damage_type.name and (event.damage_type.name == 'explosion' or event.damage_type.name == 'poison') then -- if event.cause.name == 'artillery-turret' then adjusted_damage = adjusted_damage / 2.5 - elseif event.damage_type.name and (event.damage_type.name == 'fire') then - adjusted_damage = adjusted_damage / 1.1 + -- elseif event.damage_type.name and (event.damage_type.name == 'fire') then + -- adjusted_damage = adjusted_damage end -- and additionally: if event.cause.name == 'artillery-turret' then @@ -253,8 +253,8 @@ local function extra_damage_to_players(event) local inv = event.entity.get_inventory(defines.inventory.character_main) 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.8 + if count and count >= 3500 then + event.entity.health = event.entity.health + event.final_damage_amount * 0.87 end end --samurai health buff is elsewhere end @@ -781,7 +781,7 @@ local function base_kill_rewards(event) local iron_amount = 0 local coin_amount = 0 - if memory.overworldx > 0 then + if memory.overworldx >= 0 then if entity.name == 'small-worm-turret' then iron_amount = 5 coin_amount = 40 @@ -1530,19 +1530,19 @@ local remove_boost_movement_speed_on_respawn = function(data) local player = data.player local crew_id = data.crew_id - if not (player and player.valid and player.character and player.character.valid) then + if not (player and player.valid) then return end + -- their color was strobing, so now reset it to their chat color: + player.color = player.chat_color + Memory.set_working_id(crew_id) local memory = Memory.get_crew_memory() if not (memory.id and memory.id > 0) then return end --check if crew disbanded if memory.game_lost then return end memory.speed_boost_characters[player.index] = nil - -- their color was strobing, so now reset it to their chat color: - player.color = player.chat_color - Common.notify_player_expected(player, 'Respawn speed bonus removed.') end ) @@ -1556,9 +1556,6 @@ local boost_movement_speed_on_respawn = if not player or not player.valid then return end - if not player.character or not player.character.valid and player.character and player.character.valid then - return - end Memory.set_working_id(crew_id) local memory = Memory.get_crew_memory() diff --git a/maps/pirates/loot.lua b/maps/pirates/loot.lua index 8cfbf5dd..9b3bc82b 100644 --- a/maps/pirates/loot.lua +++ b/maps/pirates/loot.lua @@ -103,9 +103,9 @@ Public.chest_loot_data_raw = { {4, 0, 2, true, 'electric-furnace', 1, 3}, {3, 0.2, 1, true, 'chemical-plant', 1, 3}, - {40, -1, 0.5, true, 'speed-module', 1, 3}, - {20, 0, 1.5, true, 'speed-module-2', 1, 2}, - {10, 0, 2, true, 'speed-module-3', 1, 1}, + {50, -1, 0.5, true, 'speed-module', 1, 3}, + {25, 0, 1.5, true, 'speed-module-2', 1, 2}, + {12, 0, 2, true, 'speed-module-3', 1, 1}, {4, -1, 1, true, 'effectivity-module', 1, 3}, -- {4, 0, 1, true, 'effectivity-module-2', 1, 3}, --disabled to reduce 'avalanche of crap' effect {4, 0, 2, true, 'effectivity-module-3', 1, 1}, @@ -314,12 +314,12 @@ function Public.maze_camp_loot() end Public.maze_lab_loot_data_raw = { - {8, -0.5, 0.5, true, 'automation-science-pack', 5, 18}, - {8, -0.6, 0.6, true, 'logistic-science-pack', 5, 18}, - {6, -0.1, 1, true, 'military-science-pack', 5, 15}, - {6, -0.5, 1.5, true, 'chemical-science-pack', 4, 10}, - {6, 0, 1.5, true, 'production-science-pack', 3, 9}, - {2, 0, 2, true, 'utility-science-pack', 2, 2}, + {8, -0.5, 0.5, true, 'automation-science-pack', 5, 20}, + {8, -0.6, 0.6, true, 'logistic-science-pack', 5, 20}, + {6, -0.1, 1, true, 'military-science-pack', 5, 18}, + {6, -0.5, 1.5, true, 'chemical-science-pack', 4, 12}, + {6, 0, 1.5, true, 'production-science-pack', 3, 11}, + {2, 0, 2, true, 'utility-science-pack', 2, 3}, -- {4, 0.4, 1.5, true, 'utility-science-pack', 16, 32}, -- {10, 0.5, 1.5, true, 'space-science-pack', 16, 32}, } diff --git a/maps/pirates/main.lua b/maps/pirates/main.lua index f952927b..334b843d 100644 --- a/maps/pirates/main.lua +++ b/maps/pirates/main.lua @@ -18,6 +18,8 @@ The scenario is quite complex, but there are ways to get started, even if you do require 'modules.biter_noms_you' require 'modules.no_deconstruction_of_neutral_entities' +local CustomEvents = require 'maps.pirates.custom_events' --it might be necessary to do this before anything + local Server = require 'utils.server' local inspect = require 'utils.inspect'.inspect -- local Modifers = require 'player_modifiers' @@ -204,8 +206,8 @@ local function crew_tick() TickFunctions.update_boat_stored_resources(10) end - if tick % 15 == 0 then - TickFunctions.covered_requirement_check(15) + if tick % 10 == 0 then + TickFunctions.covered_requirement_check(10) end if tick % 30 == 0 then @@ -271,8 +273,6 @@ local function crew_tick() end end - - if tick % 240 == 0 then TickFunctions.Kraken_Destroyed_Backup_check(240) end diff --git a/maps/pirates/memory.lua b/maps/pirates/memory.lua index 47f56e4e..3488802a 100644 --- a/maps/pirates/memory.lua +++ b/maps/pirates/memory.lua @@ -40,7 +40,9 @@ end -function Public.reset_crew_memory(id) --also serves as a dev reference of memory entries +function Public.reset_crew_memory(id) --mostly serves as a dev reference of memory entries + -- but not _everything_ is stored here, it's just a guide to the most important things + pirates_global_memory.crew_memories[id] = {} local memory = pirates_global_memory.crew_memories[id] @@ -109,7 +111,7 @@ function Public.reset_crew_memory(id) --also serves as a dev reference of memory memory.floating_pollution = nil end -function Public.fallthrough_crew_memory() --could make this a metatable +function Public.fallthrough_crew_memory() --could make this a metatable, but metatables and factorio global seem not to play nicely return { id = 0, difficulty = 1, diff --git a/maps/pirates/ores.lua b/maps/pirates/ores.lua index 2c2263ff..1e35004e 100644 --- a/maps/pirates/ores.lua +++ b/maps/pirates/ores.lua @@ -7,6 +7,8 @@ local inspect = require 'utils.inspect'.inspect local Common = require 'maps.pirates.common' local Utils = require 'maps.pirates.utils_local' local simplex_noise = require 'utils.simplex_noise'.d2 +local CustomEvents = require 'maps.pirates.custom_events' + local Public = {} @@ -20,6 +22,8 @@ function Public.try_ore_spawn(surface, realp, source_name, density_bonus) local destination = Common.current_destination() local choices = destination.dynamic_data.hidden_ore_remaining_abstract + local ret = false + if choices and Utils.length(choices) > 0 then local choices_possible = {} local choices_to_prioitise = {} @@ -59,7 +63,7 @@ function Public.try_ore_spawn(surface, realp, source_name, density_bonus) if placed > 0 and not destination.dynamic_data.ore_types_spawned[choice] then destination.dynamic_data.ore_types_spawned[choice] = true end - return true + ret = true end else local real_amount = Math.max(Common.minimum_ore_placed_per_tile, Common.ore_abstract_to_real(choices[choice])) @@ -79,13 +83,15 @@ function Public.try_ore_spawn(surface, realp, source_name, density_bonus) if placed > 0 and not destination.dynamic_data.ore_types_spawned[choice] then destination.dynamic_data.ore_types_spawned[choice] = true end - return true + ret = true end end end end - return false + -- script.raise_event(CustomEvents.enum['update_crew_progress_gui'], {}) + + return ret end diff --git a/maps/pirates/overworld.lua b/maps/pirates/overworld.lua index 4993082b..82120a1f 100644 --- a/maps/pirates/overworld.lua +++ b/maps/pirates/overworld.lua @@ -28,6 +28,7 @@ local Shop = require 'maps.pirates.shop.shop' local Upgrades = require 'maps.pirates.boat_upgrades' local Kraken = require 'maps.pirates.surfaces.sea.kraken' local Highscore = require 'maps.pirates.highscore' +local CustomEvents = require 'maps.pirates.custom_events' local infront_positions = {} @@ -106,6 +107,9 @@ function Public.generate_overworld_destination(p) elseif (macrop.x > 25 and (macrop.x - 22) % 18 == 14) then --we want this to overwrite dock, so putting it here type = Surfaces.enum.ISLAND subtype = Surfaces.Island.enum.WALKWAYS + elseif macrop.x == 23 then --overwrite dock. rocket launch cost + type = Surfaces.enum.ISLAND + subtype = Surfaces.Island.enum.MAZE elseif macrop.y == -1 and (((macrop.x % 4) == 3 and macrop.x ~= 15) or macrop.x == 14) then --avoid x=15 because radioactive is there type = Surfaces.enum.DOCK elseif macrop.x == 5 then --biter boats appear. large island works well so players run off @@ -144,9 +148,6 @@ function Public.generate_overworld_destination(p) subtype = Surfaces.Island.enum.SWAMP elseif macrop.x == 22 then --game length decrease, pending more content. also kinda fun to have to steer in realtime due to double space type = nil - elseif macrop.x == 23 then --rocket launch cost - type = Surfaces.enum.ISLAND - subtype = Surfaces.Island.enum.MAZE elseif macrop.x == 24 then --rocket launch cost type = Surfaces.enum.ISLAND subtype = Surfaces.Island.enum.WALKWAYS @@ -310,9 +311,9 @@ function Public.generate_overworld_destination(p) end static_params.abstract_ore_amounts = abstract_ore_amounts - static_params.radius_squared_modifier = (1 + 1 * Math.random())^2 + static_params.radius_squared_modifier = (2 + 2 * Math.random()) - if macrop.x == 0 then static_params.radius_squared_modifier = 1 end + if macrop.x == 0 then static_params.radius_squared_modifier = 2 end static_params.discord_emoji = scope.Data.discord_emoji @@ -572,6 +573,8 @@ function Public.check_for_destination_collisions() memory.currentdestination_index = index memory.boat.state = Boats.enum_state.ATSEA_LOADING_MAP + script.raise_event(CustomEvents.enum['update_crew_progress_gui'], {}) + local destination = Common.current_destination() Surfaces.destination_on_collide(destination) diff --git a/maps/pirates/player_colors.lua b/maps/pirates/player_colors.lua index ff37d9a3..175e7225 100644 --- a/maps/pirates/player_colors.lua +++ b/maps/pirates/player_colors.lua @@ -72,7 +72,6 @@ Public.colors = { ["beige"] = {r = 0.96, g = 0.96, b = 0.86}, ["berry"] = {r = 153, g = 15, b = 75}, ["big dip o'ruby"] = {r = 0.61, g = 0.15, b = 0.26}, - ["bile"] = {r = 181, g = 195, b = 6}, ["bisque"] = {r = 1.0, g = 0.89, b = 0.77}, ["bistre"] = {r = 0.24, g = 0.17, b = 0.12}, ["bistre brown"] = {r = 0.59, g = 0.44, b = 0.09}, @@ -1271,6 +1270,6 @@ Public.colors = { ["zomp"] = {r = 0.22, g = 0.65, b = 0.56}, } -Public.bright_color_names = {"acid", "acid green", "aero", "aero blue", "alabaster", "algae", "algae green", "alice blue", "alloy orange", "almond", "amaranth", "amaranth pink", "amaranth purple", "amaranth red", "amber", "amethyst", "android green", "antique brass", "antique fuchsia", "antique white", "apple", "apple green", "apricot", "aqua", "aqua blue", "aqua green", "aqua marine", "aquamarine", "arctic lime", "artichoke", "arylide yellow", "ash gray", "asparagus", "atomic tangerine", "aureolin", "avocado green", "azul", "azure", "baby blue", "baby blue eyes", "baby green", "baby pink", "baby powder", "baby purple", "baker miller pink", "banana", "banana yellow", "barbie pink", "barney", "barney purple", "battleship grey", "beau blue", "beaver", "beige", "bile", "bisque", "bistre brown", "bitter lemon", "bitter lime", "bittersweet", "bittersweet shimmer", "black shadows", "blanched almond", "bland", "blast off bronze", "blizzard blue", "blond", "blood orange", "blue", "blue bell", "bluegrey", "blue jeans", "bluetiful", "blue violet", "blue yonder", "blurple", "blush", "blush pink", "bone", "boring green", "brick orange", "brick red", "bright aqua", "bright blue", "bright cyan", "bright green", "bright lavender", "bright light blue", "bright light green", "bright lilac", "bright lime", "bright lime green", "bright magenta", "bright maroon", "bright navy blue", "bright olive", "bright orange", "bright pink", "bright purple", "bright red", "bright sea green", "bright sky blue", "bright teal", "bright turquoise", "bright violet", "bright yellow", "brilliant rose", "brink pink", "bronze", "brown sugar", "bubblegum", "bubble gum pink", "bubblegum pink", "bud green", "buff", "burlywood", "burnished brown", "burnt orange", "burnt siena", "burnt sienna", "burnt yellow", "burple", "butter", "butterscotch", "butter yellow", "byzantine", "cadet blue", "cadet grey", "cadmium orange", "cadmium red", "cadmium yellow", "café au lait", "cambridge blue", "camel", "cameo pink", "camo", "canary", "canary yellow", "candy apple red", "candy pink", "capri", "caramel", "cardinal", "caribbean green", "carnation", "carnation pink", "carolina blue", "carrot orange", "cedar chest", "celadon", "celadon blue", "celadon green", "celery", "celeste", "celtic blue", "cement", "cerise", "cerulean", "cerulean blue", "cerulean frost", "cg blue", "cg red", "champagne", "champagne pink", "charm pink", "chartreuse", "cherry", "cherry blossom pink", "cherry red", "chili red", "china pink", "china rose", "chrome yellow", "cinereous", "cinnabar", "cinnamon", "cinnamon satin", "citrine", "citron", "clay", "clay brown", "clear blue", "cloudy blue", "cocoa brown", "cool blue", "cool green", "cool grey", "copper", "copper penny", "copper red", "copper rose", "coquelicot", "coral", "coral pink", "corn", "cornflower", "cornflower blue", "cornsilk", "cosmic latte", "cotton candy", "cream", "creme", "crimson", "crystal", "cultured", "custard", "cyan", "cyber yellow", "cyclamen", "dandelion", "deep cerise", "deep champagne", "deep chestnut", "deep lavender", "deep lilac", "deep orange", "deep pink", "deep rose", "deep saffron", "deep sky blue", "denim", "desert", "desert sand", "dirt", "dodger blue", "dogwood rose", "drab", "drab green", "duck egg blue", "dull blue", "dull brown", "dull green", "dull orange", "dull pink", "dull purple", "dull red", "dull teal", "dull yellow", "dusky pink", "dusky purple", "dusky rose", "dust", "dusty blue", "dusty green", "dusty lavender", "dusty orange", "dusty pink", "dusty purple", "dusty red", "dusty rose", "dusty teal", "dutch white", "earth", "earth yellow", "easter green", "easter purple", "ecru", "egg shell", "eggshell", "eggshell blue", "electric blue", "electric green", "electric indigo", "electric lime", "electric pink", "electric purple", "electric violet", "emerald", "erin", "eton blue", "faded blue", "faded green", "faded orange", "faded pink", "faded purple", "faded red", "faded yellow", "fallow", "fandango", "fandango pink", "fashion fuchsia", "fawn", "fern", "fiery rose", "fire engine red", "fire opal", "flame", "flat blue", "flat green", "flax", "flirt", "floral white", "fluorescent blue", "fluorescent green", "fluro green", "foam green", "fresh green", "frog green", "frostbite", "fuchsia", "fuchsia purple", "fuchsia rose", "fulvous", "gainsboro", "gamboge", "ghost white", "glaucous", "glossy grape", "go green", "gold", "golden", "golden brown", "golden poppy", "golden rod", "goldenrod", "golden yellow", "gold fusion", "granny smith apple", "grapefruit", "grass", "gray", "green", "green apple", "green lizard", "green sheen", "green teal", "grey", "grullo", "hansa yellow", "harlequin", "harvest gold", "hazel", "heather", "heat wave", "heliotrope", "heliotrope gray", "highlighter green", "hollywood cerise", "honeydew", "hospital green", "hot green", "hot magenta", "hot pink", "hot purple", "ice", "iceberg", "ice blue", "icky green", "icterine", "illuminating emerald", "inchworm", "international orange", "iris", "irresistible", "isabelline", "ivory", "jade", "jade green", "jasmine", "jonquil", "june bud", "jungle green", "kelly green", "keppel", "kermit green", "key lime", "khaki", "khaki green", "kiwi", "kiwi green", "kobi", "languid lavender", "laser lemon", "laurel green", "lava", "lavender", "lavender blue", "lavender blush", "lavender gray", "lavender pink", "lawn green", "leaf", "leaf green", "leafy green", "leather", "lemon", "lemon chiffon", "lemon curry", "lemon glacier", "lemon green", "lemon lime", "lemon meringue", "lemon yellow", "liberty", "lichen", "lilac", "lilac luster", "liliac", "lime", "lime green", "lime yellow", "linen", "lion", "lipstick", "lipstick red", "liseran purple", "little boy blue", "liver chestnut", "livid", "macaroni and cheese", "madder lake", "magenta", "magenta haze", "magic mint", "magnolia", "mahogany", "maize", "majorelle blue", "malachite", "manatee", "mandarin", "mango", "mango tango", "manilla", "mantis", "marigold", "maroon", "mauve", "mauvelous", "mauve taupe", "maximum blue", "maximum blue green", "maximum blue purple", "maximum green yellow", "maximum red", "maximum red purple", "maximum yellow", "maximum yellow red", "maya blue", "medium aquamarine", "medium blue", "medium candy apple red", "medium carmine", "medium champagne", "medium green", "medium grey", "medium orchid", "medium pink", "medium purple", "medium sea green", "medium slate blue", "medium spring green", "medium turquoise", "medium violet red", "mellow apricot", "mellow yellow", "melon", "metallic blue", "metallic gold", "metallic seaweed", "metallic sunburst", "mid blue", "mid green", "mikado yellow", "mimi pink", "mindaro", "minion yellow", "mint", "mint cream", "mint green", "minty green", "misty moss", "misty rose", "mocha", "mode beige", "morning blue", "moss", "moss green", "mountain meadow", "mountbatten pink", "muddy yellow", "mulberry", "mushroom", "mustard", "mustard brown", "mustard green", "mustard yellow", "muted blue", "muted green", "muted pink", "muted purple", "mystic", "mystic maroon", "nadeshiko pink", "naples yellow", "nasty green", "neon blue", "neon carrot", "neon fuchsia", "neon green", "neon pink", "neon purple", "neon red", "neon yellow", "new york pink", "nice blue", "nickel", "non photo blue", "nyanza", "ocean", "ocean blue", "ocean green", "ocher", "ochre", "ocre", "off blue", "off green", "off white", "off yellow", "old gold", "old lace", "old lavender", "old pink", "old rose", "old silver", "olive", "olive drab", "olive green", "olive yellow", "olivine", "opal", "opera mauve", "orange", "orange peel", "orangered", "orange soda", "orchid", "orchid pink", "outrageous orange", "pacific blue", "pale", "paolo veronese green", "papaya whip", "paradise pink", "parchment", "paris green", "pastel blue", "pastel green", "pastel orange", "pastel pink", "pastel purple", "pastel red", "pastel yellow", "pea", "peach", "peach puff", "peachy pink", "pea green", "pear", "pearly purple", "pea soup", "pea soup green", "periwinkle", "periwinkle blue", "permanent geranium lake", "perrywinkle", "persian green", "persian orange", "persian pink", "persian red", "persian rose", "persimmon", "pewter blue", "phlox", "pictorial carmine", "piggy pink", "pig pink", "pink", "pink flamingo", "pink lace", "pink lavender", "pink red", "pink sherbet", "pinky", "pinky purple", "pinky red", "pistachio", "platinum", "plum", "plump purple", "poison green", "polished pine", "pomp and power", "popstar", "powder blue", "powder pink", "primary blue", "process yellow", "psychedelic purple", "puce", "pumpkin", "pumpkin orange", "pure blue", "purple mountain majesty", "purple pizzazz", "purple plum", "purpureus", "putty", "queen blue", "queen pink", "quick silver", "radical red", "radioactive green", "rajah", "raspberry", "raspberry glace", "raspberry rose", "raw sienna", "razzle dazzle rose", "razzmatazz", "razzmic berry", "really light blue", "red", "red salsa", "redwood", "rhythm", "rich blue", "robin egg blue", "robin's egg", "robin's egg blue", "rocket metallic", "roman silver", "rosa", "rose", "rose bonbon", "rose dust", "rose madder", "rose pink", "rose pompadour", "rose quartz", "rose red", "rose taupe", "rose vale", "rosso corsa", "rosy brown", "rosy pink", "royal purple", "royal yellow", "ruber", "rubine red", "ruby", "rust", "rust orange", "rusty orange", "rusty red", "safety orange", "safety yellow", "saffron", "sage", "sage green", "salmon", "salmon pink", "sand", "sand brown", "sand dune", "sandstone", "sandy", "sandy brown", "sand yellow", "sapphire", "sapphire blue", "satin sheen gold", "scarlet", "schauss pink", "school bus yellow", "screamin' green", "sea", "sea blue", "seafoam", "seafoam blue", "seafoam green", "seashell", "seaweed", "seaweed green", "selective yellow", "shadow", "shadow blue", "shamrock", "shamrock green", "sheen green", "shimmering blush", "shiny shamrock", "shocking pink", "silver", "silver chalice", "silver pink", "silver sand", "sinopia", "sizzling red", "sizzling sunrise", "sky", "sky blue", "sky magenta", "slate blue", "slate gray", "slate green", "slime green", "smitten", "snow", "soft blue", "soft green", "soft pink", "soft purple", "sonic silver", "spearmint", "spring bud", "spring frost", "spring green", "squash", "star command blue", "steel", "steel blue", "steel grey", "steel pink", "steel teal", "stil de grain yellow", "stone", "stormy blue", "straw", "strawberry", "strawberry blonde", "strong blue", "strong pink", "sugar plum", "sunflower", "sunflower yellow", "sunglow", "sunny yellow", "sunray", "sunset", "sunshine yellow", "sun yellow", "super pink", "syracuse orange", "tan", "tan brown", "tangerine", "tango pink", "tan green", "tart orange", "taupe gray", "tawny", "tea", "tea green", "teal blue", "teal green", "tea rose", "telemagenta", "terracota", "terra cotta", "terracotta", "thistle", "thulian pink", "tickle me pink", "tiffany blue", "timberwolf", "titanium yellow", "tomato", "tomato red", "topaz", "toupe", "toxic green", "true blue", "tufts blue", "tumbleweed", "turquoise", "turquoise blue", "turquoise green", "turtle green", "tuscan", "tuscan tan", "tuscany", "ua red", "ultramarine blue", "ultra pink", "ultra red", "unbleached silk", "unmellow yellow", "uranian blue", "vanilla", "vanilla ice", "vegas gold", "venetian red", "verdigris", "vermilion", "vermillion", "veronica", "vibrant blue", "vibrant green", "vibrant purple", "violet", "violet blue", "violet pink", "violet red", "viridian green", "vivid blue", "vivid green", "vivid purple", "vivid sky blue", "vivid tangerine", "vivid violet", "volt", "warm blue", "warm grey", "warm pink", "warm purple", "washed out green", "water blue", "watermelon", "weird green", "wheat", "white", "wild blue yonder", "wild orchid", "wild strawberry", "wild watermelon", "windows blue", "windsor tan", "wintergreen", "wintergreen dream", "winter sky", "wisteria", "wood brown", "xanadu", "xanthic", "xanthous", "yellow", "yellow ochre", "yellow sunshine", "zomp"} +Public.bright_color_names = {"acid", "acid green", "aero", "aero blue", "alabaster", "algae", "algae green", "alice blue", "alloy orange", "almond", "amaranth", "amaranth pink", "amaranth purple", "amaranth red", "amber", "amethyst", "android green", "antique brass", "antique fuchsia", "antique white", "apple", "apple green", "apricot", "aqua", "aqua blue", "aqua green", "aqua marine", "aquamarine", "arctic lime", "artichoke", "arylide yellow", "ash gray", "asparagus", "atomic tangerine", "aureolin", "avocado green", "azul", "azure", "baby blue", "baby blue eyes", "baby green", "baby pink", "baby powder", "baby purple", "baker miller pink", "banana", "banana yellow", "barbie pink", "barney", "barney purple", "battleship grey", "beau blue", "beaver", "beige", "bisque", "bistre brown", "bitter lemon", "bitter lime", "bittersweet", "bittersweet shimmer", "black shadows", "blanched almond", "bland", "blast off bronze", "blizzard blue", "blond", "blood orange", "blue", "blue bell", "bluegrey", "blue jeans", "bluetiful", "blue violet", "blue yonder", "blurple", "blush", "blush pink", "bone", "boring green", "brick orange", "brick red", "bright aqua", "bright blue", "bright cyan", "bright green", "bright lavender", "bright light blue", "bright light green", "bright lilac", "bright lime", "bright lime green", "bright magenta", "bright maroon", "bright navy blue", "bright olive", "bright orange", "bright pink", "bright purple", "bright red", "bright sea green", "bright sky blue", "bright teal", "bright turquoise", "bright violet", "bright yellow", "brilliant rose", "brink pink", "bronze", "brown sugar", "bubblegum", "bubble gum pink", "bubblegum pink", "bud green", "buff", "burlywood", "burnished brown", "burnt orange", "burnt siena", "burnt sienna", "burnt yellow", "burple", "butter", "butterscotch", "butter yellow", "byzantine", "cadet blue", "cadet grey", "cadmium orange", "cadmium red", "cadmium yellow", "café au lait", "cambridge blue", "camel", "cameo pink", "camo", "canary", "canary yellow", "candy apple red", "candy pink", "capri", "caramel", "cardinal", "caribbean green", "carnation", "carnation pink", "carolina blue", "carrot orange", "cedar chest", "celadon", "celadon blue", "celadon green", "celery", "celeste", "celtic blue", "cement", "cerise", "cerulean", "cerulean blue", "cerulean frost", "cg blue", "cg red", "champagne", "champagne pink", "charm pink", "chartreuse", "cherry", "cherry blossom pink", "cherry red", "chili red", "china pink", "china rose", "chrome yellow", "cinereous", "cinnabar", "cinnamon", "cinnamon satin", "citrine", "citron", "clay", "clay brown", "clear blue", "cloudy blue", "cocoa brown", "cool blue", "cool green", "cool grey", "copper", "copper penny", "copper red", "copper rose", "coquelicot", "coral", "coral pink", "corn", "cornflower", "cornflower blue", "cornsilk", "cosmic latte", "cotton candy", "cream", "creme", "crimson", "crystal", "cultured", "custard", "cyan", "cyber yellow", "cyclamen", "dandelion", "deep cerise", "deep champagne", "deep chestnut", "deep lavender", "deep lilac", "deep orange", "deep pink", "deep rose", "deep saffron", "deep sky blue", "denim", "desert", "desert sand", "dirt", "dodger blue", "dogwood rose", "drab", "drab green", "duck egg blue", "dull blue", "dull brown", "dull green", "dull orange", "dull pink", "dull purple", "dull red", "dull teal", "dull yellow", "dusky pink", "dusky purple", "dusky rose", "dust", "dusty blue", "dusty green", "dusty lavender", "dusty orange", "dusty pink", "dusty purple", "dusty red", "dusty rose", "dusty teal", "dutch white", "earth", "earth yellow", "easter green", "easter purple", "ecru", "egg shell", "eggshell", "eggshell blue", "electric blue", "electric green", "electric indigo", "electric lime", "electric pink", "electric purple", "electric violet", "emerald", "erin", "eton blue", "faded blue", "faded green", "faded orange", "faded pink", "faded purple", "faded red", "faded yellow", "fallow", "fandango", "fandango pink", "fashion fuchsia", "fawn", "fern", "fiery rose", "fire engine red", "fire opal", "flame", "flat blue", "flat green", "flax", "flirt", "floral white", "fluorescent blue", "fluorescent green", "fluro green", "foam green", "fresh green", "frog green", "frostbite", "fuchsia", "fuchsia purple", "fuchsia rose", "fulvous", "gainsboro", "gamboge", "ghost white", "glaucous", "glossy grape", "go green", "gold", "golden", "golden brown", "golden poppy", "golden rod", "goldenrod", "golden yellow", "gold fusion", "granny smith apple", "grapefruit", "grass", "gray", "green", "green apple", "green lizard", "green sheen", "green teal", "grey", "grullo", "hansa yellow", "harlequin", "harvest gold", "hazel", "heather", "heat wave", "heliotrope", "heliotrope gray", "highlighter green", "hollywood cerise", "honeydew", "hospital green", "hot green", "hot magenta", "hot pink", "hot purple", "ice", "iceberg", "ice blue", "icky green", "icterine", "illuminating emerald", "inchworm", "international orange", "iris", "irresistible", "isabelline", "ivory", "jade", "jade green", "jasmine", "jonquil", "june bud", "jungle green", "kelly green", "keppel", "kermit green", "key lime", "khaki", "khaki green", "kiwi", "kiwi green", "kobi", "languid lavender", "laser lemon", "laurel green", "lava", "lavender", "lavender blue", "lavender blush", "lavender gray", "lavender pink", "lawn green", "leaf", "leaf green", "leafy green", "leather", "lemon", "lemon chiffon", "lemon curry", "lemon glacier", "lemon green", "lemon lime", "lemon meringue", "lemon yellow", "liberty", "lichen", "lilac", "lilac luster", "liliac", "lime", "lime green", "lime yellow", "linen", "lion", "lipstick", "lipstick red", "liseran purple", "little boy blue", "liver chestnut", "livid", "macaroni and cheese", "madder lake", "magenta", "magenta haze", "magic mint", "magnolia", "mahogany", "maize", "majorelle blue", "malachite", "manatee", "mandarin", "mango", "mango tango", "manilla", "mantis", "marigold", "maroon", "mauve", "mauvelous", "mauve taupe", "maximum blue", "maximum blue green", "maximum blue purple", "maximum green yellow", "maximum red", "maximum red purple", "maximum yellow", "maximum yellow red", "maya blue", "medium aquamarine", "medium blue", "medium candy apple red", "medium carmine", "medium champagne", "medium green", "medium grey", "medium orchid", "medium pink", "medium purple", "medium sea green", "medium slate blue", "medium spring green", "medium turquoise", "medium violet red", "mellow apricot", "mellow yellow", "melon", "metallic blue", "metallic gold", "metallic seaweed", "metallic sunburst", "mid blue", "mid green", "mikado yellow", "mimi pink", "mindaro", "minion yellow", "mint", "mint cream", "mint green", "minty green", "misty moss", "misty rose", "mocha", "mode beige", "morning blue", "moss", "moss green", "mountain meadow", "mountbatten pink", "muddy yellow", "mulberry", "mushroom", "mustard", "mustard brown", "mustard green", "mustard yellow", "muted blue", "muted green", "muted pink", "muted purple", "mystic", "mystic maroon", "nadeshiko pink", "naples yellow", "nasty green", "neon blue", "neon carrot", "neon fuchsia", "neon green", "neon pink", "neon purple", "neon red", "neon yellow", "new york pink", "nice blue", "nickel", "non photo blue", "nyanza", "ocean", "ocean blue", "ocean green", "ocher", "ochre", "ocre", "off blue", "off green", "off white", "off yellow", "old gold", "old lace", "old lavender", "old pink", "old rose", "old silver", "olive", "olive drab", "olive green", "olive yellow", "olivine", "opal", "opera mauve", "orange", "orange peel", "orangered", "orange soda", "orchid", "orchid pink", "outrageous orange", "pacific blue", "pale", "paolo veronese green", "papaya whip", "paradise pink", "parchment", "paris green", "pastel blue", "pastel green", "pastel orange", "pastel pink", "pastel purple", "pastel red", "pastel yellow", "pea", "peach", "peach puff", "peachy pink", "pea green", "pear", "pearly purple", "pea soup", "pea soup green", "periwinkle", "periwinkle blue", "permanent geranium lake", "perrywinkle", "persian green", "persian orange", "persian pink", "persian red", "persian rose", "persimmon", "pewter blue", "phlox", "pictorial carmine", "piggy pink", "pig pink", "pink", "pink flamingo", "pink lace", "pink lavender", "pink red", "pink sherbet", "pinky", "pinky purple", "pinky red", "pistachio", "platinum", "plum", "plump purple", "poison green", "polished pine", "pomp and power", "popstar", "powder blue", "powder pink", "primary blue", "process yellow", "psychedelic purple", "puce", "pumpkin", "pumpkin orange", "pure blue", "purple mountain majesty", "purple pizzazz", "purple plum", "purpureus", "putty", "queen blue", "queen pink", "quick silver", "radical red", "radioactive green", "rajah", "raspberry", "raspberry glace", "raspberry rose", "raw sienna", "razzle dazzle rose", "razzmatazz", "razzmic berry", "really light blue", "red", "red salsa", "redwood", "rhythm", "rich blue", "robin egg blue", "robin's egg", "robin's egg blue", "rocket metallic", "roman silver", "rosa", "rose", "rose bonbon", "rose dust", "rose madder", "rose pink", "rose pompadour", "rose quartz", "rose red", "rose taupe", "rose vale", "rosso corsa", "rosy brown", "rosy pink", "royal purple", "royal yellow", "ruber", "rubine red", "ruby", "rust", "rust orange", "rusty orange", "rusty red", "safety orange", "safety yellow", "saffron", "sage", "sage green", "salmon", "salmon pink", "sand", "sand brown", "sand dune", "sandstone", "sandy", "sandy brown", "sand yellow", "sapphire", "sapphire blue", "satin sheen gold", "scarlet", "schauss pink", "school bus yellow", "screamin' green", "sea", "sea blue", "seafoam", "seafoam blue", "seafoam green", "seashell", "seaweed", "seaweed green", "selective yellow", "shadow", "shadow blue", "shamrock", "shamrock green", "sheen green", "shimmering blush", "shiny shamrock", "shocking pink", "silver", "silver chalice", "silver pink", "silver sand", "sinopia", "sizzling red", "sizzling sunrise", "sky", "sky blue", "sky magenta", "slate blue", "slate gray", "slate green", "slime green", "smitten", "snow", "soft blue", "soft green", "soft pink", "soft purple", "sonic silver", "spearmint", "spring bud", "spring frost", "spring green", "squash", "star command blue", "steel", "steel blue", "steel grey", "steel pink", "steel teal", "stil de grain yellow", "stone", "stormy blue", "straw", "strawberry", "strawberry blonde", "strong blue", "strong pink", "sugar plum", "sunflower", "sunflower yellow", "sunglow", "sunny yellow", "sunray", "sunset", "sunshine yellow", "sun yellow", "super pink", "syracuse orange", "tan", "tan brown", "tangerine", "tango pink", "tan green", "tart orange", "taupe gray", "tawny", "tea", "tea green", "teal blue", "teal green", "tea rose", "telemagenta", "terracota", "terra cotta", "terracotta", "thistle", "thulian pink", "tickle me pink", "tiffany blue", "timberwolf", "titanium yellow", "tomato", "tomato red", "topaz", "toupe", "toxic green", "true blue", "tufts blue", "tumbleweed", "turquoise", "turquoise blue", "turquoise green", "turtle green", "tuscan", "tuscan tan", "tuscany", "ua red", "ultramarine blue", "ultra pink", "ultra red", "unbleached silk", "unmellow yellow", "uranian blue", "vanilla", "vanilla ice", "vegas gold", "venetian red", "verdigris", "vermilion", "vermillion", "veronica", "vibrant blue", "vibrant green", "vibrant purple", "violet", "violet blue", "violet pink", "violet red", "viridian green", "vivid blue", "vivid green", "vivid purple", "vivid sky blue", "vivid tangerine", "vivid violet", "volt", "warm blue", "warm grey", "warm pink", "warm purple", "washed out green", "water blue", "watermelon", "weird green", "wheat", "white", "wild blue yonder", "wild orchid", "wild strawberry", "wild watermelon", "windows blue", "windsor tan", "wintergreen", "wintergreen dream", "winter sky", "wisteria", "wood brown", "xanadu", "xanthic", "xanthous", "yellow", "yellow ochre", "yellow sunshine", "zomp"} return Public \ No newline at end of file diff --git a/maps/pirates/progression.lua b/maps/pirates/progression.lua index b1ce0ada..ee054b96 100644 --- a/maps/pirates/progression.lua +++ b/maps/pirates/progression.lua @@ -8,6 +8,7 @@ local Common = require 'maps.pirates.common' local CoreData = require 'maps.pirates.coredata' local Utils = require 'maps.pirates.utils_local' local inspect = require 'utils.inspect'.inspect +local CustomEvents = require 'maps.pirates.custom_events' local Structures = require 'maps.pirates.structures.structures' local Boats = require 'maps.pirates.structures.boats.boats' @@ -229,6 +230,8 @@ function Public.progress_to_destination(destination_index) end end + script.raise_event(CustomEvents.enum['update_crew_fuel_gui'], {}) + -- Delay.add(Delay.enum.PLACE_DOCK_JETTY_AND_BOATS) Task.set_timeout_in_ticks(2, place_dock_jetty_and_boats, {crew_id = memory.id}) else @@ -268,9 +271,11 @@ function Public.progress_to_destination(destination_index) memory.destinationsvisited_indices[#memory.destinationsvisited_indices + 1] = destination_index - memory.currentdestination_index = destination_index + memory.currentdestination_index = destination_index --already done when we collide with it typically local destination = Common.current_destination() + script.raise_event(CustomEvents.enum['update_crew_progress_gui'], {}) + destination.dynamic_data.timer = 0 destination.dynamic_data.timeratlandingtime = nil @@ -388,6 +393,8 @@ function Public.check_for_end_of_boat_movement(boat) memory.mainshop_availability_bools.upgrade_power = false memory.mainshop_availability_bools.unlock_merchants = false memory.mainshop_availability_bools.rockets_for_sale = false + + script.raise_event(CustomEvents.enum['update_crew_fuel_gui'], {}) Public.go_from_currentdestination_to_sea() @@ -498,6 +505,8 @@ function Public.undock_from_dock(manual) memory.mainshop_availability_bools.new_boat_cutter_with_hold = false memory.mainshop_availability_bools.new_boat_sloop_with_hold = false + script.raise_event(CustomEvents.enum['update_crew_fuel_gui'], {}) + Crew.summon_crew() local force = memory.force @@ -549,10 +558,6 @@ function Public.go_from_currentdestination_to_sea() memory.enemy_force.reset_evolution() local base_evo = Balance.base_evolution() Common.set_evo(base_evo) - destination.dynamic_data.evolution_accrued_leagues = base_evo - destination.dynamic_data.evolution_accrued_time = 0 - destination.dynamic_data.evolution_accrued_nests = 0 - destination.dynamic_data.evolution_accrued_silo = 0 memory.kraken_evo = 0 memory.loadingticks = nil diff --git a/maps/pirates/quest.lua b/maps/pirates/quest.lua index 43a4855d..29ef943d 100644 --- a/maps/pirates/quest.lua +++ b/maps/pirates/quest.lua @@ -38,13 +38,13 @@ function Public.quest_reward() local rng = Math.random() if rng <= 0.3 then - ret = {name = 'iron-plate', count = Math.ceil(2000 * multiplier), display_sprite = '[item=iron-plate]', display_amount = string.format('%.0fk', 2 * multiplier)} + ret = {name = 'iron-plate', count = Math.ceil(2000 * multiplier), display_sprite = '[item=iron-plate]', display_amount = string.format('%.1fk', 2 * multiplier)} elseif rng <= 0.5 then - ret = {name = 'copper-plate', count = Math.ceil(2000 * multiplier), display_sprite = '[item=copper-plate]', display_amount = string.format('%.0fk', 2 * multiplier)} + ret = {name = 'copper-plate', count = Math.ceil(2000 * multiplier), display_sprite = '[item=copper-plate]', display_amount = string.format('%.1fk', 2 * multiplier)} elseif rng <= 0.7 then ret = {name = 'solid-fuel', count = Math.ceil(450 * multiplier), display_sprite = '[item=solid-fuel]', display_amount = string.format('%.0f', Math.ceil(450 * multiplier))} elseif rng <= 0.9 then - ret = {name = 'coin', count = Math.ceil(6000 * (multiplier^(1/2))), display_sprite = '[item=coin]', display_amount = string.format('%.0fk', Math.ceil(6 * (multiplier^(1/2))))} + ret = {name = 'coin', count = Math.ceil(6000 * (multiplier^(1/2))), display_sprite = '[item=coin]', display_amount = string.format('%.1fk', Math.ceil(6 * (multiplier^(1/2))))} else ret = {name = 'piercing-rounds-magazine', count = Math.ceil(250 * multiplier), display_sprite = '[item=piercing-rounds-magazine]', display_amount = string.format('%.0f', Math.ceil(250 * multiplier))} end diff --git a/maps/pirates/roles/classes.lua b/maps/pirates/roles/classes.lua index c841a307..e2e48e1f 100644 --- a/maps/pirates/roles/classes.lua +++ b/maps/pirates/roles/classes.lua @@ -86,10 +86,10 @@ Public.explanation = { [enum.WOOD_LORD] = 'They find many more resources when chopping trees.', [enum.CHIEF_EXCAVATOR] = 'They find many more resources when handmining ore.', [enum.HATAMOTO] = 'They are very tough, and *with no weapon equipped* fight well by melee, but poorly otherwise.', - [enum.IRON_LEG] = 'They are very resistant to damage when carrying 2500 iron ore.', + [enum.IRON_LEG] = 'They are very resistant to damage when carrying 3500 iron ore.', [enum.QUARTERMASTER] = 'They give nearby crewmates extra physical attack, and generate ore for the captain\'s cabin for each one.', [enum.DREDGER] = 'They find surprising items when they fish.', - [enum.SMOLDERING] = 'They periodically convert wood into coal, if they have less than 25 coal.', + [enum.SMOLDERING] = 'They periodically convert wood into coal, if they have less than 50 coal.', [enum.GOURMET] = 'They generate ore for the captain\'s cabin by eating fish in fancy locations.', } @@ -201,7 +201,7 @@ function Public.class_ore_grant(player, how_much, disable_scaling) else count = Math.ceil(how_much * Balance.class_resource_scale()) end - if Math.random(3) == 1 then + if Math.random(4) == 1 then Common.flying_text_small(player.surface, player.position, '[color=0.85,0.58,0.37]+' .. count .. '[/color]') Common.give_items_to_crew{{name = 'copper-ore', count = count}} else diff --git a/maps/pirates/shop/captains.lua b/maps/pirates/shop/captains.lua index d1c05c71..62ad5ae7 100644 --- a/maps/pirates/shop/captains.lua +++ b/maps/pirates/shop/captains.lua @@ -12,6 +12,7 @@ local Hold = require 'maps.pirates.surfaces.hold' local Crew = require 'maps.pirates.crew' local Boats = require 'maps.pirates.structures.boats.boats' local Dock = require 'maps.pirates.surfaces.dock' +local CustomEvents = require 'maps.pirates.custom_events' local Public = {} @@ -137,6 +138,8 @@ function Public.initialise_captains_shop() -- buy_fast_loader = true, -- sell_copper = false, } + + script.raise_event(CustomEvents.enum['update_crew_fuel_gui'], {}) end function Public.main_shop_try_purchase(player, purchase_name) @@ -301,6 +304,7 @@ function Public.main_shop_try_purchase(player, purchase_name) end + script.raise_event(CustomEvents.enum['update_crew_fuel_gui'], {}) -- memory.mainshop_rate_limit_ticker = Common.mainshop_rate_limit_ticks else diff --git a/maps/pirates/shop/dock.lua b/maps/pirates/shop/dock.lua index 126497c4..7f18c49b 100644 --- a/maps/pirates/shop/dock.lua +++ b/maps/pirates/shop/dock.lua @@ -25,8 +25,8 @@ Public.market_barters = { --repeating these: {price = {{'iron-plate', 300}}, offer = {type = 'give-item', item = 'copper-plate', count = 500}}, {price = {{'copper-plate', 300}}, offer = {type = 'give-item', item = 'iron-plate', count = 500}}, - {price = {{'steel-plate', 50}}, offer = {type = 'give-item', item = 'copper-plate', count = 500}}, - {price = {{'steel-plate', 50}}, offer = {type = 'give-item', item = 'iron-plate', count = 500}}, + {price = {{'steel-plate', 40}}, offer = {type = 'give-item', item = 'copper-plate', count = 500}}, + {price = {{'steel-plate', 40}}, offer = {type = 'give-item', item = 'iron-plate', count = 500}}, {price = {{'raw-fish', 50}}, offer = {type = 'give-item', item = 'coal', count = 500}}, {price = {{'raw-fish', 50}}, offer = {type = 'give-item', item = 'iron-plate', count = 750}}, {price = {{'raw-fish', 50}}, offer = {type = 'give-item', item = 'copper-plate', count = 750}}, @@ -52,9 +52,9 @@ Public.market_sales = { {price = {{'coin', 2000}}, offer = {type = 'give-item', item = 'uranium-rounds-magazine', count = 30}}, {price = {{'coin', 2000}}, offer = {type = 'give-item', item = 'piercing-shotgun-shell', count = 50}}, {price = {{'coin', 2000}}, offer = {type = 'give-item', item = 'raw-fish', count = 300}}, - {price = {{'coin', 2000}}, offer = {type = 'give-item', item = 'laser-turret', count = 2}}, + {price = {{'coin', 2000}}, offer = {type = 'give-item', item = 'laser-turret', count = 1}}, {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 = 'substation', count = 5}}, {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}}, diff --git a/maps/pirates/shop/shop.lua b/maps/pirates/shop/shop.lua index 59d5b614..30f5fa31 100644 --- a/maps/pirates/shop/shop.lua +++ b/maps/pirates/shop/shop.lua @@ -96,7 +96,7 @@ function Public.event_on_market_item_purchased(event) if required_class then if not (memory.classes_table and memory.classes_table[player.index] and memory.classes_table[player.index] == required_class) then ok = false - Common.notify_force_error(force, string.format('Class purchase error: you need to be a %s to buy this.', Classes.display_form[required_class])) + Common.notify_force_error(force, string.format('Class purchase error: You need to be a %s to buy this.', Classes.display_form[required_class])) end end diff --git a/maps/pirates/structures/boats/boats.lua b/maps/pirates/structures/boats/boats.lua index 3a851fce..ca1d92cc 100644 --- a/maps/pirates/structures/boats/boats.lua +++ b/maps/pirates/structures/boats/boats.lua @@ -291,7 +291,6 @@ function Public.place_boat(boat, floor_tile, place_entities_bool, correct_tiles, e.destructible = false e.minable = false e.rotatable = false - e.operable = false if i == 1 then boat.upstairs_pole = e Public.try_connect_upstairs_and_downstairs_poles(boat) diff --git a/maps/pirates/structures/island_structures/roc/data.lua b/maps/pirates/structures/island_structures/roc/data.lua index 6087793c..b8f4c016 100644 --- a/maps/pirates/structures/island_structures/roc/data.lua +++ b/maps/pirates/structures/island_structures/roc/data.lua @@ -168,15 +168,15 @@ Public.maze_defended_camp = { force = 'ancient-hostile', offset = {x = 0, y = 0}, count = 30, - large_r = 9, - small_r = 6, + large_r = 10, + small_r = 7, }, { type = 'entities_randomlyplaced', name = 'wooden-chest', force = 'ancient-friendly', offset = {x = 0, y = 0}, - count = 12, + count = 13, r = 5, }, }, @@ -194,15 +194,15 @@ Public.maze_undefended_camp = { force = 'ancient-hostile', offset = {x = 0, y = 0}, count = 10, - large_r = 9, - small_r = 6, + large_r = 10, + small_r = 7, }, { type = 'entities_randomlyplaced', name = 'wooden-chest', force = 'ancient-friendly', offset = {x = 0, y = 0}, - count = 6, + count = 7, r = 5, }, }, diff --git a/maps/pirates/surfaces/cabin.lua b/maps/pirates/surfaces/cabin.lua index 2d56f7d4..bc6e27ae 100644 --- a/maps/pirates/surfaces/cabin.lua +++ b/maps/pirates/surfaces/cabin.lua @@ -174,7 +174,7 @@ function Public.create_cabin_surface() e.destructible = false e.minable = false e.rotatable = false - e.operable = false + -- e.operable = false boat.output_chest = e end @@ -184,7 +184,7 @@ function Public.create_cabin_surface() e.destructible = false e.minable = false e.rotatable = false - e.operable = false + -- e.operable = false boat.backup_output_chest = e end diff --git a/maps/pirates/surfaces/crowsnest.lua b/maps/pirates/surfaces/crowsnest.lua index 5c160ae6..db4210de 100644 --- a/maps/pirates/surfaces/crowsnest.lua +++ b/maps/pirates/surfaces/crowsnest.lua @@ -5,6 +5,7 @@ local Common = require 'maps.pirates.common' local CoreData = require 'maps.pirates.coredata' local Utils = require 'maps.pirates.utils_local' local Math = require 'maps.pirates.math' +local CustomEvents = require 'maps.pirates.custom_events' local inspect = require 'utils.inspect'.inspect local Token = require 'utils.token' @@ -117,6 +118,8 @@ function Public.move_crowsnest(vectorx, vectory) -- crew_force.clear_chart(surface) crew_force.chart(surface, area) end + + script.raise_event(CustomEvents.enum['update_crew_progress_gui'], {}) end diff --git a/maps/pirates/surfaces/dock.lua b/maps/pirates/surfaces/dock.lua index ac68cb64..1b19a3cc 100644 --- a/maps/pirates/surfaces/dock.lua +++ b/maps/pirates/surfaces/dock.lua @@ -10,6 +10,7 @@ local Cabin = require 'maps.pirates.surfaces.cabin' local CoreData = require 'maps.pirates.coredata' local Utils = require 'maps.pirates.utils_local' local inspect = require 'utils.inspect'.inspect +local CustomEvents = require 'maps.pirates.custom_events' local Public = {} @@ -72,6 +73,8 @@ function Public.execute_boat_purchase() memory.mainshop_availability_bools.new_boat_cutter_with_hold = false memory.mainshop_availability_bools.new_boat_sloop_with_hold = false memory.mainshop_availability_bools.new_boat_cutter = false + + script.raise_event(CustomEvents.enum['update_crew_fuel_gui'], {}) end diff --git a/maps/pirates/surfaces/hold.lua b/maps/pirates/surfaces/hold.lua index 8b1662ab..c3c26e00 100644 --- a/maps/pirates/surfaces/hold.lua +++ b/maps/pirates/surfaces/hold.lua @@ -172,7 +172,6 @@ function Public.create_hold_surface(nth) e.destructible = false e.minable = false e.rotatable = false - e.operable = false boat.downstairs_poles[nth][i] = e end end diff --git a/maps/pirates/surfaces/islands/maze/data.lua b/maps/pirates/surfaces/islands/maze/data.lua index 65a6d070..4a4dd9f4 100644 --- a/maps/pirates/surfaces/islands/maze/data.lua +++ b/maps/pirates/surfaces/islands/maze/data.lua @@ -23,7 +23,7 @@ function Public.base_ores() return { ['copper-ore'] = 3.5, ['iron-ore'] = 6.5, - ['coal'] = 4.4, + ['coal'] = 4.0, ['stone'] = 2.0, ['crude-oil'] = 15, } diff --git a/maps/pirates/surfaces/islands/maze/maze.lua b/maps/pirates/surfaces/islands/maze/maze.lua index 51431cd9..cbde7ca2 100644 --- a/maps/pirates/surfaces/islands/maze/maze.lua +++ b/maps/pirates/surfaces/islands/maze/maze.lua @@ -139,8 +139,8 @@ local free_labyrinth_cell_raffle = { maze_defended_camp = 1, maze_undefended_camp = 0.25, maze_worms = 0.8, - small_abandoned_refinery = 0.1, - small_roboport_base = 0.1, + small_abandoned_refinery = 0.05, + small_roboport_base = 0.05, maze_belts_1 = 0.2, maze_belts_2 = 0.2, maze_belts_3 = 0.2, diff --git a/maps/pirates/surfaces/islands/standard/data.lua b/maps/pirates/surfaces/islands/standard/data.lua index f63a167f..19a79240 100644 --- a/maps/pirates/surfaces/islands/standard/data.lua +++ b/maps/pirates/surfaces/islands/standard/data.lua @@ -25,7 +25,7 @@ function Public.base_ores() return { ['copper-ore'] = 0.4, ['iron-ore'] = 5.7, - ['coal'] = 4.4, + ['coal'] = 4, ['stone'] = 0.6, } end diff --git a/maps/pirates/surfaces/islands/standard_variant/data.lua b/maps/pirates/surfaces/islands/standard_variant/data.lua index e99d196c..7fae0f84 100644 --- a/maps/pirates/surfaces/islands/standard_variant/data.lua +++ b/maps/pirates/surfaces/islands/standard_variant/data.lua @@ -23,9 +23,9 @@ Public.static_params_default = { function Public.base_ores() return { - ['copper-ore'] = 3.8, - ['iron-ore'] = 4.0, - ['coal'] = 4.5, + ['copper-ore'] = 3.0, + ['iron-ore'] = 4.9, + ['coal'] = 4, ['stone'] = 1.6, } end diff --git a/maps/pirates/surfaces/islands/swamp/data.lua b/maps/pirates/surfaces/islands/swamp/data.lua index 5860c988..b4de05d0 100644 --- a/maps/pirates/surfaces/islands/swamp/data.lua +++ b/maps/pirates/surfaces/islands/swamp/data.lua @@ -22,9 +22,9 @@ Public.static_params_default = { function Public.base_ores() return { - ['copper-ore'] = 1.4, - ['iron-ore'] = 2.6, - ['coal'] = 6.8, + ['copper-ore'] = 1.8, + ['iron-ore'] = 3.8, + ['coal'] = 5.5, ['stone'] = 0.5, ['crude-oil'] = 50, } diff --git a/maps/pirates/surfaces/surfaces.lua b/maps/pirates/surfaces/surfaces.lua index 266be178..43abdbec 100644 --- a/maps/pirates/surfaces/surfaces.lua +++ b/maps/pirates/surfaces/surfaces.lua @@ -203,6 +203,8 @@ function Public.destination_on_collide(destination) times = {1, 5, 10, 15, 20, 25} elseif playercount <= 15 then times = {1, 5, 10, 15, 20, 25, 30} + elseif playercount <= 21 then + times = {1, 5, 10, 15, 20, 25, 30, 35} else times = {1, 5, 10, 15, 20, 25, 30, 35, 40} end diff --git a/maps/pirates/tick_functions.lua b/maps/pirates/tick_functions.lua index c4415a94..efbad5c0 100644 --- a/maps/pirates/tick_functions.lua +++ b/maps/pirates/tick_functions.lua @@ -38,7 +38,7 @@ function Public.strobe_player_colors(tickinterval) local strobing_players = memory.speed_boost_characters - if strobing_players and #strobing_players > 0 then + if #strobing_players > 0 then local col = Utils.rgb_from_hsv((game.tick*6) % 360, 0.7, 0.9) for index, val in pairs(strobing_players) do if val then @@ -69,7 +69,7 @@ function Public.prevent_unbarreling_off_ship(tickinterval) local r = a.get_recipe() if r and r.subgroup and r.subgroup.name and r.subgroup.name == 'fill-barrel' and (not (r.name and r.name == 'fill-water-barrel')) then if not Boats.on_boat(boat, a.position) then - Common.notify_force_error(memory.force, 'Recipe error: barrels are too heavy to carry back to the ship. Try another way.') + Common.notify_force_error(memory.force, 'Recipe error: Barrels are too heavy to carry back to the ship. Try another way.') a.set_recipe('fill-water-barrel') end end @@ -163,6 +163,8 @@ function Public.ship_deplete_fuel(tickinterval) local rate = Progression.fuel_depletion_rate() + memory.fuel_depletion_rate_memoized = rate + local boat = memory.boat local input_chests = boat.input_chests @@ -198,7 +200,6 @@ function Public.transfer_pollution(tickinterval) end function Public.shop_ratelimit_tick(tickinterval) - local memory = Memory.get_crew_memory() -- if memory.mainshop_rate_limit_ticker and memory.mainshop_rate_limit_ticker > 0 then -- memory.mainshop_rate_limit_ticker = memory.mainshop_rate_limit_ticker - tickinterval @@ -283,7 +284,6 @@ function Public.periodic_free_resources(tickinterval) end function Public.pick_up_tick(tickinterval) - local memory = Memory.get_crew_memory() local destination = Common.current_destination() if not destination then return end local surface_name = destination.surface_name @@ -947,9 +947,9 @@ end function Public.loading_update(tickinterval) local memory = Memory.get_crew_memory() if memory.game_lost then return end - local currentdestination = Common.current_destination() - if not memory.loadingticks then return end + + local destination = Common.current_destination() local destination_index = memory.mapbeingloadeddestination_index if not destination_index then memory.loadingticks = nil return end @@ -960,9 +960,8 @@ function Public.loading_update(tickinterval) -- if memory.loadingticks % 100 == 0 then game.print(memory.loadingticks) end - local destination_data = memory.destinations[destination_index] - if (not destination_data) then - if memory.boat and currentdestination.type == Surfaces.enum.LOBBY then + if (not destination) then + if memory.boat and destination.type == Surfaces.enum.LOBBY then if memory.loadingticks >= 350 - Common.loading_interval then if Boats.players_on_boat_count(memory.boat) > 0 then if memory.loadingticks < 350 then @@ -988,13 +987,13 @@ function Public.loading_update(tickinterval) end return else - local surface_name = destination_data.surface_name + local surface_name = destination.surface_name if not surface_name then return end local surface = game.surfaces[surface_name] if not surface then return end - if currentdestination.type == Surfaces.enum.LOBBY then + if destination.type == Surfaces.enum.LOBBY then if memory.loadingticks >= 1260 then @@ -1039,9 +1038,9 @@ function Public.loading_update(tickinterval) elseif memory.boat.state == Boats.enum_state.ATSEA_LOADING_MAP then local total = Common.map_loading_ticks_atsea - if currentdestination.type == Surfaces.enum.DOCK then + if destination.type == Surfaces.enum.DOCK then total = Common.map_loading_ticks_atsea_dock - elseif currentdestination.type == Surfaces.enum.ISLAND and currentdestination.subtype == Surfaces.Island.enum.MAZE then + elseif destination.type == Surfaces.enum.ISLAND and destination.subtype == Surfaces.Island.enum.MAZE then total = Common.map_loading_ticks_atsea_maze end @@ -1223,14 +1222,17 @@ end function Public.minimap_jam(tickinterval) local memory = Memory.get_crew_memory() - local destination = Common.current_destination() - if destination.type == Surfaces.enum.ISLAND and destination.subtype == Surfaces.Island.enum.MAZE and memory.overworldx >= Common.maze_minimap_jam_start_league and memory.boat and memory.boat.state == Boats.enum_state.LANDED then - if not destination.surface_name then return end - local surface = game.surfaces[destination.surface_name] - local force = memory.force - force.clear_chart(surface) + if memory.overworldx >= Common.maze_minimap_jam_start_league and memory.boat and memory.boat.state == Boats.enum_state.LANDED then + local destination = Common.current_destination() + if destination.type == Surfaces.enum.ISLAND and destination.subtype == Surfaces.Island.enum.MAZE then + if not destination.surface_name then return end + local surface = game.surfaces[destination.surface_name] + local force = memory.force + force.clear_chart(surface) + end end + end -- function Public.crewtick_handle_delayed_tasks(tickinterval) @@ -1266,7 +1268,7 @@ function Public.Kraken_Destroyed_Backup_check(tickinterval) -- a server became b for i = 1, Kraken.kraken_slots do if memory.active_sea_enemies.krakens[i] then local kraken_data = memory.active_sea_enemies.krakens[i] - if kraken_data.step >= 3 then + if kraken_data.step and kraken_data.step >= 3 then some_spawners_should_be_alive = true end end @@ -1314,9 +1316,10 @@ end function Public.silo_insta_update() local memory = Memory.get_crew_memory() - local destination = Common.current_destination() if memory.game_lost then return end + local destination = Common.current_destination() + local silos = destination.dynamic_data.rocketsilos if silos and silos[1] and silos[1].valid then --need the first silo to be alive in order to charge any others diff --git a/maps/pirates/tick_functions_classes.lua b/maps/pirates/tick_functions_classes.lua index 39857e26..cf5ea628 100644 --- a/maps/pirates/tick_functions_classes.lua +++ b/maps/pirates/tick_functions_classes.lua @@ -178,7 +178,7 @@ function Public.class_rewards_tick(tickinterval) if memory.classes_table[player.index] == Classes.enum.SMOLDERING then local inv = player.get_inventory(defines.inventory.character_main) if not (inv and inv.valid) then return end - local max_coal = 25 + local max_coal = 50 -- local max_transfer = 1 local wood_count = inv.get_item_count('wood') local coal_count = inv.get_item_count('coal')