diff --git a/luafight/Modules/Battle/Logic/Base/Effect.lua b/luafight/Modules/Battle/Logic/Base/Effect.lua index 1ff2a9d37..b41f63aa7 100644 --- a/luafight/Modules/Battle/Logic/Base/Effect.lua +++ b/luafight/Modules/Battle/Logic/Base/Effect.lua @@ -260,15 +260,25 @@ local effectList = { end end) end, - --吸取[a]%的[b],持续[c]秒 - --a[float],b[属性],c[float] + --吸取[a]%的[b],持续[c]秒(属于增益),累积不高于自身该属性的[d]% + --a[float],b[属性],c[float],d[float] [16] = function(caster, target, args, interval) local f1 = args[1] - local dt = args[2] + local pro = args[2] local f2 = args[3] + local f3 = args[4] BattleLogic.WaitForTrigger(interval, function () - target:AddBuff(Buff.Create(caster, BuffName.PropertyChange, f2, propertyList[dt], f1, 4)) - caster:AddBuff(Buff.Create(caster, BuffName.PropertyChange, f2, propertyList[dt], f1, 2)) + --计算上限值 + local total = caster.data:GetOrginData(propertyList[pro]) * (1 + f3) + --计算预期吸取后的值 + local targetValue = caster:GetRoleData(propertyList[pro]) + target:GetRoleData(propertyList[pro]) * f1 + --计算有效吸收值 + local delta = min(targetValue, total) - caster:GetRoleData(propertyList[pro]) + + if delta > 0 then + target:AddBuff(Buff.Create(caster, BuffName.PropertyChange, f2, propertyList[pro], delta, 3)) + caster:AddBuff(Buff.Create(caster, BuffName.PropertyChange, f2, propertyList[pro], delta, 1)) + end end) end, --造成[a]%的[b]伤害,如果是[c],有[d]%必定暴击 diff --git a/luafight/Modules/Battle/Logic/Base/RoleData.lua b/luafight/Modules/Battle/Logic/Base/RoleData.lua index ab8a992c7..446865b55 100644 --- a/luafight/Modules/Battle/Logic/Base/RoleData.lua +++ b/luafight/Modules/Battle/Logic/Base/RoleData.lua @@ -3,11 +3,8 @@ RoleData.__index = RoleData local max = math.max local floor = math.floor function RoleData.New() - local instance = {role=0, data={0,0,0,0,0, - 0,0,0,0,0, - 0,0,0,0,0, - 0,0,0,0,0, - 0,0,0,0,0}} + local instance = {role=0, data={0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0}, + orginData={0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0}} setmetatable(instance, RoleData) return instance end @@ -16,6 +13,7 @@ function RoleData:Init(role, data) self.role = role for i=1, #data do self.data[i] = floor(data[i] * 100000 + 0.5) / 100000 --进行精度处理,避免前后端计算不一致 + self.orginData[i] = floor(data[i] * 100000 + 0.5) / 100000 --进行精度处理,避免前后端计算不一致 end end @@ -25,6 +23,12 @@ function RoleData:GetData(name) end end +function RoleData:GetOrginData(name) + if self.orginData[name] then + return self.orginData[name] + end +end + function RoleData:SetValue(name, value) if self.data[name] then local delta = self.data[name] @@ -51,7 +55,7 @@ end function RoleData:AddPencentValue(name, pencent) if self.data[name] then - return self:AddValue(name, self.data[name] * pencent) + return self:AddValue(name, self.orginData[name] * pencent) end return 0 end diff --git a/luafight/Modules/Battle/Logic/Base/Skill.lua b/luafight/Modules/Battle/Logic/Base/Skill.lua index 015906934..1669ccb5e 100644 --- a/luafight/Modules/Battle/Logic/Base/Skill.lua +++ b/luafight/Modules/Battle/Logic/Base/Skill.lua @@ -139,18 +139,17 @@ function Skill:Cast() BattleLogic.SetAggro(self.owner) if not self.isTeamSkill then + local time = max(8-self.owner:GetRoleData(RoleDataName.Speed)/(8*(self.owner:GetRoleData(RoleDataName.Level)+10)), 1.5) if self.owner.superSkill == self then self.sp = 0 self.spPass = floor(self.cd * BattleLogic.GameFrameRate) BattleLogic.AddMP(self.owner.camp, 10) if self.owner.skill then local skill = self.owner.skill - local time = max(8-self.owner:GetRoleData(RoleDataName.Speed)/(8*(self.owner:GetRoleData(RoleDataName.Level)+10)), 1.5) skill.sp = 0 skill.spPass = floor(time * BattleLogic.GameFrameRate) end else - local time = max(8-self.owner:GetRoleData(RoleDataName.Speed)/(8*(self.owner:GetRoleData(RoleDataName.Level)+10)), 1.5) self.sp = 0 self.spPass = floor(time * BattleLogic.GameFrameRate) BattleLogic.AddMP(self.owner.camp, 8) diff --git a/luafight/Modules/Battle/Logic/Misc/BattleUtil.lua b/luafight/Modules/Battle/Logic/Misc/BattleUtil.lua index 666d5de67..fb7d83236 100644 --- a/luafight/Modules/Battle/Logic/Misc/BattleUtil.lua +++ b/luafight/Modules/Battle/Logic/Misc/BattleUtil.lua @@ -91,8 +91,8 @@ function BattleUtil.ChooseTarget(role, chooseId) end) elseif chooseWeight == 7 then BattleUtil.Sort(arr, function(a, b) - local r1 = a:GetRoleData(RoleDataName.MagicDefence) - local r2 = b:GetRoleData(RoleDataName.MagicDefence) + local r1 = a:GetSkillCD() + local r2 = b:GetSkillCD() if sort == 1 then return r1 > r2 else return r1 < r2 end end) end diff --git a/luafight/Modules/Battle/Logic/RoleLogic.lua b/luafight/Modules/Battle/Logic/RoleLogic.lua index 2944543ab..2613ce601 100644 --- a/luafight/Modules/Battle/Logic/RoleLogic.lua +++ b/luafight/Modules/Battle/Logic/RoleLogic.lua @@ -122,6 +122,18 @@ function RoleLogic:CanCastSkill() return self.enable and not self.ctrl_slient and not self.IsDebug and BattleLogic.GetSkillUsable(self.camp) end +function RoleLogic:GetSkillCD() + local cd = 0 + if self.skill and not self.superSkill then + cd = max(self.skill.spPass - self.skill.sp, 0) + elseif not self.skill and self.superSkill then + cd = max(self.superSkill.spPass - self.superSkill.sp, 0) + elseif self.skill and self.superSkill then + cd = max(self.skill.spPass - self.skill.sp, 0) + max(self.superSkill.spPass - self.superSkill.sp, 0) + end + return cd +end + function RoleLogic:GetRoleData(property) local tarPro = self.data:GetData(property) local item diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/GetPlayerInfoHandler.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/GetPlayerInfoHandler.java index 4fa5b1827..aff360940 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/GetPlayerInfoHandler.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/GetPlayerInfoHandler.java @@ -61,7 +61,7 @@ public class GetPlayerInfoHandler extends BaseHandler{ //竞技场免费次数刷新 ArenaLogic.getInstance().flushFreeUseTimes(user); PlayerLogic.getInstance().vipflushEveryDay(user); - user.getUserMissionManager().onGameEvent(user, GameEvent.DAILY_REFRESH); + user.getUserMissionManager().onGameEvent(user, GameEvent.DAILY_REFRESH,0); } playerInfoManager.setLoginTime(TimeUtils.now()); Map guidePoints = playerInfoManager.getGuidePoints(); diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/UserMissionManager.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/UserMissionManager.java index 7b9d78c0c..5e9f7300a 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/UserMissionManager.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/UserMissionManager.java @@ -40,6 +40,9 @@ public class UserMissionManager extends MongoBase { Set missionIds = SDailyTasksConfig.config.keySet(); int type = (int)parm[0]; if(type == 0){ + if( dailyMissionIdsType.getDoingMissionIds().isEmpty() && dailyMissionIdsType.getFinishMissionIds().isEmpty() && dailyMissionIdsType.getRewardedMissionIds().isEmpty() ){ + return; + } dailyMissionIdsType.getDoingMissionIds().clear(); dailyMissionIdsType.getFinishMissionIds().clear(); dailyMissionIdsType.getRewardedMissionIds().clear();