From 51ca7053a112087c40dd3ce73da3e046df7970ae Mon Sep 17 00:00:00 2001 From: lvxinran Date: Mon, 7 Sep 2020 15:51:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=AD=E4=B9=B0buff=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=8C=E9=AD=82=E5=8D=B0=E5=9F=BA=E7=A1=80=E6=88=98=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../logic/family/GuildChallengeLogic.java | 17 +++++++++-------- .../com/ljsd/jieling/logic/hero/HeroLogic.java | 9 +++++++++ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/family/GuildChallengeLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/family/GuildChallengeLogic.java index 3a4ab9c58..c5da6e0d4 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/family/GuildChallengeLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/family/GuildChallengeLogic.java @@ -356,14 +356,7 @@ public class GuildChallengeLogic { SGuildCheckpointConfig config = STableManager.getConfig(SGuildCheckpointConfig.class).get(guildInfo.getCurrBossId()); int[] attributePromote = config.getAttributePromote(); int maxCount = attributePromote.length; - if(guildInfo.getBuffIndex()>=maxCount){ - throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE); - } - int[][] attributePromotePrice = config.getAttributePromotePrice(); - boolean itemCost = ItemUtil.itemCost(user, new int[][]{{attributePromotePrice[0][0], attributePromotePrice[1][guildInfo.getBuffIndex()]}}, BIReason.GUILD_CHALLENGE_BUFF_BUY_CONSUME, 1); - if(!itemCost){ - throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE); - } + synchronized (lockMap.get(guildId)){ int time; @@ -376,6 +369,14 @@ public class GuildChallengeLogic { } time = TimeUtils.nowInt() + 3600; } + if(guildInfo.getBuffIndex()>=maxCount){ + throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE); + } + int[][] attributePromotePrice = config.getAttributePromotePrice(); + boolean itemCost = ItemUtil.itemCost(user, new int[][]{{attributePromotePrice[0][0], attributePromotePrice[1][guildInfo.getBuffIndex()]}}, BIReason.GUILD_CHALLENGE_BUFF_BUY_CONSUME, 1); + if(!itemCost){ + throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE); + } guildInfo.setBuffIndex(guildInfo.getBuffIndex()+1); int fiveTime = (int)(TimeUtils.getLastOrUnderHour(TimeUtils.now(), 5, 0, false)/1000); guildInfo.setBuffOverTime(Math.min(time,fiveTime)); diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java index 200e59ac9..e1fc6a815 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java @@ -1544,6 +1544,15 @@ public class HeroLogic{ combinedAttribute(config.get(buildLevelProperty).getProperty(),heroAllAttribute); } } + //魂印 + Map soulEquipByPositionMap = hero.getSoulEquipByPositionMap(); + soulEquipByPositionMap.forEach((k,v)->{ + SEquipConfig sEquipConfig = STableManager.getConfig(SEquipConfig.class).get(v); + int[][] property = sEquipConfig.getProperty(); + if(property!=null&&property.length>0){ + combinedAttribute(property,heroAllAttribute); + } + }); //皮肤、称号加成