FIX
parent
38950f5f46
commit
1c7be8d183
|
|
@ -41,7 +41,7 @@ public class SGameSetting implements BaseConfig {
|
|||
|
||||
private int invasionBossPrivilege;
|
||||
|
||||
private int invasionBossTimesAdd;
|
||||
private int invasionBossItem;
|
||||
|
||||
private int adventureFastBattle;
|
||||
|
||||
|
|
@ -61,7 +61,7 @@ public class SGameSetting implements BaseConfig {
|
|||
|
||||
private int equipCompoundLimit;
|
||||
|
||||
private int[] dailyGift;
|
||||
private int[][] dailyGift;
|
||||
|
||||
private int recoveryTime;
|
||||
|
||||
|
|
@ -163,8 +163,8 @@ public class SGameSetting implements BaseConfig {
|
|||
return invasionBossPrivilege;
|
||||
}
|
||||
|
||||
public int getInvasionBossTimesAdd() {
|
||||
return invasionBossTimesAdd;
|
||||
public int getInvasionBossItem() {
|
||||
return invasionBossItem;
|
||||
}
|
||||
|
||||
public int getAdventureFastBattle() {
|
||||
|
|
@ -175,7 +175,7 @@ public class SGameSetting implements BaseConfig {
|
|||
return adventureOffline;
|
||||
}
|
||||
|
||||
public int[] getDailyGift() {
|
||||
public int[][] getDailyGift() {
|
||||
return dailyGift;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -88,4 +88,6 @@ public interface BIReason {
|
|||
|
||||
int BOMB_CONSUME = 1023;
|
||||
|
||||
int CHALLENGE_INVASIONBOSS_CONSUME = 1024;
|
||||
|
||||
}
|
||||
|
|
@ -1,7 +1,5 @@
|
|||
package com.ljsd.jieling.logic.fight;
|
||||
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
import com.ljsd.jieling.config.*;
|
||||
import com.ljsd.jieling.core.GlobalsDef;
|
||||
import com.ljsd.jieling.core.VipPrivilegeType;
|
||||
|
|
@ -606,9 +604,13 @@ public class CombatLogic {
|
|||
MessageUtil.sendErrorResponse(session,0, MessageTypeProto.MessageType.ADVENTURE_BOSS_CHALLENGE_RESPONSE_VALUE,"");
|
||||
return;
|
||||
}
|
||||
int [] a= new int[]{1,1};
|
||||
PlayerManager playerInfoManager = user.getPlayerInfoManager();
|
||||
if(!playerInfoManager.check(invasionBossPrivilege,fightTimes)){
|
||||
MessageUtil.sendErrorResponse(session,0, MessageTypeProto.MessageType.ADVENTURE_BOSS_CHALLENGE_RESPONSE_VALUE,"over fight");
|
||||
int[][] costs = new int[1][];
|
||||
costs[0] =new int[]{SGameSetting.getGameSetting().getInvasionBossItem(),fightTimes};
|
||||
boolean enough = ItemUtil.itemCost(user, costs, BIReason.CHALLENGE_INVASIONBOSS_CONSUME, fightTimes);
|
||||
if(!enough){
|
||||
MessageUtil.sendErrorResponse(session,0, MessageTypeProto.MessageType.ADVENTURE_BOSS_CHALLENGE_RESPONSE_VALUE,"道具不足");
|
||||
return;
|
||||
}
|
||||
if(fightTimes==1 && skipFight==0){
|
||||
|
|
|
|||
|
|
@ -229,19 +229,20 @@ public class PlayerLogic {
|
|||
int vipLevel = user.getPlayerInfoManager().getVipLevel();
|
||||
SVipLevelConfig sVipLevelConfig = SVipLevelConfig.getsVipLevelConfigMap().get(vipLevel);
|
||||
Map<Integer, Integer> privilegeMap = sVipLevelConfig.getPrivilegeMap();
|
||||
int[] dailyGift = SGameSetting.getGameSetting().getDailyGift();
|
||||
|
||||
if(privilegeMap!=null&&privilegeMap.containsKey(dailyGift[1])){
|
||||
Item item = user.getItemManager().getItem(dailyGift[0]);
|
||||
Integer num = privilegeMap.get(dailyGift[1]);
|
||||
int hadNum=0;
|
||||
if(item!=null){
|
||||
hadNum=item.getItemNum();
|
||||
}
|
||||
if(hadNum<num){
|
||||
Map<Integer,Integer> itemMap = new HashMap<>(1);
|
||||
itemMap.put(dailyGift[0],num-hadNum);
|
||||
ItemUtil.addItem(user,itemMap,null,BIReason.VIP_DAY_REWARD);
|
||||
int[][] dailyGifts = SGameSetting.getGameSetting().getDailyGift();
|
||||
for(int[] dailyGift : dailyGifts){
|
||||
if(privilegeMap!=null&&privilegeMap.containsKey(dailyGift[1])){
|
||||
Item item = user.getItemManager().getItem(dailyGift[0]);
|
||||
Integer num = privilegeMap.get(dailyGift[1]);
|
||||
int hadNum=0;
|
||||
if(item!=null){
|
||||
hadNum=item.getItemNum();
|
||||
}
|
||||
if(hadNum<num){
|
||||
Map<Integer,Integer> itemMap = new HashMap<>(1);
|
||||
itemMap.put(dailyGift[0],num-hadNum);
|
||||
ItemUtil.addItem(user,itemMap,null,BIReason.VIP_DAY_REWARD);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(fBuilder!=null){
|
||||
|
|
@ -253,7 +254,6 @@ public class PlayerLogic {
|
|||
. setUsedTimes(vipInfoItem.getValue())
|
||||
.build());
|
||||
}
|
||||
|
||||
fBuilder.setHadTakeDailyBox(playerInfoManager.getHadTakeDailyBoxVip()).addAllPrivilege(privilegeList);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue