Merge branch 'main' of http://git.hivekion.com:3000/liyudong/simulation-backend
This commit is contained in:
commit
447020fe6c
|
@ -143,10 +143,10 @@ public class BattleRootTask extends AbtParentTask {
|
||||||
}
|
}
|
||||||
injuredConsume = Long.valueOf(RandomUtil.getSecureRandom().nextInt(3));
|
injuredConsume = Long.valueOf(RandomUtil.getSecureRandom().nextInt(3));
|
||||||
ammunitionConsume = intervalDuringTime * (0.1D + RandomUtil.getSecureRandom().nextDouble());
|
ammunitionConsume = intervalDuringTime * (0.1D + RandomUtil.getSecureRandom().nextDouble());
|
||||||
foodConsume = intervalDuringTime * FOOD_SPREED;
|
foodConsume = FOOD_SPREED;
|
||||||
waterConsume = intervalDuringTime * WATER_SPREED;
|
waterConsume = WATER_SPREED;
|
||||||
|
|
||||||
medicalConsume = intervalDuringTime * MEDICAL_SPREED* RoomManager.getMag(roomId);
|
medicalConsume = MEDICAL_SPREED;
|
||||||
|
|
||||||
|
|
||||||
if(scenarioInfoOnTime.getAmmunition().getCurrent() - Double.valueOf(ammunition - ammunitionConsume)>0) {
|
if(scenarioInfoOnTime.getAmmunition().getCurrent() - Double.valueOf(ammunition - ammunitionConsume)>0) {
|
||||||
|
@ -271,7 +271,11 @@ public class BattleRootTask extends AbtParentTask {
|
||||||
battleConsume.setLng(teamLng);
|
battleConsume.setLng(teamLng);
|
||||||
battleConsume.setId(IdUtils.simpleUUID());
|
battleConsume.setId(IdUtils.simpleUUID());
|
||||||
battleConsume.setAmmunition(ammunitionConsume);
|
battleConsume.setAmmunition(ammunitionConsume);
|
||||||
battleConsume.setDeath(Integer.valueOf(Double.valueOf(deathConsume).intValue()));
|
if(deathConsume == 0L){
|
||||||
|
battleConsume.setDeath(0);
|
||||||
|
}else {
|
||||||
|
battleConsume.setDeath(Integer.valueOf(Double.valueOf(deathConsume).intValue()));
|
||||||
|
}
|
||||||
battleConsume.setInjured(Integer.valueOf(Double.valueOf(injuredConsume).intValue()));
|
battleConsume.setInjured(Integer.valueOf(Double.valueOf(injuredConsume).intValue()));
|
||||||
battleConsume.setFood(foodConsume);
|
battleConsume.setFood(foodConsume);
|
||||||
// battleConsume.setFuel(fuelConsume);
|
// battleConsume.setFuel(fuelConsume);
|
||||||
|
@ -340,6 +344,18 @@ public class BattleRootTask extends AbtParentTask {
|
||||||
respObj.setScenarioId(scenarioTask.getScenarioId());
|
respObj.setScenarioId(scenarioTask.getScenarioId());
|
||||||
respObj.setCmdType("deathRequest");
|
respObj.setCmdType("deathRequest");
|
||||||
Global.sendCmdInfoQueue.add(respObj);
|
Global.sendCmdInfoQueue.add(respObj);
|
||||||
|
log.info("================================begin death Supplier Task=====================================");
|
||||||
|
produceTask(scenarioInfoOnTime.getPerson().getDeath());
|
||||||
|
String jsonInjured = (String)redisUtil.hget(scenarioTask.getScenarioId() + "-" + roomId + "-" + scenarioTask.getResourceId(),"scenarioInfo");
|
||||||
|
ScenarioInfo scenarioInfoInjured =JSONObject.parseObject(jsonInjured,ScenarioInfo.class);
|
||||||
|
scenarioInfoInjured.getPerson().setDeath(Long.valueOf(0).intValue());
|
||||||
|
redisUtil.hset(scenarioTask.getScenarioId() + "-" + roomId + "-" + scenarioTask.getResourceId(), "scenarioInfo", JSONObject.toJSONString(scenarioInfoInjured));
|
||||||
|
String updJsonStr = (String) redisUtil.hget(scenarioTask.getScenarioId() + "-" + roomId + "-" + scenarioTask.getResourceId(), "updScenarioInfo");
|
||||||
|
EditScenarioInfo updScenarioInfo = JSON.parseObject(updJsonStr, EditScenarioInfo.class);
|
||||||
|
updScenarioInfo.getJbxx().getPerson().setDeath(Long.valueOf(0).intValue());
|
||||||
|
redisUtil.hset(scenarioTask.getScenarioId() + "-" + roomId + "-" + scenarioTask.getResourceId(),
|
||||||
|
"updScenarioInfo", JSON.toJSONString(updScenarioInfo));
|
||||||
|
log.info("================================end death Supplier Task=====================================");
|
||||||
suppleFlagMap.put("death", true);
|
suppleFlagMap.put("death", true);
|
||||||
}
|
}
|
||||||
Long restInjured = Long.valueOf(scenarioInfoOnTime.getPerson().getInjured());
|
Long restInjured = Long.valueOf(scenarioInfoOnTime.getPerson().getInjured());
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
injured.warn = 10
|
injured.warn = 20
|
||||||
death.warn = 56
|
death.warn = 2
|
||||||
ammunition.warn = 3
|
ammunition.warn = 3
|
||||||
food.warn = 3
|
food.warn = 3
|
||||||
water.warn = 3
|
water.warn = 3
|
||||||
|
|
Loading…
Reference in New Issue
Block a user