mirror of
https://gitlab.com/YuukiPS/GC-Resources.git
synced 2025-04-28 17:15:22 +00:00
217 lines
6.0 KiB
Lua
217 lines
6.0 KiB
Lua
-- 基础信息
|
|
local base_info = {
|
|
group_id = 155005268
|
|
}
|
|
|
|
-- Trigger变量
|
|
local defs = {
|
|
group_ID = 155005268
|
|
}
|
|
|
|
-- DEFS_MISCS
|
|
local Controllers = {}
|
|
local EnvControlGadgets = {268005}
|
|
local Worktops = {268005}
|
|
local DayAppearGadgets = {268003}
|
|
local NightAppearGadgets = {268004}
|
|
|
|
|
|
--[[
|
|
Variable:
|
|
ScriptLib.GetGroupVariableValue(context, name)
|
|
ScriptLib.GetGroupVariableValueByGroup(context, name, group_id)
|
|
ScriptLib.SetGroupVariableValue(context, name, value)
|
|
ScriptLib.SetGroupVariableValueByGroup(context, name, value, group_id)
|
|
|
|
GadgetState:
|
|
ScriptLib.GetGadgetStateByConfigId(context, group_id, config_id)
|
|
ScriptLib.SetGroupGadgetStateByConfigId(context, group_id, config_id, gadget_state)
|
|
|
|
Option:
|
|
ScriptLib.SetWorktopOptionsByGroupId(context, group_id, config_id, {option_table})
|
|
ScriptLib.DelWorktopOptionByGroupId(context, group_id, config_id, option_id)
|
|
|
|
SuiteControll:
|
|
ScriptLib.GoToGroupSuite(context, group_id, suite_index)
|
|
ScriptLib.AddExtraGroupSuite(context, group_id, suite_index)
|
|
|
|
TimeAxis:
|
|
ScriptLib.InitTimeAxis(context, key, timer, is_loop)
|
|
ScriptLib.EndTimeAxis(context, key)
|
|
ScriptLib.PauseTimeAxis(context, key)
|
|
ScriptLib.ContinueTimeAxis(context, key)
|
|
|
|
ScriptLib.SetPlatformPointArray(context, gadget_id, pointarray_id, {pointarrayindexlist}, { route_type = 0 })
|
|
]]
|
|
local gameplayStateFuncitons =
|
|
{
|
|
["0"] = function(context)
|
|
|
|
ScriptLib.SetGroupVariableValue(context,"is_daynight_finish",1)
|
|
|
|
end,
|
|
["1"] = function(context)
|
|
ScriptLib.SetGroupVariableValue(context,"is_daynight_finish",0)
|
|
ScriptLib.AddExtraGroupSuite(context, defs.group_ID, 2)
|
|
DayNight_Gadget_Unlock(context,268005)
|
|
|
|
end,
|
|
["2"] = function(context)
|
|
ScriptLib.SetGroupVariableValue(context,"is_daynight_finish",0)
|
|
ScriptLib.AddExtraGroupSuite(context, defs.group_ID, 3)
|
|
DayNight_Gadget_Finish(context,268005)
|
|
ScriptLib.SetGroupGadgetStateByConfigId(context, 155005268, 268006, GadgetState.GearStart)
|
|
|
|
end
|
|
|
|
}
|
|
|
|
|
|
function UpdateGamePlayState(context)
|
|
local state = ScriptLib.GetGroupVariableValue(context, "gameplayState")
|
|
|
|
gameplayStateFuncitons[tostring(state)](context)
|
|
|
|
end
|
|
|
|
--================================================================
|
|
--
|
|
-- 配置
|
|
--
|
|
--================================================================
|
|
|
|
-- 怪物
|
|
monsters = {
|
|
}
|
|
|
|
-- NPC
|
|
npcs = {
|
|
}
|
|
|
|
-- 装置
|
|
gadgets = {
|
|
{ config_id = 268003, gadget_id = 70360316, pos = { x = 302.725, y = 120.847, z = 872.026 }, rot = { x = 0.000, y = 13.497, z = 0.000 }, level = 36, area_id = 200 },
|
|
{ config_id = 268004, gadget_id = 70360317, pos = { x = 306.339, y = 120.452, z = 866.174 }, rot = { x = 359.594, y = 285.556, z = 1.067 }, level = 36, area_id = 200 },
|
|
{ config_id = 268005, gadget_id = 70360312, pos = { x = 301.917, y = 121.684, z = 867.578 }, rot = { x = 0.000, y = 188.427, z = 0.000 }, level = 36, area_id = 200 },
|
|
{ config_id = 268006, gadget_id = 70350006, pos = { x = 305.283, y = 122.342, z = 882.018 }, rot = { x = 0.000, y = 12.397, z = 0.000 }, level = 36, persistent = true, area_id = 200 }
|
|
}
|
|
|
|
-- 区域
|
|
regions = {
|
|
}
|
|
|
|
-- 触发器
|
|
triggers = {
|
|
-- 初始化
|
|
{ config_id = 1268001, name = "GROUP_LOAD_268001", event = EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_EVENT_GROUP_LOAD_268001", trigger_count = 0 },
|
|
-- 监听gameplayState变化
|
|
{ config_id = 1268002, name = "VARIABLE_CHANGE_268002", event = EventType.EVENT_VARIABLE_CHANGE, source = "gameplayState", condition = "condition_EVENT_VARIABLE_CHANGE_268002", action = "action_EVENT_VARIABLE_CHANGE_268002", trigger_count = 0 },
|
|
-- 开启操作台
|
|
{ config_id = 1268007, name = "GADGET_STATE_CHANGE_268007", event = EventType.EVENT_GADGET_STATE_CHANGE, source = "", condition = "condition_EVENT_GADGET_STATE_CHANGE_268007", action = "action_EVENT_GADGET_STATE_CHANGE_268007", trigger_count = 0 }
|
|
}
|
|
|
|
-- 变量
|
|
variables = {
|
|
{ config_id = 1, name = "gameplayState", value = 1, no_refresh = true }
|
|
}
|
|
|
|
--================================================================
|
|
--
|
|
-- 初始化配置
|
|
--
|
|
--================================================================
|
|
|
|
-- 初始化时创建
|
|
init_config = {
|
|
suite = 1,
|
|
end_suite = 0,
|
|
rand_suite = false
|
|
}
|
|
|
|
--================================================================
|
|
--
|
|
-- 小组配置
|
|
--
|
|
--================================================================
|
|
|
|
suites = {
|
|
{
|
|
-- suite_id = 1,
|
|
-- description = 静态逻辑,
|
|
monsters = { },
|
|
gadgets = { 268005, 268006 },
|
|
regions = { },
|
|
triggers = { "GROUP_LOAD_268001", "VARIABLE_CHANGE_268002", "GADGET_STATE_CHANGE_268007" },
|
|
rand_weight = 100
|
|
},
|
|
{
|
|
-- suite_id = 2,
|
|
-- description = 玩法开启,
|
|
monsters = { },
|
|
gadgets = { },
|
|
regions = { },
|
|
triggers = { },
|
|
rand_weight = 100
|
|
},
|
|
{
|
|
-- suite_id = 3,
|
|
-- description = 玩法完成,
|
|
monsters = { },
|
|
gadgets = { },
|
|
regions = { },
|
|
triggers = { },
|
|
rand_weight = 100
|
|
}
|
|
}
|
|
|
|
--================================================================
|
|
--
|
|
-- 触发器
|
|
--
|
|
--================================================================
|
|
|
|
-- 触发操作
|
|
function action_EVENT_GROUP_LOAD_268001(context, evt)
|
|
UpdateGamePlayState(context)
|
|
return 0
|
|
end
|
|
|
|
-- 触发条件
|
|
function condition_EVENT_VARIABLE_CHANGE_268002(context, evt)
|
|
if evt.param1 == evt.param2 then return false end
|
|
|
|
-- 判断变量"gameplayState"为0
|
|
if ScriptLib.GetGroupVariableValue(context, "gameplayState") == 0 then
|
|
return false
|
|
end
|
|
return true
|
|
end
|
|
|
|
-- 触发操作
|
|
function action_EVENT_VARIABLE_CHANGE_268002(context, evt)
|
|
UpdateGamePlayState(context)
|
|
return 0
|
|
end
|
|
|
|
-- 触发条件
|
|
function condition_EVENT_GADGET_STATE_CHANGE_268007(context, evt)
|
|
if 312 ~= ScriptLib.GetGadgetStateByConfigId(context, 155005268, 268005) then
|
|
return false
|
|
end
|
|
|
|
return true
|
|
end
|
|
|
|
-- 触发操作
|
|
function action_EVENT_GADGET_STATE_CHANGE_268007(context, evt)
|
|
-- 将本组内变量名为 "gameplayState" 的变量设置为 2
|
|
if 0 ~= ScriptLib.SetGroupVariableValue(context, "gameplayState", 2) then
|
|
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_groupVariable")
|
|
return -1
|
|
end
|
|
|
|
return 0
|
|
end
|
|
|
|
require "V2_4/EnvState"
|
|
require "V2_4/EnvStateWorktop" |