1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2025-09-16 09:16:22 +02:00
This commit is contained in:
James Gillham
2017-08-12 05:14:29 +01:00
5 changed files with 103 additions and 3 deletions

View File

@@ -301,6 +301,28 @@ local function unfollow(cmd)
end
end
global.wells = {}
local function well(cmd)
if not game.player.admin then
cant_run(cmd.name)
return
end
if cmd.parameter == nil then
return
end
local params = {}
for param in string.gmatch(cmd.parameter, "%S+") do table.insert(params, param) end
if game.item_prototypes[params[1]] and params[2] and tonumber(params[2]) then
local ips = tonumber(params[2])
local chest = game.surfaces[1].create_entity({name = "steel-chest", force = game.player.force, position = game.player.position})
table.insert(global.wells, {chest = chest, item = params[1], items_per_second = ips})
refill_well()
else
game.player.print("Usage: /well <item> <items per second>.")
end
end
commands.add_command("kill", "Will kill you.", kill)
commands.add_command("detrain", "<player> - Kicks the player off a train. (Admins and moderators)", detrain)
@@ -319,3 +341,5 @@ commands.add_command("afktime", 'Shows how long players have been afk.', afk)
commands.add_command("tag", '<player> <tag> Sets a players tag. (Admins only)', tag)
commands.add_command("follow", '<player> makes you follow the player. Use /unfollow to stop following a player.', follow)
commands.add_command("unfollow", 'stops following a player.', unfollow)
commands.add_command("well", '<item> <items per second> (Admins only)', well)

View File

@@ -25,12 +25,12 @@ And this is what you ought to know:
- Don't argue with other players for silly things.
- No political, racist, or misogynistic content.
- If you suspect you desync, restart the game.
- You can join our community on discord.me/redmew
- View the chatlog on: log.mewmew.net
- Join our growing community on discord.me/redmew
- Post server pics (or didn't happen): redmew.reddit.com
- View the in-game chatlog on: log.mewmew.net
- Contribute to our Hookers & Blow Fund with:
Bitcoin: 13qh5uJh3UDUiWKyQaybkpxC1gfLVDB1ww
Paypal: paypal.me/redmew (5$+ get nudes)
]===]
player.gui.left.direction = "horizontal"

View File

@@ -0,0 +1,64 @@
require "locale.gen_shared.perlin_noise"
local tree_to_place = {"dry-tree","dry-hairy-tree","tree-06","tree-06","tree-01","tree-02","tree-03"}
function run_terrain_module(event)
if not global.terrain_seed_A then global.terrain_seed_A = math.random(10,10000) end
if not global.terrain_seed_B then global.terrain_seed_B = math.random(10,10000) end
local area = event.area
local surface = event.surface
local tiles = {}
local tileswater = {}
local entities = surface.find_entities(area)
for _, entity in pairs(entities) do
if (run_ores_module ~= nil and entity.type == "resource") then
entity.destroy()
end
end
local top_left = area.left_top --make a more direct reference
for x = top_left.x-1, top_left.x + 32 do
for y = top_left.y-1, top_left.y + 32 do
--local pos_x = top_left.x + x
--local pos_y = top_left.y + y
local tile = surface.get_tile(x,y)
if tile.name ~= "out-of-map" then
--local tile_to_insert = "grass-medium"
local wiggle = 50 + perlin:noise((x*0.005),(y*0.005),global.terrain_seed_A + 71) * 60
local terrain_A = perlin:noise((x*0.005),(y*0.005),global.terrain_seed_A + 19) * wiggle --For determining where water is
local terrain_sqr = terrain_A * terrain_A --we can use this again to mess with other layers as well
if terrain_sqr < 50 then --Main water areas
--local deep = (terrain_sqr < 20) and true or false
terrain_A = perlin:noise((x*0.01),(y*0.01),global.terrain_seed_A + 31) * 90 + (wiggle * -0.2) --we only gen this when we consider placing water
--terrain_A = simplex_2d((x*0.01),(y*0.01),global.terrain_seed_A + 31) * 90 + (wiggle * -0.2) --we only gen this when we consider placing water
if terrain_A * terrain_A > 40 then --creates random bridges over the water by overlapping with another noise layer
table.insert(tiles, {name = "water", position = {x,y}})
end
elseif terrain_sqr > 70 then
if run_ores_module ~= nil then
run_ores_module_setup()
if x > top_left.x-1 and x < top_left.x+32 and y > top_left.y-1 and y < top_left.y+32 then
run_ores_module_tile(surface,x,y)
end
end
end
end
end
end
surface.set_tiles(tiles,true)
--surface.set_tiles(tileswater,true)
end

View File

@@ -23,8 +23,10 @@ in this file and your run_*type*_module(event) function will be called.
--require "locale.gen_shape.x_shape"
require "locale.gen_shape.grid_islands"
--terrain--
--require "locale.gen_terrain.neko_bridged_rivers"
--require "locale.gen_terrain.neko_river_overlay"
--ores--
--require "locale.gen_ores.neko_crazy_ores"

View File

@@ -1,3 +1,9 @@
function refill_well()
for _,well in pairs(global.wells) do
well.chest.insert({name = well.item, count = well.items_per_second * 15})
end
end
local function on_tick()
walk_on_tick()
if game.tick % 60 == 0 then
@@ -8,8 +14,12 @@ local function on_tick()
end
if game.tick % 180 == 0 then
fish_market_on_180_ticks()
if game.tick % 900 == 0 then
refill_well()
end
end
end
end
Event.register(defines.events.on_tick, on_tick)