0
0
mirror of https://gitlab.com/YuukiPS/GC-Resources.git synced 2025-04-28 09:05:26 +00:00

sync CustomGCResources

This commit is contained in:
Yuuki 2023-07-03 01:11:40 +08:00
parent a2a4e1a07d
commit 46d2b65b40
15 changed files with 176 additions and 278 deletions

View File

@ -0,0 +1,12 @@
function OnBeHurt(context, element_type, unkParam, is_host)
ScriptLib.PrintContextLog(context, "Test ElectricController")
local state = ScriptLib.GetGadgetState(context)
if element_type == ElementType.Electric then
if state == GadgetState.Default or state == GadgetState.GearAction1 then
ScriptLib.SetGadgetState(context, GadgetState.GearStart)
end
if state == GadgetState.Action01 then
ScriptLib.SetGadgetState(context, GadgetState.Action02)
end
end
end

View File

@ -1,28 +1,12 @@
-- 机关初始化配置
-- 初始状态
local state_ = GadgetState.GearStart
-- 启动元素
local start_elem_type_ = ElementType.Fire
-- 停止元素
local stop_elem_type_ = ElementType.None
-- 机关被攻击
function OnBeHurt(context, element_type, strike_type, is_host)
if is_host == true then
-- 获取机关当前状态
local state = ScriptLib.GetGadgetState(context)
if state == GadgetState.Default or state == GadgetState.GearAction1 then
if start_elem_type_ == element_type then
ScriptLib.SetGadgetState(context, GadgetState.GearStart)
end
end
if state == GadgetState.Action01 then
if start_elem_type_ == element_type then
ScriptLib.SetGadgetState(context, GadgetState.Action02)
end
end
end
end
function OnBeHurt(context, element_type, unkParam, is_host)
ScriptLib.PrintContextLog(context, "Test FireController")
local state = ScriptLib.GetGadgetState(context)
if element_type == ElementType.Fire then
if state == GadgetState.Default or state == GadgetState.GearAction1 then
ScriptLib.SetGadgetState(context, GadgetState.GearStart)
end
if state == GadgetState.Action01 then
ScriptLib.SetGadgetState(context, GadgetState.Action02)
end
end
end

View File

@ -0,0 +1,45 @@
function OnBeHurt(context, element_type, unkParam, is_host)
local state = ScriptLib.GetGadgetState(context)
if state == GadgetState.GearStop then
if element_type == ElementType.Fire then
local value = ScriptLib.GetGearStartValue(context)
value = value + 1
if value >= 1 then
ScriptLib.SetGadgetState(context, GadgetState.GearStart)
ScriptLib.SetGearStartValue(context, 1)
else
ScriptLib.SetGearStartValue(context, value)
end
elseif element_type == ElementType.Ice then
ScriptLib.ResetGadgetState(context, GadgetState.GearStop)
end
elseif state == GadgetState.GearStart then
if element_type == ElementType.Ice then
local value = ScriptLib.GetGearStopValue(context)
value = value + 1
if value >= 1 then
ScriptLib.SetGadgetState(context, GadgetState.GearStop)
ScriptLib.SetGearStopValue(context, 1)
else
ScriptLib.SetGearStopValue(context, value)
end
end
end
end
function OnClientExecuteReq(context, param1, param2, param3)
if param1 == 1 then
ScriptLib.SetGadgetState(context, GadgetState.GearStart)
end
end
function OnTimer(context, now)
local state = ScriptLib.GetGadgetState(context)
if state == GadgetState.GearStop then
local start_time = ScriptLib.GetGadgetStateBeginTime(context)
if now >= start_time + 4 then
ScriptLib.SetGadgetState(context, GadgetState.GearStart)
ScriptLib.SetGearStopValue(context, 0)
end
end
end

View File

@ -1,26 +1,12 @@
-- 机关初始化配置
-- 初始状态
local state_ = GadgetState.GearStart
-- 启动元素
local start_elem_type_ = ElementType.Grass
-- 停止元素
local stop_elem_type_ = ElementType.None
-- 机关被攻击
function OnBeHurt(context, element_type, strike_type, is_host)
if is_host == true then
-- 获取机关当前状态
local state = ScriptLib.GetGadgetState(context)
if state == GadgetState.Default or state == GadgetState.GearAction1 then
if start_elem_type_ == element_type then
ScriptLib.SetGadgetState(context, GadgetState.GearStart)
end
end
if state == GadgetState.Action01 then
if start_elem_type_ == element_type then
ScriptLib.SetGadgetState(context, GadgetState.Action02)
end
end
end
end
function OnBeHurt(context, element_type, unkParam, is_host)
ScriptLib.PrintContextLog(context, "Test GrassController")
local state = ScriptLib.GetGadgetState(context)
if element_type == ElementType.Grass then
if state == GadgetState.Default or state == GadgetState.GearAction1 then
ScriptLib.SetGadgetState(context, GadgetState.GearStart)
end
if state == GadgetState.Action01 then
ScriptLib.SetGadgetState(context, GadgetState.Action02)
end
end
end

View File

@ -1,28 +1,12 @@
-- 机关初始化配置
-- 初始状态
local state_ = GadgetState.GearStart
-- 启动元素
local start_elem_type_ = ElementType.Ice
-- 停止元素
local stop_elem_type_ = ElementType.None
-- 机关被攻击
function OnBeHurt(context, element_type, strike_type, is_host)
if is_host == true then
-- 获取机关当前状态
local state = ScriptLib.GetGadgetState(context)
if state == GadgetState.Default or state == GadgetState.GearAction1 then
if start_elem_type_ == element_type then
ScriptLib.SetGadgetState(context, GadgetState.GearStart)
end
end
if state == GadgetState.Action01 then
if start_elem_type_ == element_type then
ScriptLib.SetGadgetState(context, GadgetState.Action02)
end
end
end
end
function OnBeHurt(context, element_type, unkParam, is_host)
ScriptLib.PrintContextLog(context, "Test IceController")
local state = ScriptLib.GetGadgetState(context)
if element_type == ElementType.Ice then
if state == GadgetState.Default or state == GadgetState.GearAction1 then
ScriptLib.SetGadgetState(context, GadgetState.GearStart)
end
if state == GadgetState.Action01 then
ScriptLib.SetGadgetState(context, GadgetState.Action02)
end
end
end

View File

@ -0,0 +1,8 @@
function OnBeHurt(context, element_type, unkParam, is_host)
local state = ScriptLib.GetGadgetState(context)
if element_type == ElementType.Fire then
if state == GadgetState.Default then
ScriptLib.SetGadgetState(context, GadgetState.GearStart);
end
end
end

View File

@ -1,26 +1,12 @@
-- 机关初始化配置
-- 初始状态
local state_ = GadgetState.GearStart
-- 启动元素
local start_elem_type_ = ElementType.Rock
-- 停止元素
local stop_elem_type_ = ElementType.None
-- 机关被攻击
function OnBeHurt(context, element_type, strike_type, is_host)
if is_host == true then
-- 获取机关当前状态
local state = ScriptLib.GetGadgetState(context)
if state == GadgetState.Default or state == GadgetState.GearAction1 then
if start_elem_type_ == element_type then
ScriptLib.SetGadgetState(context, GadgetState.GearStart)
end
end
if state == GadgetState.Action01 then
if start_elem_type_ == element_type then
ScriptLib.SetGadgetState(context, GadgetState.Action02)
end
end
end
end
function OnBeHurt(context, element_type, unkParam, is_host)
ScriptLib.PrintContextLog(context, "Test RockController")
local state = ScriptLib.GetGadgetState(context)
if element_type == ElementType.Rock then
if state == GadgetState.Default or state == GadgetState.GearAction1 then
ScriptLib.SetGadgetState(context, GadgetState.GearStart)
end
if state == GadgetState.Action01 then
ScriptLib.SetGadgetState(context, GadgetState.Action02)
end
end
end

View File

@ -1,102 +1,25 @@
function OnClientExecuteReq(context, param1, param2, param3)
--ScriptLib.PrintLog("GadgetState Get Change")
if param1 == 0 then
ScriptLib.SetGadgetState(context, GadgetState.Default)
end
if param1 == 101 then
ScriptLib.SetGadgetState(context, 101)
end
if param1 == 102 then
ScriptLib.SetGadgetState(context, 102)
end
if param1 == 103 then
ScriptLib.SetGadgetState(context, 103)
end
if param1 == 104 then
ScriptLib.SetGadgetState(context, 104)
end
if param1 == 200 then
ScriptLib.SetGadgetState(context, 200)
end
if param1 == 201 then
ScriptLib.SetGadgetState(context, GadgetState.GearStart)
end
if param1 == 202 then
ScriptLib.SetGadgetState(context, GadgetState.GearStop)
end
if param1 == 203 then
ScriptLib.SetGadgetState(context, GadgetState.GearAction1)
end
if param1 == 204 then
ScriptLib.SetGadgetState(context, GadgetState.GearAction2)
end
if param1 == 210 then
ScriptLib.SetGadgetState(context, 210)
end
if param1 == 211 then
ScriptLib.SetGadgetState(context, 211)
end
if param1 == 212 then
ScriptLib.SetGadgetState(context, 212)
end
if param1 == 213 then
ScriptLib.SetGadgetState(context, 213)
end
if param1 == 214 then
ScriptLib.SetGadgetState(context, 214)
end
if param1 == 222 then
ScriptLib.SetGadgetState(context, 222)
end
if param1 == 300 then
ScriptLib.SetGadgetState(context, 300)
end
if param1 == 301 then
ScriptLib.SetGadgetState(context, 301)
end
if param1 == 302 then
ScriptLib.SetGadgetState(context, 302)
end
if param1 == 303 then
ScriptLib.SetGadgetState(context, 303)
end
if param1 == 304 then
ScriptLib.SetGadgetState(context, 304)
end
if param1 == 310 then
ScriptLib.SetGadgetState(context, 310)
end
if param1 == 311 then
ScriptLib.SetGadgetState(context, 311)
end
if param1 == 312 then
ScriptLib.SetGadgetState(context, 312)
end
if param1 == 313 then
ScriptLib.SetGadgetState(context, 313)
end
if param1 == 314 then
ScriptLib.SetGadgetState(context, 314)
end
if param1 == 322 then
ScriptLib.SetGadgetState(context, 322)
end
if param1 == 901 then
ScriptLib.SetGadgetState(context, GadgetState.Action01)
end
if param1 == 902 then
ScriptLib.SetGadgetState(context, GadgetState.Action02)
end
if param1 == 903 then
ScriptLib.SetGadgetState(context, GadgetState.Action03)
end
if param1 == 106 then
elseif param1 == 106 then
ScriptLib.SetGadgetState(context, GadgetState.ChestRock)
elseif param1 == 201 then
ScriptLib.SetGadgetState(context, GadgetState.GearStart)
elseif param1 == 202 then
ScriptLib.SetGadgetState(context, GadgetState.GearStop)
elseif param1 == 203 then
ScriptLib.SetGadgetState(context, GadgetState.GearAction1)
elseif param1 == 204 then
ScriptLib.SetGadgetState(context, GadgetState.GearAction2)
elseif param1 == 901 then
ScriptLib.SetGadgetState(context, GadgetState.Action01)
elseif param1 == 902 then
ScriptLib.SetGadgetState(context, GadgetState.Action02)
elseif param1 == 903 then
ScriptLib.SetGadgetState(context, GadgetState.Action03)
elseif (param1 >= 101 and param1 <= 104) or param1 == 200 or
(param1 >= 211 and param1 <= 214) or param1 == 222 or
(param1 >= 300 and param1 <= 304) or (param1 >= 310 and param1 <= 314) or param1 == 322 then
ScriptLib.SetGadgetState(context, param1)
end
end

View File

@ -1,6 +1,3 @@
function OnClientExecuteReq(context, param1, param2, param3)
--ScriptLib.PrintLog("GadgetState Get Change")
ScriptLib.SetGadgetState(context, param1)
return 0
ScriptLib.SetGadgetState(context, param1)
end

View File

@ -1,5 +1,3 @@
function OnDie(context, element_type, strike_type)
ScriptLib.DropSubfield(context, {subfield_name = "Ore_Dig"})
end
end

View File

@ -0,0 +1,7 @@
function OnClientExecuteReq(context, param1, param2, param3)
if param1 == 0 then
ScriptLib.SetGadgetState(context, GadgetState.Default)
elseif param1 == 1 then
ScriptLib.SetGadgetState(context, GadgetState.GearStart)
end
end

View File

@ -1,26 +1,12 @@
-- 机关初始化配置
-- 初始状态
local state_ = GadgetState.GearStart
-- 启动元素
local start_elem_type_ = ElementType.Water
-- 停止元素
local stop_elem_type_ = ElementType.None
-- 机关被攻击
function OnBeHurt(context, element_type, strike_type, is_host)
if is_host == true then
-- 获取机关当前状态
local state = ScriptLib.GetGadgetState(context)
if state == GadgetState.Default or state == GadgetState.GearAction1 then
if start_elem_type_ == element_type then
ScriptLib.SetGadgetState(context, GadgetState.GearStart)
end
end
if state == GadgetState.Action01 then
if start_elem_type_ == element_type then
ScriptLib.SetGadgetState(context, GadgetState.Action02)
end
end
end
end
function OnBeHurt(context, element_type, unkParam, is_host)
ScriptLib.PrintContextLog(context, "Test WaterController")
local state = ScriptLib.GetGadgetState(context)
if element_type == ElementType.Water then
if state == GadgetState.Default or state == GadgetState.GearAction1 then
ScriptLib.SetGadgetState(context, GadgetState.GearStart)
end
if state == GadgetState.Action01 then
ScriptLib.SetGadgetState(context, GadgetState.Action02)
end
end
end

View File

@ -1,28 +1,12 @@
-- 机关初始化配置
-- 初始状态
local state_ = GadgetState.GearStart
-- 启动元素
local start_elem_type_ = ElementType.Wind
-- 停止元素
local stop_elem_type_ = ElementType.None
-- 机关被攻击
function OnBeHurt(context, element_type, strike_type, is_host)
if is_host == true then
-- 获取机关当前状态
local state = ScriptLib.GetGadgetState(context)
if state == GadgetState.Default or state == GadgetState.GearAction1 then
if start_elem_type_ == element_type then
ScriptLib.SetGadgetState(context, GadgetState.GearStart)
end
end
if state == GadgetState.Action01 then
if start_elem_type_ == element_type then
ScriptLib.SetGadgetState(context, GadgetState.Action02)
end
end
end
end
function OnBeHurt(context, element_type, unkParam, is_host)
ScriptLib.PrintContextLog(context, "Test WindController")
local state = ScriptLib.GetGadgetState(context)
if element_type == ElementType.Wind then
if state == GadgetState.Default or state == GadgetState.GearAction1 then
ScriptLib.SetGadgetState(context, GadgetState.GearStart)
end
if state == GadgetState.Action01 then
ScriptLib.SetGadgetState(context, GadgetState.Action02)
end
end
end

View File

@ -1,10 +1,8 @@
function OnBeHurt(context, element_type, strike_type, is_host)
local gather_config_ids = ScriptLib.GetGatherConfigIdList(context)
local length = #gather_config_ids
ScriptLib.PrintLog("gather_config_ids length: " ..length)
function OnBeHurt(context, element_type, unkParam, is_host)
local configIds = ScriptLib.GetGatherConfigIdList(context)
local count = #configIds
if length > 0 then
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, gather_config_ids[1], GadgetState.GatherDrop) then
ScriptLib.PrintLog("Drop config_id:" .. gather_config_ids[1] .." failed")
end
end
ScriptLib.SetGadgetStateByConfigId(context, configIds[1], GadgetState.GatherDrop)
end
end

View File

@ -5549,7 +5549,7 @@
},
{
"gadgetId": 70330400,
"serverController": "ElecController"
"serverController": "ElectricController"
},
{
"gadgetId": 70330401,
@ -6189,7 +6189,7 @@
},
{
"gadgetId": 70360036,
"serverController": "ElecController"
"serverController": "ElectricController"
},
{
"gadgetId": 70360037,
@ -7813,7 +7813,7 @@
},
{
"gadgetId": 70900008,
"serverController": "ElecController"
"serverController": "ElectricController"
},
{
"gadgetId": 70900009,
@ -7869,7 +7869,7 @@
},
{
"gadgetId": 70900056,
"serverController": "ElecController"
"serverController": "ElectricController"
},
{
"gadgetId": 70900057,
@ -8093,7 +8093,7 @@
},
{
"gadgetId": 70900402,
"serverController": "ElecController"
"serverController": "ElectricController"
},
{
"gadgetId": 70900403,