From a35eefefac8e4f4923bf753cebf47e8be4d2fa30 Mon Sep 17 00:00:00 2001 From: lvxinran Date: Mon, 28 Oct 2019 12:05:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=98=E6=96=97=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- luafight/Modules/Battle/Logic/Misc/BattleUtil.lua | 14 ++++++++------ luafight/Modules/Battle/Logic/RoleLogic.lua | 3 +-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/luafight/Modules/Battle/Logic/Misc/BattleUtil.lua b/luafight/Modules/Battle/Logic/Misc/BattleUtil.lua index 559e4b3d3..57eaea19a 100644 --- a/luafight/Modules/Battle/Logic/Misc/BattleUtil.lua +++ b/luafight/Modules/Battle/Logic/Misc/BattleUtil.lua @@ -271,12 +271,14 @@ function BattleUtil.CalDamage(atkRole, defRole, damageType, baseFactor, ignoreDe (1 + atkRole:GetRoleData(RoleDataName.ElementDamageBocusFactor) - defRole:GetRoleData(elementDamageReduceFactor))) --属性克制关系:光暗互克,地克风克水克火克地 - 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 + local atkEle = atkRole.roleData.element + local defEle = defRole.roleData.element + local restrain = atkEle == 1 and defEle == 4 or + atkEle == 4 and defEle == 2 or + atkEle == 2 and defEle == 3 or + atkEle == 3 and defEle == 1 or + atkEle == 5 and defEle == 6 or + atkEle == 6 and defEle == 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 diff --git a/luafight/Modules/Battle/Logic/RoleLogic.lua b/luafight/Modules/Battle/Logic/RoleLogic.lua index 12f3fd2a1..0ed57bbe6 100644 --- a/luafight/Modules/Battle/Logic/RoleLogic.lua +++ b/luafight/Modules/Battle/Logic/RoleLogic.lua @@ -41,7 +41,7 @@ local skillPool = BattleObjectPool.New(function () end) function RoleLogic.New() - local instance = {uid=0,roleData=0,data=RoleData.New(),camp=0,name=0,roleType=0,aiIndex=1,position=0,sp=0,spPass=0, + local instance = {uid=0,roleData=0,data=RoleData.New(),camp=0,name=0,aiIndex=1,position=0,sp=0,spPass=0, shield=BattleList.New(), exCalDmgList=BattleList.New(), proTranList=BattleList.New(), @@ -61,7 +61,6 @@ function RoleLogic:Init(uid, data, position) self.camp = data.camp --阵营 0:我方 1:敌方 self.name = data.name - self.roleType = 1 --阵营 1:普通 2:Boss 3:召唤物 self.shield:Clear() --护盾列表 self.exCalDmgList:Clear() --额外计算伤害列表