Browse Source

hard set mine windows

lakebane-master
FatBoy-DOTC 10 months ago
parent
commit
5713dab8cf
  1. 21
      src/engine/objects/Mine.java

21
src/engine/objects/Mine.java

@ -212,19 +212,6 @@ public class Mine extends AbstractGameObject { @@ -212,19 +212,6 @@ public class Mine extends AbstractGameObject {
for (Mine mine : serverMines) {
Mine.mineMap.put(mine, mine.buildingID);
Mine.towerMap.put(mine.buildingID, mine);
if(mine.capSize == 5){
mine.liveLength = 1800;
}
if(mine.capSize == 10){
if(ThreadLocalRandom.current().nextInt(0,100) > 50){
mine.liveLength = 1800;
} else{
mine.liveLength = 3600;
}
}
if(mine.capSize == 20){
mine.liveLength = 3600;
}
}
ChinaMines.add(serverMines.get(0));
@ -293,7 +280,7 @@ public class Mine extends AbstractGameObject { @@ -293,7 +280,7 @@ public class Mine extends AbstractGameObject {
writer.putInt(mine.production.hash);
writer.putInt(mine.getModifiedProductionAmount());
writer.putInt(mine.getModifiedProductionAmount()); //TODO calculate range penalty here
writer.putInt(mine.liveLength); //window in seconds
writer.putInt(3600); //window in seconds
// Errant mines are currently open. Set time to now.
@ -314,11 +301,7 @@ public class Mine extends AbstractGameObject { @@ -314,11 +301,7 @@ public class Mine extends AbstractGameObject {
mineOpenTime = LocalDateTime.now().withHour(mine.liveTime).withMinute(0).withSecond(0).withNano(0);
writer.putLocalDateTime(mineOpenTime);
if(mine.liveLength == 3600) {
writer.putLocalDateTime(mineOpenTime.plusHours(1));
} else{
writer.putLocalDateTime(mineOpenTime.plusMinutes(30));
}
writer.putLocalDateTime(mineOpenTime.plusHours(1));
writer.put(mine.isActive ? (byte) 0x01 : (byte) 0x00);
Building mineTower = BuildingManager.getBuilding(mine.buildingID);

Loading…
Cancel
Save