激活皮肤消耗

back_recharge
lvxinran 2020-11-01 18:50:54 +08:00
parent 7232b8604a
commit 4105cb1292
2 changed files with 7 additions and 0 deletions

View File

@ -290,4 +290,6 @@ public interface BIReason {
int SPECIAL_FREE_PIECE_CONSUME = 1072;//灵兽放生碎片消耗
int SKIN_USE_CONSUME = 1073;//激活皮肤消耗
}

View File

@ -204,6 +204,11 @@ public class ItemLogic {
}else{
time = sHeroSkin.getTime()+TimeUtils.nowInt();
}
boolean use = ItemUtil.itemCost(user,new int[][]{{item.getItemId(),item.getItemNum()}},BIReason.SKIN_USE_CONSUME,1);
if(!use){
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
}
user.getHeroManager().addSkin(sHeroSkin.getType(),time);
ItemUtil.drop(user,new int[][]{sHeroSkin.getHeadIcon()},BIReason.SKIN_USE_REWARD);
HeroInfoProto.GetSkinIndication indication = HeroInfoProto.GetSkinIndication.newBuilder()