|
|
@ -114,34 +114,35 @@ public class Mine extends AbstractGameObject { |
|
|
|
mineTower.setMaxHitPoints(5000 * this.capSize); |
|
|
|
mineTower.setMaxHitPoints(5000 * this.capSize); |
|
|
|
mineTower.setCurrentHitPoints((float)5000 * this.capSize); |
|
|
|
mineTower.setCurrentHitPoints((float)5000 * this.capSize); |
|
|
|
this.mineTime = ThreadLocalRandom.current().nextInt(1-23); |
|
|
|
this.mineTime = ThreadLocalRandom.current().nextInt(1-23); |
|
|
|
|
|
|
|
this.mineTime *= 100; |
|
|
|
refactorMineTime(this); |
|
|
|
refactorMineTime(this); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void refactorMineTime(Mine mine){ |
|
|
|
public static void refactorMineTime(Mine mine){ |
|
|
|
if(DateTime.now().dayOfWeek().getName().toLowerCase().equals("sunday")){ |
|
|
|
if(DateTime.now().dayOfWeek().getName().toLowerCase().equals("sunday")){ |
|
|
|
mine.mineTime += 1; |
|
|
|
mine.mineTime += 100; |
|
|
|
} |
|
|
|
} |
|
|
|
if(DateTime.now().dayOfWeek().getName().toLowerCase().equals("monday")){ |
|
|
|
if(DateTime.now().dayOfWeek().getName().toLowerCase().equals("monday")){ |
|
|
|
mine.mineTime += 2; |
|
|
|
mine.mineTime += 200; |
|
|
|
} |
|
|
|
} |
|
|
|
if(DateTime.now().dayOfWeek().getName().toLowerCase().equals("tuesday")){ |
|
|
|
if(DateTime.now().dayOfWeek().getName().toLowerCase().equals("tuesday")){ |
|
|
|
mine.mineTime += 3; |
|
|
|
mine.mineTime += 300; |
|
|
|
} |
|
|
|
} |
|
|
|
if(DateTime.now().dayOfWeek().getName().toLowerCase().equals("wednesday")){ |
|
|
|
if(DateTime.now().dayOfWeek().getName().toLowerCase().equals("wednesday")){ |
|
|
|
mine.mineTime += 4; |
|
|
|
mine.mineTime += 400; |
|
|
|
} |
|
|
|
} |
|
|
|
if(DateTime.now().dayOfWeek().getName().toLowerCase().equals("thursday")){ |
|
|
|
if(DateTime.now().dayOfWeek().getName().toLowerCase().equals("thursday")){ |
|
|
|
mine.mineTime += 5; |
|
|
|
mine.mineTime += 500; |
|
|
|
} |
|
|
|
} |
|
|
|
if(DateTime.now().dayOfWeek().getName().toLowerCase().equals("friday")){ |
|
|
|
if(DateTime.now().dayOfWeek().getName().toLowerCase().equals("friday")){ |
|
|
|
mine.mineTime += 6; |
|
|
|
mine.mineTime += 600; |
|
|
|
} |
|
|
|
} |
|
|
|
if(DateTime.now().dayOfWeek().getName().toLowerCase().equals("saturday")){ |
|
|
|
if(DateTime.now().dayOfWeek().getName().toLowerCase().equals("saturday")){ |
|
|
|
mine.mineTime += 7; |
|
|
|
mine.mineTime += 700; |
|
|
|
} |
|
|
|
} |
|
|
|
if(mine.mineTime >= 24) |
|
|
|
if(mine.mineTime >= 2400) |
|
|
|
mine.mineTime -= 24; |
|
|
|
mine.mineTime -= 2400; |
|
|
|
} |
|
|
|
} |
|
|
|
public static void releaseMineClaims(PlayerCharacter playerCharacter) { |
|
|
|
public static void releaseMineClaims(PlayerCharacter playerCharacter) { |
|
|
|
|
|
|
|
|
|
|
@ -227,7 +228,7 @@ public class Mine extends AbstractGameObject { |
|
|
|
|
|
|
|
|
|
|
|
// Mine times are those of the nation not individual guild.
|
|
|
|
// Mine times are those of the nation not individual guild.
|
|
|
|
|
|
|
|
|
|
|
|
Guild mineNatonGuild = mine.getOwningGuild().getNation(); |
|
|
|
Guild mineNatonGuild = mine.getOwningGuild(); |
|
|
|
|
|
|
|
|
|
|
|
// Adjust the serialized mine time based upon whether
|
|
|
|
// Adjust the serialized mine time based upon whether
|
|
|
|
// the Guild's mine window has passed or not and if it was claimed.
|
|
|
|
// the Guild's mine window has passed or not and if it was claimed.
|
|
|
@ -236,7 +237,8 @@ public class Mine extends AbstractGameObject { |
|
|
|
|
|
|
|
|
|
|
|
if (mineNatonGuild.isEmptyGuild() == false && mine.isActive == false) { |
|
|
|
if (mineNatonGuild.isEmptyGuild() == false && mine.isActive == false) { |
|
|
|
|
|
|
|
|
|
|
|
int guildWOO = mineNatonGuild.getNation().getMineTime(); |
|
|
|
//int guildWOO = mineNatonGuild.getNation().getMineTime();
|
|
|
|
|
|
|
|
int guildWOO = mine.mineTime; |
|
|
|
LocalDateTime guildMineTime = mineOpenTime.withHour(guildWOO); |
|
|
|
LocalDateTime guildMineTime = mineOpenTime.withHour(guildWOO); |
|
|
|
|
|
|
|
|
|
|
|
if (mineOpenTime.isAfter(guildMineTime) || mine.wasClaimed == true) |
|
|
|
if (mineOpenTime.isAfter(guildMineTime) || mine.wasClaimed == true) |
|
|
|