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

71 lines
1.4 KiB
Lua
Raw Normal View History

2020-04-27 00:19:06 +02:00
-- on table to rule them all!
local Global = require 'utils.global'
local Event = require 'utils.event'
2020-04-30 14:48:40 +02:00
local this = {
players = {},
game_lost = false,
game_won = false,
energy = {},
wave_counter = 0,
locomotive_health = 10000,
locomotive_max_health = 10000,
cargo_health = 10000,
cargo_max_health = 10000,
revealed_spawn = 0,
scrap_enabled = true,
2020-04-30 15:56:25 +02:00
rocks_yield_ore_maximum_amount = 500,
2020-04-30 14:48:40 +02:00
rocks_yield_ore_base_amount = 50,
2020-05-01 01:02:56 +02:00
rocks_yield_ore_distance_modifier = 0.020,
left_top = {
x = 0,
y = 0
},
vendor = {}
2020-04-30 14:48:40 +02:00
}
2020-04-27 00:19:06 +02:00
local Public = {}
Global.register(
this,
function(tbl)
this = tbl
end
)
function Public.reset_table()
2020-04-27 20:04:37 +02:00
--for k, _ in pairs(this) do
-- this[k] = nil
--end
2020-04-28 21:55:19 +02:00
this.lo_energy = nil
this.ow_energy = nil
2020-04-27 20:04:37 +02:00
this.game_lost = false
2020-04-27 00:19:06 +02:00
this.game_won = false
2020-04-28 21:55:19 +02:00
this.energy = {}
this.wave_counter = 0
2020-04-27 20:04:37 +02:00
this.locomotive_health = 10000
this.locomotive_max_health = 10000
2020-04-28 21:55:19 +02:00
this.cargo_health = 10000
this.cargo_max_health = 10000
2020-04-27 20:04:37 +02:00
this.revealed_spawn = 0
2020-04-30 11:44:57 +02:00
this.scrap_enabled = true
2020-05-01 01:02:56 +02:00
this.left_top = {
x = 0,
y = 0
}
this.train_upgrades = 0
this.energy_purchased = false
2020-05-01 17:52:06 +02:00
this.freeze_daytime = false
2020-04-27 00:19:06 +02:00
end
function Public.get_table()
return this
end
local on_init = function ()
Public.reset_table()
end
Event.on_init(on_init)
return Public