274 lines
10 KiB
Lua
274 lines
10 KiB
Lua
|
EventConfig = EventConfig or {}
|
|||
|
|
|||
|
--- Action Tick的频率
|
|||
|
EventConfig.TickFrequency = 24.
|
|||
|
|
|||
|
|
|||
|
|
|||
|
EventEnum = {
|
|||
|
|
|||
|
--- DefaultEvent
|
|||
|
DSStartUp = 1001, -- 服务器启动
|
|||
|
PlayerLogin = 1003, -- 玩家加入房间 PlayerKey
|
|||
|
PlayerExit = 1004, -- 玩家离开房间 PlayerKey
|
|||
|
|
|||
|
--- GameState
|
|||
|
GameStateChange = 2001, -- 游戏模式改变 CustomEnum.EGameState
|
|||
|
WaitPlayerJoin = 2002, -- 等待玩家加入
|
|||
|
GamePlay = 2003, -- 游戏开始
|
|||
|
GameEnd = 2004, -- 游戏结束
|
|||
|
|
|||
|
|
|||
|
--- PlayerEvent
|
|||
|
PlayerDeathInfo = 3001, -- 死亡信息 VictimKey, CauserKey, WeaponID, DamageType, IsHeadShotDamage, Distance, DamageValue uint, uint, int, int, bool, float, float
|
|||
|
PlayerInjuryInfo = 3002, -- 受伤信息 VictimKey, CauserKey, WeaponID, DamageType, IsHeadShotDamage, Distance, DamageValue uint, uint, int, int, bool, float, float
|
|||
|
PlayerPossessed = 3003, -- 玩家受控 PlayerKey
|
|||
|
PlayerBeginPlay = 3004, -- 玩家受控 PlayerPawn
|
|||
|
|
|||
|
|
|||
|
AchievementPlayerKill = 10005, -- 成就事件玩家击杀 KillerPlayerKey, DeadPlayerKey, WeaponID,
|
|||
|
AchievementSettlement = 10006, -- 成就事件游戏结算
|
|||
|
TrophyOwnerExit = 10007, -- 奖杯拥有者掉线
|
|||
|
|
|||
|
|
|||
|
Broadcast = 20001, -- 广播UI信息 BroadcastType, BroadcastTable, BroadcastPos
|
|||
|
UpdatePlayerScoreData = 20002, -- 玩家得分信息更新 通过UGCGameSystem.GameState.PlayerScoreDatas 获取玩家得分信息
|
|||
|
SelectWeaponCallBack = 20004, -- 武器选择回调 SelectSucceed
|
|||
|
AddTip = 20005, -- 添加提提示 TipStr TipType
|
|||
|
ClickSelectWeapon = 20006, -- 点击选择武器信息 EWeaponSelect, InfoID
|
|||
|
UpdateTeamPlayerNum = 20007, -- 更新队伍玩家数量 BlueTeamNum, RedTeamNum
|
|||
|
SelectTeamCallBack = 20008, -- 选择队伍的回调 SelectSucceed
|
|||
|
Winner = 20009, -- 决出获胜者 WinnerPlayerKey
|
|||
|
GameWillBegin = 20010, -- 游戏即将开始
|
|||
|
PlayerCause = 20011, -- 玩家造成伤害 Damage, IsKill, CauserKey, VictimKey
|
|||
|
PlayerOwnedBuffChange = 20012, -- 玩家拥有的Buff已改变
|
|||
|
SaveSelectWeaponCallBack = 20013, -- 武器选择保存回调 SaveSucceed
|
|||
|
PlayerSaveWeaponChange = 20014, -- 武器选择保存已改变
|
|||
|
ButtonSettingCallBack = 20015, -- 保存按键配置回调 ButtonsRender{{TargetWidgetEnum = WidgetConfig.EUIType, Pos = {X, Y}, Scale = float}, ...}
|
|||
|
|
|||
|
|
|||
|
UpdatePlayerRank = 20101, -- 玩家排行榜信息更新
|
|||
|
|
|||
|
|
|||
|
--- Trophy Game Event
|
|||
|
TrophyOwnerChange = 30003, -- 奖杯拥有者改变 NewOwnerPlayerKey
|
|||
|
UpdatePlayerWeapon = 30004, -- 玩家武器列表更新
|
|||
|
PlayerUseBuff = 30005, -- 玩家使用Buff
|
|||
|
PlayerFirstTimePlaying = 30006, -- 玩家第一次进入游戏
|
|||
|
|
|||
|
|
|||
|
|
|||
|
--- Game DiagramsBattlefield Event
|
|||
|
|
|||
|
PlayerBuyCallBack = 50001, -- 玩家购买回调 bSucceed
|
|||
|
PlayerGoldCoinChange = 50002, -- 玩家金币数改变
|
|||
|
SelectInitBackPackCallBack = 50003, -- 选择初始背包配置回调
|
|||
|
PlayerRewardScoreChange = 50004, -- 玩家悬赏分改变
|
|||
|
PlayerAreaChange = 50005, -- 玩家所在区域改变 {[PlayerKey] = uint[1, 8]}
|
|||
|
LoadMap = 50006, -- 关卡加载 MapConifg.MapType
|
|||
|
SelectMapCallBack = 50007, -- 地图选择服务器的回调 bSucceed, MapType
|
|||
|
SelectDefaultWeaponCallBack = 50008, -- 默认武器选择回调 bSucceed, WeaponID
|
|||
|
|
|||
|
RandomSelectVoteMap = 50009,
|
|||
|
|
|||
|
--- Game MechanismBattlefield
|
|||
|
PlayerGradientGradeChange = 60001, -- 玩家梯度等级改变
|
|||
|
|
|||
|
PlayerIsAliveIsChange = 60002, -- 玩家存活列表改变
|
|||
|
UpdateMapSelectionFinalResult = 60003, -- 最终确认的地图更新
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
--- 模式编辑器的默认事件映射
|
|||
|
EventConfig.GameModeEditEventMap = {
|
|||
|
["DSStartUp"] = EventEnum.DSStartUp,
|
|||
|
["PlayerLogin"] = EventEnum.PlayerLogin,
|
|||
|
["PlayerExit"] = EventEnum.PlayerExit,
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
--- 事件包含的的参数名
|
|||
|
EventConfig.EventParam = {
|
|||
|
--[[
|
|||
|
Template
|
|||
|
[EventEnum.] = {"PlayerKey",},
|
|||
|
]]
|
|||
|
|
|||
|
[EventEnum.DSStartUp] = {},
|
|||
|
[EventEnum.PlayerLogin] = {"PlayerPawn", "PlayerKey"},
|
|||
|
[EventEnum.PlayerExit] = {"PlayerPawn", "PlayerKey"},
|
|||
|
|
|||
|
[EventEnum.GameStateChange] = {"GameState"},
|
|||
|
[EventEnum.WaitPlayerJoin] = {},
|
|||
|
[EventEnum.GamePlay] = {},
|
|||
|
[EventEnum.GameEnd] = {},
|
|||
|
|
|||
|
[EventEnum.PlayerLogin] = {"PlayerKey",},
|
|||
|
[EventEnum.PlayerExit] = {"PlayerKey",},
|
|||
|
[EventEnum.PlayerDeathInfo] = {"VictimKey", "CauserKey", "WeaponID", "DamageType", "IsHeadShotDamage", "Distance", "DamageValue"},
|
|||
|
[EventEnum.PlayerInjuryInfo] = {"VictimKey", "CauserKey", "WeaponID", "DamageType", "IsHeadShotDamage", "Distance", "DamageValue"},
|
|||
|
|
|||
|
[EventEnum.PlayerPossessed] = {"PlayerKey",},
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
EventConfig.ActionType = {
|
|||
|
---Player
|
|||
|
PlayerLogin = 1001,
|
|||
|
PlayerExit = 1002,
|
|||
|
PlayerDeadUpdateInfo = 1003,
|
|||
|
PlayerRespawn = 1004,
|
|||
|
|
|||
|
PlayerAddEnergy = 1005,
|
|||
|
PlayerPossessed = 1006,
|
|||
|
|
|||
|
EnableInfBullets = 1007,
|
|||
|
|
|||
|
---GameState
|
|||
|
WaitPlayerJoin = 2001,
|
|||
|
GamePlay = 2002,
|
|||
|
GameEnd = 2003,
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
--- Action 配置游戏模式的默认参数,该参数会被传入参数可被覆盖(传入参数有效才会覆盖),不填则使用Action中的默认参数或被传入参数覆盖
|
|||
|
EventConfig.ActionInfo = {
|
|||
|
-- Player
|
|||
|
[EventConfig.ActionType.PlayerLogin] = {
|
|||
|
ActionPath = "Script.Global.EventManager.EventAction.EventAction_PlayerLogin",
|
|||
|
ActionParam = {
|
|||
|
PlayerKey = -1,
|
|||
|
},
|
|||
|
},
|
|||
|
[EventConfig.ActionType.PlayerExit] = {
|
|||
|
ActionPath = "Script.Global.EventManager.EventAction.EventAction_PlayerExit",
|
|||
|
ActionParam = {
|
|||
|
PlayerKey = -1,
|
|||
|
-- 玩家不足以支持游戏时触发的游戏结束事件
|
|||
|
EndEvent = EventEnum.GameEnd,
|
|||
|
},
|
|||
|
},
|
|||
|
[EventConfig.ActionType.PlayerRespawn] = {
|
|||
|
ActionPath = "Script.Global.EventManager.EventAction.EventAction_PlayerRespawn",
|
|||
|
ActionParam = {
|
|||
|
PlayerKey = -1,
|
|||
|
-- 复活等待的时间
|
|||
|
DelayTime = 3.,
|
|||
|
},
|
|||
|
},
|
|||
|
[EventConfig.ActionType.PlayerDeadUpdateInfo] = {
|
|||
|
ActionPath = "Script.Global.EventManager.EventAction.EventAction_PlayerDeadUpdateInfo",
|
|||
|
ActionParam = {
|
|||
|
DeadPlayerKey = -1,
|
|||
|
KillerPlayerKey = -1,
|
|||
|
WeaponID = -1,
|
|||
|
},
|
|||
|
},
|
|||
|
[EventConfig.ActionType.PlayerPossessed] = {
|
|||
|
ActionPath = "Script.Global.EventManager.EventAction.EventAction_PlayerPossessed",
|
|||
|
ActionParam = {
|
|||
|
},
|
|||
|
},
|
|||
|
[EventConfig.ActionType.EnableInfBullets] = {
|
|||
|
ActionPath = "Script.Global.EventManager.EventAction.EventAction_EnableInfBullets",
|
|||
|
ActionParam = {
|
|||
|
},
|
|||
|
},
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
-- GameState
|
|||
|
[EventConfig.ActionType.WaitPlayerJoin] = {
|
|||
|
ActionPath = "Script.Global.EventManager.EventAction.EventAction_WaitingPlayer",
|
|||
|
ActionParam = {
|
|||
|
-- 等待玩家加入的时长
|
|||
|
WaitTime = GlobalConfigs.GameSetting.WaitTime,
|
|||
|
-- 提前开始游戏的最少队伍人数
|
|||
|
WaitTeamPlayerNum = 8,
|
|||
|
-- 等待结束触发的事件
|
|||
|
WaitFinishEvent = EventEnum.GamePlay,
|
|||
|
-- 等待结束玩家不足时触发的事件
|
|||
|
WaitFailureEvent = EventEnum.GameEnd,
|
|||
|
-- 至少等待时长
|
|||
|
AtLeastWaitingTime = GlobalConfigs.GameSetting.WaitTime,
|
|||
|
-- 游戏即将开始提示的时间
|
|||
|
GameWillBeginWaitTime = 8,
|
|||
|
},
|
|||
|
},
|
|||
|
[EventConfig.ActionType.GamePlay] = {
|
|||
|
ActionPath = "Script.Global.EventManager.EventAction.EventAction_Play",
|
|||
|
ActionParam = {
|
|||
|
-- 游戏游玩时长
|
|||
|
GameTime = GlobalConfigs.GameSetting.GameTime,
|
|||
|
-- 游戏结束事件
|
|||
|
GameEndEvent = EventEnum.GameEnd,
|
|||
|
},
|
|||
|
},
|
|||
|
[EventConfig.ActionType.GameEnd] = {
|
|||
|
ActionPath = "Script.Global.EventManager.EventAction.EventAction_GameEnd",
|
|||
|
ActionParam = {
|
|||
|
-- 延迟关闭DS时间
|
|||
|
DelayOffDS = 20.;
|
|||
|
},
|
|||
|
},
|
|||
|
|
|||
|
[EventConfig.ActionType.PlayerAddEnergy] = {
|
|||
|
ActionPath = "Script.Global.EventManager.EventAction.EventAction_PlayerAddEnergy",
|
|||
|
ActionParam = {
|
|||
|
},
|
|||
|
},
|
|||
|
}
|
|||
|
|
|||
|
--- 事件绑定Action 参数映射 [EventParamName] = "ActionParamName"
|
|||
|
EventConfig.EventAttach = {
|
|||
|
[EventEnum.DSStartUp] = {
|
|||
|
[EventConfig.ActionType.WaitPlayerJoin] = {},
|
|||
|
[EventConfig.ActionType.PlayerAddEnergy] = {},
|
|||
|
[EventConfig.ActionType.EnableInfBullets] = {},
|
|||
|
},
|
|||
|
[EventEnum.GamePlay] = {
|
|||
|
[EventConfig.ActionType.GamePlay] = {},
|
|||
|
},
|
|||
|
[EventEnum.GameEnd] = {
|
|||
|
[EventConfig.ActionType.GameEnd] = {},
|
|||
|
},
|
|||
|
[EventEnum.PlayerLogin] = {
|
|||
|
[EventConfig.ActionType.PlayerLogin] = {
|
|||
|
["PlayerKey"] = "PlayerKey"
|
|||
|
}
|
|||
|
},
|
|||
|
[EventEnum.PlayerExit] = {
|
|||
|
[EventConfig.ActionType.PlayerExit] = {
|
|||
|
["PlayerKey"] = "PlayerKey"
|
|||
|
}
|
|||
|
},
|
|||
|
[EventEnum.PlayerDeathInfo] = {
|
|||
|
[EventConfig.ActionType.PlayerRespawn] = {
|
|||
|
["VictimKey"] = "PlayerKey"
|
|||
|
},
|
|||
|
[EventConfig.ActionType.PlayerDeadUpdateInfo] = {
|
|||
|
["VictimKey"] = "DeadPlayerKey",
|
|||
|
["CauserKey"] = "KillerPlayerKey",
|
|||
|
["WeaponID"] = "WeaponID",
|
|||
|
}
|
|||
|
|
|||
|
},
|
|||
|
|
|||
|
[EventEnum.PlayerPossessed] = {
|
|||
|
[EventConfig.ActionType.PlayerPossessed] = {
|
|||
|
["PlayerKey"] = "PlayerKey"
|
|||
|
}
|
|||
|
},
|
|||
|
}
|
|||
|
|
|||
|
function EventConfig.CheckEventAttach(EventType)
|
|||
|
return (
|
|||
|
EventConfig.EventParam[EventType] ~= nil
|
|||
|
and table.getCount(EventConfig.EventAttach[EventType]) > 0
|
|||
|
)
|
|||
|
end
|