gem stuff

This commit is contained in:
Mini-Chiss 2015-08-28 20:06:39 -07:00
parent d879bc68ab
commit 8238a199d5
2 changed files with 38 additions and 5 deletions

View File

@ -9,6 +9,7 @@ import mineplex.core.common.util.C;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime;
import mineplex.minecraft.game.core.combat.CombatComponent; import mineplex.minecraft.game.core.combat.CombatComponent;
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent; import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
import nautilus.game.arcade.ArcadeFormat; import nautilus.game.arcade.ArcadeFormat;
@ -36,7 +37,8 @@ public class GameGemManager implements Listener
{ {
ArcadeManager Manager; ArcadeManager Manager;
boolean DoubleGem = true; boolean DoubleGem = false;
boolean TimeReward = true;
public GameGemManager(ArcadeManager manager) public GameGemManager(ArcadeManager manager)
{ {
@ -185,7 +187,20 @@ public class GameGemManager implements Listener
} }
} }
if (DoubleGem && game.GemDoubleEnabled && UtilPlayer.is1_8(player)) //Time Reward
if (TimeReward)
{
long timeOnline = 7380000;
double hoursOnline = timeOnline/3600000d;
if (hoursOnline > 5)
hoursOnline = 5;
total += (int)(earned * (hoursOnline * 0.2));
}
if (DoubleGem && game.GemDoubleEnabled)
total += earned; total += earned;
Manager.GetDonation().RewardGems(null, "Earned " + game.GetName(), player.getName(), player.getUniqueId(), total); Manager.GetDonation().RewardGems(null, "Earned " + game.GetName(), player.getName(), player.getUniqueId(), total);
@ -290,8 +305,26 @@ public class GameGemManager implements Listener
} }
} }
//Time Reward
if (TimeReward)
{
long timeOnline = 7380000;
double hoursOnline = timeOnline/3600000d;
if (hoursOnline > 5)
hoursOnline = 5;
int extraGems = (int)(earnedGems * (hoursOnline * 0.2));;
UtilPlayer.message(player, F.elem(C.cGreen + "+" + extraGems + " Gems") + " for " +
F.elem("Online for " + UtilTime.MakeStr(timeOnline) ));
totalGems += extraGems;
}
//Double Gem //Double Gem
if (DoubleGem && game.GemDoubleEnabled && UtilPlayer.is1_8(player)) if (DoubleGem && game.GemDoubleEnabled)
{ {
UtilPlayer.message(player, F.elem(C.cGreen + "+" + (earnedGems) + " Gems") + " for " + F.elem(C.cDGreen + "Double Gem Weekend")); UtilPlayer.message(player, F.elem(C.cGreen + "+" + (earnedGems) + " Gems") + " for " + F.elem(C.cDGreen + "Double Gem Weekend"));