试炼炸弹使用次数限制
parent
044e43c4ce
commit
bc5255167a
|
|
@ -2057,6 +2057,7 @@ public class MapLogic {
|
|||
.setTowerUseTime((int)(mapManager.getCurrTowerTime()/1000))
|
||||
.setKillCount(mapManager.getTrialInfo().getKillCount())
|
||||
.addAllTrialRewardInfo(mapManager.getTrialInfo().getTowerReceivedReward())
|
||||
.setBombUsed(mapManager.getTrialInfo().getBombUseTimes())
|
||||
.build();
|
||||
builder.setTowerCopyInfo(towerCopyInfo);
|
||||
builder.addAllPlayedGenMapId(mapManager.getPlayGenMaps());
|
||||
|
|
@ -2375,6 +2376,7 @@ public class MapLogic {
|
|||
int[] bombReward = rewardResult.stream().mapToInt(Integer::valueOf).toArray();
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, bombReward, 1,1,BIReason.BOMB_REWARD);
|
||||
|
||||
mapManager.updateBombUseCount(mapManager.getTrialInfo().getBombUseTimes()+1);
|
||||
|
||||
mapManager.setTrialEnergy(100);
|
||||
MapInfoProto.MapTowerUseBombResponse.Builder response = MapInfoProto.MapTowerUseBombResponse.newBuilder();
|
||||
|
|
@ -2885,6 +2887,7 @@ public class MapLogic {
|
|||
trialInfo.setBuffIds(initBuff);
|
||||
trialInfo.setFloor(trialInfo.getFloor()-7>1?trialInfo.getFloor()-7:1);
|
||||
trialInfo.setKillCount(0);
|
||||
trialInfo.setBombUseTimes(0);
|
||||
trialInfo.setTowerReceivedReward(new HashSet<>());
|
||||
if(mapManager.getCurMapId()!=0){
|
||||
if(MapLogic.getInstance().getMap(user) instanceof TowerMap){
|
||||
|
|
|
|||
|
|
@ -817,6 +817,10 @@ public class MapManager extends MongoBase {
|
|||
trialInfo.setMapGameInfo(info);
|
||||
updateString("trialInfo.mapGameInfo",info);
|
||||
}
|
||||
public void updateBombUseCount(int bombUseCount){
|
||||
trialInfo.setBombUseTimes(bombUseCount);
|
||||
updateString("trialInfo.bombUseTimes",bombUseCount);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,8 @@ public class TrialInfo {
|
|||
|
||||
private MapGameInfo mapGameInfo = new MapGameInfo();
|
||||
|
||||
private int bombUseTimes;
|
||||
|
||||
public Set<Integer> getTowerReceivedReward() {
|
||||
return towerReceivedReward;
|
||||
}
|
||||
|
|
@ -138,4 +140,12 @@ public class TrialInfo {
|
|||
public void setMapGameInfo(MapGameInfo mapGameInfo) {
|
||||
this.mapGameInfo = mapGameInfo;
|
||||
}
|
||||
|
||||
public int getBombUseTimes() {
|
||||
return bombUseTimes;
|
||||
}
|
||||
|
||||
public void setBombUseTimes(int bombUseTimes) {
|
||||
this.bombUseTimes = bombUseTimes;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue