314 lines
11 KiB
Lua
Raw Permalink Normal View History

2025-01-04 23:00:19 +08:00
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, -- 游戏结束
RoundBegining = 2005, -- 回合开始
RoundEnd = 2006, -- 回合结束
RoundReadyFinish = 2007, -- 回合准备阶段结束
-- 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
BulletHitCallBack = 3005, -- 玩家射出的子弹命中物体或玩家的回调 (PlayerPawn:UGCPlayerPawn, ShootWeapon:ASTExtraShootWeapon,Bullet:ASTExtraShootWeaponBulletBase,HitInfo:FHitResult)
PlayerTeamChange = 3006, -- 玩家的队伍改变 PC, TeamID
-- PlayerPawn同步参数更新 更新传入Pawn及其同步变量值
UpdateCanObtainIncreaseCount = 4001,
UpdateNowCanSelectIncrease = 4002,
UpdateOwnedIncrease = 4003,
UpdateToGodSchedule = 4004,
-- PlayerEvent End
UpdatePlayerStartList = 10001, -- 通知出生点控制器进行更新出生点指针
AchievementSettlement = 10002, -- 成就事件游戏结算
UpdateTeamScore = 10003, -- 队伍得分信息更新
UpdatePlayerScoreData = 10004, -- 玩家得分信息更新 通过UGCGameSystem.GameState.PlayerScoreDatas 获取玩家得分信息
AddTip = 10005, -- 添加提提示 TipStr TipType
GameWillBegin = 10006, -- 游戏即将开始
PlayerIsAliveIsChange = 10007, -- 玩家存活列表改变
UpdatePlayerInfo = 10008, -- 玩家个人信息更新
ResetPlayerTransformToPlayerStart = 10009, -- 通知出生点控制器刷新玩家位置,而非重生 InPC InPawn
PlayerWeaponCombinationUpdate = 11001, -- 玩家可选的武器配置列表更新 [PlayerKey] = CombinationType
PlayerSelectedWeaponIndexUpdate = 11002, -- 玩家选择的武器配置索引更新 [PlayerKey] = Index
--- SelectMap
LoadMap = 20001, -- 关卡加载 MapConifg.MapType
SelectMapCallBack = 20002, -- 地图选择服务器的回调 bSucceed, MapType
SelectDefaultWeaponCallBack = 20003, -- 默认武器选择回调 bSucceed, WeaponID
RandomSelectVoteMap = 20004,
UpdateMapKey = 20005, -- 随机出的地图索引 MapKey
-- 工程变量,可替换修改
PlayerPickStar = 30001, -- 玩家拾取了星星 PlayerKey
}
--- 模式编辑器的默认事件映射
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.RoundBegining] = {},
[EventEnum.RoundEnd] = {},
[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,
RoundBegining = 2004,
RoundEnd = 2005,
CountdownMode = 2101, -- 倒计时模式
TargetTeamScoringMode = 2102, -- 队伍目标得分模式
RespiratoryRegurgitation= 3001, -- 呼吸回血
TestPlaceMap = 10001,
}
--- 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,
-- 等待结束触发的事件
WaitFinishEvent = EventEnum.GamePlay,
-- 等待结束玩家不足时触发的事件
WaitFailureEvent = EventEnum.GameEnd,
-- 至少等待时长
AtLeastWaitingTime = 5,
-- 游戏即将开始提示的时间
GameWillBeginWaitTime = 5,
},
},
[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 = 30.;
},
},
[EventConfig.ActionType.RoundBegining] = {
ActionPath = "Script.Global.EventManager.EventAction.EventAction_RoundBegining",
ActionParam = {
GameTime = GlobalConfigs.GameSetting.RoundTime;
PreparationTime = GlobalConfigs.GameSetting.RoundReadyTime;
GameEndEvent = EventEnum.RoundEnd;
},
},
[EventConfig.ActionType.RoundEnd] = {
ActionPath = "Script.Global.EventManager.EventAction.EventAction_RoundEnd",
ActionParam = {
GameTime = 8;
GameEndEvent = EventEnum.GameEnd;
NewRoundEvent = EventEnum.RoundBegining;
},
},
[EventConfig.ActionType.CountdownMode] = {
ActionPath = "Script.Global.EventManager.EventAction.EventAction_CountdownMode",
ActionParam = {
-- 游戏游玩时长
GameTime = GlobalConfigs.GameSetting.GameTime,
GameEndEvent = EventEnum.GameEnd;
},
},
[EventConfig.ActionType.TargetTeamScoringMode] = {
ActionPath = "Script.Global.EventManager.EventAction.EventAction_TargetTeamScoringMode",
ActionParam = {
-- 游戏游玩时长
GameTime = GlobalConfigs.GameSetting.GameTime,
GameEndEvent = EventEnum.GameEnd;
},
},
[EventConfig.ActionType.RespiratoryRegurgitation] = {
ActionPath = "Script.Global.EventManager.EventAction.EventAction_RespiratoryRegurgitation",
ActionParam = {
},
},
}
--- 事件绑定Action 参数映射 [EventParamName] = "ActionParamName"
EventConfig.EventAttach = {
[EventEnum.DSStartUp] = {
[EventConfig.ActionType.WaitPlayerJoin] = {},
[EventConfig.ActionType.EnableInfBullets] = {},
[EventConfig.ActionType.RespiratoryRegurgitation] = {},
},
[EventEnum.GamePlay] = {
-- [EventConfig.ActionType.CountdownMode] = {},
[EventConfig.ActionType.TargetTeamScoringMode] = {},
},
[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"
}
},
[EventEnum.RoundBegining] = {
[EventConfig.ActionType.RoundBegining] = {};
},
[EventEnum.RoundEnd] = {
[EventConfig.ActionType.RoundEnd] = {};
},
}
function EventConfig.CheckEventAttach(EventType)
return (
EventConfig.EventParam[EventType] ~= nil
and table.getCount(EventConfig.EventAttach[EventType]) > 0
)
end