1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2024-12-12 10:04:40 +02:00

Merge branch 'donator-perks' of https://github.com/grilledham/RedMew into dev_reports

This commit is contained in:
grilledham 2018-08-13 17:27:39 +01:00
commit 1747c7e651
14 changed files with 885 additions and 19 deletions

View File

@ -9,7 +9,7 @@ require 'nuke_control'
require 'follow'
require 'autodeconstruct'
require 'corpse_util'
require 'infinite_storage_chest'
--require 'infinite_storage_chest'
require 'fish_market'
require 'reactor_meltdown'
require 'map_layout'
@ -170,8 +170,39 @@ Event.add(
end
)
global.cheated_items = {}
local minutes_to_ticks = 60 * 60
local hours_to_ticks = 60 * 60 * 60
local ticks_to_minutes = 1 / minutes_to_ticks
local ticks_to_hours = 1 / hours_to_ticks
local function format_time(ticks)
local result = {}
local hours = math.floor(ticks * ticks_to_hours)
if hours > 0 then
ticks = ticks - hours * hours_to_ticks
table.insert(result, hours)
if hours == 1 then
table.insert(result, 'hour')
else
table.insert(result, 'hours')
end
end
local minutes = math.floor(ticks * ticks_to_minutes)
table.insert(result, minutes)
if minutes == 1 then
table.insert(result, 'minute')
else
table.insert(result, 'minutes')
end
return table.concat(result, ' ')
end
global.cheated_items = {}
global.cheated_items_by_timestamp = {}
Event.add(
defines.events.on_player_crafted_item,
function(event)
@ -190,17 +221,12 @@ Event.add(
cheat_items[pi] = data
end
if player.name == 'plague006' then
-- cyan player, aquamarine text
player.color = {r = 64, g = 224, b = 208, a = 0.5}
player.chat_color = {r = 175, g = 238, b = 238, a = 0.5}
end
local stack = event.item_stack
local name = stack.name
local count = data[name] or 0
data[name] = stack.count + count
local user_item_record = data[name] or {count = 0}
local count = user_item_record.count
local time = user_item_record["time"] or format_time(game.tick)
data[name] = {count = stack.count + count, time = time}
end
)

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -0,0 +1,106 @@
local b = require 'map_gen.shared.builders'
return b.decompress({
height = 99,
width = 127,
data = {
{1,127,},
{1,127,},
{1,127,},
{1,127,},
{1,127,},
{1,127,},
{1,85,2,13,1,29,},
{1,82,2,20,1,25,},
{1,80,2,24,1,23,},
{1,78,2,28,1,21,},
{1,77,2,31,1,19,},
{1,76,2,34,1,17,},
{1,75,2,36,1,16,},
{1,72,2,1,1,2,2,37,1,15,},
{1,70,2,2,1,2,2,39,1,14,},
{1,69,2,3,1,2,2,39,1,14,},
{1,68,2,4,1,1,2,41,1,13,},
{1,66,2,6,1,1,2,42,1,12,},
{1,65,2,6,1,2,2,43,1,11,},
{1,64,2,7,1,1,2,44,1,11,},
{1,63,2,8,1,1,2,15,1,1,2,29,1,10,},
{1,62,2,9,1,1,2,15,1,2,2,29,1,9,},
{1,61,2,10,1,1,2,12,1,2,2,2,1,1,2,29,1,9,},
{1,60,2,11,1,1,2,12,1,2,2,32,1,9,},
{1,59,2,10,1,3,2,13,1,1,2,33,1,8,},
{1,58,2,12,1,1,2,25,1,5,2,18,1,8,},
{1,57,2,13,1,1,2,23,1,9,2,17,1,7,},
{1,56,2,37,1,3,2,5,1,4,2,15,1,7,},
{1,55,2,37,1,2,2,4,1,3,2,3,1,2,2,14,1,7,},
{1,54,2,16,1,1,2,21,1,1,2,2,1,1,2,2,1,2,2,5,1,2,2,13,1,7,},
{1,53,2,17,1,1,2,20,1,2,2,7,1,1,2,1,1,1,2,3,1,2,2,12,1,7,},
{1,52,2,18,1,1,2,20,1,1,2,2,1,1,2,6,1,1,2,1,1,1,2,3,1,1,2,13,1,6,},
{1,52,2,18,1,2,2,18,1,2,2,16,1,1,2,12,1,6,},
{1,51,2,8,1,1,2,11,1,1,2,18,1,1,2,9,1,1,2,7,1,1,2,12,1,6,},
{1,50,2,8,1,2,2,10,1,2,2,18,1,1,2,18,1,1,2,11,1,6,},
{1,49,2,8,1,3,2,11,1,1,2,17,1,2,2,7,1,5,2,6,1,1,2,11,1,6,},
{1,48,2,9,1,2,2,12,1,1,2,17,1,2,2,6,1,3,2,1,1,4,2,2,1,1,2,1,1,1,2,11,1,6,},
{1,47,2,23,1,2,2,17,1,2,2,6,1,2,2,3,1,2,2,5,1,1,2,11,1,6,},
{1,46,2,25,1,1,2,17,1,2,2,5,1,2,2,3,1,3,2,5,1,1,2,11,1,6,},
{1,45,2,26,1,2,2,16,1,2,2,5,1,3,2,3,1,2,2,2,1,1,2,2,1,1,2,11,1,6,},
{1,44,2,27,1,2,2,16,1,2,2,1,1,1,2,2,1,3,2,3,1,5,2,3,1,1,2,11,1,6,},
{1,43,2,29,1,1,2,16,1,2,2,4,1,1,2,1,1,1,2,4,1,1,2,2,1,2,2,2,1,1,2,11,1,6,},
{1,43,2,29,1,1,2,17,1,1,2,6,1,8,2,3,1,2,2,11,1,6,},
{1,41,2,31,1,2,2,16,1,2,2,3,1,1,2,3,1,2,2,4,1,1,2,2,1,1,2,12,1,6,},
{1,41,2,31,1,2,2,16,1,2,2,3,1,1,2,12,1,1,2,11,1,7,},
{1,40,2,33,1,1,2,17,1,2,2,14,1,2,2,11,1,7,},
{1,39,2,10,1,2,2,22,1,2,2,17,1,1,2,11,1,1,2,2,1,1,2,12,1,7,},
{1,38,2,10,1,3,2,22,1,2,2,17,1,2,2,10,1,1,2,1,1,2,2,12,1,7,},
{1,38,2,10,1,2,2,23,1,2,2,18,1,2,2,8,1,1,2,1,1,3,2,12,1,7,},
{1,37,2,11,1,2,2,24,1,2,2,18,1,2,2,2,1,1,2,5,1,2,2,13,1,8,},
{1,36,2,38,1,2,2,19,1,10,2,14,1,8,},
{1,36,2,26,1,3,2,9,1,2,2,22,1,3,2,18,1,8,},
{1,35,2,26,1,3,2,11,1,2,2,41,1,9,},
{1,35,2,25,1,3,2,12,1,3,2,40,1,9,},
{1,34,2,42,1,2,2,39,1,10,},
{1,33,2,43,1,2,2,39,1,10,},
{1,33,2,44,1,2,2,38,1,10,},
{1,33,2,44,1,3,2,36,1,11,},
{1,32,2,8,1,2,2,36,1,2,2,35,1,12,},
{1,32,2,8,1,2,2,37,1,2,2,16,1,1,2,3,1,2,2,12,1,12,},
{1,31,2,8,1,2,2,9,1,2,2,28,1,2,2,14,1,2,2,3,1,1,2,12,1,13,},
{1,31,2,7,1,2,2,9,1,3,2,29,1,2,2,13,1,2,2,15,1,14,},
{1,31,2,18,1,1,2,32,1,2,2,29,1,14,},
{1,30,2,53,1,2,2,27,1,15,},
{1,30,2,54,1,2,2,25,1,16,},
{1,30,2,55,1,3,2,22,1,17,},
{1,29,2,57,1,3,2,20,1,18,},
{1,29,2,59,1,4,2,16,1,19,},
{1,29,2,44,1,4,2,13,1,5,2,12,1,20,},
{1,28,2,30,1,5,2,8,1,6,2,16,1,6,2,4,1,24,},
{1,28,2,29,1,4,2,35,1,31,},
{1,27,2,75,1,25,},
{1,9,2,5,1,13,2,74,1,26,},
{1,7,2,8,1,7,2,3,1,3,2,70,1,29,},
{1,7,2,8,1,6,2,5,1,5,2,66,1,30,},
{1,6,2,9,1,5,2,8,1,3,2,62,1,34,},
{1,6,2,8,1,5,2,9,1,3,2,55,1,1,2,1,1,39,},
{1,6,2,22,1,11,2,33,1,2,2,8,1,45,},
{1,6,2,22,1,14,2,35,1,50,},
{1,7,2,21,1,20,2,1,1,3,2,5,1,2,2,4,1,64,},
{1,10,2,14,1,1,2,2,1,100,},
{1,12,2,11,1,104,},
{1,11,2,8,1,1,2,1,1,106,},
{1,11,2,8,1,108,},
{1,11,2,8,1,108,},
{1,11,2,9,1,107,},
{1,10,2,9,1,108,},
{1,10,2,10,1,107,},
{1,10,2,9,1,108,},
{1,10,2,10,1,107,},
{1,11,2,8,1,108,},
{1,11,2,6,1,1,2,1,1,108,},
{1,12,2,6,1,109,},
{1,127,},
{1,127,},
{1,127,},
{1,127,},
{1,127,},
{1,127,},
}
})

View File

@ -0,0 +1,266 @@
local b = require 'map_gen.shared.builders'
return b.decompress({
height = 259,
width = 320,
data = {
{1,320,},
{1,320,},
{1,320,},
{1,320,},
{1,320,},
{1,320,},
{1,320,},
{1,320,},
{1,320,},
{1,320,},
{1,73,2,3,1,166,2,6,1,72,},
{1,70,2,9,1,161,2,11,1,69,},
{1,68,2,12,1,158,2,15,1,67,},
{1,66,2,15,1,157,2,17,1,65,},
{1,63,2,19,1,155,2,20,1,63,},
{1,61,2,22,1,153,2,23,1,61,},
{1,60,2,24,1,151,2,26,1,59,},
{1,58,2,27,1,150,2,27,1,58,},
{1,56,2,29,1,149,2,30,1,56,},
{1,54,2,32,1,148,2,32,1,54,},
{1,53,2,33,1,66,2,15,1,66,2,35,1,52,},
{1,51,2,36,1,55,2,36,1,55,2,36,1,51,},
{1,50,2,37,1,49,2,48,1,48,2,38,1,50,},
{1,48,2,40,1,43,2,57,1,44,2,40,1,48,},
{1,47,2,41,1,39,2,65,1,39,2,42,1,47,},
{1,46,2,43,1,34,2,73,1,35,2,44,1,45,},
{1,44,2,45,1,31,2,79,1,31,2,46,1,44,},
{1,43,2,46,1,28,2,85,1,28,2,47,1,43,},
{1,42,2,48,1,24,2,91,1,25,2,49,1,41,},
{1,41,2,49,1,22,2,96,1,21,2,51,1,40,},
{1,39,2,51,1,19,2,101,1,19,2,52,1,39,},
{1,38,2,53,1,16,2,105,1,17,2,53,1,38,},
{1,37,2,54,1,14,2,109,1,14,2,55,1,37,},
{1,36,2,55,1,12,2,113,1,12,2,56,1,36,},
{1,35,2,56,1,10,2,117,1,10,2,57,1,35,},
{1,34,2,58,1,7,2,121,1,8,2,58,1,34,},
{1,33,2,59,1,7,2,121,1,7,2,60,1,33,},
{1,32,2,60,1,8,2,120,1,7,2,61,1,32,},
{1,31,2,62,1,7,2,120,1,7,2,62,1,31,},
{1,30,2,63,1,7,2,119,1,8,2,63,1,30,},
{1,29,2,64,1,7,2,119,1,7,2,65,1,29,},
{1,28,2,65,1,7,2,119,1,7,2,66,1,28,},
{1,27,2,67,1,7,2,118,1,7,2,67,1,27,},
{1,26,2,68,1,7,2,118,1,7,2,68,1,26,},
{1,25,2,69,1,7,2,117,1,8,2,69,1,25,},
{1,25,2,69,1,7,2,117,1,7,2,71,1,24,},
{1,24,2,70,1,8,2,116,1,7,2,71,1,24,},
{1,23,2,72,1,7,2,116,1,7,2,72,1,23,},
{1,22,2,73,1,7,2,116,1,7,2,73,1,22,},
{1,21,2,74,1,7,2,115,1,8,2,74,1,21,},
{1,21,2,74,1,7,2,115,1,7,2,76,1,20,},
{1,20,2,75,1,7,2,115,1,7,2,76,1,20,},
{1,19,2,76,1,8,2,114,1,7,2,77,1,19,},
{1,18,2,78,1,7,2,114,1,7,2,78,1,18,},
{1,17,2,79,1,7,2,114,1,7,2,79,1,17,},
{1,17,2,79,1,7,2,114,1,7,2,79,1,17,},
{1,16,2,80,1,7,2,113,1,7,2,81,1,16,},
{1,15,2,81,1,7,2,113,1,7,2,82,1,15,},
{1,15,2,81,1,8,2,112,1,7,2,82,1,15,},
{1,14,2,83,1,7,2,112,1,7,2,83,1,14,},
{1,13,2,84,1,7,2,112,1,7,2,84,1,13,},
{1,13,2,84,1,7,2,112,1,7,2,84,1,13,},
{1,12,2,85,1,7,2,111,1,8,2,85,1,12,},
{1,11,2,86,1,7,2,111,1,7,2,87,1,11,},
{1,11,2,86,1,7,2,111,1,7,2,87,1,11,},
{1,10,2,87,1,7,2,111,1,7,2,88,1,10,},
{1,10,2,88,1,7,2,110,1,7,2,88,1,10,},
{1,9,2,89,1,7,2,110,1,7,2,89,1,9,},
{1,9,2,89,1,7,2,110,1,7,2,89,1,9,},
{1,9,2,89,1,7,2,110,1,7,2,89,1,9,},
{1,8,2,90,1,7,2,109,1,7,2,90,1,9,},
{1,8,2,90,1,7,2,109,1,7,2,90,1,9,},
{1,8,2,90,1,7,2,109,1,7,2,90,1,9,},
{1,9,2,89,1,7,2,109,1,7,2,90,1,9,},
{1,9,2,90,1,7,2,108,1,7,2,90,1,9,},
{1,9,2,90,1,7,2,108,1,7,2,89,1,10,},
{1,10,2,89,1,7,2,108,1,7,2,89,1,10,},
{1,10,2,89,1,7,2,108,1,7,2,88,1,11,},
{1,11,2,88,1,7,2,108,1,7,2,88,1,11,},
{1,11,2,88,1,7,2,107,1,8,2,87,1,12,},
{1,12,2,87,1,7,2,107,1,8,2,86,1,13,},
{1,13,2,86,1,7,2,107,1,7,2,86,1,14,},
{1,14,2,85,1,7,2,107,1,7,2,86,1,14,},
{1,14,2,85,1,7,2,107,1,7,2,84,1,16,},
{1,16,2,83,1,8,2,106,1,7,2,83,1,17,},
{1,17,2,83,1,7,2,106,1,7,2,82,1,18,},
{1,18,2,82,1,7,2,106,1,7,2,81,1,19,},
{1,19,2,81,1,7,2,106,1,7,2,80,1,20,},
{1,20,2,80,1,7,2,106,1,7,2,79,1,21,},
{1,21,2,79,1,7,2,106,1,7,2,78,1,22,},
{1,23,2,77,1,7,2,106,1,7,2,76,1,24,},
{1,24,2,76,1,7,2,106,1,7,2,74,1,26,},
{1,26,2,74,1,7,2,105,1,8,2,73,1,27,},
{1,28,2,72,1,7,2,105,1,8,2,71,1,29,},
{1,29,2,71,1,7,2,105,1,7,2,70,1,31,},
{1,31,2,69,1,7,2,105,1,7,2,69,1,32,},
{1,33,2,67,1,7,2,105,1,7,2,67,1,34,},
{1,35,2,65,1,7,2,105,1,7,2,65,1,36,},
{1,36,2,64,1,8,2,104,1,7,2,63,1,38,},
{1,38,2,62,1,8,2,104,1,8,2,60,1,40,},
{1,41,2,59,1,8,2,104,1,8,2,58,1,42,},
{1,43,2,57,1,8,2,104,1,8,2,55,1,45,},
{1,45,2,54,1,9,2,104,1,9,2,52,1,47,},
{1,48,2,51,1,9,2,104,1,9,2,49,1,50,},
{1,50,2,48,1,10,2,104,1,10,2,46,1,52,},
{1,53,2,45,1,9,2,105,1,11,2,42,1,55,},
{1,56,2,41,1,10,2,106,1,11,2,38,1,58,},
{1,60,2,36,1,11,2,106,1,12,2,33,1,62,},
{1,42,2,1,1,21,2,30,1,13,2,106,1,14,2,27,1,21,2,3,1,42,},
{1,42,2,4,1,22,2,23,1,15,2,108,1,17,2,17,1,24,2,6,1,42,},
{1,41,2,8,1,27,2,11,1,19,2,108,1,56,2,8,1,42,},
{1,41,2,10,1,54,2,110,1,52,2,11,1,42,},
{1,41,2,13,1,50,2,113,1,46,2,16,1,41,},
{1,41,2,17,1,45,2,115,1,42,2,19,1,41,},
{1,40,2,21,1,40,2,118,1,38,2,22,1,41,},
{1,40,2,25,1,35,2,5,1,6,2,98,1,4,2,8,1,31,2,27,1,41,},
{1,40,2,29,1,28,2,6,1,10,2,94,1,9,2,8,1,23,2,32,1,41,},
{1,40,2,35,1,19,2,8,1,13,2,90,1,12,2,12,1,11,2,39,1,41,},
{1,40,2,60,1,16,2,88,1,14,2,62,1,40,},
{1,40,2,59,1,18,2,86,1,17,2,60,1,40,},
{1,39,2,59,1,19,2,85,1,18,2,60,1,40,},
{1,39,2,59,1,20,2,84,1,19,2,59,1,40,},
{1,39,2,58,1,21,2,83,1,21,2,58,1,40,},
{1,39,2,58,1,22,2,82,1,21,2,58,1,40,},
{1,39,2,58,1,22,2,81,1,22,2,58,1,40,},
{1,39,2,57,1,24,2,80,1,23,2,57,1,40,},
{1,39,2,57,1,24,2,79,1,24,2,57,1,40,},
{1,39,2,57,1,24,2,79,1,24,2,57,1,40,},
{1,39,2,57,1,24,2,79,1,24,2,58,1,39,},
{1,39,2,57,1,24,2,79,1,25,2,57,1,39,},
{1,39,2,56,1,26,2,78,1,25,2,57,1,39,},
{1,39,2,56,1,26,2,77,1,26,2,57,1,39,},
{1,39,2,56,1,26,2,77,1,26,2,57,1,39,},
{1,39,2,56,1,26,2,77,1,26,2,57,1,39,},
{1,39,2,56,1,26,2,77,1,26,2,57,1,39,},
{1,39,2,56,1,26,2,77,1,26,2,57,1,39,},
{1,39,2,56,1,26,2,77,1,26,2,57,1,39,},
{1,39,2,57,1,25,2,77,1,26,2,57,1,39,},
{1,39,2,57,1,24,2,79,1,25,2,57,1,39,},
{1,39,2,57,1,24,2,79,1,24,2,58,1,39,},
{1,39,2,57,1,24,2,79,1,24,2,58,1,39,},
{1,39,2,57,1,24,2,80,1,23,2,58,1,39,},
{1,39,2,58,1,22,2,81,1,23,2,58,1,39,},
{1,39,2,58,1,22,2,81,1,22,2,58,1,40,},
{1,39,2,59,1,20,2,83,1,21,2,58,1,40,},
{1,39,2,59,1,20,2,83,1,20,2,59,1,40,},
{1,39,2,60,1,18,2,85,1,19,2,59,1,40,},
{1,39,2,61,1,16,2,86,1,18,2,60,1,40,},
{1,39,2,61,1,16,2,87,1,16,2,61,1,40,},
{1,39,2,63,1,12,2,90,1,14,2,62,1,40,},
{1,40,2,63,1,10,2,92,1,12,2,63,1,40,},
{1,40,2,65,1,6,2,96,1,9,2,64,1,40,},
{1,40,2,169,1,4,2,66,1,41,},
{1,40,2,119,1,1,2,119,1,41,},
{1,40,2,109,1,21,2,109,1,41,},
{1,40,2,103,1,34,2,102,1,41,},
{1,41,2,96,1,44,2,98,1,41,},
{1,41,2,93,1,51,2,93,1,42,},
{1,41,2,90,1,23,2,11,1,24,2,89,1,42,},
{1,41,2,87,1,18,2,28,1,18,2,86,1,42,},
{1,42,2,83,1,16,2,38,1,15,2,84,1,42,},
{1,42,2,81,1,14,2,46,1,13,2,82,1,42,},
{1,42,2,79,1,12,2,53,1,13,2,78,1,43,},
{1,42,2,76,1,12,2,59,1,12,2,76,1,43,},
{1,42,2,75,1,11,2,64,1,10,2,75,1,43,},
{1,43,2,72,1,11,2,68,1,10,2,72,1,44,},
{1,43,2,71,1,10,2,72,1,9,2,71,1,44,},
{1,43,2,69,1,10,2,76,1,9,2,69,1,44,},
{1,44,2,67,1,9,2,79,1,9,2,68,1,44,},
{1,44,2,66,1,9,2,82,1,8,2,66,1,45,},
{1,44,2,65,1,8,2,85,1,8,2,65,1,45,},
{1,45,2,62,1,9,2,87,1,9,2,63,1,45,},
{1,45,2,61,1,9,2,90,1,8,2,61,1,46,},
{1,45,2,60,1,9,2,92,1,8,2,60,1,46,},
{1,46,2,59,1,8,2,25,1,2,2,39,1,2,2,26,1,8,2,58,1,47,},
{1,46,2,58,1,8,2,25,1,4,2,37,1,4,2,26,1,7,2,58,1,47,},
{1,47,2,56,1,8,2,25,1,6,2,35,1,6,2,26,1,7,2,57,1,47,},
{1,47,2,55,1,8,2,25,1,8,2,34,1,7,2,26,1,7,2,55,1,48,},
{1,48,2,53,1,8,2,26,1,8,2,33,1,8,2,27,1,7,2,54,1,48,},
{1,48,2,53,1,7,2,27,1,8,2,33,1,9,2,26,1,7,2,53,1,49,},
{1,48,2,52,1,8,2,26,1,10,2,31,1,10,2,27,1,7,2,52,1,49,},
{1,49,2,51,1,7,2,27,1,10,2,31,1,10,2,28,1,6,2,51,1,50,},
{1,50,2,49,1,7,2,28,1,10,2,31,1,10,2,28,1,7,2,50,1,50,},
{1,50,2,49,1,7,2,27,1,12,2,30,1,11,2,28,1,6,2,50,1,50,},
{1,50,2,48,1,7,2,28,1,12,2,29,1,12,2,28,1,7,2,48,1,51,},
{1,51,2,47,1,7,2,28,1,12,2,29,1,12,2,29,1,6,2,47,1,52,},
{1,51,2,47,1,7,2,28,1,12,2,29,1,12,2,29,1,6,2,47,1,52,},
{1,52,2,45,1,7,2,29,1,12,2,29,1,12,2,29,1,7,2,45,1,53,},
{1,52,2,45,1,7,2,29,1,12,2,29,1,12,2,30,1,6,2,45,1,53,},
{1,53,2,44,1,7,2,29,1,12,2,29,1,13,2,29,1,6,2,44,1,54,},
{1,54,2,43,1,7,2,28,1,13,2,29,1,13,2,29,1,6,2,44,1,54,},
{1,54,2,43,1,7,2,28,1,13,2,29,1,13,2,29,1,7,2,42,1,55,},
{1,55,2,41,1,7,2,29,1,14,2,28,1,13,2,29,1,7,2,41,1,56,},
{1,55,2,41,1,7,2,29,1,14,2,28,1,13,2,29,1,7,2,41,1,56,},
{1,56,2,40,1,7,2,29,1,14,2,28,1,13,2,29,1,7,2,40,1,57,},
{1,57,2,39,1,7,2,29,1,14,2,28,1,13,2,29,1,7,2,40,1,57,},
{1,57,2,39,1,7,2,29,1,14,2,28,1,13,2,29,1,7,2,39,1,58,},
{1,58,2,39,1,7,2,28,1,14,2,28,1,13,2,29,1,7,2,38,1,59,},
{1,59,2,38,1,7,2,29,1,12,2,29,1,13,2,29,1,7,2,38,1,59,},
{1,59,2,38,1,7,2,29,1,12,2,29,1,13,2,29,1,6,2,38,1,60,},
{1,60,2,37,1,7,2,29,1,12,2,29,1,12,2,30,1,6,2,37,1,61,},
{1,61,2,36,1,7,2,29,1,12,2,29,1,12,2,29,1,7,2,36,1,62,},
{1,62,2,36,1,7,2,28,1,12,2,29,1,12,2,29,1,6,2,37,1,62,},
{1,63,2,35,1,7,2,28,1,12,2,29,1,12,2,29,1,6,2,36,1,63,},
{1,63,2,36,1,6,2,28,1,12,2,29,1,12,2,28,1,7,2,35,1,64,},
{1,64,2,35,1,7,2,27,1,12,2,30,1,11,2,28,1,6,2,35,1,65,},
{1,65,2,34,1,8,2,27,1,10,2,31,1,10,2,28,1,7,2,34,1,66,},
{1,66,2,34,1,7,2,27,1,10,2,31,1,10,2,28,1,6,2,34,1,67,},
{1,67,2,34,1,7,2,26,1,10,2,31,1,10,2,27,1,7,2,34,1,67,},
{1,68,2,33,1,7,2,27,1,9,2,32,1,9,2,26,1,7,2,34,1,68,},
{1,69,2,33,1,7,2,26,1,8,2,33,1,8,2,27,1,6,2,34,1,69,},
{1,70,2,32,1,8,2,25,1,8,2,33,1,8,2,26,1,7,2,33,1,70,},
{1,71,2,32,1,8,2,25,1,6,2,35,1,6,2,26,1,7,2,32,1,72,},
{1,72,2,32,1,8,2,24,1,6,2,36,1,5,2,25,1,7,2,32,1,73,},
{1,72,2,33,1,8,2,24,1,3,2,39,1,3,2,25,1,7,2,32,1,74,},
{1,73,2,33,1,8,2,92,1,7,2,33,1,74,},
{1,74,2,33,1,8,2,90,1,7,2,33,1,75,},
{1,75,2,33,1,8,2,87,1,8,2,33,1,76,},
{1,76,2,33,1,9,2,84,1,8,2,33,1,77,},
{1,78,2,32,1,9,2,82,1,8,2,32,1,79,},
{1,79,2,33,1,9,2,78,1,8,2,33,1,80,},
{1,80,2,33,1,9,2,75,1,9,2,33,1,81,},
{1,81,2,34,1,9,2,71,1,9,2,34,1,82,},
{1,83,2,33,1,10,2,67,1,10,2,34,1,83,},
{1,84,2,34,1,11,2,62,1,10,2,34,1,85,},
{1,85,2,35,1,11,2,57,1,11,2,35,1,86,},
{1,87,2,35,1,12,2,52,1,11,2,36,1,87,},
{1,88,2,36,1,13,2,45,1,13,2,36,1,89,},
{1,90,2,36,1,15,2,37,1,15,2,37,1,90,},
{1,91,2,38,1,17,2,27,1,17,2,38,1,92,},
{1,93,2,39,1,26,2,4,1,25,2,40,1,93,},
{1,94,2,42,1,48,2,41,1,95,},
{1,96,2,44,1,39,2,44,1,97,},
{1,98,2,47,1,29,2,47,1,99,},
{1,99,2,58,1,5,2,58,1,100,},
{1,101,2,117,1,102,},
{1,103,2,113,1,104,},
{1,105,2,109,1,106,},
{1,107,2,105,1,108,},
{1,110,2,99,1,111,},
{1,112,2,95,1,113,},
{1,115,2,90,1,115,},
{1,118,2,84,1,118,},
{1,120,2,79,1,121,},
{1,124,2,72,1,124,},
{1,127,2,65,1,128,},
{1,131,2,57,1,132,},
{1,136,2,47,1,137,},
{1,143,2,33,1,144,},
{1,156,2,7,1,157,},
{1,320,},
{1,320,},
{1,320,},
{1,320,},
{1,320,},
{1,320,},
{1,320,},
{1,320,},
{1,320,},
}
})

View File

@ -0,0 +1,161 @@
local b = require 'map_gen.shared.builders'
local Random = require 'map_gen.shared.random'
local ore_seed = 3000
local wave = b.sine_wave(64, 16, 4)
local waves = b.single_y_pattern(wave, 64)
local bounds = b.rectangle(192, 192)
local wave_island = b.choose(bounds, waves, b.empty_shape)
local wave_island2 = b.rotate(wave_island, degrees(90))
local pattern = {
{wave_island, wave_island2},
{wave_island2, wave_island}
}
local wave_islands = b.grid_pattern(pattern, 2, 2, 192, 192)
local wave2 = b.sine_wave(64, 8, 2)
local connecting_wave = b.any {wave2, b.rotate(wave2, degrees(90))}
local connecting_waves = b.single_pattern(connecting_wave, 192, 192)
connecting_waves = b.translate(connecting_waves, 64, 64)
wave_islands = b.any {wave_islands, connecting_waves}
wave_islands = b.change_tile(wave_islands, false, 'deepwater')
wave_islands = b.rotate(wave_islands, degrees(45))
local map = b.change_map_gen_collision_tile(wave_islands, 'water-tile', 'grass-1')
map = b.scale(map, 2)
local pig = b.picture(require 'map_gen.data.presets.pig')
local ham = b.picture(require 'map_gen.data.presets.ham')
pig = b.scale(pig, 64 / 320)
ham = b.scale(ham, 64 / 127)
local ores_patch = b.circle(16)
local function value(base, mult, pow)
return function(x, y)
local d = math.sqrt(x * x + y * y)
return base + mult * d ^ pow
end
end
local function non_transform(shape)
return shape
end
local function uranium_transform(shape)
return b.scale(shape, 0.5)
end
local function oil_transform(shape)
shape = b.scale(shape, 0.5)
shape = b.throttle_world_xy(shape, 1, 5, 1, 5)
return shape
end
local ores = {
{weight = 150},
{transform = non_transform, resource = 'iron-ore', value = value(500, 0.75, 1.2), weight = 16},
{transform = non_transform, resource = 'copper-ore', value = value(400, 0.75, 1.2), weight = 10},
{transform = non_transform, resource = 'stone', value = value(250, 0.3, 1.05), weight = 3},
{transform = non_transform, resource = 'coal', value = value(400, 0.8, 1.075), weight = 8},
{transform = uranium_transform, resource = 'uranium-ore', value = value(200, 0.3, 1.025), weight = 3},
{transform = oil_transform, resource = 'crude-oil', value = value(180000, 50, 1.1), weight = 6}
}
local total_ore_weights = {}
local ore_t = 0
for _, v in ipairs(ores) do
ore_t = ore_t + v.weight
table.insert(total_ore_weights, ore_t)
end
local random_ore = Random.new(ore_seed, ore_seed * 2)
local ore_pattern = {}
for r = 1, 50 do
local row = {}
ore_pattern[r] = row
local even_r = r % 2 == 0
for c = 1, 50 do
local even_c = c % 2 == 0
local shape
if even_r == even_c then
shape = pig
else
shape = ham
end
local i = random_ore:next_int(1, ore_t)
index = table.binary_search(total_ore_weights, i)
if (index < 0) then
index = bit32.bnot(index)
end
local ore_data = ores[index]
local transform = ore_data.transform
if not transform then
row[c] = b.no_entity
else
local ore_shape = transform(shape)
local x = random_ore:next_int(-24, 24)
local y = random_ore:next_int(-24, 24)
ore_shape = b.translate(ore_shape, x, y)
local ore = b.resource(ore_shape, ore_data.resource, ore_data.value)
row[c] = ore
end
end
end
local start_pig =
b.segment_pattern {
b.resource(
pig,
'iron-ore',
function()
return 1000
end
),
b.resource(
pig,
'copper-ore',
function()
return 500
end
),
b.resource(
pig,
'coal',
function()
return 750
end
),
b.resource(
pig,
'stone',
function()
return 300
end
)
}
ore_pattern[1][1] = start_pig
local ore_grid = b.grid_pattern_full_overlap(ore_pattern, 50, 50, 96, 96)
ore_grid = b.translate(ore_grid, -50, 64)
map = b.apply_entity(map, ore_grid)
map = b.fish(map, 0.0025)
return map

View File

@ -0,0 +1,231 @@
local b = require 'map_gen.shared.builders'
local Perlin = require 'map_gen.shared.perlin_noise'
local Event = require 'utils.event'
local Global = require 'utils.global'
local oil_seed
local uranium_seed
local density_seed
local enemy_seed
local oil_scale = 1 / 64
local oil_threshold = 0.6
local uranium_scale = 1 / 128
local uranium_threshold = 0.65
local density_scale = 1 / 48
local density_threshold = 0.5
local density_multiplier = 50
Global.register_init(
{},
function(tbl)
tbl.seed = game.surfaces[1].map_gen_settings.seed
end,
function(tbl)
local seed = tbl.seed
oil_seed = seed
uranium_seed = seed * 2
density_seed = seed * 3
enemy_seed = seed * 4
end
)
local market_items = require 'resources.market_items'
table.remove(market_items, 13)
table.remove(market_items, 9)
Event.add(
defines.events.on_research_finished,
function(event)
local p_force = game.forces.player
local r = event.research
if r.name == 'flamethrower' then
p_force.recipes['flamethrower'].enabled = false
p_force.recipes['flamethrower-turret'].enabled = false
end
end
)
local trees = {
'tree-01',
'tree-02',
'tree-02-red',
'tree-03',
'tree-04',
'tree-05',
'tree-06',
'tree-06-brown',
'tree-07',
'tree-08',
'tree-08-brown',
'tree-08-red',
'tree-09',
'tree-09-brown',
'tree-09-red'
}
local trees_count = #trees
local function tree_shape(_, _, world)
local x, y = world.x, world.y
local tree = trees[math.random(trees_count)]
local dx = math.random(-1, 1)
local dy = math.random(-1, 1)
return {name = tree, position = {x + dx, y + dy}}
--return {name = tree}
end
tree_shape = b.throttle_world_xy(tree_shape, 1, 2, 1, 2)
local worm_names = {'small-worm-turret', 'medium-worm-turret', 'big-worm-turret'}
local spawner_names = {'biter-spawner', 'spitter-spawner'}
local factor = 10 / (768 * 32)
local max_chance = 1 / 6
local scale_factor = 48
local sf = 1 / scale_factor
local m = 1 / 650
local function enemy(x, y, world)
local d = math.sqrt(world.x * world.x + world.y * world.y)
if d < 68 then
return nil
end
if d < 100 then
return tree_shape(x, y, world)
end
local threshold = 1 - d * m
threshold = math.max(threshold, 0.5) -- -0.125)
x, y = x * sf, y * sf
if Perlin.noise(x, y, enemy_seed) > threshold then
if math.random(8) == 1 then
local lvl
if d < 400 then
lvl = 1
elseif d < 650 then
lvl = 2
else
lvl = 3
end
local chance = math.min(max_chance, d * factor)
if math.random() < chance then
local worm_id
if d > 512 then
local power = 512 / d
worm_id = math.ceil((math.random() ^ power) * lvl)
worm_id = math.clamp(worm_id, 1, 3)
else
worm_id = math.random(lvl)
end
return {name = worm_names[worm_id]}
end
else
local chance = math.min(max_chance, d * factor)
if math.random() < chance then
local spawner_id = math.random(2)
return {name = spawner_names[spawner_id]}
end
end
else
return tree_shape(x, y, world)
end
end
local value = b.euclidean_value
local oil_shape = b.throttle_world_xy(b.full_shape, 1, 8, 1, 8)
local oil_resource = b.resource(oil_shape, 'crude-oil', value(250000, 200))
local uranium_resource = b.resource(b.full_shape, 'uranium-ore', value(200, 1))
local ores = {
{resource = b.resource(b.full_shape, 'iron-ore', value(25, 0.5)), weight = 6},
{resource = b.resource(b.full_shape, 'copper-ore', value(25, 0.5)), weight = 4},
{resource = b.resource(b.full_shape, 'stone', value(25, 0.5)), weight = 1},
{resource = b.resource(b.full_shape, 'coal', value(25, 0.5)), weight = 2}
}
local weighted_ores = b.prepare_weighted_array(ores)
local total_ores = weighted_ores.total
local spawn_zone = b.circle(64)
local ore_circle = b.circle(68)
local start_ores = {
b.resource(ore_circle, 'iron-ore', value(100, 0)),
b.resource(ore_circle, 'copper-ore', value(50, 0)),
b.resource(ore_circle, 'coal', value(100, 0)),
b.resource(ore_circle, 'stone', value(50, 0))
}
local start_segment = b.segment_pattern(start_ores)
local function ore(x, y, world)
if spawn_zone(x, y) then
return
end
local start_ore = start_segment(x, y, world)
if start_ore then
return start_ore
end
local oil_x, oil_y = x * oil_scale, y * oil_scale
local oil_noise = Perlin.noise(oil_x, oil_y, oil_seed)
if oil_noise > oil_threshold then
return oil_resource(x, y, world)
end
local uranium_x, uranium_y = x * uranium_scale, y * uranium_scale
local uranium_noise = Perlin.noise(uranium_x, uranium_y, uranium_seed)
if uranium_noise > uranium_threshold then
return uranium_resource(x, y, world)
end
local i = math.random() * total_ores
local index = table.binary_search(weighted_ores, i)
if (index < 0) then
index = bit32.bnot(index)
end
local resource = ores[index].resource
local entity = resource(x, y, world)
local density_x, density_y = x * density_scale, y * density_scale
local density_noise = Perlin.noise(density_x, density_y, density_seed)
if density_noise > density_threshold then
entity.amount = entity.amount * density_multiplier
end
entity.enable_tree_removal = false
return entity
end
local water = b.circle(8)
water = b.change_tile(water, true, 'water-green')
water = b.any {b.rectangle(16, 4), b.rectangle(4, 16), water}
local start = b.if_else(water, b.full_shape)
start = b.change_map_gen_collision_tile(start, 'water-tile', 'grass-1')
local map = b.choose(ore_circle, start, b.full_shape)
map = b.apply_entity(map, ore)
map = b.apply_entity(map, enemy)
map = b.change_map_gen_tile(map, 'water', 'water-green')
map = b.change_map_gen_tile(map, 'deepwater', 'deepwater-green')
return map

View File

@ -125,6 +125,20 @@ function Builders.sine_fill(width, height)
end
end
function Builders.sine_wave(width, height, thickness)
local width_inv = tau / width
local height_inv = 2 / height
thickness = thickness * 0.5
return function(x, y)
local x2 = x * width_inv
local y2 = math.sin(x2)
y = y * height_inv
local d = math.abs(y2 - y)
return d < thickness
end
end
function Builders.rectangular_spiral(x_size, optional_y_size)
optional_y_size = optional_y_size or x_size

View File

@ -73,6 +73,7 @@ local tiles_per_tick = 32
--shape = require "map_gen.presets.dino_island"
--shape = require "map_gen.presets.toxic_jungle"
--shape = require "map_gen.presets.danger_ores"
--shape = require "map_gen.presets.bacon_islands"
--shape = require "map_gen.presets.test"
--shapes--

View File

@ -17,6 +17,7 @@ local focus_color = {r = 1, g = 0.55, b = 0.1}
local rank_colors = {
{r = 1, g = 1, b = 1}, -- Guest
{r = 0.155, g = 0.540, b = 0.898}, -- Regular
{r = 172.6, g = 70.2, b = 215.8}, -- Donator {r = 152, g = 24, b = 206}
{r = 0.093, g = 0.768, b = 0.172} -- Admin
}
@ -24,6 +25,7 @@ local inv_sprite_time_step = 1 / sprite_time_step
local rank_names = {
'Guest',
'Regular',
'Donator',
'Admin'
}
@ -83,12 +85,17 @@ end
local function get_rank_level(player)
if player.admin then
return 3
elseif UserGroups.is_regular(player.name) then
return 2
else
return 1
return 4
end
local name = player.name
if UserGroups.is_donator(name) then
return 3
elseif UserGroups.is_regular(name) then
return 2
end
return 1
end
local function do_poke_spam_protection(player)

4
resources/donators.lua Normal file
View File

@ -0,0 +1,4 @@
return {
['robertkruijt'] = true,
['aldldl'] = true
}

View File

@ -57,6 +57,9 @@ return {
{price = {{'coin', 350}}, offer = {type = 'give-item', item = 'energy-shield-equipment'}},
{price = {{'coin', 350}}, offer = {type = 'give-item', item = 'personal-laser-defense-equipment'}},
{price = {{'coin', 1}}, offer = {type = 'give-item', item = 'refined-hazard-concrete'}},
{price = {{'coin', 75}}, offer = {type = 'give-item', item = 'loader'}},
{price = {{'coin', 150}}, offer = {type = 'give-item', item = 'fast-loader'}},
{price = {{'coin', 225}}, offer = {type = 'give-item', item = 'express-loader'}},
--[[ {price = {{'coin', 5}}, offer = {type = 'give-item', item = 'science-pack-1'}},
{price = {{'coin', 10}}, offer = {type = 'give-item', item = 'science-pack-2'}},

View File

@ -147,7 +147,6 @@ return {
['jedifan'] = true,
['jinnjuice'] = true,
['joe32'] = true,
['jokerofthez'] = true,
['jono777'] = true,
['judaires'] = true,
['junhinhow'] = true,
@ -157,7 +156,6 @@ return {
['kidflash'] = true,
['koretego'] = true,
['kostrahb'] = true,
['krul'] = true,
['leadhades27'] = true,
['legionmammal978'] = true,
['lejnel'] = true,
@ -599,5 +597,49 @@ return {
['thislsamerica'] = true,
['vesorakia'] = true,
['wavethrash'] = true,
['xjohnson'] = true
['xjohnson'] = true,
['Ryix'] = true,
['Mylon'] = true,
['Terminutter'] = true,
['Hafgrim'] = true,
['l3igspeck'] = true,
['lyman'] = true,
['zsintai1987'] = true,
['xubos'] = true,
['Elsa-Zhou'] = true,
['SirBlubbalot'] = true,
['bulb5'] = true,
['fellan03'] = true,
['Irx99'] = true,
['Spocks'] = true,
['OmniMancer'] = true,
['TfGuy44'] = true,
['Krul'] = true,
['moncada'] = true,
['Wr1190'] = true,
['Phoenix27833'] = true,
['reddutton'] = true,
['4yDo'] = true,
['jpszat'] = true,
['DaHolli'] = true,
['Blaster'] = true,
['BluJester'] = true,
['thisisjack'] = true,
['Appadeia'] = true,
['Scuideie-Guy'] = true,
['drakferion'] = true,
['thelegendxp'] = true,
['SteelMK'] = true,
['Marviniusus'] = true,
['FrostDestructor'] = true,
['Gorganus'] = true,
['Sirnumnum'] = true,
['telefrog'] = true,
['wrex82'] = true,
['fce2'] = true,
['wampastompa09'] = true,
['Magic'] = true,
['ReinekeWF'] = true,
['JokerOfTheZ'] = true,
['DOSorDIE'] = true
}

View File

@ -1,4 +1,5 @@
global.regulars = require 'resources.regulars'
global.donators = require 'resources.donators'
local Event = require 'utils.event'
local Utils = require 'utils.utils'
@ -66,6 +67,10 @@ function Module.get_rank(player)
end
end
function Module.is_donator(player_name)
return global.donators[player_name]
end
Event.add(
defines.events.on_player_joined_game,
function(event)