|
|
|
@ -15,6 +15,7 @@ import engine.gameManager.*;
@@ -15,6 +15,7 @@ import engine.gameManager.*;
|
|
|
|
|
import engine.net.ByteBufferWriter; |
|
|
|
|
import engine.net.client.msg.ErrorPopupMsg; |
|
|
|
|
import engine.server.MBServerStatics; |
|
|
|
|
import org.joda.time.DateTime; |
|
|
|
|
import org.pmw.tinylog.Logger; |
|
|
|
|
|
|
|
|
|
import java.net.UnknownHostException; |
|
|
|
@ -57,6 +58,8 @@ public class Mine extends AbstractGameObject {
@@ -57,6 +58,8 @@ public class Mine extends AbstractGameObject {
|
|
|
|
|
public Integer totalPlayers; |
|
|
|
|
|
|
|
|
|
public boolean hasProduced = false; |
|
|
|
|
|
|
|
|
|
public int mineTime; |
|
|
|
|
/** |
|
|
|
|
* ResultSet Constructor |
|
|
|
|
*/ |
|
|
|
@ -110,8 +113,34 @@ public class Mine extends AbstractGameObject {
@@ -110,8 +113,34 @@ public class Mine extends AbstractGameObject {
|
|
|
|
|
Building mineTower = BuildingManager.getBuilding(this.buildingID); |
|
|
|
|
mineTower.setMaxHitPoints(5000 * this.capSize); |
|
|
|
|
mineTower.setCurrentHitPoints((float)5000 * this.capSize); |
|
|
|
|
this.mineTime = ThreadLocalRandom.current().nextInt(1-23); |
|
|
|
|
refactorMineTime(this); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void refactorMineTime(Mine mine){ |
|
|
|
|
if(DateTime.now().dayOfWeek().getName().toLowerCase().equals("sunday")){ |
|
|
|
|
mine.mineTime += 1; |
|
|
|
|
} |
|
|
|
|
if(DateTime.now().dayOfWeek().getName().toLowerCase().equals("monday")){ |
|
|
|
|
mine.mineTime += 2; |
|
|
|
|
} |
|
|
|
|
if(DateTime.now().dayOfWeek().getName().toLowerCase().equals("tuesday")){ |
|
|
|
|
mine.mineTime += 3; |
|
|
|
|
} |
|
|
|
|
if(DateTime.now().dayOfWeek().getName().toLowerCase().equals("wednesday")){ |
|
|
|
|
mine.mineTime += 4; |
|
|
|
|
} |
|
|
|
|
if(DateTime.now().dayOfWeek().getName().toLowerCase().equals("thursday")){ |
|
|
|
|
mine.mineTime += 5; |
|
|
|
|
} |
|
|
|
|
if(DateTime.now().dayOfWeek().getName().toLowerCase().equals("friday")){ |
|
|
|
|
mine.mineTime += 6; |
|
|
|
|
} |
|
|
|
|
if(DateTime.now().dayOfWeek().getName().toLowerCase().equals("saturday")){ |
|
|
|
|
mine.mineTime += 7; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
public static void releaseMineClaims(PlayerCharacter playerCharacter) { |
|
|
|
|
|
|
|
|
|
if (playerCharacter == null) |
|
|
|
|