战斗同步0.94

back_recharge
lvxinran 2019-10-23 23:37:04 +08:00
parent fa6f4e546d
commit e5a1eb23cf
4 changed files with 37 additions and 20 deletions

View File

@ -1124,19 +1124,19 @@ local passivityList = {
end
role.Event:AddEvent(BattleEventName.RoleBeHit, OnBeHit)
end,
--发动技能后,有[a]的概率为自身及相邻加持攻击[b]%的护盾,持续[c]秒。
--a[float],b[float],c[int]
--发动技能后,有[a]的概率为自身及相邻加持[b][c]%的护盾,持续[d]秒。
--a[float],b[属性],c[float],d[int]
[62] = function(role, args)
local f1 = args[1]
local f2 = args[2]
local f3 = args[3]
local pro = args[2]
local f2 = args[3]
local f3 = args[4]
local OnSkillCastEnd = function(skill)
BattleUtil.RandomAction(f1, function ()
role:AddBuff(Buff.Create(role, BuffName.Shield, f3, floor(role:GetRoleData(RoleDataName.Attack) * f2), 0))
local list = BattleLogic.GetNeighbor(role, 1)
for i=1, #list do
list[i]:AddBuff(Buff.Create(role, BuffName.Shield, f3, floor(role:GetRoleData(RoleDataName.Attack) * f2), 0))
list[i]:AddBuff(Buff.Create(role, BuffName.Shield, f3, floor(role:GetRoleData(propertyList[pro]) * f2), 0))
end
end)
end

View File

@ -141,17 +141,28 @@ function Skill:Cast()
end
if not self.isTeamSkill then
if self.owner.superSkill == self then
--绝技读条时间=max9-速度/8*(等级+10,3)
local time = max(9-self.owner:GetRoleData(RoleDataName.Speed)/(8*(self.owner:GetRoleData(RoleDataName.Level)+10)), 3)
self.owner.sp = 0
self.owner.spPass = floor(BattleUtil.ErrorCorrection(time) * BattleLogic.GameFrameRate)
local type = BattleLogic.Type
local isPVEMonster = self.owner.camp == 1 and (type == 1 or type == 2 or type == 4 or type == 5)
local time = 0
if isPVEMonster then
if self.owner.superSkill == self then
--怪物绝技读条时间=max10-速度/8*(等级+10,2)
time = max(10-self.owner:GetRoleData(RoleDataName.Speed)/(8*(self.owner:GetRoleData(RoleDataName.Level)+10)), 2)
else
--怪物普技读条时间==max9-速度/8*(等级+10,1)
time = max(9-self.owner:GetRoleData(RoleDataName.Speed)/(8*(self.owner:GetRoleData(RoleDataName.Level)+10)), 1)
end
else
--普技读条时间=max7-速度/8*(等级+10,1.5)
local time = max(7-self.owner:GetRoleData(RoleDataName.Speed)/(8*(self.owner:GetRoleData(RoleDataName.Level)+10)), 1.5)
self.owner.sp = 0
self.owner.spPass = floor(BattleUtil.ErrorCorrection(time) * BattleLogic.GameFrameRate)
if self.owner.superSkill == self then
--绝技读条时间=max9-速度/8*(等级+10,3)
time = max(9-self.owner:GetRoleData(RoleDataName.Speed)/(8*(self.owner:GetRoleData(RoleDataName.Level)+10)), 3)
else
--普技读条时间=max7-速度/8*(等级+10,1.5)
time = max(7-self.owner:GetRoleData(RoleDataName.Speed)/(8*(self.owner:GetRoleData(RoleDataName.Level)+10)), 1.5)
end
end
self.owner.sp = 0
self.owner.spPass = floor(BattleUtil.ErrorCorrection(time) * BattleLogic.GameFrameRate)
else
self.owner.curSkill = self
end

View File

@ -9,9 +9,6 @@ local curUid
local curBuffId
local curFrame
local playerMP
local enemyMP
local playerSkillUsable
local enemySkillUsable

View File

@ -230,6 +230,7 @@ function BattleUtil.CalDamage(atkRole, defRole, damageType, baseFactor, ignoreDe
local baseDamage
ignoreDef = 1 - (ignoreDef or 0)
bCrit = Random.Range01() <= clamp(atkRole:GetRoleData(RoleDataName.Crit)-defRole:GetRoleData(RoleDataName.Tenacity), 0, 1)
bCrit = bCrit or defRole.isFlagCrit == true
local defence = 0
if damageType == 1 then --1 物理 2 魔法
defence = defRole:GetRoleData(RoleDataName.PhysicalDefence)
@ -238,7 +239,7 @@ function BattleUtil.CalDamage(atkRole, defRole, damageType, baseFactor, ignoreDe
end
local attack = atkRole:GetRoleData(RoleDataName.Attack)
--计算暴击
if bCrit or defRole.isFlagCrit then
if bCrit then
local critDamageFactor = atkRole:GetRoleData(RoleDataName.CritDamageFactor)
--加入被动效果
local critFunc = function(critEx) critDamageFactor = critEx end
@ -267,7 +268,15 @@ function BattleUtil.CalDamage(atkRole, defRole, damageType, baseFactor, ignoreDe
baseDamage = BattleUtil.FP_Mul(baseDamage, baseFactor,
1 + atkRole:GetRoleData(RoleDataName.DamageBocusFactor) - defRole:GetRoleData(RoleDataName.DamageReduceFactor),
(1 + atkRole:GetRoleData(RoleDataName.ElementDamageBocusFactor) - defRole:GetRoleData(elementDamageReduceFactor)))
baseDamage = floor(max(baseDamage, 0.1 * attack))
--属性克制关系:光暗互克,地克风克水克火克地
local restrain = atkRole.element == 1 and defRole.element == 4 or
atkRole.element == 4 and defRole.element == 2 or
atkRole.element == 2 and defRole.element == 3 or
atkRole.element == 3 and defRole.element == 1 or
atkRole.element == 5 and defRole.element == 6 or
atkRole.element == 6 and defRole.element == 5
baseDamage = restrain and floor(max(baseDamage*1.5, 0.1*attack)) or floor(max(baseDamage, 0.1*attack))
for i=1, atkRole.exCalDmgList.size do
local func = atkRole.exCalDmgList.buffer[i]