1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-24 03:47:58 +02:00

67 lines
1.4 KiB
Lua
Raw Normal View History

2020-05-17 12:23:55 +02:00
-- on table to rule them all!
local Global = require 'utils.global'
local Event = require 'utils.event'
local this = {
2020-05-20 09:09:39 +02:00
disable_reset = false,
2020-05-19 23:00:52 +02:00
players = {},
2020-05-21 23:08:23 +02:00
offline_players = {},
power_sources = {},
refill_turrets = {index = 1},
magic_crafters = {index = 1},
magic_fluid_crafters = {index = 1}
2020-05-17 12:23:55 +02:00
}
local Public = {}
Global.register(
this,
function(tbl)
this = tbl
end
)
function Public.reset_table()
this.locomotive_index = nil
this.loco_surface = nil
this.game_lost = false
this.locomotive_health = 10000
this.locomotive_max_health = 10000
this.cargo_health = 10000
this.cargo_max_health = 10000
this.train_upgrades = 0
this.offline_players = {}
this.biter_pets = {}
2020-05-21 23:08:23 +02:00
this.power_sources = {}
this.refill_turrets = {index = 1}
this.magic_crafters = {index = 1}
this.magic_fluid_crafters = {index = 1}
2020-05-17 12:23:55 +02:00
this.mined_scrap = 0
this.biters_killed = 0
this.locomotive_xp_aura = 40
this.xp_points = 0
this.xp_points_upgrade = 0
this.aura_upgrades = 0
this.health_upgrades = 0
this.threat_upgrades = 0
2020-05-20 09:10:17 +02:00
this.left_top = {
x = 0,
y = 0
}
2020-05-17 12:23:55 +02:00
end
2020-05-20 09:09:39 +02:00
function Public.get(key)
if key then
return this[key]
2020-05-17 12:23:55 +02:00
else
2020-05-20 09:09:39 +02:00
return this
2020-05-17 12:23:55 +02:00
end
end
local on_init = function()
Public.reset_table()
end
Event.on_init(on_init)
return Public