加经验
parent
d6ab9a413d
commit
291d8acbae
|
@ -17,6 +17,8 @@ public class SWorkShopRebuildConfig implements BaseConfig {
|
|||
|
||||
private int[][] secondaryCost;
|
||||
|
||||
private int exp;
|
||||
|
||||
private static Map<Integer,SWorkShopRebuildConfig> sWorkShopRebuildConfigMap;
|
||||
|
||||
|
||||
|
@ -51,5 +53,7 @@ public class SWorkShopRebuildConfig implements BaseConfig {
|
|||
return secondaryCost;
|
||||
}
|
||||
|
||||
|
||||
public int getExp() {
|
||||
return exp;
|
||||
}
|
||||
}
|
|
@ -114,10 +114,13 @@ public class WorkShopLogic {
|
|||
|
||||
}
|
||||
|
||||
private void times2Array(int [][] array,int times){
|
||||
for(int[] a :array){
|
||||
a[1] =a[1]*times;
|
||||
private int[][] times2Array(int [][] array,int times){
|
||||
int[][] result = new int[array.length][];
|
||||
for(int i=0;i<array.length;i++){
|
||||
int value = array[i][1] * times;
|
||||
result[i] = new int[]{array[i][0],value};
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private boolean checkIsUnlock(int optType,int type,WorkShopController workShopController,int[] openRules){
|
||||
|
@ -221,8 +224,8 @@ public class WorkShopLogic {
|
|||
LOGGER.error("不匹配");
|
||||
}
|
||||
int[][] cost = sWorkShopFoundationConfig.getCost();
|
||||
times2Array(cost,nums);
|
||||
if( !ItemUtil.itemCost(user, cost)){
|
||||
int[][] reallyCost = times2Array(cost, nums);
|
||||
if( !ItemUtil.itemCost(user, reallyCost)){
|
||||
MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.WORKSHOP_FOUNDATION_RESPONSE_VALUE,"道具不足");
|
||||
return;
|
||||
}
|
||||
|
@ -320,7 +323,9 @@ public class WorkShopLogic {
|
|||
MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.WORKSHOP_REBUILD_RESPONSE_VALUE,err);
|
||||
return;
|
||||
}
|
||||
|
||||
SWorkShopRebuildConfig sWorkShopRebuildConfig = SWorkShopRebuildConfig.getsWorkShopRebuildConfigByQulity(sEquipConfig.getQuality());
|
||||
int addExp = sWorkShopRebuildConfig.getExp();
|
||||
user.getWorkShopController().addWorkShopExp(addExp);
|
||||
equip.rebuildEquip(user.getWorkShopController().getWorkShopLevel());
|
||||
equipManager.addEquip(equip);
|
||||
PlayerInfoProto.WorkShopRebuildRespoonse build = PlayerInfoProto.WorkShopRebuildRespoonse.newBuilder().setEquip(CBean2Proto.getEquipProto(equip)).build();
|
||||
|
|
Loading…
Reference in New Issue