mirror of
https://github.com/Refactorio/RedMew.git
synced 2025-11-06 09:09:26 +02:00
implemented fish_market.enable
This commit is contained in:
@@ -9,11 +9,10 @@ global.scenario.variables.player_deaths = {}
|
|||||||
global.scenario.config = {}
|
global.scenario.config = {}
|
||||||
global.scenario.config.player_list = {}
|
global.scenario.config.player_list = {}
|
||||||
global.scenario.config.player_list.enable_coin_col = true
|
global.scenario.config.player_list.enable_coin_col = true
|
||||||
global.scenario.config.fish_market = {}
|
|
||||||
global.scenario.config.fish_market.enable = true
|
|
||||||
global.scenario.config.paint = {}
|
global.scenario.config.paint = {}
|
||||||
global.scenario.config.paint.enable = true
|
global.scenario.config.paint.enable = true
|
||||||
global.scenario.config.fish_market = {}
|
global.scenario.config.fish_market = {}
|
||||||
|
global.scenario.config.fish_market.enable = true
|
||||||
global.scenario.config.nuke_control = {}
|
global.scenario.config.nuke_control = {}
|
||||||
global.scenario.config.nuke_control.enable_autokick = true
|
global.scenario.config.nuke_control.enable_autokick = true
|
||||||
global.scenario.config.nuke_control.enable_autoban = true
|
global.scenario.config.nuke_control.enable_autoban = true
|
||||||
|
|||||||
@@ -31,10 +31,6 @@ local function spawn_market(cmd)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if not global.scenario.config.fish_market.enable then
|
|
||||||
game.player.print("Cannot spawn market. Market is disabled in the scenario config.")
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local surface = player.surface
|
local surface = player.surface
|
||||||
local force = player.force
|
local force = player.force
|
||||||
|
|
||||||
@@ -452,10 +448,17 @@ local function fish_player_crafted_item(event)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
commands.add_command('market', 'Places a fish market near you. (Admins only)', spawn_market)
|
local function on_init()
|
||||||
|
|
||||||
Event.on_nth_tick(180, on_180_ticks)
|
if global.scenario.config.fish_market.enable then
|
||||||
Event.add(defines.events.on_pre_player_mined_item, pre_player_mined_item)
|
commands.add_command('market', 'Places a fish market near you. (Admins only)', spawn_market)
|
||||||
Event.add(defines.events.on_entity_died, fish_drop_entity_died)
|
|
||||||
Event.add(defines.events.on_market_item_purchased, market_item_purchased)
|
Event.on_nth_tick(180, on_180_ticks)
|
||||||
Event.add(defines.events.on_player_crafted_item, fish_player_crafted_item)
|
Event.add(defines.events.on_pre_player_mined_item, pre_player_mined_item)
|
||||||
|
Event.add(defines.events.on_entity_died, fish_drop_entity_died)
|
||||||
|
Event.add(defines.events.on_market_item_purchased, market_item_purchased)
|
||||||
|
Event.add(defines.events.on_player_crafted_item, fish_player_crafted_item)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
Event.on_init(init)
|
||||||
|
Event.on_load(init)
|
||||||
|
|||||||
@@ -52,6 +52,9 @@ if global.scenario and global.scenario.config then
|
|||||||
global.scenario.nuke_control.enable_autokick = nil
|
global.scenario.nuke_control.enable_autokick = nil
|
||||||
global.scenario.nuke_control.enable_autoban = nil
|
global.scenario.nuke_control.enable_autoban = nil
|
||||||
end
|
end
|
||||||
|
if global.scenario.config.fish_market then
|
||||||
|
global.scenario.config.fish_market.enable = nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function create_cave_miner_button(player)
|
local function create_cave_miner_button(player)
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ local tiles_per_tick = 32
|
|||||||
--require "map_gen.combined.dimensions"
|
--require "map_gen.combined.dimensions"
|
||||||
--require "map_gen.combined.dagobah_swamp"
|
--require "map_gen.combined.dagobah_swamp"
|
||||||
--require "map_gen.combined.meteor_strike" --unfinished
|
--require "map_gen.combined.meteor_strike" --unfinished
|
||||||
require 'map_gen.combined.cave_miner.cave_miner'
|
--require 'map_gen.combined.cave_miner.cave_miner'
|
||||||
|
|
||||||
|
|
||||||
--presets--
|
--presets--
|
||||||
|
|||||||
Reference in New Issue
Block a user