2022-01-24 10:23:08 +08:00
|
|
|
-- Fundemental script for FreeKill
|
|
|
|
-- Load mods, init the engine, etc.
|
|
|
|
|
2022-03-25 12:28:07 +08:00
|
|
|
package.path = package.path .. ";./lua/lib/?.lua"
|
2022-03-28 22:24:30 +08:00
|
|
|
.. ";./lua/?.lua"
|
2022-01-24 10:23:08 +08:00
|
|
|
|
|
|
|
-- load libraries
|
2022-03-30 16:33:56 +08:00
|
|
|
|
2022-03-25 12:28:07 +08:00
|
|
|
class = require "middleclass"
|
|
|
|
json = require "json"
|
2022-03-30 16:33:56 +08:00
|
|
|
|
2022-04-30 15:27:56 +08:00
|
|
|
local GroupUtils = require "core.util"
|
|
|
|
TargetGroup, AimGroup = table.unpack(GroupUtils)
|
2022-04-01 20:51:01 +08:00
|
|
|
dofile "lua/core/debug.lua"
|
2022-03-31 13:29:23 +08:00
|
|
|
|
2022-03-28 22:24:30 +08:00
|
|
|
math.randomseed(os.time())
|
2022-01-24 10:23:08 +08:00
|
|
|
|
|
|
|
-- load core classes
|
2022-03-30 14:14:40 +08:00
|
|
|
Engine = require "core.engine"
|
|
|
|
Package = require "core.package"
|
|
|
|
General = require "core.general"
|
|
|
|
Card = require "core.card"
|
2023-01-16 19:13:07 +08:00
|
|
|
Exppattern = require "core.exppattern"
|
2022-03-30 14:14:40 +08:00
|
|
|
Skill = require "core.skill"
|
2023-01-29 18:11:41 +08:00
|
|
|
UsableSkill = require "core.skill_type.usable_skill"
|
|
|
|
StatusSkill = require "core.skill_type.status_skill"
|
2022-03-30 14:14:40 +08:00
|
|
|
Player = require "core.player"
|
2023-03-14 00:12:02 +08:00
|
|
|
GameMode = require "core.game_mode"
|
2023-04-05 00:49:54 +08:00
|
|
|
UI = require "ui-util"
|
2022-03-25 12:28:07 +08:00
|
|
|
|
2023-02-27 10:23:48 +08:00
|
|
|
-- load config
|
|
|
|
local function loadConf()
|
|
|
|
local cfg = io.open("freekill.client.config.json")
|
|
|
|
local ret
|
|
|
|
if cfg == nil then
|
|
|
|
ret = {
|
|
|
|
language = "zh_CN",
|
|
|
|
}
|
|
|
|
else
|
|
|
|
ret = json.decode(cfg:read("a"))
|
|
|
|
cfg:close()
|
|
|
|
end
|
|
|
|
return ret
|
|
|
|
end
|
|
|
|
Config = loadConf()
|
|
|
|
|
|
|
|
-- disable dangerous functions
|
2023-03-14 20:50:36 +08:00
|
|
|
local _os = {
|
|
|
|
time = os.time,
|
|
|
|
date = os.date,
|
|
|
|
clock = os.clock,
|
|
|
|
difftime = os.difftime,
|
|
|
|
getms = os.getms,
|
|
|
|
}
|
|
|
|
os = _os
|
2023-02-27 10:23:48 +08:00
|
|
|
io = nil
|
2023-03-14 20:50:36 +08:00
|
|
|
package = nil
|
|
|
|
load = nil
|
|
|
|
loadfile = nil
|
2023-02-27 10:23:48 +08:00
|
|
|
|
2022-03-25 12:28:07 +08:00
|
|
|
-- load packages
|
2022-03-31 13:29:23 +08:00
|
|
|
dofile "lua/fk_ex.lua"
|
2022-03-28 22:24:30 +08:00
|
|
|
Fk = Engine:new()
|