mirror of
https://github.com/Refactorio/RedMew.git
synced 2025-03-03 14:53:01 +02:00
[diggy] landfill now spanws dirt-[1-7] #276
This commit is contained in:
parent
299375731c
commit
d48676bcc5
@ -81,6 +81,9 @@ function Scenario.register(debug)
|
||||
end
|
||||
)
|
||||
|
||||
local landfill_tiles = {'dirt-1','dirt-2','dirt-3','dirt-4','dirt-5','dirt-6','dirt-7'}
|
||||
require ('map_gen.misc.change_landfill_tile')(landfill_tiles)
|
||||
|
||||
ScenarioInfo.set_map_name('Diggy')
|
||||
ScenarioInfo.set_map_description('Dig your way through!')
|
||||
ScenarioInfo.set_map_extra_info(extra_map_info)
|
||||
|
@ -1,6 +1,9 @@
|
||||
local Event = require 'utils.event'
|
||||
|
||||
local tile
|
||||
local replacement_tiles
|
||||
local tile_count
|
||||
local random = math.random
|
||||
|
||||
|
||||
Event.add(
|
||||
defines.events.on_player_built_tile,
|
||||
@ -13,7 +16,7 @@ Event.add(
|
||||
if event.item.name == 'landfill' then
|
||||
local tiles = event.tiles
|
||||
for i = 1, #tiles do
|
||||
tiles[i].name = tile
|
||||
tiles[i].name = replacement_tiles[random(1,tile_count)]
|
||||
end
|
||||
local surface = game.surfaces[event.surface_index]
|
||||
surface.set_tiles(tiles)
|
||||
@ -21,6 +24,7 @@ Event.add(
|
||||
end
|
||||
)
|
||||
|
||||
return function(tile_name)
|
||||
tile = tile_name or 'sand-1'
|
||||
return function(tiles)
|
||||
replacement_tiles = tiles or {"sand-1"}
|
||||
tile_count = #replacement_tiles
|
||||
end
|
||||
|
@ -127,7 +127,7 @@ local terrain_modules = {
|
||||
--everything else. You may use more than one of these, but beware they might not be compatible
|
||||
--require "map_gen.misc.rusky_pvp"
|
||||
--require("map_gen.misc.rail_grid") -- used for map_gen.presets.UK
|
||||
--require ('map_gen.misc.change_landfill_tile')('sand-1')
|
||||
--require ('map_gen.misc.change_landfill_tile'){'sand-1'}
|
||||
--require ('map_gen.misc.danger_ore_banned_entities')
|
||||
--require ('map_gen.misc.restrict_landfill_tile')({['water'] = true})
|
||||
--require "map_gen.ores.rso.rso_control"
|
||||
|
Loading…
x
Reference in New Issue
Block a user