From b3fb6040a3d7775a4a675b5782971e06292bc2a8 Mon Sep 17 00:00:00 2001 From: danielmartin0 Date: Tue, 13 Sep 2022 22:09:25 +0100 Subject: [PATCH] luacheck --- maps/pirates/api_events.lua | 2 +- maps/pirates/balance.lua | 1 - maps/pirates/gui/evo.lua | 14 +++++++------- maps/pirates/main.lua | 6 ++---- maps/pirates/shop/dock.lua | 1 - 5 files changed, 10 insertions(+), 14 deletions(-) diff --git a/maps/pirates/api_events.lua b/maps/pirates/api_events.lua index bb18b26e..122a917d 100644 --- a/maps/pirates/api_events.lua +++ b/maps/pirates/api_events.lua @@ -1248,7 +1248,7 @@ local function event_on_research_finished(event) if (not (memory.game_lost)) then --this condition should prevent discord messages being fired when the crew disbands and gets reset -- using a localised string means we have to write this out (recall that "" signals concatenation) memory.force.print({"", '>> ', {'pirates.research_notification', research.localised_name}}, CoreData.colors.notify_force_light) - + Server.to_discord_embed_raw({'', '[' .. memory.name .. '] ', {'pirates.research_notification', game.technology_prototypes[research.name].localised_name}}, true) end diff --git a/maps/pirates/balance.lua b/maps/pirates/balance.lua index 32d43b2a..65a5d26c 100644 --- a/maps/pirates/balance.lua +++ b/maps/pirates/balance.lua @@ -379,7 +379,6 @@ function Public.quest_reward_multiplier() end function Public.island_richness_avg_multiplier() - local ret local base = 0.73 local additional = 0.120 * Math.clamp(0, 7, (Common.overworldx()/40)^(65/100) * Math.sloped(Public.crew_scale(), 1/40)) --tuned tbh diff --git a/maps/pirates/gui/evo.lua b/maps/pirates/gui/evo.lua index d6ee26ca..124e076f 100644 --- a/maps/pirates/gui/evo.lua +++ b/maps/pirates/gui/evo.lua @@ -71,12 +71,12 @@ function Public.full_update(player) local destination = Common.current_destination() - local evolution_leagues - local evolution_kraken - local evolution_time - local evolution_silo - local evolution_nests - local evolution_sandwurms + local evolution_leagues = 0 + local evolution_kraken = 0 + local evolution_time = 0 + local evolution_silo = 0 + local evolution_nests = 0 + local evolution_sandwurms = 0 local evolution_total local types = {'leagues', 'kraken', 'time', 'silo', 'nests', 'sandwurms'} @@ -143,7 +143,7 @@ function Public.full_update(player) button.number = evolution_total button.tooltip = str - + if evolution_total > 1.0 then button.sprite = 'entity/behemoth-worm-turret' elseif evolution_total >= 0.9 then diff --git a/maps/pirates/main.lua b/maps/pirates/main.lua index c8ad4659..91142cf0 100644 --- a/maps/pirates/main.lua +++ b/maps/pirates/main.lua @@ -123,8 +123,6 @@ local function on_init() game.create_force(Common.get_ancient_friendly_force_name(id)) game.create_force(Common.get_ancient_hostile_force_name(id)) - local crew_force = game.create_force(Common.get_crew_force_name(id)) - Crew.reset_crew_and_enemy_force(id) end @@ -279,9 +277,9 @@ local function crew_tick() memory.crew_disband_tick_message = nil local message1 = {'pirates.crew_disband_tick_message', 30} - + Common.notify_force(memory.force, message1) - + Server.to_discord_embed_raw({'', '[' .. memory.name .. '] ', message1}, true) end end diff --git a/maps/pirates/shop/dock.lua b/maps/pirates/shop/dock.lua index d8344a7a..dc6a8872 100644 --- a/maps/pirates/shop/dock.lua +++ b/maps/pirates/shop/dock.lua @@ -129,7 +129,6 @@ Public.market_sales = { function Public.create_dock_markets(surface, p) - local memory = Memory.get_crew_memory() local destination = Common.current_destination() if not (surface and p) then return end