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

more luachecks

This commit is contained in:
Gerkiz 2021-03-24 18:22:45 +01:00
parent da7546565b
commit 9d033903fb
50 changed files with 59 additions and 154 deletions

View File

@ -1,3 +1,4 @@
--luacheck: ignore
local Event = require 'utils.event'
local Modifier = require 'player_modifiers'
local Color = require 'utils.color_presets'

View File

@ -1,3 +1,4 @@
--luacheck: ignore
--[[
Exchange Strings

View File

@ -1,3 +1,4 @@
--luacheck: ignore
local Event = require 'utils.event'
local WD = require 'modules.wave_defense.table'
local WPT = require 'maps.amap.table'

View File

@ -1,3 +1,4 @@
--luacheck: ignore
local Event = require 'utils.event'
local Global = require 'utils.global'
local Task = require 'utils.task'

View File

@ -1,3 +1,4 @@
--luacheck: ignore
require 'modules.rocks_broken_paint_tiles'
local Event = require 'utils.event'

View File

@ -1,3 +1,4 @@
--luacheck: ignore
local Token = require 'utils.token'
local Task = require 'utils.task'
local Event = require 'utils.event'

View File

@ -8,7 +8,6 @@ local WD = require 'modules.wave_defense.table'
local Public = {}
local main_tile_name = 'black-refined-concrete'
local RPG = require 'modules.rpg.table'
local Loot = require 'maps.amap.loot'
local function validate_entity(entity)
if not (entity and entity.valid) then
return false

View File

@ -1,3 +1,4 @@
--luacheck: ignore
require 'modules.rpg.main'
require 'maps.amap.relax'
require 'maps.amap.diff'

View File

@ -1,3 +1,4 @@
--luacheck: ignore
local WPT = require 'maps.amap.table'
local Event = require 'utils.event'
local Public = {}

View File

@ -46,7 +46,7 @@ end
local function set_raffle()
global.rocks_yield_ore['raffle'] = {}
for _, t in pairs(get_chances()) do
for x = 1, t[2], 1 do
for _ = 1, t[2], 1 do
table.insert(global.rocks_yield_ore['raffle'], t[1])
end
end
@ -116,7 +116,6 @@ local function on_player_mined_entity(event)
event.buffer.clear()
local ore = global.rocks_yield_ore['raffle'][math_random(1, global.rocks_yield_ore['size_of_raffle'])]
local player = game.players[event.player_index]
local count = get_amount(entity)
count = math_floor(count * (1 + player.force.mining_drill_productivity_bonus))
@ -127,7 +126,6 @@ local function on_player_mined_entity(event)
local position = {x = entity.position.x, y = entity.position.y}
local ore_amount = math_floor(count * 0.85) + 1
local stone_amount = math_floor(count * 0.15) + 1
player.surface.create_entity({name = 'flying-text', position = position, text = '+' .. ore_amount .. ' [img=item/' .. ore .. ']', color = {r = 200, g = 160, b = 30}})
create_particles(player.surface, particles[ore], position, 64, {x = player.position.x, y = player.position.y})

View File

@ -32,7 +32,7 @@ function Public.set_health_modifier(force_index, modifier)
end
function Public.reset_tables()
for k, v in pairs(fhb) do
for k, _ in pairs(fhb) do
fhb[k] = nil
end
end

View File

@ -1,6 +1,5 @@
local Global = require 'utils.global'
local surface_name = 'amap'
local WPT = require 'maps.amap.table'
local Reset = require 'maps.amap.soft_reset'
local Public = {}

View File

@ -32,7 +32,7 @@ function Public.set_health_modifier(force_index, modifier)
end
function Public.reset_tables()
for k, v in pairs(fhb) do
for k, _ in pairs(fhb) do
fhb[k] = nil
end
end

View File

@ -4,10 +4,7 @@ require 'maps.hunger_games_map_intro'
require 'modules.hunger_games'
require 'modules.dynamic_player_spawn'
local simplex_noise = require 'utils.simplex_noise'
simplex_noise = simplex_noise.d2
local event = require 'utils.event'
local table_insert = table.insert
local Event = require 'utils.event'
local math_random = math.random
local map_functions = require 'tools.map_functions'
@ -73,5 +70,5 @@ local function on_chunk_generated(event)
end
end
event.add(defines.events.on_player_joined_game, on_player_joined_game)
event.add(defines.events.on_chunk_generated, on_chunk_generated)
Event.add(defines.events.on_player_joined_game, on_player_joined_game)
Event.add(defines.events.on_chunk_generated, on_chunk_generated)

View File

@ -1,5 +1,5 @@
-- Biter Battles -- mewmew made this --
--luacheck:ignore
local Server = require 'utils.server'
local Score = require 'comfy_panel.score'
local Global = require 'utils.global'

View File

@ -1,3 +1,4 @@
--luacheck:ignore
local simplex_noise = require 'utils.simplex_noise'
local simplex_noise = simplex_noise.d2
local event = require 'utils.event'

View File

@ -1,3 +1,4 @@
--luacheck:ignore
local simplex_noise = require 'tools.simplex_noise'
local Event = require 'utils.event'
biter_battles_terrain = {}

View File

@ -1,3 +1,4 @@
--luacheck:ignore
local Public = {}
local BiterRaffle = require 'maps.biter_battles_v2.biter_raffle'
local Functions = require 'maps.biter_battles_v2.functions'
@ -42,7 +43,7 @@ local threat_values = {
local function get_active_biter_count(biter_force_name)
local count = 0
for _, biter in pairs(global.active_biters[biter_force_name]) do
for _, _ in pairs(global.active_biters[biter_force_name]) do
count = count + 1
end
return count
@ -256,7 +257,7 @@ local function select_units_around_spawner(spawner, force_name, side_target)
--Manual spawning of units
local roll_type = unit_type_raffle[math_random(1, size_of_unit_type_raffle)]
for c = 1, max_unit_count - unit_count, 1 do
for _ = 1, max_unit_count - unit_count, 1 do
if threat < 0 then
break
end
@ -352,7 +353,7 @@ end
local function get_active_threat(biter_force_name)
local active_threat = 0
for unit_number, biter in pairs(global.active_biters[biter_force_name]) do
for _, biter in pairs(global.active_biters[biter_force_name]) do
if biter.entity then
if biter.entity.valid then
active_threat = active_threat + threat_values[biter.entity.name]
@ -436,7 +437,6 @@ local function create_attack_group(surface, force_name, biter_force_name)
end
Public.pre_main_attack = function()
local surface = game.surfaces['biter_battles']
local force_name = global.next_attack
if not global.training_mode or (global.training_mode and #game.forces[force_name].connected_players > 0) then
@ -476,7 +476,7 @@ Public.wake_up_sleepy_groups = function()
local biter_force_name = force_name .. '_biters'
local entity
local unit_group
for unit_number, biter in pairs(global.active_biters[biter_force_name]) do
for _, biter in pairs(global.active_biters[biter_force_name]) do
entity = biter.entity
if entity then
if entity.valid then

View File

@ -1,3 +1,4 @@
--luacheck:ignore
local Public = {}
local math_random = math.random
local math_floor = math.floor

View File

@ -1,3 +1,4 @@
--luacheck:ignore
local Server = require 'utils.server'
local mapkeeper = '[color=blue]Mapkeeper:[/color]'

View File

@ -1,3 +1,4 @@
--luacheck:ignore
local bb_config = require 'maps.biter_battles_v2.config'
local event = require 'utils.event'
local Server = require 'utils.server'

View File

@ -1,3 +1,4 @@
--luacheck:ignore
local bb_config = require 'maps.biter_battles_v2.config'
local Force_health_booster = require 'modules.force_health_booster'
local Functions = require 'maps.biter_battles_v2.functions'

View File

@ -1,3 +1,4 @@
--luacheck:ignore
local string_sub = string.sub
local math_random = math.random
local math_round = math.round

View File

@ -1,3 +1,4 @@
--luacheck:ignore
local Functions = require 'maps.biter_battles_v2.functions'
local Gui = require 'maps.biter_battles_v2.gui'
local Init = require 'maps.biter_battles_v2.init'

View File

@ -1,3 +1,4 @@
--luacheck:ignore
local Public = {}
local Server = require 'utils.server'

View File

@ -1,3 +1,4 @@
--luacheck:ignore
local Terrain = require 'maps.biter_battles_v2.terrain'
local Force_health_booster = require 'modules.force_health_booster'
local Score = require 'comfy_panel.score'

View File

@ -1,3 +1,4 @@
--luacheck:ignore
-- Biter Battles v2 -- by MewMew
local Ai = require 'maps.biter_battles_v2.ai'

View File

@ -1,3 +1,4 @@
--luacheck:ignore
local Public = {}
local Functions = require 'maps.biter_battles_v2.functions'

View File

@ -1,3 +1,4 @@
--luacheck:ignore
-- science logs tab --
local Tabs = require 'comfy_panel.main'

View File

@ -1,3 +1,4 @@
--luacheck:ignore
local Public = {}
local Server = require 'utils.server'

View File

@ -1,3 +1,4 @@
--luacheck:ignore
local Public = {}
local LootRaffle = require 'functions.loot_raffle'
local BiterRaffle = require 'functions.biter_raffle'

View File

@ -27,7 +27,7 @@ function Public.unit_health_buttons(player)
button.style.minimal_height = 38
button.style.minimal_width = 78
button.style.padding = 2
local button = player.gui.top.add({type = 'sprite-button', name = 'health_boost_east', caption = 1, tooltip = 'Health modfier of east side biters.\nIncreases by feeding.'})
button = player.gui.top.add({type = 'sprite-button', name = 'health_boost_east', caption = 1, tooltip = 'Health modfier of east side biters.\nIncreases by feeding.'})
button.style.font = 'heading-1'
button.style.font_color = {r = 180, g = 180, b = 0}
button.style.minimal_height = 38

View File

@ -1,3 +1,4 @@
--luacheck: ignore
require 'modules.no_turrets'
require 'modules.no_acid_puddles'
local Tabs = require 'comfy_panel.main'
@ -11,7 +12,6 @@ local Unit_health_booster = require 'modules.biter_health_booster'
local Map = require 'modules.map_info'
local Global = require 'utils.global'
local Server = require 'utils.server'
local Public = {}
local math_random = math.random
@ -55,7 +55,7 @@ for x = worm_turret_spawn_radius * -1, 0, 1 do
end
end
local function spawn_worm_turret(surface, force_name, food_item)
local function spawn_worm_turret(surface, force_name)
local r_max = surface.count_entities_filtered({type = 'turret', force = force_name}) + 1
if r_max > 256 then
return

View File

@ -1,3 +1,4 @@
--luacheck: ignore
local raffle = {
['automation-science-pack'] = {{}, 1},
['logistic-science-pack'] = {{}, 2},

View File

@ -1,3 +1,4 @@
--luacheck: ignore
----------share chat with spectator force-------------------
local function on_console_chat(event)
if not event.message then

View File

@ -1,3 +1,4 @@
--luacheck: ignore
local Public = {}
local math_random = math.random

View File

@ -1,3 +1,4 @@
--luacheck: ignore
local math_abs = math.abs
local math_random = math.random
local GetNoise = require 'utils.get_noise'

View File

@ -1,3 +1,4 @@
--luacheck: ignore
-- Cave Miner -- mewmew made this --
-- modified by Gerkiz --

View File

@ -1,3 +1,4 @@
--luacheck: ignore
local Event = require 'utils.event'
local damage_per_explosive = 100

View File

@ -1,3 +1,4 @@
--luacheck: ignore
--choppy-- mewmew made this --
-- modified by gerkiz

View File

@ -1,3 +1,4 @@
--luacheck: ignore
local Event = require 'utils.event'
local Global = require 'utils.global'

View File

@ -1,3 +1,4 @@
--luacheck: ignore
local Public = {}
local GetNoise = require 'utils.get_noise'

View File

@ -1,3 +1,4 @@
--luacheck: ignore
local Constants = require 'maps.cave_miner_v2.constants'
local Event = require 'utils.event'
local Explosives = require 'modules.explosives_2'

View File

@ -1,3 +1,4 @@
--luacheck: ignore
local Public = {}
local Constants = require 'maps.cave_miner_v2.constants'

View File

@ -1,3 +1,4 @@
--luacheck: ignore
local Functions = require 'maps.cave_miner_v2.functions'
local max_spill = 60

View File

@ -1,3 +1,4 @@
--luacheck: ignore
local Public = {}
local GetNoise = require 'utils.get_noise'

View File

@ -166,13 +166,13 @@ local function fish_in_space_gui(player)
progressbar.style.maximal_width = 100
progressbar.style.top_padding = 10
local label = frame.add({type = 'label', caption = this.fish_in_space .. '/' .. tostring(this.catplanet_goals[i + 1].goal)})
label = frame.add({type = 'label', caption = this.fish_in_space .. '/' .. tostring(this.catplanet_goals[i + 1].goal)})
label.style.font_color = {r = 0.33, g = 0.66, b = 0.9}
if this.catplanet_goals[i].rank then
local label = frame.add({type = 'label', caption = ' ~Rank~'})
label = frame.add({type = 'label', caption = ' ~Rank~'})
label.style.font_color = {r = 0.75, g = 0.75, b = 0.75}
local label = frame.add({type = 'label', caption = this.catplanet_goals[i].rank})
label = frame.add({type = 'label', caption = this.catplanet_goals[i].rank})
label.style.font = 'default-bold'
label.style.font_color = this.catplanet_goals[i].color
end

View File

@ -970,8 +970,8 @@ local market_kill_visuals = function()
return
end
local is_branch_18 = sub(branch_version, 3, 4)
local get_active_version = sub(game.active_mods.base, 3, 4)
-- local is_branch_18 = sub(branch_version, 3, 4)
-- local get_active_version = sub(game.active_mods.base, 3, 4)
if not surface or not surface.valid then
return
@ -981,8 +981,8 @@ local market_kill_visuals = function()
return
end
local m = 32
local m2 = m * 0.005
-- local m = 32
-- local m2 = m * 0.005
-- if get_active_version >= is_branch_18 then
-- for i = 1, 1024, 1 do
-- surface.create_particle(

View File

@ -3,10 +3,7 @@ local BiterRaffle = require 'functions.biter_raffle'
local DungeonsTable = require 'maps.dungeons.table'
local table_shuffle_table = table.shuffle_table
local table_insert = table.insert
local table_remove = table.remove
local math_random = math.random
local math_abs = math.abs
local math_sqrt = math.sqrt
local math_floor = math.floor
@ -15,7 +12,7 @@ local function add_enemy_units(surface, room)
for _, tile in pairs(room.room_tiles) do
if math_random(1, 2) == 1 then
local name = BiterRaffle.roll('spitter', Functions.get_dungeon_evolution_factor(surface.index) * 1.5)
local unit = surface.create_entity({name = name, position = tile.position, force = dungeontable.enemy_forces[surface.index]})
surface.create_entity({name = name, position = tile.position, force = dungeontable.enemy_forces[surface.index]})
end
end
end

View File

@ -1,121 +0,0 @@
0.26
the west side now has worms and rocks as obstacles instead of nests
biter wave fixes
0.25
evacuate infinite fish to win
the west side now has far away nests, to prevent unnecessary exploration
0.24
evacuate 100000 fish to win the game
0.23
very late waves will only yield behemoths now
shotgun damage increase
0.22
wave sending improvements
0.21
players become untargetable after market loss
randomized spawn ore locations
0.20
mine slots are cheaper
flamethrower slots are cheaper
0.19
added water ponds to the west
0.18
artillery tech is no longer available from start
researching tanks will grant the artillery tech early
added corpse cleaning every wave start
removed flamethrower damage upgrades
wave improvements
atomic bomb is a lot more expensive
added boss waves
0.17
artillery tech is now unlocked from the start
artillery shells are now more expensive
land mines are immune to biter explosions
0.16
all non-player kills will yield full coin rewards
turret slot price adjustments
0.15
max biter limit to prevent slowdown
wave spawn changes
0.14
the artillery now yields full coin rewards
spawners now grant coins
less biters in the west
0.13
more lategame modifier adjustments
explosions get stronger in very lategame
artillery allowed, added to the market and added to slots
behemoths can spawn worms in endgame stage
market price adjustments
player entities beyond the barrier will get damaged each wave
player blueprints beyond the barrier will get removed each wave
biter explosions no create visual explosions on the entities they affect
0.12
added starting no-attack grace period
added flamethrower turret
added non-player coin drops
0.11
added spawn oil
wave adjustments
0.10
biter waves complete rework
turret slots can now be purchased in the market
0.09
biter wave fixes
new turret and land mine limits
evolution scales with wave count
0.08
players and passengers in cars, tanks and trains now properly get their coin rewards
0.07
biters no longer drop random items
biter kills now grant coins
market has items to sell for coins
fixed spawn water
a certain amount of gun or laser turrets can be placed per area
0.06
custom spawn ores
0.05
hourglass map layout changes
wave interval is slower
force barrier to the biter territory
0.04
even more biters explosions
0.03
biters explode and splice
added worms
added wave message
spawners spawn biters
0.02
biters sometimes drop loot
biter waves are slower but bigger
added teleporters as loot
removed trees and cliffs on the biter side
biter wave changes
added wave counter
0.01
blubby blubby fish