Browse Source

mine work

lakebane-master
FatBoy-DOTC 7 months ago
parent
commit
54c0b3d7ce
  1. 2
      src/engine/devcmd/cmds/PrintStatsCmd.java
  2. 14
      src/engine/objects/Mine.java
  3. 2
      src/engine/workthreads/MineThread.java

2
src/engine/devcmd/cmds/PrintStatsCmd.java

@ -76,7 +76,7 @@ public class PrintStatsCmd extends AbstractDevCmd {
out += "Health Regen: " + tar.getRegenModifier(Enum.ModType.HealthRecoverRate) + newline; out += "Health Regen: " + tar.getRegenModifier(Enum.ModType.HealthRecoverRate) + newline;
out += "Stamina Regen: " + tar.getRegenModifier(Enum.ModType.StaminaRecoverRate) + newline; out += "Stamina Regen: " + tar.getRegenModifier(Enum.ModType.StaminaRecoverRate) + newline;
out += "Mana Regen: " + tar.getRegenModifier(Enum.ModType.ManaRecoverRate) + newline; out += "Mana Regen: " + tar.getRegenModifier(Enum.ModType.ManaRecoverRate) + newline;
out += "Zerg Multiplier: " + tar.ZergMultiplier + newline;
throwbackInfo(pc, out); throwbackInfo(pc, out);
} }

14
src/engine/objects/Mine.java

@ -66,6 +66,8 @@ public class Mine extends AbstractGameObject {
public static ArrayList<Mine> ChinaMines = new ArrayList<>(); public static ArrayList<Mine> ChinaMines = new ArrayList<>();
public static ArrayList<Mine> EuroMines = new ArrayList<>(); public static ArrayList<Mine> EuroMines = new ArrayList<>();
public static ArrayList<Mine> AmericaMines = new ArrayList<>(); public static ArrayList<Mine> AmericaMines = new ArrayList<>();
public boolean wasOpened = false;
/** /**
* ResultSet Constructor * ResultSet Constructor
*/ */
@ -349,6 +351,16 @@ public class Mine extends AbstractGameObject {
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
for(Mine mine : Mine.getMines()){
int minute = 0;
if (mine.firstThirty == false)
minute = 30;
LocalDateTime openTime = LocalDateTime.now().withHour(mine.liveTime).withMinute(minute).withSecond(0);
LocalDateTime closeTime = openTime.plusMinutes(30);
if(LocalDateTime.now().isAfter(closeTime))
mine.wasOpened = true;
}
} }
/* /*
@ -585,6 +597,8 @@ public class Mine extends AbstractGameObject {
if(isAc) { if(isAc) {
ZergMechanicThread.startZergThreadMine(this); ZergMechanicThread.startZergThreadMine(this);
} }
this.wasOpened = true;
} }
public boolean validForMine(Resource r) { public boolean validForMine(Resource r) {

2
src/engine/workthreads/MineThread.java

@ -45,7 +45,7 @@ public class MineThread implements Runnable {
LocalDateTime closeTime = openTime.plusMinutes(30); LocalDateTime closeTime = openTime.plusMinutes(30);
//current time is after start time and before close time, open mine window //current time is after start time and before close time, open mine window
if (LocalDateTime.now().isAfter(openTime.minusMinutes(1)) && !mine.wasClaimed) { if (LocalDateTime.now().isAfter(openTime.minusMinutes(1)) && !mine.wasClaimed && !mine.wasOpened) {
mineWindowOpen(mine); mineWindowOpen(mine);
continue; continue;
} }

Loading…
Cancel
Save