添加新被动242,243 技能概率追加技能,击杀追加技能

dev_chengFeng
wangzhenxing 2020-08-20 16:54:03 +09:00
parent b650ba81e8
commit 9aec289306
4 changed files with 78 additions and 5 deletions

View File

@ -3503,8 +3503,6 @@ local passivityList = {
end
role.Event:AddEvent(BattleEventName.BuffCaster, onBuffCaster)
end,
-- 直接伤害击杀目标对仇恨目标造成[a]%物理伤害
-- a[float]
[185] = function(role, args)
@ -4726,5 +4724,37 @@ local passivityList = {
end
BattleLogic.Event:AddEvent(BattleEventName.RoleRealDead, _OnRoleRealDead)
end,
-- 释放技能有[a]%概率释放[b]技能。
-- a[float]b[int]
[242] = function(role, args)
local f1 = args[1]
local f2 = args[2]
-- 释放技能后
local onSkillEnd = function(skill)
if skill and skill.type == BattleSkillType.Special then
BattleUtil.RandomAction(f1, function()
--BattleLogic.WaitForTrigger(0.1, function()
LogError("技能触发再次释放技能"..f2)
role:InsertExtraSkill(f2)
--end)
end)
end
end
role.Event:AddEvent(BattleEventName.SkillCastEnd, onSkillEnd)
end,
-- 直接伤害击杀目标释放[a]技能。
-- a[float]
[243] = function(role, args)
local f1 = args[1]
local onRoleHit = function(target)
if target:IsDead() and BattleUtil.CheckIsNoDead(target) then
-- local target = RoleManager.GetAliveAggro(role)
--BattleUtil.CalDamage(nil, role, target, 1, f1)
role:InsertExtraSkill(f1)
LogError("击杀触发再次释放技能")
end
end
role.Event:AddEvent(BattleEventName.RoleHit, onRoleHit)
end,
}
return passivityList

View File

@ -186,6 +186,8 @@ BattleSkillType = {
Monster = 0,
Normal = 1,
Special = 2,
--额外技能
Extra = 3,
}
CountTypeName = {
@ -202,6 +204,15 @@ ShieldTypeName = {
AllReduce = 3, -- 无敌护盾
}
--额外释放技能
ExtraReleaseSkill={
skill1={1012051,1,0,1,{200000,{1,0.41,2}}},
skill2={1132051,0.8,0,1,{200212,{1,0.89,2}}},
skill3={1151111,0.05,0,1,{220000,1,0.86,2}},
skill4={10000351,0.3,0.5,4,{400000,{1,1.75,1}}},
}
-- 战斗表属性id对应战斗中属性数据
BattlePropList = {

View File

@ -368,6 +368,19 @@ end
return false
end
-- 根据id获取额外技能
function BattleUtil.GetExtraSkillbyId(id)
if id==1 then
return ExtraReleaseSkill.skill1
elseif id==2 then
return ExtraReleaseSkill.skill2
elseif id==3 then
return ExtraReleaseSkill.skill3
elseif id==4 then
return ExtraReleaseSkill.skill4
end
end
function BattleUtil.FinalDamage(skill, atkRole, defRole, damage, bCrit, damageType, dotType)
if damage < 0 then damage = 0 end
local finalDmg = defRole.data:SubValue(RoleDataName.Hp, damage)

View File

@ -1,4 +1,4 @@
RoleLogic = {}
RoleLogic = {}
RoleLogic.__index = RoleLogic
--local RoleLogic = RoleLogic
--local RoleDataName = RoleDataName
@ -47,7 +47,6 @@ function RoleLogic:Init(uid, data, position)
self.skill = data.skill
self.superSkill = data.superSkill
--首次读条时间=速度/20*(等级+10
self.sp = 0
local time = self:GetRoleData(RoleDataName.Speed)/(20*(self:GetRoleData(RoleDataName.Level)+10))
@ -378,6 +377,26 @@ function RoleLogic:AddSkill(type, isRage, isAdd, targets)
"targets", targets and #targets or "0"
)
end
--加入额外技能,用于额外释放技能 by:王振兴
function RoleLogic:InsertExtraSkill(id)
local effectData=BattleUtil.GetExtraSkillbyId(id)
if effectData then
--和老史,佳琦确认果 附加技能算绝技 被沉默无法释放 可以套娃 递归触发 by:王振兴
SkillManager.InsertSkill(self, effectData, BattleSkillType.Special, nil, true, false)
BattleLogManager.Log(
"Add Skill",
"camp", self.camp,
"pos", self.position,
"type", BattleSkillType.Extra,
"isRage", tostring(false),
"isAdd", tostring(true),
"targets", targets and #targets or "0"
)
end
end
-- 插入一个技能
function RoleLogic:InsertSkill(type, isRage, isAdd, targets)
if not self.IsCanAddSkill and isAdd then return end
@ -488,7 +507,7 @@ function RoleLogic:IsDead()
return self.isDead
end
function RoleLogic:IsRealDead()
return self.isRealDead
return self.isRealDead
end