1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2025-03-03 14:53:01 +02:00

Integrate apocalypse as an admin command

This commit is contained in:
plague006 2019-02-08 15:19:30 -05:00 committed by Matthew Heguy
parent ae03b94fc8
commit 8b10cd44b5
2 changed files with 17 additions and 11 deletions

View File

@ -3,6 +3,7 @@ local Token = require 'utils.token'
local Global = require 'utils.global'
local Rank = require 'features.rank_system'
local Report = require 'features.report'
local Apocalypse = require 'features.apocalypse'
local Utils = require 'utils.core'
local Game = require 'utils.game'
local Event = require 'utils.event'
@ -485,3 +486,15 @@ Command.add(
},
revive_ghosts
)
-- Commands with no functions, only calls to other modules
Command.add(
'apocalypse',
{
description = 'Calls for the endtimes.',
admin_only = true,
allowed_by_server = true
},
Apocalypse.begin_apocalypse
)

View File

@ -1,4 +1,3 @@
local Command = require 'utils.command'
local table = require 'utils.table'
local Task = require 'utils.task'
local Token = require 'utils.token'
@ -8,6 +7,8 @@ local HailHydra = require 'map_gen.shared.hail_hydra'
local clear_table = table.clear_table
local Public = {}
local hydra_config = {
['behemoth-spitter'] = {['behemoth-spitter'] = 0.01},
['behemoth-biter'] = {['behemoth-biter'] = 0.01}
@ -42,7 +43,7 @@ local biter_spawn_token =
end
)
local function begin_apocalypse(_, player)
function Public.begin_apocalypse(_, player)
if global.apocalypse_now then
return
end
@ -83,12 +84,4 @@ local function begin_apocalypse(_, player)
)
end
Command.add(
'apocalypse',
{
description = 'Calls for the endtimes.',
admin_only = true,
allowed_by_server = true
},
begin_apocalypse
)
return Public