101 lines
4.5 KiB
Lua
101 lines
4.5 KiB
Lua
|
BuffConfig = BuffConfig or {}
|
|||
|
BuffConfig.EBuffType = {
|
|||
|
TestBuff = -1;
|
|||
|
InfiniteBullets = 0;
|
|||
|
|
|||
|
JumpStrengthenLv1 = 1;
|
|||
|
JumpStrengthenLv2 = 2;
|
|||
|
JumpStrengthenLv3 = 3;
|
|||
|
MoveSpeedStrengthenLv1 = 4;
|
|||
|
MoveSpeedStrengthenLv2 = 5;
|
|||
|
MoveSpeedStrengthenLv3 = 6;
|
|||
|
IncreasedDamageLv1 = 7;
|
|||
|
IncreasedDamageLv2 = 8;
|
|||
|
IncreasedDamageLv3 = 9;
|
|||
|
RespiratoryRecoveryLv1 = 10;
|
|||
|
RespiratoryRecoveryLv2 = 11;
|
|||
|
RespiratoryRecoveryLv3 = 12;
|
|||
|
IncreasedDefenseLv1 = 13;
|
|||
|
IncreasedDefenseLv2 = 14;
|
|||
|
IncreasedDefenseLv3 = 15;
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
BuffConfig.BuffName = {
|
|||
|
[BuffConfig.EBuffType.TestBuff] = "TestBuff";
|
|||
|
[BuffConfig.EBuffType.InfiniteBullets] = "InfiniteBullets";
|
|||
|
|
|||
|
[BuffConfig.EBuffType.JumpStrengthenLv1] = "JumpStrengthenLv1";
|
|||
|
[BuffConfig.EBuffType.JumpStrengthenLv2] = "JumpStrengthenLv2";
|
|||
|
[BuffConfig.EBuffType.JumpStrengthenLv3] = "JumpStrengthenLv3";
|
|||
|
[BuffConfig.EBuffType.MoveSpeedStrengthenLv1] = "MoveSpeedStrengthenLv1";
|
|||
|
[BuffConfig.EBuffType.MoveSpeedStrengthenLv2] = "MoveSpeedStrengthenLv2";
|
|||
|
[BuffConfig.EBuffType.MoveSpeedStrengthenLv3] = "MoveSpeedStrengthenLv3";
|
|||
|
[BuffConfig.EBuffType.IncreasedDamageLv1] = "IncreasedDamageLv1";
|
|||
|
[BuffConfig.EBuffType.IncreasedDamageLv2] = "IncreasedDamageLv2";
|
|||
|
[BuffConfig.EBuffType.IncreasedDamageLv3] = "IncreasedDamageLv3";
|
|||
|
[BuffConfig.EBuffType.RespiratoryRecoveryLv1] = "RespiratoryRecoveryLv1";
|
|||
|
[BuffConfig.EBuffType.RespiratoryRecoveryLv2] = "RespiratoryRecoveryLv2";
|
|||
|
[BuffConfig.EBuffType.RespiratoryRecoveryLv3] = "RespiratoryRecoveryLv3";
|
|||
|
[BuffConfig.EBuffType.IncreasedDefenseLv1] = "IncreasedDefenseLv1";
|
|||
|
[BuffConfig.EBuffType.IncreasedDefenseLv2] = "IncreasedDefenseLv2";
|
|||
|
[BuffConfig.EBuffType.IncreasedDefenseLv3] = "IncreasedDefenseLv3";
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
BuffConfig.BuffShowName = {
|
|||
|
[BuffConfig.EBuffType.TestBuff] = "测试";
|
|||
|
[BuffConfig.EBuffType.InfiniteBullets] = "无限子弹";
|
|||
|
|
|||
|
[BuffConfig.EBuffType.JumpStrengthenLv1] = "二段跳";
|
|||
|
[BuffConfig.EBuffType.JumpStrengthenLv2] = "三段跳";
|
|||
|
[BuffConfig.EBuffType.JumpStrengthenLv3] = "四段跳";
|
|||
|
[BuffConfig.EBuffType.MoveSpeedStrengthenLv1] = "移速Lv1";
|
|||
|
[BuffConfig.EBuffType.MoveSpeedStrengthenLv2] = "移速Lv2";
|
|||
|
[BuffConfig.EBuffType.MoveSpeedStrengthenLv3] = "移速Lv3";
|
|||
|
[BuffConfig.EBuffType.IncreasedDamageLv1] = "增伤Lv1";
|
|||
|
[BuffConfig.EBuffType.IncreasedDamageLv2] = "增伤Lv2";
|
|||
|
[BuffConfig.EBuffType.IncreasedDamageLv3] = "增伤Lv3";
|
|||
|
[BuffConfig.EBuffType.RespiratoryRecoveryLv1] = "呼吸恢复Lv1";
|
|||
|
[BuffConfig.EBuffType.RespiratoryRecoveryLv2] = "呼吸恢复Lv2";
|
|||
|
[BuffConfig.EBuffType.RespiratoryRecoveryLv3] = "呼吸恢复Lv3";
|
|||
|
[BuffConfig.EBuffType.IncreasedDefenseLv1] = "防御强化Lv1";
|
|||
|
[BuffConfig.EBuffType.IncreasedDefenseLv2] = "防御强化Lv2";
|
|||
|
[BuffConfig.EBuffType.IncreasedDefenseLv3] = "防御强化Lv3";
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
---@param InPlayerPawn PlayerPawn* @玩家角色
|
|||
|
---@param InBuffType BuffConfig.EBuffType @Buff类型
|
|||
|
---@param LayerCount int @层数 默认1
|
|||
|
---@param BuffCauser Controller* @施加Buff的玩家或AI。
|
|||
|
---@param CauserActor Actor* @施加Buff的Actor,比如说PlayerPawn、燃烧瓶Actor等等
|
|||
|
function BuffConfig.PlayerUseBuff(InPlayerPawn, InBuffType, LayerCount, BuffCauser, CauserActor)
|
|||
|
if UE.IsValid(InPlayerPawn) and InPlayerPawn:IsAlive() and BuffConfig.BuffName[InBuffType] then
|
|||
|
if LayerCount == nil then LayerCount = 1 end
|
|||
|
UGCLogSystem.Log("[BuffConfig_PlayerUseBuff] BuffName:%s", BuffConfig.BuffName[InBuffType])
|
|||
|
return UGCBuffSystem.AddBuff(InPlayerPawn, BuffConfig.BuffName[InBuffType], LayerCount, BuffCauser, CauserActor)
|
|||
|
end
|
|||
|
return false
|
|||
|
end
|
|||
|
|
|||
|
---@param InPlayerPawn PlayerPawn* @玩家角色
|
|||
|
---@param InBuffType BuffConfig.EBuffType @Buff类型
|
|||
|
---@param LayerCount int @层数 默认1
|
|||
|
function BuffConfig.PlayerRemoveBuff(InPlayerPawn, InBuffType, LayerCount)
|
|||
|
if UE.IsValid(InPlayerPawn) and InPlayerPawn:IsAlive() and BuffConfig.BuffName[InBuffType] then
|
|||
|
if LayerCount == nil then LayerCount = 1 end
|
|||
|
return UGCBuffSystem.RemoveBuff(InPlayerPawn, BuffConfig.BuffName[InBuffType], LayerCount)
|
|||
|
end
|
|||
|
return false
|
|||
|
end
|
|||
|
|
|||
|
---@param InPlayerPawn PlayerPawn* @玩家角色
|
|||
|
---@param InBuffType BuffConfig.EBuffType @Buff类型
|
|||
|
function BuffConfig.PlayerHasBuff(InPlayerPawn, InBuffType)
|
|||
|
if UE.IsValid(InPlayerPawn) and InPlayerPawn:IsAlive() and BuffConfig.BuffName[InBuffType] then
|
|||
|
return UGCBuffSystem.HasBuff(InPlayerPawn, BuffConfig.BuffName[InBuffType])
|
|||
|
end
|
|||
|
return false
|
|||
|
end
|