0
0
mirror of https://gitlab.com/YuukiPS/GC-Resources.git synced 2025-04-28 08:55:13 +00:00

Revert "The Great De-Local'ifying of defs and base_info"

This reverts commit 0989747b
This commit is contained in:
KingRainbow44 2023-08-30 21:15:50 -04:00
parent 957e020504
commit 8dd3a721e5
No known key found for this signature in database
GPG Key ID: FC2CB64B00D257BE
26824 changed files with 508601 additions and 509046 deletions

View File

@ -1,5 +1,5 @@
--[[
defs = {
local defs = {
RegionID = 575001
}
--]]

View File

@ -1,5 +1,5 @@
--[[
defs = {
local defs = {
RegionID = 575001
}
--]]
@ -53,4 +53,4 @@ function action_EVENT_LEAVE_REGION(context, evt)
end
Initialize_Group()
--LF_Initialize_Level()
--LF_Initialize_Level()

View File

@ -84,11 +84,11 @@ local progress_def = {
["nightmare"] = {0,1500,3000,4500,6500}
}
defs = {
local defs = {
--group_main
gadget_aster = 413001,
gadget_reward = 123456,
score_ratio = {normal=1,hard=0.75,nightmare=0.5},
score_ratio = {normal=1,hard=0.75,nightmare=0.5},
difficulty_weight = {normal=75,hard=20,nightmare=5},
--group_stage
--group_clear
@ -108,7 +108,7 @@ local play = {
group_gadget = 133001498,
energy_str = "AVATAR_ASTER_SCORE", --uid_value
difficulty = "difficulty",
ratio_energy = {"ASTER_ENERGY_RATIO",2},
ratio_energy = {"ASTER_ENERGY_RATIO",2},
ratio_progress = {"ASTER_PROGRESS_RATIO",2},
op_radius = 10
}
@ -271,7 +271,7 @@ function condition_battle_state(context, evt)
if defs.group_id == play.group_main then
ScriptLib.PrintContextLog(context, "## ASTER_LOG: battle_state : param1->"..evt.param1.." | param2->"..evt.param2.." | param3->"..evt.param3)
end
if evt.param1 == play.PlayType and evt.param2 == play.PlayId then
if evt.param1 == play.PlayType and evt.param2 == play.PlayId then
return true
end
return false
@ -720,7 +720,7 @@ function LF_Get_Uid_Op_Target(context, buff_type)
local list = {}
math.randomseed(ScriptLib.GetServerTime(context) + buff_type)
--if buff_type == 1 or buff_type == 2 then
list[1] = user[math.random(1,#user)]
list[1] = user[math.random(1,#user)]
ScriptLib.PrintContextLog(context, "## ASTER_LOG : uid_op_target -> "..list[1])
--end
return list
@ -744,10 +744,10 @@ function LF_Modify_Gadget_Group(context, stage)
elseif circle_type_defs[D] == 2 then
--交分台换位置
ScriptLib.SetGadgetStateByConfigId(context, defs.gadget_aster, 201)
end
end
if stage == 0 then
ScriptLib.SetScenePlayBattleUidValue(context, 0, host, "circle_ptr", tide_defs[D][stage].circle)
ScriptLib.AddExtraGroupSuite(context, play.group_gadget, tide_defs[D][stage].circle)
ScriptLib.AddExtraGroupSuite(context, play.group_gadget, tide_defs[D][stage].circle)
elseif circle_type_defs[D] == 1 then
ScriptLib.SetScenePlayBattleUidValue(context, 0, host, "circle_ptr", tide_defs[D][stage].circle)
local prev_stage = ScriptLib.GetScenePlayBattleUidValue(context, 0, host, "prev_stage")
@ -758,4 +758,4 @@ function LF_Modify_Gadget_Group(context, stage)
return 0
end
LF_Initialize_Group(triggers, suites, defs.group_id)
LF_Initialize_Group(triggers, suites, defs.group_id)

View File

@ -1,6 +1,6 @@
--地脉花循环营地模板
--defs = {
--local defs = {
-- group_id = xxx ,
-- monster_waves = 4,
-- chest_id = xxx,
@ -19,7 +19,7 @@ local Tri = {
--[6] = { name = "chest_die", config_id = 8000006, event = EventType.EVENT_ANY_GADGET_DIE, source = "", condition = "", action = "action_any_gadget_die", trigger_count = 0 },
[7] = { name = "select_option", config_id = 8000007, event = EventType.EVENT_SELECT_OPTION, source = "", condition = "", action = "action_select_option", trigger_count = 0 },
[8] = { name = "blossom_chest_die", config_id = 8000008, event = EventType.EVENT_BLOSSOM_CHEST_DIE, source = "", condition = "", action = "action_blossom_chest_die", trigger_count = 0 },
}
function Initialize()
@ -33,7 +33,7 @@ function Initialize()
table.insert(variables,{ config_id=50000002,name = "wave", value = 0, no_refresh = true})
end
----------------------------------
@ -92,7 +92,7 @@ function action_blossom_chest_die(context,evt)
ScriptLib.SetGroupVariableValue(context,"HasStarted",0)
ScriptLib.SetGroupVariableValue(context,"wave",0)
ScriptLib.RefreshBlossomGroup(context, { group_id = 0, suite = 1, exclude_prev = true })
end
return 0
end
@ -102,8 +102,8 @@ function action_select_option(context,evt)
ScriptLib.PrintContextLog(context,"BG: Option has been selected! Monster waves start!")
ScriptLib.SetGadgetStateByConfigId(context, LF_Get_Blossom_Operator(context), 201)
ScriptLib.DelWorktopOptionByGroupId(context,0,LF_Get_Blossom_Operator(context),187)
--所有东西成功刷出来了将group设置为已开始状态
ScriptLib.SetGroupVariableValue(context,"HasStarted",1)
LF_Start_Monster_Wave(context)
@ -140,7 +140,7 @@ function LF_Create_Next_Monster_Wave(context)
else
ScriptLib.PrintContextLog(context,"BG: Creating monster wave: "..nextWave)
ScriptLib.AddExtraGroupSuite(context, 0, nextWave+1)
ScriptLib.PrintContextLog(context,"BG: We are trying to load suite : "..nextWave+1)
ScriptLib.SetGroupVariableValue(context,"wave",nextWave)
--ScriptLib.SetGroupTempValue(context, "wave", nextWave, {})
@ -170,7 +170,7 @@ function LF_Init_Blossom_Group(context)
if (LF_Get_Blossom_Operator(context) == -1) then
return -1
end
ScriptLib.PrintContextLog(context,"BG: Current operator config id is: "..LF_Get_Blossom_Operator(context))
--加载地脉淤积的gadget
@ -200,4 +200,4 @@ function LF_Get_Blossom_Operator(context)
return operator[refreshType]
end
----------------------------------
Initialize()
Initialize()

View File

@ -48,7 +48,7 @@ end
Initialize_Group()
----------------------------------------------
--[[
defs = {
local defs = {
operator = 431009,
blossom_chest = 431010,
ice_storm = 431011,
@ -193,4 +193,4 @@ function action_any_gadget_die(context, evt)
end
end
return 0
end
end

View File

@ -52,7 +52,7 @@ end
Initialize_Group()
----------------------------------------------
--[[
defs = {
local defs = {
operator = 422010,
blossom_chest = 422011,
platform = 422013
@ -218,7 +218,7 @@ function action_platform_reach_point(context, evt)
ScriptLib.CreateGadget(context, { config_id = v.gadget })
break
end
end
end
end
return 0
end
@ -233,4 +233,4 @@ function action_timer_event(context, evt)
ScriptLib.CreateGadgetByConfigIdByPos(context, defs.timedOre, {x=pos.x,y=pos.y,z=pos.z}, {x=0,y=0,z=0})
ScriptLib.CreateGroupTimerEvent(context, ScriptLib.GetContextGroupId(context), "timer", interval)
return 0
end
end

View File

@ -1,5 +1,5 @@
--[[
defs = {
local defs = {
gallery_id = 1,
gadget_entry = 1,
balloon_clear_state = 202,
@ -68,7 +68,7 @@ function action_time_axis_pass(context, evt)
LF_CLEAR_CUR_RANDOM_BALLOON(context, evt.param1)
elseif evt.source_name == "static_clear" then
LF_CLEAR_CUR_STATIC_BALLOON(context, evt.param1)
end
end
return 0
end
@ -136,14 +136,14 @@ function LF_CREATE_NEXT_STATIC_BALLOON(context, wave)
if wave == 0 then
balloons = suites[defs.static_start_suite].gadgets
ScriptLib.AddExtraGroupSuite(context, 0, defs.static_start_suite)
else
else
balloons = suites[defs.static_suite_list[wave]].gadgets
--防止策划配错,强制移除
ScriptLib.RemoveExtraGroupSuite(context, 0, defs.static_suite_list[wave])
ScriptLib.AddExtraGroupSuite(context, 0, defs.static_suite_list[wave])
end
ScriptLib.PrintContextLog(context, "## balloon_log : #balloons="..#balloons)
--调整蛋道
for i,v in ipairs(balloons) do
if point_array_defs[v] ~= nil then
@ -228,4 +228,4 @@ function ShootBalloonBombScore(context)
return 0
end
---------------------------------
Initialize()
Initialize()

View File

@ -1,5 +1,5 @@
--[[
defs = {
local defs = {
gallery_id = 1,
option_1 = 7,
option_2 = 2905,
@ -59,7 +59,7 @@ function action_enter_region(context, evt)
for i,v in ipairs(regions) do
if math.abs(v.pos.y - position.y) <= v.size.y/2 then
return LF_SET_VISION_TYPE(context, v.config_id)
end
end
end
return -1
end
@ -185,7 +185,7 @@ function LF_GALLERY_START(context, evt)
if 0 ~= ScriptLib.StartPlatform(context, defs.gadget_final) then
return -1
end
for i,v in ipairs(defs.group_list) do
for i,v in ipairs(defs.group_list) do
ScriptLib.AddExtraGroupSuite(context, v, 2)
end
end
@ -194,7 +194,7 @@ function LF_GALLERY_STOP(context, evt)
ScriptLib.CreateGadget(context, {config_id = defs.gadget_airwall})
--ScriptLib.SetGadgetEnableInteract(context, 0, defs.gadget_operator, true)
ScriptLib.RemoveExtraGroupSuite(context, 0, 2)
for i,v in ipairs(defs.group_list) do
for i,v in ipairs(defs.group_list) do
ScriptLib.RemoveExtraGroupSuite(context, v, 2)
end
local uid_list = ScriptLib.GetSceneUidList(context)
@ -204,7 +204,7 @@ end
-------------------------------------------
function FlyBalloonDestinationScore(context)
ScriptLib.PrintContextLog(context, "## FlyBalloonDestinationScore | uid -> "..context.uid.." | source -> "..context.source_entity_id.." | target -> "..context.target_entity_id)
--ScriptLib.AddTeamEntityGlobalFloatValue(context, {context.uid}, "has_end_game", 1)
--ScriptLib.AddTeamEntityGlobalFloatValue(context, {context.uid}, "has_end_game", 1)
ScriptLib.UpdatePlayerGalleryScore(context, defs.gallery_id, {["trigger_gadget_id"]=70360139,["has_end_game"]=true})
return 0
end
@ -233,4 +233,4 @@ function FlyBalloonLanding(context)
return -1
end
-------------------------------------------
Initialize()
Initialize()

View File

@ -1,4 +1,4 @@
--[[defs = {
--[[local defs = {
gadget_operator = xxx,
group_id = xxx,
gadget_prison_list = {1,2,3,4}
@ -285,4 +285,4 @@ function LF_Handle_Progress(context, skill_name, uid)
end
end
----------------------------------------
Initialize()
Initialize()

View File

@ -1,4 +1,4 @@
--[[defs = {
--[[local defs = {
group_id = xxx,
gadget_prison_list = {1,2,3,4},
gadget_guide = {1,2,3},
@ -11,7 +11,7 @@
rampage_time = 40,
gadget_energy = 1,
}--]]
--[[local energy_info = {
[1] = { time = 80, points = {1,2,3,4,5,6}},
[2] = { time = 160, points = {1,2,3,4,5,6}}
@ -259,9 +259,9 @@ function action_avatar_die(context, evt)
if prey == context.uid then
--prey提前死亡不参与游戏
LF_Set_Prey_Die(context, context.uid)
return 0
return 0
end
end
end
--hunter提前死亡直接结算prey胜利
local _index = ScriptLib.GetHideAndSeekPlayIndex(context)
ScriptLib.EndSceneMultiStagePlayStage(context, _index, "null", true)
@ -425,13 +425,13 @@ function LF_Start_Comp_Challenge(context)
for i,v in ipairs(uid_list) do
if v == hunter then
LF_Set_Player_State_Value(context, v, HS_State.Play.name, 0)
else
else
local idx = 0
for j = 1,3 do
if v == ScriptLib.GetGroupTempValue(context, "prey_"..j, {}) then
idx = j
break
end
end
end
--只有非死亡状态的游侠才继续游戏
if ScriptLib.GetGroupTempValue(context, HS_State.Play.name.."_"..v, {}) == 3 then
@ -567,4 +567,4 @@ function LF_Handle_Exhibition_Prey_Win(context)
end
end
---------------------------------------
Initialize_Base()
Initialize_Base()

View File

@ -1,5 +1,5 @@
--[[
defs = {
local defs = {
timer_region = 1,
challenge_region = 2,
monster_hilichurl = 3,
@ -36,7 +36,7 @@ end
function action_enter_region(context, evt)
if evt.param1 == defs.challenge_region then
--做一个challenge唯一的保护
if ScriptLib.GetGroupTempValue(context, "in_challenge", {}) == 0 then
if ScriptLib.GetGroupTempValue(context, "in_challenge", {}) == 0 then
local ret = ScriptLib.ActiveChallenge(context, 234, 234, 1, 950, 1, 0)
ScriptLib.PrintContextLog(context, "## Hilichurl : hili challenge ret = "..ret)
ScriptLib.SetGroupTempValue(context, "in_challenge", 1, {})
@ -149,7 +149,7 @@ function LF_Handle_Monster_Hilichurl(context)
local time = ScriptLib.GetGameHour(context)
if defs.exist_hour[2] == 24 then
if time == 0 then
time = 24
time = 24
end
end
--先校验时间符合区间
@ -193,4 +193,4 @@ function LF_Try_Summon_Hilichurl(context)
end
end
----------------------------------------------
Initialize()
Initialize()

View File

@ -1,16 +1,16 @@
--[[
defs = {
local defs = {
need_kill_hint = true,
group_id = 144001108, --对应的GroupID
gadget_init = {108013, 108014}, --defs.gadget_init里按顺序填入 开启挑战机关ConfigID、 限时终点ConfigID
challenge_time = 181, --挑战持续的时间
gadget_suites = {
gadget_suites = {
[4] = {108015,108023}, --suites每波需要销毁的指示路点和光柱,结构为[suite_id] = {gadget1,gadget2},id从4开始
[5] = {108017,108024},
[6] = {108019,108025},
},
--怪物死亡时刷新对应的Suites里的纹章,结构为[configid] = suiteid,
suites_heraldry_loot = {
suites_heraldry_loot = {
[108075] = 7,
[108077] = 8,
},
@ -50,7 +50,7 @@ end
--机关开启条件及开启处理
function action_select_option(context, evt)
if defs.gadget_init[1] ~= evt.param1 or 175 ~= evt.param2 then
return -1
return -1
end
--弹出Reminder提示玩家不处于要求的状态下状态ID为2代表玩家处于开船状态
if 2 ~= ScriptLib.GetPlayerVehicleType(context,context.uid) then
@ -87,7 +87,7 @@ function action_select_option(context, evt)
ScriptLib.StartFatherChallenge(context, 2011)
ScriptLib.SetChallengeEventMark(context, 2011, ChallengeEventMarkType.SUMMER_TIME_SPRINT_BOAT_TIME)
ScriptLib.SetChallengeEventMark(context, 2013, ChallengeEventMarkType.SUMMER_TIME_SPRINT_BOAT_GATHER_POINT)
ScriptLib.DelWorktopOptionByGroupId(context, defs.group_id, defs.gadget_init[1], 175)
ScriptLib.DelWorktopOptionByGroupId(context, defs.group_id, defs.gadget_init[1], 175)
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : del_work_options_by_group_configId")
-- 添加suite4的新内容
ScriptLib.AddExtraGroupSuite(context, defs.group_id, defs.suites_chain[1])
@ -96,19 +96,19 @@ function action_select_option(context, evt)
ScriptLib.AddExtraGroupSuite(context, defs.group_id, 10)
end
-- 将configid为 defs.gadget_init[1] 的物件更改为状态 GadgetState.GearStart
ScriptLib.SetGadgetStateByConfigId(context, defs.gadget_init[1], GadgetState.GearStart)
ScriptLib.SetGadgetStateByConfigId(context, defs.gadget_init[1], GadgetState.GearStart)
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_GearStart")
return 0
end
-- 处理成功
function action_challenge_success(context, evt)
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : success_process_start")
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : success_process_start")
if evt.param1 ~= 2011 then
return -1
end
for i=1,#defs.gadget_init do
ScriptLib.KillEntityByConfigId(context, { config_id = defs.gadget_init[i] })
ScriptLib.KillEntityByConfigId(context, { config_id = defs.gadget_init[i] })
end
for i= 2, #suites do
@ -118,7 +118,7 @@ function action_challenge_success(context, evt)
for k,grp_id in pairs(boat_groups) do
ScriptLib.SetGroupTempValue(context, "flagHasStarted", 0, {group_id = grp_id})
end
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : success_kill_all_entity")
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : success_kill_all_entity")
ScriptLib.RefreshGroup(context, { group_id = defs.group_id, suite = 1 })
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : success_process_end")
return 0
@ -142,10 +142,10 @@ function action_challenge_fail(context, evt)
-- 设置操作台选项
ScriptLib.SetWorktopOptionsByGroupId(context, defs.group_id, defs.gadget_init[1], {175})
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_wok_options_by_configid")
for i= 2, #suites do --目前第三组为空,从第四组开始
ScriptLib.RemoveExtraGroupSuite(context, defs.group_id, i)
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : remove_groupsuites")
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : remove_groupsuites")
end
-- 将configid为 defs.gadget_init[1] 的物件更改为状态 GadgetState.Default
@ -170,7 +170,7 @@ end
-- 进入最终区域,suite2
function condition_enter_final_region(context, evt)
-- 判断角色数量不少于1
if evt.param1 ~= suites[2].regions[1] then
if evt.param1 ~= suites[2].regions[1] then
return false
end
if ScriptLib.GetRegionEntityCount(context, { region_eid = evt.source_eid, entity_type = EntityType.AVATAR }) < 1 then
@ -191,7 +191,7 @@ function action_enter_region(context, evt)
if evt.param1 ~= suites[suite_seq].regions[1] then
return -1
end
if ScriptLib.GetRegionEntityCount(context, { region_eid = evt.source_eid, entity_type = EntityType.AVATAR }) < 1 then
if ScriptLib.GetRegionEntityCount(context, { region_eid = evt.source_eid, entity_type = EntityType.AVATAR }) < 1 then
return -1
end
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : Enter"..suite_seq)

View File

@ -1,5 +1,5 @@
--[[
defs = {
local defs = {
group_id = xxx,
tide_sum = 25,
tide_max = 8,
@ -32,7 +32,7 @@ function Initialize()
for k,v in pairs(Tri) do
table.insert(triggers, v)
table.insert(suites[1].triggers, v.name)
end
end
for k,v in pairs(Var) do
table.insert(variables, v)
end
@ -69,7 +69,7 @@ function action_any_monster_die(context, evt)
ScriptLib.AddBlossomScheduleProgressByGroupId(context, defs.group_id)
if 0 == ScriptLib.GetGroupMonsterCount(context) then
local _wave = ScriptLib.GetGroupVariableValue(context, "wave")
if _wave+4 <= #suites then
if _wave+4 <= #suites then
ScriptLib.ShowReminderRadius(context, 400004, points[1].pos, 40)
ScriptLib.AddExtraGroupSuite(context, 0, _wave+4)
ScriptLib.ChangeGroupVariableValue(context, "wave", 1)
@ -97,4 +97,4 @@ function LF_Group_Init(context)
ScriptLib.AddExtraGroupSuite(context, 0, 4)
end
------------------------------
Initialize()
Initialize()

View File

@ -1,5 +1,5 @@
--[[
defs = {
local defs = {
monster_boss = xxx,
summon_region_list = {1,2,3}, --region出怪的list
summon_interval = 15, --自动出怪时间
@ -113,7 +113,7 @@ function action_any_monster_die(context, evt)
LF_Random_Attack_Platform(context)
ScriptLib.InitTimeAxis(context, "shuffle_loop", {25}, true)
end
break
break
end
end
end
@ -200,7 +200,7 @@ function LF_Summon_Action(context, idx)
ScriptLib.RemoveExtraGroupSuite(context, 0, idx+5)
end
local value = ScriptLib.GetGroupTempValue(context, "SummonStep", {})
value = value - value%math.pow(10,idx) + value%math.pow(10,idx-1) + math.pow(10,idx-1)
value = value - value%math.pow(10,idx) + value%math.pow(10,idx-1) + math.pow(10,idx-1)
ScriptLib.SetGroupTempValue(context, "SummonStep", value, {})
if value ~= 1111 then
ScriptLib.InitTimeAxis(context, "summon", {defs.summon_interval}, true)
@ -224,7 +224,7 @@ end
function SLC_Summon_Start(context)
if 1 ~= ScriptLib.GetGroupTempValue(context, "summon_lock", {}) then
ScriptLib.SetGroupTempValue(context, "summon_lock", 1, {})
else
else
return -1
end
ScriptLib.EndTimeAxis(context, "summon_delay")
@ -258,4 +258,4 @@ end
---------------------------------------
Initialize()
---------------------------------------
---------------------------------------

View File

@ -1,9 +1,9 @@
--[[
defs = {
local defs = {
gadget_up = 1, --向上压板
gadget_down = 2, --向下压板
gadget_water = 7001, --水片
point_array = 400100010,
point_array = 400100010,
point_list = {1,2,3,4,5},
gadget_list = {1,2,3,4,5}, --刻痕
point_xz = {x=100,z=100}, --point坐标
@ -62,7 +62,7 @@ end
function action_platform_reach_point(context, evt)
ScriptLib.PrintContextLog(context, "## TuneStone : Reach_Point | "..evt.param1.." | "..evt.param2)
local water = ScriptLib.GetGroupVariableValue(context, "Water_Level")
ScriptLib.ScenePlaySound(context, {play_pos = defs.audio_xyz, sound_name = defs.audio_list[water], play_type=1, is_broadcast=true})
ScriptLib.ScenePlaySound(context, {play_pos = defs.audio_xyz, sound_name = defs.audio_list[water], play_type=1, is_broadcast=true})
ScriptLib.SetGroupTempValue(context, "motion", 0, {})
--if evt.param1 == defs.gadget_water then
-- LF_Check_Water_To_Motion(context, evt)
@ -104,7 +104,7 @@ function LF_Init_Water(context, evt)
ScriptLib.SetPlatformPointArray(context, defs.gadget_water, defs.point_array, {defs.point_list[defs.start_level]}, {route_type = 0, turn_mode = false})
ScriptLib.SetGroupVariableValue(context, "first_play", 0)
ScriptLib.SetGroupVariableValue(context, "Water_Level", defs.start_level)
return 0
return 0
end
if water == 0 then
water = defs.start_level
@ -122,7 +122,7 @@ function LF_Modify_Water(context, water, delta)
ScriptLib.PrintContextLog(context, "## TuneStone : LF_Modify_Water : level = "..water.." | delta = "..delta)
ScriptLib.SetGroupTempValue(context, "motion", 1, {})
ScriptLib.SetGadgetStateByConfigId(context, defs.gadget_list[water], 0)
--ScriptLib.ScenePlaySound(context, {play_pos = defs.audio_xyz, sound_name = defs.audio_list[water], play_type=2, is_broadcast=true})
--ScriptLib.ScenePlaySound(context, {play_pos = defs.audio_xyz, sound_name = defs.audio_list[water], play_type=2, is_broadcast=true})
local _water = water + delta
ScriptLib.SetGroupVariableValue(context, "Water_Level", _water)
ScriptLib.SetPlatformPointArray(context, defs.gadget_water, defs.point_array, {defs.point_list[_water]}, {route_type = 0, turn_mode = false})
@ -145,4 +145,4 @@ function LF_Check_Water_To_Motion(context, evt)
ScriptLib.SetGroupVariableValue(context, "tune", water)
end
--------------------------------------
Initialize()
Initialize()

View File

@ -1,6 +1,6 @@
--[[
defs = {
group_id = xxx ,
local defs = {
group_id = xxx ,
monster_shaman = 1,
gadget_barrier = {1,2,3,4,5},
TowerBridges = {{3,4},{3,5}}
@ -102,4 +102,4 @@ function LF_Init_Blossom_Group(context)
ScriptLib.AddExtraGroupSuite(context, 0, 2)
end
----------------------------------
Initialize()
Initialize()

View File

@ -1,6 +1,6 @@
--地脉花循环营地模板
--defs = {
--local defs = {
-- group_id = xxx ,
-- monster_waves = 4,
-- chest_id = xxx,
@ -19,7 +19,7 @@ local Tri = {
--[6] = { name = "chest_die", config_id = 8000006, event = EventType.EVENT_ANY_GADGET_DIE, source = "", condition = "", action = "action_any_gadget_die", trigger_count = 0 },
[7] = { name = "select_option", config_id = 8000007, event = EventType.EVENT_SELECT_OPTION, source = "", condition = "", action = "action_select_option", trigger_count = 0 },
[8] = { name = "blossom_chest_die", config_id = 8000008, event = EventType.EVENT_BLOSSOM_CHEST_DIE, source = "", condition = "", action = "action_blossom_chest_die", trigger_count = 0 },
}
function Initialize()
@ -33,7 +33,7 @@ function Initialize()
table.insert(variables,{ config_id=50000002,name = "wave", value = 0, no_refresh = true})
end
----------------------------------
@ -92,7 +92,7 @@ function action_blossom_chest_die(context,evt)
ScriptLib.SetGroupVariableValue(context,"HasStarted",0)
ScriptLib.SetGroupVariableValue(context,"wave",0)
ScriptLib.RefreshBlossomGroup(context, { group_id = 0, suite = 1, exclude_prev = true })
end
return 0
end
@ -102,8 +102,8 @@ function action_select_option(context,evt)
ScriptLib.PrintContextLog(context,"BG: Option has been selected! Monster waves start!")
ScriptLib.SetGadgetStateByConfigId(context, LF_Get_Blossom_Operator(context), 201)
ScriptLib.DelWorktopOptionByGroupId(context,0,LF_Get_Blossom_Operator(context),187)
--所有东西成功刷出来了将group设置为已开始状态
ScriptLib.SetGroupVariableValue(context,"HasStarted",1)
LF_Start_Monster_Wave(context)
@ -140,7 +140,7 @@ function LF_Create_Next_Monster_Wave(context)
else
ScriptLib.PrintContextLog(context,"BG: Creating monster wave: "..nextWave)
ScriptLib.AddExtraGroupSuite(context, 0, nextWave+1)
ScriptLib.PrintContextLog(context,"BG: We are trying to load suite : "..nextWave+1)
ScriptLib.SetGroupVariableValue(context,"wave",nextWave)
--ScriptLib.SetGroupTempValue(context, "wave", nextWave, {})
@ -170,7 +170,7 @@ function LF_Init_Blossom_Group(context)
if (LF_Get_Blossom_Operator(context) == -1) then
return -1
end
ScriptLib.PrintContextLog(context,"BG: Current operator config id is: "..LF_Get_Blossom_Operator(context))
--加载地脉淤积的gadget
@ -200,4 +200,4 @@ function LF_Get_Blossom_Operator(context)
return operator[refreshType]
end
----------------------------------
Initialize()
Initialize()

View File

@ -1,6 +1,6 @@
--2.0奥博伦派对玩法
--defs = {
--local defs = {
-- group_id = 111101122 ,
-- tamari_gadget_id = defs.temari_gadget_id,
-- host_option_id = 184,
@ -33,7 +33,7 @@ local Tri2 = {
[4] = { name = "select_option", config_id = 8000006, event = EventType.EVENT_SELECT_OPTION, source = "", condition = "", action = "action_select_option", trigger_count = 0, forbid_guest = false },
[5] = { name = "group_refresh", config_id = 8000007, event = EventType.EVENT_GROUP_REFRESH, source = "", condition = "", action = "action_group_refresh", trigger_count = 0},
[6] = { name = "gadget_create", config_id = 8000008, event = EventType.EVENT_GADGET_CREATE, source = "", condition = "", action = "action_gadget_create", trigger_count = 0},
}
function Initialize()
@ -45,13 +45,13 @@ function Initialize()
table.insert(triggers, v)
table.insert(suites[2].triggers, v.name)
end
table.insert(chests,defs.chest_1)
table.insert(chests,defs.chest_2)
table.insert(chests,defs.chest_3)
--table.insert(chests,defs.chest_online)
table.insert(temari_gadgets,defs.temari_1)
table.insert(temari_gadgets,defs.temari_2)
table.insert(temari_gadgets,defs.temari_2)
table.insert(temari_gadgets,defs.temari_3)
table.insert(temari_gadgets,defs.temari_online)
@ -72,7 +72,7 @@ end
function action_group_load(context,evt)
ScriptLib.PrintContextLog(context,"TMR: Group Load!")
LF_Initiate_Play(context)
return 0
end
@ -102,7 +102,7 @@ function action_gadget_create(context,evt)
if (evt.param1 == defs.temari_gadget_id) then
LF_Set_Gadget_Option(context)
end
return 0
return 0
end
function action_quest_finish(context,evt)
@ -116,10 +116,10 @@ end
--选择了选项,根据当前主客机,触发不同的挑战(联机挑战)
function action_select_option(context,evt)
--试图开启主机藏球挑战
if evt.param2 == tempDefs.host_option then
if evt.param2 == tempDefs.host_option then
--藏球挑战
if LF_Is_Host(context) then
if LF_Get_Challenge_State(context) == 10 or LF_Get_Challenge_State(context) == 12 then
if LF_Get_Challenge_State(context) == 10 or LF_Get_Challenge_State(context) == 12 then
--仅在联机玩法初始化以及主机已完成藏球的情况下,可以开启藏球挑战
ScriptLib.PrintContextLog(context,"TMR: !!!!!!!!!!!!Hide ball challenge starts!!!!!!!")
LF_Load_Online_Level(context,1)
@ -167,7 +167,7 @@ function action_select_option(context,evt)
ScriptLib.PrintContextLog(context,"TMR: CHALLENGE FAILS!!!! Cannot start duplicated challenges!!!")
end
end
return 0
end
@ -176,7 +176,7 @@ end
function action_challenge_fail(context,evt)
if LF_Get_Play_Phase(context) == 1 then
if evt.param1 == tempDefs.find_ball_challenge_offline then
if evt.param1 == tempDefs.find_ball_challenge_offline then
ScriptLib.PrintContextLog(context,"TMR: Offline Challenge fails!")
LF_Stop_Temari_Gallery(context)
LF_Update_Quest_State(context,false)
@ -206,7 +206,7 @@ function action_challenge_fail(context,evt)
--移除掉联机用的关卡布设
LF_Online_Hide_Level(context)
LF_Set_Gadget_Option(context)
LF_Stop_Temari_Gallery(context)
LF_Stop_Temari_Gallery(context)
end
end
@ -216,13 +216,13 @@ end
--分别处理单机玩法和联机玩法挑战成功的情况
function action_challenge_success(context,evt)
ScriptLib.PrintContextLog(context,"TMR: Some challenge has been finished!!!")
if LF_Get_Play_Phase(context) == 1 then
if evt.param1 == tempDefs.find_ball_challenge_offline then
if evt.param1 == tempDefs.find_ball_challenge_offline then
ScriptLib.PrintContextLog(context,"TMR: Offline Challenge success!")
LF_Stop_Temari_Gallery(context)
LF_Update_Quest_State(context,true)
LF_Update_Quest_State(context,true)
--创建一个单机找球挑战宝箱,仅单机挑战的最后一关给一个宝箱
if (LF_Get_OfflineChallenge_Level(context)-2 == 3) then
ScriptLib.CreateGadget(context,{config_id=chests[LF_Get_OfflineChallenge_Level(context)-2]})
@ -247,10 +247,10 @@ function action_challenge_success(context,evt)
--移除掉联机用的关卡布设
LF_Online_Hide_Level(context)
LF_Set_Gadget_Option(context)
LF_Stop_Temari_Gallery(context)
LF_Stop_Temari_Gallery(context)
end
end
return 0
end
@ -291,7 +291,7 @@ function LF_Load_Next_Level(context)
end
--初始化联机玩法
function LF_Initiate_Online_Challenge(context)
function LF_Initiate_Online_Challenge(context)
--把交互用的奥博伦球创建出来
ScriptLib.CreateGadget(context,{config_id = defs.temari_gadget_id})
--给奥博伦交互球设置选项
@ -318,7 +318,7 @@ end
--重置整个group的方法将group还原至最初的状态
function LF_Reset_Group(context)
if LF_Get_Play_Phase(context) == 1 then
if LF_Get_Play_Phase(context) == 1 then
LF_Set_OfflineChallenge_Level(context,2)
LF_Set_Challenge_State(context,0)
else
@ -337,10 +337,10 @@ end
--target:0单机找球1联机藏球2联机找球
function LF_Start_Challenge(context,target)
if LF_Get_Play_Phase(context) == 1 then
--要求开启挑战,因为是单机的,直接开就可以了
--要求开启挑战,因为是单机的,直接开就可以了
ScriptLib.ActiveChallenge(context,tempDefs.find_ball_challenge_offline,tempDefs.find_ball_challenge_offline,tempDefs.challenge_time, 0, tempDefs.find_ball_challenge_offline, 1)
LF_Start_Temari_Gallery(context)
else
if (target == 2) then
local ret = LF_Start_Temari_Gallery(context)
@ -365,7 +365,7 @@ function LF_Start_Challenge(context,target)
ScriptLib.CreateFatherChallenge(context, father_challenge, father_challenge, tempDefs.challenge_time, {success=2, fail=1})
ScriptLib.AttachChildChallenge(context, father_challenge, challenge, challenge, child_challenge_param_table, {context.uid},{success=1, fail=1})
ScriptLib.StartFatherChallenge(context,father_challenge)
end
return 0
end
@ -377,15 +377,15 @@ function LF_Stop_Challenge(context,target,result)
if LF_Get_Play_Phase(context) == 1 then
--单机的直接关掉即可
ScriptLib.PrintContextLog(context,"TMR: Stop offline challenge here!!!")
ScriptLib.StopChallenge(context,tempDefs.find_ball_challenge_offline,result)
else
if (target == 1) then
if (target == 1) then
--结束联机藏球挑战
ScriptLib.PrintContextLog(context,"TMR: Stop hide ball challenge with result: "..result)
ScriptLib.StopChallenge(context,tempDefs.father_hide_ball_challenge,result)
elseif (target == 2) then
elseif (target == 2) then
--结束联机找球挑战
ScriptLib.PrintContextLog(context,"TMR: Stop find ball challenge with result: "..result)
ScriptLib.StopChallenge(context,tempDefs.father_find_ball_challenge,result)
@ -418,14 +418,14 @@ function LF_Update_Quest_State(context, questState)
local quest_suffix = "01"
if (questState) then
quest_suffix = "01"
else
else
quest_suffix = "02"
end
local quest_param = defs.group_id.."0"..quest_level..quest_suffix
local ret = ScriptLib.AddQuestProgress(context,quest_param)
ScriptLib.PrintContextLog(context,"TMR: quest param is "..quest_param)
ScriptLib.PrintContextLog(context,"TMR: The result of Adding quest progress is "..ret)
--不论挑战是否胜利,都要移除掉当前加载的关卡
@ -458,9 +458,9 @@ function LF_Teleport_Player(context)
ScriptLib.PrintContextLog(context,"TMR: Current host player is :"..uidlist[1])
ScriptLib.PrintContextLog(context,"TMR: The context uid is: "..context.uid)
if (LF_Is_Host(context)) then
ScriptLib.TransPlayerToPos(context, {uid_list = {uidlist[1]}, pos = {x=temari_pos.x,y=temari_pos.y,z=temari_pos.z}, radius = 1, rot = {x=0, y=0, z=1},is_skip_ui=false} )
ScriptLib.TransPlayerToPos(context, {uid_list = {uidlist[1]}, pos = {x=temari_pos.x,y=temari_pos.y,z=temari_pos.z}, radius = 1, rot = {x=0, y=0, z=1},is_skip_ui=false} )
else
ScriptLib.TransPlayerToPos(context, {uid_list = {context.uid}, pos = {x=temari_pos.x,y=temari_pos.y,z=temari_pos.z}, radius = 1, rot = {x=0, y=0, z=1},is_skip_ui=false} )
ScriptLib.TransPlayerToPos(context, {uid_list = {context.uid}, pos = {x=temari_pos.x,y=temari_pos.y,z=temari_pos.z}, radius = 1, rot = {x=0, y=0, z=1},is_skip_ui=false} )
end
end
@ -553,7 +553,7 @@ end
--返回当前关卡的手鞠球位置
function LF_Get_Temari_Pos(context)
if (LF_Get_Play_Phase(context) == 1) then
if (LF_Get_Play_Phase(context) == 1) then
--一阶段获取手鞠球的位置
local curLevel = LF_Get_OfflineChallenge_Level(context)
local temari_entity_id = ScriptLib.GetEntityIdByConfigId(context,temari_gadgets[curLevel-2])
@ -572,7 +572,7 @@ end
--存储联机玩法中当前球的位置
function LF_Save_Online_Temari_Pos(context)
local pos = LF_Get_Temari_Pos(context)
ScriptLib.PrintContextLog(context,"TMR: Save Temari pos: "..pos.x..","..pos.y..","..pos.z)
local ret = ScriptLib.SetGroupVariableValue(context,"pos_x",math.floor(pos.x))
ScriptLib.SetGroupVariableValue(context,"pos_y",math.ceil(pos.y))
@ -669,4 +669,4 @@ function SLC_Hide_Ball(context)
end
--------------------------------------------------------------------
Initialize()
Initialize()

View File

@ -3,7 +3,7 @@
--1. 同group内的溢出洞口每经过时间randomTime发一次球
--2. 每次randomCount个洞口会发球
--[[
defs = {
local defs = {
--GroupID
group_id = 240950005,
@ -19,7 +19,7 @@ defs = {
--配置每次几个洞口发球
random_thunderhole_sum = {
min = 1,
min = 1,
max = 3,
},
@ -35,8 +35,8 @@ local define = {
}
local extraTriggers={
initialtrigger =
{
initialtrigger =
{
--["Select_Option"] = { config_id = 8000001, name = "Select_Option", event = EventType.EVENT_SELECT_OPTION, source = "", condition = "", action = "action_select_option", trigger_count = 0 },
["TimeAxis_Event"] = { config_id = 8000002, name = "TimeAxis_Event", event= EventType.EVENT_TIME_AXIS_PASS, source = "", condition = "", action = "action_trigger_timeaxis", trigger_count = 0 },
--["Challenge_Fail"] = { config_id = 8000003, name = "Challenge_Fail", event= EventType.EVENT_CHALLENGE_FAIL, source = "", condition = "", action = "action_challenge_fail", trigger_count = 0 },
@ -91,7 +91,7 @@ function RandomThunderHole(context, minNum, maxNum)
math.randomseed(ScriptLib.GetServerTime(context))
randomNum = math.random(minNum, maxNum)
for i=1,randomNum do
for i=1,randomNum do
if ScriptLib.GetGadgetStateByConfigId(context, define.groupID, define.gadgetList[i]) ~= 0 then
ScriptLib.SetGadgetStateByConfigId(context, define.gadgetList[i], 202)--物件切202发球后会自己切回201
end
@ -143,10 +143,10 @@ end
function CheckThunderHoleState(context)
for i=1,#define.gadgetList do
if ScriptLib.GetGadgetStateByConfigId(context, define.groupID, define.gadgetList[i]) == 0 then
ScriptLib.EndTimeAxis(context, "shoot")
ScriptLib.EndTimeAxis(context, "shoot")
break
end
end
end
return 0
end
LF_Initialize_Group(triggers, suites)
LF_Initialize_Group(triggers, suites)

View File

@ -7,7 +7,7 @@
=======================================]]--
-- Trigger变量
--[[
defs = {
local defs = {
BossConfigID = 181001,
regionID = 181005,
}
@ -119,3 +119,4 @@ end
LF_Initialize_Level()
--- ServerUploadTool Save to [/root/env/data/lua/common/V2_1] ---

View File

@ -1,6 +1,6 @@
-- Trigger变量
--[[
defs = {
local defs = {
BossConfigID = 1002,
EnvConfigID = 1001,
GroupID = 220117001,
@ -111,3 +111,4 @@ end
LF_Initialize_Level()
--- ServerUploadTool Save to [/root/env/data/lua/common/V2_1] ---

View File

@ -1,6 +1,6 @@
-- Trigger变量
--[[
defs = {
local defs = {
BossConfigID = 1002,
EnvConfigID = 1001,
GroupID = 220117001,
@ -89,3 +89,4 @@ end
LF_Initialize_Level()
--- ServerUploadTool Save to [/root/env/data/lua/common/V2_1] ---

View File

@ -26,7 +26,7 @@
------
--defs = {
--local defs = {
-- group_id = 235801002,
-- worktop_id = 123,
-- minion_fever = 5,
@ -83,7 +83,7 @@ local Tri = {
[8] = { name = "sumo_switch_team", config_id = 8000008, event = EventType.EVENT_SUMO_SWITCH_TEAM_EVENT, source = "", condition = "", action = "action_sumo_switch_team", trigger_count = 0},
[9] = { name = "dungeon_all_avatar_die", config_id = 8000009, event = EventType.EVENT_DUNGEON_ALL_AVATAR_DIE, source = "", condition = "", action = "action_dungeon_all_avatar_die", trigger_count = 0},
[10] = { name = "dungeon_settle", config_id = 8000010, event = EventType.EVENT_DUNGEON_SETTLE, source = "", condition = "", action = "action_dungeon_settle", trigger_count = 0},
}
function Initialize()
@ -117,7 +117,7 @@ function action_group_load(context,evt)
--ScriptLib.PrintContextLog(context,"FS: The result of starting weather".. DungeonWeather[1].."is "..ret)
--ret = ScriptLib.EnterWeatherArea(context, DungeonWeather[1])
--ScriptLib.PrintContextLog(context,"FS: The result of entering weather".. DungeonWeather[1].."is "..ret)
return 0
end
@ -170,7 +170,7 @@ function action_time_axis_pass(context,evt)
--ScriptLib.PrintContextLog(context,"FS: Showing reminder "..local_defs.team_noswitch_pubishment_reminder)
ScriptLib.ShowTemplateReminder(context, local_defs.team_noswitch_pubishment_reminder, {0})
--ScriptLib.ShowReminder(context, local_defs.team_noswitch_pubishment_reminder)
ScriptLib.SetGroupVariableValue(context,"is_noswitch_punishment",1)
LF_Set_Team_Global_Value(context,local_defs.team_noswitch_pubishment,1)
end
@ -225,7 +225,7 @@ function action_monster_die_before_leave_scene(context,evt)
LF_Update_Fever(context,defs.minion_fever*fever_ratio)
else
LF_Update_Fever(context,defs.elite_fever*fever_ratio)
--精英死亡时,重新开始计时
ScriptLib.EndTimeAxis(context,"ELITE_AXIS")
ScriptLib.InitTimeAxis(context,"ELITE_AXIS",time_axis.elite_axis,false)
@ -268,7 +268,7 @@ function action_sumo_switch_team(context,evt)
ScriptLib.UpdatePlayerGalleryScore(context, defs.gallery_id, {["uid"] = uid_list[1], ["noswitch_time"] = defs.noswitch_punishment_interval})
--清除当前显示的换队惩罚的reminder
local uid_list = ScriptLib.GetSceneUidList(context)
local ret = ScriptLib.RevokePlayerShowTemplateReminder(context, local_defs.team_noswitch_pubishment_reminder, {})
@ -277,7 +277,7 @@ function action_sumo_switch_team(context,evt)
--换队的时候修改team的gv重新刷一下新的avatar身上的加成效果
--ScriptLib.PrintContextLog(context,"FS: team has changed, team_has_change = 1")
LF_Set_Team_Global_Value(context,local_defs.team_has_switch,1)
ScriptLib.SetGroupVariableValue(context,"is_noswitch_punishment",0)
return 0
@ -332,7 +332,7 @@ end
--终止玩法方法,关掉各种东西
function LF_Stop_Play(context)
local current_monster_tide = LF_Get_Current_Monster_Tide(context)
--清理一下空气墙,防止其他问题
ScriptLib.RemoveEntityByConfigId(context, defs.group_id, EntityType.GADGET, defs.airwall)
@ -354,7 +354,7 @@ function LF_Create_Monster_Tide(context,monster_tide_index)
local monster_config_id_list = monster_tide[monster_tide_index]
--增加怪物潮的计数下一次开启时index会+1防止索引到同一波怪物潮
local tide_num = LF_Get_Current_Tide_Num(context)
local tide_num = LF_Get_Current_Tide_Num(context)
LF_Set_Current_Tide_Num(context,tide_num+1)
ScriptLib.AutoMonsterTide(context, tide_num+1, defs.group_id, monster_config_id_list, #monster_config_id_list, defs.min_monster_count,defs.max_monster_count)
@ -390,7 +390,7 @@ function LF_Activate_Environment_Gadget(context,fever_level)
local config_id = suites[defs.environment_suite].gadgets[i]
local gadget_id = LF_Get_Gadget_Id_By_Config_Id(context,config_id)
--大小火盆
if (gadget_id == 70350306 or gadget_id == 70350307) then
if (gadget_id == 70350306 or gadget_id == 70350307) then
if (fever_level<local_defs.burn_effect_level) then
--点燃小火
--ScriptLib.PrintContextLog(context,"FS: Burn little fire!")
@ -401,21 +401,21 @@ function LF_Activate_Environment_Gadget(context,fever_level)
--ScriptLib.PrintContextLog(context,"FS: Burn middle fire!")
local ret = ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, config_id, 201)
end
if (fever_level >= #fever_progress_table-2) then
if (fever_level >= #fever_progress_table-2) then
--持续喷大火
--ScriptLib.PrintContextLog(context,"FS: Burn super fire!")
ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, config_id, 202)
end
end
--挂灯
if (gadget_id == 70350308) then
if (gadget_id == 70350308) then
if (fever_level>=local_defs.burn_effect_level) then
--点燃小火
ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, config_id, 201)
end
end
--场景氛围
if (gadget_id == 70350309) then
if (gadget_id == 70350309) then
--转到对应的gadgetStatedefault-0、phase1-201、phase2-202、phase3-203、phase4-204
ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, config_id, 200+fever_level)
end
@ -526,24 +526,24 @@ end
--server lua call-------------------------------------------------
function SLC_Update_Fever_Ratio(context,new_fever_ratio)
ScriptLib.PrintContextLog(context,"FS: SERVER_LUA_CALL: Changing fever ratio to: "..new_fever_ratio)
ScriptLib.SetGroupVariableValue(context,"fever_ratio",new_fever_ratio)
return 0
return 0
end
--向客户端下发当前的惩罚状态和fever值用于客户端重连时请求
function SLC_Refresh_Team_State(context)
ScriptLib.PrintContextLog(context,"FS: SERVER_LUA_CALL: Request for refresh punishment state: ")
local is_noswitch_punishment = ScriptLib.GetGroupVariableValue(context,"is_noswitch_punishment")
LF_Set_Team_Global_Value(context,"NOSWITCH_PUNISHMENT",is_noswitch_punishment)
local fever = ScriptLib.GetGalleryProgressScore(context, "fever", defs.gallery_id)
LF_Set_Team_Global_Value(context,"fever",fever)
return 0
return 0
end
------------------------------------------------------------------
Initialize()
Initialize()

View File

@ -4,7 +4,7 @@
--挑战倒计时结束关Gallery停止钓鱼
--另外处理Gallery意外先结束同步退出钓鱼-停挑战
-- defs = {
-- local defs = {
-- --对应GalleryID
-- gallery_id = 11001,
@ -19,7 +19,7 @@
-- challenge_id = 0,
-- --本挑战中算作计数目标的鱼IDs 鱼ID在FishData表
-- target_fish_id =
-- target_fish_id =
-- {1,2,3,4,5},
-- }
@ -39,8 +39,8 @@ local extraTriggers = {
{ name = "fishing_start", config_id = 8000004, event = EventType.EVENT_FISHING_START, source = "", condition = "", action = "action_fishing_start", trigger_count = 0},
{ name = "fishing_timeout_flee", config_id = 8000005, event = EventType.EVENT_FISHING_TIMEOUT_FLEE, source = "", condition = "", action = "action_fishing_timeout_flee", trigger_count = 0},
{ name = "fishing_qte_finish", config_id = 8000006, event = EventType.EVENT_FISHING_QTE_FINISH, source = "", condition = "", action = "action_fishing_qte_finish", trigger_count = 0},
{ name = "fishing_score_change", config_id = 8000007, event = EventType.EVENT_VARIABLE_CHANGE, source = "challenge_score", condition = "", action = "", trigger_count = 0, tag = "1000"},
{ name = "fishing_qte_finish", config_id = 8000006, event = EventType.EVENT_FISHING_QTE_FINISH, source = "", condition = "", action = "action_fishing_qte_finish", trigger_count = 0},
{ name = "fishing_score_change", config_id = 8000007, event = EventType.EVENT_VARIABLE_CHANGE, source = "challenge_score", condition = "", action = "", trigger_count = 0, tag = "1000"},
{ name = "leave_region", config_id = 8000008, event = EventType.EVENT_LEAVE_REGION, source = "", condition = "", action = "action_leave_region", trigger_count = 0}
}
@ -94,11 +94,11 @@ function action_gallery_stop(context, evt)
ScriptLib.SetGroupTempValue(context, "gallery_state", 0, {})
--正常应该Gallery结束控制Challenge结束
if ScriptLib.GetGroupTempValue(context, "fishing_state", {}) == 1 then
--设置挑战状态标记
ScriptLib.SetGroupTempValue(context, "fishing_state", 0, {})
if ScriptLib.GetGroupTempValue(context, "challenge_state", {}) == 1 then
if ScriptLib.GetGroupTempValue(context, "challenge_state", {}) == 1 then
--停挑战
ScriptLib.StopChallenge(context, defs.challenge_id, 1)
end
@ -115,12 +115,12 @@ end
function action_challenge_fail(context, evt)
ScriptLib.SetGroupTempValue(context, "challenge_state", 0, {})
if ScriptLib.GetGroupTempValue(context, "fishing_state", {}) == 1 then
--设置挑战状态标记
ScriptLib.SetGroupTempValue(context, "fishing_state", 0, {})
--停止Gallery false失败 true成功。这里需要填false
if ScriptLib.GetGroupTempValue(context, "gallery_state", {}) == 1 then
if ScriptLib.GetGroupTempValue(context, "gallery_state", {}) == 1 then
ScriptLib.StopGallery(context, defs.gallery_id, false)
ScriptLib.PrintContextLog(context, "[fishing] Gallery stopped by challenge end.")
end
@ -136,12 +136,12 @@ end
function action_challenge_success(context, evt)
ScriptLib.SetGroupTempValue(context, "challenge_state", 0, {})
if ScriptLib.GetGroupTempValue(context, "fishing_state", {}) == 1 then
--设置挑战状态标记
ScriptLib.SetGroupTempValue(context, "fishing_state", 0, {})
--停止Gallery false失败 true成功
if ScriptLib.GetGroupTempValue(context, "gallery_state", {}) == 1 then
if ScriptLib.GetGroupTempValue(context, "gallery_state", {}) == 1 then
ScriptLib.StopGallery(context, defs.gallery_id, false)
end
@ -158,12 +158,12 @@ function action_fishing_timeout_flee(context, evt)
if defs.fishing_type == 1 then
--单轮计数重置
ScriptLib.SetGroupTempValue(context,"tempScore", 0, {})
end
end
--end
return 0
end
--每次退出钓鱼QTE状态时触发
--每次退出钓鱼QTE状态时触发
--evt.param1 鱼id
--evt.param2 0-失败 1-成功
--evt.param3 0-未进包(即背包满/到达活动要求的获取上限1-进包
@ -178,7 +178,7 @@ function action_fishing_qte_finish(context, evt)
--若成功钓起
if evt.param2 == 1 then
--如果是目标鱼,加分
if CheckIsInTable(context,target_fish,defs.target_fish_id) then
if CheckIsInTable(context,target_fish,defs.target_fish_id) then
--单局计数+1
ScriptLib.ChangeGroupTempValue(context, "tempScore", 1, {})
@ -187,7 +187,7 @@ function action_fishing_qte_finish(context, evt)
fishing_score = {score}
--触发挑战计数Trigger
ScriptLib.SetGroupVariableValue(context, "challenge_score", score)
--如果不是目标鱼不加分但还是要UpdateGallery非目标鱼也要算上
else
score = ScriptLib.GetGroupTempValue(context, "tempScore", {})
@ -195,7 +195,7 @@ function action_fishing_qte_finish(context, evt)
end
--处理是否放生
local is_free = false
if evt.param3 ~= 1 then
if evt.param3 ~= 1 then
is_free = true
end
--更新Gallery分数
@ -214,7 +214,7 @@ function action_fishing_qte_finish(context, evt)
local tempUnmissScore = ScriptLib.GetGroupTempValue(context, "tempUnmissScore", {})
local tempScore = ScriptLib.GetGroupTempValue(context, "tempScore", {})
--检查是不是该刷新最大连续记录
--检查是不是该刷新最大连续记录
if tempUnmissScore < tempScore then
--若是,则连续挑战计分更新
ScriptLib.SetGroupTempValue(context,"tempUnmissScore", tempScore, {})
@ -228,7 +228,7 @@ function action_fishing_qte_finish(context, evt)
local score = ScriptLib.GetGroupTempValue(context, "tempUnmissScore", {})
fishing_score = {score}
local is_free = false
if evt.param3 ~= 1 then
if evt.param3 ~= 1 then
is_free = true
end
ScriptLib.UpdatePlayerGalleryScore(context, defs.gallery_id, {["fishing_score"] = fishing_score, ["fish_id"] = evt.param1, ["is_free"] =is_free})
@ -246,18 +246,18 @@ end
function action_leave_region(context, evt)
if ScriptLib.GetGroupTempValue(context, "fishing_state", {}) == 1 then
--设置挑战状态标记
ScriptLib.SetGroupTempValue(context, "fishing_state", 0, {})
--停挑战
if ScriptLib.GetGroupTempValue(context, "challenge_state", {}) == 1 then
if ScriptLib.GetGroupTempValue(context, "challenge_state", {}) == 1 then
ScriptLib.StopChallenge(context, defs.challenge_id, 1)
end
--停Gallery false失败 true成功
if ScriptLib.GetGroupTempValue(context, "gallery_state", {}) == 1 then
if ScriptLib.GetGroupTempValue(context, "gallery_state", {}) == 1 then
ScriptLib.StopGallery(context, defs.gallery_id, false)
end

View File

@ -4,7 +4,7 @@
--挑战倒计时结束关Gallery停止钓鱼
--另外处理Gallery意外先结束同步退出钓鱼-停挑战
-- defs = {
-- local defs = {
-- --GroupID
-- group_id = 100000000,
@ -99,7 +99,7 @@ function action_fishing_start(context, evt)
--添加子挑战-bonus cfg.child_bonus
ScriptLib.AttachChildChallenge(context,cfg.father_id,cfg.child_bonus,cfg.child_bonus, {3,1002,99}, {context.uid},{success=1, fail=1})
ScriptLib.SetGroupTempValue(context,"challenge_state", 1, {})
end
return 0
@ -115,11 +115,11 @@ function action_gallery_stop(context, evt)
end
if ScriptLib.GetGroupTempValue(context, "fishing_state", {}) == 1 then
--设置挑战状态标记
ScriptLib.SetGroupTempValue(context, "fishing_state", 0, {})
if ScriptLib.GetGroupTempValue(context, "challenge_state", {}) == 1 then
if ScriptLib.GetGroupTempValue(context, "challenge_state", {}) == 1 then
--停挑战
ScriptLib.EndFatherChallenge(context, cfg.father_id)
end
@ -136,12 +136,12 @@ end
function action_challenge_fail(context, evt)
ScriptLib.SetGroupTempValue(context, "challenge_state", 0, {})
if ScriptLib.GetGroupTempValue(context, "fishing_state", {}) == 1 then
--设置挑战状态标记
ScriptLib.SetGroupTempValue(context, "fishing_state", 0, {})
--停止Gallery false失败 true成功。这里需要填false
if ScriptLib.GetGroupTempValue(context, "gallery_state", {}) == 1 then
if ScriptLib.GetGroupTempValue(context, "gallery_state", {}) == 1 then
ScriptLib.StopGallery(context, defs.gallery_id, false)
ScriptLib.PrintContextLog(context, "[fishing] Gallery stopped by challenge end.")
end
@ -158,12 +158,12 @@ end
function action_challenge_success(context, evt)
ScriptLib.SetGroupTempValue(context, "challenge_state", 0, {})
if ScriptLib.GetGroupTempValue(context, "fishing_state", {}) == 1 then
--设置挑战状态标记
ScriptLib.SetGroupTempValue(context, "fishing_state", 0, {})
--停止Gallery false失败 true成功
if ScriptLib.GetGroupTempValue(context, "gallery_state", {}) == 1 then
if ScriptLib.GetGroupTempValue(context, "gallery_state", {}) == 1 then
ScriptLib.StopGallery(context, defs.gallery_id, false)
end
@ -184,7 +184,7 @@ function action_fishing_timeout_flee(context, evt)
--end
return 0
end
--每次退出钓鱼QTE状态时触发
--每次退出钓鱼QTE状态时触发
--evt.param1 鱼id
--evt.param2 0-失败 1-成功
--evt.param3 0-未进包(即背包满/到达活动要求的获取上限1-进包
@ -208,31 +208,31 @@ function action_fishing_qte_finish(context, evt)
---------处理总数
--单局计数+1
ScriptLib.ChangeGroupTempValue(context, "totalCount", 1, {})
ScriptLib.ChangeGroupTempValue(context, "tempScore", 1, {})
ScriptLib.ChangeGroupTempValue(context, "tempScore", 1, {})
tempScore = ScriptLib.GetGroupTempValue(context, "tempScore", {})
--触发总数挑战的计数Trigger
ScriptLib.SetGroupVariableValue(context, "score_total", tempScore)
--------处理连续成功
--检查是不是该刷新最大连续记录
--检查是不是该刷新最大连续记录
if tempUnmissScore < tempScore then
--若是,则连续挑战计分更新
ScriptLib.SetGroupTempValue(context,"tempUnmissScore", tempScore, {})
--触发连续成功挑战计数Trigger
ScriptLib.SetGroupVariableValue(context, "score_unmiss", tempScore)
end
--------处理Bonus时间
--检查是不是该刷新最大bonus时间记录,evt里发过来是整数还是取一下floor保险
ScriptLib.PrintContextLog(context, "This BonusTime@"..evt.param4)
local diff = 0
--不大于180秒正常算差
if evt.param4 <= 180 then
if evt.param4 <= 180 then
diff = math.floor(evt.param4 - ScriptLib.GetGroupTempValue(context, "bonusTime", {}))
--大于180秒按180秒算差
else
@ -240,11 +240,11 @@ function action_fishing_qte_finish(context, evt)
end
--差值是几就触发几次Trigger
if diff > 0 then
ScriptLib.SetGroupTempValue(context,"bonusTime", evt.param4, {})
ScriptLib.SetGroupTempValue(context,"bonusTime", evt.param4, {})
UpdateBonusTimeForChallenge(context,diff)
end
--如果不是目标鱼也要更新Gallery
else
else
--单轮计数重置
ScriptLib.SetGroupTempValue(context,"tempScore", 0, {})
@ -258,7 +258,7 @@ function action_fishing_qte_finish(context, evt)
local fishing_score = {totalCount, tempUnmissScore, bonusTime}
local is_free = false
if evt.param3 ~= 1 then
if evt.param3 ~= 1 then
is_free = true
end
ScriptLib.UpdatePlayerGalleryScore(context, defs.gallery_id, {["fishing_score"] = fishing_score, ["fish_id"] = evt.param1, ["is_free"] = is_free})
@ -284,18 +284,18 @@ end
function action_leave_region(context, evt)
if ScriptLib.GetGroupTempValue(context, "fishing_state", {}) == 1 then
--设置挑战状态标记
ScriptLib.SetGroupTempValue(context, "fishing_state", 0, {})
--停挑战
if ScriptLib.GetGroupTempValue(context, "challenge_state", {}) == 1 then
if ScriptLib.GetGroupTempValue(context, "challenge_state", {}) == 1 then
--停挑战
ScriptLib.EndFatherChallenge(context, cfg.father_id)
end
--停Gallery false失败 true成功
if ScriptLib.GetGroupTempValue(context, "gallery_state", {}) == 1 then
if ScriptLib.GetGroupTempValue(context, "gallery_state", {}) == 1 then
ScriptLib.StopGallery(context, defs.gallery_id, false)
end

View File

@ -1,6 +1,6 @@
-- Trigger变量
--[[
defs = {
local defs = {
PotConfigIDA =148004,
PotConfigIDB =148005,
PotConfigIDC =148006,

View File

@ -1,6 +1,6 @@
-- Trigger变量
--[[
defs = {
local defs = {
ButtonLeftConfig = 51001,
ButtonRightConfig = 51002,
StoveConfig = 51003,

View File

@ -1,5 +1,5 @@
--[[
defs = {
local defs = {
-- 进入指定Region获得对应AbilityGroup
-- AG:AbilityGroup
GroupID = 133003041,
@ -222,3 +222,4 @@ end
LF_Initialize_Level()
--- ServerUploadTool Save to [/root/env/data/lua/common/V2_1] ---

View File

@ -1,7 +1,7 @@
--- def参数
--- 描述长宽
--[[
defs = {
local defs = {
-- 该参数 填入ConfigID 用来确认临接关系
InitFloorArrays = {
{6001,6004,6007,6010},

View File

@ -1,7 +1,7 @@
--- def参数
--- 描述长宽
--[[
defs = {
local defs = {
-- 该参数用来确认合法对子地板
FloorGadgetID = {70310062,70310063,70310064,70310065,70310087,70310088},
FloorNum = 8,

View File

@ -1,6 +1,6 @@
--ServerUploadTool Save to [/root/env/data/lua/common/V2_2]
--[[
defs = {
local defs = {
region_Enter = 191004,
region_Leave = 191006
Boss = 222,
@ -71,7 +71,7 @@ function action_CreateBoss(context,evt)
ScriptLib.SetGadgetStateByConfigId(context, Pursina[1][1], GadgetState.Default)
ScriptLib.SetGadgetStateByConfigId(context, Pursina[2][1], GadgetState.Default)
ScriptLib.SetGadgetStateByConfigId(context, Pursina[3][1], GadgetState.Default)
if evt.param1 == 1 then
if evt.param1 == 1 then
for k,v in pairs(gadgets) do
if v.gadget_id == 70800055 then
ScriptLib.CreateGadget(context,{config_id = v.config_id})
@ -110,14 +110,14 @@ function enterRegion(context,evt)
ScriptLib.ForbidPlayerRegionVision(context, context.uid)
ScriptLib.SetPlayerGroupVisionType(context, {context.uid}, {0})
end
return 0
return 0
end
function action_Active_Count(context,evt) --纯reminder 用 无逻辑
if defs.Boss ~= nil then
if defs.Boss ~= nil then
if evt.param1 == 2 and evt.param1 > evt.param2 then ScriptLib.ShowReminder(context,600081) end
if evt.param1 == 3 and evt.param1 > evt.param2 then ScriptLib.ShowReminder(context,600080) end
end
return 0
return 0
end
function action_Boss_SetBattle(context,evt)
local groupID = ScriptLib.GetContextGroupId(context)
@ -175,7 +175,7 @@ function leaveRegion(context,evt)
ScriptLib.RevertPlayerRegionVision(context, context.uid)
ScriptLib.SetPlayerGroupVisionType(context, {context.uid}, {1})
if ScriptLib.GetGroupVariableValue(context,"IsFinished") == 0 then --该then内为 未完成玩法时离开region时执行的操作
log_ActivityDig_2(context,4)
log_ActivityDig_2(context,4)
fail(context)
end
end
@ -261,7 +261,7 @@ function Finteract(context, evt)
ScriptLib.SetGroupTempValue(context,"Progress_To_Add_1",0,{}) --挖掘进度中转变量
ScriptLib.SetGroupTempValue(context,"Progress_To_Add_2",0,{}) --挖掘进度中转变量
ScriptLib.SetGroupTempValue(context,"Progress_To_Add_3",0,{}) --挖掘进度中转变量
-- 卸载操作台
if defs.Boss == nil then ScriptLib.SetGadgetStateByConfigId(context, evt.param1, GadgetState.GearStart) end
ScriptLib.DelWorktopOptionByGroupId(context, groupID, evt.param1, 175)
@ -277,7 +277,7 @@ function Finteract(context, evt)
ScriptLib.InitTimeAxis(context, "tick", {1}, true)
--5秒后显示reminder
ScriptLib.InitTimeAxis(context, "reminder", {6}, false)
end
end
return 0
end
function tick(context,evt)--每tick计算进度 "Progress_To_Add_"..i
@ -286,13 +286,13 @@ function tick(context,evt)--每tick计算进度 "Progress_To_Add_"..i
FinishPursina[i] = ScriptLib.GetGroupTempValue(context,"FinishPursina_"..i,{})
if FinishPursina[i] ~= 1 then
local Progress_wait_for_Add = ScriptLib.GetGroupTempValue(context, "Progress_To_Add_"..i,{}) --取当前待增加进度
if Progress_wait_for_Add >= 10 then
if Progress_wait_for_Add >= 10 then
local real_add = math.floor(Progress_wait_for_Add/10)
ScriptLib.AddGalleryProgressScore(context, "digProgress"..i-1, GALLERY_ID, real_add)
ScriptLib.SetGroupTempValue(context,"Progress_To_Add_"..i,Progress_wait_for_Add - real_add*10,{})
local nowProgress = ScriptLib.GetGalleryProgressScore(context,"digProgress".. i-1,GALLERY_ID)
if nowProgress >= 100 then
local nowProgress = ScriptLib.GetGalleryProgressScore(context,"digProgress".. i-1,GALLERY_ID)
if nowProgress >= 100 then
local groupID = ScriptLib.GetContextGroupId(context)
ScriptLib.SetGadgetStateByConfigId(context,Pursina[i][1], GadgetState.GearAction1)
ScriptLib.RemoveEntityByConfigId(context, groupID, EntityType.GADGET, Pursina[i][2])
@ -348,11 +348,11 @@ function finishPlay(context)
--2.2挖矿活动__完成且击倒boss不少于n次
local temp_result = ScriptLib.GetGroupTempValue(context,"watcher5",{})
ScriptLib.PrintContextLog(context, "[通关计数]击倒boss".. temp_result.. "")
if temp_result >= Watcher_Condition[5] then
if temp_result >= Watcher_Condition[5] then
ScriptLib.AddExhibitionAccumulableData(context, uid[1], "Activity_PursinaChallenge_watcher_5", 1)
end
--2.2挖矿活动__完成且未击倒boss
if temp_result == 0 then
if temp_result == 0 then
ScriptLib.AddExhibitionAccumulableData(context, uid[1], "Activity_PursinaChallenge_watcher_4", 1)
end
--完成后等待一段时间refreshgroup
@ -361,7 +361,7 @@ function finishPlay(context)
ScriptLib.AddExhibitionAccumulableData(context, uid[1], "Activity_Pursina_Group_".. groupID,1)
ScriptLib.FinishGroupLinkBundle(context, groupID)
end
log_ActivityDig_2(context,0)
return 0
end
@ -371,7 +371,7 @@ function gallerytimeout(context,evt)
ScriptLib.PrintContextLog(context, "【[gallerytimeout]】evt.param2="..evt.param2)
ScriptLib.PrintContextLog(context, "【[gallerytimeout]】GALLERY_ID="..GALLERY_ID)
if evt.param1 == GALLERY_ID and evt.param2 == 0 then
if evt.param3 == 1 then
if evt.param3 == 1 then
ScriptLib.PrintContextLog(context, "【[gallerytimeout]】evt.param3="..evt.param3)
--埋点
log_ActivityDig_2(context,2)
@ -433,13 +433,13 @@ function LowPower(context)
ScriptLib.PrintContextLog(context, "【[LowPower]】")
local configID = ScriptLib.GetGadgetConfigId(context, {gadget_eid = context.source_entity_id})
ScriptLib.MarkGroupLuaAction(context, "ActivityDig_3",ScriptLib.GetGalleryTransaction(context, GALLERY_ID), {["Pursina_ID"] = configID,["change_type"]=4})
return 0
return 0
end
function MediumPower(context)
ScriptLib.PrintContextLog(context, "【[MediumPower]】")
local configID = ScriptLib.GetGadgetConfigId(context, {gadget_eid = context.source_entity_id})
ScriptLib.MarkGroupLuaAction(context, "ActivityDig_3",ScriptLib.GetGalleryTransaction(context, GALLERY_ID) , {["Pursina_ID"] = configID,["change_type"]=3})
return 0
return 0
end
function HighPower(context)
ScriptLib.PrintContextLog(context, "【[HighPower]】")
@ -454,8 +454,8 @@ function SLC_ShowUI(context)
local configID = ScriptLib.GetGadgetConfigId(context, {gadget_eid = context.source_entity_id})
for i = 1, #Pursina do
if Pursina[i][2] == configID then ScriptLib.CreateGadget(context, {config_id = 888880 + i}) end
end
return 0
end
return 0
end
function SLC_HideUI(context)
ScriptLib.PrintContextLog(context, "【[SLC_HideUI]】")
@ -463,8 +463,8 @@ function SLC_HideUI(context)
local groupID = ScriptLib.GetContextGroupId(context)
for i = 1, #Pursina do
if Pursina[i][2] == configID then ScriptLib.RemoveEntityByConfigId(context, groupID, EntityType.GADGET, 888880+i) end
end
return 0
end
return 0
end
function ServerLuaCall_Pursina_Start(context)--桩子物件用,用于当前激活桩子的计数,顺便埋个点
ScriptLib.ChangeGroupVariableValue(context, "Active_Count", 1)
@ -540,20 +540,21 @@ function Initialize()
if v.gadget_id == 70800047 then
table.insert(gadgets , {config_id = 888881 , gadget_id = 70800050, pos = v.pos, rot = v.rot, level = v.level, area_id = v.area_id })
break
end
end
end
for k,v in pairs(gadgets) do
if v.gadget_id == 70800048 then
table.insert(gadgets , {config_id = 888882 , gadget_id = 70800051, pos = v.pos, rot = v.rot, level = v.level, area_id = v.area_id })
break
end
end
end
for k,v in pairs(gadgets) do
if v.gadget_id == 70800049 then
table.insert(gadgets , {config_id = 888883 , gadget_id = 70800052, pos = v.pos, rot = v.rot, level = v.level, area_id = v.area_id })
break
end
end
end
return 0
end
Initialize()

View File

@ -6,7 +6,7 @@
--怪物脱战时会在一系列表演之后发一个SLC_BossBattleResetgroup重置
]]
--[[
defs = {
local defs = {
--开启怪物用的特效gadget
gadget_starter = 275001,
@ -58,7 +58,7 @@ function LF_Initialize_Group(triggers, suites)
end
function condition_Boss_Die(context, evt)
if evt.param1 ~= defs.monster_configID then
if evt.param1 ~= defs.monster_configID then
return false
end
return true
@ -91,16 +91,16 @@ function action_Leave_BattleRegion(context, evt)
ScriptLib.PrintContextLog(context, "[Boss_Hound] Player leave region. uid@"..context.uid)
if ScriptLib.GetGroupVariableValue(context, "challenge_state") == 1 then
--local count = ScriptLib.GetRegionEntityCount(context, { region_eid = eid, entity_type = EntityType.AVATAR })
--尝试转移config_id的authority, 当uid和config_id的authority不一致时尝试转移到region_config_id里的玩家。
local new_auth = ScriptLib.TryReallocateEntityAuthority(context, context.uid, defs.monster_configID, evt.param1)
--[[if count <= 0 then
--[[if count <= 0 then
ScriptLib.PrintContextLog(context, "[Boss_Hound] No Player in Region. Reset Battle.")
LF_ResetBattle(context)
end]]
end
return 0
end
@ -116,7 +116,7 @@ end
--[[function action_Enter_StartRegion(context, evt)
if ScriptLib.GetGroupVariableValue(context, "challenge_state") ~= 0 or
if ScriptLib.GetGroupVariableValue(context, "challenge_state") ~= 0 or
evt.param1 ~= defs.start_region then
return 0
end
@ -127,7 +127,7 @@ end]]
--触发战斗
function action_Boss_In_Battle(context, evt)
if evt.param1 ~= defs.monster_configID then
if evt.param1 ~= defs.monster_configID then
return 0
end
@ -165,7 +165,7 @@ function LF_Get_BattleField_AlivePlayer(context)
local uid_list = ScriptLib.GetSceneUidList(context)
for i,v in ipairs(uid_list) do
if LF_Get_Distance(context, v, defs.battle_regionID) < defs.battle_radius then
if LF_Get_Distance(context, v, defs.battle_regionID) < defs.battle_radius then
if ScriptLib.IsPlayerAllAvatarDie(context, v) == false then
ScriptLib.PrintContextLog(context, "[Boss_Hound] Get_BattleField_AlivePlayer. UID@"..v)
return v
@ -193,14 +193,14 @@ function SLC_BossBattleReset(context)
ScriptLib.PrintContextLog(context, "[Boss_Hound] #WARN# Got SLC_BossBattleReset, while challenge_state is 0 (Not in Battle). Tell TD.")
return 0
end]]
--planA: 接到直接重置
LF_ResetBattle(context)
--planB: 尝试找场内玩家转移auth。 找不到就ResetBattle
--[[local target_uid = LF_Get_BattleField_AlivePlayer(context)
if target_uid ~= 0 then
if target_uid ~= 0 then
ScriptLib.PrintContextLog(context, "[Boss_Hound] Got SLC_BossBattleReset, then found alive player@"..target_uid.." in field, trying Refresh Authority.")
@ -215,4 +215,4 @@ function SLC_BossBattleReset(context)
return 0
end
LF_Initialize_Group(triggers, suites)
LF_Initialize_Group(triggers, suites)

View File

@ -4,7 +4,7 @@
--[[
defs = {
local defs = {
}
]]
@ -55,3 +55,4 @@ function action_Refresh_SGV(context,evt)
end
LF_Initialize_Group(triggers, suites)

View File

@ -10,7 +10,7 @@
--[[
defs = {
local defs = {
buff_gadget = ,
}
@ -42,9 +42,9 @@ end
function action_EVENT_SELECT_OPTION(context,evt)
if 1001 ~= evt.param1 then
return 0
return 0
end
if 175 ~= evt.param2 then
return 0
end
@ -59,7 +59,7 @@ end
--param1变化值
function SLC_Change_EnhanceLevel(context, param1)
ScriptLib.PrintContextLog(context, "[EnergyDisk] Get SLC_Change_EnhanceLevel. param1@"..param1.." from@"..context.source_entity_id)
if defs.buff_gadget == nil then
if defs.buff_gadget == nil then
return 0
end
--先将中央物件置为可触发
@ -67,7 +67,7 @@ function SLC_Change_EnhanceLevel(context, param1)
local cur_level = ScriptLib.GetGroupVariableValue(context,"buff_level")
local tmp = cur_level + param1
if tmp < 0 or tmp > 4 then
if tmp < 0 or tmp > 4 then
ScriptLib.PrintContextLog(context, "[EnergyDisk] #WARN# Get SLC at cur_level@"..cur_level.." change value@"..param1)
return 0
else
@ -77,19 +77,19 @@ function SLC_Change_EnhanceLevel(context, param1)
--通知刷一次buff (怪物侧会监听,此处不用)
--LF_Trigger_BuffGadget(context)
end
return 0
end
--[[
function action_Monster_Tide_Create(context, evt)
ScriptLib.PrintContextLog(context, "[EnergyDisk] Monster_Tide_Create. Index@"..evt.source_eid)
if defs.buff_gadget == nil then
if defs.buff_gadget == nil then
return 0
end
--if evt.source_eid == 2 then
--如果招出来是怪,则触发一次中央物件
LF_Trigger_BuffGadget(context)
--elseif evt.source_eid == 1 then
--elseif evt.source_eid == 1 then
--如果招出来是漂浮灵,则将中央物件置为可触发
--LF_DisTrigger_BuffGadget(context)
--end
@ -97,14 +97,14 @@ function action_Monster_Tide_Create(context, evt)
end
function action_Monster_Tide_Die(context, evt)
if defs.buff_gadget == nil then
if defs.buff_gadget == nil then
return 0
end
if evt.source_eid == 2 then
--如果是怪,则触发一次中央物件
LF_Trigger_BuffGadget(context)
end
return 0
end
]]
@ -127,3 +127,4 @@ end
end]]
LF_Initialize_Group(triggers, suites)

View File

@ -4,7 +4,7 @@
--[[
defs = {
local defs = {
group_id = ,
@ -74,7 +74,7 @@ function action_ANY_MONSTER_DIE(context, evt)
end
ScriptLib.ChangeGroupVariableValue(context, "kill_count", 1)
--检查杀够数量了没
if defs.Monster_Count ~= nil then
if defs.Monster_Count ~= nil then
local kill_count = ScriptLib.GetGroupVariableValue(context, "kill_count")
if kill_count >= defs.Monster_Count then
LF_EnableCageInteract(context)
@ -83,7 +83,7 @@ function action_ANY_MONSTER_DIE(context, evt)
return 0
end
function LF_DisableCageInteract(context)
for k, v in pairs(defs.target_id) do
for k, v in pairs(defs.target_id) do
--客户端交互
ScriptLib.SetGadgetStateByConfigId(context, k, 903)
--服务器交互
@ -93,7 +93,7 @@ function LF_DisableCageInteract(context)
end
function LF_EnableCageInteract(context)
for k, v in pairs(defs.target_id) do
for k, v in pairs(defs.target_id) do
--服务器交互
ScriptLib.SetGadgetEnableInteract(context, defs.group_id, k, true)
--客户端交互
@ -117,7 +117,7 @@ function action_quest_notify(context,evt)
return -1
end
--检查挑战状态
if ScriptLib.GetGroupVariableValue(context, "challenge_state") ~= 0 then
if ScriptLib.GetGroupVariableValue(context, "challenge_state") ~= 0 then
return -1
else
--处理开始挑战
@ -137,10 +137,10 @@ function action_quest_notify(context,evt)
end
function action_gadgetstate_change(context, evt)
if evt.param1 ~= 201 then
if evt.param1 ~= 201 then
return 0
end
--GadgetLua上已经有这个判断了 做双保险
if ScriptLib.CheckIsInMpMode(context) == true then
ScriptLib.PrintContextLog(context, "[HachiBattle] Is in MP mode, refuse state cahnge.")
@ -150,7 +150,7 @@ function action_gadgetstate_change(context, evt)
return 0
end
local result = CheckTableAndReturnValue(context, evt.param2, defs.target_id)
local result = CheckTableAndReturnValue(context, evt.param2, defs.target_id)
if result ~= 0 then
@ -216,7 +216,7 @@ function action_enter_region(context,evt)
return 0
end
--检查挑战状态
if ScriptLib.GetGroupVariableValue(context, "challenge_state") ~= 0 then
if ScriptLib.GetGroupVariableValue(context, "challenge_state") ~= 0 then
return 0
else
--处理开始挑战
@ -228,7 +228,7 @@ function action_enter_region(context,evt)
ScriptLib.SetGroupTempValue(context, "player_uid", context.uid, {} )
local start_process = ScriptLib.GetGroupVariableValue(context,"saved_progress")
local start_process = ScriptLib.GetGroupVariableValue(context,"saved_progress")
ScriptLib.PrintContextLog(context, "[HachiBattle] Start Challenge. ChallengeID@ "..defs.challenge_id.." TargetCages@".. defs.taget_score.." CurrentCages@"..start_process)
--参数1 event_type所在枚举序号 参数2 trigger_tag参数3 次数参数4Bool次数达成是否计为成功参数5初始次数值
ScriptLib.StartChallenge(context, defs.ChallengeIndex, defs.challenge_id, {3, 1000, defs.taget_score, 1, start_process})
@ -236,7 +236,7 @@ function action_enter_region(context,evt)
--重新进圈开挑战时,再检查一次杀怪数量
local kill_count = ScriptLib.GetGroupVariableValue(context, "kill_count")
if kill_count >= defs.Monster_Count then
for k, v in pairs(defs.target_id) do
for k, v in pairs(defs.target_id) do
--客户端可交互的笼子
if 0 == ScriptLib.GetGadgetStateByConfigId(context, defs.group_id, k) then
--设置服务器可交互
@ -271,13 +271,13 @@ function CheckTableAndReturnValue(context,key,table)
end
function action_Will_Unload(context, evt)
if ScriptLib.GetGroupVariableValue(context, "challenge_state") == 1 then
if ScriptLib.GetGroupVariableValue(context, "challenge_state") == 1 then
ScriptLib.SetGroupVariableValue(context, "challenge_state", 0)
end
end
return 0
end
function action_Challenge_Fail(context, evt)
if ScriptLib.GetGroupVariableValue(context, "challenge_state") == 1 then
if ScriptLib.GetGroupVariableValue(context, "challenge_state") == 1 then
ScriptLib.SetGroupVariableValue(context, "challenge_state", 0)
end
return 0
@ -290,11 +290,11 @@ function action_Group_Load(context,evt)
end
local kill_count = ScriptLib.GetGroupVariableValue(context, "kill_count")
ScriptLib.PrintContextLog(context, "[HachiBattle] Group load. kill_count@"..kill_count.." first wave monster@"..#suites[3].monsters)
if #suites[3].monsters == kill_count then
if #suites[3].monsters == kill_count then
ScriptLib.PrintContextLog(context, "[HachiBattle] Try re-add suite 4.")
ScriptLib.AddExtraGroupSuite(context, defs.group_id, 4)
end
return 0
end
LF_Initialize_Group(triggers, suites)
LF_Initialize_Group(triggers, suites)

View File

@ -4,7 +4,7 @@
--[[
defs = {
local defs = {
group_id = 246101001,
--Boss目标点
target_points = {1004,1005,1006,1007,1008,1009,1010,1011,1012}
@ -38,11 +38,11 @@ function SLC_ActiveRandomPoint(context)
local list = {table.unpack(defs.target_points)}
ScriptLib.PrintContextLog(context, "[HachiDungeon] Get Random Result: ListCount@"..#list.." Last Index@"..last_index)
--如果不是第一次随机
if last_index ~= 0 then
if last_index ~= 0 then
table.remove(list, last_index)
ScriptLib.PrintContextLog(context, "[HachiDungeon] Remove from Pool @"..list[rand_index])
end
math.randomseed(ScriptLib.GetServerTime(context))
rand_index = math.random(#list)
@ -56,7 +56,7 @@ function SLC_ActiveRandomPoint(context)
--CD时间轴 时间到了将刚才的物件切回0
ScriptLib.SetGroupTempValue(context, "deny_call", 1, {})
ScriptLib.InitTimeAxis(context, "cool_down", {10}, false)
return 0
end
@ -81,7 +81,7 @@ function SLC_HachiDungeonBuff_Mark(context)
ScriptLib.ChangeGroupTempValue(context, "buff_num", 1, {})
return 0
end
--上报运营日志数据 需求单s1286672
--上报运营日志数据 需求单s1286672
function UpLoadActionLog(context)
local log = {
@ -98,10 +98,10 @@ end
function LF_GetKeyByValue(context, value, table)
for k,v in pairs(table) do
if value == v then
if value == v then
return k
end
end
return 0
end
LF_Initialize_Group(triggers, suites)
LF_Initialize_Group(triggers, suites)

View File

@ -5,7 +5,7 @@
--[[
defs = {
local defs = {
group_id = ,
@ -13,12 +13,12 @@ defs = {
start_region_id = ,
--开始挑战后哪些suit要Add
challenge_suits =
challenge_suits =
{ 2 },
--挑战index
ChallengeIndex = 1001,
--开始小光柱
starting_point_id = 590040,
@ -95,8 +95,8 @@ function action_challenge_pause(context, evt)
end
--处理小动物意外死亡 约定小动物都在Suit 5
function action_any_monster_die(context, evt)
if CheckIsInTable(context, evt.param1, suites[5].monsters) then
if CheckIsInTable(context, evt.param1, suites[5].monsters) then
local exist_int = ScriptLib.GetGroupVariableValue(context, "animal")
local exist_table = LF_Split_Int(context, exist_int)
ScriptLib.PrintContextLog(context, "[HachiSneak] Try Set Animal. exist_int@"..exist_int)
@ -105,7 +105,7 @@ function action_any_monster_die(context, evt)
local ret = ScriptLib.CreateMonster(context, { config_id = evt.param1, delay_time = 2 })
ScriptLib.PrintContextLog(context, "[HachiSneak] Reset animal@"..evt.param1.." ret@"..ret)
end
end
end
return 0
end
@ -168,12 +168,12 @@ end
--关卡接到后检查任务状态如果标志任务4003103没完成则退出挑战状态
function SLC_PlayerDie_DuringQuest(context)
if ScriptLib.GetGroupVariableValue(context,"challenge_state") ~= 1 then
if ScriptLib.GetGroupVariableValue(context,"challenge_state") ~= 1 then
return 0
end
local quest_state = ScriptLib.GetQuestState(context, context.source_entity_id, 4003103)
if 3 ~= quest_state then
if 3 ~= quest_state then
--允许再次接受任务通知
ScriptLib.SetGroupVariableValue(context, "quest_done", 0)
--恢复玩家SGV
@ -263,9 +263,9 @@ function action_challenge_fail(context,evt)
--移除开挑战时添加的suit
end
for k,v in pairs(defs.challenge_suits) do
ScriptLib.RemoveExtraGroupSuite(context, defs.group_id, v)
end
return 0
@ -284,14 +284,14 @@ function SetHachiWayPointGV(context)
ScriptLib.SetGroupVariableValue(context, "waypoint_set", 1)
for k,v in pairs(defs.waypoint) do
for k,v in pairs(defs.waypoint) do
ScriptLib.AddEntityGlobalFloatValueByConfigId(context, {k}, "_INU_SHIHANDAI_SEARCH_START" ,v[1])
ScriptLib.AddEntityGlobalFloatValueByConfigId(context, {k}, "_INU_SHIHANDAI_SEARCH_END" ,v[2])
local tmp = ScriptLib.GetEntityIdByConfigId(context, k)
ScriptLib.PrintContextLog(context, "[HachiSneak] Add GV: DogConfigID@"..k.." EntityID@"..tmp.." SEARCH_START@"..v[1].." SEARCH_END@"..v[2])
end
end
return 0
end
@ -415,7 +415,7 @@ function action_enter_region(context,evt)
return -1
end
--检查挑战状态
if ScriptLib.GetGroupVariableValue(context, "challenge_state") ~= 0 then
if ScriptLib.GetGroupVariableValue(context, "challenge_state") ~= 0 then
return -1
else
--处理开始挑战
@ -458,11 +458,11 @@ function MonsterCallCaught(context)
ScriptLib.PrintContextLog(context, "[HachiSneak] #WARN# Challenge Not Open but Got Animal LuaCall!!")
return -1
end
local player_uid = ScriptLib.GetGroupTempValue(context, "player_uid", {})
ScriptLib.ChangeGroupTempValue(context, "capture_times", 1, {})
ScriptLib.ChangeGroupVariableValue(context,"saved_progress",1)
ScriptLib.AddExhibitionAccumulableData(context, player_uid, "Activity_Hachi_Group_"..defs.group_id, 1)
ScriptLib.PrintContextLog(context, "[HachiSneak] Exhibition Update. UID@"..player_uid.." key@".."Activity_Hachi_Group_"..defs.group_id)
--
@ -470,7 +470,7 @@ function MonsterCallCaught(context)
LF_MarkAnimal(context,animal)
ScriptLib.RemoveEntityByConfigId(context, defs.group_id, EntityType.MONSTER, animal)
--ScriptLib.KillEntityByConfigId(context, { config_id = animal })
return 0
end
@ -531,7 +531,7 @@ function SLC_SmokeSetThreat(context)
return 0
end
--上报运营日志数据
--上报运营日志数据
function UpLoadActionLog(context,transaction)
local log = {
@ -583,4 +583,4 @@ function GetIndexInTable(context, value, check_table)
return 0
end
Initialize_Group(triggers, suites)
Initialize_Group(triggers, suites)

View File

@ -13,7 +13,7 @@
903
]]
--[[
defs = {
local defs = {
--galleryID
gallery_id = ,
@ -106,7 +106,7 @@ function StartSubChallengeKillMonster(context, prev_context, child_index, challe
local father_state = ScriptLib.GetGroupVariableValue(context, "father_state")
if father_state ~= 0 and father_state ~= 1 then
--添加子挑战
--添加子挑战
--挑战类型为:击杀指定数量怪物 参数1 指定groupid 参数2指定group内怪物死亡的数量
local target_count = ScriptLib.GetGroupTempValue(context, "target_count",{})
@ -116,7 +116,7 @@ function StartSubChallengeKillMonster(context, prev_context, child_index, challe
ScriptLib.AttachChildChallenge(context, cfg.father_index, child_index, challenge_id, {3, 666, target_count, 1}, {},{success=1, fail=1})
else
ScriptLib.PrintContextLog(context, "[MistTrialV2] #WRONG# Trying to start a subchallenge while father is not actived!! ")
ScriptLib.PrintContextLog(context, "[MistTrialV2] #WRONG# Trying to start a subchallenge while father is not actived!! ")
end
return 0
end
@ -140,7 +140,7 @@ function AddMistTrialChildChallengeScore(context, prev_context, score)
ScriptLib.SetGroupVariableValue(context, "catchKey", 0)
else
ScriptLib.SetGroupVariableValue(context, "catchKey", 1)
end
end
return 0
end
@ -154,20 +154,20 @@ end
--当钥匙房被完成时,调这个方法-----
--参数为 {1}
function AddMistTrialKeyProgress(context, prev_context, param)
ScriptLib.PrintContextLog(context, "[MistTrialV2] Get Key Progress. add@"..param)
ScriptLib.PrintContextLog(context, "[MistTrialV2] Get Key Progress. add@"..param)
local father_state = ScriptLib.GetGroupVariableValue(context, "father_state")
--if father_state == 2 then
ScriptLib.ChangeGroupVariableValue(context, "key_progress", param)
local key_progress = ScriptLib.GetGroupVariableValue(context, "key_progress")
Reminder_Key_Progress(context, key_progress)
--else
--ScriptLib.PrintContextLog(context, "[MistTrialV2] #WRONG# Trying to finish a key room while father challenge is @"..father_state.." (need 2)")
--ScriptLib.PrintContextLog(context, "[MistTrialV2] #WRONG# Trying to finish a key room while father challenge is @"..father_state.." (need 2)")
--end
return 0
end
--由于复活的实现原因不能反复Attach如果一个地城有多个复活房每次交互复活房操作台的时候先调用这个来移除
function RemoveReviveAbility(context, prev_context)
ScriptLib.PrintContextLog(context, "[MistTrialV2] Remove MistTrial Revive Ability.")
ScriptLib.PrintContextLog(context, "[MistTrialV2] Remove MistTrial Revive Ability.")
ScriptLib.DelGalleryAbilityGroup(context, {}, defs.gallery_id, 0)
return 0
end
@ -175,18 +175,18 @@ end
--LD通知Ability变动 。 参数 0-地脉异常升级 1-全队复活
function ModifyMistTrialAbility(context, prev_context, param)
ScriptLib.PrintContextLog(context, "[MistTrialV2] Modify MistTrial Ability. Param@"..param)
ScriptLib.PrintContextLog(context, "[MistTrialV2] Modify MistTrial Ability. Param@"..param)
if param == 0 then
if param == 0 then
--设置地脉异常等级初始1级 升档最多3次 一共4个档
ScriptLib.ChangeGroupTempValue(context, "Buff_Attack", 1, {})
ScriptLib.ChangeGroupVariableValue(context, "floor_level", 1)
local floor_level = ScriptLib.GetGroupVariableValue(context, "floor_level")
if floor_level > 4 or floor_level < 1 then
if floor_level > 4 or floor_level < 1 then
ScriptLib.PrintContextLog(context, "[MistTrialV2] #WRONG# Unexpected floor_level: Got@"..floor_level.." (floor_level is 1 ~ 4 in MistTrialV2)")
ScriptLib.PrintContextLog(context, "[MistTrialV2] #WRONG# Unexpected floor_level: Got@"..floor_level.." (floor_level is 1 ~ 4 in MistTrialV2)")
return 0
else
@ -195,7 +195,7 @@ function ModifyMistTrialAbility(context, prev_context, param)
return 0
elseif param == 1 then
elseif param == 1 then
--复活
ScriptLib.ChangeGroupTempValue(context, "Buff_Heal", 1, {})
@ -204,7 +204,7 @@ function ModifyMistTrialAbility(context, prev_context, param)
return 0
else
ScriptLib.PrintContextLog(context, "[MistTrialV2] #WRONG# Unexpected ModifyMistTrialAbility param: Got@"..param.." (param is 0 or 1 in MistTrialV2)")
ScriptLib.PrintContextLog(context, "[MistTrialV2] #WRONG# Unexpected ModifyMistTrialAbility param: Got@"..param.." (param is 0 or 1 in MistTrialV2)")
end
return 0
@ -214,31 +214,31 @@ end
--用于获知挑战进行到哪个阶段了.三符文完成
function action_Key_Challenge_Success(context, evt)
ScriptLib.PrintContextLog(context, "[MistTrialV2] Get Challenge Success. @"..evt.param1)
ScriptLib.PrintContextLog(context, "[MistTrialV2] Get Challenge Success. @"..evt.param1)
ScriptLib.SetGroupVariableValue(context, "father_state", 3)
return 0
end
--用于获知挑战进行到哪个阶段了.激活操作台完成
function action_Worktop_Challenge_Success(context, evt)
ScriptLib.PrintContextLog(context, "[MistTrialV2] Get Challenge Success. @"..evt.param1)
ScriptLib.PrintContextLog(context, "[MistTrialV2] Get Challenge Success. @"..evt.param1)
ScriptLib.SetGroupVariableValue(context, "father_state", 4)
return 0
end
--用于获知挑战进行到哪个阶段了.最终挑战完成
function action_Final_Challenge_Success(context, evt)
ScriptLib.PrintContextLog(context, "[MistTrialV2] Get Challenge Success. @"..evt.param1)
ScriptLib.PrintContextLog(context, "[MistTrialV2] Get Challenge Success. @"..evt.param1)
ScriptLib.SetGroupVariableValue(context, "father_state", 5)
return 0
end
--初始化标志位
function action_Gallery_Start(context, evt)
ScriptLib.PrintContextLog(context, "[MistTrialV2] Gallery Start Detected!! GalleryId@"..evt.param1)
ScriptLib.PrintContextLog(context, "[MistTrialV2] Gallery Start Detected!! GalleryId@"..evt.param1)
ScriptLib.SetGroupVariableValue(context, "gallery_state", 1)
ScriptLib.SetGroupVariableValue(context, "father_state", 2)
ResetGroupTempVar(context)
--由于复活的实现原因需要手动下下来才行复刻不要再复用这个1.5的远古ability了b1326884
--由于复活的实现原因需要手动下下来才行复刻不要再复用这个1.5的远古ability了b1326884
ScriptLib.DelGalleryAbilityGroup(context, {}, defs.gallery_id, 0)
return 0
end
@ -248,8 +248,8 @@ function action_Sub_Challenge_Success(context, evt)
--特殊三挑战不发,发了也没用
return 0
else
local fromGroup = ScriptLib.GetGroupTempValue(context, "target_group", {})
ScriptLib.PrintContextLog(context, "[MistTrialV2] A Sub Challenge Finished. ChallengeID@"..evt.param1.." ChallengeIndex@"..evt.source_name..". Send GroupVar(succcess = 1) to Group@"..fromGroup)
local fromGroup = ScriptLib.GetGroupTempValue(context, "target_group", {})
ScriptLib.PrintContextLog(context, "[MistTrialV2] A Sub Challenge Finished. ChallengeID@"..evt.param1.." ChallengeIndex@"..evt.source_name..". Send GroupVar(succcess = 1) to Group@"..fromGroup)
ScriptLib.SetGroupVariableValueByGroup(context, "success", 1, fromGroup)
end
@ -258,13 +258,13 @@ end
--钥匙房进度
function Reminder_Key_Progress(context, progress)
if progress == 1 then
if progress == 1 then
ScriptLib.ShowReminder(context, 43001002)
return 0
elseif progress == 2 then
elseif progress == 2 then
ScriptLib.ShowReminder(context, 43001003)
return 0
elseif progress == 3 then
elseif progress == 3 then
ScriptLib.ShowReminder(context, 43001004)
return 0
else
@ -274,53 +274,53 @@ function Reminder_Key_Progress(context, progress)
end
function condition_Enter_FatherRegion(context, evt)
if evt.param1 ~= defs.region_id then
return false
if evt.param1 ~= defs.region_id then
return false
end
return true
end
--由大Region触发用且仅用于接续父挑战
function action_Enter_FatherRegion(context, evt)
ScriptLib.PrintContextLog(context, "[MistTrialV2] Enter father region triggered...")
ScriptLib.PrintContextLog(context, "[MistTrialV2] Enter father region triggered...")
if ScriptLib.GetGroupVariableValue(context, "father_state") == 0 then
if ScriptLib.GetGroupVariableValue(context, "father_state") == 0 then
ScriptLib.SetGroupVariableValue(context, "father_state", 1)
ScriptLib.PrintContextLog(context, "[MistTrialV2] First Time Enter region. Set mark.")
return 0
end
end
local gallery_state = ScriptLib.GetGroupVariableValue(context, "gallery_state")
if gallery_state == 2 then
if gallery_state == 2 then
ScriptLib.PrintContextLog(context, "[MistTrialV2] ...gallery is finished, will do nothing.")
ScriptLib.PrintContextLog(context, "[MistTrialV2] ...gallery is finished, will do nothing.")
return 0
elseif gallery_state == 1 then
ScriptLib.PrintContextLog(context, "[MistTrialV2] Gallery_state = 1 & father_state is not 0, Trying to get Challenge Progress. ")
ScriptLib.PrintContextLog(context, "[MistTrialV2] Gallery_state = 1 & father_state is not 0, Trying to get Challenge Progress. ")
if ResumeMistTrial(context) == -1 then
if ResumeMistTrial(context) == -1 then
ScriptLib.PrintContextLog(context, "[MistTrialV2] #WRONG# Unexpected Challenge Progress!!")
end
return 0
elseif gallery_state == 0 then
elseif gallery_state == 0 then
ScriptLib.PrintContextLog(context, "[MistTrialV2] ...gallery is not started, will do nothing.")
ScriptLib.PrintContextLog(context, "[MistTrialV2] ...gallery is not started, will do nothing.")
return 0
else
ScriptLib.PrintContextLog(context, "[MistTrialV2] #WRONG# Unexpected Gallery state! gallery_state@".. gallery_state)
ScriptLib.PrintContextLog(context, "[MistTrialV2] #WRONG# Unexpected Gallery state! gallery_state@".. gallery_state)
return 0
end
end
return 0
end
@ -330,19 +330,19 @@ function ResumeMistTrial(context, evt)
--父挑战状态 0-初始 1-进了地城但未开始 2-进行中(正在激活古代符文 3-进行中启动遗迹控制台4-进行中(最终挑战) 5-全部完成
local father_state = ScriptLib.GetGroupVariableValue(context, "father_state")
ScriptLib.PrintContextLog(context, "[MistTrialV2] ResumeMistTrial Called. father_state@".. father_state)
ScriptLib.PrintContextLog(context, "[MistTrialV2] ResumeMistTrial Called. father_state@".. father_state)
--迷城战线v2的限时用Gallery控制excel表
--此处用于保证接续挑战时CreateFatherChallenge的时长不要小于Gallery
local father_life = 1800
if father_state == 0 or father_state == 1 then
if father_state == 0 or father_state == 1 then
--挑战还没开始过,就触发了接续挑战
ScriptLib.PrintContextLog(context, "[MistTrialV2] #WRONG# Mark has set 1 but father challenge state is 0 ! ")
ScriptLib.PrintContextLog(context, "[MistTrialV2] #WRONG# Mark has set 1 but father challenge state is 0 ! ")
return 0
elseif father_state == 2 then
elseif father_state == 2 then
--接续钥匙房挑战 defs.key_challenge
local saved = ScriptLib.GetGroupVariableValue(context, "key_progress")
@ -353,13 +353,13 @@ function ResumeMistTrial(context, evt)
ScriptLib.AttachChildChallenge(context, cfg.father_index, cfg.key_challenge_index, defs.key_challenge, {3,901,defs.key_target,1,saved}, {}, {success=1, fail=1} )
ScriptLib.StartFatherChallenge(context, cfg.father_index)
ScriptLib.PrintContextLog(context, "[MistTrialV2] Resuming MistTrial Starting: 激活古代符文. Saved key num@"..saved)
ScriptLib.PrintContextLog(context, "[MistTrialV2] Resuming MistTrial Starting: 激活古代符文. Saved key num@"..saved)
return 0
elseif father_state == 3 then
elseif father_state == 3 then
ScriptLib.PrintContextLog(context, "[MistTrialV2] Resuming MistTrial Starting: 启动遗迹控制台.")
ScriptLib.PrintContextLog(context, "[MistTrialV2] Resuming MistTrial Starting: 启动遗迹控制台.")
--创建父挑战
ScriptLib.CreateFatherChallenge(context, cfg.father_index, defs.challenge_id, father_life , {success=99999, fail=99999})
@ -372,9 +372,9 @@ function ResumeMistTrial(context, evt)
return 0
elseif father_state == 4 then
elseif father_state == 4 then
ScriptLib.PrintContextLog(context, "[MistTrialV2] Resuming MistTrial Starting: 最终挑战.")
ScriptLib.PrintContextLog(context, "[MistTrialV2] Resuming MistTrial Starting: 最终挑战.")
--创建父挑战
ScriptLib.CreateFatherChallenge(context, cfg.father_index, defs.challenge_id, father_life , {success=99999, fail=99999})
@ -387,10 +387,10 @@ function ResumeMistTrial(context, evt)
return 0
elseif father_state == 5 then
elseif father_state == 5 then
--挑战还没开始过,就触发了接续挑战
ScriptLib.PrintContextLog(context, "[MistTrialV2] Trying to resume challenge but it is all clear. Do nothing.")
ScriptLib.PrintContextLog(context, "[MistTrialV2] Trying to resume challenge but it is all clear. Do nothing.")
return 0
end
@ -399,15 +399,15 @@ end
function action_Gallery_Stop(context, evt)
if evt.param1 ~= defs.gallery_id then
if evt.param1 ~= defs.gallery_id then
return -1
end
UpLoadActionLog(context)
--evt.param3
--1、时间到 2、客户端中断 3、LUA中断
if evt.param3 == 1 then
if evt.param3 == 1 then
ScriptLib.PrintContextLog(context, "[MistTrialV2] Gallery Stop Triggered. reason@ Time Up.")
ScriptLib.PrintContextLog(context, "[MistTrialV2] Gallery Stop Triggered. reason@ Time Up.")
ScriptLib.SetGroupVariableValue(context, "gallery_state", 2)
@ -417,7 +417,7 @@ function action_Gallery_Stop(context, evt)
elseif evt.param3 == 2 then
ScriptLib.PrintContextLog(context, "[MistTrialV2] Gallery Stop Triggered. reason@ Client.")
ScriptLib.PrintContextLog(context, "[MistTrialV2] Gallery Stop Triggered. reason@ Client.")
ScriptLib.SetGroupVariableValue(context, "gallery_state", 2)
@ -426,11 +426,11 @@ function action_Gallery_Stop(context, evt)
ScriptLib.SetGroupVariableValue(context, "father_state", 5)
elseif evt.param3 == 3 then
ScriptLib.PrintContextLog(context, "[MistTrialV2] Gallery Stop Triggered. reason@ Lua.")
ScriptLib.PrintContextLog(context, "[MistTrialV2] Gallery Stop Triggered. reason@ Lua.")
ScriptLib.SetGroupVariableValue(context, "gallery_state", 2)
ScriptLib.SetGroupVariableValue(context, "father_state", 5)
end
end
return 0
end
function ResetGroupTempVar(context)
@ -439,12 +439,12 @@ function ResetGroupTempVar(context)
end
return 0
end
--上报运营日志数据 需求单s1286673
--上报运营日志数据 需求单s1286673
function UpLoadActionLog(context)
local log = {
["Buff_Attack"] = 0,
["Buff_Heal"] = 0
["Buff_Heal"] = 0
}
for k, v in pairs(log) do
@ -456,17 +456,17 @@ function UpLoadActionLog(context)
return 0
end
--用于检查value是否在目标table中
function CheckIsInTable(context,check_value)
function CheckIsInTable(context,check_value)
--和关卡约定的challenge Index
local indexs = {999,901,902,903}
for k,v in pairs(indexs) do
if v == check_value then
--ScriptLib.PrintContextLog(context, "[MistTrialV2] Check Is SpecialChallenge. return 1")
if v == check_value then
--ScriptLib.PrintContextLog(context, "[MistTrialV2] Check Is SpecialChallenge. return 1")
return 1
end
end
return 0
end
LF_Initialize_Group(triggers, suites)
LF_Initialize_Group(triggers, suites)

View File

@ -6,13 +6,13 @@
--[[
defs = {
local defs = {
--按想要的解谜顺序, 填子装置的config_id
branch_gadgets = {117012, 117013, 117014},
branch_gadgets = {117012, 117013, 117014},
--主装置的config_id,可填一个或多个
main_gadget = {117011},
main_gadget = {117011},
--重置倒计时秒数
limit_time = {25},
limit_time = {25},
--这组解谜在哪个suit里
puzzle_suit = 1,
--当前group
@ -78,7 +78,7 @@ end]]
--10.15迭代进入范围弹出banner 反复弹 战斗过程中不弹 装置已经是暖源了也不弹
function action_enter_BannerRegion(context, evt)
--检查region
if defs.banner_region == nil or evt.param1 ~= defs.banner_region then
if defs.banner_region == nil or evt.param1 ~= defs.banner_region then
return 0
end
--检查暖源
@ -88,24 +88,24 @@ function action_enter_BannerRegion(context, evt)
--检查战斗状态
if ScriptLib.GetGroupVariableValue(context,"challenge") == 0 then
if ScriptLib.GetGroupTempValue(context, "deny_banner", {}) ~= 1 then
if ScriptLib.GetGroupTempValue(context, "deny_banner", {}) ~= 1 then
--banner触发CD防止堆积Banner队列
ScriptLib.InitTimeAxis(context, "Banner_CD", {3}, false)
ScriptLib.SetGroupTempValue(context, "deny_banner", 1, {})
ScriptLib.ShowReminder(context, 400108)
end
end
end
return 0
end
function action_On_BannerCD(context, evt)
ScriptLib.SetGroupTempValue(context, "deny_banner", 0, {})
return 0
end
end
function action_enter_TutorialRegion(context, evt)
if defs.guide_regionID == nil then
if defs.guide_regionID == nil then
return 0
elseif evt.param1 == defs.guide_regionID then
elseif evt.param1 == defs.guide_regionID then
LF_Try_StartTutorial(context)
end
return 0
@ -133,7 +133,7 @@ function FaildProcess(context)
ScriptLib.ShowReminder(context, 400096)
--龙血矿重置
if defs.mineral ~= nil then
if defs.mineral ~= nil then
for k,v in pairs(defs.mineral) do
ScriptLib.CreateGadget(context, { config_id = v })
end
@ -150,12 +150,12 @@ function SetGadgetStateInTable(context,table,state)
end
function SuccessProcess(context)
UpLoadActionLog_StateChange(context)
UpLoadActionLog_StateChange(context)
ScriptLib.SetGroupVariableValue(context,"puzzle_state", 2)
SetGadgetStateInTable(context,defs.main_gadget,201)
--在战斗过程中解谜完成立即上SGV
local uid_list = ScriptLib.GetSceneUidList(context)
for k,v in pairs(uid_list) do
for k,v in pairs(uid_list) do
ScriptLib.SetTeamServerGlobalValue(context, v, "SGV_WinterCamp_PlayerBuff", 1)
end
if ScriptLib.GetGroupVariableValue(context,"challenge") == 1 then
@ -172,11 +172,11 @@ function action_Mineral_State_Change(context, evt)
local mineral_index = LF_IndexInTable(context,evt.param2,defs.mineral)
if mineral_index == 0 then
if mineral_index == 0 then
return 0
else
--记下最后一次交互的龙血矿index
ScriptLib.SetGroupVariableValue(context, "lastID", mineral_index)
ScriptLib.SetGroupVariableValue(context, "lastID", mineral_index)
end
return 0
end
@ -206,7 +206,7 @@ function action_Gadget_State_Change(context, evt)
--如果是正确的交互顺序
else]]
--移除对应的龙血矿
local index_toRemove = ScriptLib.GetGroupVariableValue(context, "lastID")
local index_toRemove = ScriptLib.GetGroupVariableValue(context, "lastID")
if index_toRemove ~= 0 then
ScriptLib.RemoveEntityByConfigId(context, defs.group, EntityType.GADGET, defs.mineral[index_toRemove])
end
@ -233,12 +233,12 @@ function action_Gadget_State_Change(context, evt)
ScriptLib.SetGroupVariableValue(context,"puzzle_state", 1)
ScriptLib.SetGroupVariableValue(context,"next_index", 2)
--移除对应的龙血矿
local index_toRemove = ScriptLib.GetGroupVariableValue(context, "lastID")
local index_toRemove = ScriptLib.GetGroupVariableValue(context, "lastID")
if index_toRemove ~= 0 then
ScriptLib.RemoveEntityByConfigId(context, defs.group, EntityType.GADGET, defs.mineral[index_toRemove])
end
--ScriptLib.InitTimeAxis(context,"WinterCamp_LimitTime",defs.limit_time,true)
ScriptLib.PrintContextLog(context,"[WinterCampDevice] Puzzle Start. next_index@"..next_index)
ScriptLib.PrintContextLog(context,"[WinterCampDevice] Puzzle Start. next_index@"..next_index)
--end
end
end
@ -266,7 +266,7 @@ function action_leave_OptimizRegion(context,evt)
--检查Region的configId是否是优化圈
if evt.param1 == defs.optimiz_region then
ScriptLib.ClearPlayerEyePoint(context, evt.param1)
ScriptLib.PrintContextLog(context, "[WinterCamp] Leave optimiz_region. Region_config_id@"..evt.param1)
ScriptLib.PrintContextLog(context, "[WinterCamp] Leave optimiz_region. Region_config_id@"..evt.param1)
end
return 0
end
@ -287,7 +287,7 @@ function action_On_TimeAxis(context, evt)
--检查玩家是不是该带着SGV但没带客机中途加入战斗的情况
if evt.source_name == "SGV_Checker" then
LF_Check_AllPlayerSGV(context)
end
end
--[[--暖源机关auth保持为主机
local uid_list = ScriptLib.GetSceneUidList(context)
if #uid_list ~= 0 then
@ -298,22 +298,22 @@ end
function LF_Check_AllPlayerSGV(context)
--检查暖源状态
if ScriptLib.GetGroupVariableValue(context,"puzzle_state") == 2 then
if ScriptLib.GetGroupVariableValue(context,"puzzle_state") == 2 then
local uid_list = ScriptLib.GetSceneUidList(context)
for k,v in pairs(uid_list) do
for k,v in pairs(uid_list) do
if ScriptLib.GetTeamServerGlobalValue(context, v, "SGV_WinterCamp_PlayerBuff") == 0 then
ScriptLib.SetTeamServerGlobalValue(context, v, "SGV_WinterCamp_PlayerBuff", 1)
end
end
end
end
return 0
end
function action_select_option(context, evt)
--选项7是开挑战
if evt.param2 == 7 then
if evt.param2 == 7 then
ScriptLib.SetGroupVariableValue(context, "challenge", 1)
ScriptLib.DelWorktopOptionByGroupId(context, defs.group, defs.challenge_gadget, 7)
ScriptLib.SetGadgetStateByConfigId(context, defs.challenge_gadget, 201)
@ -322,16 +322,16 @@ function action_select_option(context, evt)
--mark
ScriptLib.MarkGroupLuaAction(context, "ActivityWinterCamp_3", "", {})
--暖源状态下开挑战上GV
if ScriptLib.GetGroupVariableValue(context,"puzzle_state") == 2 then
if ScriptLib.GetGroupVariableValue(context,"puzzle_state") == 2 then
local uid_list = ScriptLib.GetSceneUidList(context)
for k,v in pairs(uid_list) do
for k,v in pairs(uid_list) do
ScriptLib.SetTeamServerGlobalValue(context, v, "SGV_WinterCamp_PlayerBuff", 1)
end
--用于检查中途加入的玩家
ScriptLib.InitTimeAxis(context, "SGV_Checker", {3}, true)
else
local uid_list = ScriptLib.GetSceneUidList(context)
for k,v in pairs(uid_list) do
for k,v in pairs(uid_list) do
ScriptLib.SetTeamServerGlobalValue(context, v, "SGV_WinterCamp_PlayerBuff", 0)
end
--处理暴风雪特效如果configID已存在 会无事发生
@ -351,7 +351,7 @@ function action_challenge_success(context, evt)
ScriptLib.SetGroupVariableValue(context, "challenge", 0)
--优化圈
ScriptLib.RemoveExtraGroupSuite(context, defs.group, 2)
--[[if defs.optimiz_region ~= nil then
--[[if defs.optimiz_region ~= nil then
ScriptLib.ClearPlayerEyePoint(context, defs.optimiz_region)
end]]
LF_ResetPlayerSGV(context)
@ -394,9 +394,9 @@ function UpLoadActionLog_StateChange(context) --寒冷装置变为暖源状态
end
function LF_ResetPlayerSGV(context)
local uid_list = ScriptLib.GetSceneUidList(context)
for k,v in pairs(uid_list) do
for k,v in pairs(uid_list) do
ScriptLib.SetTeamServerGlobalValue(context, v, "SGV_WinterCamp_PlayerBuff", 0)
end
return 0
end
LF_Initialize_Group(triggers, suites)
LF_Initialize_Group(triggers, suites)

View File

@ -3,7 +3,7 @@
]]
--[[
defs = {
local defs = {
--挑战ID
challenge_id = ,
@ -20,7 +20,7 @@ local extraTriggers={
{ config_id = 8000001,name = "Enter_Region", event = EventType.EVENT_ENTER_REGION, source = "", condition = "", action = "action_enter_region", trigger_count = 0 },
--挑战计数trigger
{ config_id = 8000002, name = "Variable_Change", event = EventType.EVENT_VARIABLE_CHANGE, source = "saved_progress", condition = "", action = "", trigger_count = 0 ,tag = "1000"},
{ config_id = 8000003,name = "Leave_Region", event = EventType.EVENT_LEAVE_REGION, source = "", condition = "", action = "action_leave_region", trigger_count = 0 },
{ config_id = 8000009, name = "Group_Will_Unload", event = EventType.EVENT_GROUP_WILL_UNLOAD, source = "", condition = "", action = "action_Group_Will_Unload", trigger_count = 0 },
@ -48,9 +48,9 @@ end
function action_enter_TutorialRegion(context, evt)
if defs.guide_regionID == nil then
if defs.guide_regionID == nil then
return 0
elseif evt.param1 == defs.guide_regionID then
elseif evt.param1 == defs.guide_regionID then
LF_Try_StartTutorial(context)
end
return 0
@ -70,14 +70,14 @@ function LF_Try_StartTutorial(context)
return 0
end
function action_Group_Will_Unload(context, evt)
if ScriptLib.GetGroupVariableValue(context, "challenge_state") == 1 then
if ScriptLib.GetGroupVariableValue(context, "challenge_state") == 1 then
ScriptLib.SetGroupVariableValue(context, "challenge_state", 0)
ScriptLib.SetGroupTempValue(context, "temp_start", 0, {})
end
return 0
end
function action_enter_region(context, evt)
if evt.param1 ~= defs.region_id then
if evt.param1 ~= defs.region_id then
return 0
end
@ -96,7 +96,7 @@ function action_challenge_pause(context, evt)
end
function action_challenge_fail(context, evt)
if ScriptLib.GetGroupVariableValue(context, "challenge_state") == 1 then
if ScriptLib.GetGroupVariableValue(context, "challenge_state") == 1 then
ScriptLib.PrintContextLog(context,"[WinterCampGacha] #WARN# Challenge Failed, not really expected in this activiy.")
ScriptLib.SetGroupVariableValue(context, "challenge_state", 0)
ScriptLib.SetGroupTempValue(context, "temp_start", 0, {})
@ -105,7 +105,7 @@ function action_challenge_fail(context, evt)
end
function action_leave_region (context, evt)
if evt.param1 ~= defs.region_id then
if evt.param1 ~= defs.region_id then
return 0
end
@ -139,21 +139,21 @@ function StartChallengeOutOfRegion(context)
ScriptLib.PrintContextLog(context,"[WinterCampGacha] Start Challenge OutOfRegion: temp_start@".. temp_start)
if temp_start == 0 then
if temp_start == 0 then
local start_process = ScriptLib.GetGroupVariableValue(context, "saved_progress")
--参数1 event_type所在枚举序号 参数2 trigger_tag参数3 次数参数4Bool次数达成是否计为成功参数5初始次数值
ScriptLib.StartChallenge(context, 1, defs.challenge_id, {3, 1000, defs.target_count, 1 , start_process})
ScriptLib.SetGroupVariableValue(context, "challenge_state", 1)
--tempStart的状态标记
--tempStart的状态标记
-- 0-圈外可触发tempStart。 1-触发了tempStart但未进圈 2-在圈里不触发tempStart 3- 挑战已完成不触发tempStart
ScriptLib.SetGroupTempValue(context, "temp_start", 1, {})
--起时间轴
ScriptLib.InitTimeAxis(context, "temp_start_life", {6}, false)
elseif temp_start == 1 then
elseif temp_start == 1 then
--续命
ScriptLib.InitTimeAxis(context, "temp_start_life", {6}, false)
@ -165,13 +165,13 @@ function LF_TryStartChallenge(context)
ScriptLib.SetGroupTempValue(context, "temp_start", 2, {})
if ScriptLib.GetGroupVariableValue(context, "challenge_state") == 0 then
if ScriptLib.GetGroupVariableValue(context, "challenge_state") == 0 then
local start_process = ScriptLib.GetGroupVariableValue(context, "saved_progress")
--参数1 event_type所在枚举序号 参数2 trigger_tag参数3 次数参数4Bool次数达成是否计为成功参数5初始次数值
ScriptLib.StartChallenge(context, 1, defs.challenge_id, {3, 1000, defs.target_count, 1 , start_process})
ScriptLib.SetGroupVariableValue(context, "challenge_state", 1)
end
return 0
@ -179,7 +179,7 @@ end
--[[function action_time_axis_pass(context, evt)
if ScriptLib.GetGroupTempValue(context, "temp_start",{}) == 1 then
if ScriptLib.GetGroupTempValue(context, "temp_start",{}) == 1 then
ScriptLib.PauseChallenge(context, 1)
@ -196,14 +196,14 @@ function GadgetCall_SnowPile_Interact(context)
--StartChallengeOutOfRegion(context)
LF_TryStartChallenge(context)
local configId = ScriptLib.GetGadgetConfigId(context, {gadget_eid = context.source_entity_id})
--向服务器请求本次雪堆结果 1 刷怪0掉落-1有错误
local result = ScriptLib.WinterCampSnowDriftInteract(context, configId)
ScriptLib.PrintContextLog(context,"[WinterCampGacha] Get result form server: result@".. result)
if result == 1 then
if result == 1 then
local tmp = GetMonsterSuit(context,configId)
@ -217,7 +217,7 @@ function GadgetCall_SnowPile_Interact(context)
return 0
elseif result == 0 then
ScriptLib.ChangeGroupVariableValue(context, "saved_progress", 1)
--杀死雪堆
ScriptLib.KillGroupEntity(context, { group_id = defs.group_id, gadgets = {configId} })
@ -246,11 +246,11 @@ end
--雪堆1 对应suite2 雪堆2 对应suite3 以此类推
function GetMonsterSuit(context, cfg_id)
local tmp = 0
for k,v in ipairs(suites[1].gadgets) do
for k,v in ipairs(suites[1].gadgets) do
if cfg_id == v then
tmp = k+1
return tmp
return tmp
end
end
return 0

View File

@ -4,7 +4,7 @@
]]
--[[
defs = {
local defs = {
--战斗开始加载suit空气墙等
add_onStart = {2},
--开启流程的操作台configID
@ -16,12 +16,12 @@ defs = {
--Boss的ConfigID
boss_id = 66005,
--暖源的IDlist
heat_id =
heat_id =
{66009,66010,66011},
--点位configID
point_list = {66012,66013,66014},
--招怪池
monster_list = {66025,66026,66027,66028,66029},
--招gadget池-召唤
@ -36,7 +36,7 @@ local cfg = {
group_id = 133002066,
play_type = 5,
play_id = 5,
play_id = 5,
}
local optimizSuite = {
@ -97,7 +97,7 @@ end
--监听战斗阶段变化
function condition_battle_state(context, evt)
ScriptLib.PrintContextLog(context, "[WinterCampMimik] Battle State Notify: play_type@"..evt.param1.." play_id@"..evt.param2.." state@"..evt.param3)
if evt.param1 == cfg.play_type and evt.param2 == cfg.play_id then
if evt.param1 == cfg.play_type and evt.param2 == cfg.play_id then
return true
end
return false
@ -107,14 +107,14 @@ function action_battle_state(context, evt)
--BATTLE_PREPARE
if evt.param3 == 2 then
ScriptLib.SetGadgetEnableInteract(context, cfg.group_id, defs.gadget_starter, false)
ScriptLib.SetGadgetEnableInteract(context, cfg.group_id, defs.gadget_starter, false)
--ScriptLib.SetGadgetStateByConfigId(context, defs.gadget_starter, 201)
ScriptLib.KillGroupEntity(context,{ group_id = cfg.group_id, gadgets = {defs.gadget_starter}})
--BATTLE_READY
elseif evt.param3 == 3 then
ScriptLib.PrestartScenePlayBattle(context, {duration = 600, start_cd = 3, progress_stage = {1}, group_id = cfg.group_id})
--加载优化圈所在suit 取最后一个suit
ScriptLib.AddExtraGroupSuite(context, cfg.group_id, #suites)
@ -168,8 +168,8 @@ end
--Boss通知关闭暖源禁止交互
function SLC_Close_WarmPoint(context, evt)
if ScriptLib.GetGroupVariableValue(context, "challenge_state") == 1 then
for k,v in pairs(defs.heat_id) do
if ScriptLib.GetGroupVariableValue(context, "challenge_state") == 1 then
for k,v in pairs(defs.heat_id) do
ScriptLib.SetGadgetStateByConfigId(context, v, GadgetState.Default)
ScriptLib.SetGadgetEnableInteract(context, cfg.group_id, v, false)
end
@ -190,7 +190,7 @@ end
function LF_Reset_WarmPoint(context,evt)
for k,v in pairs(defs.heat_id) do
for k,v in pairs(defs.heat_id) do
ScriptLib.SetGadgetStateByConfigId(context, v, GadgetState.GearStart)
ScriptLib.SetGadgetEnableInteract(context, cfg.group_id, v, true)
end
@ -265,12 +265,12 @@ function action_all_player_die(context, evt)
end
--检查全部离场
if LF_Check_AllPlayer_OutRegion(context, 66004) then
if LF_Check_AllPlayer_OutRegion(context, 66004) then
ScriptLib.PrintContextLog(context, "[WinterCampMimik] All Player Out Region.")
ScriptLib.FailScenePlayBattle(context, cfg.group_id)
return 0
end
return 0
end
@ -279,7 +279,7 @@ function action_any_monster_die(context, evt)
ScriptLib.PrintContextLog(context, "[WinterCampMimik] Monster Die Triggered. ConfigID@"..evt.param1)
if evt.param1 == defs.boss_id then
ScriptLib.AddScenePlayBattleProgress(context, cfg.group_id, 1)
else
@ -311,12 +311,12 @@ function action_leave_OptimizRegion(context,evt)
ScriptLib.PrintContextLog(context, "[WinterCampMimik] Leave optimiz_region. UID@"..context.uid.." RegionID@"..evt.param1)
--小圈检查场内玩家数量
if evt.param1 == 66004 then
if evt.param1 == 66004 then
if LF_Check_AllPlayer_OutRegion(context,66004) then
ScriptLib.FailScenePlayBattle(context, cfg.group_id)
end
--大圈清eyePoint
elseif evt.param1 == 66008 then
elseif evt.param1 == 66008 then
ScriptLib.ClearPlayerEyePoint(context, 66004)
ScriptLib.SetLimitOptimization(context, context.uid, false)
end
@ -330,7 +330,7 @@ function SLC_Boss_OutOfBattle(context)
end
--卸载保护
function action_group_will_unload( context, evt )
ScriptLib.RemoveEntityByConfigId(context, cfg.group_id, EntityType.REGION, 66008)
ScriptLib.FailScenePlayBattle(context, cfg.group_id)
@ -340,7 +340,7 @@ end
--以性能圈判断,玩家是否全部离场
function LF_Check_AllPlayer_OutRegion(context,region_id)
--非战斗阶段 跳过
if ScriptLib.GetGroupVariableValue(context, "challenge_state") ~= 1 then
if ScriptLib.GetGroupVariableValue(context, "challenge_state") ~= 1 then
return false
end
local eid = ScriptLib.GetEntityIdByConfigId(context, region_id)
@ -349,9 +349,9 @@ function LF_Check_AllPlayer_OutRegion(context,region_id)
ScriptLib.PrintContextLog(context, "[WinterCampMimik] Count player in Battle Field: RegionID@"..region_id.. "PlayerCount@".. count)
if count < 1 then
if count < 1 then
return true
end
end
return false
end
@ -365,12 +365,12 @@ function SLC_TryCreateGadget(context, param1)
return 0
end
if param1 == 0 then
if param1 == 0 then
point_configID = defs.point_list[point_index]
ScriptLib.PrintContextLog(context, "[WinterCampMimik] To Create gadget. gadget@"..defs.summoner_list[point_index].." at Point@"..point_configID.." (Index@"..point_index..")")
--pointIndex和gadget池index对应
ScriptLib.CreateGadgetByConfigIdByPos(context, defs.summoner_list[point_index], gadgets[point_configID].pos, gadgets[point_configID].rot)
elseif param1 == 1 then
elseif param1 == 1 then
point_configID = defs.point_list[point_index]
ScriptLib.PrintContextLog(context, "[WinterCampMimik] To Create gadget. gadget@"..defs.shooter_list[point_index].." at Point@"..point_configID.." (Index@"..point_index..")")
--pointIndex和gadget池index对应
@ -386,7 +386,7 @@ function SLC_GadgetTryCreateMonster(context, param1)
ScriptLib.PrintContextLog(context, "[WinterCampMimik] Get SLC_GadgetTryCreateMonster. MonsterCount@"..param1)
if param1 >5 then
if param1 >5 then
ScriptLib.PrintContextLog(context, "[WinterCampMimik] #WARN# SLC_GadgetTryCreateMonster param cannot larger than 5. Please check ability.")
return 0
end
@ -401,9 +401,9 @@ function SLC_GadgetTryCreateMonster(context, param1)
ScriptLib.PrintContextLog(context, "[WinterCampMimik] LF_GetRandomPosition. X@"..summon_pos.x.." Y@"..summon_pos.y.." Z@"..summon_pos.z)
--ScriptLib.PrintContextLog(context, "[WinterCampMimik] GetRotationByEntityId. rotX@"..rot.x.." rotY@"..rot.y.." rotZ@"..rot.z)
--ScriptLib.PrintContextLog(context, "[WinterCampMimik] LF_Try_SummonMonster. posX@"..pos_list[i].x .." posZ@"..pos_list[i].z .." rot@"..rot)
LF_Try_SummonMonster(context,summon_pos,rot)
LF_Try_SummonMonster(context,summon_pos,rot)
end
return 0
end
--返回五个随机点
@ -411,11 +411,11 @@ function LF_GetRandomPosition(context, radius, pos)
local pos_result = {x = 0, y = 0, z = 0}
math.randomseed(ScriptLib.GetServerTime(context))
pos_result.x = math.floor(pos.x + (2*math.random()-1)*radius)
pos_result.y = math.floor(pos.y)
pos_result.z = math.floor(pos.z + (2*math.random()-1)*radius)
return pos_result
end
@ -423,9 +423,9 @@ function LF_Try_SummonMonster(context,pos,rot)
--如果config_id已存在接口会返回-2
for i = 1, #defs.monster_list do
local config_id = defs.monster_list[i]
local ret = ScriptLib.CreateMonsterByConfigIdByPos(context, config_id, pos, rot)
local ret = ScriptLib.CreateMonsterByConfigIdByPos(context, config_id, pos, rot)
ScriptLib.PrintContextLog(context, "[WinterCampMimik] LF_Try_SummonMonster. configID@"..config_id.." ret@"..ret)
if ret == 0 then
if ret == 0 then
--成功创建了就停 通知怪物入战
ScriptLib.SetMonsterBattleByGroup(context, config_id, cfg.group_id)
break
@ -436,14 +436,14 @@ end
function SLC_KillBossGadget(context,param1) --param1 1射击物件 0招怪物件
if param1 == 0 or param1 == 1 then
if param1 == 0 or param1 == 1 then
local configId = ScriptLib.GetGadgetConfigId(context, {gadget_eid = context.source_entity_id})
ScriptLib.KillGroupEntity(context,{ group_id = cfg.group_id, gadgets = {configId}})
LF_Set_PointAvailible_OnGadgetDie(context, param1, evt.param1)
else
ScriptLib.PrintContextLog(context, "[WinterCampMimik] #WARN# SLC_KillBossGadget Get Unknown Param: @"..param1)
end
return 0
end
@ -452,7 +452,7 @@ function action_gadget_die(context,evt)
local gadget_id = gadgets[evt.param1].gadget_id
ScriptLib.PrintContextLog(context, "[WinterCampMimik] Get Gadget_Die. gadgetID@"..gadget_id)
--42601027 射击物件
if gadget_id == 42601027 then
if gadget_id == 42601027 then
LF_Set_PointAvailible_OnGadgetDie(context, 1, evt.param1)
--42601028 招怪物件
elseif gadget_id == 42601028 then
@ -466,22 +466,22 @@ end
function LF_Get_RandomAvailiblePoint_Index(context, gadget_type)
local availible_points = {}
--找所有空闲的点
for k,v in pairs(defs.point_list) do
for k,v in pairs(defs.point_list) do
if ScriptLib.GetGadgetStateByConfigId(context, 0, v) == 0 then
table.insert(availible_points, v)
end
end
if #availible_points > 0 then
if #availible_points > 0 then
--抓个壮丁
local rand_index = 0
local rand_index = 0
math.randomseed(ScriptLib.GetServerTime(context))
rand_index = math.random(#availible_points)
--mark他
if gadget_type == 0 then
if gadget_type == 0 then
ScriptLib.SetGadgetStateByConfigId(context, availible_points[rand_index], 201)
ScriptLib.PrintContextLog(context, "[WinterCampMimik] Set Point Usage Mark. configID@"..availible_points[rand_index].." gadget_type@"..gadget_type)
elseif gadget_type == 1 then
elseif gadget_type == 1 then
ScriptLib.SetGadgetStateByConfigId(context, availible_points[rand_index], 201)
ScriptLib.PrintContextLog(context, "[WinterCampMimik] Set Point Usage Mark. configID@"..availible_points[rand_index].." gadget_type@"..gadget_type)
else
@ -503,7 +503,7 @@ function LF_Set_PointAvailible_OnGadgetDie(context, gadget_type, die_gadget)
ScriptLib.PrintContextLog(context, "[WinterCampMimik] LF_Set_PointAvailible_OnGadgetDie. die_gadget@"..die_gadget)
local point_index = 0
if gadget_type == 1 then
if gadget_type == 1 then
point_index = GetIndexByValue(context, die_gadget,defs.shooter_list)
else
point_index = GetIndexByValue(context, die_gadget,defs.summoner_list)
@ -516,10 +516,10 @@ end
function GetIndexByValue(context, value, check_table)
for i=1, #check_table do
if value == check_table[i] then
if value == check_table[i] then
return i
end
end
return 0
end
LF_Initialize_Group(triggers, suites)
LF_Initialize_Group(triggers, suites)

View File

@ -4,7 +4,7 @@
]]
--[[
defs = {
local defs = {
--战斗开始加载suit空气墙等
add_onStart = {2},
--开启流程的操作台configID
@ -16,12 +16,12 @@ defs = {
--Boss的ConfigID
boss_id = 66005,
--暖源的IDlist
heat_id =
heat_id =
{66009,66010,66011},
--点位configID
point_list = {66012,66013,66014},
--招怪池
monster_list = {66025,66026,66027,66028,66029},
--招gadget池-召唤
@ -36,7 +36,7 @@ local cfg = {
group_id = 133002108,
--play_type = 5,
--play_id = 5,
--play_id = 5,
}
local optimizSuite = {
@ -106,8 +106,8 @@ end
--Boss通知关闭暖源禁止交互
function SLC_Close_WarmPoint(context, param1)
if ScriptLib.GetGroupVariableValue(context, "challenge_state") == 1 then
for k,v in pairs(defs.heat_id) do
if ScriptLib.GetGroupVariableValue(context, "challenge_state") == 1 then
for k,v in pairs(defs.heat_id) do
ScriptLib.SetGadgetStateByConfigId(context, v, GadgetState.Default)
ScriptLib.SetGadgetEnableInteract(context, cfg.group_id, v, false)
end
@ -128,7 +128,7 @@ end
function LF_Reset_WarmPoint(context)
for k,v in pairs(defs.heat_id) do
for k,v in pairs(defs.heat_id) do
ScriptLib.SetGadgetStateByConfigId(context, v, GadgetState.GearStart)
ScriptLib.SetGadgetEnableInteract(context, cfg.group_id, v, true)
end
@ -189,7 +189,7 @@ function action_leave_OptimizRegion(context,evt)
ScriptLib.PrintContextLog(context, "[WinterCampMimik] Leave optimiz_region. UID@"..context.uid.." RegionID@"..evt.param1)
--如果是内圈,检查场内玩家数量
if evt.param1 == 108024 then
if evt.param1 == 108024 then
if LF_Check_AllPlayer_OutRegion(context) then
--ScriptLib.FailScenePlayBattle(context, cfg.group_id) 任务版无ScenePlay
end
@ -203,7 +203,7 @@ function action_leave_OptimizRegion(context,evt)
--ScriptLib.RevertPlayerRegionVision(context, context.uid)
ScriptLib.SetLimitOptimization(context, context.uid, false)
end
return 0
@ -216,16 +216,16 @@ end
--以性能圈的内圈判断,玩家是否全部离场
function LF_Check_AllPlayer_OutRegion(context)
local eid = ScriptLib.GetEntityIdByConfigId(context, 108024)
local count = ScriptLib.GetRegionEntityCount(context, { region_eid = eid, entity_type = EntityType.AVATAR })
ScriptLib.PrintContextLog(context, "[WinterCampMimik] Count player in Battle Field: Count@".. count)
if count < 1 then
if count < 1 then
return true
end
end
return false
end
--Boss通知在点位上创建Gadgetparam10-招怪物件 1-发子弹物件
@ -238,12 +238,12 @@ function SLC_TryCreateGadget(context, param1)
return 0
end
if param1 == 0 then
if param1 == 0 then
point_configID = defs.point_list[point_index]
ScriptLib.PrintContextLog(context, "[WinterCampMimik] To Create gadget. gadget@"..defs.summoner_list[point_index].." at Point@"..point_configID.." (Index@"..point_index..")")
--pointIndex和gadget池index对应
ScriptLib.CreateGadgetByConfigIdByPos(context, defs.summoner_list[point_index], gadgets[point_configID].pos, gadgets[point_configID].rot)
elseif param1 == 1 then
elseif param1 == 1 then
point_configID = defs.point_list[point_index]
ScriptLib.PrintContextLog(context, "[WinterCampMimik] To Create gadget. gadget@"..defs.shooter_list[point_index].." at Point@"..point_configID.." (Index@"..point_index..")")
--pointIndex和gadget池index对应
@ -259,7 +259,7 @@ function SLC_GadgetTryCreateMonster(context, param1)
ScriptLib.PrintContextLog(context, "[WinterCampMimik] Get SLC_GadgetTryCreateMonster. MonsterCount@"..param1)
if param1 >5 then
if param1 >5 then
ScriptLib.PrintContextLog(context, "[WinterCampMimik] #WARN# SLC_GadgetTryCreateMonster param cannot larger than 5. Please check ability.")
return 0
end
@ -274,9 +274,9 @@ function SLC_GadgetTryCreateMonster(context, param1)
ScriptLib.PrintContextLog(context, "[WinterCampMimik] LF_GetRandomPosition. X@"..summon_pos.x.." Y@"..summon_pos.y.." Z@"..summon_pos.z)
--ScriptLib.PrintContextLog(context, "[WinterCampMimik] GetRotationByEntityId. rotX@"..rot.x.." rotY@"..rot.y.." rotZ@"..rot.z)
--ScriptLib.PrintContextLog(context, "[WinterCampMimik] LF_Try_SummonMonster. posX@"..pos_list[i].x .." posZ@"..pos_list[i].z .." rot@"..rot)
LF_Try_SummonMonster(context,summon_pos,rot)
LF_Try_SummonMonster(context,summon_pos,rot)
end
return 0
end
--返回五个随机点
@ -284,11 +284,11 @@ function LF_GetRandomPosition(context, radius, pos)
local pos_result = {x = 0, y = 0, z = 0}
math.randomseed(ScriptLib.GetServerTime(context))
pos_result.x = math.floor(pos.x + (2*math.random()-1)*radius)
pos_result.y = math.floor(pos.y)
pos_result.z = math.floor(pos.z + (2*math.random()-1)*radius)
return pos_result
end
@ -296,9 +296,9 @@ function LF_Try_SummonMonster(context,pos,rot)
--如果config_id已存在接口会返回-2
for i = 1, #defs.monster_list do
local config_id = defs.monster_list[i]
local ret = ScriptLib.CreateMonsterByConfigIdByPos(context, config_id, pos, rot)
local ret = ScriptLib.CreateMonsterByConfigIdByPos(context, config_id, pos, rot)
ScriptLib.PrintContextLog(context, "[WinterCampMimik] LF_Try_SummonMonster. configID@"..config_id.." ret@"..ret)
if ret == 0 then
if ret == 0 then
--成功创建了就停 通知怪物入战
ScriptLib.SetMonsterBattleByGroup(context, config_id, cfg.group_id)
break
@ -309,14 +309,14 @@ end
function SLC_KillBossGadget(context,param1) --param1 1射击物件 0招怪物件
if param1 == 0 or param1 == 1 then
if param1 == 0 or param1 == 1 then
local configId = ScriptLib.GetGadgetConfigId(context, {gadget_eid = context.source_entity_id})
ScriptLib.KillGroupEntity(context,{ group_id = cfg.group_id, gadgets = {configId}})
LF_Set_PointAvailible_OnGadgetDie(context, param1, evt.param1)
else
ScriptLib.PrintContextLog(context, "[WinterCampMimik] #WARN# SLC_KillBossGadget Get Unknown Param: @"..param1)
end
return 0
end
@ -325,7 +325,7 @@ function action_gadget_die(context,evt)
local gadget_id = gadgets[evt.param1].gadget_id
ScriptLib.PrintContextLog(context, "[WinterCampMimik] Get Gadget_Die. gadgetID@"..gadget_id)
--42601027 射击物件
if gadget_id == 42601027 then
if gadget_id == 42601027 then
LF_Set_PointAvailible_OnGadgetDie(context, 1, evt.param1)
--42601028 招怪物件
elseif gadget_id == 42601028 then
@ -339,22 +339,22 @@ end
function LF_Get_RandomAvailiblePoint_Index(context, gadget_type)
local availible_points = {}
--找所有空闲的点
for k,v in pairs(defs.point_list) do
for k,v in pairs(defs.point_list) do
if ScriptLib.GetGadgetStateByConfigId(context, 0, v) == 0 then
table.insert(availible_points, v)
end
end
if #availible_points > 0 then
if #availible_points > 0 then
--抓个壮丁
local rand_index = 0
local rand_index = 0
math.randomseed(ScriptLib.GetServerTime(context))
rand_index = math.random(#availible_points)
--mark他
if gadget_type == 0 then
if gadget_type == 0 then
ScriptLib.SetGadgetStateByConfigId(context, availible_points[rand_index], 201)
ScriptLib.PrintContextLog(context, "[WinterCampMimik] Set Point Usage Mark. configID@"..availible_points[rand_index].." gadget_type@"..gadget_type)
elseif gadget_type == 1 then
elseif gadget_type == 1 then
ScriptLib.SetGadgetStateByConfigId(context, availible_points[rand_index], 201)
ScriptLib.PrintContextLog(context, "[WinterCampMimik] Set Point Usage Mark. configID@"..availible_points[rand_index].." gadget_type@"..gadget_type)
else
@ -376,7 +376,7 @@ function LF_Set_PointAvailible_OnGadgetDie(context, gadget_type, die_gadget)
ScriptLib.PrintContextLog(context, "[WinterCampMimik] LF_Set_PointAvailible_OnGadgetDie. die_gadget@"..die_gadget)
local point_index = 0
if gadget_type == 1 then
if gadget_type == 1 then
point_index = GetIndexByValue(context, die_gadget,defs.shooter_list)
else
point_index = GetIndexByValue(context, die_gadget,defs.summoner_list)
@ -389,10 +389,10 @@ end
function GetIndexByValue(context, value, check_table)
for i=1, #check_table do
if value == check_table[i] then
if value == check_table[i] then
return i
end
end
return 0
end
LF_Initialize_Group(triggers, suites)
LF_Initialize_Group(triggers, suites)

View File

@ -1,13 +1,13 @@
--- ServerUploadTool Save to [/root/env/data/lua/common/V2_3] ---
--[[
2.3
Group版
]]
--[[
defs = {
local defs = {
gallery_id = ,
@ -30,7 +30,7 @@ defs = {
--金币和冰柱的对应关系
--[冰柱config_id]={金币config_id1,金币config_id2...}
coin_ice = {
coin_ice = {
[108010] = {108015,108023},
[108011] = {108017,108024},
[108012] = {108019,108025},
@ -64,7 +64,7 @@ local triggers_end={
{ config_id = 8100001, name = "Enter_Region", event = EventType.EVENT_ENTER_REGION, source = "", condition = "condition_enter_final", action = "", trigger_count = 0, tag = "666" },
{ config_id = 8100002, name = "Challenge_Success", event = EventType.EVENT_CHALLENGE_SUCCESS, source = "",condition = "",action = "action_challenge_success",trigger_count= 0}
}
function LF_Initialize_Group(triggers, suites)
--起点用触发器
@ -93,9 +93,9 @@ end
function action_enter_TutorialRegion(context, evt)
if defs.guide_regionID == nil then
if defs.guide_regionID == nil then
return 0
elseif evt.param1 == defs.guide_regionID then
elseif evt.param1 == defs.guide_regionID then
LF_Try_StartTutorial(context)
end
return 0
@ -120,10 +120,10 @@ function SLC_WinterCampCoinGet(context,param1)
ScriptLib.PrintContextLog(context, "[WinterCamp] Got SLC_WinterCampCoinGet. param@"..param1 )
if param1 == 0 then
if param1 == 0 then
--触发挑战Trigger
ScriptLib.ChangeGroupVariableValue(context, "coin_counter", 1)
elseif param1 == 1 then
elseif param1 == 1 then
--触发挑战Trigger
ScriptLib.ChangeGroupVariableValue(context, "spec_coin_counter", 1)
end
@ -137,7 +137,7 @@ end
function action_select_option(context, evt)
--检查SelectOption
if defs.starter_gadget ~= evt.param1 or 175 ~= evt.param2 then
return -1
return -1
end
--检查是否单机
if true == ScriptLib.CheckIsInMpMode(context) then
@ -149,16 +149,16 @@ function action_select_option(context, evt)
break
end
end
ScriptLib.ShowReminderRadius(context, 400053, center, 2)
ScriptLib.ShowReminderRadius(context, 400053, center, 2)
return -1
end
--LD用多个Region覆盖赛道范围这个变量用于判断是否出圈
ScriptLib.SetGroupTempValue(context, "is_in_region", 0, {})
--切操作台状态
ScriptLib.SetGadgetStateByConfigId(context, defs.starter_gadget, GadgetState.GearStart)
ScriptLib.SetGadgetStateByConfigId(context, defs.starter_gadget, GadgetState.GearStart)
--去掉操作台SelectOption
ScriptLib.DelWorktopOptionByGroupId(context, defs.group_id, defs.starter_gadget, 175)
ScriptLib.DelWorktopOptionByGroupId(context, defs.group_id, defs.starter_gadget, 175)
--加载第一波suit
for k,v in pairs(defs.load_on_start) do
@ -170,9 +170,9 @@ function action_select_option(context, evt)
ScriptLib.SwitchSceneEnvAnimal(context, 0)
--VisionType 龙血古树赛道不屏蔽3 神像赛道不屏蔽5
if defs.group_id == 133008671 then
if defs.group_id == 133008671 then
ScriptLib.SetPlayerGroupVisionType(context, {context.uid}, {0,3})
elseif defs.group_id == 133008673 then
elseif defs.group_id == 133008673 then
ScriptLib.SetPlayerGroupVisionType(context, {context.uid}, {0,5})
else
ScriptLib.SetPlayerGroupVisionType(context, {context.uid}, {0})
@ -198,11 +198,11 @@ function InitChallenge(context)
ScriptLib.SetGroupTempValue(context, "challenge_state", 1, {})
--ScriptLib.PrintContextLog(context, "[WinterCamp] Gallery Started. gallery_id@"..evt.param1)
--起挑战
--起挑战
ScriptLib.CreateFatherChallenge(context, 1, defs.father_challenge, defs.challenge_time, {success = 10, fail = 5})
--先开再attach给子挑战保序
ScriptLib.StartFatherChallenge(context,1)
ScriptLib.AttachChildChallenge(context,1, 2003003, 2003003,{4, 666,1,1},{},{success = 10,fail = 5}) --限时到达
ScriptLib.AttachChildChallenge(context,1, 2003003, 2003003,{4, 666,1,1},{},{success = 10,fail = 5}) --限时到达
ScriptLib.AttachChildChallenge(context, 1, 2003004, 2003004,{3, 888,999},{},{success = 0,fail = 0}) --收集普通纹章
ScriptLib.AttachChildChallenge(context, 1, 2003005, 2003005,{3, 999,999},{},{success = 0,fail = 0}) --收集限时纹章
@ -251,14 +251,14 @@ function action_challenge_success(context,evt)
end
function action_challenge_fail(context, evt)
--evt.param2剩余时间
if evt.param2 <= 0 then
if evt.param2 <= 0 then
LF_FailChallenge(context,1)
else
LF_FailChallenge(context,2)
end
return 0
end
@ -267,7 +267,7 @@ function LF_FailChallenge(context,reason)
-- 设置操作台选项
ScriptLib.SetWorktopOptionsByGroupId(context, defs.group_id, defs.starter_gadget, {175})
for i = 2, #suites do
ScriptLib.RemoveExtraGroupSuite(context, defs.group_id, i)
end
@ -306,7 +306,7 @@ function LF_Close_OtherHintCircle(context)
local battle_id = ScriptLib.WinterCampGetBattleGroupBundleId(context)
if battle_id ~= 0 then
ScriptLib.DeactivateGroupLinkBundleByBundleId(context, battle_id)
ScriptLib.DeactivateGroupLinkBundleByBundleId(context, battle_id)
end
ScriptLib.PrintContextLog(context, "[WinterCampParkour] Close Other HintCircle. explore_id@"..explore_id.." battle_id@"..battle_id)
return 0
@ -333,8 +333,8 @@ function SLC_SpecialIcePillarBreak(context)
ScriptLib.PrintContextLog(context, "[WinterCampParkour] Break Special IcePillar. cfg_id@"..cfg_id)
for k,v in pairs(defs.coin_ice) do
if k == cfg_id then
for k,v in pairs(defs.coin_ice) do
if k == cfg_id then
ChangeCoinState(context,v)
return 0
end
@ -386,20 +386,20 @@ function action_leave_OptimizRegion(context,evt)
return 0
end
--ScriptLib.ClearPlayerEyePoint(context, evt.param1)
--ScriptLib.ClearPlayerEyePoint(context, evt.param1)
--如果完全出圈了,触发挑战失败
local is_in_region = ScriptLib.GetGroupTempValue(context, "is_in_region", {})
ScriptLib.PrintContextLog(context, "[WinterCamp] Leave optimiz_region. Region_config_id@"..evt.param1.." is_in_region@"..is_in_region)
if is_in_region <= 0 then
if is_in_region <= 0 then
LF_FailChallenge(context,2)
end
end
end
return 0
end
--终点检查
function condition_enter_final(context, evt)
if evt.param1 ~= defs.end_region then
if evt.param1 ~= defs.end_region then
return false
end
return true
@ -435,7 +435,7 @@ end
function CameraAction(context)
if defs.look_pos and defs.duration then
if defs.look_pos and defs.duration then
--触发镜头注目,强制注目形式,不广播其他玩家
local pos_follow = {x=0, y=0, z=0}
@ -459,4 +459,4 @@ function CheckIsInTable(context,value,check_table)
return false
end
LF_Initialize_Group(triggers, suites)
LF_Initialize_Group(triggers, suites)

View File

@ -3,7 +3,7 @@
]]
--[[
defs = {
local defs = {
guide_regionID = [configID],
}
]]
@ -24,9 +24,9 @@ end
function action_enter_TutorialRegion(context, evt)
if defs.guide_regionID == nil then
if defs.guide_regionID == nil then
return 0
elseif evt.param1 == defs.guide_regionID then
elseif evt.param1 == defs.guide_regionID then
LF_Try_StartTutorial(context)
end
return 0

View File

@ -1,5 +1,5 @@
--[[
defs = {
local defs = {
box_gadget_id = 1,
point_array_id = 1,
option_id = 1,
@ -125,7 +125,7 @@ function LF_Get_Push_Direction(context, avatar, target)
_direct = "left"
else _direct = "right"
end
end
end
end
ScriptLib.PrintContextLog(context, "## BoxPusher : LF_Get_Entity_Pos | _direct = ".._direct)
return _direct
@ -369,4 +369,4 @@ function action_time_axis_pass(context, evt)
return 0
end
Initialize()
Initialize()

View File

@ -1,4 +1,4 @@
--[[defs = {
--[[local defs = {
group_id = xxx,
gadget_prison_list = {1,2,3,4},
gadget_guide = {1,2,3},
@ -11,7 +11,7 @@
rampage_time = 40,
gadget_energy = 1,
}--]]
--[[local energy_info = {
[1] = { time = 80, points = {1,2,3,4,5,6}},
[2] = { time = 160, points = {1,2,3,4,5,6}}
@ -244,7 +244,7 @@ function action_time_axis_pass(context, evt)
elseif evt.source_name == "hunter_win_by_EX" or evt.source_name == "hunter_win_in_time" or evt.source_name == "hunter_catch_by_guide" then
--相关陈列室统计
ScriptLib.SetGroupTempValue(context, evt.source_name, 0, {})
elseif evt.source_name == "final_time" then
elseif evt.source_name == "final_time" then
--抓捕阶段第180秒后为决胜时间猎手在该时间内抓两人记录翻牌
ScriptLib.SetGroupTempValue(context,"is_in_final_time",1,{})
else
@ -283,9 +283,9 @@ function action_avatar_die(context, evt)
if prey == context.uid then
--prey提前死亡不参与游戏
LF_Set_Prey_Die(context, context.uid)
return 0
return 0
end
end
end
--hunter提前死亡直接结算prey胜利
local _index = ScriptLib.GetHideAndSeekPlayIndex(context)
ScriptLib.EndSceneMultiStagePlayStage(context, _index, "null", true)
@ -355,8 +355,8 @@ function LF_Stop_Hide_And_Seek(context, value)
ScriptLib.EndTimeAxis(context, tostring(_uid))
end
--这个watcher比较特殊需要在胜利时检测prey的state所以要写在还原state之前。
if value == 2 then
for i = 1 , 3 do
if value == 2 then
for i = 1 , 3 do
local _prey = ScriptLib.GetGroupTempValue(context, "prey_"..i, {})
local _const = ScriptLib.GetGroupTempValue(context, "const_prey_"..i, {})
if _const ~= 0 then
@ -484,13 +484,13 @@ function LF_Start_Comp_Challenge(context)
for i,v in ipairs(uid_list) do
if v == hunter then
LF_Set_Player_State_Value(context, v, HS_State.Play.name, 0)
else
else
local idx = 0
for j = 1,3 do
if v == ScriptLib.GetGroupTempValue(context, "prey_"..j, {}) then
idx = j
break
end
end
end
--只有非死亡状态的游侠才继续游戏
if ScriptLib.GetGroupTempValue(context, HS_State.Play.name.."_"..v, {}) == 3 then
@ -533,10 +533,10 @@ end
function LF_Bake_Random_Scene(context)
ScriptLib.PrintContextLog(context, "## HS_Log : LF_Bake_Random_Scene")
--根据ld需求进行调整
--开启天气
for i = 1 , #weather_id_list do
ScriptLib.SetWeatherAreaState(context, weather_id_list[i], 1)
ScriptLib.SetWeatherAreaState(context, weather_id_list[i], 1)
end
--suite 2按权重随机创建
@ -573,12 +573,12 @@ function LF_Clear_Random_Scene(context)
ScriptLib.KillEntityByConfigId(context, {config_id = v, entity_type = EntityType.GADGET})
end
--关闭天气
for i = 1 , #weather_id_list do
ScriptLib.SetWeatherAreaState(context, weather_id_list[i], 0)
ScriptLib.SetWeatherAreaState(context, weather_id_list[i], 0)
end
end
function LF_Init_Player_State(context, uid)
@ -641,4 +641,4 @@ function LF_Handle_Exhibition_Prey_Win(context)
end
end
---------------------------------------
Initialize_Base()
Initialize_Base()

View File

@ -15,9 +15,9 @@ local fever_attenuation = {
-1,-1,-2,-2,-3
}
--地城对应的天气配置
local DungeonWeather = {
10039,10040,10041,10042
}
local DungeonWeather = {
10039,10040,10041,10042
}
--怪物潮
local monster_tide = {
@ -29,7 +29,7 @@ local monster_tide = {
}
defs = {
local defs = {
group_id = 235801002,
worktop_id = 123, --操作台对应的操作数
air_wall = 2005, --场内空气墙对应的ConfigID
@ -82,7 +82,7 @@ local Tri = {
[9] = { name = "dungeon_all_avatar_die", config_id = 8000009, event = EventType.EVENT_DUNGEON_ALL_AVATAR_DIE, source = "", condition = "", action = "action_dungeon_all_avatar_die", trigger_count = 0},
[10] = { name = "dungeon_settle", config_id = 8000010, event = EventType.EVENT_DUNGEON_SETTLE, source = "", condition = "", action = "action_dungeon_settle", trigger_count = 0},
[11] = { name = "enter_start_region", config_id = 8000011, event = EventType.EVENT_ENTER_REGION, source = "", condition = "", action = "action_enter_start_region", trigger_count = 0},
}
function Initialize()
@ -122,7 +122,7 @@ end
--按下操作台按键,启动玩法
function action_select_option(context,evt)
--如果空气墙没有提前创建,那么不会处理开始事件
if 1~= ScriptLib.GetGroupVariableValue(context,"is_air_wall_created") then
if 1~= ScriptLib.GetGroupVariableValue(context,"is_air_wall_created") then
return -1
end
ScriptLib.DelWorktopOptionByGroupId(context, defs.group_id, defs.worktop_id, local_defs.worktop_option)
@ -183,8 +183,8 @@ function action_monster_tide_die(context,evt)
--如果当前怪物潮已经被杀完了
if evt.param1 >= #current_tide_list then
if defs.num_killed_per_tide[current_monster_tide] == 0 then
LF_Refresh_Monster_Tide(context,"Current")
else
LF_Refresh_Monster_Tide(context,"Current")
else
LF_Refresh_Monster_Tide(context,"Next")
end
end
@ -199,7 +199,7 @@ function action_monster_die_before_leave_scene(context,evt)
local monster_fever = monsters[monster_cid].kill_score
LF_Update_Fever(context,monster_fever*fever_ratio)
LF_Update_Score(context,monster_eid)
return 0
return 0
end
@ -207,12 +207,12 @@ function LF_Refresh_Monster_Tide(context, refresh_mode)
local current_monster_tide_index = LF_Get_Current_Monster_Tide(context)
-- ScriptLib.KillMonsterTide(context, defs.group_id, LF_Get_Current_Tide_Num(context))
-- ScriptLib.SetGroupVariableValue(context,"is_tide_being_switched",1)
if refresh_mode == "Current" then
if refresh_mode == "Current" then
LF_Set_Current_Monster_Tide(context, current_monster_tide_index)
LF_Create_Monster_Tide(context,current_monster_tide_index)
ScriptLib.PrintContextLog(context,"FS: Tide Clear Refresh Current")
end
if refresh_mode == "Next" then
if refresh_mode == "Next" then
LF_Set_Current_Monster_Tide(context, current_monster_tide_index + 1)
LF_Create_Monster_Tide(context,current_monster_tide_index + 1)
ScriptLib.PrintContextLog(context,"FS: Tide Clear Refresh Next")
@ -240,7 +240,7 @@ function action_sumo_switch_team(context,evt)
ScriptLib.UpdatePlayerGalleryScore(context, defs.gallery_id, {["uid"] = uid_list[1], ["noswitch_time"] = defs.noswitch_punishment_interval})
--清除当前显示的换队惩罚的reminder
local uid_list = ScriptLib.GetSceneUidList(context)
local ret = ScriptLib.RevokePlayerShowTemplateReminder(context, local_defs.team_noswitch_pubishment_reminder, {})
ScriptLib.RevokePlayerShowTemplateReminder(context, local_defs.punish_inAdvance_reminder, {})
@ -249,7 +249,7 @@ function action_sumo_switch_team(context,evt)
--换队的时候修改team的gv重新刷一下新的avatar身上的加成效果
LF_Set_Team_Global_Value(context,local_defs.team_has_switch,1)
ScriptLib.SetGroupVariableValue(context,"is_noswitch_punishment",0)
return 0
@ -306,7 +306,7 @@ end
--终止玩法方法,关掉各种东西
function LF_Stop_Play(context)
local current_monster_tide = LF_Get_Current_Monster_Tide(context)
--清理一下空气墙,防止其他问题
ScriptLib.RemoveEntityByConfigId(context, defs.group_id, EntityType.GADGET, defs.air_wall)
@ -324,7 +324,7 @@ function LF_Create_Monster_Tide(context,monster_tide_index)
ScriptLib.PrintContextLog(context,"FS: Creating monster tide ["..monster_tide_index.."]")
local monster_config_id_list = monster_tide[monster_tide_index]
--增加怪物潮的计数下一次开启时index会+1防止索引到同一波怪物潮
local tide_num = LF_Get_Current_Tide_Num(context)
local tide_num = LF_Get_Current_Tide_Num(context)
LF_Set_Current_Tide_Num(context,tide_num+1)
local current_monster_tide = LF_Get_Current_Monster_Tide(context)
ScriptLib.AutoMonsterTide(context, tide_num+1, defs.group_id, monster_config_id_list, #monster_config_id_list, tide_suite_config[current_monster_tide].min, tide_suite_config[current_monster_tide].max)
@ -352,7 +352,7 @@ function LF_Activate_Environment_Gadget(context,fever_level)
local config_id = suites[defs.environment_suite].gadgets[i]
local gadget_id = LF_Get_Gadget_Id_By_Config_Id(context,config_id)
--大小火盆
if (gadget_id == 70350306 or gadget_id == 70350307) then
if (gadget_id == 70350306 or gadget_id == 70350307) then
if (fever_level<local_defs.burn_effect_level) then
--点燃小火
--ScriptLib.PrintContextLog(context,"FS: Burn little fire!")
@ -363,21 +363,21 @@ function LF_Activate_Environment_Gadget(context,fever_level)
--ScriptLib.PrintContextLog(context,"FS: Burn middle fire!")
local ret = ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, config_id, 201)
end
if (fever_level >= #fever_progress_table-2) then
if (fever_level >= #fever_progress_table-2) then
--持续喷大火
--ScriptLib.PrintContextLog(context,"FS: Burn super fire!")
ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, config_id, 202)
end
end
--挂灯
if (gadget_id == 70350308) then
if (gadget_id == 70350308) then
if (fever_level>=local_defs.burn_effect_level) then
--点燃小火
ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, config_id, 201)
end
end
--场景氛围
if (gadget_id == 70350309) then
if (gadget_id == 70350309) then
--转到对应的gadgetStatedefault-0、phase1-201、phase2-202、phase3-203、phase4-204
ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, config_id, 200+fever_level)
end
@ -447,7 +447,7 @@ end
--获取当前怪物潮的击杀数量
function LF_Get_Current_Tide_Minion_Killed(context)
local num_minion_killed = ScriptLib.GetGroupVariableValue(context,"num_current_minion_killed")
return num_minion_killed
return num_minion_killed
end
--增加当前怪物潮的击杀数量
@ -469,23 +469,23 @@ end
--server lua call-------------------------------------------------
function SLC_Update_Fever_Ratio(context,new_fever_ratio)
ScriptLib.PrintContextLog(context,"FS: SERVER_LUA_CALL: Changing fever ratio to: "..new_fever_ratio)
ScriptLib.SetGroupVariableValue(context,"fever_ratio",new_fever_ratio)
return 0
return 0
end
--向客户端下发当前的惩罚状态和fever值用于客户端重连时请求
function SLC_Refresh_Team_State(context)
ScriptLib.PrintContextLog(context,"FS: SERVER_LUA_CALL: Request for refresh punishment state: ")
local is_noswitch_punishment = ScriptLib.GetGroupVariableValue(context,"is_noswitch_punishment")
LF_Set_Team_Global_Value(context,"NOSWITCH_PUNISHMENT",is_noswitch_punishment)
local fever = ScriptLib.GetGalleryProgressScore(context, "fever", defs.gallery_id)
LF_Set_Team_Global_Value(context,"fever",fever)
return 0
return 0
end
------------------------------------------------------------------

View File

@ -29,7 +29,7 @@
--defs.punish_inAdvance_reminder_time = 3
------
--defs = {
--local defs = {
-- group_id = 235801002,
-- worktop_id = 123,
-- minion_fever = 5,
@ -129,14 +129,14 @@ function action_group_load(context,evt)
--开场就直接加载氛围物件,不要等玩家开启挑战
--加载环境氛围物件
ScriptLib.AddExtraGroupSuite(context,defs.group_id,defs.environment_suite)
ScriptLib.AddExtraGroupSuite(context,defs.group_id,defs.environment_suite)
return 0
end
--按下操作台按键,启动玩法
function action_select_option(context,evt)
--如果空气墙没有提前创建,那么不会处理开始事件
if 1~= ScriptLib.GetGroupVariableValue(context,"is_air_wall_created") then
if 1~= ScriptLib.GetGroupVariableValue(context,"is_air_wall_created") then
return -1
end
ScriptLib.DelWorktopOptionByGroupId(context, defs.group_id, defs.worktop_id, local_defs.worktop_option)
@ -189,7 +189,7 @@ function action_time_axis_pass(context,evt)
--ScriptLib.PrintContextLog(context,"FS: Showing reminder "..local_defs.team_noswitch_pubishment_reminder)
ScriptLib.ShowTemplateReminder(context, local_defs.team_noswitch_pubishment_reminder, {0})
--ScriptLib.ShowReminder(context, local_defs.team_noswitch_pubishment_reminder)
ScriptLib.SetGroupVariableValue(context,"is_noswitch_punishment",1)
LF_Set_Team_Global_Value(context,local_defs.team_noswitch_pubishment,1)
end
@ -220,16 +220,16 @@ function action_monster_tide_die(context,evt)
local tide_index = tonumber(evt.source_name)
local refresh_end_tide = ScriptLib.GetGroupVariableValue(context,"refresh_end_tide")
if tide_index == refresh_end_tide then
if tide_index == refresh_end_tide then
local elite_num = ScriptLib.GetGroupVariableValue(context,"is_elite_on_ground")
local monster_count = ScriptLib.GetGroupMonsterCount(context)
ScriptLib.PrintContextLog(context,"FS:[TIDE_DIE] 死亡的怪物来源于刷新时手动结束的怪物潮,剩余总怪物数量"..monster_count.."精英怪"..elite_num)
if monster_count == elite_num and elite_num ~= 0 then
if monster_count == elite_num and elite_num ~= 0 then
ScriptLib.PrintContextLog(context,"FS:[TIDE_DIE] 场上仅剩精英怪,标记需要在精英怪死亡时创建新的怪物潮")
ScriptLib.SetGroupVariableValue(context,"is_current_minion_tide_end",1)
end
if monster_count == 0 then
if monster_count == 0 then
ScriptLib.PrintContextLog(context,"FS:[TIDE_DIE] 场上没有怪物了,直接创建")
LF_Create_Monster_Tide(context,current_monster_tide)
ScriptLib.SetGroupVariableValue(context,"is_current_minion_tide_end",0)
@ -283,11 +283,11 @@ function action_monster_die_before_leave_scene(context,evt)
ScriptLib.EndTimeAxis(context,"ELITE_AXIS")
ScriptLib.InitTimeAxis(context,"ELITE_AXIS",time_axis.elite_axis,false)
if ScriptLib.GetGroupVariableValue(context,"is_current_minion_tide_end") == 0 then
if not LF_Is_Current_Index_End(context) then
if not LF_Is_Current_Index_End(context) then
ScriptLib.PrintContextLog(context,"FS:[DEBUG][MonDie] 精英怪死亡当前怪物潮没有触发OVER继续刷新,波次"..LF_Get_Current_Tide_Num(context))
ScriptLib.ContinueAutoMonster(context, defs.group_id, LF_Get_Current_Tide_Num(context))
else
if 0 == ScriptLib.GetGroupMonsterCount(context) then
if 0 == ScriptLib.GetGroupMonsterCount(context) then
ScriptLib.PrintContextLog(context,"FS:[DEBUG] [MonDie]精英怪死亡当前怪物潮已经触发OVER且场上没有Monster重新创建怪物潮")
local current_monster_tide = LF_Get_Current_Monster_Tide(context)
LF_Create_Monster_Tide(context,current_monster_tide)
@ -296,7 +296,7 @@ function action_monster_die_before_leave_scene(context,evt)
end
else
--当前怪物潮已经结束了,因为场上有精英怪被卡住了。精英死亡时,手动开启新的怪物潮
if 0 == ScriptLib.GetGroupMonsterCount(context) then
if 0 == ScriptLib.GetGroupMonsterCount(context) then
ScriptLib.PrintContextLog(context,"FS:[DEBUG][MonDie] 精英怪死亡且场上没有怪物,波次"..LF_Get_Current_Tide_Num(context))
local current_monster_tide = LF_Get_Current_Monster_Tide(context)
LF_Create_Monster_Tide(context,current_monster_tide)
@ -305,7 +305,7 @@ function action_monster_die_before_leave_scene(context,evt)
end
end
end
return 0
end
@ -329,7 +329,7 @@ function action_sumo_switch_team(context,evt)
ScriptLib.UpdatePlayerGalleryScore(context, defs.gallery_id, {["uid"] = uid_list[1], ["noswitch_time"] = defs.noswitch_punishment_interval})
--清除当前显示的换队惩罚的reminder
local uid_list = ScriptLib.GetSceneUidList(context)
local ret = ScriptLib.RevokePlayerShowTemplateReminder(context, local_defs.team_noswitch_pubishment_reminder, {})
ScriptLib.RevokePlayerShowTemplateReminder(context, local_defs.punish_inAdvance_reminder, {})
@ -339,7 +339,7 @@ function action_sumo_switch_team(context,evt)
--换队的时候修改team的gv重新刷一下新的avatar身上的加成效果
--ScriptLib.PrintContextLog(context,"FS: team has changed, team_has_change = 1")
LF_Set_Team_Global_Value(context,local_defs.team_has_switch,1)
ScriptLib.SetGroupVariableValue(context,"is_noswitch_punishment",0)
return 0
@ -403,7 +403,7 @@ end
--终止玩法方法,关掉各种东西
function LF_Stop_Play(context)
local current_monster_tide = LF_Get_Current_Monster_Tide(context)
--清理一下空气墙,防止其他问题
ScriptLib.RemoveEntityByConfigId(context, defs.group_id, EntityType.GADGET, defs.air_wall)
@ -425,7 +425,7 @@ end
function LF_Create_Monster_Tide(context,monster_tide_index)
local monster_config_id_list = monster_tide[monster_tide_index]
--增加怪物潮的计数下一次开启时index会+1防止索引到同一波怪物潮
local tide_num = LF_Get_Current_Tide_Num(context)
local tide_num = LF_Get_Current_Tide_Num(context)
LF_Set_Current_Tide_Num(context,tide_num+1)
ScriptLib.PrintContextLog(context,"FS: [DEBUG][CREATE] 创建怪物潮,怪物波次 ["..monster_tide_index.."]".."怪物潮INDEX"..(tide_num+1))
local current_monster_tide = LF_Get_Current_Monster_Tide(context)
@ -446,7 +446,7 @@ function LF_Refresh_Currtent_Monster_Tide(context)
-- ScriptLib.SetGroupVariableValue(context,"is_current_minion_tide_end",1)
LF_Set_Current_Monster_Tide(context,current_monster_tide+1)
--如果场上没有怪就直接创建
if 0 == ScriptLib.GetGroupMonsterCount(context) then
if 0 == ScriptLib.GetGroupMonsterCount(context) then
LF_Create_Monster_Tide(context,current_monster_tide+1)
ScriptLib.SetGroupVariableValue(context,"is_current_minion_tide_end",0)
ScriptLib.PrintContextLog(context,"FS:[DEBUG] [REFRESH]更新怪物潮,刷新怪物,并且标记这一波怪没有结束")
@ -475,7 +475,7 @@ function LF_Create_Elite_Monster(context,elite_index)
ScriptLib.CreateMonsterByConfigIdByPos(context, elite_list[i], v.pos, v.rot)
end
end
end
ScriptLib.SetGroupVariableValue(context,"is_elite_on_ground",#elite_list)
end
@ -520,7 +520,7 @@ function LF_Activate_Environment_Gadget(context,fever_level)
local config_id = suites[defs.environment_suite].gadgets[i]
local gadget_id = LF_Get_Gadget_Id_By_Config_Id(context,config_id)
--大小火盆
if (gadget_id == 70350306 or gadget_id == 70350307) then
if (gadget_id == 70350306 or gadget_id == 70350307) then
if (fever_level<local_defs.burn_effect_level) then
--点燃小火
--ScriptLib.PrintContextLog(context,"FS: Burn little fire!")
@ -531,21 +531,21 @@ function LF_Activate_Environment_Gadget(context,fever_level)
--ScriptLib.PrintContextLog(context,"FS: Burn middle fire!")
local ret = ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, config_id, 201)
end
if (fever_level >= #fever_progress_table-2) then
if (fever_level >= #fever_progress_table-2) then
--持续喷大火
--ScriptLib.PrintContextLog(context,"FS: Burn super fire!")
ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, config_id, 202)
end
end
--挂灯
if (gadget_id == 70350308) then
if (gadget_id == 70350308) then
if (fever_level>=local_defs.burn_effect_level) then
--点燃小火
ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, config_id, 201)
end
end
--场景氛围
if (gadget_id == 70350309) then
if (gadget_id == 70350309) then
--转到对应的gadgetStatedefault-0、phase1-201、phase2-202、phase3-203、phase4-204
ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, config_id, 200+fever_level)
end
@ -665,23 +665,23 @@ end
--server lua call-------------------------------------------------
function SLC_Update_Fever_Ratio(context,new_fever_ratio)
ScriptLib.PrintContextLog(context,"FS: SERVER_LUA_CALL: Changing fever ratio to: "..new_fever_ratio)
ScriptLib.SetGroupVariableValue(context,"fever_ratio",new_fever_ratio)
return 0
return 0
end
--向客户端下发当前的惩罚状态和fever值用于客户端重连时请求
function SLC_Refresh_Team_State(context)
ScriptLib.PrintContextLog(context,"FS: SERVER_LUA_CALL: Request for refresh punishment state: ")
local is_noswitch_punishment = ScriptLib.GetGroupVariableValue(context,"is_noswitch_punishment")
LF_Set_Team_Global_Value(context,"NOSWITCH_PUNISHMENT",is_noswitch_punishment)
local fever = ScriptLib.GetGalleryProgressScore(context, "fever", defs.gallery_id)
LF_Set_Team_Global_Value(context,"fever",fever)
return 0
return 0
end
------------------------------------------------------------------

View File

@ -1,14 +1,14 @@
--ServerUploadTool Save to [/root/env/data/lua/common/V2_5]
--[[
=====================================================================================================================
|| Filename || RecircleChallenge
|| Filename || RecircleChallenge
|| RelVersion || 2.5
|| Owner || xudong.sun
|| Description || 2.5
|| LogName || ## RC_LOG
|| Protection || group卸载时清空怪物
=====================================================================================================================
-- defs = {
-- local defs = {
-- --groupID
-- groupID = 177006001,
@ -58,7 +58,7 @@ end
function action_LeaveRegion( context, evt)
if ScriptLib.GetRegionEntityCount(context, { region_eid = evt.source_eid, entity_type = EntityType.AVATAR })~=0 then
return 0
return 0
end
ScriptLib.KillMonsterTide(context, defs.groupID, 1)
@ -72,7 +72,7 @@ function action_GroupRefresh( context, evt )
ScriptLib.PrintContextLog(context,"RC_LOG: Group Refresh")
ScriptLib.SetGroupTempValue(context, "ChallengeMode", 0, {})
return 0
end
@ -81,15 +81,15 @@ function action_GroupUnload( context, evt)
ScriptLib.SetGroupTempValue(context, "ChallengeMode", 0, {})
if ScriptLib.GetGadgetStateByConfigId(context, defs.groupID, defs.challenge_gadget) == 202 then
return 0
end
ScriptLib.SetGadgetStateByConfigId(context, defs.challenge_gadget, 0)
ScriptLib.KillMonsterTide(context, defs.groupID, 1)
return 0
end
@ -98,7 +98,7 @@ function action_InteractDwon( context, evt )
ScriptLib.PrintContextLog(context,"RC_LOG: ChallengeMode = "..ScriptLib.GetGroupTempValue(context, "ChallengeMode", {}))
if evt.param1 ~= 2 then
return 0
return 0
end
@ -139,7 +139,7 @@ function action_ChallengeFail( context, evt )
ScriptLib.SetGadgetStateByConfigId(context, defs.challenge_gadget, 0)
ScriptLib.KillMonsterTide(context, defs.groupID, 1)
return 0
end
@ -153,4 +153,4 @@ function LF_Initialize_Group()
return 0
end
LF_Initialize_Group()
LF_Initialize_Group()

View File

@ -3,7 +3,7 @@
|| owner: luyao.huang
|| description: 2.6线buff地城玩法
|| LogName: CrystalLink
|| Protection:
|| Protection:
=======================================]]--
--miscs
@ -33,7 +33,7 @@
-- {2047,2048}
--}
--
--defs = {
--local defs = {
-- play_round = 1, --战斗轮次,上半场 = 1下半场 = 2
-- next_play_group = 100000, --下一个轮次的groupid
--
@ -50,7 +50,7 @@
--内部表数据定义
local local_defs = {
worktop_option = 30110, --操作台选项id
worktop_option = 30110, --操作台选项id
team_global_value = "SGV_FEVER_LEVEL", --team上的SGV名称
--monster_create_min_interval = 5 --性能优化:刷怪最小间隔
}
@ -75,7 +75,7 @@ local time_axis = {
--增加fever触发不超过n次的检测时间窗口
add_fever_check_window_axis = {defs.add_fever_check_window},
--性能优化:刷怪最小间隔
monster_create_min_interval_axis = {defs.monster_create_min_interval},
@ -96,7 +96,7 @@ local Tri = {
{ config_id = 40000007, name = "gallery_stop", event = EventType.EVENT_GALLERY_STOP, source = "", condition = "", action = "action_gallery_stop", trigger_count = 0},
{ config_id = 40000008, name = "dungeon_all_avatar_die", event = EventType.EVENT_DUNGEON_ALL_AVATAR_DIE, source = "", condition = "", action = "action_dungeon_all_avatar_die", trigger_count = 0},
{ config_id = 40000009, name = "dungeon_settle", event = EventType.EVENT_DUNGEON_SETTLE, source = "", condition = "", action = "action_dungeon_settle", trigger_count = 0},
}
function Initialize()
@ -149,7 +149,7 @@ end
--下半场玩法启动,开始玩法初始化
function action_variable_change(context,evt)
if (evt.source_name == "can_start" and evt.param1 == 1) then
if (evt.source_name == "can_start" and evt.param1 == 1) then
ScriptLib.PrintContextLog(context,"## [CrystalLink] variable change 下半场group启动玩法初始化")
LF_Init_Play(context)
end
@ -209,7 +209,7 @@ function action_time_axis_pass(context,evt)
if (evt.source_name == "ATTENUATION_INTERVAL_AXIS") then
ScriptLib.SetGroupTempValue(context,"can_attenuate",1,{})
end
--增加fever检测时间窗口这个窗口内玩家增加fever的次数应该少于指定次数
if (evt.source_name == "ADD_FEVER_CHECK_WINDOW_AXIS") then
ScriptLib.SetGroupTempValue(context,"add_fever_times",0,{})
@ -279,7 +279,7 @@ function action_monster_tide_die(context,evt)
ScriptLib.PrintContextLog(context,"## [CrystalLink] monster die怪物死亡重启时间轴")
local has_paused_by_minion_die = ScriptLib.GetGroupVariableValue(context,"has_paused_by_minion_die")
if (has_paused_by_minion_die == 0) then
if (has_paused_by_minion_die == 0) then
if (defs.monster_create_min_interval ~= 0) then
ScriptLib.PrintContextLog(context,"## [CrystalLink] monster die之前没有怪物死亡了pause一次怪物潮")
ScriptLib.InitTimeAxis(context,"MONSTER_CREATE_MIN_INTERVAL_AXIS",time_axis.monster_create_min_interval_axis,false)
@ -298,7 +298,7 @@ function action_monster_die_before_leave_scene(context,evt)
local is_elite = LF_Is_Elite(context,monster_cid)
if (is_elite) then
if (LF_Is_Current_Elite_All_Dead(context)) then
ScriptLib.PrintContextLog(context,"## [CrystalLink] monster die本轮次的精英怪死完了精英怪重新开始计时")
--精英死亡时,重新开始计时
@ -307,7 +307,7 @@ function action_monster_die_before_leave_scene(context,evt)
--精英死亡时,重新开始精英怪预警计时
ScriptLib.EndTimeAxis(context,"ELITE_PREVIEW_REMINDER_AXIS")
ScriptLib.InitTimeAxis(context,"ELITE_PREVIEW_REMINDER_AXIS",time_axis.elite_preview_reminder_axis,false)
--精英怪死亡时,可能波次已经推进且场上小怪死完,但小怪是在波次推进之前死完的,无法触发这个事件
if (LF_Is_Current_Minion_All_Dead(context) and LF_Monster_Tide_Index_Has_Move_Forward(context)) then
ScriptLib.SetGroupVariableValue(context,"current_tide_all_killed", 1)
@ -350,7 +350,7 @@ function action_dungeon_settle(context,evt)
--触发事件时做一次校验只在当前激活的group做清理
local is_active = ScriptLib.GetGroupVariableValue(context,"is_active")
if (is_active == 1) then
LF_Immediate_Stop_Play(context)
ScriptLib.CauseDungeonSuccess(context)
end
@ -367,7 +367,7 @@ end
--初始化玩法,加载操作台等物件
function LF_Init_Play(context)
ScriptLib.PrintContextLog(context,"## [CrystalLink] LF Init Play ----------玩法初始化开始----------")
--先将当前group置为激活状态
@ -377,11 +377,11 @@ function LF_Init_Play(context)
--加载环境氛围物件
ScriptLib.AddExtraGroupSuite(context,base_info.group_id,defs.environment_suite)
--上半场开场将team上的半场SGV记录为0
if (defs.play_round == 1) then
if (defs.play_round == 1) then
LF_Set_Team_Global_Value(context,"SGV_CLEAR_LEVEL",0)
end
--如果是下半场,需要直接将振晶石切换到上半场的状态
if (defs.play_round == 2) then
if (defs.play_round == 2) then
local current_fever = ScriptLib.GetGroupVariableValue(context,"current_fever")
local fever_level = LF_Get_Fever_Level(context,current_fever)
LF_Activate_Environment_Gadget(context,fever_level)
@ -400,7 +400,7 @@ function LF_Start_Play(context)
ScriptLib.InitGalleryProgressScore(context, "fever", defs.gallery_id, fever_progress_table, GalleryProgressScoreUIType.GALLERY_PROGRESS_SCORE_UI_TYPE_CRYSTAL_LINK, GalleryProgressScoreType.GALLERY_PROGRESS_SCORE_NO_DEGRADE)
--如果是下半场在开场的时候用current_fever刷新一次fever值把上半场的fever带过来
if (defs.play_round == 2) then
if (defs.play_round == 2) then
local current_fever = ScriptLib.GetGroupVariableValue(context,"current_fever")
LF_Update_Fever(context,current_fever)
end
@ -446,7 +446,7 @@ function LF_Stop_Play(context)
local current_fever = ScriptLib.GetGalleryProgressScore(context, "fever", defs.gallery_id)
ScriptLib.SetGroupVariableValueByGroup(context,"current_fever",current_fever,defs.next_play_group)
ScriptLib.SetGroupVariableValueByGroup(context,"can_start",1,defs.next_play_group)
LF_Set_Team_Global_Value(context,"SGV_CLEAR_LEVEL",1)
if ScriptLib.CrystalLinkDungeonTeamSetUp(context,2,{init_gallery_progress=current_fever})~=0 then
ScriptLib.PrintContextLog(context,"## [CrystalLink] LF Stop Play 切换队伍失败,直接结束地城")
@ -507,7 +507,7 @@ function LF_Create_Monster_Tide(context,monster_tide_index)
local monster_config_id_list = monster_tide[monster_tide_index]
--增加怪物潮的计数下一次开启时index会+1防止索引到同一波怪物潮
local tide_num = LF_Get_Current_Tide_Num(context)
local tide_num = LF_Get_Current_Tide_Num(context)
LF_Set_Current_Tide_Num(context,tide_num+1)
local min = monster_tide_count[monster_tide_index].min
@ -518,16 +518,16 @@ function LF_Create_Monster_Tide(context,monster_tide_index)
ScriptLib.SetGroupVariableValue(context,"last_created_tide_index",monster_tide_index)
--重置记录monstertide的变量
ScriptLib.SetGroupVariableValue(context,"current_tide_all_killed",0)
ScriptLib.PrintContextLog(context,"## [CrystalLink] Create Monster Tide ----------怪物潮生成结束----------")
end
--召唤指定ID的精英怪组
function LF_Create_Elite_Monster(context,elite_index)
ScriptLib.PrintContextLog(context,"## [CrystalLink] Create Elite Monster ----------开始生成精英怪,精英怪索引为 = "..elite_index.."----------")
local elite_list = elite[elite_index]
math.randomseed(ScriptLib.GetServerTime(context))
@ -599,7 +599,7 @@ function LF_Activate_Environment_Gadget(context,fever_level)
end
if (fever_level < #fever_progress_table-2) then
for i = 1, fever_level do
for i = 1, fever_level do
ScriptLib.SetGroupGadgetStateByConfigId(context,base_info.group_id,ReactionGems[i][1],201)
ScriptLib.SetGroupGadgetStateByConfigId(context,base_info.group_id,ReactionGems[i][2],201)
end
@ -825,4 +825,4 @@ end
------------------------------------------------------------------
Initialize()
Initialize()

View File

@ -3,11 +3,11 @@
|| owner: luyao.huang
|| description: 2.6-
|| LogName: IrodoriMaster
|| Protection:
|| Protection:
=======================================]]--
------
--defs = {
--local defs = {
-- challenge_time = 240,
-- hard_challenge_time = 120,
-- father_challenge_id = 123,
@ -16,7 +16,7 @@
-- gallery_id = 123456,
-- swordmaster_id = 120,
--}
local local_defs =
local local_defs =
{
swordmaster_reminder_hp_ratio = 50
}
@ -69,12 +69,12 @@ function action_irodori_master_ready(context,evt)
ScriptLib.CreateFatherChallenge(context, 1, defs.father_challenge_id, defs.challenge_time, {success = 5, fail = 10})
--先开再attach给子挑战保序
ScriptLib.StartFatherChallenge(context,1)
ScriptLib.AttachChildChallenge(context,1, 11, defs.normal_challenge_id,{defs.challenge_time,base_info.group_id,swordmaster_id[difficulty]},{uidList[1]},{success = 5,fail = 10}) --普通挑战
ScriptLib.AttachChildChallenge(context,1, 11, defs.normal_challenge_id,{defs.challenge_time,base_info.group_id,swordmaster_id[difficulty]},{uidList[1]},{success = 5,fail = 10}) --普通挑战
--只有中等难度有两个挑战目标
if (difficulty == 2) then
ScriptLib.AttachChildChallenge(context,1, 10, defs.hard_challenge_id,{defs.hard_challenge_time,base_info.group_id,swordmaster_id[difficulty]},{uidList[1]},{success = 0,fail = 0}) --优秀挑战
end
ScriptLib.AttachChildChallenge(context,1, 10, defs.hard_challenge_id,{defs.hard_challenge_time,base_info.group_id,swordmaster_id[difficulty]},{uidList[1]},{success = 0,fail = 0}) --优秀挑战
end
return 0
end
@ -100,7 +100,7 @@ end
function action_challenge_fail(context,evt)
local fail_challenge_id = evt.param1
if (fail_challenge_id == defs.father_challenge_id) then
ScriptLib.PrintContextLog(context,"## [IrodoriMaster] action_challenge_fail 父挑战失败")
ScriptLib.PrintContextLog(context,"## [IrodoriMaster] action_challenge_fail 父挑战失败")
LF_Clear_Stage(context)
--只需要处理父挑战失败:普通挑战失败,则父挑战失败;优秀挑战失败,则无事发生
if (evt.param2 <= 0) then
@ -185,4 +185,4 @@ end
------------------------------------------------------------------
Initialize()
Initialize()

View File

@ -3,11 +3,11 @@
|| owner: luyao.huang
|| description: 2.6
|| LogName: PhotographActivity
|| Protection:
|| Protection:
=======================================]]--
------
--defs = {
--local defs = {
-- worktop_id = 10001,
-- gallery_id = 18001,
-- region_id = 20001,
@ -26,7 +26,7 @@ local Tri = {
[5] = { name = "leave_region", config_id = 40000004, event = EventType.EVENT_LEAVE_REGION, source = "", condition = "", action = "action_leave_region", trigger_count = 0},
[6] = { name = "group_will_unload", config_id = 40000005, event = EventType.EVENT_GROUP_WILL_UNLOAD, source = "", condition = "", action = "action_group_will_unload", trigger_count = 0},
[7] = { name = "gallery_stop", config_id = 40000006, event = EventType.EVENT_GALLERY_STOP, source = "", condition = "", action = "action_gallery_stop", trigger_count = 0},
}
function Initialize()
@ -138,7 +138,7 @@ function LF_Stop_Play(context, is_success)
--卸载打点suite
--LF_Set_Photo_Point_Suite(context,false)
--关闭黄圈
ScriptLib.DeactivateGroupLinkBundle(context, base_info.group_id)
ScriptLib.DeactivateGroupLinkBundle(context, base_info.group_id)
if (is_success) then
--关闭操作台
--LF_Set_Worktop(context,false)
@ -187,4 +187,4 @@ function LF_Has_Succeeded(context)
end
------------------------------------------------------------------
Initialize()
Initialize()

View File

@ -14,7 +14,7 @@
--[[
-- Trigger变量
defs = {
local defs = {
group_id = 245002001,
gear_group_id = 245002002,
route_guide_timer = 5,
@ -22,9 +22,9 @@
trapGroups = {245002013},
init_building_points = 800,
-- 当前关卡
level = 0,
level = 0,
-- 判断怪物掉落死亡的Y值
dieY = -8,
dieY = -8,
}
-- DEFS_MISCS
@ -43,7 +43,7 @@
]]--
local Global =
local Global =
{
totalWaves = 1,
}
@ -57,7 +57,7 @@ end
-- 初始化Group的各种变量
function LF_Init_Challenge_Group()
local innerTriggers =
local innerTriggers =
{
t3 = { config_id = 40000003, name = "challenge_success", event = EventType.EVENT_SCENE_MULTISTAGE_PLAY_STAGE_END, source = "", condition = "", action = "action_STAGE_END", trigger_count = 0},
@ -67,12 +67,12 @@ function LF_Init_Challenge_Group()
t7 = { config_id = 40000007, name = "end_stage_request", event = EventType.EVENT_SCENE_MULTISTAGE_PLAY_END_STAGE_REQ, source = "", condition = "", action = "action_END_STAGE_REQ", trigger_count = 0 },
-- t8 = { config_id = 8000008, name = "pick_card_event", event = EventType.EVENT_MECHANICUS_PICKED_CARD, source = "", condition = "", action = "action_PICK_CARD", trigger_count = 0 }
--t9 = { config_id = 40000009,name = "TIMER_EVENT_DELAY", event = EventType.EVENT_TIMER_EVENT, source = "delay", condition = "", action = "action_NEXT_BUILD_STAGE", trigger_count = 0 },
t10 = { config_id = 40000010,name = "TIMER_EVENT_START_REMINDER", event = EventType.EVENT_TIMER_EVENT, source = "reminder", condition = "", action = "action_START_REMINDER", trigger_count = 0 },
t11 = { config_id = 40000011,name = "ALL_AVATAR_DIE", event = EventType.EVENT_DUNGEON_ALL_AVATAR_DIE, source = "", condition = "", action = "action_ALL_AVATAR_DIE", trigger_count = 0 },
}
for i, v in ipairs(suites) do
for _, _trigger in pairs(innerTriggers) do
table.insert(v.triggers, _trigger.name)
@ -109,7 +109,7 @@ function LF_Init_Challenge_Group()
-- GM
table.insert(variables, { config_id=50000007,name = "GM_LevelNum", value = 0})
end
-- 游戏结束条件-所有玩家角色死亡
@ -157,7 +157,7 @@ function action_group_load(context, evt)
--ScriptLib.SetGroupVariableValue(context, "DieY", defs.dieY)
-- 初始化允许逃逸的怪物数量
-- ScriptLib.SetGroupVariableValue(context, "max_escapable_monsters", defs.max_escapable_monsters or 999)
-- 初始化波数
-- 初始化波数
ScriptLib.SetGroupVariableValue(context, "wave_ptr", 1)
--local ban_list={}
@ -238,10 +238,10 @@ function LF_AddRouteGuidePoints(context)
return 0
end
if 0 ~= ScriptLib.SetPlatformPointArray(context, guide_point_pool[idx], guide_routes[i], routes_start_point[guide_routes[i]].points, { route_type = 0 }) then
if 0 ~= ScriptLib.SetPlatformPointArray(context, guide_point_pool[idx], guide_routes[i], routes_start_point[guide_routes[i]].points, { route_type = 0 }) then
PrintLog(context, "设置点阵失败")
end
if idx >= #guide_point_pool then
idx = 1
else
@ -325,7 +325,7 @@ end
-- ScriptLib.SetGroupVariableValue(context, "escaped_monsters", escaped_monsters)
-- return 0
-- end
-- escaped_monsters = escaped_monsters + 1
-- -- 游戏失败
@ -348,10 +348,10 @@ function LF_GetPickedCards(context)
local Card_GearCoolDown = 53
for _, _card in pairs(cards) do
if _card == Card_DieReasonIsFall then
if _card == Card_DieReasonIsFall then
ScriptLib.SetGroupVariableValueByGroup(context, "CardPicked_DieReasonIsFall", 1, 0)
end
if _card == Card_GearCoolDown then
if _card == Card_GearCoolDown then
ScriptLib.SetGroupVariableValueByGroup(context, "CardPicked_GearCoolDown", 1, 0)
end
end
@ -376,20 +376,20 @@ function LF_SpecialGameplayLevel1(context, prev_context, _isElite)
if gmLevel > 0 then currentLevel = gmLevel end
--region 简单1/困难1
if currentLevel ~= 1 and currentLevel ~= 5 then
if currentLevel ~= 1 and currentLevel ~= 5 then
return 0
end
local buildingPoint = 0
if currentLevel == 1 then
if currentLevel == 1 then
buildingPoint = 10
if _isElite > 0 then
if _isElite > 0 then
buildingPoint = 50
end
end
if currentLevel == 5 then
if currentLevel == 5 then
buildingPoint = 15
if _isElite > 0 then
if _isElite > 0 then
buildingPoint = 60
end
end
@ -416,20 +416,20 @@ function LF_SpecialGameplayLevel3(context, prev_context, _isElite)
local gmLevel = ScriptLib.GetGroupVariableValue(context, "GM_LevelNum")
if gmLevel > 0 then currentLevel = gmLevel end
if currentLevel ~= 3 and currentLevel ~= 7 then
if currentLevel ~= 3 and currentLevel ~= 7 then
return 0
end
-- 获取塔的总数
local towers = ScriptLib.GetGroupVariableValueByGroup(context, "towers", defs.gear_group_id)
local buildingPoint = 10
if _isElite > 0 then
if _isElite > 0 then
buildingPoint = 50
end
local N = 10
if towers < N then
if towers < N then
LF_AddBuildingPoints(context, prev_context, buildingPoint)
PrintLog(context, "地脉异常LV3增加"..buildingPoint.."点建造值")
end
@ -442,20 +442,20 @@ function LF_SpecialGameplayLevel4(context, prev_context, param1)
PrintLog(context, "地脉异常4检查开始")
local currentLevel = defs.level or 0
-- GM
local gmLevel = ScriptLib.GetGroupVariableValue(context, "GM_LevelNum")
if gmLevel > 0 then currentLevel = gmLevel end
--
--
if currentLevel ~= 4 and currentLevel ~=8 then
if currentLevel ~= 4 and currentLevel ~=8 then
return 0
end
-- 获取塔的总数
local towers = ScriptLib.GetGroupVariableValueByGroup(context, "towers", defs.gear_group_id)
local towers = ScriptLib.GetGroupVariableValueByGroup(context, "towers", defs.gear_group_id)
-- 地脉异常4是否开启
local M4 = ScriptLib.GetGroupVariableValueByGroup(context, "M4_Active", 0)
@ -463,12 +463,12 @@ function LF_SpecialGameplayLevel4(context, prev_context, param1)
local N = 10
-- 关卡4简单
if currentLevel == 4 then
if currentLevel == 4 then
-- 满足开启条件
if towers < N and M4 == 0 then
if towers < N and M4 == 0 then
PrintLog(context, "!开启L4地脉异常")
local sgvDeltaTbl =
local sgvDeltaTbl =
{
SGV_AttackRatioUp = 1,
}
@ -477,9 +477,9 @@ function LF_SpecialGameplayLevel4(context, prev_context, param1)
end
-- 满足关闭条件
if towers >= N and M4 == 1 then
if towers >= N and M4 == 1 then
PrintLog(context, "关闭L4地脉异常")
local sgvDeltaTbl =
local sgvDeltaTbl =
{
SGV_AttackRatioUp = -1,
}
@ -489,12 +489,12 @@ function LF_SpecialGameplayLevel4(context, prev_context, param1)
end
-- 关卡4困难
if currentLevel == 8 then
if currentLevel == 8 then
-- 满足开启条件
if towers < N and M4 == 0 then
if towers < N and M4 == 0 then
PrintLog(context, "!开启L4地脉异常")
local sgvDeltaTbl =
local sgvDeltaTbl =
{
SGV_AttackRatioUp = 2,
}
@ -503,9 +503,9 @@ function LF_SpecialGameplayLevel4(context, prev_context, param1)
end
-- 满足关闭条件
if towers >= N and M4 == 1 then
if towers >= N and M4 == 1 then
PrintLog(context, "关闭L4地脉异常")
local sgvDeltaTbl =
local sgvDeltaTbl =
{
SGV_AttackRatioUp = -2,
}
@ -513,9 +513,9 @@ function LF_SpecialGameplayLevel4(context, prev_context, param1)
ScriptLib.SetGroupVariableValueByGroup(context, "M4_Active", 0, defs.group_id)
end
end
return 0
end
LF_Init_Challenge_Group()
LF_Init_Challenge_Group()

View File

@ -15,7 +15,7 @@
--[[
-- Trigger变量
defs = {
local defs = {
group_id = 245002002,
fundation_id = 70350145,
challange_group_id = 245002001,
@ -24,20 +24,20 @@
-- DEFS_MISCS
-- 预设塔配置表(底座和塔的对应关系)
local towerPrebuild =
local towerPrebuild =
{
foundationConfigId = towerGearId, --需要查询Excel
}
--]]
local Global =
local Global =
{
-- 塔的标记槽位数。同时存在的塔不会超过这个数字
slotNum = 20,
-- 所有类型塔信息表
allTowerType =
allTowerType =
{
-- 二期机关
[70350281] = {price = 500}, --水塔
@ -75,7 +75,7 @@ end
-- 判断创生物件是否是塔
function condition_TOWER_CREATE(context, evt)
local towerGadgetId = evt.param2
if Global.allTowerType[towerGadgetId] ~= nil then
if Global.allTowerType[towerGadgetId] ~= nil then
PrintLog(context, "TowerGadgetId "..evt.param2.." Created.")
return true
end
@ -89,7 +89,7 @@ function action_TOWER_CREATE(context, evt)
-- 存储该塔
for i = 1, Global.slotNum do
if ScriptLib.GetGroupVariableValue(context, "Slot"..i) == 0 then
if ScriptLib.GetGroupVariableValue(context, "Slot"..i) == 0 then
ScriptLib.SetGroupVariableValue(context, "Slot"..i, evt.param1)
break
end
@ -104,7 +104,7 @@ function condition_TOWER_DESTROY(context, evt)
-- 清除该塔的记录
for i = 1, Global.slotNum do
if ScriptLib.GetGroupVariableValue(context, "Slot"..i) == configId then
if ScriptLib.GetGroupVariableValue(context, "Slot"..i) == configId then
ScriptLib.SetGroupVariableValue(context, "Slot"..i, 0)
return true
end
@ -124,7 +124,7 @@ end
function action_EVENT_GROUP_LOAD(context, evt)
PrintLog(context, "Gear Group Load Begin 1544")
LF_Initialize_Fundations(context)
LF_Initialize_Towers(context)
@ -179,7 +179,7 @@ end
function LF_Initialize_Towers(context, prev_context, param1, param2, param3)
PrintLog(context, "Init Towers!")
if towerPrebuild == nil then
if towerPrebuild == nil then
PrintLog(context, "towerPrebuild为nil")
else
--PrintLog(context, "towerPrebuild表长度"..#towerPrebuild)
@ -189,9 +189,9 @@ function LF_Initialize_Towers(context, prev_context, param1, param2, param3)
PrintLog(context, "预设塔列表长度"..#prebuildTable)
if 0 ~= ScriptLib.ForceSetIrodoriFoundationTowers(context, prebuildTable, defs.challange_group_id, 999) then
if 0 ~= ScriptLib.ForceSetIrodoriFoundationTowers(context, prebuildTable, defs.challange_group_id, 999) then
PrintLog(context, "设置预设塔失败!")
else
else
PrintLog(context, "设置预设塔成功!")
end
return 0
@ -221,7 +221,7 @@ end
-- 初始化Group
function LF_Initialize_Group(triggers, suites)
local extraTriggers =
local extraTriggers =
{
{ config_id = 40000001, name = "GROUP_LOAD", event = EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_EVENT_GROUP_LOAD", trigger_count = 0},
{ config_id = 40000012, name = "TOWER_CREATE", event = EventType.EVENT_GADGET_CREATE, source = "", condition = "condition_TOWER_CREATE", action = "action_TOWER_CREATE", trigger_count = 0 },
@ -240,7 +240,7 @@ function LF_Initialize_Group(triggers, suites)
table.insert(variables, {config_id=50000001,name = "towers", value = 0})
-- 标记塔槽位
for i = 1, Global.slotNum do
for i = 1, Global.slotNum do
table.insert(variables, {config_id=51000000+i,name = "Slot"..i, value = 0})
end

View File

@ -15,7 +15,7 @@
--编辑器配置
--[[
defs = {
local defs = {
group_id = 245002003,
gear_group_id = 245002002
}
@ -47,11 +47,11 @@ end
-- 初始化一些trigger和var
function LF_Init_Monster_Group()
local extraTriggers =
local extraTriggers =
{
t1 = { config_id = 40000001, name = "monster_die", event = EventType.EVENT_ANY_MONSTER_DIE, source = "", condition = "", action = "action_monster_die", trigger_count = 0 },
t3 = { config_id = 40000003, name = "MONSTER_WILL_LEAVE_SCENE", event = EventType.EVENT_MONSTER_DIE_BEFORE_LEAVE_SCENE, source = "", condition = "", action = "action_MONSTER_DIE_BEFORE_LEAVE_SCENE", trigger_count = 0 },
--t4 = { config_id = 40000004, name = "EVENT_ANY_MONSTER_LIVE", event = EventType.EVENT_ANY_MONSTER_LIVE, source = "", condition = "", action = "action_ANY_MONSTER_LIVE", trigger_count = 0 },
--t4 = { config_id = 40000004, name = "EVENT_ANY_MONSTER_LIVE", event = EventType.EVENT_ANY_MONSTER_LIVE, source = "", condition = "", action = "action_ANY_MONSTER_LIVE", trigger_count = 0 },
}
for _, _trigger in pairs(extraTriggers) do
@ -75,7 +75,7 @@ function action_monster_die(context, evt)
ScriptLib.ExecuteGroupLua(context, ScriptLib.GetGroupVariableValue(context, "challenge_group"), "UpdateLeftMonsterNum", {0})
LF_UpdateMonsterKillCount(context)
return 0
end
@ -91,7 +91,7 @@ function action_MONSTER_DIE_BEFORE_LEAVE_SCENE(context, evt)
local eliteMonsters = superMonsters or {}
local isElite = 0
for _, _monsterId in pairs(eliteMonsters) do
if mid == _monsterId then
if mid == _monsterId then
isElite = 1
end
end
@ -112,7 +112,7 @@ end
function LF_GetDieFallBonusPoints(context, evt, _isElite)
local dieReason = evt.param3
if dieReason == nil then
if dieReason == nil then
PrintLog(context, "死亡原因未知")
return 0
else
@ -121,8 +121,8 @@ function LF_GetDieFallBonusPoints(context, evt, _isElite)
local challengeGroup = ScriptLib.GetGroupVariableValue(context, "challenge_group")
if dieReason == 5 or dieReason == 6 or dieReason == 7 then
-- 地脉异常L1检查
if dieReason == 5 or dieReason == 6 or dieReason == 7 then
-- 地脉异常L1检查
ScriptLib.ExecuteGroupLua(context, challengeGroup, "LF_SpecialGameplayLevel1", {_isElite})
end
@ -133,14 +133,14 @@ end
function MonsterArrive(context)
local entityId = context.target_entity_id
ScriptLib.PrintContextLog(context, "TowerDefenseMonsterArrive"..context.target_entity_id)
-- points是刷怪点位
for k, v in pairs(points) do
if ScriptLib.GetEntityIdByConfigId(context, v.config_id) == entityId then
-- ScriptLib.ExecuteGroupLua(context, ScriptLib.GetGroupVariableValue(context, "challenge_group"), "MonsterEscaped", {0})
ScriptLib.ExecuteGroupLua(context, ScriptLib.GetGroupVariableValue(context, "challenge_group"), "UpdateLeftMonsterNum", {0})
-- 直接Remove不会走掉血死亡流程
ScriptLib.RemoveEntityByConfigId(context, defs.group_id, EntityType.MONSTER, v.config_id)
@ -221,7 +221,7 @@ function LF_StartWave(context, prev_context, param1, param2, param3)
PrintLog(context, "WAVE开启")
local wave = param2
ScriptLib.SetGroupVariableValue(context, "challenge_group", param1)
ScriptLib.SetGroupVariableValue(context, "monster_wave_ptr", wave)
ScriptLib.SetGroupVariableValue(context, "tide_ptr", 1)
@ -235,11 +235,11 @@ end
function LF_MonsterTideOver(context)
ScriptLib.PrintContextLog(context, "TIDE结束")
-- 当前wave和tide
local wave = ScriptLib.GetGroupVariableValue(context, "monster_wave_ptr")
local tide = ScriptLib.GetGroupVariableValue(context, "tide_ptr")
if tide >= #monsterTides then
local challenge_group = ScriptLib.GetGroupVariableValue(context, "challenge_group")
ScriptLib.ExecuteGroupLua(context, challenge_group, "wave_done", {0})
@ -290,4 +290,4 @@ function LF_StartTide(context, tide)
end
------------------------------------
LF_Init_Monster_Group()
LF_Init_Monster_Group()

View File

@ -15,7 +15,7 @@
--[[
-- Trigger变量
defs = {
local defs = {
group_id = 245002013,
challenge_group_id = 245002001,
close_cd = 5,
@ -25,7 +25,7 @@
-- DEFS_MISCS
-- 特殊机关
-- 关卡1光桥专用且只会放一组
local specialGears =
local specialGears =
{
-- operatorConfigId
[1001] = {operatorEffectConfigId = 1002, bridgeConfigId = 1003},
@ -36,7 +36,7 @@
-- 打印日志
function PrintLog(context, content)
local print = 1
if print > 0 then
if print > 0 then
local log = "## [TowerDefence_SpecialGears_V3.0] TD_V3: "..content
ScriptLib.PrintContextLog(context, log)
end
@ -45,7 +45,7 @@ end
-- 初始化Group
function LF_Initialize_Group(triggers, suites)
local extraTriggers =
local extraTriggers =
{
{ config_id = 40000001, name = "GROUP_LOAD", event = EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_EVENT_GROUP_LOAD", trigger_count = 0},
{ config_id = 40000002, name = "GADGET_CREATE", event = EventType.EVENT_GADGET_CREATE, source = "", condition = "", action = "action_GADGET_CREATE", trigger_count = 0 },
@ -78,12 +78,12 @@ function action_EVENT_GROUP_LOAD(context, evt)
return 0
end
--
--
function action_GADGET_CREATE(context, evt)
-- 初始化所有操作台(其实只有一个)
for operatorConfigId, info in pairs(specialGears) do
if evt.param1 == operatorConfigId then
if evt.param1 == operatorConfigId then
ScriptLib.SetWorktopOptionsByGroupId(context, defs.group_id, operatorConfigId, {4007})
end
end
@ -110,7 +110,7 @@ function action_EVENT_SELECT_OPTION(context, evt)
-- 操作台激活
ScriptLib.SetGadgetStateByConfigId(context, operatorConfigId, 201)
if specialGears[operatorConfigId] == nil then
if specialGears[operatorConfigId] == nil then
return 0
end
@ -125,11 +125,11 @@ function action_EVENT_SELECT_OPTION(context, evt)
-- TIMER_CLOSE
ScriptLib.CreateGroupTimerEvent(context, defs.group_id, "close", defs.close_cd)
-- TIMER_RESET
local resetCd = defs.reset_cd
local card_picked = ScriptLib.GetGroupVariableValueByGroup(context, "CardPicked_GearCoolDown", defs.challenge_group_id)
if card_picked > 0 then
if card_picked > 0 then
resetCd = resetCd * 0.5
end
ScriptLib.CreateGroupTimerEvent(context, defs.group_id, "reset", resetCd)

View File

@ -3,12 +3,12 @@
--|| Filename || Activity_LumenCharge
--|| RelVersion || V2_7
--|| Owner || chao-jin
--|| Description ||
--|| Description ||
--|| LogName || ##[Activity_LumenCharge]
--|| Protection ||
--|| Protection ||
--======================================================================================================================
--[[Defs & Miscs
defs = {
local defs = {
challenge_time = 300,
pursina = 581032,
pursina_tip = 581105,
@ -31,59 +31,59 @@ local mud_list = {
--黑泥核心1
[581066] = { mud_id = 581082, cover_list= {581094}, respawn_time = 4, mutex_id = 581067, score = 3,
cover_content = {
[1] = {581025},
[2] = {581033},
[3] = {581051},
cover_content = {
[1] = {581025},
[2] = {581033},
[3] = {581051},
[4] = {581079},
[5] = {581123},}
},
--黑泥核心2
[581068] = { mud_id = 581081, cover_list= {581095,581096}, respawn_time = 4, mutex_id = 581071, score = 3,
cover_content = {
[1] = {581020,581026},
[2] = {581049,581044},
[3] = {581054,581055},
cover_content = {
[1] = {581020,581026},
[2] = {581049,581044},
[3] = {581054,581055},
[4] = {581108,581080},
[5] = {581127,581124},}
},
--黑泥核心3
[581069] = { mud_id = 581083, cover_list= {581093}, respawn_time = 4, mutex_id = 581070, score = 3,
cover_content = {
[1] = {581022},
[2] = {581045},
[3] = {581099},
cover_content = {
[1] = {581022},
[2] = {581045},
[3] = {581099},
[4] = {581098},
[5] = {581125},}
},
},
--黑泥核心4
[581067] = {mud_id = 581084, cover_list = {581091, 581092}, respawn_time = 6, mutex_id = 581066, score = 3,
cover_content = {
cover_content = {
[1] = {581031,581036},
[2] = {581053,581046},
[3] = {581056,581100},
[4] = {581101,581113},
[5] = {581126,581128},},
[5] = {581126,581128},},
},
--黑泥核心5
[581070] = {mud_id = 581085, cover_list = {581087, 581088}, respawn_time = 6, mutex_id = 581069, score = 3,
cover_content = {
cover_content = {
[1] = {581029,581039},
[2] = {581047,581048},
[3] = {581102,581103},
[4] = {581115,581116},
[5] = {581129,581130},},
[5] = {581129,581130},},
},
--黑泥核心6
[581071] = {mud_id = 581086, cover_list = {581017,581019,581089, 581090}, respawn_time = 6, mutex_id = 581068, score = 3,
cover_content = {
cover_content = {
[1] = {581040,581041,581042,581043},
[2] = {581052,581058,581059,581050},
[3] = {581104,581106,581057,581076},
[4] = {581078,581119,581118,581117},
[5] = {581122,581131,581132,581139},},
[5] = {581122,581131,581132,581139},},
},
}
}
--====================================================================================================================]]
--======================================================================================================================
@ -100,7 +100,7 @@ local LumenCharge_Triggers = {
}
--Events
--Group加载时处理内容
function action_group_load(context, evt)
function action_group_load(context, evt)
ScriptLib.PrintContextLog(context,"##[LumenCharge]:加载Group")
ScriptLib.ActivateGroupLinkBundle(context, base_info.group_id)
LF_ResetAllValues(context)
@ -117,10 +117,10 @@ function condition_add_charge_progress(context, evt)
end
--处理能量进度变化时的进度显示
function action_variable_change(context, evt)
if evt.source_name == "energy" then
function action_variable_change(context, evt)
if evt.source_name == "energy" then
--充能进度10%刷怪
if evt.param1 == 10 then
if evt.param1 == 10 then
ScriptLib.PrintContextLog(context,"##[LumenCharge]:刷新第1波怪")
ScriptLib.ChangeGroupVariableValue(context, "stage", 1)
ScriptLib.ShowReminder(context, 4000144)
@ -129,7 +129,7 @@ function action_variable_change(context, evt)
-- ScriptLib.RemoveExtraGroupSuite(context, base_info.group_id, 9)
end
--充能进度35%刷怪
if evt.param1 == 35 then
if evt.param1 == 35 then
ScriptLib.PrintContextLog(context,"##[LumenCharge]:刷新第2波怪")
ScriptLib.ChangeGroupVariableValue(context, "stage", 1)
ScriptLib.ShowReminder(context, 4000144)
@ -137,7 +137,7 @@ function action_variable_change(context, evt)
-- ScriptLib.RemoveExtraGroupSuite(context, base_info.group_id, 11)
end
--充能进度60%刷怪
if evt.param1 == 60 then
if evt.param1 == 60 then
ScriptLib.PrintContextLog(context,"##[LumenCharge]:刷新第3波怪")
ScriptLib.ChangeGroupVariableValue(context, "stage", 1)
ScriptLib.ShowReminder(context, 4000144)
@ -145,7 +145,7 @@ function action_variable_change(context, evt)
-- ScriptLib.RemoveExtraGroupSuite(context, base_info.group_id, 13)
end
--充能进度85%刷怪
if evt.param1 == 85 then
if evt.param1 == 85 then
ScriptLib.PrintContextLog(context,"##[LumenCharge]:刷新第4波怪")
ScriptLib.ChangeGroupVariableValue(context, "stage", 1)
ScriptLib.ShowReminder(context, 4000144)
@ -163,8 +163,8 @@ end
--玩家与操作台交互
function action_select_option(context, evt)
if extra_info.start_operator ~= evt.param1 then
function action_select_option(context, evt)
if extra_info.start_operator ~= evt.param1 then
return 0
end
@ -176,11 +176,11 @@ function action_select_option(context, evt)
ScriptLib.AttachChildChallenge(context, 1, 2009010, 2009010, { defs.challenge_time, 3, 1003, 100},{},{success = 1,fail = 1})
ScriptLib.AttachChildChallenge(context, 1, 2009008, 2009008, { defs.challenge_time, 3, 1001, 100},{},{success = 10,fail = 5})
ScriptLib.StartFatherChallenge(context,1)
--启动reminder开灯
ScriptLib.ShowReminder(context, 4000143)
ScriptLib.SetGadgetStateByConfigId(context, extra_info.lantern, GadgetState.GearStart)
--刷新黑泥对应Group
ScriptLib.AddExtraGroupSuite(context, 166001581, 2)
ScriptLib.AddExtraGroupSuite(context, 166001581, 3)
@ -196,8 +196,8 @@ function action_select_option(context, evt)
end
--玩家距离过远挑战失败
function action_leave_fail_region(context, evt)
if evt.param1 == defs.fail_region then
function action_leave_fail_region(context, evt)
if evt.param1 == defs.fail_region then
ScriptLib.PrintContextLog(context,"##[LumenCharge]:玩家脱离战斗区域,手动结束挑战")
ScriptLib.StopChallenge(context, 1, 0)
end
@ -205,18 +205,18 @@ function action_leave_fail_region(context, evt)
end
--处理时间轴
function action_time_axis_pass(context, evt)
function action_time_axis_pass(context, evt)
--充能的时间轴
if evt.source_name == "energyBasic" then
if evt.source_name == "energyBasic" then
--增加进度
ScriptLib.ChangeGroupVariableValue(context, "energy", 1)
end
end
--黑泥重生的时间轴
local core_id = tonumber(evt.source_name)
if core_id ~= nil then
local core_id = tonumber(evt.source_name)
if core_id ~= nil then
if mud_list[core_id] ~= nil then
--普通黑泥,没有互斥,直接创生核心和黑泥
if mud_list[core_id].mutex_id == 0 then
if mud_list[core_id].mutex_id == 0 then
ScriptLib.PrintContextLog(context,"##[LumenCharge]:[普通黑泥]时间轴触发")
LF_CreateMudSet(context, core_id)
else
@ -226,7 +226,7 @@ function action_time_axis_pass(context, evt)
LF_CreateMudSet(context, core_id)
ScriptLib.EndTimeAxis(context, tostring(core_id))
ScriptLib.PrintContextLog(context,"##[LumenCharge]:[核心黑泥]复活完成,关闭自身时间轴")
else
else
--互斥黑泥存在
ScriptLib.PrintContextLog(context,"##[LumenCharge]:[核心黑泥]互斥黑泥存在,此次不刷新"..(mud_list[core_id].mutex_id ))
return 0
@ -241,16 +241,16 @@ end
--处理黑泥死亡,加进度,计入统计
function action_any_gadget_die(context,evt)
if not ScriptLib.IsChallengeStartedByChallengeId(context, 2009007) then
ScriptLib.PrintContextLog(context,"##[LumenCharge]:挑战未開啟,不處理")
ScriptLib.PrintContextLog(context,"##[LumenCharge]:挑战未開啟,不處理")
return 0
end
local core_id = evt.param1
--确定死亡的是黑泥核心
if mud_list[core_id] ~= nil then
ScriptLib.PrintContextLog(context,"##[LumenCharge]:增加清除黑泥的总计数")
if mud_list[core_id] ~= nil then
ScriptLib.PrintContextLog(context,"##[LumenCharge]:增加清除黑泥的总计数")
ScriptLib.ChangeGroupTempValue(context, "MUD_REMOVED", 1, {})
if 1 ~= ScriptLib.GetGroupTempValue(context, "PURSINA_WORKING", {}) then
ScriptLib.PrintContextLog(context,"##[LumenCharge]:光钉损坏中,清除黑泥不增加进度")
if 1 ~= ScriptLib.GetGroupTempValue(context, "PURSINA_WORKING", {}) then
ScriptLib.PrintContextLog(context,"##[LumenCharge]:光钉损坏中,清除黑泥不增加进度")
else
ScriptLib.PrintContextLog(context,"##[LumenCharge]:清除黑泥,增加进度")
for i=1,mud_list[core_id].score do
@ -260,20 +260,20 @@ function action_any_gadget_die(context,evt)
--移除黑泥对应的组件
LF_RemoveMudSet(context,core_id)
if mud_list[core_id].mutex_id == 0 then
ScriptLib.PrintContextLog(context,"##[LumenCharge]:创建普通黑泥复生时间轴")
ScriptLib.PrintContextLog(context,"##[LumenCharge]:创建普通黑泥复生时间轴")
ScriptLib.InitTimeAxis(context, tostring(core_id), {mud_list[core_id].respawn_time}, false)
else
ScriptLib.PrintContextLog(context,"##[LumenCharge]:创建核心黑泥复生时间轴")
ScriptLib.PrintContextLog(context,"##[LumenCharge]:创建核心黑泥复生时间轴")
ScriptLib.InitTimeAxis(context, tostring(core_id), {mud_list[core_id].respawn_time}, true)
end
end
end
return 0
end
--处理挑战成功
function action_challenge_success(context, evt)
if evt.param1 ~= 2009007 then
function action_challenge_success(context, evt)
if evt.param1 ~= 2009007 then
return 0
end
ScriptLib.PrintContextLog(context,"##[LumenCharge]:总挑战成功")
@ -297,8 +297,8 @@ end
--处理挑战失败
function action_challenge_fail(context, evt)
if evt.param1 ~= 2009007 then
function action_challenge_fail(context, evt)
if evt.param1 ~= 2009007 then
return 0
end
ScriptLib.PrintContextLog(context,"##[LumenCharge]:总挑战失败")
@ -380,7 +380,7 @@ function LF_SetPursinaHighSpeed(context)
ScriptLib.SetGroupTempValue(context, "PURSINA_WORKING", 1, {})
end
--启动光钉,打开嘲讽
function LF_StartPursina(context, evt)
function LF_StartPursina(context, evt)
ScriptLib.PrintContextLog(context,"##[LumenCharge]:启动光钉")
ScriptLib.SetGadgetStateByConfigId(context, defs.pursina, 202)
ScriptLib.SetGroupTempValue(context, "PURSINA_WORKING", 1, {})
@ -390,7 +390,7 @@ function LF_StartPursina(context, evt)
end
--停止光钉,关闭嘲讽
function LF_StopPursina(context, evt)
ScriptLib.PrintContextLog(context,"##[LumenCharge]:关闭光钉")
ScriptLib.PrintContextLog(context,"##[LumenCharge]:关闭光钉")
ScriptLib.SetGadgetStateByConfigId(context, defs.pursina, 203)
ScriptLib.SetGroupTempValue(context, "PURSINA_WORKING", 0, {})
ScriptLib.SetEntityServerGlobalValueByConfigId(context, defs.pursina, "SGV_PURSINA_TAUNT", 0)
@ -399,10 +399,10 @@ end
--创建黑泥套组
function LF_CreateMudSet(context, core_id)
if mud_list[core_id] ~= nil then
if mud_list[core_id] ~= nil then
local covers = mud_list[core_id].cover_list
local content = mud_list[core_id].cover_content
ScriptLib.PrintContextLog(context,"##[LumenCharge]:创建黑泥,黑泥白盒")
ScriptLib.PrintContextLog(context,"##[LumenCharge]:创建黑泥,黑泥白盒")
ScriptLib.CreateGadget(context, {config_id = core_id})
ScriptLib.CreateGadget(context, {config_id = mud_list[core_id].mud_id})
if #covers ~= 0 then
@ -411,7 +411,7 @@ function LF_CreateMudSet(context, core_id)
ScriptLib.CreateGadget(context, {config_id = cover_id})
end
end
if #content ~= 0 then
if #content ~= 0 then
-- local cur_stage = ScriptLib.GetGroupVariableValue(context, "stage")
ScriptLib.PrintContextLog(context,"##[LumenCharge]:遍历移除包裹内容物")
-- 这里遍历了所有stage的包裹物全部尝试进行一次移除
@ -424,27 +424,27 @@ function LF_CreateMudSet(context, core_id)
end
end
else
ScriptLib.PrintContextLog(context,"##[LumenCharge]:[WARINING] 使用了错误的黑泥核心ID注意检查")
ScriptLib.PrintContextLog(context,"##[LumenCharge]:[WARINING] 使用了错误的黑泥核心ID注意检查")
end
end
--移除黑泥套组
function LF_RemoveMudSet(context, core_id)
if mud_list[core_id] ~= nil then
if mud_list[core_id] ~= nil then
local covers = mud_list[core_id].cover_list
local content= mud_list[core_id].cover_content
ScriptLib.PrintContextLog(context,"##[LumenCharge]:移除黑泥白盒")
ScriptLib.PrintContextLog(context,"##[LumenCharge]:移除黑泥白盒")
if 0 ~= ScriptLib.GetEntityIdByConfigId(context, mud_list[core_id].mud_id) then
ScriptLib.KillEntityByConfigId(context, { group_id = base_info.group_id, config_id = mud_list[core_id].mud_id, entity_type = EntityType.GADGET })
-- ScriptLib.RemoveEntityByConfigId(context, base_info.group_id, EntityType.GADGET, mud_list[core_id].mud_id)
end
ScriptLib.PrintContextLog(context,"##[LumenCharge]:移除黑泥包裹物")
for k,cover_id in pairs(covers) do
if 0 ~= ScriptLib.GetEntityIdByConfigId(context, cover_id) then
ScriptLib.KillEntityByConfigId(context, { group_id = base_info.group_id, config_id = cover_id, entity_type = EntityType.GADGET })
-- ScriptLib.RemoveEntityByConfigId(context, base_info.group_id, EntityType.GADGET, cover_id)
end
end
end
local cur_stage = ScriptLib.GetGroupVariableValue(context, "stage")
@ -455,7 +455,7 @@ function LF_RemoveMudSet(context, core_id)
end
end
else
ScriptLib.PrintContextLog(context,"##[LumenCharge]:[WARINING] 使用了错误的黑泥核心ID注意检查")
ScriptLib.PrintContextLog(context,"##[LumenCharge]:[WARINING] 使用了错误的黑泥核心ID注意检查")
end
end
@ -471,7 +471,7 @@ end
function SLC_ResumePursina(context)
if not ScriptLib.IsChallengeStartedByChallengeId(context, 2009007) then
ScriptLib.PrintContextLog(context,"##[LumenCharge]:挑战已结束,不再恢复时间轴")
ScriptLib.PrintContextLog(context,"##[LumenCharge]:挑战已结束,不再恢复时间轴")
return 0
end
LF_SetPursinaMidSpeed(context)
@ -495,4 +495,4 @@ function LumenCharge_Initialize()
end
end
LumenCharge_Initialize()
LumenCharge_Initialize()

View File

@ -3,12 +3,12 @@
--|| Filename || Activity_LumenWipeout
--|| RelVersion || V2_7
--|| Owner || chao-jin
--|| Description ||
--|| Description ||
--|| LogName || ##[Activity_LumenWipeout]
--|| Protection ||
--|| Protection ||
--[[======================================================================================================================
--Defs & Miscs
defs = {
local defs = {
pursina = 630015,
pursina_tip = 630087,
fail_region = 630038
@ -28,8 +28,8 @@ local extra_infos = {
local LumenWipeout_Triggers = {
{config_id = 8002001, name = "pursina_state", event = EventType.EVENT_VARIABLE_CHANGE, source = "", condition = "", action = "action_pursina_state", trigger_count = 0},
{config_id = 8002002, name = "challenge_success", event = EventType.EVENT_CHALLENGE_SUCCESS, source = "", condition = "", action = "action_challenge_success", trigger_count = 0 },
{config_id = 8002003, name = "challenge_fail", event = EventType.EVENT_CHALLENGE_FAIL, source = "", condition = "", action = "action_challenge_fail", trigger_count = 0 },
{config_id = 8002002, name = "challenge_success", event = EventType.EVENT_CHALLENGE_SUCCESS, source = "", condition = "", action = "action_challenge_success", trigger_count = 0 },
{config_id = 8002003, name = "challenge_fail", event = EventType.EVENT_CHALLENGE_FAIL, source = "", condition = "", action = "action_challenge_fail", trigger_count = 0 },
{config_id = 8002004, name = "any_gadget_die", event = EventType.EVENT_ANY_GADGET_DIE, source = "", condition = "", action = "action_any_gadget_die", trigger_count = 0},
{config_id = 8002005, name = "group_load", event = EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_group_load", trigger_count = 0},
{config_id = 8002006, name = "leave_fail_region", event = EventType.EVENT_LEAVE_REGION, source = "", condition = "", action = "action_leave_fail_region", trigger_count = 0},
@ -42,21 +42,21 @@ local LumenWipeout_Triggers = {
--Events
function action_pursina_state(context, evt)
if evt.source_name == "pursina_state" then
if evt.param1 == 0 then
function action_pursina_state(context, evt)
if evt.source_name == "pursina_state" then
if evt.param1 == 0 then
LF_SetPursinaNormal(context)
return 0
end
if evt.param1 == 1 then
if evt.param1 == 1 then
LF_SetPursinaBroken(context)
return 0
end
if evt.param1 == 2 then
if evt.param1 == 2 then
LF_SetPursinaMidSpeed(context)
return 0
end
if evt.param3 == 3 then
if evt.param3 == 3 then
LF_SetPursinaHighSpeed(context)
return 0
end
@ -75,17 +75,17 @@ function action_challenge_success(context, evt)
ScriptLib.PrintContextLog(context,"##[LumenWipeout]:埋点数据,挑战成功,流水号"..transaction.."耗时"..used_time.."清除黑泥总数"..remove_mud.."流明石等级"..lumen_level)
ScriptLib.MarkGroupLuaAction(context, "Luminous_challenge_2", transaction, {["challenge_id"] = 2009002,["end_reason"] = 1,["use_time"]= used_time ,["remove_mud"]= remove_mud,["luminous_level"] = lumen_level})
LF_ClearGroup(context)
LF_ClearGroup(context)
ScriptLib.TryFinishLuminanceStoneChallengeStage(context, base_info.group_id)
ScriptLib.GoToGroupSuite(context, base_info.group_id, 10)
ScriptLib.FinishGroupLinkBundle(context, base_info.group_id)
return 0
end
--处理BGM物件
function action_pause_battle_bgm(context, evt)
if evt.param1 == 630078 then
function action_pause_battle_bgm(context, evt)
if evt.param1 == 630078 then
ScriptLib.PrintContextLog(context,"##[LumenWipeout]:刷最后一波怪移除BGM入战物件")
if 0 ~= ScriptLib.GetEntityIdByConfigId(context, defs.enemy_gadget) then
ScriptLib.RemoveEntityByConfigId(context, base_info.group_id, EntityType.GADGET, defs.enemy_gadget)
@ -95,24 +95,24 @@ function action_pause_battle_bgm(context, evt)
end
--挑战失败处理
function action_challenge_fail(context, evt)
function action_challenge_fail(context, evt)
ScriptLib.PrintContextLog(context,"##[LumenWipeout]:挑战失败")
--运营用的埋点数据
local used_time = 300 - evt.param2
local remove_mud = ScriptLib.GetGroupTempValue(context, "MUD_REMOVED", {})
local lumen_level = ScriptLib.GetTeamServerGlobalValue(context, context.owner_uid, "SGV_Light_Stone_Level")
local transaction = evt.param_str1
if evt.param2 <= 0 then
if evt.param2 <= 0 then
ScriptLib.PrintContextLog(context,"##[LumenWipeout]:埋点数据,时间用尽,流水号"..transaction.."耗时"..used_time.."清除黑泥总数"..remove_mud.."流明石等级"..lumen_level)
ScriptLib.MarkGroupLuaAction(context, "Luminous_challenge_2", transaction, {["challenge_id"] = 2009002,["end_reason"] = 2,["use_time"]= used_time ,["remove_mud"]= remove_mud, ["luminous_level"] = lumen_level})
else
if ScriptLib.IsPlayerAllAvatarDie(context, context.owner_uid) then
if ScriptLib.IsPlayerAllAvatarDie(context, context.owner_uid) then
ScriptLib.PrintContextLog(context,"##[LumenWipeout]:埋点数据,团灭,流水号"..transaction.."耗时"..used_time.."清除黑泥总数"..remove_mud.."流明石等级"..lumen_level)
ScriptLib.MarkGroupLuaAction(context, "Luminous_challenge_2", transaction, {["challenge_id"] = 2009002,["end_reason"] = 0,["use_time"]= used_time ,["remove_mud"]= remove_mud, ["luminous_level"] = lumen_level})
end
end
--清除额外内容并恢复
LF_ClearGroup(context)
LF_ClearGroup(context)
ScriptLib.CreateGadget(context, {config_id = defs.pursina_tip})
ScriptLib.SetWorktopOptionsByGroupId(context, base_info.group_id, extra_infos.start_operator, {7})
@ -127,8 +127,8 @@ function action_group_load( context, evt )
end
--玩家脱离战斗区域,挑战失败
function action_leave_fail_region(context, evt)
if evt.param1 == defs.fail_region then
function action_leave_fail_region(context, evt)
if evt.param1 == defs.fail_region then
ScriptLib.PrintContextLog(context,"##[LumenWipeout]:玩家脱离战斗区域,手动结束挑战")
ScriptLib.StopChallenge(context, 233, 0)
end
@ -167,11 +167,11 @@ function action_gadget_create(context,evt)
-- ScriptLib.CreateGadget(context, {config_id = mud_list[evt.param1]})
ScriptLib.ChangeGroupTempValue(context, "MUD_NUMS", 1, {})
--创建黑泥,看看光钉的工作状态
if 0 ~= ScriptLib.GetGroupTempValue(context, "MUD_NUMS", {}) then
if 0 ~= ScriptLib.GetGroupTempValue(context, "MUD_NUMS", {}) then
if 1 == ScriptLib.GetGroupTempValue(context, "PURSINA_WORKING", {}) then
if 0 == ScriptLib.GetGroupTempValue(context, "MUD_REMIND", {}) then
ScriptLib.PrintContextLog(context,"##[LumenWipeout]:弹出第一次Reminder")
ScriptLib.ShowReminder(context, 4000146)
ScriptLib.ShowReminder(context, 4000146)
ScriptLib.SetGroupTempValue(context, "MUD_REMIND",1, {})
end
ScriptLib.PrintContextLog(context,"##[LumenWipeout]:创建黑泥,光钉在工作中,光钉损坏")
@ -180,7 +180,7 @@ function action_gadget_create(context,evt)
end
end
end
if evt.param1 == extra_infos.start_operator then
if evt.param1 == extra_infos.start_operator then
ScriptLib.SetWorktopOptionsByGroupId(context, base_info.group_id, extra_infos.start_operator, {7})
end
return 0
@ -193,12 +193,12 @@ function action_any_gadget_die(context,evt)
ScriptLib.ChangeGroupTempValue(context, "MUD_NUMS", -1, {})
ScriptLib.KillEntityByConfigId(context, { group_id = base_info.group_id, config_id = mud_list[evt.param1], entity_type = EntityType.GADGET })
-- ScriptLib.RemoveEntityByConfigId(context, 166001630, EntityType.GADGET, mud_list[evt.param1])
if not ScriptLib.IsChallengeStartedByChallengeId(context, 2009005) then
if not ScriptLib.IsChallengeStartedByChallengeId(context, 2009005) then
ScriptLib.PrintContextLog(context,"##[LumenWipeout]:挑战未开始,不增加统计")
return 0
end
--场上没有黑泥了,移除包裹物,恢复光钉
if 0 == ScriptLib.GetGroupTempValue(context, "MUD_NUMS", {}) then
if 0 == ScriptLib.GetGroupTempValue(context, "MUD_NUMS", {}) then
if 0 ~= ScriptLib.GetEntityIdByConfigId(context, extra_infos.mud_cover) then
ScriptLib.KillEntityByConfigId(context, { group_id = base_info.group_id, config_id = extra_infos.mud_cover, entity_type = EntityType.GADGET })
-- ScriptLib.RemoveEntityByConfigId(context, 166001630, EntityType.GADGET, extra_infos.mud_cover)
@ -213,10 +213,10 @@ end
--时间轴移动
function action_time_axis_pass(context,evt)
if evt.source_name == "pursinaDelay" then
if evt.source_name == "pursinaDelay" then
ScriptLib.PrintContextLog(context,"##[LumenWipeout]:光钉开始正常运转")
LF_SetPursinaMidSpeed(context)
ScriptLib.ShowReminder(context, 4000145)
ScriptLib.ShowReminder(context, 4000145)
end
return 0
end
@ -260,7 +260,7 @@ function LF_SetPursinaHighSpeed(context)
ScriptLib.SetGroupTempValue(context, "PURSINA_WORKING", 1, {})
end
--启动光钉
function LF_StartPursina(context, evt)
function LF_StartPursina(context, evt)
ScriptLib.PrintContextLog(context,"##[LumenWipeout]:启动光钉")
ScriptLib.SetGadgetStateByConfigId(context, defs.pursina, 202)
ScriptLib.SetGroupTempValue(context, "PURSINA_WORKING", 1, {})
@ -269,7 +269,7 @@ function LF_StartPursina(context, evt)
end
--停止光钉
function LF_StopPursina(context, evt)
ScriptLib.PrintContextLog(context,"##[LumenWipeout]:关闭光钉")
ScriptLib.PrintContextLog(context,"##[LumenWipeout]:关闭光钉")
ScriptLib.SetGadgetStateByConfigId(context, defs.pursina, 203)
ScriptLib.SetGroupTempValue(context, "PURSINA_WORKING", 0, {})
end
@ -292,4 +292,4 @@ function LumenWipeout_Initialize()
end
end
LumenWipeout_Initialize()
LumenWipeout_Initialize()

View File

@ -1,5 +1,5 @@
--[[
defs={
local defs={
air_wall = 999,
}
]]
@ -47,7 +47,7 @@ end
function LF_Notify_Next_Group_Wait(context)
for k , v in pairs(Next_Group_List) do
local _targetgroup = 0
if k ==base_info.group_id then
if k ==base_info.group_id then
_targetgroup = v
ScriptLib.SetGroupTempValue(context,"Need_Wait",1,{ group_id = _targetgroup})
end
@ -67,14 +67,14 @@ end
function action_t2_EVENT_VARIABLE_CHANGE_Ready(context,evt)
local _wait = ScriptLib.GetGroupTempValue(context,"Need_Wait",{})
ScriptLib.PrintContextLog(context,"## Rogue_Terraion_2 action_t2_EVENT_VARIABLE_CHANGE_Ready: _wait=".._wait)
if _wait == 1 then
if _wait == 1 then
ScriptLib.SetGroupTempValue(context,"Need_Wait",0,{})
local _hard = ScriptLib.GetGroupTempValue(context,"operator_is_hard",{})
local _boss = ScriptLib.GetGroupTempValue(context,"operator_is_boss",{})
LF_Create_Fight_Operator(context,_hard,_boss)
local _vec = ScriptLib.GetRogueDiaryRoundAndRoom(context)
--地城2特殊处理创建操作台时给个reminder
if #_vec == 2 then
if #_vec == 2 then
local _stage = _vec[1]
local _cell = _vec[2]
local _uidlist = ScriptLib.GetSceneUidList(context)
@ -104,13 +104,13 @@ end
--初始化
function Initialize_2()
--加变量
if temp_Variables_Rogue_Terrain_2 ~= nil then
if temp_Variables_Rogue_Terrain_2 ~= nil then
for k,v in pairs(temp_Variables_Rogue_Terrain_2) do
table.insert(variables,v)
end
end
--加触发器
if temp_Tirgger_Rogue_Terrain_2 ~= nil then
if temp_Tirgger_Rogue_Terrain_2 ~= nil then
for k,v in pairs(temp_Tirgger_Rogue_Terrain_2) do
v.name = "temp_Tirgger2_"..k
v.config_id = 40200000 + k
@ -127,4 +127,4 @@ function Initialize_2()
return 0
end
Initialize_2()
Initialize_2()

View File

@ -1,5 +1,5 @@
--[[
defs={
local defs={
Portal_Eff = 999,
Portal_Trigger = 999,
Streaming_Gadget = 999,
@ -29,7 +29,7 @@ local temp_Variables_Rogue_Terrain_3 = {
{ config_id=50000003,name = "Can_Be_Inited", value = 1, no_refresh = false },
}
local temp_Tirgger_Rogue_Terrain_3 = {
--[[
--[[
{event = EventType.EVENT_CHALLENGE_SUCCESS,source = "",condition="",action="action_t3_EVENT_CHALLENGE_SUCCESS",trigger_count=0},
{event = EventType.EVENT_ROGUE_START_FIGHT,source = "",condition="",action="action_t3_EVENT_ROGUE_START_FIGHT",trigger_count=0},
{event = EventType.EVENT_CHALLENGE_FAIL, source = "", condition = "", action = "action_t3_EVENT_CHALLENGE_FAIL",trigger_count = 0},
@ -85,7 +85,7 @@ function action_t3_EVENT_ENTER_REGION(context,evt)
ScriptLib.SetGroupVariableValue(context,"Is_Inited",1)
for k , v in pairs(t3_last_group) do
ScriptLib.SetGroupVariableValueByGroup(context,"Can_Be_Inited",0,k) --任意房间被初始化所有房间的值要设成0防止还有各种奇怪方式触发到别的房间的region同一时间只能有一个房间初始化直到玩家打通房间
if k == base_info.group_id then
if k == base_info.group_id then
ScriptLib.SetGroupVariableValueByGroup(context,"Unload",0,v)
ScriptLib.SetGroupVariableValueByGroup(context,"Is_Inited",0,v)
end
@ -105,13 +105,13 @@ function action_t3_EVENT_ROGUE_OPEN_ACCESS(context,evt)
ScriptLib.SetPlatformPointArray(context, defs.pointer, defs.pointarray, {defs.pointarray,_t}, {route_type = 0, turn_mode = false})
--如果是第一间,那么注目天空轮盘
local _vec = ScriptLib.GetRogueDiaryRoundAndRoom(context)
if #_vec == 2 then
if #_vec == 2 then
local _stage = _vec[1]
local _cell = _vec[2]
ScriptLib.PrintContextLog(context,"## Rogue_Terraion_3 action_t3_EVENT_ROGUE_OPEN_ACCESS:_stage=".._stage .."|_cell=".._cell)
if _stage == 1 and _cell == 2 then --此时cell已经变成2 因为打完了第一间
for k,v in pairs(gadgets) do
if v.config_id == defs.clock then
if v.config_id == defs.clock then
ScriptLib.BeginCameraSceneLook(context, { look_pos = v.pos, duration = 2, is_force = false, is_broadcast = false, is_recover_keep_current = true, delay = 1, is_set_follow_pos =false, follow_pos = {x=0,y=0,z=0}, is_force_walk =true, is_change_play_mode = true, screen_x = 0, screen_y = 0, is_set_screenXY = false, other_params ={}, keep_rot_type = KeepRotType.KEEP_ROT_XY, custom_radius = 0})
end
end
@ -121,14 +121,14 @@ function action_t3_EVENT_ROGUE_OPEN_ACCESS(context,evt)
end
--通知下一个房间可以被Inited
for k , v in pairs(t3_next_group) do
if k == base_info.group_id then
if k == base_info.group_id then
ScriptLib.SetGroupVariableValueByGroup(context,"Can_Be_Inited",1,v)
end
end
return 0
end
--[[
--[[
function action_t3_EVENT_CHALLENGE_SUCCESS(context,evt)
ScriptLib.PrintContextLog(context,"## Rogue_Terraion_3 action_t3_EVENT_CHALLENGE_SUCCESS:")
return 0
@ -151,7 +151,7 @@ end
--初始化
function Initialize_3()
--加触发器
if temp_Tirgger_Rogue_Terrain_3 ~= nil then
if temp_Tirgger_Rogue_Terrain_3 ~= nil then
for k,v in pairs(temp_Tirgger_Rogue_Terrain_3) do
v.name = "temp_Tirgger3_"..k
v.config_id = 40300000 + k
@ -160,7 +160,7 @@ function Initialize_3()
end
end
--加变量
if temp_Variables_Rogue_Terrain_3 ~= nil then
if temp_Variables_Rogue_Terrain_3 ~= nil then
for k,v in pairs(temp_Variables_Rogue_Terrain_3) do
table.insert(variables,v)
end
@ -169,14 +169,14 @@ function Initialize_3()
for k,v in pairs(gadgets) do
if v.gadget_id == 70800140 then
v.server_global_value_config = { ["SGV_Disable"] = 1}
end
end
end
--给钟增加sgv
for k,v in pairs(gadgets) do
if v.gadget_id == 70800163 then
v.server_global_value_config = { ["SGV_Time"] = defs.pointarray}
end
end
end
return 0
end
Initialize_3()
Initialize_3()

View File

@ -2,13 +2,13 @@
|| filename: || YeLan_BoxPusher
|| owner: || siyu.li
|| description: ||
|| LogName: ||
|| LogName: ||
|| Protection: || TimeAxisPass检测箱子到达点位
=======================================]]
--[[
var: level_start为1以开启推箱子流程
var_change接source为"level_finish"
defs = {
local defs = {
box_gadget_id_1 = 1, --可推箱子的gadget_id
box_gadget_id_2 = 2, --可推箱子的gadget_id
config_suites = {1} --注册逻辑的suite队列
@ -160,7 +160,7 @@ function LF_Get_Push_Direction(context, avatar, target)
_direct = "left"
else _direct = "right"
end
end
end
end
ScriptLib.PrintContextLog(context, "## YeLan_BoxPusher : LF_Get_Entity_Pos | _direct = ".._direct)
return _direct
@ -200,7 +200,7 @@ function LF_Check_Target_Position(context, x, z, forward)
local _forward = forward
--由于关卡方向与地图方向可能不一致,需要额外做一次旋转
--[[if forward == "up" then _forward = "left"
elseif forward == "left" then _forward = "down"
elseif forward == "left" then _forward = "down"
elseif forward == "down" then _forward = "right"
else _forward = "up"
end--]]
@ -303,7 +303,7 @@ function LF_Check_Is_Correct_Target_Point(context, box_id, x, z)
end
if is_pos_correct == false then
ScriptLib.SetGroupGadgetStateByConfigId(context, 0, box_config[box_id].config_id, 201)
end
end
end
end
return true
@ -323,7 +323,7 @@ function LF_Check_Is_Level_Finish(context)
is_right_pos = true
end
end
if is_right_pos == false then
if is_right_pos == false then
return false
end
end
@ -451,4 +451,4 @@ function action_time_axis_pass(context, evt)
return 0
end
Initialize()
Initialize()

View File

@ -5,11 +5,11 @@
|| owner: weiwei.sun
|| description: 2.8 LD配置习惯沿GroupVar结构(group例: 133212006)
|| LogName: ## [AnimalSeelie]
|| Protection:
|| Protection:
=======================================]]
--[[
defs = {
local defs = {
gadget_animal = 26001,
pointarray_ID = 110200012,
maxPointCount = 8,
@ -30,11 +30,11 @@ local Triggers_AnimalSeelie = {
function LF_Initialize_Group(triggers, suites)
for i=1, #Triggers_AnimalSeelie do
table.insert(triggers, Triggers_AnimalSeelie[i])
table.insert(triggers, Triggers_AnimalSeelie[i])
end
--非flow
if (init_config.io_type ~= 1) then
for i = 1, #suites do
for i = 1, #suites do
for k,v in pairs(Triggers_AnimalSeelie) do
table.insert(suites[i].triggers, v.name)
end
@ -52,7 +52,7 @@ function LF_Initialize_Group(triggers, suites)
table.insert(variables,{ config_id = 50000002, name = "cur_point_index", value = 0, no_refresh = true })
table.insert(variables,{ config_id = 50000003, name = "next_index", value = 1, no_refresh = true })
for i = 1, #suite_disk do
for i = 1, #suite_disk do
for k,v in pairs(Triggers_AnimalSeelie) do
table.insert(suite_disk[i].triggers, v.name)
end
@ -83,7 +83,7 @@ function LF_GetNextPath(context)
local path = {}
--当前在pointArray的第几个点
--当前在pointArray的第几个点
local cur_point = ScriptLib.GetGroupVariableValue(context, "cur_point_index")
--范围检查 cur_point是否不在table内,则设为初始点
if false == LF_CheckIsInTable(context, cur_point, defs.pointInfo) then
@ -106,14 +106,14 @@ function LF_GetNextPath(context)
ScriptLib.PrintContextLog(context, "## [AnimalSeelie] LF_GetNextPath: path index overflow!")
--设为当前点位
table.insert(path, defs.pointInfo[#defs.pointInfo])
else
stop_point = defs.pointInfo[next_index]
--从起步点(当前点+1开始到下次停的点为止存为一个table
--如果由于LD手动修改stop_point小于起步点则将该点直接设为目标点没有过程点
if cur_point >= stop_point then
if cur_point >= stop_point then
table.insert(path, stop_point)
else
for i = cur_point + 1, stop_point do
@ -141,24 +141,24 @@ function action_Platform_Reach(context, evt)
return -1
end
ScriptLib.PrintContextLog(context, "## [AnimalSeelie] Platform_Reach: param2@"..evt.param2.." param3@"..evt.param3)
--是否到达终点
if evt.param3 == defs.maxPointCount then
--埋点
ScriptLib.MarkGroupLuaAction(context, "AnimalSeelieEnd", "", {["group_id"] = base_info.group_id, ["config_id"] = 0})
ScriptLib.MarkGroupLuaAction(context, "AnimalSeelieEnd", "", {["group_id"] = base_info.group_id, ["config_id"] = 0})
ScriptLib.SetGroupVariableValue(context, "isFinished", 1)
ScriptLib.KillEntityByConfigId(context, { config_id = defs.gadget_animal })
ScriptLib.StopPlatform(context, defs.gadget_animal)
--创生奖励
if nil ~= defs.gadget_Reward and 0 ~= defs.gadget_Reward then
ScriptLib.CreateGadget(context, { config_id = defs.gadget_Reward })
end
if nil ~= defs.addSuite_Info and 0 ~= defs.addSuite_Info then
if nil ~= defs.gadget_Reward and 0 ~= defs.gadget_Reward then
ScriptLib.CreateGadget(context, { config_id = defs.gadget_Reward })
end
if nil ~= defs.addSuite_Info and 0 ~= defs.addSuite_Info then
ScriptLib.SetFlowSuite(context, base_info.group_id, defs.addSuite_Info)
end
end
return 0
end
--是否需要停下
--是否需要停下
local next = ScriptLib.GetGroupVariableValue(context, "next_index")
if evt.param3 == defs.pointInfo[next] then
ScriptLib.StopPlatform(context, defs.gadget_animal)
@ -166,7 +166,7 @@ function action_Platform_Reach(context, evt)
ScriptLib.SetGroupVariableValue(context, "cur_point_index", evt.param3)
ScriptLib.SetGroupVariableValue(context, "next_index", next)
end
return 0
end
@ -182,15 +182,15 @@ function action_Avatar_Near_Platform(context, evt)
--903底座状态,kill 结束
local state = ScriptLib.GetGadgetStateByConfigId(context, base_info.group_id, defs.gadget_animal)
if state == 903 then
if state == 903 then
ScriptLib.KillEntityByConfigId(context, { config_id = defs.gadget_animal })
return 0
end
if 1 == ScriptLib.GetGroupVariableValue(context, "isFinished") then
if 1 == ScriptLib.GetGroupVariableValue(context, "isFinished") then
return 0
end
if nil ~= defs.animal_state then
if nil ~= defs.animal_state then
LF_SetAnimaState(context)
end
--埋点
@ -206,7 +206,7 @@ end
function LF_SetAnimaState(context)
local next = ScriptLib.GetGroupVariableValue(context, "next_index")
--范围修正
if next > #defs.animal_state then
if next > #defs.animal_state then
next = #defs.animal_state
ScriptLib.SetGroupVariableValue(context, "next_index", next)
ScriptLib.PrintContextLog(context, "## [AnimalSeelie] LF_SetAnimaState: next_index overflow!. Set to@"..next)
@ -225,4 +225,4 @@ function LF_CheckIsInTable(context, value, check_table)
return false
end
LF_Initialize_Group(triggers, suites)
LF_Initialize_Group(triggers, suites)

View File

@ -1,5 +1,5 @@
--[[
defs = {
local defs = {
--开启操作台configID
starter_gadget = ,
--终点Region的ConfigID
@ -14,8 +14,8 @@ defs = {
--计数定义。
--这个赛道中每种行为写入哪个param
--行为1-持续加速20秒 2-障碍破坏 3-(未定义)
counter =
{
counter =
{
["param1"] = 2,
["param2"] = 0,
["param3"] = 0,
@ -23,13 +23,13 @@ defs = {
father_challenge = ID,
child_time_challenge =
child_time_challenge =
{
{challenge_id = 1ID, aim = },
{challenge_id = 2ID, aim = },
},
child_count_challenge =
child_count_challenge =
{
{challenge_id = 1ID, aim = },
},
@ -98,7 +98,7 @@ end
--机关开启条件及开启处理
function action_Select_Option(context, evt)
if defs.starter_gadget ~= evt.param1 or cfg.start_option ~= evt.param2 then
return 0
return 0
end
--检查玩家处于开船状态
if 2 ~= ScriptLib.GetPlayerVehicleType(context,context.uid) then
@ -131,21 +131,21 @@ function action_Select_Option(context, evt)
ScriptLib.StartFatherChallenge(context, cfg.challenge_id)
--填加计时类子挑战
for k,v in pairs(defs.child_time_challenge) do
for k,v in pairs(defs.child_time_challenge) do
ScriptLib.AttachChildChallenge(context, cfg.challenge_id, v.challenge_id*10 + k, v.challenge_id, { v.aim, 4, 666, 1},{},{success = 10,fail = 0})
end
--填加计数类子挑战
for k,v in pairs(defs.child_count_challenge) do
for k,v in pairs(defs.child_count_challenge) do
--参数1 event_type所在枚举序号 参数2 trigger_tag参数3 次数参数4Bool次数达成是否计为成功参数5初始次数值
ScriptLib.AttachChildChallenge(context, cfg.challenge_id, v.challenge_id*10 + k, v.challenge_id, { 3, k, v.aim},{},{success = 0,fail = 0})
ScriptLib.AttachChildChallenge(context, cfg.challenge_id, v.challenge_id*10 + k, v.challenge_id, { 3, k, v.aim},{},{success = 0,fail = 0})
ScriptLib.PrintContextLog(context, "## [BoatRaceV2] Challenge started. start galleryID@"..defs.gallery_id.." father_challengeID@"..cfg.challenge_id)
end
--不限时抵达终点隐藏挑战
ScriptLib.AttachChildChallenge(context, cfg.challenge_id, cfg.child_end, cfg.child_end, { 4, 666, 1, 1},{},{success = 10,fail = 0})
--处理操作台
ScriptLib.SetGadgetStateByConfigId(context, defs.starter_gadget, GadgetState.GearStart)
ScriptLib.DelWorktopOptionByGroupId(context, base_info.group_id, defs.starter_gadget, cfg.start_option)
ScriptLib.SetGadgetStateByConfigId(context, defs.starter_gadget, GadgetState.GearStart)
ScriptLib.DelWorktopOptionByGroupId(context, base_info.group_id, defs.starter_gadget, cfg.start_option)
--开Gallery
ScriptLib.StartGallery(context, defs.gallery_id)
@ -168,10 +168,10 @@ end
function action_Enter_Tutorial_Region(context, evt)
if nil == defs.guide_region then
return 0
return 0
end
if evt.param1 ~= defs.guide_region then
return 0
return 0
end
LF_TryShowGuide(context)
return 0
@ -180,7 +180,7 @@ end
-- 处理成功
function action_Challenge_Success(context, evt)
ScriptLib.PrintContextLog(context, "## [BoatRaceV2] Challenge success.")
ScriptLib.PrintContextLog(context, "## [BoatRaceV2] Challenge success.")
if evt.param1 ~= cfg.challenge_id then
return 0
end
@ -188,13 +188,13 @@ function action_Challenge_Success(context, evt)
LF_ReportSkillExhibition(context, uid)
local time = cfg.total_time - evt.param2
if time > 0 then
if time > 0 then
ScriptLib.UpdatePlayerGalleryScore(context, defs.gallery_id, { ["time"]= time, ["uid"] = uid })
else
ScriptLib.UpdatePlayerGalleryScore(context, defs.gallery_id, { ["time"]= 0, ["uid"] = uid })
ScriptLib.PrintContextLog(context, "## [BoatRaceV2] #WARN# Get unexpected time usage.")
end
ScriptLib.RefreshGroup(context, { group_id = base_info.group_id, suite = 1 })
--设置操作台选项
@ -216,7 +216,7 @@ function action_Challenge_Fail(context, evt)
local uid = ScriptLib.GetSceneOwnerUid(context)
local time = cfg.total_time - evt.param2
if time > 0 then
if time > 0 then
ScriptLib.UpdatePlayerGalleryScore(context, defs.gallery_id, { ["time"]= time, ["uid"] = uid })
else
ScriptLib.UpdatePlayerGalleryScore(context, defs.gallery_id, { ["time"]= 0, ["uid"] = uid })
@ -251,7 +251,7 @@ end
-- 进入最终区域
function condition_Enter_Final_Region(context, evt)
-- 判断角色数量不少于1
if evt.param1 ~= defs.end_region then
if evt.param1 ~= defs.end_region then
return false
end
if ScriptLib.GetRegionEntityCount(context, { region_eid = evt.source_eid, entity_type = EntityType.AVATAR }) < 1 then
@ -275,7 +275,7 @@ function action_Group_Will_Unload( context,evt )
end
function action_Leave_Play_Region(context, evt)
if defs.play_region ~= evt.param1 then
if defs.play_region ~= evt.param1 then
return 0
end
ScriptLib.PrintContextLog(context, "## [BoatRaceV2] Player leave play region.")
@ -288,7 +288,7 @@ function LF_ReportSkillExhibition(context, uid)
for i, v in ipairs(cfg.exhiKey_all[base_info.group_id]) do
local record = ScriptLib.GetGroupTempValue(context, "exhi_counter_"..i, {})
ScriptLib.PrintContextLog(context, "## [BoatRaceV2] LF_ReportSkillExhibition. exhi_counter_"..i.. "record@"..record)
if 0 < record then
if 0 < record then
ScriptLib.AddExhibitionReplaceableData(context, uid, v, record)
end
end
@ -296,7 +296,7 @@ function LF_ReportSkillExhibition(context, uid)
end
function LF_GetGalleryParamName(context, type)
for k,v in pairs(defs.counter) do
for k,v in pairs(defs.counter) do
if v == type then
return k
end
@ -311,38 +311,38 @@ function SLC_BoatRaceV2_Counter(context, type)
--确认是要加本赛道gallery的哪个param
local gallery_param = LF_GetGalleryParamName(context, type)
if 0 == gallery_param then
if 0 == gallery_param then
return 0
end
--如果是物件破坏,看是否在计数白名单内
if 2 == type then
if 2 == type then
if nil ~= defs.gadget_filter then
local config_id = ScriptLib.GetGadgetConfigId(context, { gadget_eid = context.source_entity_id })
local gadget_id = gadgets[config_id].gadget_id
if LF_CheckIsInTable(context, gadget_id, defs.gadget_filter) then
if LF_CheckIsInTable(context, gadget_id, defs.gadget_filter) then
ScriptLib.PrintContextLog(context, "## [BoatRaceV2] SLC_BoatRaceV2_Counter. Count gadget. config_id@"..config_id.." gadget_id@"..gadget_id)
else
return 0
end
end
end
--update gallery
if 0 ~= gallery_param then
ScriptLib.UpdatePlayerGalleryScore(context, defs.gallery_id, { [gallery_param]= 1 , ["uid"] = ScriptLib.GetSceneOwnerUid(context)})
ScriptLib.PrintContextLog(context, "## [BoatRaceV2] Update gallery. param@"..gallery_param)
end
end
--设置陈列室缓存、触发挑战计数
if "param1" == gallery_param then
if "param1" == gallery_param then
ScriptLib.ChangeGroupTempValue(context, "exhi_counter_1", 1, {})
ScriptLib.ChangeGroupVariableValue(context, "counter_1", 1)
elseif "param2" == gallery_param then
elseif "param2" == gallery_param then
ScriptLib.ChangeGroupTempValue(context, "exhi_counter_2", 1, {})
ScriptLib.ChangeGroupVariableValue(context, "counter_2", 1)
elseif "param3" == gallery_param then
elseif "param3" == gallery_param then
ScriptLib.ChangeGroupTempValue(context, "exhi_counter_3", 1, {})
ScriptLib.ChangeGroupVariableValue(context, "counter_3", 1)
end
@ -350,14 +350,14 @@ function SLC_BoatRaceV2_Counter(context, type)
end
--进入隐藏赛道的计数
function action_Enter_Hiden_Region(context, evt)
if nil == defs.hiden_region then
if nil == defs.hiden_region then
return 0
end
--是否是指定region
if LF_CheckIsInTable(context, evt.param1, defs.hiden_region) then
--看看计入哪个param
--看看计入哪个param
local gallery_param = 0
for k,v in pairs(defs.counter) do
for k,v in pairs(defs.counter) do
if v == 3 then
gallery_param = k
end
@ -367,15 +367,15 @@ function action_Enter_Hiden_Region(context, evt)
if 0 ~= gallery_param then
ScriptLib.UpdatePlayerGalleryScore(context, defs.gallery_id, { [gallery_param]= 1 })
ScriptLib.PrintContextLog(context, "## [BoatRaceV2] Updata gallery. param@"..gallery_param)
end
end
--设置陈列室缓存、触发挑战计数
if "param1" == gallery_param then
if "param1" == gallery_param then
ScriptLib.ChangeGroupTempValue(context, "exhi_counter_1", 1, {})
ScriptLib.ChangeGroupVariableValue(context, "counter_1", 1)
elseif "param2" == gallery_param then
elseif "param2" == gallery_param then
ScriptLib.ChangeGroupTempValue(context, "exhi_counter_2", 1, {})
ScriptLib.ChangeGroupVariableValue(context, "counter_2", 1)
elseif "param3" == gallery_param then
elseif "param3" == gallery_param then
ScriptLib.ChangeGroupTempValue(context, "exhi_counter_3", 1, {})
ScriptLib.ChangeGroupVariableValue(context, "counter_3", 1)
end
@ -383,8 +383,8 @@ function action_Enter_Hiden_Region(context, evt)
ScriptLib.RemoveEntityByConfigId(context, 0, EntityType.REGION, evt.param1)
else
return 0
end
end
return 0
end
--[[
@ -402,23 +402,23 @@ function LF_TryShowGuide(context)
--Activity_SummerTimeV2_BoatRace_Guide3
local havePlayed3 = ScriptLib.GetExhibitionAccumulableData(context, context.uid, 11405110)
if 0 < havePlayed3 then
if 0 < havePlayed3 then
return 0
end
--如果弹过第一关
if 0 < havePlayed1 then
--第二关1175
if 199004061 == base_info.group_id and 1 > havePlayed2 then
if 199004061 == base_info.group_id and 1 > havePlayed2 then
ScriptLib.ShowClientTutorial(context, 1175, {context.uid})
ScriptLib.AddExhibitionAccumulableData(context,context.uid, "Activity_SummerTimeV2_BoatRace_Guide2", 1)
else
--第二关以外其他关不弹
end
--如果没弹过第一关
--如果没弹过第一关
else
--第一关 1174
if 199003065 == base_info.group_id then
if 199003065 == base_info.group_id then
ScriptLib.ShowClientTutorial(context, 1174, {context.uid})
ScriptLib.AddExhibitionAccumulableData(context,context.uid, "Activity_SummerTimeV2_BoatRace_Guide1", 1)
else
@ -428,15 +428,15 @@ function LF_TryShowGuide(context)
ScriptLib.AddExhibitionAccumulableData(context,context.uid, "Activity_SummerTimeV2_BoatRace_Guide3", 1)
end
end
end
end
return 0
end
--船行为埋点
function SLC_BoatRace_LuaMark(context, param1, param2, param3)
ScriptLib.MarkGroupLuaAction(context, "SummerTimeV2_Boat_1", "", {["change_type"] = param1, ["change_num"] = param2, ["after_num"] = param3})
ScriptLib.MarkGroupLuaAction(context, "SummerTimeV2_Boat_1", "", {["change_type"] = param1, ["change_num"] = param2, ["after_num"] = param3})
return 0
end

View File

@ -5,12 +5,12 @@
|| owner: weiwei.sun
|| description: 2.8
|| LogName: ## [CloudPlatform]
|| Protection:
|| Protection:
=======================================]]
--[[
defs = {
stages =
local defs = {
stages =
{
--key为第几段value1为这一段的起点suitevalue2为这一段的主体suite
--这些suite里不要放台子以外的gadget, 不要有InitSuite
@ -33,7 +33,7 @@ local Triggers = {
{ config_id = 8000001, name = "Tile_State_Change", event = EventType.EVENT_GADGET_STATE_CHANGE, source = "", condition = "", action = "action_Tile_State_Change", trigger_count = 0 },
{ config_id = 8000002, name = "FallDown_Leave_Region", event = EventType.EVENT_LEAVE_REGION, source = "", condition = "", action = "action_FallDown_Leave_Region", trigger_count = 0, forbid_guest = false},
{ config_id = 8000003, name = "Group_Load", event = EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_Group_Load", trigger_count = 0 },
}
function LF_Initialize_Group(triggers, suites)
@ -81,9 +81,9 @@ function action_Tile_State_Change(context, evt)
--ScriptLib.RemoveExtraGroupSuite(context, base_info.group_id, defs.stages[stage_index - 1][1])
--ScriptLib.RemoveExtraGroupSuite(context, base_info.group_id, defs.stages[stage_index - 1][2])
--迭代为Kill
LF_KillSuiteGadgets(context, defs.stages[stage_index - 1][1])
LF_KillSuiteGadgets(context, defs.stages[stage_index - 1][2])
LF_KillSuiteGadgets(context, defs.stages[stage_index - 1][1])
LF_KillSuiteGadgets(context, defs.stages[stage_index - 1][2])
elseif 1 == stage_index then
ScriptLib.AddExtraGroupSuite(context, base_info.group_id, defs.region_suite)
@ -96,13 +96,13 @@ function action_Tile_State_Change(context, evt)
if LF_CheckStageSuccess(context, stage_index) then
if LF_CheckIsFinalStage(context) then
if LF_CheckIsFinalStage(context) then
ScriptLib.GoToGroupSuite(context, base_info.group_id, defs.end_suite)
LF_UnLoadAntiDivingBoard(context)
--埋点
ScriptLib.MarkGroupLuaAction(context, "CloudPlatform", "", {["group_id"] = base_info.group_id, ["result"] = 1})
ScriptLib.MarkGroupLuaAction(context, "CloudPlatform", "", {["group_id"] = base_info.group_id, ["result"] = 1})
else
--当前主体格全部锁定
@ -131,9 +131,9 @@ function LF_Check_AllPlayer_OutRegion(context, region_id)
ScriptLib.PrintContextLog(context, "## [CloudPlatform] Count player in region: regionID@"..region_id.. " playerCount@".. count)
if count < 1 then
if count < 1 then
return true
end
end
return false
end
@ -160,7 +160,7 @@ function LF_CheckStageSuccess(context, stage_index)
--检查当前阶段的主体suite内gadgetstate是否均为201
local tile_gadget_table = suites[defs.stages[stage_index][2]].gadgets
for k,v in pairs(tile_gadget_table) do
if 201 ~= ScriptLib.GetGadgetStateByConfigId(context, base_info.group_id, v) then
if 201 ~= ScriptLib.GetGadgetStateByConfigId(context, base_info.group_id, v) then
ScriptLib.PrintContextLog(context, "## [CloudPlatform] LF_CheckStageSuccess return false. gadget@"..v)
return false
end
@ -176,7 +176,7 @@ function LF_CheckIsFinalStage(context)
ScriptLib.PrintContextLog(context, "## [CloudPlatform] LF_CheckIsFinalStage. stage_index@"..stage_index.." total stages@"..#defs.stages)
if stage_index >= #defs.stages then
if stage_index >= #defs.stages then
return true
end
@ -185,9 +185,9 @@ end
function action_FallDown_Leave_Region(context, evt)
ScriptLib.PrintContextLog(context, "## [CloudPlatform] Player falled down. uid@"..evt.uid)
if LF_Check_AllPlayer_OutRegion(context, evt.param1) then
if LF_Check_AllPlayer_OutRegion(context, evt.param1) then
--埋点
ScriptLib.MarkGroupLuaAction(context, "CloudPlatform", "", {["group_id"] = base_info.group_id, ["result"] = 2})
ScriptLib.MarkGroupLuaAction(context, "CloudPlatform", "", {["group_id"] = base_info.group_id, ["result"] = 2})
ScriptLib.RefreshGroup(context, { group_id = 0, suite = 1 })
ScriptLib.SetGroupTempValue(context,"stage_index", 1, {})
@ -209,11 +209,11 @@ function LF_CheckIsInTable(context, value, check_table)
end
function LF_UnLoadAntiDivingBoard(context)
if nil ~= defs.board_id then
if nil ~= defs.board_id then
ScriptLib.KillEntityByConfigId(context, { config_id = defs.board_id })
end
if nil ~= defs.board_id_list then
for k,v in pairs(defs.board_id_list) do
if nil ~= defs.board_id_list then
for k,v in pairs(defs.board_id_list) do
ScriptLib.KillEntityByConfigId(context, { config_id = v })
end
end
@ -221,11 +221,11 @@ function LF_UnLoadAntiDivingBoard(context)
end
function LF_LoadAntiDivingBoard(context)
if nil ~= defs.board_id then
if nil ~= defs.board_id then
ScriptLib.CreateGadget(context, { config_id = defs.board_id })
end
if nil ~= defs.board_id_list then
for k,v in pairs(defs.board_id_list) do
if nil ~= defs.board_id_list then
for k,v in pairs(defs.board_id_list) do
ScriptLib.CreateGadget(context, { config_id = v })
end
end
@ -242,4 +242,4 @@ function LF_TryShowGuide(context)
end
return 0
end
LF_Initialize_Group(triggers, suites)
LF_Initialize_Group(triggers, suites)

View File

@ -4,10 +4,10 @@
|| owner: weiwei.sun
|| description: DreamLand大活动角色地城通用Buff控制器 Group上
|| LogName: ## [DLDungeon]
|| Protection:
|| Protection:
=======================================]]
--[[
defs = {
local defs = {
--是否教学关
is_tutorial = 1,
--起始操作台
@ -32,7 +32,7 @@ defs = {
--随机固定顺序怪物潮组合 每次进地城随机取key。
--key对应value代表依序出现的MonsterTide小花括号内配置复数个表示同时刷出。
rand_table = {
[1] =
[1] =
{
{1,2},
{3},
@ -69,7 +69,7 @@ local cfg = {
--持续刷buff时间隔时间
buff_interval = 30,
exhiKey_succ =
exhiKey_succ =
{
[1] = {"Activity_SummerTimeV2_Kazuha_Succ", "Activity_SummerTimeV2_Kazuha_SuccOnce"},
[2] = {"Activity_SummerTimeV2_Xinyan_Succ", "Activity_SummerTimeV2_Xinyan_SuccOnce"},
@ -91,23 +91,23 @@ local cfg = {
exhiKey_all_replace = {
--万叶
[1] = {
"Activity_SummerTimeV2_Kazuha_TotalBuff", --2.8大活动地城-万叶-单局拾取Buff总数
"Activity_SummerTimeV2_Kazuha_TSkillOnce", --2.8大活动地城-万叶-单局使用T键技能数
"Activity_SummerTimeV2_Kazuha_TotalBuff", --2.8大活动地城-万叶-单局拾取Buff总数
"Activity_SummerTimeV2_Kazuha_TSkillOnce", --2.8大活动地城-万叶-单局使用T键技能数
},
--辛焱
[2] = {
"Activity_SummerTimeV2_Xinyan_GadgetUsage",--2.8大活动地城-辛焱-单局交互传音花次数
"Activity_SummerTimeV2_Xinyan_EnbreakOnce",--2.8大活动地城-辛焱-单局传音花碎盾次数
"Activity_SummerTimeV2_Xinyan_GadgetUsage",--2.8大活动地城-辛焱-单局交互传音花次数
"Activity_SummerTimeV2_Xinyan_EnbreakOnce",--2.8大活动地城-辛焱-单局传音花碎盾次数
"Activity_SummerTimeV2_Xinyan_FallAttackOnce",--2.8大活动地城-辛焱-单局下落冲击波击中次数
},
--菲谢尔
[3] = {
"Activity_SummerTimeV2_Fischl_BuffOnce",--2.8大活动地城-菲谢尔-单局获得奥兹buff次数
"Activity_SummerTimeV2_Fischl_ElecShockOnce",--2.8大活动地城-菲谢尔-单局雷冲击波击中次数
"Activity_SummerTimeV2_Fischl_ElecShockOnce",--2.8大活动地城-菲谢尔-单局雷冲击波击中次数
},
--莫娜
[4] = {
"Activity_SummerTimeV2_Mona_PushOnce",--2.8大活动地城-莫娜-单局撞怪数
"Activity_SummerTimeV2_Mona_PushOnce",--2.8大活动地城-莫娜-单局撞怪数
"Activity_SummerTimeV2_Mona_BuffOnce",--2.8大活动地城-莫娜-单局获得星座buff次数
}
},
@ -128,7 +128,7 @@ local extra_Triggers = {
{ config_id = 8000006, name = "MonaBuff2_TimeAxis_Pass", event = EventType.EVENT_TIME_AXIS_PASS, source = "mona_buff2", condition = "", action = "action_MonaBuff2_TimeAxis_Pass", trigger_count = 0},
{ config_id = 8000007, name = "WindField_GadgetCreate", event = EventType.EVENT_GADGET_CREATE, source = "", condition = "", action = "action_WindField_GadgetCreate", trigger_count = 0},
{ config_id = 8000008, name = "WindField_GadgetDie", event = EventType.EVENT_ANY_GADGET_DIE, source = "", condition = "", action = "action_WindField_GadgetDie", trigger_count = 0},
{ config_id = 8000009, name = "Group_Load", event = EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_Group_Load", trigger_count = 0},
{ config_id = 8000010, name = "Select_Option", event = EventType.EVENT_SELECT_OPTION, source = "", condition = "", action = "action_Select_Option", trigger_count = 0},
@ -151,7 +151,7 @@ end
function action_Group_Load(context, evt)
--莫娜、辛焱地城add随机suite
if 2 == defs.type or 4 == defs.type then
if 2 == defs.type or 4 == defs.type then
LF_AddRandomSuite(context)
end
return 0
@ -162,7 +162,7 @@ function action_Select_Option(context, evt)
if evt.param1 ~= defs.starter then
return 0
end
if nil ~= defs.option_id then
if nil ~= defs.option_id then
ScriptLib.DelWorktopOptionByGroupId(context, base_info.group_id, defs.starter, defs.option_id)
end
@ -174,19 +174,19 @@ function action_Select_Option(context, evt)
if nil == defs.is_tutorial then
LF_ClearReplacableExhibition(context)
if 2 == defs.type then
if 2 == defs.type then
LF_Init_XinyanWatcherCounter(context)
end
end
ScriptLib.SetGroupTempValue(context, "wave", 1, {})
LF_StartMonsterTide(context, 1)
--辛焱 风场计数
if 2 == defs.type then
ScriptLib.SetGroupTempValue(context, "xinyan_wind", 0,{})
ScriptLib.SetGroupTempValue(context, "xinyan_wind", 0,{})
end
--ability SGVchange触发器
--ability SGVchange触发器
ScriptLib.SetGroupTempValue(context, "sgv_changer", 1, {})
return 0
end
@ -227,7 +227,7 @@ function LF_InitChallenge(context)
--计算怪物数量
local tide_queue = defs.rand_table[rand_index]
local sum = 0
for k,v in pairs(tide_queue) do
for k,v in pairs(tide_queue) do
for ik, iv in pairs(v) do
sum = sum + #defs.tide_cfg[iv].monsters
end
@ -239,13 +239,13 @@ end
function action_Dungeon_All_Avatar_Die(context, evt)
local uid_list = ScriptLib.GetSceneUidList(context)
local uid_list = ScriptLib.GetSceneUidList(context)
for k,v in pairs(uid_list) do
local is_all_dead = ScriptLib.IsPlayerAllAvatarDie(context, v)
if false == is_all_dead then
return 0
end
end
end
ScriptLib.SetGroupTempValue(context, "is_all_dead", 1, {})
ScriptLib.CauseDungeonFail(context)
ScriptLib.StopChallenge(context, defs.challenge_id, 0)
@ -265,13 +265,13 @@ function LF_ClearAllMonsterTide(context)
end
--正常值 clear指定的怪物潮
for k,v in pairs(defs.rand_table[rand_index][wave]) do
for k,v in pairs(defs.rand_table[rand_index][wave]) do
--怪物潮索引
local tide_index = wave*1000 + v
local tide_index = wave*1000 + v
ScriptLib.PrintContextLog(context, "## [DLDungeon] Clear monster tide. tide_cfg@"..v.." tide_index@"..tide_index)
ScriptLib.KillMonsterTide(context, base_info.group_id, tide_index)
end
return 0
return 0
end
--开启一个波次的怪物潮
@ -279,9 +279,9 @@ end
function LF_StartMonsterTide(context, wave)
--万叶、菲谢尔刷buff
if 1 == defs.type or 3 == defs.type then
if 1 == defs.type or 3 == defs.type then
ScriptLib.EndTimeAxis(context, "routine_buff")
ScriptLib.EndTimeAxis(context, "routine_buff")
LF_ClearBuffGadget(context)
LF_CreateRandomBuff(context, defs.buff_count)
@ -290,19 +290,19 @@ function LF_StartMonsterTide(context, wave)
ScriptLib.PrintContextLog(context, "## [DLDungeon] Buff_TimeAxis_Pass. Start routine buff time axis.")
end
--莫娜亮石板
if 4 == defs.type then
if 4 == defs.type then
LF_ActiveMonaStar(context)
end
local rand_index = ScriptLib.GetGroupVariableValue(context, "rand_index")
--越界修正
--rand_index异常直接取1
if rand_index > #defs.rand_table then
if rand_index > #defs.rand_table then
rand_index = 1
ScriptLib.SetGroupVariableValue(context, "rand_index", rand_index)
end
--波次异常直接停止 以免无限循环
if wave > #defs.rand_table[rand_index] then
if wave > #defs.rand_table[rand_index] then
return 0
end
--本轮有几个并行怪物潮
@ -314,12 +314,12 @@ function LF_StartMonsterTide(context, wave)
ScriptLib.SetGroupTempValue(context, "tide_num", tide_num, {})
--启动并行怪物潮
for k,v in pairs(defs.rand_table[rand_index][wave]) do
for k,v in pairs(defs.rand_table[rand_index][wave]) do
--设置怪物潮索引
local tide_index = wave*1000 + v
local tide_index = wave*1000 + v
ScriptLib.PrintContextLog(context, "## [DLDungeon] Start monster tide. tide_cfg@"..v.." tide_index@"..tide_index)
--创建怪物潮
ScriptLib.AutoMonsterTide(context, tide_index, base_info.group_id, defs.tide_cfg[v].monsters, #defs.tide_cfg[v].monsters, defs.tide_cfg[v].min, defs.tide_cfg[v].max)
ScriptLib.AutoMonsterTide(context, tide_index, base_info.group_id, defs.tide_cfg[v].monsters, #defs.tide_cfg[v].monsters, defs.tide_cfg[v].min, defs.tide_cfg[v].max)
end
--波次++
@ -327,13 +327,13 @@ function LF_StartMonsterTide(context, wave)
--辛焱reminder 如果本次中有 tide_cfg 3、4、5、6 则ShowHintReminder
if 2 == defs.type and 1 ~= defs.is_tutorial then
for k,v in pairs(defs.rand_table[rand_index][wave]) do
for k,v in pairs(defs.rand_table[rand_index][wave]) do
if 3 == v or 4 == v or 5 == v or 6 == v then
LF_ShowHintReminder(context)
return 0
end
end
end
end
return 0
end
@ -349,7 +349,7 @@ function action_Monster_Tide_Die(context, evt)
ScriptLib.StopChallenge(context, defs.challenge_id, 0)
return 0
end
if evt.param1 < #defs.tide_cfg[tide_cfg_index].monsters then
if evt.param1 < #defs.tide_cfg[tide_cfg_index].monsters then
return 0
end
@ -358,7 +358,7 @@ function action_Monster_Tide_Die(context, evt)
--检查本轮怪物潮都已经结束
local tide_num = ScriptLib.GetGroupTempValue(context, "tide_num", {})
ScriptLib.PrintContextLog(context, "## [DLDungeon]: Tide index ".. tide_index.." all monster die. remain_tide_num@".. tide_num)
if 0 >= tide_num then
if 0 >= tide_num then
local rand_index = ScriptLib.GetGroupVariableValue(context, "rand_index")
if wave > #defs.rand_table[rand_index] then
--全部完成
@ -374,9 +374,9 @@ function action_Monster_Tide_Die(context, evt)
end
function action_Challenge_Success(context, evt)
if defs.challenge_id ~= evt.param1 then
if defs.challenge_id ~= evt.param1 then
return 0
end
end
------清理-------
--莫娜石板清除
if 4 == defs.type then
@ -386,10 +386,10 @@ function action_Challenge_Success(context, evt)
--万叶、菲谢尔清理场上Buff
if 1 == defs.type or 3 == defs.type then
--停止所有时间轴
ScriptLib.EndTimeAxis(context, "routine_buff")
ScriptLib.EndTimeAxis(context, "routine_buff")
LF_ClearBuffGadget(context)
end
if nil ~= defs.is_tutorial then
if nil ~= defs.is_tutorial then
return 0
end
------陈列室-------
@ -404,7 +404,7 @@ function action_Challenge_Success(context, evt)
end
function action_Challenge_Fail(context, evt)
if defs.challenge_id ~= evt.param1 then
if defs.challenge_id ~= evt.param1 then
return 0
end
------清理-------
@ -419,21 +419,21 @@ function action_Challenge_Fail(context, evt)
--万叶、菲谢尔清理场上Buff
if 1 == defs.type or 3 == defs.type then
--停止所有时间轴
ScriptLib.EndTimeAxis(context, "routine_buff")
ScriptLib.EndTimeAxis(context, "routine_buff")
LF_ClearBuffGadget(context)
end
ScriptLib.RefreshGroup(context, { group_id = base_info.group_id, suite = init_config.suite })
--莫娜、辛焱地城add随机suite
if 2 == defs.type or 4 == defs.type then
if 2 == defs.type or 4 == defs.type then
LF_AddRandomSuite(context)
end
-- 设置操作台选项
ScriptLib.SetWorktopOptionsByGroupId(context, base_info.group_id, defs.starter, { defs.option_id })
--教学关不DungeonFail
if nil ~= defs.is_tutorial then
if nil ~= defs.is_tutorial then
return 0
end
@ -443,7 +443,7 @@ function action_Challenge_Fail(context, evt)
end
return 0
end
end
function LF_AddRandomSuite(context)
@ -473,14 +473,14 @@ function LF_CreateRandomBuff(context, count)
local spawn_queue = {table.unpack(defs.buff_pool)}
--需求先刷0~2个限定buff(无、A、B、A+B)其余部分刷普通buff。不需要再对buff种类做随机了
if nil ~= defs.buff_pool_spec and 2 <= #defs.buff_pool_spec then
if nil ~= defs.buff_pool_spec and 2 <= #defs.buff_pool_spec then
math.randomseed(ScriptLib.GetServerTime(context))
local spec_num = math.random(0, 3)
--数量确定,只枚举情况不洗牌了
if 3 == spec_num then
table.insert(spawn_queue, 1, defs.buff_pool_spec[1])
table.insert(spawn_queue, 2, defs.buff_pool_spec[2])
elseif 1 == spec_num or 2 == spec_num then
elseif 1 == spec_num or 2 == spec_num then
table.insert(spawn_queue, 1, defs.buff_pool_spec[spec_num])
end
end
@ -490,7 +490,7 @@ function LF_CreateRandomBuff(context, count)
local point_list = LF_Get_RandomPointList(context)
for i = 1, count do
--获取生成点位
local point_configID = point_list[i]
local point_configID = point_list[i]
ScriptLib.PrintContextLog(context, "## [DLDungeon] To Create gadget. gadget@"..spawn_queue[i].." at Point@"..point_configID)
ScriptLib.CreateGadgetByConfigIdByPos(context, spawn_queue[i], gadgets[point_configID].pos, gadgets[point_configID].rot)
end
@ -521,20 +521,20 @@ function action_WindField_GadgetCreate(context, evt)
return 0
end
ScriptLib.PrintContextLog(context, "## [DLDungeon] WindField_GadgetCreate. evt.param1@"..evt.param1)
if 70220118 ~= gadgets[evt.param1].gadget_id then
if 70220118 ~= gadgets[evt.param1].gadget_id then
return 0
end
end
ScriptLib.ChangeGroupTempValue(context, "xinyan_wind", 1, {})
LF_SetGV_AllTeam(context, "GV_XINYAN_BUFF", 1)
return 0
end
--辛焱 风场创建
function action_WindField_GadgetDie(context, evt)
if 70220118 ~= gadgets[evt.param1].gadget_id then
if 70220118 ~= gadgets[evt.param1].gadget_id then
return 0
end
end
ScriptLib.ChangeGroupTempValue(context, "xinyan_wind", -1, {})
if 0 >= ScriptLib.GetGroupTempValue(context, "xinyan_wind", {}) then
if 0 >= ScriptLib.GetGroupTempValue(context, "xinyan_wind", {}) then
LF_SetGV_AllTeam(context, "GV_XINYAN_BUFF", 0)
end
return 0
@ -565,7 +565,7 @@ function LF_ActiveMonaStar(context)
for k,v in pairs(gadgets) do
if v.gadget_id == 70310323 and k ~= star_list[star_idx][2] then
ScriptLib.SetGadgetStateByConfigId(context, k, 202)
end
end
end
LF_ShowHintReminder(context)
return 0
@ -584,7 +584,7 @@ function LF_CloseMonaStar(context)
end
--莫娜 石板被踩
function SLC_DLActivityDungeon_StarBtn(context)
if 1 ~= ScriptLib.GetGroupTempValue(context, "mona_btn", {}) then
if 1 ~= ScriptLib.GetGroupTempValue(context, "mona_btn", {}) then
return 0
end
--施加buff
@ -602,7 +602,7 @@ function LF_ActiveMonaBuff(context)
local monster_tide_idx = ScriptLib.GetGroupTempValue(context, "mona_buff_idx", {})
local buff_list = defs.tide_cfg[monster_tide_idx].mona_buffs
if nil == buff_list then
if nil == buff_list then
return 0
end
math.randomseed(ScriptLib.GetServerTime(context))
@ -610,10 +610,10 @@ function LF_ActiveMonaBuff(context)
local buff_idx = math.random(#buff_list)
ScriptLib.PrintContextLog(context, "## [DLDungeon] LF_ActiveMonaBuff. buff@"..buff_list[buff_idx])
--开启弹飞buff
if 1 == buff_list[buff_idx] then
if 1 == buff_list[buff_idx] then
LF_SetGV_AllTeam(context, "GV_MONA_BUFF1", 1)
--下雨、增伤buff
elseif 2 == buff_list[buff_idx] then
elseif 2 == buff_list[buff_idx] then
LF_SetGV_AllTeam(context, "GV_MONA_BUFF2", 1)
LF_HandleMonaWater(context, 1)
--全场控怪
@ -622,7 +622,7 @@ function LF_ActiveMonaBuff(context)
LF_SetGV_AllTeam(context, "GV_MONA_BUFF3", 1)
end
--埋点
ScriptLib.MarkGroupLuaAction(context, "SummerTimeV2_Dungeon4_1", "", {["bufftype"] = buff_list[buff_idx]})
ScriptLib.MarkGroupLuaAction(context, "SummerTimeV2_Dungeon4_1", "", {["bufftype"] = buff_list[buff_idx]})
return 0
end
@ -651,7 +651,7 @@ end
--param1: 1-球A大跳 2-球B减T键CD 3-球C增伤至最多三层
function SLC_DLActivityDungeon_Kazuha(context, param1)
ScriptLib.PrintContextLog(context, "## [DLDungeon] SLC_DLActivityDungeon_Kazuha. param1@"..param1.." uid@"..context.uid)
if 1 == param1 then
if 1 == param1 then
LF_SetGV_AllTeam(context, "GV_KAZUHA_BUFF1", 1)
elseif 2 == param1 then
LF_SetGV_AllTeam(context,"GV_KAZUHA_BUFF2", 1)
@ -663,14 +663,14 @@ function SLC_DLActivityDungeon_Kazuha(context, param1)
end
ScriptLib.AddExhibitionReplaceableData(context, context.uid, "Activity_SummerTimeV2_Kazuha_TotalBuff", 1)
--埋点
ScriptLib.MarkGroupLuaAction(context, "SummerTimeV2_Dungeon1_2", "", {["bufftype"] = param1})
ScriptLib.MarkGroupLuaAction(context, "SummerTimeV2_Dungeon1_2", "", {["bufftype"] = param1})
return 0
end
--万叶地城减CD触发
--param1: 0-元素战技 1-元素爆发 2-下落攻击
function SLC_DLActivityDungeon_TCoolDown(context, param1)
ScriptLib.PrintContextLog(context, "## [DLDungeon] SLC_DLActivityDungeon_TCoolDown. param1@"..param1)
if 1 == param1 then
if 1 == param1 then
LF_TriggerSGVChangeAllTeam(context, "GV_SKILL_CD")
elseif 2 == param1 then
LF_TriggerSGVChangeAllTeam(context, "GV_ULTIMATESKILL_CD")
@ -685,7 +685,7 @@ end
--param1: 1-雷震荡波 2-奥兹 3-刷大招
function SLC_DLActivityDungeon_Fischl(context, param1)
ScriptLib.PrintContextLog(context, "## [DLDungeon] SLC_DLActivityDungeon_Fischl. param1@"..param1.." uid@"..context.uid)
if 1 == param1 then
if 1 == param1 then
LF_SetGV_OnePlayer(context, "GV_CREATE_ELECTRICZONE", 1)
LF_Exhibition_FischlBuff(context)
elseif 2 == param1 then
@ -695,7 +695,7 @@ function SLC_DLActivityDungeon_Fischl(context, param1)
LF_Exhibition_FischlBuff(context)
end
--埋点
ScriptLib.MarkGroupLuaAction(context, "SummerTimeV2_Dungeon3_1", "", {["bufftype"] = param1})
ScriptLib.MarkGroupLuaAction(context, "SummerTimeV2_Dungeon3_1", "", {["bufftype"] = param1})
return 0
end
--招奥兹需要冲物件SLC所以陈列室另起一个SLC
@ -704,14 +704,14 @@ function SLC_DLActivityDungeon_FischlOzSummon(context)
local pos_raw = ScriptLib.GetPosByEntityId(context, context.source_entity_id)
position.x = pos_raw.x - pos_raw.x % 0.01
position.y = pos_raw.y - pos_raw.y % 0.01
position.z = pos_raw.z - pos_raw.z % 0.01
if nil ~= defs.crow_id then
position.z = pos_raw.z - pos_raw.z % 0.01
if nil ~= defs.crow_id then
for k , v in pairs(defs.crow_id) do
local ret = ScriptLib.CreateGadgetByConfigIdByPos(context, v, position, gadgets[v].rot)
if 0 == ret then
break
end
end
end
end
return 0
end
@ -723,27 +723,27 @@ function LF_HandleMonaWater(context, dir)
return 0
end
function LF_TriggerSGVChangeAllTeam(context, key)
function LF_TriggerSGVChangeAllTeam(context, key)
local value = ScriptLib.GetGroupTempValue(context, "sgv_changer", {})
local uid_list = ScriptLib.GetSceneUidList(context)
local uid_list = ScriptLib.GetSceneUidList(context)
ScriptLib.SetTeamEntityGlobalFloatValue(context, uid_list, key, value)
ScriptLib.PrintContextLog(context, "## [DLDungeon] LF_TriggerSGVChangeAllTeam. key@"..key.." value@"..value)
if value > 1000 then
ScriptLib.SetGroupTempValue(context, "sgv_changer", 0, {})
else
ScriptLib.ChangeGroupTempValue(context, "sgv_changer", 1, {})
end
end
return 0
end
function LF_SetGV_AllMonster(context, key, value)
local mon_list = ScriptLib.GetGroupAliveMonsterList(context, base_info.group_id)
ScriptLib.AddEntityGlobalFloatValueByConfigId(context, mon_list, key, value)
local mon_list = ScriptLib.GetGroupAliveMonsterList(context, base_info.group_id)
ScriptLib.AddEntityGlobalFloatValueByConfigId(context, mon_list, key, value)
ScriptLib.PrintContextLog(context, "## [DLDungeon] LF_SetGV_AllMonster. key@"..key.." value@"..value)
return 0
end
function LF_SetGV_AllTeam(context, key, value)
local uid_list = ScriptLib.GetSceneUidList(context)
local uid_list = ScriptLib.GetSceneUidList(context)
ScriptLib.SetTeamEntityGlobalFloatValue(context, uid_list, key, value)
ScriptLib.PrintContextLog(context, "## [DLDungeon] LF_SetGV_AllTeam. key@"..key.." value@"..value)
return 0
@ -755,10 +755,10 @@ function LF_SetGV_OnePlayer(context, key, value)
return 0
end
function LF_SetSGV_AllTeam(context, key, value)
local uid_list = ScriptLib.GetSceneUidList(context)
for k,v in pairs(uid_list) do
local uid_list = ScriptLib.GetSceneUidList(context)
for k,v in pairs(uid_list) do
ScriptLib.SetTeamServerGlobalValue(context, v, key, value)
end
end
ScriptLib.PrintContextLog(context, "## [DLDungeon] LF_SetSGV_AllTeam. key@"..key.." value@"..value)
return 0
end
@ -768,7 +768,7 @@ function LF_ReportSkillExhibition(context)
local uid_list = ScriptLib.GetSceneUidList(context)
for k, v in pairs(cfg.exhiKey_all) do
local record = ScriptLib.GetGroupTempValue(context, v, {})
if 0 < record then
if 0 < record then
for ik,iv in pairs(uid_list) do
ScriptLib.AddExhibitionAccumulableData(context, iv, v, record)
end
@ -778,7 +778,7 @@ function LF_ReportSkillExhibition(context)
end
--陈列室 通用 全体 通关次数
function LF_Exhibition_Succ(context)
if nil ~= defs.is_tutorial then
if nil ~= defs.is_tutorial then
return 0
end
local uid_list = ScriptLib.GetSceneUidList(context)
@ -790,17 +790,17 @@ function LF_Exhibition_Succ(context)
end
--重置陈列室缓存值
function LF_InitExhibitionTemp(context)
if nil ~= defs.is_tutorial then
if nil ~= defs.is_tutorial then
return 0
end
for k, v in pairs(cfg.exhiKey_all) do
for k, v in pairs(cfg.exhiKey_all) do
ScriptLib.SetGroupTempValue(context, v, 0, {})
end
return 0
end
--陈列室 万叶 单人 单局减CD触发次数
function LF_Exhibition_CoolDown(context, uid)
if nil ~= defs.is_tutorial or 1 ~= defs.type then
if nil ~= defs.is_tutorial or 1 ~= defs.type then
return 0
end
@ -809,7 +809,7 @@ function LF_Exhibition_CoolDown(context, uid)
end
--缓存陈列室 万叶 T键次数
function SLC_DLActivityDungeon_Exhi_TSkill(context)
if nil ~= defs.is_tutorial or 1 ~= defs.type then
if nil ~= defs.is_tutorial or 1 ~= defs.type then
return 0
end
--全体
@ -817,12 +817,12 @@ function SLC_DLActivityDungeon_Exhi_TSkill(context)
--单人
ScriptLib.AddExhibitionReplaceableData(context, context.uid, "Activity_SummerTimeV2_Kazuha_TSkillOnce", 1)
--埋点
ScriptLib.MarkGroupLuaAction(context, "SummerTimeV2_Dungeon1_1", "", {})
ScriptLib.MarkGroupLuaAction(context, "SummerTimeV2_Dungeon1_1", "", {})
return 0
end
--缓存陈列室 莫娜 撞怪击中次数
function SLC_DLActivityDungeon_Exhi_MonaPush(context)
if nil ~= defs.is_tutorial or 4 ~= defs.type then
if nil ~= defs.is_tutorial or 4 ~= defs.type then
return 0
end
--全体
@ -834,7 +834,7 @@ end
--缓存陈列室 菲谢尔 全体 冲击波击中次数
function SLC_DLActivityDungeon_Exhi_FischlElecShock(context)
if nil ~= defs.is_tutorial or 3 ~= defs.type then
if nil ~= defs.is_tutorial or 3 ~= defs.type then
return 0
end
--全体
@ -845,7 +845,7 @@ function SLC_DLActivityDungeon_Exhi_FischlElecShock(context)
end
--缓存陈列室 菲谢尔 获得奥兹buff次数
function LF_Exhibition_FischlBuff(context)
if nil ~= defs.is_tutorial or 3 ~= defs.type then
if nil ~= defs.is_tutorial or 3 ~= defs.type then
return 0
end
--全体
@ -858,7 +858,7 @@ end
--缓存陈列室 莫娜 全体 获得星星buff次数
function LF_DLActivityDungeon_Exhi_MonaBuff(context)
if nil ~= defs.is_tutorial or 4 ~= defs.type then
if nil ~= defs.is_tutorial or 4 ~= defs.type then
return 0
end
--全体
@ -870,24 +870,24 @@ end
--缓存陈列室 辛焱 全体 交互传音花次数
--param1: 1-风场 2-声波
function SLC_DLActivityDungeon_Exhi_GadgetUsage(context, param1)
if nil ~= defs.is_tutorial or 2 ~= defs.type then
if nil ~= defs.is_tutorial or 2 ~= defs.type then
return 0
end
--单人
ScriptLib.AddExhibitionReplaceableData(context, context.uid, "Activity_SummerTimeV2_Xinyan_GadgetUsage", 1)
--埋点
if 1 == param1 then
ScriptLib.MarkGroupLuaAction(context, "SummerTimeV2_Dungeon2_1", "", {})
ScriptLib.MarkGroupLuaAction(context, "SummerTimeV2_Dungeon2_1", "", {})
elseif 2 == param1 then
ScriptLib.MarkGroupLuaAction(context, "SummerTimeV2_Dungeon2_2", "", {})
ScriptLib.MarkGroupLuaAction(context, "SummerTimeV2_Dungeon2_2", "", {})
end
return 0
end
--缓存陈列室 辛焱 全体 花冲击波击中盾怪次数
function SLC_DLActivityDungeon_Exhi_XinyanEnbreak(context)
if nil ~= defs.is_tutorial or 2 ~= defs.type then
if nil ~= defs.is_tutorial or 2 ~= defs.type then
return 0
end
end
--全体
ScriptLib.ChangeGroupTempValue(context, "Activity_SummerTimeV2_Xinyan_Enbreak", 1, {})
--单人
@ -896,13 +896,13 @@ function SLC_DLActivityDungeon_Exhi_XinyanEnbreak(context)
end
--缓存陈列室 辛焱 全体 下落攻击击中次数
function SLC_DLActivityDungeon_Exhi_XinyanFallAttack(context)
if nil ~= defs.is_tutorial or 2 ~= defs.type then
if nil ~= defs.is_tutorial or 2 ~= defs.type then
return 0
end
--单人跨局累计wathcer
ScriptLib.ChangeGroupTempValue(context, tostring(context.uid), 1, {})
--单人单局
--单人单局
ScriptLib.AddExhibitionReplaceableData(context, context.uid, "Activity_SummerTimeV2_Xinyan_FallAttackOnce", 1)
return 0
end
@ -926,4 +926,4 @@ function LF_Report_XinyanWatcherCounter(context)
end
return 0
end
LF_Initialize(triggers, suites)
LF_Initialize(triggers, suites)

View File

@ -2,12 +2,12 @@
--[[======================================
|| filename: DrawOneLine_Dreamland
|| owner: weiwei.sun
|| description:
|| description:
|| LogName: ## [DrawOneLine]
|| Protection:
|| Protection:
=======================================]]
--[[
defs =
local defs =
{
--玩法完成时 这个gadget如果为GearStop则会被设为Default
finish_gadget = ,
@ -16,7 +16,7 @@ defs =
--终点格configid
ender = ,
--矩阵 用于踩格子时判断是否相邻
matrix =
matrix =
{
{0,0,0,0,0},
@ -35,16 +35,16 @@ defs =
[1] = 903configID1,
},
--移动格的目标位置和使用的点阵
movable_pos =
movable_pos =
{--[移动格子configID] = new_pos: 两位数字的矩阵坐标x是十位y是个位
[10011] = { new_pos = 12},
[10011] = { new_pos = 12},
},
lines=
{
[] = 线,
},
}
}
]]
local cfg = {
--玩法中,最多存在多少石板
@ -55,7 +55,7 @@ local cfg = {
local extraTriggers={
{ config_id = 8000001, name = "Group_Load", event = EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_Group_Load", trigger_count = 0 },
{ config_id = 8000002,name = "Leave_Region", event = EventType.EVENT_LEAVE_REGION, source = "", condition = "", action = "action_Leave_Region", trigger_count = 0 },
{ config_id = 8000003, name = "Reach_Point", event = EventType.EVENT_PLATFORM_REACH_POINT, source = "", condition = "", action = "action_Reach_Point", trigger_count = 0 },
@ -77,16 +77,16 @@ function SLC_DrawOneLine_Start(context)
local config_id = ScriptLib.GetGadgetConfigId(context, { gadget_eid = context.source_entity_id })
--SLC来源没有配置为起点 return
if config_id ~= defs.starter then
return 0
return 0
end
local state = ScriptLib.GetGroupTempValue(context, "puzzle_state", {})
ScriptLib.PrintContextLog(context, "## [DrawOneLine] Get SLC_DrawOneLine_Start. state@"..state)
if 0 == state then
if 0 == state then
ScriptLib.SetGadgetStateByConfigId(context, config_id, 201)
LF_SetCurTileIndex(context, config_id)
LF_InitMatrix(context)
elseif 1 == state then
LF_InitMatrix(context)
elseif 1 == state then
ScriptLib.SetGadgetStateByConfigId(context, config_id, 201)
LF_SetCurTileIndex(context, config_id)
LF_RestartMatrix(context)
@ -102,17 +102,17 @@ function SLC_DrawOneLine_Reset(context)
local config_id = ScriptLib.GetGadgetConfigId(context, { gadget_eid = context.source_entity_id })
--SLC来源没有配置为起点 return
if config_id ~= defs.starter then
return 0
return 0
end
local state = ScriptLib.GetGroupTempValue(context, "puzzle_state", {})
ScriptLib.PrintContextLog(context, "## [DrawOneLine] Get SLC_DrawOneLine_Reset. state@"..state)
if 1 ~= state then
if 1 ~= state then
return 0
end
--如果已经离开了起点 则重置
local cur_tile = ScriptLib.GetGroupTempValue(context, "cur_tile", {})
local x = math.floor(cur_tile/10)
local y = cur_tile%10
local y = cur_tile%10
if defs.matrix[x][y] ~= config_id then
LF_SetCurTileIndex(context, config_id)
LF_RestartMatrix(context)
@ -134,7 +134,7 @@ function action_Group_Load(context, evt)
LF_SetStarterTile(context, 0)
return 0
return 0
end
function action_Group_Refresh(context, evt)
@ -161,14 +161,14 @@ function action_Leave_Region(context, evt)
if evt.param1 == defs.guide_region then
return 0
end
if 1 == ScriptLib.GetGroupTempValue(context, "puzzle_state", {}) then
if 1 == ScriptLib.GetGroupTempValue(context, "puzzle_state", {}) then
LF_FailProgress(context, 2)
end
return 0
end
function action_Enter_Guide_Region(context, evt)
if evt.param1 ~= defs.guide_region then
if evt.param1 ~= defs.guide_region then
return 0
end
LF_TryShowGuide(context)
@ -176,8 +176,8 @@ function action_Enter_Guide_Region(context, evt)
end
function SLC_DrawOneLine_Fail(context)
if 1 == ScriptLib.GetGroupTempValue(context, "puzzle_state", {}) then
if 1 == ScriptLib.GetGroupTempValue(context, "puzzle_state", {}) then
local config_id = ScriptLib.GetGadgetConfigId(context, { gadget_eid = context.source_entity_id })
ScriptLib.PrintContextLog(context, "## [DrawOneLine] SLC_DrawOneLine_Fail. config_id@"..config_id)
--检查是否是当前格
@ -189,8 +189,8 @@ function SLC_DrawOneLine_Fail(context)
LF_SetStarterTile(context, 1)
else
LF_FailProgress(context, 0)
end
end
end
end
end
return 0
@ -207,15 +207,15 @@ function SLC_DrawOneLine_LightOn(context, param1)
ScriptLib.PrintContextLog(context, "## [DrawOneLine] SLC_DrawOneLine_LightOn. config_id@"..config_id.." cur_tile@"..cur_tile.. " is_adjust@"..is_adjust)
if 2 == is_adjust then
return 0
end
end
--是否是起点格
if config_id == defs.starter then
ScriptLib.SetGadgetStateByConfigId(context, config_id, 201)
LF_SetCurTileIndex(context, config_id)
LF_InitMatrix(context)
else
if 1 == ScriptLib.GetGroupTempValue(context, "is_fail", {}) then
LF_InitMatrix(context)
else
if 1 == ScriptLib.GetGroupTempValue(context, "is_fail", {}) then
return 0
end
--检测是否相邻
@ -253,7 +253,7 @@ function SLC_DrawOneLine_CheckSuccess(context)
local ret = LF_CheckSuccess(context)
ScriptLib.PrintContextLog(context, "## [DrawOneLine] SLC_DrawOneLine_CheckSuccess called. ret@"..ret)
if 1 == ret then
LF_SuccessProgress(context)
LF_SuccessProgress(context)
else
LF_FailProgress(context, 1)
end
@ -263,9 +263,9 @@ end
function LF_HandleMoveTile(context, config_id)
ScriptLib.PrintContextLog(context, "## [DrawOneLine] LF_HandleMoveTile called. config_id@".. config_id)
--移除线
if nil ~= defs.lines then
if nil ~= defs.lines then
ScriptLib.RemoveEntityByConfigId(context, 0, EntityType.GADGET, defs.lines[config_id])
end
end
--route
local ret = ScriptLib.StartPlatform(context, config_id)
if -1 == ret then
@ -293,7 +293,7 @@ function LF_CreateTileByMatchCfg(context, config_id)
ScriptLib.SetGadgetStateByConfigId(context, defs.reveal_match[config_id], 0)
--再移除离散格
ScriptLib.KillEntityByConfigId(context, { config_id = config_id })
return 0
end
--处理还原格 逆向操作
@ -302,7 +302,7 @@ function LF_RemoveTileByMatchCfg(context, config_id)
ScriptLib.SetGadgetStateByConfigId(context, defs.reveal_match[config_id], 903)
--再添加离散格
ScriptLib.CreateGadget(context, { config_id = config_id })
return 0
end
@ -325,7 +325,7 @@ function LF_FailProgress(context, reason)
--其他格子如果未处于隐藏态切GearStop
elseif 0 ~= iv then
if 903 ~= ScriptLib.GetGadgetStateByConfigId(context, base_info.group_id, iv) then
ScriptLib.SetGadgetStateByConfigId(context, iv, 202)
ScriptLib.SetGadgetStateByConfigId(context, iv, 202)
end
end
end
@ -370,8 +370,8 @@ end
function LF_CheckSuccess(context)
for k, v in pairs(defs.matrix) do
for ik, iv in pairs(v) do
if 0 ~= iv and 201 ~= ScriptLib.GetGadgetStateByConfigId(context, base_info.group_id, iv) and 0 ~= iv then
for ik, iv in pairs(v) do
if 0 ~= iv and 201 ~= ScriptLib.GetGadgetStateByConfigId(context, base_info.group_id, iv) and 0 ~= iv then
ScriptLib.PrintContextLog(context, "## [DrawOneLine] LF_CheckSuccess ret 0. Found blank tile@"..iv)
return 0
end
@ -385,7 +385,7 @@ end
--type 0-常规加载 1-处理重置,然后加载
function LF_SetStarterTile(context, type)
if type == 0 then
if type == 0 then
ScriptLib.CreateGadget(context, { config_id = defs.starter })
else
LF_KillAllGadget(context)
@ -393,7 +393,7 @@ function LF_SetStarterTile(context, type)
if 1 == ScriptLib.GetGroupTempValue(context, "puzzle_state", {}) then
ScriptLib.SetGroupTempValue(context, "puzzle_state", 0, {})
end
ScriptLib.CreateGadget(context, { config_id = defs.starter })
end
@ -417,7 +417,7 @@ function LF_RestartMatrix(context)
for ik, iv in pairs(v) do
LF_ResetTile(context, iv)
end
end
end
--处理矩阵外
for k, v in pairs(defs.reveal_tiles) do
for ik, iv in pairs(v) do
@ -448,8 +448,8 @@ function LF_ResetTile(context, config_id)
end
else
--处理普通格(非起点 非初始隐藏格)
if defs.starter ~= config_id and 0 ~= config_id and gadgets[config_id].state ~= GadgetState.Action03 then
ScriptLib.SetGadgetStateByConfigId(context, config_id, 0)
if defs.starter ~= config_id and 0 ~= config_id and gadgets[config_id].state ~= GadgetState.Action03 then
ScriptLib.SetGadgetStateByConfigId(context, config_id, 0)
end
end
@ -459,10 +459,10 @@ end
--设置当前在哪个方块
function LF_SetCurTileIndex(context, config_id)
for i=1,#defs.matrix do
for j=1,#defs.matrix[i] do
for j=1,#defs.matrix[i] do
if defs.matrix[i][j] == config_id then
ScriptLib.SetGroupTempValue(context, "cur_tile", i*10 + j, {})
end
end
end
end
return 0
@ -508,7 +508,7 @@ function LF_CheckTwoGadgetIsAdjacent(context, current_idx, config_step_in)
--右侧
if defs.matrix[x+1][y] == config_step_in then
local new_idx = (x+1)*10+y
ScriptLib.SetGroupTempValue(context, "cur_tile", new_idx, {})
ScriptLib.SetGroupTempValue(context, "cur_tile", new_idx, {})
return 1
end
end
@ -531,12 +531,12 @@ function LF_CheckGadgetCount(context)
local sum = 0
for k, v in pairs(defs.matrix) do
for ik, iv in pairs(v) do
if iv ~= 0 then
if iv ~= 0 then
sum = sum + 1
end
end
end
if sum > cfg.tile_limit then
if sum > cfg.tile_limit then
ScriptLib.PrintContextLog(context, "## [DrawOneLine] #WARN# Gadget over use! Tell LD.")
return 1
end
@ -554,4 +554,4 @@ function LF_TryShowGuide(context)
return 0
end
LF_Initialize_Group(triggers, suites)
LF_Initialize_Group(triggers, suites)

View File

@ -5,11 +5,11 @@
|| owner: weiwei.sun
|| description: 2.8
|| LogName: ## [DreamOperation]
|| Protection:
|| Protection:
=======================================]]
--[[
defs = {
local defs = {
--每个操作台config_id, 控制的markfalg和它的解最多5位数字。
--玩家按按钮左转写2 右转写3。
--例如“左左右左”即为“{2,2,3,2}”
@ -17,7 +17,7 @@ defs = {
[config_id1] = { markflag = 1, key = {2,2,3,2},
[config_id2] = { markflag = 2, key = {2,2,3,2},
}
}
]]
@ -57,7 +57,7 @@ function SLC_DreamOperation_GetFlag(context)
ScriptLib.SetEntityServerGlobalValueByConfigId(context, config_id, "SGV_Control_Target", defs.answers[config_id].markflag)
ScriptLib.PrintContextLog(context, "## [DreamOperation] LF_InitGear. config_id@"..config_id.." markflag@"..defs.answers[config_id].markflag)
return 0
end
@ -116,12 +116,12 @@ function LF_HandleInput(context, config_id, param)
--继续
ScriptLib.SetGroupTempValue(context, "g_"..config_id, index, {})
end
return 0
end
function LF_CountTableNum(context, t)
local count = 0
local count = 0
for k,v in pairs(t) do
count = count + 1
end
@ -129,4 +129,4 @@ function LF_CountTableNum(context, t)
end
LF_Initialize_Group(triggers, suites)
LF_Initialize_Group(triggers, suites)

View File

@ -4,10 +4,10 @@
|| owner: weiwei.sun
|| description: 2.8
|| LogName: MonaPortal
|| Protection:
|| Protection:
=======================================]]--
--[[
defs = {
local defs = {
target_leveltag = 22,
pos = { x=-677.9, y=135, z=-16},
rot = {x=0, y=0, z=1},
@ -16,7 +16,7 @@ defs = {
]]
function SLC_MonaPortal_Start(context)
if true == ScriptLib.CheckIsInMpMode(context) then
if true == ScriptLib.CheckIsInMpMode(context) then
local cfg_id = ScriptLib.GetGadgetConfigId(context, { gadget_eid = context.source_entity_id })
ScriptLib.ShowReminderRadius(context, 321700501, gadgets[cfg_id].pos, 5)
return 0
@ -32,9 +32,9 @@ end
function SLC_MonaPortal_TryShowReminder(context)
local config_id = ScriptLib.GetGadgetConfigId(context, { gadget_eid = context.source_entity_id })
if 22 == defs.target_leveltag then
if 22 == defs.target_leveltag then
ScriptLib.ShowReminderRadius(context, 1111377, gadgets[config_id].pos, 5)
end
return 0
end
end

View File

@ -4,10 +4,10 @@
|| owner: weiwei.sun
|| description: 2.8
|| LogName: TimeReverser
|| Protection:
|| Protection:
=======================================]]--
--[[
defs = {
local defs = {
reverse_time = 10,--回溯倒计时,整数秒
}
]]
@ -30,13 +30,13 @@ function LF_Initialize_Group(triggers, suites)
end
function action_Group_Load(context, evt)
if 1 == ScriptLib.GetGroupVariableValue(context, "is_reverting") then
if 1 == ScriptLib.GetGroupVariableValue(context, "is_reverting") then
for k, v in pairs(gadgets) do
if nil ~= v.mark_flag then
if nil ~= v.mark_flag then
ScriptLib.SetGadgetStateByConfigId(context, v.config_id, 0)
end
end
end
end
ScriptLib.SetGroupVariableValue(context, "revert", 0)
ScriptLib.SetGroupVariableValue(context, "is_reverting", 0)
return 0
@ -47,7 +47,7 @@ function action_Device_Gadget_State_Change(context, evt)
if 70310390 ~= gadget_id then
return 0
end
if 0 ~= evt.param1 then
if 0 ~= evt.param1 then
return 0
end
ScriptLib.SetGroupVariableValue(context, "is_reverting", 0)
@ -55,26 +55,26 @@ function action_Device_Gadget_State_Change(context, evt)
end
function action_Gadget_State_Change(context, evt)
if nil == gadgets[evt.param2] then
if nil == gadgets[evt.param2] then
ScriptLib.PrintContextLog(context, "## [TimeReverser] Gadget_State_Change get unknown param2.")
return 0
end
if nil == gadgets[evt.param2].mark_flag then
if nil == gadgets[evt.param2].mark_flag then
return 0
end
if 201 ~= evt.param1 then
if 201 ~= evt.param1 then
return 0
end
--检查是否处于待回溯状态若不处于则尝试init回溯时间轴
if 1 ~= ScriptLib.GetGroupVariableValue(context, "is_reverting") then
if 1 ~= ScriptLib.GetGroupVariableValue(context, "is_reverting") then
LF_TryInitReverseTimeAxis(context)
end
return 0
end
function action_TimeAxis_Pass(context, evt)
function action_TimeAxis_Pass(context, evt)
for k, v in pairs(gadgets) do
if nil ~= v.mark_flag then
if nil ~= v.mark_flag then
ScriptLib.SetGadgetStateByConfigId(context, v.config_id, 0)
end
--其中回溯机关 做回溯表现
@ -93,7 +93,7 @@ function action_Revert_VariableChange(context, evt)
--检查是否处于待回溯状态若不处于则尝试init回溯时间轴
if 1 ~= ScriptLib.GetGroupVariableValue(context, "is_reverting") then
LF_TryInitReverseTimeAxis(context)
end
end
end
return 0
end
@ -116,7 +116,7 @@ function LF_TryInitReverseTimeAxis(context)
ScriptLib.SetGroupVariableValue(context, "is_reverting", 1)
ScriptLib.PrintContextLog(context, "## [TimeReverser] LF_TryInitReverseTimeAxis. InitTimeAxis.")
return 0
end
return 0
end
return 0
end
LF_Initialize_Group(triggers, suites)

View File

@ -9,7 +9,7 @@
--[[
defs =
local defs =
{
operator_id = 574048, --操作台的configid
option_id = 175, --操作台的option id
@ -17,10 +17,10 @@
gallery_id = 25001,
}
local monster_list =
local monster_list =
{
-- 第1波怪
[1] =
[1] =
{
-- 精英怪configID, 精英怪全部死亡就刷下一波
elite_monster = {574001,574002},
@ -59,7 +59,7 @@
tide_mons_score = 10,
},
}
--]]
@ -71,7 +71,7 @@ function PrintLog(context, content)
ScriptLib.PrintContextLog(context, log)
end
local extraTriggers =
local extraTriggers =
{
{ name = "tri_group_load", config_id = 40000001, event = EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_group_load", trigger_count = 0 },
{ name = "tri_select_option", config_id = 40000002, event = EventType.EVENT_SELECT_OPTION, source = "", condition = "", action = "action_select_option", trigger_count = 0},
@ -90,7 +90,7 @@ end
------ conditions & actions ------
-- 团灭
function action_dungeon_all_avatar_die(context,evt)
if 0 ~= ScriptLib.StopGallery(context, defs.gallery_id, true) then
if 0 ~= ScriptLib.StopGallery(context, defs.gallery_id, true) then
PrintLog(context, "Stop Gallery失败")
end
--LF_Stop_Play(context, false)
@ -99,7 +99,7 @@ end
-- 副本结算
function action_dungeon_settle(context,evt)
if 0 ~= ScriptLib.StopGallery(context, defs.gallery_id, true) then
if 0 ~= ScriptLib.StopGallery(context, defs.gallery_id, true) then
PrintLog(context, "Stop Gallery失败")
end
--LF_Stop_Play(context, false)
@ -130,7 +130,7 @@ function action_select_option(context,evt)
end
function action_monster_die_before_leave_scene(context, evt)
local current_wave = ScriptLib.GetGroupVariableValue(context, "current_wave")
local elites_tbl = monster_list[current_wave].elite_monster
@ -151,16 +151,16 @@ function action_monster_die_before_leave_scene(context, evt)
local left_elites = ScriptLib.GetGroupVariableValue(context, "left_elites")
left_elites = left_elites - 1
ScriptLib.SetGroupVariableValue(context, "left_elites", left_elites)
if left_elites <= 0 then
if left_elites <= 0 then
-- 关闭现有小怪复活的timer
LF_Cancel_Monster_Timers(context, current_wave)
end
else
else
-- SITUATION:普通小怪死亡
local left_elites = ScriptLib.GetGroupVariableValue(context, "left_elites")
if left_elites > 0 then
if left_elites > 0 then
-- X秒后复活
local delay_time = monster_list[current_wave].tide_mon_delay
ScriptLib.CreateGroupTimerEvent(context, base_info.group_id, tostring(monster_cid), delay_time)
@ -168,29 +168,29 @@ function action_monster_die_before_leave_scene(context, evt)
end
-- 如果场上无怪了
if ScriptLib.GetGroupMonsterCount(context) == 0 then
if ScriptLib.GetGroupMonsterCount(context) == 0 then
-- 刷下一波怪
local delay_time = monster_list[current_wave].next_delay
ScriptLib.CreateGroupTimerEvent(context, base_info.group_id, "NEXTWAVE", delay_time)
end
return 0
return 0
end
-- 计时器
function action_timer_event(context, evt)
local timer_name = evt.source_name
if timer_name == "NEXTWAVE" then
if timer_name == "NEXTWAVE" then
PrintLog(context, "计时器-刷下一波怪物")
ScriptLib.ShowReminder(context, defs.reminder_id)
local current_wave = ScriptLib.GetGroupVariableValue(context, "current_wave")
local next_wave = monster_list[current_wave].next
LF_Create_Monster_Wave(context, next_wave)
else
else
PrintLog(context, "计时器-小怪复活"..timer_name)
local monster_cid = tonumber(timer_name)
ScriptLib.CreateMonster(context, { config_id = monster_cid, delay_time = 0 })
ScriptLib.CreateMonster(context, { config_id = monster_cid, delay_time = 0 })
end
return 0
end
@ -204,12 +204,12 @@ function LF_Update_Score(context, is_elite, wave)
local score = 0
local energy = 0
if wave_info ~= nil then
if is_elite == 1 then
if wave_info ~= nil then
if is_elite == 1 then
PrintLog(context, "精英怪死亡")
score = wave_info.elite_monster_score or 0
energy = wave_info.elite_monster_energy or 0
else
else
PrintLog(context, "普通怪死亡")
score = wave_info.tide_mons_score or 0
energy = wave_info.tide_mons_energy or 0
@ -232,7 +232,7 @@ function LF_Create_Monster_Wave(context, wave)
-- 精英怪
local elites = monster_list[wave].elite_monster
for _, _configID in pairs(elites) do
ScriptLib.CreateMonster(context, { config_id = _configID, delay_time = 0 })
ScriptLib.CreateMonster(context, { config_id = _configID, delay_time = 0 })
end
local left_elites = #elites or 0
@ -243,16 +243,16 @@ function LF_Create_Monster_Wave(context, wave)
-- 普通怪
local monsters = monster_list[wave].tide_mons
for _, _configID in pairs(monsters) do
ScriptLib.CreateMonster(context, { config_id = _configID, delay_time = 0 })
ScriptLib.CreateMonster(context, { config_id = _configID, delay_time = 0 })
end
end
function LF_Cancel_Monster_Timers(context, wave)
local monsters = monster_list[wave].tide_mons
for _, _cid in pairs(monsters) do
if 0 ~= ScriptLib.CancelGroupTimerEvent(context, base_info.group_id, tostring(_cid)) then
if 0 ~= ScriptLib.CancelGroupTimerEvent(context, base_info.group_id, tostring(_cid)) then
PrintLog(context, "找不到Timer:".._cid)
else
else
PrintLog(context, "取消TIMER成功:".._cid)
end
end
@ -287,24 +287,24 @@ end
--终止玩法
function LF_Stop_Play(context, success)
if ScriptLib.GetGroupVariableValue(context, "level_stopped") == 1 then
if ScriptLib.GetGroupVariableValue(context, "level_stopped") == 1 then
return 0
end
ScriptLib.SetGroupVariableValue(context, "level_stopped", 1)
-- if 0 ~= ScriptLib.StopGallery(context, defs.gallery_id, true) then
-- if 0 ~= ScriptLib.StopGallery(context, defs.gallery_id, true) then
-- PrintLog(context, "Stop Gallery失败")
-- end
-- 关卡重置
ScriptLib.RefreshGroup(context, { group_id = base_info.group_id, suite = 1 })
ScriptLib.SetGadgetStateByConfigId(context, defs.operator_id, 202)
-- success比fail多了avatar复活逻辑。本次活动应该只会用到fail
if success == true then
if success == true then
ScriptLib.CauseDungeonSuccess(context)
else
else
ScriptLib.CauseDungeonFail(context)
end
end

View File

@ -7,7 +7,7 @@
=======================================]]
--[[
defs = {
local defs = {
gallery_id = ,
@ -42,7 +42,7 @@ local global =
total_coin_count = 0,
}
local triggers_start =
local triggers_start =
{
--测试用
--{ config_id = 8000000, name = "Test_GM", event = EventType.EVENT_VARIABLE_CHANGE, source = "testGM", condition = "", action = "", trigger_count = 0, tag = "100"},
@ -61,7 +61,7 @@ local triggers_start =
{ config_id = 40000008, name = "Enter_Tutorial_Region", event = EventType.EVENT_ENTER_REGION, source = "", condition = "", action = "action_enter_TutorialRegion", trigger_count = 0 },
}
local triggers_end =
local triggers_end =
{
--终点的trigger
{ config_id = 40000009, name = "Enter_Region", event = EventType.EVENT_ENTER_REGION, source = "", condition = "condition_enter_final", action = "", trigger_count = 0, tag = "666" },
@ -112,7 +112,7 @@ end
function LF_Calculate_Coin_Num()
local sum = 0
for _, gadgetInfo in pairs(gadgets) do
if gadgetInfo.gadget_id == 70220121 then
if gadgetInfo.gadget_id == 70220121 then
sum = sum + 1
end
end
@ -124,20 +124,20 @@ function LF_InitChallenge(context)
--挑战状态标记
ScriptLib.SetGroupTempValue(context, "challenge_state", 1, {})
-- 开父挑战再Attach保序
-- 开父挑战再Attach保序
ScriptLib.CreateFatherChallenge(context, 1, global.father_challengeID, defs.challenge_time, {success = 10, fail = 5})
if 0 == ScriptLib.StartFatherChallenge(context, 1) then
if 0 == ScriptLib.StartFatherChallenge(context, 1) then
--PrintLog(context, "开启父挑战成功")
else
else
PrintLog(context, "开启父挑战失败")
end
-- param tableparam1-event类型, param2-Tag, param3:次数, param4:达到次数是否success
-- 限时到达
if 0 ~= ScriptLib.AttachChildChallenge(context, 1, 101, 2010051, {4, 666, 1, 1}, {}, {success = 10, fail = 5}) then
-- 限时到达
if 0 ~= ScriptLib.AttachChildChallenge(context, 1, 101, 2010051, {4, 666, 1, 1}, {}, {success = 10, fail = 5}) then
PrintLog(context, "子挑战2010051添加失败")
end
-- 收集金币
if 0 ~= ScriptLib.AttachChildChallenge(context, 1, 102, 2010052, {3, 888, 999}, {}, {success = 0, fail = 0}) then
if 0 ~= ScriptLib.AttachChildChallenge(context, 1, 102, 2010052, {3, 888, 999}, {}, {success = 0, fail = 0}) then
PrintLog(context, "子挑战2010052添加失败")
end
@ -150,7 +150,7 @@ function LF_Try_StartTutorial(context)
if 0 ~= ScriptLib.AssignPlayerShowTemplateReminder(context,192,{param_uid_vec={},param_vec={},uid_vec={context.uid}}) then
PrintLog(context, "弹教程失败")
else
else
PrintLog(context, "弹教程成功")
end
@ -172,7 +172,7 @@ end
function LF_RevertVisionType(context)
local uidList = ScriptLib.GetSceneUidList(context)
for k, v in pairs(uidList) do
if 0 == ScriptLib.RevertPlayerRegionVision(context, v) then
if 0 == ScriptLib.RevertPlayerRegionVision(context, v) then
PrintLog(context, "Revert Vision成功"..v)
end
if 0 ~= ScriptLib.SetPlayerGroupVisionType(context, {v}, {1}) then
@ -184,7 +184,7 @@ end
function CameraAction(context)
if defs.look_pos and defs.duration then
if defs.look_pos and defs.duration then
--触发镜头注目,强制注目形式,不广播其他玩家
local pos_follow = {x=0, y=0, z=0}
@ -199,7 +199,7 @@ function CameraAction(context)
end
function LF_Reset_Level(context)
--重置变量
ScriptLib.SetGroupVariableValue(context, "coin_counter", 0)
ScriptLib.SetGroupTempValue(context, "challenge_state", 0, {})
@ -247,9 +247,9 @@ end
function action_enter_TutorialRegion(context, evt)
if defs.guide_regionID == nil then
if defs.guide_regionID == nil then
return 0
elseif evt.param1 == defs.guide_regionID then
elseif evt.param1 == defs.guide_regionID then
LF_Try_StartTutorial(context)
end
return 0
@ -258,14 +258,14 @@ end
function action_gadget_create(context, evt)
if defs.starter_gadget ~= evt.param1 then
return -1
return -1
end
-- 设置操作台选项
if 0 ~= ScriptLib.SetWorktopOptionsByGroupId(context, base_info.group_id, defs.starter_gadget, {175}) then
PrintLog(context, "设置操作台选项失败")
return -1
end
return 0
end
@ -282,7 +282,7 @@ end
function action_select_option(context, evt)
--检查SelectOption
if defs.starter_gadget ~= evt.param1 or 175 ~= evt.param2 then
return -1
return -1
end
--检查是否单机
if true == ScriptLib.CheckIsInMpMode(context) then
@ -293,7 +293,7 @@ function action_select_option(context, evt)
end
end
-- 400053:多人游戏状态下无法进行挑战
ScriptLib.ShowReminderRadius(context, 400053, center, 2)
ScriptLib.ShowReminderRadius(context, 400053, center, 2)
return -1
end
@ -301,13 +301,13 @@ function action_select_option(context, evt)
ScriptLib.SetGroupTempValue(context, "is_in_region", 0, {})
--切操作台状态
ScriptLib.SetGadgetStateByConfigId(context, defs.starter_gadget, GadgetState.GearStart)
ScriptLib.SetGadgetStateByConfigId(context, defs.starter_gadget, GadgetState.GearStart)
--去掉操作台SelectOption
ScriptLib.DelWorktopOptionByGroupId(context, base_info.group_id, defs.starter_gadget, 175)
ScriptLib.DelWorktopOptionByGroupId(context, base_info.group_id, defs.starter_gadget, 175)
--加载第一波suite
for k, v in pairs(defs.load_on_start) do
if 0 == ScriptLib.AddExtraGroupSuite(context, base_info.group_id, v) then
if 0 == ScriptLib.AddExtraGroupSuite(context, base_info.group_id, v) then
PrintLog(context, "加载suite"..v)
end
end
@ -318,16 +318,16 @@ function action_select_option(context, evt)
-- VISION TYPE
ScriptLib.SetPlayerGroupVisionType(context, {context.uid}, {0})
-- if base_info.group_id == 133008671 then
-- if base_info.group_id == 133008671 then
-- ScriptLib.SetPlayerGroupVisionType(context, {context.uid}, {0,3})
-- end
ScriptLib.ForbidPlayerRegionVision(context, context.uid)
LF_InitChallenge(context)
--开启Gallery
if 0 ~= ScriptLib.StartGallery(context, defs.gallery_id) then
if 0 ~= ScriptLib.StartGallery(context, defs.gallery_id) then
PrintLog(context, "开启Gallery失败")
else
PrintLog(context, "金币总数-"..global.total_coin_count)
@ -336,7 +336,7 @@ function action_select_option(context, evt)
end
end
--TODO:镜头注目
--TODO:镜头注目
CameraAction(context)
return 0
@ -367,13 +367,13 @@ function action_challenge_success(context,evt)
end
function action_challenge_fail(context, evt)
--param2 剩余时间
if evt.param2 <= 0 then
if evt.param2 <= 0 then
-- 超时
LF_FailChallenge(context, 1)
else
if ScriptLib.IsPlayerAllAvatarDie(context, context.owner_uid) then
if ScriptLib.IsPlayerAllAvatarDie(context, context.owner_uid) then
-- 团灭
PrintLog(context, "挑战失败-灭队")
LF_FailChallenge(context, 8)
@ -383,7 +383,7 @@ function action_challenge_fail(context, evt)
LF_FailChallenge(context, 2)
end
end
return 0
end
@ -417,16 +417,16 @@ function action_leave_OptimizRegion(context,evt)
--如果完全出圈了,触发挑战失败
local is_in_region = ScriptLib.GetGroupTempValue(context, "is_in_region", {})
if is_in_region <= 0 then
if is_in_region <= 0 then
LF_FailChallenge(context, 4)
end
end
end
return 0
end
--终点检查
function condition_enter_final(context, evt)
if evt.param1 ~= defs.end_regionID then
if evt.param1 ~= defs.end_regionID then
return false
end
return true
@ -443,4 +443,4 @@ end
LF_Initialize_Group(triggers, suites)
LF_Initialize_Group(triggers, suites)

View File

@ -9,11 +9,11 @@
-- @李鸿杰 还没布设相关GROUP
--[[
defs =
local defs =
{
-- Group对应的groupbundle
group_bundle_id = 0,
}
}
--]]
-- 打印日志
@ -22,13 +22,13 @@ function PrintLog(context, content)
ScriptLib.PrintContextLog(context, log)
end
local extraTriggers =
local extraTriggers =
{
--{ config_id = 40000001, name = "tri_group_load", event = EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_EVENT_GROUP_LOAD", trigger_count = 0 },
--{ config_id = 40000002, name = "tri_group_will_unload", event = EventType.EVENT_GROUP_WILL_UNLOAD, source = "", condition = "", action = "action_EVENT_GROUP_WILL_UNLOAD", trigger_count = 0 },
{ config_id = 40000003, name = "tri_monster_die", event = EventType.EVENT_ANY_MONSTER_DIE, source = "", condition = "", action = "action_EVENT_ANY_MONSTER_DIE", trigger_count = 0 },
--{ config_id = 40000004, name = "tri_enter_region", event = EventType.EVENT_ENTER_REGION, source = "", condition = "condition_EVENT_ENTER_REGION", action = "action_EVENT_ENTER_REGION", trigger_count = 0 },
{ config_id = 40000005, name = "tri_leave_region", event = EventType.EVENT_LEAVE_REGION, source = "", condition = "condition_EVENT_LEAVE_REGION", action = "action_EVENT_LEAVE_REGION", trigger_count = 0 },
{ config_id = 40000006, name = "force_refresh_group", event = EventType.EVENT_GRAVEN_PHOTO_REFRESH_GROUP, source = "", condition = "", action = "action_force_refresh_group", trigger_count = 0}
@ -51,7 +51,7 @@ function action_EVENT_ANY_MONSTER_DIE(context, evt)
-- @唐天鹏 小动物死亡/消失都会触发 event_any_monster_die
if ScriptLib.GetGroupMonsterCount(context) == 0 then
if ScriptLib.GetGroupMonsterCount(context) == 0 then
-- @唐天鹏 新增ScriptLib关闭当前groupbundle的mark并寻找其他的groupbundle显示mark
ScriptLib.InvaildGravenPhotoBundleMark(context, defs.group_bundle_id)
--if ScriptLib.IsInRegion(context, context.owner_uid, defs.play_region) then

View File

@ -7,7 +7,7 @@
=======================================]]
--[[
defs =
local defs =
{
-- 挑战编号
challenge_id = 2009009,
@ -24,11 +24,11 @@ defs =
-- 各玩法阶段配置
local play_stage =
{
[1] =
[1] =
{
gallery_id = 26001,
-- 挑战限时
challenge_time = 300,
challenge_time = 300,
-- 收集元素微粒数量
element_target = 3,
-- 探查点configID
@ -49,12 +49,12 @@ local play_stage =
treasure_suite = ,
},
[2] =
[2] =
{
},
[3] =
[3] =
{
}
@ -68,7 +68,7 @@ local extra_elements =
]]--
local extraTriggers =
local extraTriggers =
{
--测试用
--{ config_id = 41000001, name = "Gallery_Stop", event = EventType.EVENT_GALLERY_STOP, source = "", condition = "", action = "action_gallery_stop", trigger_count = 0 },
@ -92,9 +92,9 @@ local extraTriggers =
{ config_id = 40000008, name = "tri_enter_play_region", event = EventType.EVENT_ENTER_REGION, source = "", condition = "", action = "action_enter_region", forbid_guest = false, trigger_count = 0 },
{ config_id = 40000009, name = "tri_leave_play_region", event = EventType.EVENT_LEAVE_REGION, source = "", condition = "", action = "action_leave_region", forbid_guest = false, trigger_count = 0 },
--
--
{ config_id = 40000010, name = "tri_gadget_state_change", event = EventType.EVENT_GADGET_STATE_CHANGE, source = "", condition = "condition_gadget_state_change", action = "action_gadget_state_change", trigger_count = 0 },
{ config_id = 40000011, name = "tri_group_will_unload", event = EventType.EVENT_GROUP_WILL_UNLOAD, source = "", condition = "", action = "action_group_will_unload", trigger_count = 0 },
{ config_id = 40000012, name = "tri_monster_die", event = EventType.EVENT_MONSTER_DIE_BEFORE_LEAVE_SCENE, source = "", condition = "", action = "action_monster_die", trigger_count = 0 },
@ -130,7 +130,7 @@ function LF_Initialize_Group(triggers, suites)
table.insert(variables, { config_id = 50000004, name = "stage_progress1", value = 0, no_refresh = true})
table.insert(variables, { config_id = 50000005, name = "stage_progress2", value = 0, no_refresh = true})
table.insert(variables, { config_id = 50000006, name = "stage_progress3", value = 0, no_refresh = true})
-- 总进度
table.insert(variables, { config_id = 50000007, name = "stage_counter", value = 0, no_refresh = true})
@ -156,7 +156,7 @@ end
function LF_Reset_Level(context)
PrintLog(context, "LF_Reset_Level")
-- 修复区域完成后的仙灵BUG区域探索完成后不再重置
if ScriptLib.GetGroupVariableValue(context, "stage_counter") >= 3 then
if ScriptLib.GetGroupVariableValue(context, "stage_counter") >= 3 then
-- 通知小道具卸下
--ScriptLib.SetGroupVariableValue(context, "seelie_equipped", 0)
ScriptLib.SetTeamServerGlobalValue(context, context.owner_uid, "SGV_SeelieGameplayGroup", 0)
@ -199,8 +199,8 @@ end
function LF_Search_Point_Interacted(context, configID)
local stage = 1
for i = 1, #play_stage do
if play_stage[i].starter_operator_configID == configID then
for i = 1, #play_stage do
if play_stage[i].starter_operator_configID == configID then
stage = i
break
end
@ -221,22 +221,22 @@ function LF_Dig_Point_Interacted(context, configID)
if widget_equipped == nil then
widget_equipped = 0
end
if widget_equipped == 0 then
if widget_equipped == 0 then
--REMINDER "请先装备小道具"
ScriptLib.ShowReminder(context, 600132)
return
end
local stage = 1
for i = 1, #play_stage do
if play_stage[i].dig_operator_configID == configID then
for i = 1, #play_stage do
if play_stage[i].dig_operator_configID == configID then
stage = i
break
end
end
-- 存档
ScriptLib.SetGroupVariableValue(context, "stage_progress"..stage, 3)
ScriptLib.SetGroupVariableValue(context, "stage_progress"..stage, 3)
-- 隐藏挖掘点
-- 宝箱不开不隐藏mark,只隐藏效果 by siyu.li
@ -247,7 +247,7 @@ function LF_Dig_Point_Interacted(context, configID)
-- 加载宝箱suite
suite_index = play_stage[stage].treasure_suite
ScriptLib.AddExtraGroupSuite(context, base_info.group_id, suite_index)
-- 仙灵回身边
PrintLog(context, "仙灵回身边")
ScriptLib.SetGroupVariableValue(context, "seelie_out", 0)
@ -257,14 +257,14 @@ end
-- (根据小道具是否离体)控制【能量球】和【探查点】的显隐
function LF_Objects_Display(context, is_display)
if is_display == true then
if is_display == true then
-- 恢复能量球显示
LF_Show_Energy_Balls(context, true)
-- 恢复所有未完成的探查点
for i = 1, #play_stage do
for i = 1, #play_stage do
local progress = ScriptLib.GetGroupVariableValue(context, "stage_progress"..i)
if progress == 1 then
if progress == 1 then
LF_Show_Search_Point(context, i, true)
-- 如果宝箱未开启,则额外标记mark by siyu.li
elseif progress == 3 then
@ -273,10 +273,10 @@ function LF_Objects_Display(context, is_display)
end
PrintLog(context, "显示能量球&探查点")
else
else
-- 隐藏全部探查点
for i = 1, #play_stage do
for i = 1, #play_stage do
local progress = ScriptLib.GetGroupVariableValue(context, "stage_progress"..i)
LF_Show_Search_Point(context, i, false)
-- 若宝箱未开启,同时隐藏mark by siyu.li
@ -308,7 +308,7 @@ function LF_Start_Play(context, stage)
local configID = play_stage[stage].starter_operator_configID
--切探查点状态(发射子弹)
ScriptLib.SetGadgetStateByConfigId(context, configID, 201)
ScriptLib.SetGadgetStateByConfigId(context, configID, 201)
ScriptLib.DelWorktopOptionByGroupId(context, base_info.group_id, configID, defs.starter_option_id)
-- 隐藏小道具
@ -324,7 +324,7 @@ function LF_Start_Play(context, stage)
-- 开Gallery
local gallery_id = play_stage[stage].gallery_id
if 0 ~= ScriptLib.StartGallery(context, gallery_id) then
if 0 ~= ScriptLib.StartGallery(context, gallery_id) then
PrintLog(context, "开启Gallery失败")
end
local progress_tbl = {0, play_stage[stage].element_target}
@ -383,7 +383,7 @@ function LF_Player_Can_See(context)
PrintLog(context, "小道具装备:"..widget_equipped)
if seelie_out == 0 and widget_equipped == 1 then
if seelie_out == 0 and widget_equipped == 1 then
return true
end
return false
@ -398,9 +398,9 @@ end
-- 显示/隐藏【能量球】
function LF_Show_Energy_Balls(context, show)
if show == true then
if show == true then
ScriptLib.AddExtraGroupSuite(context, base_info.group_id, defs.energy_ball_suite)
else
else
ScriptLib.RemoveExtraGroupSuite(context, base_info.group_id, defs.energy_ball_suite)
end
end
@ -408,10 +408,10 @@ end
-- 显示/隐藏某阶段的【探查点】
function LF_Show_Search_Point(context, stage, show)
local configID = play_stage[stage].starter_operator_configID
if show == true then
ScriptLib.SetGadgetStateByConfigId(context, configID, 0)
if show == true then
ScriptLib.SetGadgetStateByConfigId(context, configID, 0)
ScriptLib.SetWorktopOptionsByGroupId(context, base_info.group_id, configID, {defs.starter_option_id})
else
else
ScriptLib.SetGadgetStateByConfigId(context, configID, 202)
ScriptLib.DelWorktopOptionByGroupId(context, base_info.group_id, configID, defs.starter_option_id)
end
@ -423,13 +423,13 @@ function LF_Show_Dig_Point(context, stage, show)
local suite_index = play_stage[stage].dig_operator_suite
local configID = play_stage[stage].dig_operator_configID
if show == true then
if show == true then
ScriptLib.AddExtraGroupSuite(context, base_info.group_id, suite_index)
-- 切状态显示mark
ScriptLib.SetGadgetStateByConfigId(context, configID, 0)
else
else
-- 切状态隐藏mark
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, configID, 201) then
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, configID, 201) then
PrintLog(context, "隐藏挖掘点mark失败")
end
--ScriptLib.RemoveExtraGroupSuite(context, base_info.group_id, suite_index)
@ -442,9 +442,9 @@ function LF_Show_Level(context, stage, show)
local suite_index = play_stage[stage].level_suite
if show == true then
if show == true then
ScriptLib.AddExtraGroupSuite(context, base_info.group_id, suite_index)
else
else
ScriptLib.RemoveExtraGroupSuite(context, base_info.group_id, suite_index)
end
@ -460,7 +460,7 @@ function LF_Init_Challenge(context, stage)
c_index = 2 --战斗
end
c_index = stage * 10 +c_index
if 0 ~= ScriptLib.StartChallenge(context, c_index, defs.challenge_id, {challenge_time, 3, 666, target}) then
if 0 ~= ScriptLib.StartChallenge(context, c_index, defs.challenge_id, {challenge_time, 3, 666, target}) then
PrintLog(context, "开启挑战失败")
else
local uid_list = ScriptLib.GetSceneUidList(context)
@ -469,7 +469,7 @@ function LF_Init_Challenge(context, stage)
ScriptLib.SetPlayerGroupVisionType(context, {uid}, {0})
ScriptLib.ForbidPlayerRegionVision(context, uid)
end
end
end
end
end
@ -480,7 +480,7 @@ function LF_Set_Seelie_Light_Level(context, light_level)
PrintLog(context, "设置仙灵亮度等级:"..light_level)
end
if light_level == 3 then
if light_level == 3 then
-- 延时X秒设亮度为0
ScriptLib.CreateGroupTimerEvent(context, base_info.group_id, "PerformEnd", 4)
end
@ -495,7 +495,7 @@ function LF_Load_Level(context)
-- 4- 宝箱开启
-- 能量球
-- if LF_Player_Can_See(context) == true then
-- if LF_Player_Can_See(context) == true then
-- LF_Show_Energy_Balls(context, true)
-- end
@ -504,18 +504,18 @@ function LF_Load_Level(context)
for i = 1, #play_stage do
LF_Show_Level(context, i, false)
end
-- 加载所有探查点suite。探查点的可见性与物件状态关联
for i = 1, #play_stage do
for i = 1, #play_stage do
local suite_index = play_stage[i].starter_operator_suite
ScriptLib.AddExtraGroupSuite(context, base_info.group_id, suite_index)
ScriptLib.AddExtraGroupSuite(context, base_info.group_id, suite_index)
end
-- 根据存档加载挖掘点&宝箱
for i = 1, #play_stage do
for i = 1, #play_stage do
local progress = ScriptLib.GetGroupVariableValue(context, "stage_progress"..i)
-- 宝箱未开恢复mark by siyu.li
if progress == 2 or progress == 3 then
if progress == 2 or progress == 3 then
local suite_index = play_stage[i].dig_operator_suite
ScriptLib.AddExtraGroupSuite(context, base_info.group_id, suite_index)
if progress == 3 then
@ -524,11 +524,11 @@ function LF_Load_Level(context)
else
ScriptLib.SetGadgetStateByConfigId(context, play_stage[i].dig_operator_configID, 201)
end
end
end
end
--[[ if progress == 3 then
--[[ if progress == 3 then
local suite_index = play_stage[i].treasure_suite
ScriptLib.AddExtraGroupSuite(context, base_info.group_id, suite_index)
ScriptLib.AddExtraGroupSuite(context, base_info.group_id, suite_index)
end--]]
end
end
@ -549,7 +549,7 @@ function SLC_Activity_TreasureSeelie_PickEnergyBall(context)
-- 仙灵表现(亮度)
local light_level = num % 3
if light_level == 0 then
if light_level == 0 then
light_level = 3
end
LF_Set_Seelie_Light_Level(context, light_level)
@ -585,7 +585,7 @@ function SLC_Activity_TreasureSeelie_PickElementParticle(context)
local stage = ScriptLib.GetGroupVariableValue(context, "current_challenge_stage")
PrintLog(context, "stage:"..stage)
if stage > 0 then
if stage > 0 then
local gallery_id = play_stage[stage].gallery_id
PrintLog(context, "galleryID:"..gallery_id)
ScriptLib.AddGalleryProgressScore(context, "Seelie", gallery_id, 1)
@ -600,12 +600,12 @@ function SLC_Activity_TreasureSeelie_SeelieEquipStateChanged(context, equipped)
--ScriptLib.SetGroupVariableValue(context, "seelie_equipped", math.floor(equipped))
if equipped == 1 then
if LF_Player_Can_See(context) == true then
if LF_Player_Can_See(context) == true then
if ScriptLib.GetGroupTempValue(context, "widget_first_used", {}) == 0 then
local _r = suites[1].regions[1]
if ScriptLib.IsInRegion(context, context.owner_uid, _r) then
local order = ScriptLib.GetTreasureSeelieDayByGroupId(context, base_info.group_id)
ScriptLib.MarkGroupLuaAction(context, "ActivityTreasureSeelie2", "", {["region_order"] = order, ["widget_first_use"] = ScriptLib.GetServerTime(context)})
ScriptLib.MarkGroupLuaAction(context, "ActivityTreasureSeelie2", "", {["region_order"] = order, ["widget_first_use"] = ScriptLib.GetServerTime(context)})
ScriptLib.SetGroupTempValue(context, "widget_first_used", 1, {})
end
end
@ -639,8 +639,8 @@ function action_enter_region(context, evt)
return -1
end
PrintLog(context, "进入玩法区域")
if ScriptLib.GetGroupVariableValue(context, "stage_counter") >= 3 then
if ScriptLib.GetGroupVariableValue(context, "stage_counter") >= 3 then
return 0
end
@ -649,29 +649,29 @@ function action_enter_region(context, evt)
-- 通知team仙灵小道具已进入玩法区域可装备
ScriptLib.SetTeamServerGlobalValue(context, context.owner_uid, "SGV_SeelieGameplayGroup", 1)
-- 根据关卡进度通知team仙灵是否可见
local seelie_out = ScriptLib.GetGroupVariableValue(context, "seelie_out")
ScriptLib.SetTeamServerGlobalValue(context, context.owner_uid, "SGV_SeelieInvisible", seelie_out)
-- 根据关卡进度还原仙灵亮度
local num = ScriptLib.GetGroupVariableValue(context, "energy_ball_counter")
local light_level = num % 3
LF_Set_Seelie_Light_Level(context, light_level)
--
if LF_Player_Can_See(context) == true then
--
if LF_Player_Can_See(context) == true then
LF_Objects_Display(context, true)
else
else
LF_Objects_Display(context, false)
end
for i = 1, #play_stage do
for i = 1, #play_stage do
local progress = ScriptLib.GetGroupVariableValue(context, "stage_progress"..i)
if progress == 3 then
if progress == 3 then
ScriptLib.SetGadgetStateByConfigId(context, play_stage[i].dig_operator_configID, 201)
local suite_index = play_stage[i].treasure_suite
ScriptLib.AddExtraGroupSuite(context, base_info.group_id, suite_index)
ScriptLib.AddExtraGroupSuite(context, base_info.group_id, suite_index)
end
end
return 0
@ -702,8 +702,8 @@ function action_leave_region(context, evt)
PrintLog(context, "离开玩法区域")
ScriptLib.SetGroupTempValue(context, "widget_first_used", 0, {})
-- 将未结束的挑战设置失败
if stage > 0 then
if stage > 0 then
ScriptLib.StopChallenge(context, 1, 0)
end
@ -723,7 +723,7 @@ function action_leave_region(context, evt)
end
-- 将未结束的挑战设置失败
local c_index = 1
if #suites[play_stage[stage].level_suite].monsters > 0 then
if #suites[play_stage[stage].level_suite].monsters > 0 then
c_index = 2
end
c_index = stage * 10 + c_index
@ -738,17 +738,17 @@ end
function action_gadget_create(context, evt)
local configID = evt.param1
-- 给探查点和挖掘点分别上选项
for i = 1, #play_stage do
for i = 1, #play_stage do
local progress = ScriptLib.GetGroupVariableValue(context, "stage_progress"..i)
if configID == play_stage[i].starter_operator_configID then
if progress == 1 and LF_Player_Can_See(context) == true then
if configID == play_stage[i].starter_operator_configID then
if progress == 1 and LF_Player_Can_See(context) == true then
LF_Show_Search_Point(context, i, true)
else
LF_Show_Search_Point(context, i, false)
end
elseif configID == play_stage[i].dig_operator_configID then
elseif configID == play_stage[i].dig_operator_configID then
PrintLog(context, "挖掘点create")
if progress == 2 then
ScriptLib.SetWorktopOptionsByGroupId(context, base_info.group_id, configID, {defs.dig_option_id})
@ -773,10 +773,10 @@ function action_select_option(context, evt)
local config_id = evt.param1
local option_id = evt.param2
if option_id == defs.starter_option_id then
if option_id == defs.starter_option_id then
LF_Search_Point_Interacted(context, config_id)
end
if option_id == defs.dig_option_id then
if option_id == defs.dig_option_id then
LF_Dig_Point_Interacted(context, config_id)
end
@ -819,7 +819,7 @@ function action_challenge_fail(context, evt)
end
end
LF_Stop_Play(context, stage, false)
-- 仙灵回身边
PrintLog(context, "仙灵回身边")
ScriptLib.SetGroupVariableValue(context, "seelie_out", 0)
@ -842,15 +842,15 @@ function action_gadget_state_change(context, evt)
local new_state = evt.param1
if new_state == 102 then
if new_state == 102 then
PrintLog(context, "宝箱打开")
-- 宝箱的configID
local configID = evt.param2
local stage = 1
for i = 1, #play_stage do
if play_stage[i].treasure_configID == configID then
for i = 1, #play_stage do
if play_stage[i].treasure_configID == configID then
stage = i
break
end
@ -866,7 +866,7 @@ function action_gadget_state_change(context, evt)
local counter = ScriptLib.GetGroupVariableValue(context, "stage_counter")
PrintLog(context, "区域完成进度:"..counter)
local order = ScriptLib.GetTreasureSeelieDayByGroupId(context, 0)
-- Reminder "显示宝箱进度"
-- Reminder "显示宝箱进度"
if counter == 1 then
ScriptLib.ShowReminder(context, 600129)
-- 运营埋点挖掘点1完成
@ -906,7 +906,7 @@ function action_monster_die(context, evt)
local pos = ScriptLib.GetPosByEntityId(context, eid)
local index = ScriptLib.GetGroupVariableValue(context, "element_used")
index = index + 1
ScriptLib.SetGroupVariableValue(context, "element_used", index)
@ -928,4 +928,4 @@ function action_perform_timer(context, evt)
return 0
end
LF_Initialize_Group(triggers, suites)
LF_Initialize_Group(triggers, suites)

View File

@ -3,16 +3,16 @@
|| owner: shuyi.chang
|| description:
|| LogName: ## [ContinuousTrampoline]
|| Protection:
|| Protection:
=======================================]]
-- defs =
-- local defs =
-- {
-- maxRegion = 34004,
-- maxJumpTimes = 5,
-- mushroomList = {
-- [1] = {34001, 34002,},
-- [2] = {34003},
-- [1] = {34001, 34002,},
-- [2] = {34003},
-- [3] = {34004, 34005, 34006,},
-- [4] = {34007,},
-- [5] = {34008,},
@ -24,8 +24,8 @@
local challengeId = 84
local extraTriggers =
{
local extraTriggers =
{
{ config_id = 5000001, name = "GROUP_LOAD", event = EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_GROUP_LOAD", trigger_count = 0},
{ config_id = 5000002, name = "ENTER_REGION", event = EventType.EVENT_ENTER_REGION, source = "", condition = "", action = "action_ENTER_REGION", forbid_guest = true, trigger_count = 0},
{ config_id = 5000003, name = "AVATAR_JUMP", event = EventType.EVENT_VARIABLE_CHANGE, source = "jumpTimes", condition = "", action = "action_AVATAR_JUMP", trigger_count = 0, tag = "99"},
@ -36,7 +36,7 @@ local extraTriggers =
}
local extraVariables =
local extraVariables =
{
-- 记录玩家连续跳跃次数
{ config_id = 5000101, name = "jumpTimes", value = 0, no_refresh = false },
@ -80,7 +80,7 @@ function LF_Initialize_Group(triggers, suites, variables, gadgets, regions)
-- for j = 1, #defs.mushroomList[i] do
-- local idTemp = regionBaseId + i * 10 + j
-- local posTemp = {x = gadgets[defs.mushroomList[i][j]].pos.x, y = gadgets[defs.mushroomList[i][j]].pos.y + 2.5, z = gadgets[defs.mushroomList[i][j]].pos.z}
-- local regionTemp = { config_id = idTemp,
-- local regionTemp = { config_id = idTemp,
-- shape = RegionShape.CYLINDER, radius = 1.5, pos = { x = posTemp.x, y = posTemp.y, z = posTemp.z }, height = 3.000 }
-- regions[idTemp] = regionTemp
-- mushroomRegion[i] = idTemp
@ -88,7 +88,7 @@ function LF_Initialize_Group(triggers, suites, variables, gadgets, regions)
-- -- add region to suites
-- table.insert(suites[1].regions, idTemp)
-- end
-- end
end
@ -127,7 +127,7 @@ function action_GROUP_LOAD(context, evt)
local currentMushroomIdx = ScriptLib.GetGroupVariableValue(context, "mushroomIdx")
LF_CreateMushrooms(context, currentMushroomIdx)
end
return 0
end
@ -137,7 +137,7 @@ function action_GROUP_WILL_UNLOAD(context, evt)
-- 挑战底层问题group unload时强制挑战失败
ScriptLib.StopChallenge(context, challengeId, 0)
return 0
end
@ -219,7 +219,7 @@ end
--================================================================
-- SLC functions
--================================================================
function SLC_Jump_Succeed_Once(context, evt)
function SLC_Jump_Succeed_Once(context, evt)
ScriptLib.PrintContextLog(context, "## [ContinuousTrampoline] SLC_Jump_Succeed_Once is called")
-- 为了处理断网情况需要给ability层一个callback把gv值设回0ability层只有在对应gv值为0的情况下才允许发slc
@ -269,7 +269,7 @@ function SLC_Fall_Onto_Ground(context, evt)
if jumpTimes < defs.maxJumpTimes and jumpTimes > 0 then
LF_RestartChallenge(context)
end
return 0
end

View File

@ -3,26 +3,26 @@
|| owner: shuyi.chang
|| description:
|| LogName: ## [DeathZoneObservation]
|| Protection:
|| Protection:
=======================================]]
--[[
defs_miscs =
local defs_miscs =
{
-- 死域观测站透镜的config id
lensConfigId = 103001,
lensConfigId = 103001,
-- 这个透镜对应的隐藏父任务的回退参数
resetParam = "rewindSmoke"
-- 兰纳罗的config id
lnlConfigId = 103004,
lnlConfigId = 103004,
-- 兰纳罗隐藏任务的回退参数
hiddenlnlParam = "hiddenlnl",
-- 一个smoke拥有一项
smokeTable =
smokeTable =
{
-- 每项格式如下,通常应该只有两项,即一个透镜对应两个黑烟
--[smoke_id] = {smoke = smoke_config_id, maxRegion = region_id, group = group_id, observeQuest = quest_id, finishQuest = quest_id, questParam = "任务前进变量"}
@ -32,7 +32,7 @@ defs_miscs =
}
--]]
local extraTriggers =
local extraTriggers =
{
{ config_id = 50000001, name = "GROUP_LOAD", event = EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_EVENT_GROUP_LOAD", trigger_count = 0 },
{ config_id = 50000002, name = "DEATH_ZONE_OBSERVE", event = EventType.EVENT_DEATH_ZONE_OBSERVE, source = "", condition = "", action = "action_EVENT_DEATH_ZONE_OBSERVE", trigger_count = 0 },
@ -44,7 +44,7 @@ local extraTriggers =
}
local extraVariables =
local extraVariables =
{
-- 已完成几个黑烟玩法group
{ config_id = 50000101, name = "smokeFinishedNum", value = 0, no_refresh = true },
@ -114,7 +114,7 @@ function LF_SetGlobalValueByGroupVar(context)
local curSmokeCount = ScriptLib.GetGroupVariableValue(context, "smokeObservedNum")
ScriptLib.SetEntityServerGlobalValueByConfigId(context, defs_miscs.lensConfigId, "SGV_Cur_Smoke_Count", curSmokeCount)
local smokeLeftCount = smokeCount - ScriptLib.GetGroupVariableValue(context, "smokeFinishedNum")
local smokeLeftCount = smokeCount - ScriptLib.GetGroupVariableValue(context, "smokeFinishedNum")
ScriptLib.SetEntityServerGlobalValueByConfigId(context, defs_miscs.lensConfigId, "SGV_Smoke_Count", smokeLeftCount)
ScriptLib.PrintContextLog(context, "## [DeathZoneObservation] smokeFinishedNum = "..ScriptLib.GetGroupVariableValue(context, "smokeFinishedNum")
..", smokeCount = "..smokeCount)
@ -160,7 +160,7 @@ end
-- LF_UpdateObservedSmokeCount(context)
-- LF_SetGlobalValueByGroupVar(context)
-- end
-- -- 更新此smoke的gadget state
-- ScriptLib.SetGadgetStateByConfigId(context, smokeId, gadgetState)
-- ScriptLib.PrintContextLog(context, "## [DeathZoneObservation] smoke id = ".. smokeId..", gadget state is set to "..gadgetState..
@ -190,7 +190,7 @@ function LF_SetSmokeGroupVar(context, smokeId, var)
end
function LF_UpdateObservedSmokeCount(context)
ScriptLib.PrintContextLog(context, "## [DeathZoneObservation] LF_UpdateObservedSmokeCount is called")
@ -205,11 +205,11 @@ function LF_UpdateObservedSmokeCount(context)
temp2 = temp2 + 1
end
end
ScriptLib.SetGroupVariableValue(context, "smokeObservedNum", temp1)
ScriptLib.PrintContextLog(context, "## [DeathZoneObservation] group variable smokeObservedNum is set to "..temp1)
ScriptLib.SetGroupVariableValue(context, "smokeFinishedNum", temp2)
ScriptLib.PrintContextLog(context, "## [DeathZoneObservation] group variable smokeFinishedNum is set to "..temp2)
@ -240,7 +240,7 @@ function LF_SetCurGroupSmokes(context)
-- 不管是不是当前组都要按黑烟的group var设置sgv和兰纳罗
LF_SetGlobalValueByGroupVar(context)
LF_ResetLNLByGroupVar(context)
end
function LF_ResetLNLByGroupVar(context)
@ -291,7 +291,7 @@ function LF_KillAllSmokesInGroup(context)
-- -- 任务尝试回滚,已清除的黑烟任务已经成功,不会参与回滚
-- ScriptLib.AddQuestProgress(context, defs_miscs.resetParam)
-- end
end
@ -361,7 +361,7 @@ end
function LF_SetSmokeStatus_New(context, smokeId, status)
ScriptLib.PrintContextLog(context, "## [DeathZoneObservation] LF_SetSmokeByStatus is called, smokeId = "..smokeId..", status is set to "..status)
-- 黑烟只有三种表现gadget state 0, gadget state 201, 不存在gadget(202)
-- 黑烟只有三种表现gadget state 0, gadget state 201, 不存在gadget(202)
local gadgetState = 0
if status == 0 then
-- 仅透镜可观测
@ -430,18 +430,18 @@ end
-- -- 不设置group var只回滚任务
-- ScriptLib.AddQuestProgress(context, defs_miscs.resetParam)
-- return 0
-- end
function action_EVENT_ENTER_REGION(context, evt)
ScriptLib.PrintContextLog(context, "## [DeathZoneObservation] player enters region "..evt.param1)
for k, v in pairs(defs_miscs.smokeTable) do
if evt.param1 == v.maxRegion then
-- 玩家进入黑烟区域, 要把这个黑烟加载出来
LF_SetCurSmokeActive(context, v.smoke)
-- 查看自己是不是当前组,不是的话设置为当前组,并通知上一个当前组删除自己同组的所有黑烟
LF_SetCurLensActive(context)
@ -480,7 +480,7 @@ end
function action_EVENT_DEATH_ZONE_OBSERVE(context, evt)
ScriptLib.PrintContextLog(context, "## [DeathZoneObservation] lens config id = "..evt.param1..
", observed gadget config id = ".. evt.param2..", group id = "..evt.param3)
if evt.param2 == defs_miscs.lnlConfigId then
-- 如果是兰纳罗
LF_SetLNLStatus(context, defs_miscs.lnlConfigId, 2)
@ -490,7 +490,7 @@ function action_EVENT_DEATH_ZONE_OBSERVE(context, evt)
-- 尽量不用for loop
-- 被观测到的黑烟config id
local smokeId = evt.param2
-- 黑烟状态改变
LF_SetSmokeGroupVar(context, smokeId, 1)
end
@ -510,7 +510,7 @@ function action_SMOKE_QUEST_FINISH(context, evt)
-- 某个黑烟对应的玩法group的任务已经完成
for k, v in pairs(defs_miscs.smokeTable) do
if v.finishQuest == evt.param1 then
if v.finishQuest == evt.param1 then
-- 黑烟可以永久消失了
LF_SetSmokeGroupVar(context, k, 2)
end
@ -561,7 +561,7 @@ function SLC_Lens_Closed_Excited(context)
-- 进这个slc说明本次打开界面的时候透镜一定在激化态现在关上了可能需要rmd
-- 只有兰纳罗还没被发现+透镜已经不在激化态了才出现这个reminder 33040007
if ScriptLib.GetGroupVariableValue(context, "aranaraObservedNum") == 0
if ScriptLib.GetGroupVariableValue(context, "aranaraObservedNum") == 0
and ScriptLib.GetGadgetStateByConfigId(context, 0, defs_miscs.lensConfigId) ~= 200 then
ScriptLib.ShowReminder(context, lnlDisappearRmd)
end
@ -574,3 +574,4 @@ end
-- Initialize
--================================================================
LF_Initialize_Group(triggers, suites, variables, gadgets, regions)

View File

@ -3,7 +3,7 @@
|| owner: shuyi.chang
|| description:
|| LogName: ## [DreamlandChallenge]
|| Protection:
|| Protection:
=======================================]]
-- 【高亮注意】Lua Require: V3_0/Dreamland
@ -16,7 +16,7 @@
-- 综上所述需要LD手动配置的内容包括宝箱没有特殊需求不需要创建其他东西
--[[
defs = {
local defs = {
-- 【根据实际情况修改】幻梦之门的config id
door = 17001,
@ -54,8 +54,8 @@ defs = {
--]]
local extraTriggers =
{
local extraTriggers =
{
{ config_id = 50000001, name = "GADGET_STATE_CHANGE_DOOR", event = EventType.EVENT_GADGET_STATE_CHANGE, source = "", condition = "", action = "action_GADGET_STATE_CHANGE_DOOR", trigger_count = 0 },
{ config_id = 50000002, name = "GROUP_LOAD", event = EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_GROUP_LOAD", trigger_count = 0 },
-- { config_id = 50000003, name = "MONSTER_BATTLE", event = EventType.EVENT_MONSTER_BATTLE, source = "", condition = "", action = "action_MONSTER_BATTLE", trigger_count = 0 },
@ -70,7 +70,7 @@ local extraTriggers =
}
local extraVariables =
local extraVariables =
{
-- 记录已获得的梦境之灵数量
{ config_id = 50000101, name = "spiritNum", value = 0, no_refresh = false },
@ -114,12 +114,12 @@ function LF_Initialize_Group(triggers, suites, variables, gadgets, regions)
-- add triggers to suite
for i = 1, #extraTriggers do
if extraTriggers[i].name == "GADGET_STATE_CHANGE_DOOR"
or extraTriggers[i].name == "GROUP_LOAD"
if extraTriggers[i].name == "GADGET_STATE_CHANGE_DOOR"
or extraTriggers[i].name == "GROUP_LOAD"
or extraTriggers[i].name == "TIME_AXIS_PASS" then
table.insert(suites[1].triggers,extraTriggers[i].name)
else
else
table.insert(suites[2].triggers,extraTriggers[i].name)
end
end
@ -152,7 +152,7 @@ function LF_Initialize_Group(triggers, suites, variables, gadgets, regions)
regions[defs.challengeRegion].vision_type_list = { defs.visionType }
end
function LF_ChallengeEnd(context, status)
@ -168,7 +168,7 @@ function LF_ChallengeEnd(context, status)
-- gallery成功(true是fail)
ScriptLib.StopGallery(context, defs.galleryId, false)
elseif status == 1 then
-- 失败
doorState = 902
@ -294,10 +294,10 @@ function action_GADGET_STATE_CHANGE_DOOR(context, evt)
-- 修改SGV值
ScriptLib.SetEntityServerGlobalValueByConfigId(context, v, "SGV_SPIRIT_ACTIVE", 1)
ScriptLib.PrintContextLog(context, "## [DreamlandChallenge]spirit "..v..", SGV_SPIRIT_ACTIVE changes to 1")
-- 起一个时间轴到时间之后reset SGV to 0
ScriptLib.InitTimeAxis(context, "SpiritActive", {spiritActiveTime}, false)
end
-- 开启视野
@ -341,7 +341,7 @@ function action_GROUP_LOAD(context, evt)
-- 保底回归仇恨
ScriptLib.SetTeamServerGlobalValue(context, context.owner_uid, "SGV_CAN_CLEAR_THREAT", 0)
ScriptLib.PrintContextLog(context, "## [DreamlandChallenge] SGV_CAN_CLEAR_THREAT = 0")
return 0
end
@ -384,7 +384,7 @@ function action_CHALLENGE_FAIL(context, evt)
if defs.fatherChallenge == evt.param1 then
LF_ChallengeEnd(context, 1)
end
return 0
end
@ -412,16 +412,16 @@ function action_CHALLENGE_SUCCESS(context, evt)
-- 保底把所有spirit都set to 202
for k, v in pairs(spirits) do
ScriptLib.SetGadgetStateByConfigId(context, k, GadgetState.GearStop)
end
end
-- 子挑战2号成功即父挑战成功生成宝箱
if defs.childChallenge[2] == evt.param1 then
-- 目前成功后的action在操作台option逻辑上
end
return 0
end
@ -441,7 +441,7 @@ function action_TIME_AXIS_PASS(context, evt)
-- elseif evt.source_name == "DreamlandFail" then
-- ScriptLib.TransPlayerToPos(context, {uid_list = {uid_list[1]}, pos = defs.transParam_Pos, radius = defs.transParam_Radius, rot = defs.transParam_Rot, is_skip_ui = false})
end
return 0
end
@ -457,36 +457,36 @@ function action_DOOR_FINISH(context, evt)
-- 事件成功
LF_ChallengeEnd(context, 0)
end
return 0
end
-- 触发操作
function action_LEAVE_REGION(context, evt)
ScriptLib.PrintContextLog(context, "## [DreamlandChallenge] leave region " .. evt.param1)
-- 判断是保底区域
if evt.param1 == defs.challengeRegion then
LF_FailAndForbidTransmit(context, "leave region")
end
return 0
end
function action_ENTER_REGION(context, evt)
ScriptLib.PrintContextLog(context, "## [DreamlandChallenge] enter region " .. evt.param1)
-- 判断是保底区域
if evt.param1 == defs.challengeRegion then
ScriptLib.SetGroupTempValue(context, "forbidTransmit", 0, {})
end
return 0
end
function action_GROUP_WILL_UNLOAD(context, evt)
ScriptLib.PrintContextLog(context, "## [DreamlandChallenge] group will unload")
LF_FailAndForbidTransmit(context, "group will be unloaded")
return 0
end
@ -515,7 +515,7 @@ function SLC_Player_Enter_Door(context, evt)
-- 可以开的话直接改门的gadget state
ScriptLib.SetGadgetStateByConfigId(context, defs.door, 201)
return 0
end
@ -526,7 +526,7 @@ function SLC_ClearAvatarTeamThreat(context, evt)
-- 用SGV清除玩家队伍身上的仇恨
ScriptLib.PrintContextLog(context, "## [DreamlandChallenge] SGV_CAN_CLEAR_THREAT Set: 1")
ScriptLib.SetTeamServerGlobalValue(context, context.owner_uid, "SGV_CAN_CLEAR_THREAT", 1)
return 0
end
@ -555,7 +555,7 @@ function SLC_ReturnAvatarTeamThreat(context, evt)
-- 用SGV回归玩家队伍身上的仇恨
ScriptLib.SetTeamServerGlobalValue(context, context.owner_uid, "SGV_CAN_CLEAR_THREAT", 0)
ScriptLib.PrintContextLog(context, "## [DreamlandChallenge] SGV_CAN_CLEAR_THREAT Set: 0")
return 0
end
@ -580,4 +580,4 @@ end
--================================================================
-- Initialize
--================================================================
LF_Initialize_Group(triggers, suites, variables, gadgets, regions)
LF_Initialize_Group(triggers, suites, variables, gadgets, regions)

View File

@ -8,7 +8,7 @@
|| Protection: [Protection]
=======================================]]
-- defs =
-- local defs =
-- {
-- regionId = 12345,
-- targetScore = 3,
@ -181,7 +181,7 @@ function action_TempVariableChange(context, evt)
if evt.param1 >= largeMushroomCount and ScriptLib.GetGroupTempValue(context, "score", {}) < defs.targetScore then
LF_GopherDisappear(context)
end
return 0
end
@ -192,7 +192,7 @@ end
-- local gadget_id = ScriptLib.GetGadgetIdByEntityId(context, evt.source_eid)
-- local gadgetState = ScriptLib.GetGadgetStateByConfigId(context, 0, config_id)
-- ScriptLib.PrintContextLog(context, "## TD_GopherPlay configId = ".. config_id .. ", gadgetId = "..gadget_id..", gadgetState change from "..evt.param2.." to "..gadgetState)
-- if 202 == gadgetState and gadget_id == GopherPlay.LargeMushroomId then
-- return true
-- end
@ -241,13 +241,13 @@ function LF_StopChallenge(context, success)
-- 设置所有蘑菇钻地
LF_SetArrayGadgetState(context,GopherPlay.ZeroArray)
if success == true then
-- 成功删除操作台选项操作台进202
ScriptLib.DelWorktopOptionByGroupId(context, 0, defs.startId, GopherPlay.OptionId)
ScriptLib.SetGadgetStateByConfigId(context, defs.startId, 202)
else
-- 失败重置回suite 1
-- 失败重置回suite 1
ScriptLib.RefreshGroup(context, { group_id = base_info.group_id, suite = 1 })
ScriptLib.SetWorktopOptionsByGroupId(context, 0, defs.startId, {GopherPlay.OptionId})
@ -288,7 +288,7 @@ function LF_CalLargeMushroom(context, array)
end
return temp
end
function LF_GopherDisappear(context)
-- 地鼠消失
@ -348,7 +348,7 @@ function SLC_AddScore(context,evt)
local before = ScriptLib.GetGroupTempValue(context, "last", {})
ScriptLib.SetGroupTempValue(context, "last", configId, {})
local last = ScriptLib.GetGroupTempValue(context, "last", {})
if before == last then
-- 防止短时间内被打两次
ScriptLib.PrintContextLog(context, "## TD_GopherPlay : SLC_AddScore is called, configId = "..configId..", before = "..before..

View File

@ -9,7 +9,7 @@
-- 特定Region或者Group可以写每次EnterRegion会检测
--[[
defs ={
local defs ={
regionList = {123},
-- 1,2,3,4对应4套等级
curCommander =1,

View File

@ -3,11 +3,11 @@
|| owner: shuyi.chang
|| description:
|| LogName: ## [TitanEnergy]
|| Protection:
|| Protection:
=======================================]]
--[[
defs = {
local defs = {
-- 【特别注意】所有流程必需的machine必须放在suite1中在电池全亮后自动开启
-- 【特别注意】探索性质的machine必须放在suite2中在电池全亮后不会自动开启
-- 【特别注意】只有suite1会在group load时加载
@ -34,8 +34,8 @@ defs = {
--]]
local extraTriggers =
{
local extraTriggers =
{
{ config_id = 50000001, name = "ENTER_REGION", event = EventType.EVENT_ENTER_REGION, source = "", condition = "", action = "action_ENTER_REGION", trigger_count = 0 },
{ config_id = 50000002, name = "GROUP_LOAD", event = EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_GROUP_LOAD", trigger_count = 0 },
{ config_id = 50000003, name = "CELL_INTERACT", event = EventType.EVENT_SELECT_OPTION, source = "", condition = "", action = "action_CELL_INTERACT", trigger_count = 0 },
@ -48,7 +48,7 @@ local extraTriggers =
}
local extraVariables =
local extraVariables =
{
-- 记录玩家身上有几格能量
{ config_id = 50000101, name = "playerEnergyLevel", value = 0, no_refresh = true },
@ -66,10 +66,10 @@ local extraVariables =
{ config_id = 50000106, name = "enabled", value = 0, no_refresh = true },
}
local machineGadgetIds = {
local machineGadgetIds = {
-- key表示这个机器需要几格能量才能开启
[1] = 70350439,
[2] = 70350440,
[1] = 70350439,
[2] = 70350440,
[3] = 70350441,
}
@ -102,7 +102,7 @@ local worktopOpt = {
local abilityGroup = "ActivityAbility_TitanEnergy"
local reminderTable =
local reminderTable =
{
playerFull = 60010321, -- 【玩家拥有的能量到达最大值】好了,去下一处吧!
}
@ -136,7 +136,7 @@ function LF_Initialize_Group(triggers, suites, variables, gadgets, regions)
LF_InitiateLuaVariables(gadgets, suites, variables)
-- 用于玩家身上特效的ability group
regions[defs.titanRegion].team_ability_group_list = {abilityGroup}
regions[defs.titanRegion].team_ability_group_list = {abilityGroup}
end
@ -192,7 +192,7 @@ function LF_InitiateLuaVariables(gadgets, suites, variables)
table.insert(lines, i)
end
end
end
for k, v in pairs(defs.cells) do
@ -253,7 +253,7 @@ function LF_UpdateWorktopOption(context)
-- 添加充能选项
ScriptLib.SetWorktopOptionsByGroupId(context, base_info.group_id, k, {worktopOpt.charge})
-- ScriptLib.PrintContextLog(context, "## [TitanEnergy] cell ".. k.." adds option "..worktopOpt.charge)
else
-- 删除充能选项
ScriptLib.DelWorktopOptionByGroupId(context, base_info.group_id, k, worktopOpt.charge)
@ -265,7 +265,7 @@ function LF_UpdateWorktopOption(context)
if ScriptLib.GetGroupVariableValue(context, "playerEnergyLevel") < defs.maxPlayerEnergyLev and
ScriptLib.GetGadgetStateByConfigId(context, base_info.group_id, k) == 201 and
ScriptLib.GetGroupVariableValue(context, "activeCellNum") ~= cellCount then
ScriptLib.SetWorktopOptionsByGroupId(context, base_info.group_id, k, {worktopOpt.recycle})
-- ScriptLib.PrintContextLog(context, "## [TitanEnergy] cell ".. k.." adds option "..worktopOpt.recycle)
@ -273,14 +273,14 @@ function LF_UpdateWorktopOption(context)
-- 删除回收选项
ScriptLib.DelWorktopOptionByGroupId(context, base_info.group_id, k, worktopOpt.recycle)
-- ScriptLib.PrintContextLog(context, "## [TitanEnergy] cell ".. k.." deletes option "..worktopOpt.recycle)
end
end
-- machine
for i = 1, #machines do
local worktopState = {charge = false, recycle = false}
-- 大前提条件是并不是所有电池都被点亮了
@ -303,7 +303,7 @@ function LF_UpdateWorktopOption(context)
worktopState.recycle = true
else
-- 删除回收选项
worktopState.recycle = false
worktopState.recycle = false
end
-- 如果所有电池都被点亮了quest machine就不能再操作了
@ -364,7 +364,7 @@ function LF_UpdateNodeStatByCell(context, isCharge, cellId)
local curNodes = defs.cells[cellId].nodes
for i = 1, #curNodes do
-- 一个node的config id
local curNode = curNodes[i]
-- ScriptLib.PrintContextLog(context, "## [TitanEnergy] curNode = "..curNode)
@ -413,7 +413,7 @@ function LF_UpdateNodeStatByCell(context, isCharge, cellId)
-- end
end
end
@ -429,18 +429,18 @@ function LF_UpdateLineStatByCell(context, isCharge, cellId)
local curLines = defs.cells[cellId].lines
for i = 1, #curLines do
-- 当前line的config id
local curLine = curLines[i]
-- 电线先变暗,但只要有一个电池是亮的,电线就需要亮
ScriptLib.SetGroupGadgetStateByConfigId(context, base_info.group_id, curLine, 0)
-- 找到当前line关联的所有电池
local relatedCells = gadgets[curLine].cells
for j = 1, #relatedCells do
if ScriptLib.GetGadgetStateByConfigId(context, base_info.group_id, relatedCells[j]) == 201 then
ScriptLib.SetGroupGadgetStateByConfigId(context, base_info.group_id, curLine, 201)
ScriptLib.PrintContextLog(context, "## [TitanEnergy] node "..curLine..", status = light")
@ -486,7 +486,7 @@ function LF_UpdateCellEnergy(context, isCharge, cellId)
if isCharge then
destGadgetState = 201
delta = 1
else
else
destGadgetState = 0
delta = -1
end
@ -563,7 +563,7 @@ function LF_ResetGroup(context)
local groupStatus = ScriptLib.GetGroupVariableValue(context, "groupStatus")
ScriptLib.PrintContextLog(context, "## [TitanEnergy] group status = "..groupStatus)
if groupStatus == 2 then
-- -- 进行中,表现不固定,不做特殊操作
-- -- 玩家身上能量和group变量对齐(如果身上有能量的时候断线重连了)
@ -765,7 +765,7 @@ function action_LEAVE_REGION(context, evt)
-- 断线重连和联机后会被触发
ScriptLib.PrintContextLog(context, "## [TitanEnergy] player leaves region "..evt.param1)
if evt.param1 == defs.titanRegion then
if evt.param1 == defs.titanRegion then
LF_RestartLevel(context)
end
return 0
@ -793,7 +793,7 @@ function action_VARIABLE_CHANGE(context, evt)
if evt.source_name == "activeCellNum" then
-- 如果所有电池都已经完成了电池和机关都维持201状态
if ScriptLib.GetGroupVariableValue(context, "activeCellNum") == cellCount then
-- 已经完成这组机关会再次触发此事件走下面else里的resetGroup
ScriptLib.SetGroupVariableValue(context, "groupStatus", 3)
@ -803,10 +803,10 @@ function action_VARIABLE_CHANGE(context, evt)
if LF_IsMPMode(context) == false then
LF_ResetGroup(context)
end
end
end
end
end
return 0
end
@ -831,7 +831,7 @@ function action_CELL_INTERACT(context, evt)
if ScriptLib.GetGroupVariableValue(context, "groupStatus") == 1 then
ScriptLib.SetGroupVariableValue(context, "groupStatus", 2)
end
-- 先拿到这个电池的config id
local curCellId = evt.param1
@ -855,7 +855,7 @@ function action_CELL_INTERACT(context, evt)
-- 更新操作台选项
LF_UpdateWorktopOption(context)
end
end
return 0
end
@ -873,7 +873,7 @@ function action_MACHINE_INTERACT(context, evt)
if gadgets[evt.param1].gadget_id == 70350439 or
gadgets[evt.param1].gadget_id == 70350440 or
gadgets[evt.param1].gadget_id == 70350441 then
ScriptLib.PrintContextLog(context, "## [TitanEnergy] player interact with machine worktop "..evt.param1..", option = "..evt.param2)
-- 玩法进行中
@ -886,7 +886,7 @@ function action_MACHINE_INTERACT(context, evt)
-- 机关最大能量数
local curMachineMaxEnergy = LF_GetMaxEnergyLevelByConfigId(context, curMachineId)
-- 机关目前能量数
local curMachineEnergy = ScriptLib.GetGroupVariableValue(context, tostring(curMachineId))
@ -929,7 +929,7 @@ end
function action_ENERGY_PICKUP(context, evt)
-- 以防万一,如果联机的时候出现了交互选项,立刻结束
if LF_IsMPMode(context) == true then
return 0
@ -951,7 +951,7 @@ function action_ENERGY_PICKUP(context, evt)
-- 能量块和操作台选项都无了
LF_UpdateStone(context, curStoneId, 202)
-- 玩家身上energy level ++
LF_UpdatePlayerEnergyLev(context, 1)
@ -962,7 +962,7 @@ function action_ENERGY_PICKUP(context, evt)
..ScriptLib.GetGroupVariableValue(context, "playerEnergyLevel"))
end
-- 更新操作台选项
LF_UpdateWorktopOption(context)
end
@ -976,11 +976,11 @@ function action_TIME_AXIS_PASS(context, evt)
if evt.source_name == "optionCD" then
LF_UpdateWorktopOption(context)
end
return 0
end
--================================================================
-- Initialize
--================================================================
LF_Initialize_Group(triggers, suites, variables, gadgets, regions)
LF_Initialize_Group(triggers, suites, variables, gadgets, regions)

View File

@ -3,10 +3,10 @@
|| owner: shuyi.chang
|| description:
|| LogName: ## [UnstableSpray]
|| Protection:
|| Protection:
=======================================]]
--[[
defs =
local defs =
{
-- 本轮对应的gallery id
galleryId = 0,
@ -27,16 +27,16 @@ defs =
monsterPoolTable = {
{
pool_list = {35001},
point_array_id = 0,
point_id_list = {},
affix_list = {},
point_array_id = 0,
point_id_list = {},
affix_list = {},
param = {total_count = 99, min_count = 1, max_count = 3, tag = 0, fill_time = 0, fill_count = 0, is_ordered = false, is_tag_bit_match = false},
},
{
pool_list = {35001},
point_array_id = 0,
point_id_list = {},
affix_list = {},
point_array_id = 0,
point_id_list = {},
affix_list = {},
param = {total_count = 99, min_count = 1, max_count = 3, tag = 0, fill_time = 0, fill_count = 0, is_ordered = false, is_tag_bit_match = false},
},
},
@ -52,8 +52,8 @@ defs =
}
--]]
local extraTriggers =
{
local extraTriggers =
{
{ config_id = 50000001, name = "ENTER_REGION", event = EventType.EVENT_ENTER_REGION, source = "", condition = "", action = "action_ENTER_REGION", trigger_count = 0},
{ config_id = 50000002, name = "START_CHALLENGE", event = EventType.EVENT_SELECT_OPTION, source = "", condition = "", action = "action_START_CHALLENGE", trigger_count = 0 },
{ config_id = 50000003, name = "STAGE_COMPLETE", event = EventType.EVENT_TIME_AXIS_PASS, source = "", condition = "", action = "action_STAGE_COMPLETE", trigger_count = 0 },
@ -65,7 +65,7 @@ local extraTriggers =
}
local extraVariables =
local extraVariables =
{
-- 记录目前是第几个三十秒
{ config_id = 5000101, name = "stage", value = 0, no_refresh = false },
@ -89,7 +89,7 @@ local worktopField =
optionId = 429,
}
-- local transParam =
-- local transParam =
-- {
-- pos = {x = 0, y = 0, z = 0},
-- rot = {x = 0, y = 0, z = 0},
@ -180,7 +180,7 @@ function LF_CheckAndRecordBuff(context, buffIdx)
return 0
end
-- 如果这个var记录了别的buff idx继续for loop
-- 如果这个var记录了别的buff idx继续for loop
end
end
@ -196,7 +196,7 @@ function action_ENTER_REGION(context, evt)
if defs.isStartLevel == true then
ScriptLib.SetGroupVariableValue(context, "levelEnabled", 1)
end
return 0
end
@ -237,9 +237,9 @@ function action_START_CHALLENGE(context, evt)
-- 刷怪
-- ScriptLib.AutoMonsterTide(context, 1, base_info.group_id, defs.tides.monsters, defs.tides.sum, defs.tides.max, defs.tides.min)
ScriptLib.AutoPoolMonsterTide(context, 1, base_info.group_id, defs.monsterPoolTable[1].pool_list, defs.monsterPoolTable[1].point_array_id,
ScriptLib.AutoPoolMonsterTide(context, 1, base_info.group_id, defs.monsterPoolTable[1].pool_list, defs.monsterPoolTable[1].point_array_id,
defs.monsterPoolTable[1].point_id_list, defs.monsterPoolTable[1].affix_list, defs.monsterPoolTable[1].param)
end
return 0
end
@ -255,7 +255,7 @@ function action_STAGE_COMPLETE(context, evt)
ScriptLib.SetGroupVariableValue(context, "stage", temp)
ScriptLib.PrintContextLog(context, "## [UnstableSpray] group variable stage is set to "..temp)
-- 【时间轴总长度会比90s多一点应该跑不到这里gallery就已经结束并强制卸载group了目前走event gallery stop】
if evt.param1 == 3 then
-- -- 第三轮结束,停止刷怪
@ -275,11 +275,11 @@ function action_STAGE_COMPLETE(context, evt)
else
-- 不是challenge timer也不是怪物潮timer就肯定是sgv timer
-- SGV设为0buff效果结束
ScriptLib.SetTeamServerGlobalValue(context, uid, evt.source_name, 0)
ScriptLib.SetTeamServerGlobalValue(context, uid, evt.source_name, 0)
ScriptLib.PrintContextLog(context, "## [UnstableSpray] "..evt.source_name.." is set to 0")
end
return 0
end
@ -303,7 +303,7 @@ function action_MONSTER_DIE(context, evt)
-- 第一波怪物潮都死了
-- 开下一个怪物潮
ScriptLib.AutoPoolMonsterTide(context, 2, base_info.group_id, defs.monsterPoolTable[2].pool_list, defs.monsterPoolTable[2].point_array_id,
ScriptLib.AutoPoolMonsterTide(context, 2, base_info.group_id, defs.monsterPoolTable[2].pool_list, defs.monsterPoolTable[2].point_array_id,
defs.monsterPoolTable[2].point_id_list, defs.monsterPoolTable[2].affix_list, defs.monsterPoolTable[2].param)
ScriptLib.SetGroupVariableValue(context, "firstTideClose", 2)
@ -329,16 +329,16 @@ function action_GALLERY_STOP(context, evt)
ScriptLib.SetGroupVariableValueByGroup(context, "levelEnabled", 1, defs.nextGroupId)
end
end
-- 所有buff sgv保底归零
for i = 1, 4 do
local buffIdx = ScriptLib.GetGroupVariableValue(context, "sgv"..i)
local sgv = ScriptLib.InstableSprayGetSGVByBuffId(context, buffIdx)
if sgv ~= "" then
ScriptLib.EndTimeAxis(context, sgv)
ScriptLib.SetTeamServerGlobalValue(context, uid, sgv, 0)
ScriptLib.SetTeamServerGlobalValue(context, uid, sgv, 0)
local v = ScriptLib.GetTeamServerGlobalValue(context, uid, sgv)
ScriptLib.PrintContextLog(context, "## [UnstableSpray] level ends and "..sgv.." = "..v)
end
@ -352,7 +352,7 @@ function action_DUNGEON_ALL_AVATAR_DIE(context, evt)
ScriptLib.PrintContextLog(context, "## [UnstableSpray] all avatar dies in dungeon"..evt.source_name.."uid = "..evt.uid)
ScriptLib.CauseDungeonFail(context)
-- gallery失败
ScriptLib.StopGallery(context, defs.galleryId, true)
return 0
@ -421,7 +421,7 @@ function SLC_TriggerAbility(context, evt)
LF_CheckAndRecordBuff(context, curBuffIdx[i])
-- local var1 = ScriptLib.SetGroupVariableValue(context, "sgv"..i, curBuffIdx[i])
-- local r = ScriptLib.GetGroupVariableValue(context, "sgv"..i)
-- ScriptLib.PrintContextLog(context, "## [UnstableSpray] group variable sgv"..i.." is set to "..r..", var = "..var1)

View File

@ -3,11 +3,11 @@
|| owner: shuyi.chang
|| description:
|| LogName: ## [VarunaStandard]
|| Protection:
|| Protection:
=======================================]]
--[[
defs =
local defs =
{
-- 钓鱼点
fishingPoint = {
@ -16,20 +16,20 @@ defs =
},
-- 升降水面,应该只有一项
rootWaterTable =
rootWaterTable =
{
[188001] = 330300001,
},
}
--]]
local extraTriggers =
local extraTriggers =
{
{ config_id = 50000001, name = "GROUP_LOAD", event = EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_EVENT_GROUP_LOAD", trigger_count = 0 },
{ config_id = 50000002, name = "PLATFORM_ARRIVAL", event = EventType.EVENT_PLATFORM_ARRIVAL, source = "", condition = "", action = "action_EVENT_PLATFORM_ARRIVAL", trigger_count = 0 },
}
local extraVariables =
local extraVariables =
{
}
@ -93,7 +93,7 @@ function LF_Initialize_Group(triggers, suites, variables, gadgets, regions)
if v.gadget_id == fishingGadgetId then
table.insert(fishPoints, v.config_id)
end
end
end
@ -173,7 +173,7 @@ function LF_DelFishingPoint(context, weatherState)
-- 存在但没在移动,只干掉不需要的那个钓鱼点(这个不需要的钓鱼点其实也应该已经不在了)
ScriptLib.RemoveExtraGroupSuite(context, fishGroupId, suite)
ScriptLib.PrintContextLog(context, "## [VarunaStandard] del fish point "..suite)
else
else
ScriptLib.RemoveExtraGroupSuite(context, fishGroupId, defs.fishingPoint.top)
ScriptLib.RemoveExtraGroupSuite(context, fishGroupId, defs.fishingPoint.bottom)
ScriptLib.PrintContextLog(context, "## [VarunaStandard] del all fish points cuz water doesn't exist")
@ -197,7 +197,7 @@ function LF_SetRootAndBubbleState_Local(context, weatherState)
if #fishPoints ~= 0 then
LF_DelFishingPoint(context, weatherState)
end
end
return 0
end
@ -248,7 +248,7 @@ function LF_SetWaterState(context, weatherState)
-- 水面上升和下降
ScriptLib.SetPlatformPointArray(context, k, v, {pointId}, { route_type = 0 })
ScriptLib.PrintContextLog(context, "## [VarunaStandard] water "..k.." is moving, pointId = "..pointId)
ScriptLib.SetGroupVariableValueByGroup(context, "waterStatus", 2, 133303188)
end
end
@ -294,4 +294,4 @@ end
--================================================================
-- Initialize
--================================================================
LF_Initialize_Group(triggers, suites, variables, gadgets, regions)
LF_Initialize_Group(triggers, suites, variables, gadgets, regions)

View File

@ -3,19 +3,19 @@
|| owner: shuyi.chang
|| description:
|| LogName: ## [VarunaWaterspout]
|| Protection:
|| Protection:
=======================================]]
--[[
defs =
local defs =
{
-- 受回流之柱控制的group id
groupTable =
groupTable =
{
},
-- 回流之柱副中枢所在的group id
deviceGroupTable =
deviceGroupTable =
{
},
@ -40,7 +40,7 @@ defs =
}
--]]
local extraTriggers =
local extraTriggers =
{
{ config_id = 50000001, name = "GROUP_LOAD", event = EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_EVENT_GROUP_LOAD", trigger_count = 0 },
{ config_id = 50000002, name = "TIME_AXIS_PASS", event = EventType.EVENT_TIME_AXIS_PASS, source = "", condition = "", action = "action_EVENT_TIME_AXIS_PASS", trigger_count = 0 },
@ -50,7 +50,7 @@ local extraTriggers =
}
local extraVariables =
local extraVariables =
{
-- 0雨天1晴天不要在其他group里改这个变量的值
{ config_id = 50000101, name = "SGV_WeatherState", value = 0, no_refresh = true },
@ -63,7 +63,7 @@ local extraVariables =
}
local weatherTable =
local weatherTable =
{
clearBefore = 4013,
rainBefore = 4014,
@ -113,12 +113,12 @@ function LF_CheckTime(context, destTime)
local curGameMinutePassed = time[3]
local destTimePassed = destTime[1] * 60 + destTime[2]
-- 允许前后2s内的误差
if math.abs(curGameMinutePassed - destTimePassed) < 2 then
temp = true
end
return temp
end
@ -140,7 +140,7 @@ function LF_SetSpoutGadgetState(context, gadgetState)
ScriptLib.SetGadgetStateByConfigId(context, defs.photoTable[i], photoState)
photoIdList = photoIdList..defs.photoTable[i].." state = "..photoState..","
end
ScriptLib.PrintContextLog(context, "## [VarunaWaterspout] water spout gadget state is set to "..gadgetState..
", "..photoIdList)
@ -155,13 +155,13 @@ function LF_CheckSpoutStatusByTime(context, hour, minute)
LF_SetSpoutGadgetState(context, 901)
LF_WaterSpoutTimeAxis(context, false, hour, minute)
end
local temp = hour % 12
if temp == 0 then
-- 是起水柱的那个小时0或12
if minute == 0 then
-- 暂时不走这里,走上面,允许一点误差
elseif minute < defs.waterRise + defs.waterStayup then
-- 如果还没到该下落的时间,保持循环状态(通常是调时间之后走这里先等几秒不出特效等镜头上移之后从物件层进201)
LF_SetSpoutGadgetState(context, 903)
@ -187,7 +187,7 @@ function LF_WaterSpoutTimeAxis(context, temp, hour, minute)
ScriptLib.InitTimeAxis(context, "waterSpout_"..LF_TempAxisValue(context, 3), {defs.waterRise, defs.waterRise + defs.waterStayup, defs.waterRise + defs.waterStayup + defs.waterDown}, false)
ScriptLib.PrintContextLog(context, "## [VarunaWaterspout] start a time axis, name = waterSpout_"..LF_TempAxisValue(context, 3)..", time = "..hour..":"..minute)
end
end
@ -229,7 +229,7 @@ function LF_Check_Weather_Status(context)
return
end
end
-- 只要进了这个function就一定会起新的tempWeather时间轴所以一定要把所有时间轴都取消掉
LF_CancelAllAxis(context)
@ -384,7 +384,7 @@ function LF_TempAxisValue(context, type)
tempName = "axis_waterSpout"
tempValue = ScriptLib.GetGroupTempValue(context, "axis_waterSpout", {})
end
if tempValue == 1 then
ScriptLib.SetGroupTempValue(context, tempName, 0, {})
return 0
@ -400,7 +400,7 @@ end
--================================================================
function action_EVENT_GROUP_LOAD(context, evt)
ScriptLib.PrintContextLog(context, "## [VarunaWaterspout] group is loaded")
ScriptLib.SetGroupTempValue(context, "axis_tempWeather", 0, {})
@ -424,7 +424,7 @@ function action_EVENT_ENTER_REGION(context, evt)
-- 更新当前天气
LF_Check_Weather_Status(context)
end
return 0
end
@ -438,7 +438,7 @@ function action_VARIABLE_CHANGE(context, evt)
ScriptLib.GetGroupVariableValue(context, "questStatus"))
return 0
end
if evt.source_name == "finalWeatherState" then
-- 通知中枢所在组
@ -472,10 +472,10 @@ function action_VARIABLE_CHANGE(context, evt)
local curWeather = ScriptLib.GetGroupVariableValue(context,"SGV_WeatherState")
LF_ChangeWeather(context, curWeather)
ScriptLib.PrintContextLog(context, "## [VarunaWaterspout] quest finished, weather changes to "..curWeather)
end
return 0
end
@ -487,7 +487,7 @@ function action_EVENT_SET_GAME_TIME(context, evt)
return 0
end
function action_EVENT_TIME_AXIS_PASS(context, evt)
function action_EVENT_TIME_AXIS_PASS(context, evt)
ScriptLib.PrintContextLog(context, "## [VarunaWaterspout] Time axis "..evt.source_name..", stage "..evt.param1.." is finished")
-- 只要时间轴走完一个阶段,一定切换天气状态
@ -497,21 +497,21 @@ function action_EVENT_TIME_AXIS_PASS(context, evt)
ScriptLib.PrintContextLog(context, "## [VarunaWaterspout] game hour = "..ScriptLib.GetGameHour(context)..
", current weather state = "..ScriptLib.GetGroupVariableValue(context, "SGV_WeatherState"))
elseif string.sub(evt.source_name, 0, 10) == "waterSpout" then
elseif string.sub(evt.source_name, 0, 10) == "waterSpout" then
if evt.param1 == 1 then
-- if LF_CheckTime(context, {0, 5}) == false and LF_CheckTime(context, {12, 5}) == false then
-- LF_CheckSpoutStatusByMinute(context, curGameMinute)
-- return 0
-- else
LF_SetSpoutGadgetState(context, 201)
-- end
-- end
elseif evt.param1 == 2 then
LF_SetSpoutGadgetState(context, 902)
elseif evt.param1 == 3 then
LF_SetSpoutGadgetState(context, 0)
end
elseif string.sub(evt.source_name, 0, 14) == "tempWaterSpout" then
if evt.param1 == 1 then
LF_SetSpoutGadgetState(context, 902)
@ -527,4 +527,4 @@ end
--================================================================
-- Initialize
--================================================================
LF_Initialize_Group(triggers, suites, variables, gadgets, regions)
LF_Initialize_Group(triggers, suites, variables, gadgets, regions)

View File

@ -8,7 +8,7 @@
--需求defs
--[[
defs = {
local defs = {
gallery_id = 111,
region = 111
}
@ -118,7 +118,7 @@ function action_EVENT_VARIABLE_CHANGE(context,evt)
--二阶段抓到动物后 判断是否完成
if evt.source_name == "Stage_2_Monster_Count" then
ScriptLib.PrintContextLog(context,"## Activity_Hunt_Stage_1 action_EVENT_VARIABLE_CHANGE1:defs.stage_2_goal="..defs.stage_2_goal)
if evt.param1 >= defs.stage_2_goal then
if evt.param1 >= defs.stage_2_goal then
ScriptLib.StopGallery(context, 27002, false)
end
end
@ -136,7 +136,7 @@ end
--初始化
function Initialize()
--加触发器
if temp_Tirgger ~= nil then
if temp_Tirgger ~= nil then
for k,v in pairs(temp_Tirgger) do
v.name = v.action
v.config_id = 40000000 + k
@ -147,7 +147,7 @@ function Initialize()
end
end
--加变量
if temp_Variables ~= nil then
if temp_Variables ~= nil then
for k,v in pairs(temp_Variables) do
v.config_id = 50000000 + k
table.insert(variables,v)
@ -156,4 +156,4 @@ function Initialize()
return 0
end
Initialize()
Initialize()

View File

@ -8,7 +8,7 @@
--需求defs
--[[
defs = {
local defs = {
target_group = 111
}
]]
@ -74,10 +74,10 @@ function action_EVENT_ANY_MONSTER_DIE(context,evt)
local _count = ScriptLib.GetGroupMonsterCount(context)
ScriptLib.PrintContextLog(context,"## Activity_Hunt_Stage_2 action_EVENT_ANY_MONSTER_DIE:_count=".._count)
--1解锁22解锁3
if _count == 2 and base_info.group_id == stage_2_group_id[1] then
if _count == 2 and base_info.group_id == stage_2_group_id[1] then
ScriptLib.ActivateGroupLinkBundle(context, stage_2_group_id[2])
ScriptLib.AddExtraGroupSuite(context, stage_2_group_id[2], 2)
elseif _count == 2 and base_info.group_id == stage_2_group_id[2] then
elseif _count == 2 and base_info.group_id == stage_2_group_id[2] then
ScriptLib.ActivateGroupLinkBundle(context, stage_2_group_id[3])
ScriptLib.AddExtraGroupSuite(context, stage_2_group_id[3], 2)
end
@ -89,16 +89,16 @@ function action_EVENT_ANY_MONSTER_DIE(context,evt)
ScriptLib.SetGroupVariableValueByGroup(context, "left_num", _count, defs.target_group)
end
--如果数量为0关闭黄圈
if _count == 0 then
if _count == 0 then
ScriptLib.PrintContextLog(context,"## Activity_Hunt_Stage_2 action_EVENT_ENTER_REGION:DeactivateGroupLinkBundle")
ScriptLib.DeactivateGroupLinkBundle(context,base_info.group_id)
end
return 0
end
--三阶段用 定时激活捕网机关
--三阶段用 定时激活捕网机关
function action_EVENT_TIME_AXIS_PASS_Active_Trap(context,evt)
ScriptLib.PrintContextLog(context,"## Activity_Hunt_Stage_2 action_EVENT_TIME_AXIS_PASS_Active_Trap:")
if evt.param1 == 1 then
if evt.param1 == 1 then
ScriptLib.ShowReminder(context, 400174)
--随机挑选一个未激活的trap记录config_id生成倒三角箭头
local _list = {}
@ -134,7 +134,7 @@ function action_EVENT_ENTER_REGION(context,evt)
return 0
end
--是否走进黄圈
if evt.param1 ~= defs.circle_region then
if evt.param1 ~= defs.circle_region then
ScriptLib.PrintContextLog(context,"## Activity_Hunt_Stage_2 action_EVENT_ENTER_REGION:是否走进黄圈")
return 0
end
@ -158,7 +158,7 @@ function action_EVENT_GROUP_LOAD(context,evt)
--二阶段额外初始化下变量
ScriptLib.SetGroupTempValue(context,"catched",0,{})
end
if base_info.group_id == stage_3_group_id then
--三阶段帮忙激活下八方网
ScriptLib.AssignPlayerShowTemplateReminder(context,196,{param_uid_vec={},param_vec={},uid_vec={_uid}})
@ -193,13 +193,13 @@ function action2_EVENT_VARIABLE_CHANGE(context,evt)
end
end
end
if evt.source_name == "create_monster_1" then
if evt.source_name == "create_monster_1" then
LF_Create_Monster_By_Random_Point(context,28020310,evt.param1)
end
if evt.source_name == "create_monster_2" then
if evt.source_name == "create_monster_2" then
LF_Create_Monster_By_Random_Point(context,28020311,evt.param1)
end
if evt.source_name == "create_monster_3" then
if evt.source_name == "create_monster_3" then
LF_Create_Monster_By_Random_Point(context,28020312,evt.param1)
end
return 0
@ -211,10 +211,10 @@ function LF_Create_Monster_By_Random_Point(context,m_id,num)
local _count = 0
local _list = {}
for k,v in pairs(monsters) do
if v.monster_id == m_id then
if v.monster_id == m_id then
local _isalive = false
for i = 1 , #_alivelist do
if _alivelist[i] == v.config_id then
for i = 1 , #_alivelist do
if _alivelist[i] == v.config_id then
_isalive = true
break
end
@ -244,7 +244,7 @@ function LF_Create_Monster_By_Random_Point(context,m_id,num)
local _t = math.random(#_list)
ScriptLib.PrintContextLog(context,"## Activity_Hunt_Stage_2 LF_Create_Monster_By_Random_Point:_list[_t]=".._list[_t])
--创建且给小猪、野林猪加初始sgv 设为0 只有一阶段其他阶段会默认1
if m_id == 28020310 or m_id == 28020311 then
if m_id == 28020310 or m_id == 28020311 then
ScriptLib.CreateMonsterWithGlobalValue(context, _list[_t], {["SGV_STAGE"] = 0})
else
ScriptLib.CreateMonster(context, {config_id = _list[_t], delay_time = 0})
@ -263,7 +263,7 @@ function action_EVENT_MONSTER_DIE_BEFORE_LEAVE_SCENE(context,evt)
--一阶段
local _id = ScriptLib.GetMonsterIdByEntityId(context, evt.source_eid)
--一阶段 林野猪和雪猪不看v直接算分(他们不会逃跑,死了肯定都是捕捉)
if _id == 28020311 or _id == 28020312 then
if _id == 28020311 or _id == 28020312 then
ScriptLib.SetGroupVariableValueByGroup(context, monster_list[_id], 1, defs.target_group)
elseif _id == 28020310 then--一阶段小猪
if _v ~= 0 then --非0都算捕捉
@ -277,7 +277,7 @@ function action_EVENT_MONSTER_DIE_BEFORE_LEAVE_SCENE(context,evt)
ScriptLib.SetGroupVariableValueByGroup(context, "is_finish", 1, defs.target_group)
else
--二阶段
if _v ~= 0 then
if _v ~= 0 then
--走到这里的怪都是抓到的发monsterid
local _monster_id = ScriptLib.GetMonsterIdByEntityId(context, evt.source_eid)
ScriptLib.PrintContextLog(context,"## Activity_Hunt_Stage_2 action_EVENT_MONSTER_DIE_BEFORE_LEAVE_SCENE:_monster_id=".._monster_id)
@ -315,18 +315,18 @@ end
--初始化
function Initialize()
--加触发器
if temp_Tirgger ~= nil then
if temp_Tirgger ~= nil then
for k,v in pairs(temp_Tirgger) do
v.name = v.action
v.config_id = 40000000 + k
v.trigger_count = 0
v.condition = ""
table.insert(triggers, v)
table.insert(triggers, v)
table.insert(suites[init_config.suite].triggers, v.name)
end
end
--加变量
if temp_Variables ~= nil then
if temp_Variables ~= nil then
for k,v in pairs(temp_Variables) do
table.insert(variables,v)
end
@ -339,4 +339,4 @@ function Initialize()
table.insert(gadgets,_temp_gadget)
return 0
end
Initialize()
Initialize()

View File

@ -8,7 +8,7 @@
--需求defs
--[[
defs = {
local defs = {
enter_region = 111,
leave_region = 111,
}
@ -68,7 +68,7 @@ function action_EVENT_GADGET_STATE_CHANGE(context,evt)
return 0
end
function action_EVENT_VARIABLE_CHANGE_FindRock_Trigger(context,evt)
if ScriptLib.IsChallengeStartedByChallengeIndex(context,base_info.group_id,father_challenge_id) then
if ScriptLib.IsChallengeStartedByChallengeIndex(context,base_info.group_id,father_challenge_id) then
ScriptLib.StopChallenge(context, father_challenge_id, 1)
end
--父挑战完成
@ -92,15 +92,15 @@ function action_EVENT_VARIABLE_CHANGE_FindRock_Trigger(context,evt)
ScriptLib.RevokePlayerShowTemplateReminder(context, 199, {_hostuid})
--关挑战用时检测器
ScriptLib.EndTimeAxis(context, "challenge_timer")
return 0
return 0
end
function action_EVENT_VARIABLE_CHANGE_BeatMonster_Trigger(context,evt) return 0 end
function action_EVENT_VARIABLE_CHANGE_FindClue_Trigger(context,evt) return 0 end
function action_EVENT_VARIABLE_CHANGE_PuzzleProgress_Trigger(context,evt) return 0 end
function action_EVENT_CHALLENGE_FAIL(context,evt)
ScriptLib.PrintContextLog(context,"## Activity_RockBoardExplore action_EVENT_CHALLENGE_FAIL")
if evt.param1 ~= father_challenge_id then
return 0
if evt.param1 ~= father_challenge_id then
return 0
end
--结束挑战时(失败),发埋点
--[[【3.1 backlog内】数据埋点 - 探索活动TD相关运营埋点】
@ -130,14 +130,14 @@ end
function action_EVENT_VARIABLE_CHANGE(context,evt)
ScriptLib.PrintContextLog(context,"## Activity_RockBoardExplore action_EVENT_VARIABLE_CHANGE:evt.source_name = ".. evt.source_name.."| value = "..evt.param1)
for k,v in pairs(challenge_list) do
if evt.source_name == k then
if evt.param1 == 0 then
if evt.source_name == k then
if evt.param1 == 0 then
local _uidlist = ScriptLib.GetSceneUidList(context)
if ScriptLib.IsChallengeStartedByChallengeIndex(context,base_info.group_id,father_challenge_id) then
if ScriptLib.IsChallengeStartedByChallengeIndex(context,base_info.group_id,father_challenge_id) then
ScriptLib.AttachChildChallenge(context,father_challenge_id,v,v,{3,v,challenge_goal[k],1,0},_uidlist,{success=1,fail=1})
end
end
if evt.param1 > 0 then
if evt.param1 > 0 then
ScriptLib.SetGroupVariableValue(context,k.."_Trigger",1)
end
@ -168,7 +168,7 @@ function action_EVENT_TIME_AXIS_PASS_tick(context,evt)
end
if _iswiget == false then
ScriptLib.PrintContextLog(context,"## Activity_RockBoardExplore action_EVENT_TIME_AXIS_PASS_tick:_iswiget == false")
if _isshow == 0 then
if _isshow == 0 then
ScriptLib.PrintContextLog(context,"## Activity_RockBoardExplore action_EVENT_TIME_AXIS_PASS_tick:ShowTemplateReminder")
ScriptLib.AssignPlayerShowTemplateReminder(context,199,{param_uid_vec={},param_vec={},uid_vec={_hostuid}})
ScriptLib.SetGroupTempValue(context,"isshow",1,{})
@ -187,11 +187,11 @@ end
function action_EVENT_ENTER_REGION(context,evt)
ScriptLib.PrintContextLog(context,"## Activity_RockBoardExplore action_EVENT_ENTER_REGION:evt.uid"..evt.uid)
--判断是否目标region
if evt.param1 ~= defs.enter_region then
if evt.param1 ~= defs.enter_region then
return 0
end
--判断是否已开挑战
if ScriptLib.IsChallengeStartedByChallengeIndex(context,base_info.group_id,father_challenge_id) then
if ScriptLib.IsChallengeStartedByChallengeIndex(context,base_info.group_id,father_challenge_id) then
return 0
end
--开挑战,从存档进度开始
@ -205,7 +205,7 @@ function action_EVENT_ENTER_REGION(context,evt)
for k,v in pairs(challenge_list) do
local _score = ScriptLib.GetGroupVariableValue(context,k)
ScriptLib.PrintContextLog(context,"## Activity_RockBoardExplore action_EVENT_ENTER_REGION:"..k .."=".. _score.."|v="..v)
if _score >= 0 then
if _score >= 0 then
if _score < challenge_goal[k] then
ScriptLib.AttachChildChallenge(context,father_challenge_id,v,v,{3,v,challenge_goal[k],1,_score},_uidlist,{success=1,fail=1})
end
@ -226,7 +226,7 @@ function action_EVENT_ENTER_REGION(context,evt)
end
function action_EVENT_LEAVE_REGION(context,evt)
ScriptLib.PrintContextLog(context,"## Activity_RockBoardExplore action_EVENT_LEAVE_REGION:")
if evt.param1 == defs.leave_region then
if evt.param1 == defs.leave_region then
if ScriptLib.IsChallengeStartedByChallengeIndex(context,base_info.group_id,father_challenge_id) then
ScriptLib.StopChallenge(context, father_challenge_id, 0)
end
@ -259,7 +259,7 @@ end
--初始化
function Initialize()
--加触发器
if temp_Tirgger ~= nil then
if temp_Tirgger ~= nil then
for k,v in pairs(temp_Tirgger) do
v.name = v.action
v.config_id = 40000000 + k
@ -270,7 +270,7 @@ function Initialize()
end
end
--加变量
if temp_Variables ~= nil then
if temp_Variables ~= nil then
for k,v in pairs(temp_Variables) do
table.insert(variables,v)
end
@ -278,4 +278,4 @@ function Initialize()
return 0
end
Initialize()
Initialize()

View File

@ -8,7 +8,7 @@
--需求misc
--[[
defs ={
local defs ={
gallery_id = 27004,
finish_region = 111,
}
@ -52,13 +52,13 @@ end
function action_EVENT_DUNGEON_SETTLE(context,evt)
ScriptLib.PrintContextLog(context,"## Activity_WindMaze_Battle action_EVENT_DUNGEON_SETTLE" )
LF_Try_End(context,true)
return 0
return 0
end
--团灭检测器
function action_EVENT_DUNGEON_ALL_AVATAR_DIE(context,evt)
ScriptLib.PrintContextLog(context,"## Activity_WindMaze_Battle action_EVENT_DUNGEON_ALL_AVATAR_DIE|evt.uid="..evt.uid)
local _uidlist = ScriptLib.GetSceneUidList(context)
for i = 1 ,#_uidlist do
for i = 1 ,#_uidlist do
if ScriptLib.IsPlayerAllAvatarDie(context,_uidlist[i]) == false then --任一活着则结束
return 0
end
@ -82,7 +82,7 @@ function action_EVENT_GALLERY_STOP(context,evt)
GALLERY_STOP_FINISHED = 9; // gallery
GALLERY_STOP_FUNGUS_ALL_DIE = 10; // 3.2gallery stop
} ]]
if evt.param3 == 3 or evt.param3 == 9 then
if evt.param3 == 3 or evt.param3 == 9 then
ScriptLib.CauseDungeonSuccess(context)
else
ScriptLib.CauseDungeonFail(context)
@ -93,9 +93,9 @@ function action_EVENT_ANY_MONSTER_DIE(context,evt)
ScriptLib.PrintContextLog(context,"## Activity_WindMaze_Battle action_EVENT_ANY_MONSTER_DIE")
--watcher累计杀怪
local _uidlist = ScriptLib.GetSceneUidList(context)
for i = 1 , #_uidlist do
for i = 1 , #_uidlist do
ScriptLib.AddExhibitionAccumulableDataAfterSuccess(context, _uidlist[i], "Activity_WindField_5_Monster", 1, {play_type=ExhibitionPlayType.Gallery,gallery_id=defs.gallery_id})
end
end
ScriptLib.ChangeGroupVariableValue(context,"killed_monster",1)
return 0
end
@ -109,7 +109,7 @@ function action_EVENT_ANY_GADGET_DIE(context,evt)--吃金币
--查询gadgetid
local _gadgetid = 0
for k,v in pairs(gadgets) do
if v.config_id == evt.param1 then
if v.config_id == evt.param1 then
_gadgetid = v.gadget_id
break
end
@ -121,26 +121,26 @@ function action_EVENT_ANY_GADGET_DIE(context,evt)--吃金币
ScriptLib.ChangeGroupTempValue(context,"level_5_coin_sum",1,{})
--watcher单局吃金币
local _uidlist = ScriptLib.GetSceneUidList(context)
for i = 1 , #_uidlist do
for i = 1 , #_uidlist do
ScriptLib.AddExhibitionReplaceableDataAfterSuccess(context, _uidlist[i], "Activity_WindField_5_Coin", 1, {play_type=ExhibitionPlayType.Gallery,gallery_id=defs.gallery_id})
end
end
end
return 0
end
end
function action_EVENT_VARIABLE_CHANGE(context,evt)
ScriptLib.PrintContextLog(context,"## Activity_WindMaze_Battle action_EVENT_VARIABLE_CHANGE:"..evt.source_name.." = "..evt.param1)
if evt.source_name == "cur_stage" then
local _uidlist = ScriptLib.GetSceneUidList(context)
if evt.param1 == 1 then
if evt.param1 == 1 then
--第一阶段先开gallery
ScriptLib.SetPlayerStartGallery(context,defs.gallery_id,_uidlist)
--设置复活点
ScriptLib.SetGalleryRevivePoint(context, defs.gallery_id, base_info.group_id, Stage_Battle.Revive_Point)
elseif evt.param1 == 6 then
--watcher完成
for i = 1 , #_uidlist do
for i = 1 , #_uidlist do
ScriptLib.AddExhibitionReplaceableDataAfterSuccess(context, _uidlist[i], "Activity_WindField_5_LevelFinish", 1, {play_type=ExhibitionPlayType.Gallery,gallery_id=defs.gallery_id})
end
end
--最后完成
LF_Try_End(context,false)
elseif evt.param1 == 0 then
@ -175,23 +175,23 @@ function action_EVENT_VARIABLE_CHANGE(context,evt)
end
ScriptLib.SetGroupVariableValue(context,"killed_monster",0)
ScriptLib.SetGroupVariableValue(context,"coin",0)
elseif evt.source_name == "killed_monster" then
elseif evt.source_name == "killed_monster" then
ScriptLib.UpdatePlayerGalleryScore(context,defs.gallery_id,{[evt.source_name] = evt.param1})
elseif evt.source_name == "coin" then
elseif evt.source_name == "coin" then
ScriptLib.UpdatePlayerGalleryScore(context,defs.gallery_id,{[evt.source_name] = evt.param1})
--二阶段吃金币奖励buff
if ScriptLib.GetGroupVariableValue(context,"cur_stage") == 2 and evt.param1 == defs.stage2_coin_goal then
if ScriptLib.GetGroupVariableValue(context,"cur_stage") == 2 and evt.param1 == defs.stage2_coin_goal then
local _uidlist = ScriptLib.GetSceneUidList(context)
for i = 1 , #_uidlist do
for i = 1 , #_uidlist do
--ScriptLib.AttachGalleryTeamAbilityGroup(context, {_uidlist[i]}, defs.gallery_id, 0)
ScriptLib.SetTeamServerGlobalValue(context, _uidlist[i], "SGV_WindField_Buff_1", 1)
end
ScriptLib.ChangeGroupTempValue(context,"data_buff_times",1,{})
end
--三阶段吃金币奖励buff
if ScriptLib.GetGroupVariableValue(context,"cur_stage") == 4 and evt.param1 == defs.stage4_coin_goal then
if ScriptLib.GetGroupVariableValue(context,"cur_stage") == 4 and evt.param1 == defs.stage4_coin_goal then
local _uidlist = ScriptLib.GetSceneUidList(context)
for i = 1 , #_uidlist do
for i = 1 , #_uidlist do
--ScriptLib.AttachGalleryTeamAbilityGroup(context, {_uidlist[i]}, defs.gallery_id, 0)
ScriptLib.SetTeamServerGlobalValue(context, _uidlist[i], "SGV_WindField_Buff_2", 1)
end
@ -210,7 +210,7 @@ end
--初始化
function Initialize()
--加触发器
if temp_Tirgger ~= nil then
if temp_Tirgger ~= nil then
for k,v in pairs(temp_Tirgger) do
v.name = v.action
v.config_id = 40000000 + k
@ -221,7 +221,7 @@ function Initialize()
end
end
--加变量
if temp_Variables ~= nil then
if temp_Variables ~= nil then
for k,v in pairs(temp_Variables) do
v.config_id = 50000000 + k
table.insert(variables,v)
@ -230,4 +230,4 @@ function Initialize()
return 0
end
Initialize()
Initialize()

View File

@ -8,7 +8,7 @@
--需求misc
--[[
defs ={
local defs ={
gallery_id = 27004,
finish_region = 111,
challenge_id = 2,
@ -65,7 +65,7 @@ function action_EVENT_DUNGEON_ALL_AVATAR_DIE(context,evt)
ScriptLib.PrintContextLog(context,"## Activity_WindMaze_Normal action_EVENT_DUNGEON_ALL_AVATAR_DIE:_uidlist == nil")
return 0
end
for i = 1 ,#_uidlist do
for i = 1 ,#_uidlist do
if ScriptLib.IsPlayerAllAvatarDie(context,_uidlist[i]) == false then --任一活着则结束
return 0
end
@ -102,7 +102,7 @@ function action_EVENT_GALLERY_STOP(context,evt)
GALLERY_STOP_FINISHED = 9; // gallery
GALLERY_STOP_FUNGUS_ALL_DIE = 10; // 3.2gallery stop
} ]]
if evt.param3 == 3 or evt.param3 == 9 then
if evt.param3 == 3 or evt.param3 == 9 then
ScriptLib.CauseDungeonSuccess(context)
else
ScriptLib.CauseDungeonFail(context)
@ -132,13 +132,13 @@ function action_EVENT_GADGET_STATE_CHANGE(context,evt)--吃大球
--查询gadget_id
local _gadgetid = 0
for k,v in pairs(gadgets) do
if v.config_id == evt.param2 then
if v.config_id == evt.param2 then
_gadgetid = v.gadget_id
break
end
end
ScriptLib.PrintContextLog(context,"## Activity_WindMaze_Normal action_EVENT_GADGET_STATE_CHANGE: _gadgetid=" .. _gadgetid)
if _gadgetid == Stage_Normal.BigOrb_Gadget_ID and evt.param1 == 201 then
if _gadgetid == Stage_Normal.BigOrb_Gadget_ID and evt.param1 == 201 then
--如果大球切了
if ScriptLib.GetGroupTempValue(context,"Ball_Cfgid",{}) ==0 then
--且没有正在进行的吃球挑战
@ -152,7 +152,7 @@ function action_EVENT_ANY_GADGET_DIE(context,evt)--吃金币、吃小球
--查询gadgetid
local _gadgetid = 0
for k,v in pairs(gadgets) do
if v.config_id == evt.param1 then
if v.config_id == evt.param1 then
_gadgetid = v.gadget_id
break
end
@ -167,13 +167,13 @@ function action_EVENT_ANY_GADGET_DIE(context,evt)--吃金币、吃小球
ScriptLib.PrintContextLog(context,"## Activity_WindMaze_Normal action_EVENT_ANY_GADGET_DIE:_uidlist == nil")
return 0
end
if level_list == nil then
if level_list == nil then
return 0
end
if level_list[base_info.group_id] == nil then
if level_list[base_info.group_id] == nil then
return 0
end
for i = 1 , #_uidlist do
for i = 1 , #_uidlist do
ScriptLib.PrintContextLog(context,"## Activity_WindMaze_Normal action_EVENT_ANY_GADGET_DIE:level_list[base_info.group_id] = "..level_list[base_info.group_id])
ScriptLib.AddExhibitionReplaceableDataAfterSuccess(context, _uidlist[i], "Activity_WindField_"..level_list[base_info.group_id].."_Coin", 1, {play_type=ExhibitionPlayType.Gallery,gallery_id=defs.gallery_id})
end
@ -186,7 +186,7 @@ function action_EVENT_ANY_GADGET_DIE(context,evt)--吃金币、吃小球
ScriptLib.UpdatePlayerGalleryScore(context,defs.gallery_id,{["ball_current_count"] = ScriptLib.GetGroupTempValue(context,"temp_ball_current_count",{})})
end
return 0
end
end
function action_EVENT_ENTER_REGION(context,evt)
ScriptLib.PrintContextLog(context,"## Activity_WindMaze_Normal action_EVENT_ENTER_REGION:p1="..evt.param1.."|defs.finish_region="..defs.finish_region)
if evt.param1 == defs.finish_region then
@ -198,15 +198,15 @@ function action_EVENT_ENTER_REGION(context,evt)
ScriptLib.PrintContextLog(context,"## Activity_WindMaze_Normal action_EVENT_ENTER_REGION:level_list == nil")
return 0
end
if level_list[base_info.group_id] == nil then
if level_list[base_info.group_id] == nil then
return 0
end
if level_list[base_info.group_id] == 4 then
if level_list[base_info.group_id] == 4 then
--ScriptLib.AttachGalleryTeamAbilityGroup(context, {evt.uid}, defs.gallery_id, 0)
end
ScriptLib.PrintContextLog(context,"## Activity_WindMaze_Normal action_EVENT_ENTER_REGION:清空陈列室替换值=".."Activity_WindField_"..level_list[base_info.group_id].."_Ball")
--清空陈列室替换值
--球
--球
ScriptLib.ClearExhibitionReplaceableData(context, evt.uid, "Activity_WindField_"..level_list[base_info.group_id].."_Ball")
--金币
ScriptLib.ClearExhibitionReplaceableData(context, evt.uid, "Activity_WindField_"..level_list[base_info.group_id].."_Coin")
@ -214,7 +214,7 @@ function action_EVENT_ENTER_REGION(context,evt)
return 0
end
function LF_Check_Finish(context,is_enter_region)
ScriptLib.PrintContextLog(context,"## Activity_WindMaze_Normal LF_Check_Finish:")
ScriptLib.PrintContextLog(context,"## Activity_WindMaze_Normal LF_Check_Finish:")
--[[ --Step1 检查吃够球了没【砍了】
local _maxcount = 0
for k,v in pairs(gadgets) do
@ -223,9 +223,9 @@ function LF_Check_Finish(context,is_enter_region)
end
end
local _ball = ScriptLib.GetGroupVariableValue(context,"element_ball")
if _ball < _maxcount then
if _ball < _maxcount then
--没吃够球弹reminderreturn
ScriptLib.PrintContextLog(context,"## Activity_WindMaze_Normal LF_Check_Finish:没吃够球弹reminderreturn")
ScriptLib.PrintContextLog(context,"## Activity_WindMaze_Normal LF_Check_Finish:没吃够球弹reminderreturn")
ScriptLib.ShowReminder(context,470210101)
return 0
end ]]
@ -234,7 +234,7 @@ function LF_Check_Finish(context,is_enter_region)
--2.1 取活着的玩家_alive_uidlist
local _eid = ScriptLib.GetEntityIdByConfigId(context, defs.finish_region)
local _count = ScriptLib.GetRegionEntityCount(context, { region_eid =_eid, entity_type = EntityType.AVATAR })
ScriptLib.PrintContextLog(context,"## Activity_WindMaze_Normal LF_Check_Finish:_count".._count)
ScriptLib.PrintContextLog(context,"## Activity_WindMaze_Normal LF_Check_Finish:_count".._count)
local _alive_uidlist = {}
local _uidlist = ScriptLib.GetSceneUidList(context)
if _uidlist == nil then
@ -242,21 +242,21 @@ function LF_Check_Finish(context,is_enter_region)
return 0
end
for i = 1 , #_uidlist do
if ScriptLib.IsPlayerAllAvatarDie(context, _uidlist[i]) == false then
if ScriptLib.IsPlayerAllAvatarDie(context, _uidlist[i]) == false then
table.insert(_alive_uidlist,_uidlist[i])
end
end
--2.2 判断活着的玩家都到达
if _count == 0 then
ScriptLib.PrintContextLog(context,"## Activity_WindMaze_Normal LF_Check_Finish:终点位置没人")
if _count == 0 then
ScriptLib.PrintContextLog(context,"## Activity_WindMaze_Normal LF_Check_Finish:终点位置没人")
--终点没人return
return 0
end
if _count ~= #_alive_uidlist then
if _count ~= #_alive_uidlist then
--还有人没到达终点return
if is_enter_region == true then
--如果这次检测是由enter_region引起则提示玩家
ScriptLib.PrintContextLog(context,"## Activity_WindMaze_Normal LF_Check_Finish:需要全部人到达终点弹reminderreturn")
ScriptLib.PrintContextLog(context,"## Activity_WindMaze_Normal LF_Check_Finish:需要全部人到达终点弹reminderreturn")
ScriptLib.ShowReminder(context,470210102)
end
return 0
@ -265,13 +265,13 @@ function LF_Check_Finish(context,is_enter_region)
--完成watcher[要先于gallerystop执行
--watcher完成
--local _uidlist = ScriptLib.GetSceneUidList(context)--上面有了
if level_list == nil then
if level_list == nil then
return 0
end
if level_list[base_info.group_id] == nil then
if level_list[base_info.group_id] == nil then
return 0
end
for i = 1 , #_uidlist do
for i = 1 , #_uidlist do
ScriptLib.AddExhibitionReplaceableDataAfterSuccess(context, _uidlist[i], "Activity_WindField_"..level_list[base_info.group_id].."_LevelFinish", 1, {play_type=ExhibitionPlayType.Gallery,gallery_id=defs.gallery_id})
end
@ -292,17 +292,17 @@ function action_EVENT_VARIABLE_CHANGE(context,evt)
LF_Try_FinishBall(context)
--gm结束
--正式:
elseif evt.source_name == "ball_count" then
if evt.param1 == 0 then
elseif evt.source_name == "ball_count" then
if evt.param1 == 0 then
LF_Try_FinishBall(context)
end
elseif evt.source_name == "element_ball" then
elseif evt.source_name == "element_ball" then
ScriptLib.UpdatePlayerGalleryScore(context,defs.gallery_id,{[evt.source_name] = evt.param1})
elseif evt.source_name == "killed_monster" then
elseif evt.source_name == "killed_monster" then
ScriptLib.UpdatePlayerGalleryScore(context,defs.gallery_id,{[evt.source_name] = evt.param1})
elseif evt.source_name == "coin" then
elseif evt.source_name == "coin" then
ScriptLib.UpdatePlayerGalleryScore(context,defs.gallery_id,{[evt.source_name] = evt.param1})
end
return 0
@ -315,7 +315,7 @@ function action_EVENT_GROUP_LOAD(context,evt)
return 0
end
function LF_Try_End(context,is_fail)
if is_fail then
if is_fail then
ScriptLib.PrintContextLog(context,"## Activity_WindMaze_Normal LF_Try_End:true")
else
ScriptLib.PrintContextLog(context,"## Activity_WindMaze_Normal LF_Try_End:false")
@ -345,8 +345,8 @@ function LF_Try_StartBall(context,ball_id)
return 0
end
local _time = defs.ball_challenge_time
if _time == nil then
_time = Stage_Normal.Ball_Challenge_Time
if _time == nil then
_time = Stage_Normal.Ball_Challenge_Time
ScriptLib.PrintGroupWarning(context,"## Activity_WindMaze_Normal LF_Try_StartBall:没配吃球挑战时间设为20秒")
else
end
@ -433,7 +433,7 @@ function LF_Try_FinishBall(context)
ScriptLib.SetGroupTempValue(context,"BigOrb_Is_Fisnish_".._cfgid,1,{})
--重置其他大球
for k,v in pairs(windball_list) do
if ScriptLib.GetGroupTempValue(context,"BigOrb_Is_Fisnish_"..k,{}) ~= 1 then
if ScriptLib.GetGroupTempValue(context,"BigOrb_Is_Fisnish_"..k,{}) ~= 1 then
ScriptLib.SetGadgetStateByConfigId(context,k,0)
end
end
@ -449,13 +449,13 @@ function LF_Try_FinishBall(context)
ScriptLib.PrintContextLog(context,"## Activity_WindMaze_Normal LF_Try_StartBall:_uidlist == nil")
return 0
end
if level_list == nil then
if level_list == nil then
return 0
end
if level_list[base_info.group_id] == nil then
if level_list[base_info.group_id] == nil then
return 0
end
for i = 1 , #_uidlist do
for i = 1 , #_uidlist do
ScriptLib.AddExhibitionReplaceableDataAfterSuccess(context, _uidlist[i], "Activity_WindField_"..level_list[base_info.group_id].."_Ball", 1, {play_type=ExhibitionPlayType.Gallery,gallery_id=defs.gallery_id})
end
return 0
@ -481,7 +481,7 @@ end
--初始化
function Initialize()
--加触发器
if temp_Tirgger ~= nil then
if temp_Tirgger ~= nil then
for k,v in pairs(temp_Tirgger) do
v.name = v.action
v.config_id = 40000000 + k
@ -492,7 +492,7 @@ function Initialize()
end
end
--加变量
if temp_Variables ~= nil then
if temp_Variables ~= nil then
for k,v in pairs(temp_Variables) do
v.config_id = 50000000 + k
table.insert(variables,v)
@ -501,4 +501,4 @@ function Initialize()
return 0
end
Initialize()
Initialize()

View File

@ -8,7 +8,7 @@
--需求defs
--[[
defs = {
local defs = {
challenge_id = 111,
enter_region = 1,
leave_region = 1,
@ -110,7 +110,7 @@ function action_EVENT_ENTER_REGION(context,evt)
end
local _cur_count = ScriptLib.GetGroupVariableValue(context,"SET_TRIGGER")
if _cur_count >= defs.trigger_time then
if _cur_count >= defs.trigger_time then
ScriptLib.PrintContextLog(context, "## CampChallenge : action_EVENT_ENTER_REGION:".."_cur_count >= defs.trigger_time")
ScriptLib.FinishGroupLinkBundle(context, base_info.group_id)--保底再次finish一下
return 0 --进度已完成,不开挑战
@ -123,9 +123,9 @@ function action_EVENT_ENTER_REGION(context,evt)
--https://www.tapd.cn/22963631/prong/stories/view/1122963631001540454
local _trans = ScriptLib.GetChallengeTransaction(context, defs.challenge_id)
ScriptLib.MarkGroupLuaAction(context, "Vintage_Camp_1",_trans,{})
--恢复suite内容
if Phase == nil then
if Phase == nil then
ScriptLib.PrintContextLog(context, "## CampChallenge : action_EVENT_ENTER_REGION LD注意没有配置Phase")
return 0
end
@ -134,7 +134,7 @@ function action_EVENT_ENTER_REGION(context,evt)
ScriptLib.PrintContextLog(context, "## CampChallenge : action_EVENT_ENTER_REGION LD注意没有找到Variable:STAGE")
return 0
end
if Phase[_p] == nil then
if Phase[_p] == nil then
ScriptLib.PrintContextLog(context, "## CampChallenge : action_EVENT_ENTER_REGION LD注意没有找到STAGE=".._p.."对应的suite配置")
return 0
end
@ -147,7 +147,7 @@ end
function action_EVENT_LEAVE_REGION(context,evt)
ScriptLib.PrintContextLog(context, "## CampChallenge : action_EVENT_LEAVE_REGION evt.param1="..evt.param1 .. "|defs.leave_region = "..defs.leave_region)
if evt.param1 ~= defs.leave_region then return 0 end
--主客机离开恢复visionType
ScriptLib.SetPlayerGroupVisionType(context, {evt.uid}, {1})
@ -156,7 +156,7 @@ function action_EVENT_LEAVE_REGION(context,evt)
end
--主机离开关挑战
if ScriptLib.IsChallengeStartedByChallengeIndex(context,base_info.group_id,defs.challenge_id) == true then
if ScriptLib.IsChallengeStartedByChallengeIndex(context,base_info.group_id,defs.challenge_id) == true then
ScriptLib.StopChallenge(context, defs.challenge_id, 0)
end
return 0
@ -164,7 +164,7 @@ end
--初始化
function Initialize()
--加触发器
if temp_Tirgger ~= nil then
if temp_Tirgger ~= nil then
for k,v in pairs(temp_Tirgger) do
v.name = v.action
v.config_id = 40000000 + k
@ -175,7 +175,7 @@ function Initialize()
end
end
--加变量
if temp_Variables ~= nil then
if temp_Variables ~= nil then
for k,v in pairs(temp_Variables) do
table.insert(variables,v)
end
@ -183,4 +183,4 @@ function Initialize()
return 0
end
Initialize()
Initialize()

View File

@ -15,9 +15,9 @@ local fever_attenuation = {
-1,-1,-2,-2,-3
}
--地城对应的天气配置
local DungeonWeather = {
10039,10040,10041,10042
}
local DungeonWeather = {
10039,10040,10041,10042
}
--怪物潮
local monster_tide = {
@ -29,7 +29,7 @@ local monster_tide = {
}
defs = {
local defs = {
group_id = 235801002,
worktop_id = 123, --操作台对应的操作数
air_wall = 2005, --场内空气墙对应的ConfigID
@ -82,7 +82,7 @@ local Tri = {
[9] = { name = "dungeon_all_avatar_die", config_id = 8000009, event = EventType.EVENT_DUNGEON_ALL_AVATAR_DIE, source = "", condition = "", action = "action_dungeon_all_avatar_die", trigger_count = 0},
[10] = { name = "dungeon_settle", config_id = 8000010, event = EventType.EVENT_DUNGEON_SETTLE, source = "", condition = "", action = "action_dungeon_settle", trigger_count = 0},
[11] = { name = "enter_start_region", config_id = 8000011, event = EventType.EVENT_ENTER_REGION, source = "", condition = "", action = "action_enter_start_region", trigger_count = 0},
}
function Initialize()
@ -122,7 +122,7 @@ end
--按下操作台按键,启动玩法
function action_select_option(context,evt)
--如果空气墙没有提前创建,那么不会处理开始事件
if 1~= ScriptLib.GetGroupVariableValue(context,"is_air_wall_created") then
if 1~= ScriptLib.GetGroupVariableValue(context,"is_air_wall_created") then
return -1
end
ScriptLib.DelWorktopOptionByGroupId(context, defs.group_id, defs.worktop_id, local_defs.worktop_option)
@ -183,8 +183,8 @@ function action_monster_tide_die(context,evt)
--如果当前怪物潮已经被杀完了
if evt.param1 >= #current_tide_list then
if defs.num_killed_per_tide[current_monster_tide] == 0 then
LF_Refresh_Monster_Tide(context,"Current")
else
LF_Refresh_Monster_Tide(context,"Current")
else
LF_Refresh_Monster_Tide(context,"Next")
end
end
@ -199,7 +199,7 @@ function action_monster_die_before_leave_scene(context,evt)
local monster_fever = monsters[monster_cid].kill_score
LF_Update_Fever(context,monster_fever*fever_ratio)
LF_Update_Score(context,monster_eid)
return 0
return 0
end
@ -207,12 +207,12 @@ function LF_Refresh_Monster_Tide(context, refresh_mode)
local current_monster_tide_index = LF_Get_Current_Monster_Tide(context)
-- ScriptLib.KillMonsterTide(context, defs.group_id, LF_Get_Current_Tide_Num(context))
-- ScriptLib.SetGroupVariableValue(context,"is_tide_being_switched",1)
if refresh_mode == "Current" then
if refresh_mode == "Current" then
LF_Set_Current_Monster_Tide(context, current_monster_tide_index)
LF_Create_Monster_Tide(context,current_monster_tide_index)
ScriptLib.PrintContextLog(context,"FS: Tide Clear Refresh Current")
end
if refresh_mode == "Next" then
if refresh_mode == "Next" then
LF_Set_Current_Monster_Tide(context, current_monster_tide_index + 1)
LF_Create_Monster_Tide(context,current_monster_tide_index + 1)
ScriptLib.PrintContextLog(context,"FS: Tide Clear Refresh Next")
@ -242,7 +242,7 @@ function action_sumo_switch_team(context,evt)
end
--清除当前显示的换队惩罚的reminder
local uid_list = ScriptLib.GetSceneUidList(context)
local ret = ScriptLib.RevokePlayerShowTemplateReminder(context, local_defs.team_noswitch_pubishment_reminder, {})
ScriptLib.RevokePlayerShowTemplateReminder(context, local_defs.punish_inAdvance_reminder, {})
@ -251,7 +251,7 @@ function action_sumo_switch_team(context,evt)
--换队的时候修改team的gv重新刷一下新的avatar身上的加成效果
LF_Set_Team_Global_Value(context,local_defs.team_has_switch,1)
ScriptLib.SetGroupVariableValue(context,"is_noswitch_punishment",0)
return 0
@ -310,7 +310,7 @@ end
--终止玩法方法,关掉各种东西
function LF_Stop_Play(context)
local current_monster_tide = LF_Get_Current_Monster_Tide(context)
--清理一下空气墙,防止其他问题
ScriptLib.RemoveEntityByConfigId(context, defs.group_id, EntityType.GADGET, defs.air_wall)
@ -328,7 +328,7 @@ function LF_Create_Monster_Tide(context,monster_tide_index)
ScriptLib.PrintContextLog(context,"FS: Creating monster tide ["..monster_tide_index.."]")
local monster_config_id_list = monster_tide[monster_tide_index]
--增加怪物潮的计数下一次开启时index会+1防止索引到同一波怪物潮
local tide_num = LF_Get_Current_Tide_Num(context)
local tide_num = LF_Get_Current_Tide_Num(context)
LF_Set_Current_Tide_Num(context,tide_num+1)
local current_monster_tide = LF_Get_Current_Monster_Tide(context)
ScriptLib.AutoMonsterTide(context, tide_num+1, defs.group_id, monster_config_id_list, #monster_config_id_list, tide_suite_config[current_monster_tide].min, tide_suite_config[current_monster_tide].max)
@ -356,7 +356,7 @@ function LF_Activate_Environment_Gadget(context,fever_level)
local config_id = suites[defs.environment_suite].gadgets[i]
local gadget_id = LF_Get_Gadget_Id_By_Config_Id(context,config_id)
--大小火盆
if (gadget_id == 70350306 or gadget_id == 70350307) then
if (gadget_id == 70350306 or gadget_id == 70350307) then
if (fever_level<local_defs.burn_effect_level) then
--点燃小火
--ScriptLib.PrintContextLog(context,"FS: Burn little fire!")
@ -367,21 +367,21 @@ function LF_Activate_Environment_Gadget(context,fever_level)
--ScriptLib.PrintContextLog(context,"FS: Burn middle fire!")
local ret = ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, config_id, 201)
end
if (fever_level >= #fever_progress_table-2) then
if (fever_level >= #fever_progress_table-2) then
--持续喷大火
--ScriptLib.PrintContextLog(context,"FS: Burn super fire!")
ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, config_id, 202)
end
end
--挂灯
if (gadget_id == 70350308) then
if (gadget_id == 70350308) then
if (fever_level>=local_defs.burn_effect_level) then
--点燃小火
ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, config_id, 201)
end
end
--场景氛围
if (gadget_id == 70350309) then
if (gadget_id == 70350309) then
--转到对应的gadgetStatedefault-0、phase1-201、phase2-202、phase3-203、phase4-204
ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, config_id, 200+fever_level)
end
@ -453,7 +453,7 @@ end
--获取当前怪物潮的击杀数量
function LF_Get_Current_Tide_Minion_Killed(context)
local num_minion_killed = ScriptLib.GetGroupVariableValue(context,"num_current_minion_killed")
return num_minion_killed
return num_minion_killed
end
--增加当前怪物潮的击杀数量
@ -475,23 +475,23 @@ end
--server lua call-------------------------------------------------
function SLC_Update_Fever_Ratio(context,new_fever_ratio)
ScriptLib.PrintContextLog(context,"FS: SERVER_LUA_CALL: Changing fever ratio to: "..new_fever_ratio)
ScriptLib.SetGroupVariableValue(context,"fever_ratio",new_fever_ratio)
return 0
return 0
end
--向客户端下发当前的惩罚状态和fever值用于客户端重连时请求
function SLC_Refresh_Team_State(context)
ScriptLib.PrintContextLog(context,"FS: SERVER_LUA_CALL: Request for refresh punishment state: ")
local is_noswitch_punishment = ScriptLib.GetGroupVariableValue(context,"is_noswitch_punishment")
LF_Set_Team_Global_Value(context,"NOSWITCH_PUNISHMENT",is_noswitch_punishment)
local fever = ScriptLib.GetGalleryProgressScore(context, "fever", defs.gallery_id)
LF_Set_Team_Global_Value(context,"fever",fever)
return 0
return 0
end
------------------------------------------------------------------

View File

@ -29,7 +29,7 @@
--defs.punish_inAdvance_reminder_time = 3
------
--defs = {
--local defs = {
-- group_id = 235801002,
-- worktop_id = 123,
-- minion_fever = 5,
@ -129,14 +129,14 @@ function action_group_load(context,evt)
--开场就直接加载氛围物件,不要等玩家开启挑战
--加载环境氛围物件
ScriptLib.AddExtraGroupSuite(context,defs.group_id,defs.environment_suite)
ScriptLib.AddExtraGroupSuite(context,defs.group_id,defs.environment_suite)
return 0
end
--按下操作台按键,启动玩法
function action_select_option(context,evt)
--如果空气墙没有提前创建,那么不会处理开始事件
if 1~= ScriptLib.GetGroupVariableValue(context,"is_air_wall_created") then
if 1~= ScriptLib.GetGroupVariableValue(context,"is_air_wall_created") then
return -1
end
ScriptLib.DelWorktopOptionByGroupId(context, defs.group_id, defs.worktop_id, local_defs.worktop_option)
@ -189,7 +189,7 @@ function action_time_axis_pass(context,evt)
--ScriptLib.PrintContextLog(context,"FS: Showing reminder "..local_defs.team_noswitch_pubishment_reminder)
ScriptLib.ShowTemplateReminder(context, local_defs.team_noswitch_pubishment_reminder, {0})
--ScriptLib.ShowReminder(context, local_defs.team_noswitch_pubishment_reminder)
ScriptLib.SetGroupVariableValue(context,"is_noswitch_punishment",1)
LF_Set_Team_Global_Value(context,local_defs.team_noswitch_pubishment,1)
end
@ -220,16 +220,16 @@ function action_monster_tide_die(context,evt)
local tide_index = tonumber(evt.source_name)
local refresh_end_tide = ScriptLib.GetGroupVariableValue(context,"refresh_end_tide")
if tide_index == refresh_end_tide then
if tide_index == refresh_end_tide then
local elite_num = ScriptLib.GetGroupVariableValue(context,"is_elite_on_ground")
local monster_count = ScriptLib.GetGroupMonsterCount(context)
ScriptLib.PrintContextLog(context,"FS:[TIDE_DIE] 死亡的怪物来源于刷新时手动结束的怪物潮,剩余总怪物数量"..monster_count.."精英怪"..elite_num)
if monster_count == elite_num and elite_num ~= 0 then
if monster_count == elite_num and elite_num ~= 0 then
ScriptLib.PrintContextLog(context,"FS:[TIDE_DIE] 场上仅剩精英怪,标记需要在精英怪死亡时创建新的怪物潮")
ScriptLib.SetGroupVariableValue(context,"is_current_minion_tide_end",1)
end
if monster_count == 0 then
if monster_count == 0 then
ScriptLib.PrintContextLog(context,"FS:[TIDE_DIE] 场上没有怪物了,直接创建")
LF_Create_Monster_Tide(context,current_monster_tide)
ScriptLib.SetGroupVariableValue(context,"is_current_minion_tide_end",0)
@ -283,11 +283,11 @@ function action_monster_die_before_leave_scene(context,evt)
ScriptLib.EndTimeAxis(context,"ELITE_AXIS")
ScriptLib.InitTimeAxis(context,"ELITE_AXIS",time_axis.elite_axis,false)
if ScriptLib.GetGroupVariableValue(context,"is_current_minion_tide_end") == 0 then
if not LF_Is_Current_Index_End(context) then
if not LF_Is_Current_Index_End(context) then
ScriptLib.PrintContextLog(context,"FS:[DEBUG][MonDie] 精英怪死亡当前怪物潮没有触发OVER继续刷新,波次"..LF_Get_Current_Tide_Num(context))
ScriptLib.ContinueAutoMonster(context, defs.group_id, LF_Get_Current_Tide_Num(context))
else
if 0 == ScriptLib.GetGroupMonsterCount(context) then
if 0 == ScriptLib.GetGroupMonsterCount(context) then
ScriptLib.PrintContextLog(context,"FS:[DEBUG] [MonDie]精英怪死亡当前怪物潮已经触发OVER且场上没有Monster重新创建怪物潮")
local current_monster_tide = LF_Get_Current_Monster_Tide(context)
LF_Create_Monster_Tide(context,current_monster_tide)
@ -296,7 +296,7 @@ function action_monster_die_before_leave_scene(context,evt)
end
else
--当前怪物潮已经结束了,因为场上有精英怪被卡住了。精英死亡时,手动开启新的怪物潮
if 0 == ScriptLib.GetGroupMonsterCount(context) then
if 0 == ScriptLib.GetGroupMonsterCount(context) then
ScriptLib.PrintContextLog(context,"FS:[DEBUG][MonDie] 精英怪死亡且场上没有怪物,波次"..LF_Get_Current_Tide_Num(context))
local current_monster_tide = LF_Get_Current_Monster_Tide(context)
LF_Create_Monster_Tide(context,current_monster_tide)
@ -305,7 +305,7 @@ function action_monster_die_before_leave_scene(context,evt)
end
end
end
return 0
end
@ -330,7 +330,7 @@ function action_sumo_switch_team(context,evt)
ScriptLib.UpdatePlayerGalleryScore(context, defs.gallery_id, {["uid"] = uid_list[1], ["noswitch_time"] = defs.noswitch_punishment_interval})
end
--清除当前显示的换队惩罚的reminder
local uid_list = ScriptLib.GetSceneUidList(context)
local ret = ScriptLib.RevokePlayerShowTemplateReminder(context, local_defs.team_noswitch_pubishment_reminder, {})
ScriptLib.RevokePlayerShowTemplateReminder(context, local_defs.punish_inAdvance_reminder, {})
@ -340,7 +340,7 @@ function action_sumo_switch_team(context,evt)
--换队的时候修改team的gv重新刷一下新的avatar身上的加成效果
--ScriptLib.PrintContextLog(context,"FS: team has changed, team_has_change = 1")
LF_Set_Team_Global_Value(context,local_defs.team_has_switch,1)
ScriptLib.SetGroupVariableValue(context,"is_noswitch_punishment",0)
return 0
@ -406,7 +406,7 @@ end
--终止玩法方法,关掉各种东西
function LF_Stop_Play(context)
local current_monster_tide = LF_Get_Current_Monster_Tide(context)
--清理一下空气墙,防止其他问题
ScriptLib.RemoveEntityByConfigId(context, defs.group_id, EntityType.GADGET, defs.air_wall)
@ -428,7 +428,7 @@ end
function LF_Create_Monster_Tide(context,monster_tide_index)
local monster_config_id_list = monster_tide[monster_tide_index]
--增加怪物潮的计数下一次开启时index会+1防止索引到同一波怪物潮
local tide_num = LF_Get_Current_Tide_Num(context)
local tide_num = LF_Get_Current_Tide_Num(context)
LF_Set_Current_Tide_Num(context,tide_num+1)
ScriptLib.PrintContextLog(context,"FS: [DEBUG][CREATE] 创建怪物潮,怪物波次 ["..monster_tide_index.."]".."怪物潮INDEX"..(tide_num+1))
local current_monster_tide = LF_Get_Current_Monster_Tide(context)
@ -449,7 +449,7 @@ function LF_Refresh_Currtent_Monster_Tide(context)
-- ScriptLib.SetGroupVariableValue(context,"is_current_minion_tide_end",1)
LF_Set_Current_Monster_Tide(context,current_monster_tide+1)
--如果场上没有怪就直接创建
if 0 == ScriptLib.GetGroupMonsterCount(context) then
if 0 == ScriptLib.GetGroupMonsterCount(context) then
LF_Create_Monster_Tide(context,current_monster_tide+1)
ScriptLib.SetGroupVariableValue(context,"is_current_minion_tide_end",0)
ScriptLib.PrintContextLog(context,"FS:[DEBUG] [REFRESH]更新怪物潮,刷新怪物,并且标记这一波怪没有结束")
@ -478,7 +478,7 @@ function LF_Create_Elite_Monster(context,elite_index)
ScriptLib.CreateMonsterByConfigIdByPos(context, elite_list[i], v.pos, v.rot)
end
end
end
ScriptLib.SetGroupVariableValue(context,"is_elite_on_ground",#elite_list)
end
@ -523,7 +523,7 @@ function LF_Activate_Environment_Gadget(context,fever_level)
local config_id = suites[defs.environment_suite].gadgets[i]
local gadget_id = LF_Get_Gadget_Id_By_Config_Id(context,config_id)
--大小火盆
if (gadget_id == 70350306 or gadget_id == 70350307) then
if (gadget_id == 70350306 or gadget_id == 70350307) then
if (fever_level<local_defs.burn_effect_level) then
--点燃小火
--ScriptLib.PrintContextLog(context,"FS: Burn little fire!")
@ -534,21 +534,21 @@ function LF_Activate_Environment_Gadget(context,fever_level)
--ScriptLib.PrintContextLog(context,"FS: Burn middle fire!")
local ret = ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, config_id, 201)
end
if (fever_level >= #fever_progress_table-2) then
if (fever_level >= #fever_progress_table-2) then
--持续喷大火
--ScriptLib.PrintContextLog(context,"FS: Burn super fire!")
ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, config_id, 202)
end
end
--挂灯
if (gadget_id == 70350308) then
if (gadget_id == 70350308) then
if (fever_level>=local_defs.burn_effect_level) then
--点燃小火
ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, config_id, 201)
end
end
--场景氛围
if (gadget_id == 70350309) then
if (gadget_id == 70350309) then
--转到对应的gadgetStatedefault-0、phase1-201、phase2-202、phase3-203、phase4-204
ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, config_id, 200+fever_level)
end
@ -670,23 +670,23 @@ end
--server lua call-------------------------------------------------
function SLC_Update_Fever_Ratio(context,new_fever_ratio)
ScriptLib.PrintContextLog(context,"FS: SERVER_LUA_CALL: Changing fever ratio to: "..new_fever_ratio)
ScriptLib.SetGroupVariableValue(context,"fever_ratio",new_fever_ratio)
return 0
return 0
end
--向客户端下发当前的惩罚状态和fever值用于客户端重连时请求
function SLC_Refresh_Team_State(context)
ScriptLib.PrintContextLog(context,"FS: SERVER_LUA_CALL: Request for refresh punishment state: ")
local is_noswitch_punishment = ScriptLib.GetGroupVariableValue(context,"is_noswitch_punishment")
LF_Set_Team_Global_Value(context,"NOSWITCH_PUNISHMENT",is_noswitch_punishment)
local fever = ScriptLib.GetGalleryProgressScore(context, "fever", defs.gallery_id)
LF_Set_Team_Global_Value(context,"fever",fever)
return 0
return 0
end
------------------------------------------------------------------

View File

@ -6,13 +6,13 @@
|| description: 3.2
|| ServerGadgetremote体验
|| LogName: ## [CharAmuse_BaseBall]
|| Protection:
|| Protection:
=======================================]]
--[[
defs = {
local defs = {
defs = {
local defs = {
--玩法范围region cube
play_region = 6010,
--进入时加载内容例如棒球发球机。依次为单人、2人…
@ -25,18 +25,18 @@ defs = {
target = 15,
--射击波次 默认
order =
order =
{
easy,
easy,
normal,
hard,
normal,
hard,
},
--射击波次 云锦
order_yunjin =
order_yunjin =
{
easy,
easy,
normal,
hard,
normal,
@ -46,16 +46,16 @@ defs = {
--从哪一波开始使每个发球机节奏不同0为不处理
diff_from = 0,
multi_shoot =
multi_shoot =
{ --有几个坐标就发几个球,坐标是相对于默认发射点的偏移
[21] = { {x = 0, z = 0}, {x = 0, z = 0}, {x = 0, z = 0} }
},
--波次随机池配置 {{射击模式}, {间隔}}
-- 1-单个普通 2-单个快速 3-双普 4-双快 5-三普 6-三快 7-左右旋 8-单快速左旋 9-(空) 10-单快速右旋 20以上-multi_shoot
seq =
seq =
{
},
easy=
{
@ -70,7 +70,7 @@ defs = {
{ {2,1,2,1,2}, {3,3,3,3,5} },
},
--球物件池
ball_pool =
ball_pool =
{ --普通
[2] = {6006,6007,6008,6009,6031,6032,6033,6035},
--快速
@ -81,7 +81,7 @@ defs = {
[3] = {},
},
--射击基准点位
shoot_points =
shoot_points =
{
--1人
[1] ={6016},
@ -102,7 +102,7 @@ local cfg = {
--主控GroupID
main_group = 251008007,
-- 1-单个普通 2-单个快速 3-双普 4-双快 5-三普 6-三快 7-左右旋 8-单快速左旋 9-(空) 10-单快速右旋
shoot_info =
shoot_info =
{
[1] = { ball_type = 2, shoot_count = 1, rot = { x = 0.000, y = 180.000, z = 0.000 }},
[2] = { ball_type = 1, shoot_count = 1, rot = { x = 0.000, y = 180.000, z = 0.000 }},
@ -144,8 +144,8 @@ function EX_StartGallery(context, prev_context, gallery_id, is_last_level)
local uid_list = ScriptLib.GetSceneUidList(context)
ScriptLib.SetGroupTempValue(context, "player_count", #uid_list, {})
if nil ~= defs.play_suites and nil ~= defs.play_suites[#uid_list] then
ScriptLib.AddExtraGroupSuite(context, base_info.group_id, defs.play_suites[#uid_list])
if nil ~= defs.play_suites and nil ~= defs.play_suites[#uid_list] then
ScriptLib.AddExtraGroupSuite(context, base_info.group_id, defs.play_suites[#uid_list])
end
ScriptLib.SetGroupTempValue(context, "is_last_level", is_last_level, {})
--开启gallery
@ -182,7 +182,7 @@ function action_AirWallVariable_Change(context, evt)
elseif 0 == evt.param1 and 1 == evt.param2 then
for i,v in ipairs(defs.air_wall) do
ScriptLib.RemoveEntityByConfigId(context, 0, EntityType.GADGET, v)
end
end
end
return 0
end
@ -193,7 +193,7 @@ function action_Gallery_Stop(context, evt)
if nil ~= defs.play_suites then
for k,v in pairs(defs.play_suites) do
ScriptLib.RemoveExtraGroupSuite(context, base_info.group_id, v)
end
end
end
--清除全部球
@ -211,7 +211,7 @@ function action_Gallery_Stop(context, evt)
ScriptLib.ExecuteGroupLua(context, cfg.main_group, "EX_EndPlayStage", {0, base_info.group_id})
else
ScriptLib.InitTimeAxis(context, "StopGallery", { 3 } , false)
end
end
end
ScriptLib.PrintContextLog(context,"## [CharAmuse_BaseBall] Gallery stoped. reason@".. evt.param3.." --------------")
return 0
@ -222,8 +222,8 @@ function action_Enter_Play_Region(context, evt)
local uid_list = ScriptLib.GetSceneUidList(context)
ScriptLib.PrintContextLog(context,"## [CharAmuse_BaseBall] Enter_Play_Region. player_count@"..#uid_list)
--地城Group没有卸载 TriggerCount 1 直接上就完了
if nil ~= defs.enter_suites and nil ~= defs.enter_suites[#uid_list] then
ScriptLib.AddExtraGroupSuite(context, base_info.group_id, defs.enter_suites[#uid_list])
if nil ~= defs.enter_suites and nil ~= defs.enter_suites[#uid_list] then
ScriptLib.AddExtraGroupSuite(context, base_info.group_id, defs.enter_suites[#uid_list])
end
return 0
end
@ -242,7 +242,7 @@ function LF_Start_Play(context)
end
ScriptLib.SetGroupTempValue(context, "cur_score", target, {})
ScriptLib.UpdatePlayerGalleryScore(context, gallery_id, { ["max_score"]= target} )
--order_index: 当前执行到defs.order列表中的哪一位
ScriptLib.SetGroupTempValue(context, "order_index", 1, {})
--rand_index 本次在当前难度的池中,随机到哪一条发射序列
@ -252,7 +252,7 @@ function LF_Start_Play(context)
--埋点计数
ScriptLib.SetGroupTempValue(context, "hit", 0, {})
ScriptLib.SetGroupTempValue(context, "wave_num", 0, {})
local order = defs.order
if 28008 == ScriptLib.GetGroupTempValue(context, "gallery_id", {}) then
order = defs.order_yunjin
@ -261,7 +261,7 @@ function LF_Start_Play(context)
return 0
end
LF_StartSequenceShoot_Normal(context, defs.seq[order[1]])
return 0
end
@ -279,11 +279,11 @@ function LF_HandleOrderFinish(context, is_normal)
--order_index ++
local ret = ScriptLib.ChangeGroupTempValue(context, "order_index", 1, {})
if -1 == ret then
if -1 == ret then
ScriptLib.SetGroupTempValue(context, "order_index", 1, {})
end
local order_index = ScriptLib.GetGroupTempValue(context, "order_index", {})
if defs.high_reminder ~= nil and defs.high_from ~= nil and defs.high_from == order_index then
if defs.high_reminder ~= nil and defs.high_from ~= nil and defs.high_from == order_index then
ScriptLib.ShowReminder(context, defs.high_reminder)
end
@ -300,10 +300,10 @@ function LF_HandleOrderFinish(context, is_normal)
ScriptLib.PrintContextLog(context,"## [CharAmuse_BaseBall] LF_HandleOrderFinish. is_normal@"..is_normal.." next order_index@".. order_index)
ScriptLib.ChangeGroupTempValue(context, "time_axis_index", 1, {})
--当前是齐射阶段
if 1 == is_normal then
if 1 == is_normal then
--下一个是齐射还是不齐射
if 0 < defs.diff_from and order_index >= defs.diff_from then
if 0 < defs.diff_from and order_index >= defs.diff_from then
LF_StartSequenceShoot_Diff(context, defs.seq[order[order_index]])
else
LF_StartSequenceShoot_Normal(context, defs.seq[order[order_index]])
@ -342,7 +342,7 @@ function LF_StartSequenceShoot_Normal(context, difficulty)
ScriptLib.PrintContextLog(context,"## [CharAmuse_BaseBall] LF_StartSequenceShoot_Normal. rand_index@"..rand_index)
--打出第一球
LF_CreateBall_All(context, sequence[1][1])
LF_CreateBall_All(context, sequence[1][1])
return 0
end
@ -371,7 +371,7 @@ end
function action_Interval_TimeAxis_Pass(context, evt)
local name = string.sub(evt.source_name, 1, 8)
if "interval" ~= name then
if "interval" ~= name then
return 0
end
@ -387,7 +387,7 @@ function action_Interval_TimeAxis_Pass(context, evt)
ScriptLib.PrintContextLog(context,"## [CharAmuse_BaseBall] Interval_TimeAxis_Pass. order_index@"..order_index.." difficulty@".. difficulty .." rand_index@"..rand_index.." evt.param1@"..evt.param1)
--时间轴中间点
if evt.param1 < #sequence[1] then
LF_CreateBall_All(context, sequence[1][evt.param1 + 1])
LF_CreateBall_All(context, sequence[1][evt.param1 + 1])
--时间轴结束
else
LF_HandleOrderFinish(context, 1)
@ -398,7 +398,7 @@ end
function action_Separate_TimeAxis_Pass(context, evt)
local name = string.sub(evt.source_name, 1, 8)
if "interval" == name then
if "interval" == name then
return 0
end
@ -407,13 +407,13 @@ function action_Separate_TimeAxis_Pass(context, evt)
if 28008 == ScriptLib.GetGroupTempValue(context, "gallery_id", {}) then
order = defs.order_yunjin
end
if nil == order[order_index] then
if nil == order[order_index] then
return 0
end
--还原 发射点的config_id 和 射击序列的index
local div = string.find(evt.source_name, "_")
if nil == div then
if nil == div then
return 0
end
local config_id = tonumber(string.sub(evt.source_name, 1, div - 1))
@ -421,7 +421,7 @@ function action_Separate_TimeAxis_Pass(context, evt)
--校验
local difficulty = defs.seq[order[order_index]]
local sequence = difficulty[rand_index]
if nil == gadgets[config_id] or nil == sequence then
if nil == gadgets[config_id] or nil == sequence then
return 0
end
ScriptLib.PrintContextLog(context,"## [CharAmuse_BaseBall] Separate_TimeAxis_Pass. source_name@"..evt.source_name.. " config_id@"..config_id.." rand_index@"..rand_index)
@ -447,13 +447,13 @@ function LF_CreateBall_All(context, shoot_type)
if 20 < shoot_type then
for k, shoot_point in pairs(defs.shoot_points[player_count]) do
local pos = {
x = gadgets[shoot_point].pos.x,
y = gadgets[shoot_point].pos.y,
local pos = {
x = gadgets[shoot_point].pos.x,
y = gadgets[shoot_point].pos.y,
z = gadgets[shoot_point].pos.z
}
LF_Create_MultiShootBall(context, pos, shoot_type)
end
LF_Create_MultiShootBall(context, pos, shoot_type)
end
else
if nil == cfg.shoot_info[shoot_type] then
@ -468,21 +468,21 @@ function LF_CreateBall_All(context, shoot_type)
if 7 == shoot_type then
for k, shoot_point in pairs(defs.shoot_points[player_count]) do
local pos = {
x = gadgets[shoot_point].pos.x,
y = gadgets[shoot_point].pos.y,
local pos = {
x = gadgets[shoot_point].pos.x,
y = gadgets[shoot_point].pos.y,
z = gadgets[shoot_point].pos.z
}
LF_Create_DualCurveBall(context, pos)
LF_Create_DualCurveBall(context, pos)
end
else
else
for k, shoot_point in pairs(defs.shoot_points[player_count]) do
for i = 1, shoot_count do
local pos = {
x = gadgets[shoot_point].pos.x,
y = gadgets[shoot_point].pos.y,
local pos = {
x = gadgets[shoot_point].pos.x,
y = gadgets[shoot_point].pos.y,
z = gadgets[shoot_point].pos.z + (i-1)*defs.multishoot_distance
}
LF_CreateBallFromPool(context, pos, rot, ball_type)
@ -501,12 +501,12 @@ function LF_CreateBall_Single(context, shoot_point, shoot_type)
ScriptLib.PrintContextLog(context,"## [CharAmuse_BaseBall] LF_CreateBall_Single. shoot_type@"..shoot_type)
if 20 < shoot_type then
local pos = {
x = gadgets[shoot_point].pos.x,
y = gadgets[shoot_point].pos.y,
local pos = {
x = gadgets[shoot_point].pos.x,
y = gadgets[shoot_point].pos.y,
z = gadgets[shoot_point].pos.z
}
LF_Create_MultiShootBall(context, pos)
LF_Create_MultiShootBall(context, pos)
else
if nil == cfg.shoot_info[shoot_type] then
@ -519,18 +519,18 @@ function LF_CreateBall_Single(context, shoot_point, shoot_type)
--出生朝向
local rot = cfg.shoot_info[shoot_type].rot
if 7 == shoot_type then
local pos = {
x = gadgets[shoot_point].pos.x,
y = gadgets[shoot_point].pos.y,
if 7 == shoot_type then
local pos = {
x = gadgets[shoot_point].pos.x,
y = gadgets[shoot_point].pos.y,
z = gadgets[shoot_point].pos.z
}
LF_Create_DualCurveBall(context, pos)
else
LF_Create_DualCurveBall(context, pos)
else
for i = 1, shoot_count do
local pos = {
x = gadgets[shoot_point].pos.x,
y = gadgets[shoot_point].pos.y,
local pos = {
x = gadgets[shoot_point].pos.x,
y = gadgets[shoot_point].pos.y,
z = gadgets[shoot_point].pos.z + (i-1)*defs.multishoot_distance
}
LF_CreateBallFromPool(context, pos, rot, ball_type)
@ -552,10 +552,10 @@ function LF_CreateBallFromPool(context, pos_table, rot_table, ball_type)
for ik , iv in pairs(defs.ball_pool[ball_type]) do
local ret = ScriptLib.CreateGadgetByParamTable(context, {config_id = iv, pos = pos_table, rot = rot_table, sgv_key = {"SGV_BaseBall_State"}, sgv_value = {ball_state} })
if 0 == ret then
if 0 == ret then
return 0
end
end
end
ScriptLib.PrintContextLog(context,"## [CharAmuse_BaseBall] LF_CreateBallFromPool. Create gadget failed. ")
return 0
end
@ -566,20 +566,20 @@ function LF_Create_DualCurveBall(context, pos_table)
if defs.high_from ~= nil and defs.high_from <= ScriptLib.GetGroupTempValue(context, "order_index", {}) then
ball_state = 1
end
--左旋
--左旋
for ik , iv in pairs(defs.ball_pool[4]) do
local ret = ScriptLib.CreateGadgetByParamTable(context, {config_id = iv, pos = pos_table, rot = { x = 0.000, y = 140.000, z = 0.000 }, sgv_key = {"SGV_BaseBall_State"}, sgv_value = {ball_state} })
if 0 == ret then
if 0 == ret then
break
end
end
end
--右旋
for ik , iv in pairs(defs.ball_pool[3]) do
local ret = ScriptLib.CreateGadgetByParamTable(context, {config_id = iv, pos = pos_table, rot = { x = 0.000, y = 220.000, z = 0.000 }, sgv_key = {"SGV_BaseBall_State"}, sgv_value = {ball_state} })
if 0 == ret then
if 0 == ret then
break
end
end
end
return 0
end
@ -600,10 +600,10 @@ function LF_Create_MultiShootBall(context, pos_table, shoot_type)
local pos = { x = pos_table.x + defs.multi_shoot[shoot_type][i].x, y = pos_table.y, z = pos_table.z + defs.multi_shoot[shoot_type][i].z }
for ik , iv in pairs(defs.ball_pool[2]) do
local ret = ScriptLib.CreateGadgetByParamTable(context, {config_id = iv, pos = pos, rot = { x = 0.000, y = 180.000, z = 0.000 }, sgv_key = {"SGV_BaseBall_State"}, sgv_value = {ball_state} })
if 0 == ret then
if 0 == ret then
break
end
end
end
end
return 0
@ -666,7 +666,7 @@ end
function LF_MakeTimeAxis(context, time_table)
local t = {}
for i = 1, #time_table do
for i = 1, #time_table do
local num = 0
for j = i, 1, -1 do
num = num + time_table[j]
@ -676,4 +676,4 @@ function LF_MakeTimeAxis(context, time_table)
return t
end
LF_Initialize()
LF_Initialize()

View File

@ -5,13 +5,13 @@
|| owner: weiwei.sun
|| description: 3.2
|| LogName: ## [CharAmuse_Battle]
|| Protection:
|| Protection:
=======================================]]
--[[
defs = {
local defs = {
--依次刷怪
suite_queue =
suite_queue =
{ --随机情况1
{2,3,4,5},
--随机情况2
@ -49,10 +49,10 @@ function EX_StartGallery(context, prev_context, gallery_id, is_last_level)
if nil ~= defs.play_suites then
for k,v in pairs(defs.play_suites) do
ScriptLib.AddExtraGroupSuite(context, base_info.group_id, v)
end
end
end
local uid_list = ScriptLib.GetSceneUidList(context)
ScriptLib.SetGroupTempValue(context, "player_count", #uid_list, {})
local uid_list = ScriptLib.GetSceneUidList(context)
ScriptLib.SetGroupTempValue(context, "player_count", #uid_list, {})
ScriptLib.SetGroupTempValue(context, "is_last_level", is_last_level, {})
--开启gallery
@ -90,7 +90,7 @@ function action_AirWallVariable_Change(context, evt)
elseif 0 == evt.param1 and 1 == evt.param2 then
for i,v in ipairs(defs.air_wall) do
ScriptLib.RemoveEntityByConfigId(context, 0, EntityType.GADGET, v)
end
end
end
return 0
end
@ -101,12 +101,12 @@ function action_Gallery_Stop(context, evt)
if nil ~= defs.play_suites then
for k,v in pairs(defs.play_suites) do
ScriptLib.RemoveExtraGroupSuite(context, base_info.group_id, v)
end
end
end
ScriptLib.EndAllTimeAxis(context)
if 3 ~= evt.param3 then
if 3 ~= evt.param3 then
local is_last_level = (ScriptLib.GetGroupTempValue(context, "is_last_level", {}) >= 1)
--ScriptLib.InitTimeAxis(context, "StopGallery_Fail", { 3 } , false) 9.21修改 失败不要延时结束
ScriptLib.ExecuteGroupLua(context, cfg.main_group, "EX_EndPlayStage", {1, base_info.group_id})
@ -116,7 +116,7 @@ function action_Gallery_Stop(context, evt)
ScriptLib.ExecuteGroupLua(context, cfg.main_group, "EX_EndPlayStage", {0, base_info.group_id})
else
ScriptLib.InitTimeAxis(context, "StopGallery", { 3 } , false)
end
end
end
ScriptLib.PrintContextLog(context,"## [CharAmuse_Battle] Gallery stoped. reason@".. evt.param3.." --------------")
return 0
@ -124,7 +124,7 @@ end
---------------------------------------------------------------------------------------------------------------
function LF_Start_Play(context)
ScriptLib.SetGroupTempValue(context, "round", 0, {})
local player_count = ScriptLib.GetGroupTempValue(context, "player_count", {})
@ -138,7 +138,7 @@ function LF_Start_Play(context)
end
ScriptLib.SetGroupTempValue(context, "cur_score", target, {})
ScriptLib.UpdatePlayerGalleryScore(context, gallery_id, { ["max_score"]= target} )
--随机序列
math.randomseed(ScriptLib.GetServerTime(context))
local rand_index = math.random(#defs.suite_queue)
@ -154,7 +154,7 @@ function LF_ClearRound(context)
local rand_index = ScriptLib.GetGroupTempValue(context, "rand_index", {})
ScriptLib.RemoveExtraGroupSuite(context, base_info.group_id, defs.suite_queue[rand_index][round])
--埋点
ScriptLib.MarkGroupLuaAction(context, "CharAmuse_BreakingShield", ScriptLib.GetDungeonTransaction(context), {["wave_num"] = round})
ScriptLib.MarkGroupLuaAction(context, "CharAmuse_BreakingShield", ScriptLib.GetDungeonTransaction(context), {["wave_num"] = round})
return 0
end
@ -170,7 +170,7 @@ function LF_StartRound(context)
local rand_index = ScriptLib.GetGroupTempValue(context, "rand_index", {})
if round > #defs.suite_queue[rand_index] then
round = #defs.suite_queue[rand_index]
ScriptLib.SetGroupTempValue(context, "round", round, {})
ScriptLib.SetGroupTempValue(context, "round", round, {})
ScriptLib.PrintContextLog(context,"## [CharAmuse_Battle] LF_StartRound. All round finished. Set to final.")
end
@ -205,7 +205,7 @@ function action_Any_Monster_Die(context)
--客户端弹提示
local is_last_level = (ScriptLib.GetGroupTempValue(context, "is_last_level", {}) >= 1)
ScriptLib.UpdatePlayerGalleryScore(context, gallery_id, { ["is_last_level"] = is_last_level, ["is_finish"] = true, ["is_success"] = true } )
ScriptLib.KillGroupEntity(context, { group_id = base_info.group_id, kill_policy = GroupKillPolicy.GROUP_KILL_MONSTER })
ScriptLib.KillGroupEntity(context, { group_id = base_info.group_id, kill_policy = GroupKillPolicy.GROUP_KILL_MONSTER })
LF_ClearRound(context)
ScriptLib.StopGallery(context, gallery_id, false)
return 0
@ -230,4 +230,4 @@ function action_TimeAxis_NewRound(context, evt)
return 0
end
LF_Initialize()
LF_Initialize()

View File

@ -5,35 +5,35 @@
|| owner: weiwei.sun
|| description: 3.2
|| LogName: ## [CharAmuse_BattleTide]
|| Protection:
|| Protection:
=======================================]]
--[[
defs = {
local defs = {
rule =
rule =
{
[1] =
[1] =
{ --[杀怪数] = { 启动的tide 停止补怪的tide}
[10] = { toStart = {}, toStop = {} },
},
[2] =
[2] =
{ --[杀怪数] = { 启动的tide 停止补怪的tide}
[10] = { toStart = {}, toStop = {}},
},
[3] =
[3] =
{ --[杀怪数] = { 启动的tide 停止补怪的tide}
[10] = { toStart = {}, toStop = {}},
},
[4] =
[4] =
{ --[杀怪数] = { 启动的tide 停止补怪的tide}
[10] = { toStart = {}, toStop = {}},
},
},
--怪物信息 每个tide每次只出一只按次序刷出
tide =
{
tide =
{
[1] = { 1001, 1002 },
[2] = { 1001, 1002 },
[3] = { 1001, 1002 },
@ -70,10 +70,10 @@ function EX_StartGallery(context, prev_context, gallery_id, is_last_level)
if nil ~= defs.play_suites then
for k,v in pairs(defs.play_suites) do
ScriptLib.AddExtraGroupSuite(context, base_info.group_id, v)
end
end
end
local uid_list = ScriptLib.GetSceneUidList(context)
ScriptLib.SetGroupTempValue(context, "player_count", #uid_list, {})
local uid_list = ScriptLib.GetSceneUidList(context)
ScriptLib.SetGroupTempValue(context, "player_count", #uid_list, {})
ScriptLib.SetGroupTempValue(context, "is_last_level", is_last_level, {})
--开启gallery
@ -111,7 +111,7 @@ function action_AirWallVariable_Change(context, evt)
elseif 0 == evt.param1 and 1 == evt.param2 then
for i,v in ipairs(defs.air_wall) do
ScriptLib.RemoveEntityByConfigId(context, 0, EntityType.GADGET, v)
end
end
end
return 0
end
@ -122,10 +122,10 @@ function action_Gallery_Stop(context, evt)
if nil ~= defs.play_suites then
for k,v in pairs(defs.play_suites) do
ScriptLib.RemoveExtraGroupSuite(context, base_info.group_id, v)
end
end
end
if 3 ~= evt.param3 then
if 3 ~= evt.param3 then
local is_last_level = (ScriptLib.GetGroupTempValue(context, "is_last_level", {}) >= 1)
--ScriptLib.InitTimeAxis(context, "StopGallery_Fail", { 3 } , false) 9.21修改 失败不要延时结束
ScriptLib.ExecuteGroupLua(context, cfg.main_group, "EX_EndPlayStage", {1, base_info.group_id})
@ -135,7 +135,7 @@ function action_Gallery_Stop(context, evt)
ScriptLib.ExecuteGroupLua(context, cfg.main_group, "EX_EndPlayStage", {0, base_info.group_id})
else
ScriptLib.InitTimeAxis(context, "StopGallery", { 3 } , false)
end
end
end
--埋点
@ -145,9 +145,9 @@ function action_Gallery_Stop(context, evt)
local gallery_id = ScriptLib.GetGroupTempValue(context, "gallery_id", {})
if 28015 == gallery_id or 28016 == gallery_id then
ScriptLib.MarkGroupLuaAction(context, "CharAmuse_ElecAttack", ScriptLib.GetDungeonTransaction(context), {["reaction"] = counter_1})
ScriptLib.MarkGroupLuaAction(context, "CharAmuse_ElecAttack", ScriptLib.GetDungeonTransaction(context), {["reaction"] = counter_1})
elseif 28017 == gallery_id or 28018 == gallery_id then
ScriptLib.MarkGroupLuaAction(context, "CharAmuse_NormalAttack", ScriptLib.GetDungeonTransaction(context), {["attack"] = counter_2})
ScriptLib.MarkGroupLuaAction(context, "CharAmuse_NormalAttack", ScriptLib.GetDungeonTransaction(context), {["attack"] = counter_2})
end
ScriptLib.PrintContextLog(context,"## [CharAmuse_BattleTide] Gallery stoped. reason@".. evt.param3.." --------------")
return 0
@ -160,7 +160,7 @@ function LF_Start_Play(context)
ScriptLib.SetGroupTempValue(context, "action_counter_2", 0, {})
--怪物队列index初始化
--0: 关闭
--0: 关闭
for k,v in pairs(defs.tide) do
ScriptLib.SetGroupTempValue(context, "tide_"..k, 1, {})
end
@ -350,4 +350,4 @@ function SLC_CharAmuse_BattleAction(context, param1)
return 0
end
LF_Initialize()
LF_Initialize()

View File

@ -5,11 +5,11 @@
|| owner: weiwei.sun
|| description: 3.2
|| LogName: ## [CharAmuse_BrickWall]
|| Protection:
|| Protection:
=======================================]]
--[[
defs = {
local defs = {
}
@ -19,7 +19,7 @@ local cfg = {
main_group = 251008007,
--默认血量
hp =
hp =
{ --[人数] = {各种砖块血量}
[1] = { Normal = 130, Stamina = 200, Line = 500, All = 1200,},
[2] = { Normal = 130, Stamina = 200, Line = 500, All = 1200,},
@ -52,7 +52,7 @@ function EX_StartGallery(context, prev_context, gallery_id, is_last_level)
if nil ~= defs.play_suites then
for k,v in pairs(defs.play_suites) do
ScriptLib.AddExtraGroupSuite(context, base_info.group_id, v)
end
end
end
local uid_list = ScriptLib.GetSceneUidList(context)
ScriptLib.SetGroupTempValue(context, "player_count", #uid_list, {})
@ -93,7 +93,7 @@ function action_AirWallVariable_Change(context, evt)
elseif 0 == evt.param1 and 1 == evt.param2 then
for i,v in ipairs(defs.air_wall) do
ScriptLib.RemoveEntityByConfigId(context, 0, EntityType.GADGET, v)
end
end
end
return 0
end
@ -104,9 +104,9 @@ function action_Gallery_Stop(context, evt)
if nil ~= defs.play_suites then
for k,v in pairs(defs.play_suites) do
ScriptLib.RemoveExtraGroupSuite(context, base_info.group_id, v)
end
end
end
if 3 ~= evt.param3 then
if 3 ~= evt.param3 then
local is_last_level = (ScriptLib.GetGroupTempValue(context, "is_last_level", {}) >= 1)
--ScriptLib.InitTimeAxis(context, "StopGallery_Fail", { 3 } , false) 9.21修改 失败不要延时结束
ScriptLib.ExecuteGroupLua(context, cfg.main_group, "EX_EndPlayStage", {1, base_info.group_id})
@ -116,7 +116,7 @@ function action_Gallery_Stop(context, evt)
ScriptLib.ExecuteGroupLua(context, cfg.main_group, "EX_EndPlayStage", {0, base_info.group_id})
else
ScriptLib.InitTimeAxis(context, "StopGallery", { 3 } , false)
end
end
end
ScriptLib.PrintContextLog(context,"## [CharAmuse_BrickWall] Gallery stoped. reason@".. evt.param3.." --------------")
@ -124,14 +124,14 @@ function action_Gallery_Stop(context, evt)
end
function action_Enter_Play_Region(context, evt)
local uid_list = ScriptLib.GetSceneUidList(context)
ScriptLib.SetGroupTempValue(context, "player_count", #uid_list, {})
--根据当前人数加载suite
local player_count = ScriptLib.GetGroupTempValue(context, "player_count", {})
if nil ~= defs.enter_suites and nil ~= defs.enter_suites[player_count] then
ScriptLib.AddExtraGroupSuite(context, base_info.group_id, defs.enter_suites[player_count])
if nil ~= defs.enter_suites and nil ~= defs.enter_suites[player_count] then
ScriptLib.AddExtraGroupSuite(context, base_info.group_id, defs.enter_suites[player_count])
end
ScriptLib.PrintContextLog(context,"## [CharAmuse_BrickWall] Enter_Play_Region. player_count@"..#uid_list)
@ -139,74 +139,74 @@ function action_Enter_Play_Region(context, evt)
--重新创建砖墙 重置GV、SGV
if 1 < player_count then
if nil ~= defs.hp then
ScriptLib.CreateGadgetByParamTable(context, {config_id = defs.wall, pos = gadgets[defs.wall].pos, rot = gadgets[defs.wall].rot,
ScriptLib.CreateGadgetByParamTable(context, {config_id = defs.wall, pos = gadgets[defs.wall].pos, rot = gadgets[defs.wall].rot,
sgv_key = {
"SGV_BrickWall_Mode",
"SGV_BrickWall_HP_Normal",
"SGV_BrickWall_HP_Stamina",
"SGV_BrickWall_HP_Line",
"SGV_BrickWall_HP_All",
},
},
sgv_value = {
1,
defs.hp[player_count].Normal,
defs.hp[player_count].Stamina,
defs.hp[player_count].Line,
defs.hp[player_count].All,
}
}
})
else
ScriptLib.CreateGadgetByParamTable(context, {config_id = defs.wall, pos = gadgets[defs.wall].pos, rot = gadgets[defs.wall].rot,
ScriptLib.CreateGadgetByParamTable(context, {config_id = defs.wall, pos = gadgets[defs.wall].pos, rot = gadgets[defs.wall].rot,
sgv_key = {
"SGV_BrickWall_Mode",
"SGV_BrickWall_HP_Normal",
"SGV_BrickWall_HP_Stamina",
"SGV_BrickWall_HP_Line",
"SGV_BrickWall_HP_All",
},
},
sgv_value = {
1,
cfg.hp[player_count].Normal,
cfg.hp[player_count].Stamina,
cfg.hp[player_count].Line,
cfg.hp[player_count].All,
}
}
})
end
else
if nil ~= defs.hp then
ScriptLib.CreateGadgetByParamTable(context, {config_id = defs.wall, pos = gadgets[defs.wall].pos, rot = gadgets[defs.wall].rot,
ScriptLib.CreateGadgetByParamTable(context, {config_id = defs.wall, pos = gadgets[defs.wall].pos, rot = gadgets[defs.wall].rot,
sgv_key = {
"SGV_BrickWall_Mode",
"SGV_BrickWall_HP_Normal",
"SGV_BrickWall_HP_Stamina",
"SGV_BrickWall_HP_Line",
"SGV_BrickWall_HP_All",
},
},
sgv_value = {
0,
defs.hp[player_count].Normal,
defs.hp[player_count].Stamina,
defs.hp[player_count].Line,
defs.hp[player_count].All,
}
}
})
else
ScriptLib.CreateGadgetByParamTable(context, {config_id = defs.wall, pos = gadgets[defs.wall].pos, rot = gadgets[defs.wall].rot,
ScriptLib.CreateGadgetByParamTable(context, {config_id = defs.wall, pos = gadgets[defs.wall].pos, rot = gadgets[defs.wall].rot,
sgv_key = {
"SGV_BrickWall_Mode",
"SGV_BrickWall_HP_Normal",
"SGV_BrickWall_HP_Stamina",
"SGV_BrickWall_HP_Line",
"SGV_BrickWall_HP_All",
},
},
sgv_value = {
0,
cfg.hp[player_count].Normal,
cfg.hp[player_count].Stamina,
cfg.hp[player_count].Line,
cfg.hp[player_count].All,
}
}
})
end
@ -229,47 +229,47 @@ function LF_Start_Play(context)
end
ScriptLib.SetGroupTempValue(context, "cur_score", target, {})
ScriptLib.UpdatePlayerGalleryScore(context, gallery_id, { ["max_score"]= target} )
ScriptLib.SetGroupTempValue(context, "cur_num", 0, {})
----测试关存在连续2场砖墙玩法的情况在此重新尝试创建一次砖墙configID在场无事发生
if nil ~= defs.enter_suites and nil ~= defs.enter_suites[player_count] then
ScriptLib.AddExtraGroupSuite(context, base_info.group_id, defs.enter_suites[player_count])
if nil ~= defs.enter_suites and nil ~= defs.enter_suites[player_count] then
ScriptLib.AddExtraGroupSuite(context, base_info.group_id, defs.enter_suites[player_count])
end
--重新创建砖墙 重置GV、SGV。测试期间有两关连续打砖墙的情况
if 1 < player_count then
ScriptLib.CreateGadgetByParamTable(context, {config_id = defs.wall, pos = gadgets[defs.wall].pos, rot = gadgets[defs.wall].rot,
ScriptLib.CreateGadgetByParamTable(context, {config_id = defs.wall, pos = gadgets[defs.wall].pos, rot = gadgets[defs.wall].rot,
sgv_key = {
"SGV_BrickWall_Mode",
"SGV_BrickWall_HP_Normal",
"SGV_BrickWall_HP_Stamina",
"SGV_BrickWall_HP_Line",
"SGV_BrickWall_HP_All",
},
},
sgv_value = {
1,
defs.hp[player_count].Normal,
defs.hp[player_count].Stamina,
defs.hp[player_count].Line,
defs.hp[player_count].All,
}
}
})
else
ScriptLib.CreateGadgetByParamTable(context, {config_id = defs.wall, pos = gadgets[defs.wall].pos, rot = gadgets[defs.wall].rot,
ScriptLib.CreateGadgetByParamTable(context, {config_id = defs.wall, pos = gadgets[defs.wall].pos, rot = gadgets[defs.wall].rot,
sgv_key = {
"SGV_BrickWall_Mode",
"SGV_BrickWall_HP_Normal",
"SGV_BrickWall_HP_Stamina",
"SGV_BrickWall_HP_Line",
"SGV_BrickWall_HP_All",
},
},
sgv_value = {
0,
defs.hp[player_count].Normal,
defs.hp[player_count].Stamina,
defs.hp[player_count].Line,
defs.hp[player_count].All,
}
}
})
end
@ -298,8 +298,8 @@ function SLC_CharAmusePillar_BrickCount(context, param1)
ScriptLib.PrintContextLog(context,"## [CharAmuse_BrickWall] SLC_CharAmusePillar_BrickCount. cur_count@"..cur_num.. " param1@"..param1)
if 0 < param1 and param1 < 999 then
local diff = param1 -cur_num
if 0 <= diff then
local diff = param1 -cur_num
if 0 <= diff then
ScriptLib.UpdatePlayerGalleryScore(context, gallery_id, { ["add_score"]= diff} )
ScriptLib.CharAmusementUpdateScore(context, cfg.main_group, 1, diff)--给MultStage更新分数 服务器侧埋点用
ScriptLib.ChangeGroupTempValue(context, "cur_num", diff, {})
@ -324,7 +324,7 @@ end
--埋点用
function SLC_CharAmusePillar_Report_Normal(context, param1)
if 0 < param1 then
if 0 < param1 then
ScriptLib.PrintContextLog(context,"## [CharAmuse_BrickWall] SLC_CharAmusePillar_Report_Normal. param1@"..param1)
ScriptLib.MarkGroupLuaAction(context, "CharAmuse_BrickWall", ScriptLib.GetDungeonTransaction(context), { ["normal"] = param1 })
end
@ -340,4 +340,4 @@ function SLC_CharAmusePillar_Report_UnNormal(context, param1, param2, param3)
return 0
end
LF_Initialize()
LF_Initialize()

View File

@ -5,12 +5,12 @@
|| owner: weiwei.sun
|| description: 3.2
|| LogName: ## [CharAmuse_FootBall]
|| Protection:
|| Protection:
=======================================]]
--[[
--踢球玩法配置
defs = {
local defs = {
-----全玩法通用配置-----
@ -34,7 +34,7 @@ defs = {
-- 如果是琴的关卡,用这套
Jean = {
-- 球门和空气墙所在的suite
goal_suite =10,
goal_suite =10,
-- 刷球和空气墙的规则
setting = {
-- 单人玩家
@ -60,14 +60,14 @@ defs = {
{ball_suite = {1,2}, wall_suite = {}},
{ball_suite = {3,4}, wall_suite = {2}},
{ball_suite = {3,4}, wall_suite = {4}},
},
},
},
},
},
-- 如果是可莉&烟绯的关卡,用这套
Klee = {
goal_suite =2,
goal_suite =2,
setting = {
[1] = {
{ball_suite = {1,2}, wall_suite = {}},
@ -91,9 +91,9 @@ defs = {
{ball_suite = {1,2}, wall_suite = {}},
{ball_suite = {3,4}, wall_suite = {2}},
{ball_suite = {3,4}, wall_suite = {4}},
},
},
},
},
},
}
@ -101,13 +101,13 @@ defs = {
local cfg = {
main_group = 251008007,
--
gallery_match =
gallery_match =
{
--[1000] = defs.Jean,
[28009] = defs.Klee,
[28010] = defs.Jean
},
monter_score =
monter_score =
{
[20011204] = 1,
[20011305] = 5,
@ -144,7 +144,7 @@ function EX_StartGallery(context, prev_context, gallery_id, is_last_level)
if nil ~= defs.play_suites then
for k,v in pairs(defs.play_suites) do
ScriptLib.AddExtraGroupSuite(context, base_info.group_id, v)
end
end
end
local uid_list = ScriptLib.GetSceneUidList(context)
@ -186,7 +186,7 @@ function action_AirWallVariable_Change(context, evt)
elseif 0 == evt.param1 and 1 == evt.param2 then
for i,v in ipairs(defs.air_wall) do
ScriptLib.RemoveEntityByConfigId(context, 0, EntityType.GADGET, v)
end
end
end
return 0
end
@ -197,13 +197,13 @@ function action_Gallery_Stop(context, evt)
if nil ~= defs.play_suites then
for k,v in pairs(defs.play_suites) do
ScriptLib.RemoveExtraGroupSuite(context, base_info.group_id, v)
end
end
end
LF_ClearRound(context)
ScriptLib.EndAllTimeAxis(context)
if 3 ~= evt.param3 then
if 3 ~= evt.param3 then
local is_last_level = (ScriptLib.GetGroupTempValue(context, "is_last_level", {}) >= 1)
--ScriptLib.InitTimeAxis(context, "StopGallery_Fail", { 3 } , false) 9.21修改 失败不要延时结束
ScriptLib.ExecuteGroupLua(context, cfg.main_group, "EX_EndPlayStage", {1, base_info.group_id})
@ -213,7 +213,7 @@ function action_Gallery_Stop(context, evt)
ScriptLib.ExecuteGroupLua(context, cfg.main_group, "EX_EndPlayStage", {0, base_info.group_id})
else
ScriptLib.InitTimeAxis(context, "StopGallery", { 3 } , false)
end
end
end
ScriptLib.PrintContextLog(context,"## [CharAmuse_FootBall] Gallery stoped. reason@".. evt.param3.." --------------")
return 0
@ -227,7 +227,7 @@ end
---------------------------------------------------------------------------------------------------------------
function LF_Start_Play(context)
ScriptLib.SetGroupTempValue(context, "round", 0, {})
player_count = ScriptLib.GetGroupTempValue(context, "player_count", {})
@ -313,7 +313,7 @@ function LF_StartRound(context)
--如果已经到了LD配置尽头则循环最后一波
if round > #char_type.setting[player_count] then
round = #char_type.setting[player_count]
ScriptLib.SetGroupTempValue(context, "round", round, {})
ScriptLib.SetGroupTempValue(context, "round", round, {})
ScriptLib.PrintContextLog(context,"## [CharAmuse_FootBall] LF_StartRound. All round finished. Set to final.")
end
@ -350,7 +350,7 @@ function LF_StartRound(context)
end
function LF_ClearRound(context)
local player_count = ScriptLib.GetGroupTempValue(context, "player_count", {})
local char_type = LF_GetFootBallCharType(context)
local setting = char_type.setting[player_count]
@ -365,7 +365,7 @@ function LF_ClearRound(context)
end
end
--移除其他
for i = 2, #suites do
for i = 2, #suites do
if defs.Jean.goal_suite ~= i and defs.Klee.goal_suite ~= i and wall_suite ~= i then
ScriptLib.RemoveExtraGroupSuite(context, base_info.group_id, i)
@ -373,7 +373,7 @@ function LF_ClearRound(context)
end
--埋点
local score_gain = ScriptLib.GetGroupTempValue(context, "score_gain", {})
ScriptLib.MarkGroupLuaAction(context, "CharAmuse_Football", ScriptLib.GetDungeonTransaction(context), {["wave_num"] = round, ["score_gain"] = score_gain})
ScriptLib.MarkGroupLuaAction(context, "CharAmuse_Football", ScriptLib.GetDungeonTransaction(context), {["wave_num"] = round, ["score_gain"] = score_gain})
return 0
end
@ -417,7 +417,7 @@ function action_MovingWall_ReachPoint(context, evt)
end
--[[function SLC_CharAmuse_KillSlime(context)
local config_id = ScriptLib.GetMonsterConfigId(context, { monster_eid = context.source_entity_id})
local config_id = ScriptLib.GetMonsterConfigId(context, { monster_eid = context.source_entity_id})
ScriptLib.PrintContextLog(context,"## [CharAmuse_FootBall] SLC_CharAmuse_KillSlime. source_entity_id@".. context.source_entity_id.. " target_entity_id@".. context.target_entity_id.." GetMonsterConfigId@"..config_id)
if nil == cfg.monter_score[monsters[config_id].monster_id] then
ScriptLib.PrintContextLog(context,"## [CharAmuse_FootBall] SLC_CharAmuse_KillSlime. Got unexpected config_id@")
@ -446,7 +446,7 @@ function LF_HandleMonsterDie(context, config_id)
local gallery_id = ScriptLib.GetGroupTempValue(context, "gallery_id", {})
ScriptLib.UpdatePlayerGalleryScore(context, gallery_id, { ["add_score"] = score} )
ScriptLib.CharAmusementUpdateScore(context, cfg.main_group, 1, score)--给MultStage更新分数 服务器侧埋点用
--挑战完成
if 0 >= ScriptLib.GetGroupTempValue(context, "cur_score", {}) then
local is_last_level = (ScriptLib.GetGroupTempValue(context, "is_last_level", {}) >= 1)
@ -472,4 +472,4 @@ function LF_HandleMonsterDie(context, config_id)
return 0
end
LF_Initialize()
LF_Initialize()

View File

@ -5,13 +5,13 @@
|| owner: weiwei.sun
|| description: 3.2
|| LogName: ## [CharAmuse_Main]
|| Protection:
|| Protection:
=======================================]]
--[[
defs = {
local defs = {
--每个房间传送点坐标列表,key为GalleryID
transpoint_list =
transpoint_list =
{
--玩法1
[6001] = {
@ -24,7 +24,7 @@ defs = {
}
--每个小活动关卡Group列表
group_list =
group_list =
{
--玩法1
[6001] = 235800006,
@ -45,17 +45,17 @@ local cfg = {
switchteam_delay = 2,
--需要提前取到GalleryID以创建布设的Group
groups_need_gallery =
groups_need_gallery =
{
[251008011] = {28009, 28010}
},
--战斗关
battle_gallery =
battle_gallery =
{
28013,28014,28015,28016,28017,28018
},
--战斗关
pillar_gallery =
pillar_gallery =
{
28003,28004
}
@ -134,8 +134,8 @@ function action_MPMode_All_PlayerEnter(context, evt)
if 1 == stage_index and 1 ~= has_transed then
ScriptLib.SetGroupTempValue(context, "has_transed", 1, {})
--LF_TranAllPlayerToGalleryPos(context, stage_index) --需要确保客户端Wait界面已经开启所以首次进场时晚一点传送
ScriptLib.PrintContextLog(context, "## [CharAmuse_Main] Trans player on first round. Start timeaxis enterscene_delay。")
ScriptLib.InitTimeAxis(context, "enterscene_delay", { 2 }, false)
ScriptLib.PrintContextLog(context, "## [CharAmuse_Main] Trans player on first round. Start timeaxis enterscene_delay。")
ScriptLib.InitTimeAxis(context, "enterscene_delay", { 2 }, false)
end
ScriptLib.InitTimeAxis(context, "trans_delay", { cfg.trans_delay }, false)
ScriptLib.PrintContextLog(context, "## [CharAmuse_Main] All player enter. Init time axis trans_delay.")
@ -223,7 +223,7 @@ function action_MultiStage_End(context, evt)
--End的是哪一种Stage
local name = string.sub(evt.source_name, 1, 9)
ScriptLib.PrintContextLog(context, "## [CharAmuse_Main] MultiStage_End. stage_index@"..stage_index.." source_name@"..evt.source_name.. " evt.param3@".. evt.param3)
ScriptLib.PrintContextLog(context, "## [CharAmuse_Main] MultiStage_End. stage_index@"..stage_index.." source_name@"..evt.source_name.. " evt.param3@".. evt.param3)
--失败
if 0 == evt.param3 then
if "PlayStage" == name then
@ -234,7 +234,7 @@ function action_MultiStage_End(context, evt)
--成功
ScriptLib.ChangeGroupTempValue(context, "stage_num", 1, {})
--换人与传送 WaitStage_x -> 倒计时 IdleStage_x -> 开始 PlayStage_x
if "WaitStage" == name then
if "WaitStage" == name then
ScriptLib.EndTimeAxis(context, "trans_delay")
--如果首轮传送在WaitStage结束后还没有执行则在此时传送
@ -247,11 +247,11 @@ function action_MultiStage_End(context, evt)
LF_StartIdleStage(context, stage_index)
elseif "IdleStage" == name then
LF_StartPlayStage(context, stage_index)
elseif "PlayStage" == name then
ScriptLib.ChangeGroupTempValue(context, "stage_index", 1, {})
if true == LF_IsAllStageFinish(context) then
ScriptLib.EndSceneMultiStagePlay(context, 1, true)
@ -268,10 +268,10 @@ end
function LF_StartWaitStage(context, stage_index)
local gallery_id = ScriptLib.GetGroupTempValue(context, "gallery_"..stage_index, {})
--开启阶段
ScriptLib.StartSceneMultiStagePlayStage(context, 1, 40, Multistage.CharAmusementPreview, "WaitStage_"..stage_index, { preview_stage_index = stage_index, preview_display_duration = 40})
if 1 < stage_index then
if 1 < stage_index then
ScriptLib.InitTimeAxis(context, "switchteam_delay", {cfg.switchteam_delay}, false)
else
--特殊处理1如果接下来是战斗关则移除打桩关的suite布设
@ -358,7 +358,7 @@ function EX_EndPlayStage( context, prev_context, is_fail, from_group)
ScriptLib.PrintContextLog(context, "## [CharAmuse_Main] EX_EndPlayStage. CauseDungeonSuccess")
return 0
end
return 0
end
@ -371,7 +371,7 @@ function LF_TranAllPlayerToGalleryPos(context, stage_index)
local pos = defs.transpoint_list[gallery_id][k].pos
local rot = defs.transpoint_list[gallery_id][k].rot
ScriptLib.PrintContextLog(context, "## [CharAmuse_Main] LF_TranAllPlayerToGalleryPos. Start trans player@"..v.." X@"..pos.x.. " Y@"..pos.y.. " Z@"..pos.z)
ScriptLib.TransPlayerToPos(context, { uid_list = {v}, pos = pos, radius = 0, rot = rot , is_skip_ui = true })
ScriptLib.TransPlayerToPos(context, { uid_list = {v}, pos = pos, radius = 0, rot = rot , is_skip_ui = true })
end
else
ScriptLib.PrintGroupWarning(context,"## [CharAmuse_Main] LF_TranAllPlayerToGalleryPos: uid_list got nil. ")
@ -387,10 +387,10 @@ function EX_ReTrans(context, prev_context, uid)
for i,v in ipairs(uid_list) do
if v == uid then
local pos = defs.transpoint_list[gallery_id][i].pos
local rot = defs.transpoint_list[gallery_id][i].rot
ScriptLib.TransPlayerToPos(context, { uid_list = {uid}, pos = pos, radius = 0, rot = rot , is_skip_ui = false})
local rot = defs.transpoint_list[gallery_id][i].rot
ScriptLib.TransPlayerToPos(context, { uid_list = {uid}, pos = pos, radius = 0, rot = rot , is_skip_ui = false})
ScriptLib.PrintContextLog(context, "## [CharAmuse_Main] Player@"..uid.." ReTransed.")
end
end
end
return 0
end
@ -398,7 +398,7 @@ end
function LF_IsAllStageFinish(context)
local stage_index = ScriptLib.GetGroupTempValue(context, "stage_index", {})
local gallery_num = ScriptLib.GetGroupTempValue(context, "gallery_num", {})
if stage_index > gallery_num then
if stage_index > gallery_num then
return true
end
return false
@ -407,14 +407,14 @@ end
--需要提前取到GalleryID以创建布设的Group
function LF_SendGalleryIDVec_ToPlayGroup(context, gallery_vec)
for k,v in pairs(cfg.groups_need_gallery) do
for k,v in pairs(cfg.groups_need_gallery) do
for ik,iv in ipairs(v) do
if LF_CheckIsInTable(context, iv, gallery_vec) then
if LF_CheckIsInTable(context, iv, gallery_vec) then
ScriptLib.ExecuteGroupLua(context, k, "EX_SetGalleryID", { iv })
ScriptLib.PrintContextLog(context, "## [CharAmuse_Main] LF_SendGalleryIDVec_ToPlayGroup. To@"..k.." gallery_id@"..iv)
return 0
end
end
end
end
return 0
@ -439,4 +439,4 @@ function LF_Set_Revive_Point(context, gallery_id)
return 0
end
LF_Initialize()
LF_Initialize()

View File

@ -6,11 +6,11 @@
|| owner: weiwei.sun
|| description: 3.2
|| LogName: ## [CharAmuse_Pillar]
|| Protection:
|| Protection:
=======================================]]
--[[
defs = {
local defs = {
--玩法范围region cube
play_region = 12111,
--进入时加载内容例如棒球发球机。依次为单人、2人。。
@ -26,9 +26,9 @@ defs = {
--刷出延迟
refresh_delay = 3,
-----打桩配置-----
matrix =
matrix =
{
{12001,12002,12003,12004,12005,12049},
{12006,12007,12008,12009,12010,12050},
@ -38,7 +38,7 @@ defs = {
{12054,12055,12056,12057,12058,12059},
},
rounds =
rounds =
{ --第一个数字表示普通地板个数,第二个数字表示高级地板个数 迭代第三个数字为特殊布设ID舍弃前两个数字读spec
--单人玩家
[1] = {{1,0},{1,1},{1,1},{1,1},{0,1},{0,1},{0,1},{0,1},{0,1}},
@ -50,7 +50,7 @@ defs = {
[4] = {{4,0},{2,2},{2,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2}}
},
spec =
spec =
{-- pillars = {柱子ConfigID列表}, reward_suite = {奖励suite}
[1] = { pillars = {}, reward_suite = {}}
}
@ -58,21 +58,21 @@ defs = {
high_from = 4,
--每个GalleryID 特殊奖励用哪个Suite
--1000为测试用
reward_by_gallery =
reward_by_gallery =
{
[1000] = {5},
[28003] = {5,6},
[28004] = {5,6},
},
high_reward_by_gallery =
high_reward_by_gallery =
{
[1000] = {5},
[28003] = {7},
[28004] = {7},
},
simple_reward_suite = 4,
}
]]
@ -81,7 +81,7 @@ local cfg = {
main_group = 251008007,
--root格备选区
corner_area =
corner_area =
{
[1] = {11,21,31,12,13,22},
[2] = {14,15,16,25,26,36},
@ -91,7 +91,7 @@ local cfg = {
--4个root格备选区对应的leaf格备选区域
--这个是能算的但数学不好直接列出来
--当计算延申时,首位横纵延申 二三位横向延申 四五位纵向延伸
leaf_area =
leaf_area =
{
[1] = {55,53,64,35,46},
[2] = {52,41,63,32,54},
@ -99,12 +99,12 @@ local cfg = {
[4] = {25,23,14,45,36},
},
--1*1柱子可出现范围 彼此互不相邻
normal_area =
normal_area =
{
21,41,61,13,33,53,25,45,65
},
--矩阵内环,列出来更方便
center_area =
center_area =
{
22,23,24,25,
32, 35,
@ -114,9 +114,9 @@ local cfg = {
tile_length = 5,
--最后一个柱子打下去后多久开始下一波
clear_delay = 30,
hp =
hp =
{ --温迪
[28003] =
[28003] =
{ --人数 = {普通桩,高级桩}
[1] = {1,2},
[2] = {1,3},
@ -159,7 +159,7 @@ function EX_StartGallery(context, prev_context, gallery_id, is_last_level)
if nil ~= defs.play_suites then
for k,v in pairs(defs.play_suites) do
ScriptLib.AddExtraGroupSuite(context, base_info.group_id, v)
end
end
end
local uid_list = ScriptLib.GetSceneUidList(context)
ScriptLib.SetGroupTempValue(context, "player_count", #uid_list, {})
@ -200,7 +200,7 @@ function action_AirWallVariable_Change(context, evt)
elseif 0 == evt.param1 and 1 == evt.param2 then
for i,v in ipairs(defs.air_wall) do
ScriptLib.RemoveEntityByConfigId(context, 0, EntityType.GADGET, v)
end
end
end
return 0
end
@ -211,13 +211,13 @@ function action_Gallery_Stop(context, evt)
if nil ~= defs.play_suites then
for k,v in pairs(defs.play_suites) do
ScriptLib.RemoveExtraGroupSuite(context, base_info.group_id, v)
end
end
end
LF_ClearRound(context)
ScriptLib.EndAllTimeAxis(context)
if 3 ~= evt.param3 then
if 3 ~= evt.param3 then
local is_last_level = (ScriptLib.GetGroupTempValue(context, "is_last_level", {}) >= 1)
--ScriptLib.InitTimeAxis(context, "StopGallery_Fail", { 3 } , false) 9.21修改 失败不要延时结束
ScriptLib.ExecuteGroupLua(context, cfg.main_group, "EX_EndPlayStage", {1, base_info.group_id})
@ -227,7 +227,7 @@ function action_Gallery_Stop(context, evt)
ScriptLib.ExecuteGroupLua(context, cfg.main_group, "EX_EndPlayStage", {0, base_info.group_id})
else
ScriptLib.InitTimeAxis(context, "StopGallery", { 3 } , false)
end
end
end
ScriptLib.PrintContextLog(context,"## [CharAmuse_Pillar] Gallery stoped. reason@".. evt.param3.." --------------")
@ -287,7 +287,7 @@ function LF_StartRound(context)
--如果已经到了LD配置尽头则从头循环
if round > #defs.rounds[player_count] then
round = 1
ScriptLib.SetGroupTempValue(context, "round", round, {})
ScriptLib.SetGroupTempValue(context, "round", round, {})
ScriptLib.PrintContextLog(context,"## [CharAmuse_Pillar] LF_StartRound. All round finished. Set to 1.")
end
@ -355,7 +355,7 @@ function LF_StartRound(context)
--将extend_list覆盖范围从普通柱子备选列表中移除
ScriptLib.PrintContextLog(context,"## [CharAmuse_Pillar] LF_StartRound. normal_area@" ..table.concat( cfg.normal_area, ", ").. " extend_list@"..table.concat( extend_list, ", ").. " root_pos@"..root_pos.." leaf_pos@"..leaf_pos)
for k,v in pairs(cfg.normal_area) do
if false == LF_CheckIsInTable(context, v, extend_list) then
if false == LF_CheckIsInTable(context, v, extend_list) then
if false == LF_CheckIsAround(context, v, root_pos) and false == LF_CheckIsAround(context, v, leaf_pos) then
table.insert(avalid_normal_pos, v)
end
@ -380,7 +380,7 @@ end
--取得两个延展格
--root_pos: 0-root柱子 非空- leaf柱子 决定延展方式
function LF_GetExtendArea(context, pos, root_pos)
local y = pos%10
local x_raw = pos - y
@ -472,7 +472,7 @@ function LF_GetExtendArea(context, pos, root_pos)
ScriptLib.SetGroupTempValue(context, "root_extend_dir", 1, {})
else
ScriptLib.SetGroupTempValue(context, "leaf_extend_dir", 1, {})
end
end
ScriptLib.PrintContextLog(context,"## [CharAmuse_Pillar] LF_GetExtendArea. Final extend_list@".. table.concat( extend_list, ", ") .. ". extend_dir@1")
return extend_list
end
@ -482,7 +482,7 @@ function LF_GetExtendArea(context, pos, root_pos)
ScriptLib.SetGroupTempValue(context, "root_extend_dir", 2, {})
else
ScriptLib.SetGroupTempValue(context, "leaf_extend_dir", 2, {})
end
end
ScriptLib.PrintContextLog(context,"## [CharAmuse_Pillar] LF_GetExtendArea. Final extend_list@".. table.concat( extend_list, ", ") .. ". extend_dir@2")
return extend_list
end
@ -492,7 +492,7 @@ function LF_GetExtendArea(context, pos, root_pos)
ScriptLib.SetGroupTempValue(context, "root_extend_dir", 3, {})
else
ScriptLib.SetGroupTempValue(context, "leaf_extend_dir", 3, {})
end
end
ScriptLib.PrintContextLog(context,"## [CharAmuse_Pillar] LF_GetExtendArea. Final extend_list@".. table.concat( extend_list, ", ") .. ". extend_dir@3")
return extend_list
end
@ -502,7 +502,7 @@ function LF_GetExtendArea(context, pos, root_pos)
ScriptLib.SetGroupTempValue(context, "root_extend_dir", 4, {})
else
ScriptLib.SetGroupTempValue(context, "leaf_extend_dir", 4, {})
end
end
ScriptLib.PrintContextLog(context,"## [CharAmuse_Pillar] LF_GetExtendArea. Final extend_list@".. table.concat( extend_list, ", ") .. ". extend_dir@4")
return extend_list
end
@ -536,7 +536,7 @@ function LF_IsRoundFinish(context)
for ik, iv in pairs(v) do
local state = ScriptLib.GetGadgetStateByConfigId(context, base_info.group_id, iv)
if 201 == state or 202 == state then
ScriptLib.PrintContextLog(context,"## [CharAmuse_Pillar] LF_IsRoundFinish. UnFinished@"..iv)
ScriptLib.PrintContextLog(context,"## [CharAmuse_Pillar] LF_IsRoundFinish. UnFinished@"..iv)
return false
end
end
@ -562,7 +562,7 @@ function SLC_CharAmusePillar_TryCreatReward(context)
return 0
end
local from_state = ScriptLib.GetGadgetStateByConfigId(context, base_info.group_id, config_id)
if 201 ~= from_state and 202 ~= from_state then
if 201 ~= from_state and 202 ~= from_state then
return 0
end
@ -597,7 +597,7 @@ function SLC_CharAmusePillar_TryCreatReward(context)
else
ScriptLib.InitTimeAxis(context, "ClearDelay", { cfg.clear_delay } , false)
end
--是否有spec布设若是则创建对应奖励suite
if 0 < spec_index and nil ~= defs.spec[spec_index] then
for i, v in pairs(defs.spec[spec_index].reward_suite) do
@ -614,7 +614,7 @@ function LF_GetRandRewardSuite(context)
local gallery_id = ScriptLib.GetGroupTempValue(context, "gallery_id", {})
local round = ScriptLib.GetGroupTempValue(context, "round", {})
local reward_suites= {}
if -1 == gallery_id or 0 == gallery_id then
gallery_id = 1000 --无外围测试用
end
@ -622,7 +622,7 @@ function LF_GetRandRewardSuite(context)
if round >= defs.high_from then
reward_suites = defs.high_reward_by_gallery[gallery_id]
else
reward_suites = defs.reward_by_gallery[gallery_id]
reward_suites = defs.reward_by_gallery[gallery_id]
end
local rand_index = math.random(1, #reward_suites)
@ -665,7 +665,7 @@ function LF_Create_Reward(context, suite, target_pos, dir)
end
function LF_CreateGadgetFromPool(context, gadget_id, pos, rot)
if nil == defs.gadget_pool[gadget_id] then
if nil == defs.gadget_pool[gadget_id] then
ScriptLib.PrintGroupWarning(context, "## [CharAmuse_Pillar] Gadget pool got unperpared gadget id!! gadget_id@"..gadget_id)
return 0
end
@ -682,7 +682,7 @@ end
function LF_SelectSingleMainPillar(context)
math.randomseed(ScriptLib.GetServerTime(context))
local rand_index = math.random(1, #cfg.center_area)
local rand_index = math.random(1, #cfg.center_area)
ScriptLib.PrintContextLog(context,"## [CharAmuse_Pillar] LF_SelectSingleMainPillar. Select from center area. rand_index@"..rand_index.. "result@"..cfg.center_area[rand_index])
return cfg.center_area[rand_index]
end
@ -712,7 +712,7 @@ end
function LF_GetConfigIdByPos(context, pos)
local x = math.floor(pos/10)
local y = pos%10
if nil == defs.matrix[x][y] or 0 == defs.matrix[x][y] then
if nil == defs.matrix[x][y] or 0 == defs.matrix[x][y] then
ScriptLib.PrintGroupWarning(context, "## [CharAmuse_Pillar] Pillar matrix is not complete. Check defs!")
return 0
end
@ -737,7 +737,7 @@ function LF_RisePillar(context, config_id, is_deluxe, gallery_id, player_count)
else
ScriptLib.SetEntityServerGlobalValueByConfigId(context, config_id, "SGV_FallAttackPillar_MaxHP", hp_map[1])
ScriptLib.SetGadgetStateByConfigId(context, config_id, 201)
end
end
LF_Create_Reward(context, defs.rise_reward_suite, gadgets[config_id].pos, 0)
ScriptLib.PrintContextLog(context,"## [CharAmuse_Pillar] LF_RisePillar. config_id@"..config_id)
return 0
@ -747,16 +747,16 @@ end
function SLC_CharAmusement_CoinGet(context, param1)
local gallery_id = ScriptLib.GetGroupTempValue(context, "gallery_id", {})
if 1 == param1 then
local config_id = ScriptLib.GetGadgetConfigId(context, { gadget_eid = context.target_entity_id })
ScriptLib.RemoveEntityByConfigId(context, 0, EntityType.GADGET, config_id)
ScriptLib.ChangeGroupTempValue(context, "cur_score", -1, {})
ScriptLib.UpdatePlayerGalleryScore(context, gallery_id, { ["add_score"]= 1} )
ScriptLib.CharAmusementUpdateScore(context, cfg.main_group, 1, 1)--给MultStage更新分数 服务器侧埋点用
elseif 2 == param1 then
elseif 2 == param1 then
local config_id = ScriptLib.GetGadgetConfigId(context, { gadget_eid = context.target_entity_id })
ScriptLib.RemoveEntityByConfigId(context, 0, EntityType.GADGET, config_id)
if nil ~= defs.super_coin and 1 <= defs.super_coin then
@ -819,16 +819,16 @@ end
function LF_SetPillarSuite(context)
local uid_list = ScriptLib.GetSceneUidList(context)
ScriptLib.PrintContextLog(context,"## [CharAmuse_Pillar] LF_SetPillarSuite. player_count@"..#uid_list)
if nil ~= defs.enter_suites and nil ~= defs.enter_suites[#uid_list] then
ScriptLib.AddExtraGroupSuite(context, base_info.group_id, defs.enter_suites[#uid_list])
ScriptLib.PrintContextLog(context,"## [CharAmuse_Pillar] LF_SetPillarSuite. player_count@"..#uid_list)
if nil ~= defs.enter_suites and nil ~= defs.enter_suites[#uid_list] then
ScriptLib.AddExtraGroupSuite(context, base_info.group_id, defs.enter_suites[#uid_list])
end
return 0
end
function LF_ClearPillarSuite(context)
for i = 2, #suites do
ScriptLib.RemoveExtraGroupSuite(context, base_info.group_id, i)
ScriptLib.RemoveExtraGroupSuite(context, base_info.group_id, i)
end
return 0
end
@ -857,4 +857,4 @@ function LF_CheckIsInTable(context, value, check_table)
return false
end
LF_Initialize()
LF_Initialize()

View File

@ -5,11 +5,11 @@
|| owner: weiwei.sun
|| description: 3.2
|| LogName: ## [CharAmuse_Retrans]
|| Protection:
|| Protection:
=======================================]]
--[[
defs = {
local defs = {
--玩法范围region玩法进行期间不在此Region内的玩家会被拉回
play_region = ,
}
@ -74,7 +74,7 @@ function EX_DoReTransCheck_Single(context, prev_context, uid)
end
function LF_DoReTransCheck(context, uid)
if nil == regions[defs.play_region] then
if nil == regions[defs.play_region] then
return 0
end
if false == ScriptLib.IsPlayerTransmittable(context, uid) then
@ -91,4 +91,4 @@ end
LF_Initialize_Retrans()
LF_Initialize_Retrans()

View File

@ -5,11 +5,11 @@
|| owner: weiwei.sun
|| description: 3.2
|| LogName: ## [CharAmuse_RunOnWater]
|| Protection:
|| Protection:
=======================================]]
--[[
defs = {
local defs = {
-----全玩法通用配置-----
@ -20,19 +20,19 @@ defs = {
limit_time = 120,
target = 15,
-----水上漂配置-----
reminder = 400171,
--波次轮替时不被移除的suite
ignore_on_clear = {},
-- 如果是早柚的关卡,用这套
Sayu =
Sayu =
{
-- 史莱姆 buff 所在的suite
add_suite ={10,11},
add_suite ={10,11},
-- 每波金币刷出来之后多少秒后会rmd
rmd_time = 25,
-- 每波金币刷出来之后,多少秒后会刷掉
@ -65,7 +65,7 @@ defs = {
{
},
},
},
},
},
-- 如果是神里的关卡,用这套
@ -79,7 +79,7 @@ local cfg = {
--主控GroupID
main_group = 251008007,
gallery_match =
gallery_match =
{
--[1000] = defs.Jean,
[28005] = defs.Sayu,
@ -152,7 +152,7 @@ function action_AirWallVariable_Change(context, evt)
elseif 0 == evt.param1 and 1 == evt.param2 then
for i,v in ipairs(defs.air_wall) do
ScriptLib.RemoveEntityByConfigId(context, 0, EntityType.GADGET, v)
end
end
end
return 0
end
@ -166,11 +166,11 @@ function action_Gallery_Stop(context, evt)
for k,v in pairs(char_type.add_suite) do
ScriptLib.RemoveExtraGroupSuite(context, base_info.group_id, v)
end
ScriptLib.EndAllTimeAxis(context)
if 3 ~= evt.param3 then
local is_last_level = (ScriptLib.GetGroupTempValue(context, "is_last_level", {}) >= 1)
local is_last_level = (ScriptLib.GetGroupTempValue(context, "is_last_level", {}) >= 1)
--ScriptLib.InitTimeAxis(context, "StopGallery_Fail", { 3 } , false) 9.21修改 失败不要延时结束
ScriptLib.ExecuteGroupLua(context, cfg.main_group, "EX_EndPlayStage", {1, base_info.group_id})
else
@ -179,7 +179,7 @@ function action_Gallery_Stop(context, evt)
ScriptLib.ExecuteGroupLua(context, cfg.main_group, "EX_EndPlayStage", {0, base_info.group_id})
else
ScriptLib.InitTimeAxis(context, "StopGallery", { 3 } , false)
end
end
end
ScriptLib.PrintContextLog(context,"## [CharAmuse_RunOnWater] Gallery stoped. reason@".. evt.param3.." --------------")
@ -188,7 +188,7 @@ end
---------------------------------------------------------------------------------------------------------------
function LF_Start_Play(context)
ScriptLib.SetGroupTempValue(context, "coin_num", 0, {})
ScriptLib.SetGroupTempValue(context, "round", 0, {})
ScriptLib.SetGroupTempValue(context, "index", 0, {})--这个用于使最后一波循环时timeaxis名称不同
@ -204,7 +204,7 @@ function LF_Start_Play(context)
end
ScriptLib.SetGroupTempValue(context, "cur_score", target, {})
ScriptLib.UpdatePlayerGalleryScore(context, gallery_id, { ["max_score"]= target} )
local rand_length = 1
local char_type = LF_GetRunOnWaterCharType(context)
ScriptLib.PrintContextLog(context,"## [CharAmuse_RunOnWater] LF_Start_Play. player_count@"..player_count)
@ -241,11 +241,11 @@ function SLC_CharAmusement_CoinGet(context, param1)
ScriptLib.RemoveEntityByConfigId(context, 0, EntityType.GADGET, config_id)
ScriptLib.ChangeGroupTempValue(context, "cur_score", -1, {})
ScriptLib.ChangeGroupTempValue(context, "coin_num", -1, {})
ScriptLib.UpdatePlayerGalleryScore(context, gallery_id, { ["add_score"]= 1} )
ScriptLib.CharAmusementUpdateScore(context, cfg.main_group, 1, 1)--给MultStage更新分数 服务器侧埋点用
elseif 2 == param1 then
elseif 2 == param1 then
local config_id = ScriptLib.GetGadgetConfigId(context, { gadget_eid = context.target_entity_id })
ScriptLib.RemoveEntityByConfigId(context, 0, EntityType.GADGET, config_id)
if nil ~= defs.super_coin and 1 <= defs.super_coin then
@ -269,7 +269,7 @@ function SLC_CharAmusement_CoinGet(context, param1)
local coin_num = ScriptLib.GetGroupTempValue(context, "coin_num", {})
ScriptLib.PrintContextLog(context,"## [CharAmuse_RunOnWater] SLC_CharAmusement_CoinGet. param1@"..param1.." coin_num@"..coin_num)
if 0 >= coin_num then
if 0 >= coin_num then
--ScriptLib.EndAllTimeAxis(context)
--局内不能用EndAll 因为会停掉超界检测
local round = ScriptLib.GetGroupTempValue(context, "round", {})
@ -304,7 +304,7 @@ function LF_ClearRound(context)
end
for i = 3, #suites do
for i = 3, #suites do
--史莱姆、体力球suite不移除
if nil ~= defs.ignore_on_clear then
if false == LF_CheckIsInTable(context, i, defs.ignore_on_clear) then
@ -316,7 +316,7 @@ function LF_ClearRound(context)
return 0
end
function LF_StartRound(context, rand_index)
local char_type = LF_GetRunOnWaterCharType(context)
@ -327,7 +327,7 @@ function LF_StartRound(context, rand_index)
else
coin_list = char_type.coin_list["SP"]
end
ScriptLib.SetGroupTempValue(context, "coin_num", 0, {})--个数 记录金币吃完用
ScriptLib.SetGroupTempValue(context, "score_total", 0, {})--分数 埋点用
if nil == coin_list then
@ -345,7 +345,7 @@ function LF_StartRound(context, rand_index)
--如果已经到了LD配置尽头则循环最后一波
if round > #coin_list[rand_index] then
round = #coin_list[rand_index]
ScriptLib.SetGroupTempValue(context, "round", round, {})
ScriptLib.SetGroupTempValue(context, "round", round, {})
ScriptLib.PrintContextLog(context,"## [CharAmuse_RunOnWater] LF_StartRound. All round finished. Set to final.")
end
@ -372,7 +372,7 @@ function LF_StartRound(context, rand_index)
if 1 < round then
ScriptLib.ShowReminder(context, 470310104)
end
--创建其他物件
for k,v in pairs(coin_list[rand_index][round].other) do
ScriptLib.AddExtraGroupSuite(context, base_info.group_id, v)
@ -440,4 +440,4 @@ function LF_CheckIsInTable(context, value, check_table)
end
LF_Initialize()
LF_Initialize()

View File

@ -5,11 +5,11 @@
|| owner: weiwei.sun
|| description: 3.2
|| LogName: ## [CharAmuse_SpinBall]
|| Protection:
|| Protection:
=======================================]]
--[[
defs = {
local defs = {
-----全玩法通用配置-----
@ -30,24 +30,24 @@ defs = {
reminder = 400171,
--点阵长度
length =
length =
{--[点阵id] =点阵长度
[1] = 9,
[2] = 4.
},
--创生配置
born =
born =
{--[点阵id] ={ pos = { x=,y=,z=}, rot = pos = { x=,y=,z=}}
[1]={ pos = { x=,y=,z=}, rot = pos = { x=,y=,z=}}
}
--点阵组
array_combine =
array_combine =
{
[1] = {5, 6},
}
-- 刷金币suite的规则
coin_list =
coin_list =
{
-- 单人玩家
["SP"] = {
@ -148,7 +148,7 @@ function action_AirWallVariable_Change(context, evt)
elseif 0 == evt.param1 and 1 == evt.param2 then
for i,v in ipairs(defs.air_wall) do
ScriptLib.RemoveEntityByConfigId(context, 0, EntityType.GADGET, v)
end
end
end
return 0
end
@ -159,7 +159,7 @@ function action_Gallery_Stop(context, evt)
LF_ClearRound(context)
ScriptLib.EndAllTimeAxis(context)
if 3 ~= evt.param3 then
if 3 ~= evt.param3 then
local is_last_level = (ScriptLib.GetGroupTempValue(context, "is_last_level", {}) >= 1)
--ScriptLib.InitTimeAxis(context, "StopGallery_Fail", { 3 } , false) 9.21修改 失败不要延时结束
ScriptLib.ExecuteGroupLua(context, cfg.main_group, "EX_EndPlayStage", {1, base_info.group_id})
@ -169,7 +169,7 @@ function action_Gallery_Stop(context, evt)
ScriptLib.ExecuteGroupLua(context, cfg.main_group, "EX_EndPlayStage", {0, base_info.group_id})
else
ScriptLib.InitTimeAxis(context, "StopGallery", { 3 } , false)
end
end
end
ScriptLib.PrintContextLog(context,"## [CharAmuse_SpinBall] Gallery stoped. reason@".. evt.param3.." --------------")
@ -207,7 +207,7 @@ function LF_Start_Play(context)
ScriptLib.SetGroupTempValue(context, "rand_index", rand_index, {})
LF_StartRound(context)
return 0
end
@ -229,7 +229,7 @@ function LF_StartRound(context)
ScriptLib.SetGroupTempValue(context, "coin_num", 0, {})
ScriptLib.SetGroupTempValue(context, "score_total", 0, {})
local coin_list = {}
if 1 < player_num then
coin_list = defs.coin_list["MP"]
@ -250,7 +250,7 @@ function LF_StartRound(context)
--如果已经到了LD配置尽头则循环最后一波
if round > #coin_list[rand_index] then
round = #coin_list[rand_index]
ScriptLib.SetGroupTempValue(context, "round", round, {})
ScriptLib.SetGroupTempValue(context, "round", round, {})
ScriptLib.PrintContextLog(context,"## [CharAmuse_SpinBall] LF_StartRound. All round finished. Set to final.")
end
@ -311,7 +311,7 @@ function action_Wait_TimeAxis_Pass(context, evt)
table.insert(path, i)
end
local tempParam = {route_type = 2, turn_mode = false}
ScriptLib.SetPlatformPointArray(context, config_id, v, path, tempParam)
ScriptLib.SetPlatformPointArray(context, config_id, v, path, tempParam)
ScriptLib.PrintContextLog(context,"## [CharAmuse_SpinBall] SetPlatformPointArray. config_id@".. config_id.. "point_array_id@"..v)
end
end
@ -320,7 +320,7 @@ function action_Wait_TimeAxis_Pass(context, evt)
local coin_suites = coin_list[rand_index][round].coin
for k,v in pairs(coin_suites) do
ScriptLib.AddExtraGroupSuite(context, base_info.group_id, v)
end
end
--埋点统计本波总分
local coin_1 = ScriptLib.CheckRemainGadgetCountByGroupId(context, { group_id = base_info.group_id, gadget_id = { 70320015 }})
@ -363,10 +363,10 @@ function LF_ClearRound(context)
coin_list = defs.coin_list["SP"]
end
local rand_index = ScriptLib.GetGroupTempValue(context, "rand_index", {})
for i,v in ipairs(coin_list[rand_index][round].coin) do
ScriptLib.RemoveExtraGroupSuite(context, base_info.group_id, v)
end
end
if nil ~= coin_list[rand_index][round].buff then
for i,v in ipairs(coin_list[rand_index][round].buff) do
ScriptLib.RemoveExtraGroupSuite(context, base_info.group_id, v)
@ -377,14 +377,14 @@ function LF_ClearRound(context)
end
function LF_CreateBall(context, pos, rot)
for k , v in pairs(defs.ball_pool) do
local ret = ScriptLib.CreateGadgetByConfigIdByPos(context, v, pos, rot)
if 0 == ret then
ScriptLib.PrintContextLog(context,"## [CharAmuse_SpinBall] LF_CreateBall. Create gadget@"..v)
return v
end
end
end
ScriptLib.PrintGroupWarning(context,"## [CharAmuse_SpinBall] LF_CreateBall. Unable to create ball.")
return 0
end
@ -394,8 +394,8 @@ function action_Round_TimeAxis(context, evt)
ScriptLib.EndTimeAxis(context, "round_time")
ScriptLib.EndTimeAxis(context, "reminder_time")
LF_ClearRound(context)
ScriptLib.InitTimeAxis(context, "roundwait_time", { defs.wait_time } , false)
LF_ClearRound(context)
ScriptLib.InitTimeAxis(context, "roundwait_time", { defs.wait_time } , false)
return 0
end
@ -425,11 +425,11 @@ function SLC_CharAmusement_CoinGet(context, param1)
ScriptLib.RemoveEntityByConfigId(context, 0, EntityType.GADGET, config_id)
ScriptLib.ChangeGroupTempValue(context, "cur_score", -1, {})
ScriptLib.ChangeGroupTempValue(context, "coin_num", -1, {})
ScriptLib.UpdatePlayerGalleryScore(context, gallery_id, { ["add_score"]= 1} )
ScriptLib.CharAmusementUpdateScore(context, cfg.main_group, 1, 1)--给MultStage更新分数 服务器侧埋点用
elseif 2 == param1 then
elseif 2 == param1 then
local config_id = ScriptLib.GetGadgetConfigId(context, { gadget_eid = context.target_entity_id })
ScriptLib.RemoveEntityByConfigId(context, 0, EntityType.GADGET, config_id)
if nil ~= defs.super_coin and 1 <= defs.super_coin then
@ -453,19 +453,19 @@ function SLC_CharAmusement_CoinGet(context, param1)
local coin_num = ScriptLib.GetGroupTempValue(context, "coin_num", {})
ScriptLib.PrintContextLog(context,"## [CharAmuse_SpinBall] SLC_CharAmusement_CoinGet. param1@"..param1.." coin_num@"..coin_num)
if 0 >= coin_num then
if 0 >= coin_num then
LF_ClearRound(context)
LF_ClearRound(context)
ScriptLib.EndTimeAxis(context, "ball_wait")
ScriptLib.EndTimeAxis(context, "round_time")
ScriptLib.EndTimeAxis(context, "reminder_time")
ScriptLib.InitTimeAxis(context, "roundwait_time", { defs.wait_time } , false)
ScriptLib.InitTimeAxis(context, "roundwait_time", { defs.wait_time } , false)
end
return 0
end
LF_Initialize()
LF_Initialize()

Some files were not shown because too many files have changed in this diff Show More