Merge remote-tracking branch 'origin/master' into Myst_HALLOWEEN

This commit is contained in:
Mysticate 2015-10-11 22:25:25 -04:00
commit b6d573a4d5
10 changed files with 84 additions and 53 deletions

View File

@ -15,6 +15,13 @@ public enum Achievement
new String[]{"+1 for every Gem earned in any game."},
new int[]{10000, 15000, 20000, 25000, 30000, 35000, 40000, 45000, 50000, 55000, 60000, 65000},
AchievementCategory.GLOBAL),
GLOBAL_PUMPKIN_SMASHER_2015("2015 Pumpkin Smasher", 4000,
new String[]{"Global.Halloween Pumpkins 2015"},
new String[]{"Smash 200 Flaming Pumpkins,",
"during Halloween 2015!"},
new int[]{200},
AchievementCategory.HOLIDAY),
//Bridges
BRIDGES_WINS("Bridge Champion", 600,

View File

@ -20,6 +20,10 @@ public enum AchievementCategory
new StatDisplay[] { StatDisplay.GEMS_EARNED, null, new StatDisplay("Games Played", "GamesPlayed"), StatDisplay.TIME_IN_GAME, null,
new StatDisplay("Daily Rewards", "DailyReward"), new StatDisplay("Times Voted", "DailyVote"), null, new StatDisplay("Chests Opened", "Treasure.Old", "Treasure.Ancient", "Treasure.Mythical") },
Material.EMERALD, 0, GameCategory.GLOBAL, "None"),
HOLIDAY("Holiday Achievements", null,
new StatDisplay[] {},
Material.PUMPKIN_PIE, 0, GameCategory.HOLIDAY, "None"),
BRIDGES("The Bridges", null,
new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED },
@ -257,6 +261,6 @@ public enum AchievementCategory
public enum GameCategory
{
GLOBAL, SURVIVAL, CLASSICS, CHAMPIONS, ARCADE
GLOBAL, HOLIDAY, SURVIVAL, CLASSICS, CHAMPIONS, ARCADE
}
}

View File

@ -41,7 +41,7 @@ public class AchievementMainPage extends ShopPageBase<AchievementManager, Achiev
protected void buildPage()
{
ArrayList<Integer> pageLayout = new ItemLayout(
"XXXXOXXXX",
"XXXXOXXXO",
"OXOXOXOXO",
"OXOXOXOXO",
"XXOXOXOXX").getItemSlots();

View File

@ -22,8 +22,8 @@ public final class DBPool
source.setUrl(url);
source.setUsername(username);
source.setPassword(password);
source.setMaxTotal(4);
source.setMaxIdle(4);
source.setMaxTotal(3);
source.setMaxIdle(3);
source.setTimeBetweenEvictionRunsMillis(180 * 1000);
source.setSoftMinEvictableIdleTimeMillis(180 * 1000);

View File

@ -11,7 +11,7 @@ public class MorphTitan extends MorphGadget
{
public MorphTitan(GadgetManager manager)
{
super(manager, "Titans Morph", new String[]
super(manager, "Titanic Morph", new String[]
{
C.cWhite + "Coming Soon...",
" ",

View File

@ -10,7 +10,7 @@ public class ParticleTitan extends ParticleGadget
{
public ParticleTitan(GadgetManager manager)
{
super(manager, "Titans Particle", new String[]
super(manager, "Titanic Particle", new String[]
{
C.cWhite + "Coming Soon...",
" ",

View File

@ -13,7 +13,7 @@ public class MountTitan extends HorseMount
{
public MountTitan(MountManager manager)
{
super(manager, "Titans Mount", new String[]
super(manager, "Titanic Mount", new String[]
{
C.cWhite + "Coming Soon...",
" ",

View File

@ -1583,4 +1583,24 @@ public class ArcadeManager extends MiniPlugin implements IRelation
event.GetBlocks().clear();
}
}
@EventHandler
public void spawnDebug(PlayerCommandPreprocessEvent event)
{
if (event.getPlayer().isOp() && event.getMessage().contains("setmax"))
{
try
{
int i = Integer.parseInt(event.getMessage().split(" ")[1]);
_serverConfig.MaxPlayers = i;
}
catch (Exception e)
{
}
event.setCancelled(true);
}
}
}

View File

@ -195,10 +195,13 @@ public class GameGemManager implements Listener
double hoursOnline = timeOnline/3600000d;
if (hoursOnline > 5)
hoursOnline = 5;
total += (int)(earned * (hoursOnline * 0.2));
if (hoursOnline < 24)
{
if (hoursOnline > 5)
hoursOnline = 5;
total += (int)(earned * (hoursOnline * 0.2));
}
}
if (DoubleGem && game.GemDoubleEnabled)
@ -313,17 +316,20 @@ public class GameGemManager implements Listener
double hoursOnline = timeOnline/3600000d;
if (hoursOnline > 5)
hoursOnline = 5;
int extraGems = (int)(earnedGems * (hoursOnline * 0.2));
if (extraGems > 0)
if (hoursOnline < 24)
{
UtilPlayer.message(player, F.elem(C.cGreen + "+" + extraGems + " Gems") + " for " +
F.elem("Online for " + UtilTime.MakeStr(timeOnline) + C.cGreen + " +" + (int)(hoursOnline * 20) + "%"));
totalGems += extraGems;
if (hoursOnline > 5)
hoursOnline = 5;
int extraGems = (int)(earnedGems * (hoursOnline * 0.2));
if (extraGems > 0)
{
UtilPlayer.message(player, F.elem(C.cGreen + "+" + extraGems + " Gems") + " for " +
F.elem("Online for " + UtilTime.MakeStr(timeOnline) + C.cGreen + " +" + (int)(hoursOnline * 20) + "%"));
totalGems += extraGems;
}
}
}

View File

@ -41,6 +41,7 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockDamageEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerPickupItemEvent;
import org.bukkit.inventory.ItemStack;
@ -82,6 +83,7 @@ public class HolidayManager implements Listener
}
private HolidayType type = HolidayType.Halloween;
private String _statName = "Halloween Pumpkins 2015";
ArcadeManager Manager;
private TitanGiveawayManager _titanManager;
@ -153,7 +155,7 @@ public class HolidayManager implements Listener
{
UtilParticle.PlayParticle(ParticleType.HAPPY_VILLAGER, block.getLocation().add(0.5, 0.2, 0.5), 0.3f, 0.2f, 0.3f, 0, 1,
ViewDist.LONG, UtilServer.getPlayers());
if (Math.random() > 0.90)
{
Item egg = block.getWorld().dropItem(block.getLocation().add(0.5, 0.8, 0.5),
@ -164,7 +166,7 @@ public class HolidayManager implements Listener
block.getWorld().playSound(block.getLocation(), Sound.CHICKEN_EGG_POP, 0.25f + (float)Math.random() * 0.75f, 0.75f + (float)Math.random() * 0.5f);
}
if (Math.random() > 0.95)
{
sendChestPackets(block);
@ -184,7 +186,7 @@ public class HolidayManager implements Listener
if (Manager.GetGameHostManager().isPrivateServer())
return;
Game game = Manager.GetGame();
int requirement = (int)((double)Manager.GetPlayerFull() * 0.5d);
@ -243,7 +245,7 @@ public class HolidayManager implements Listener
for (Player other : UtilServer.getPlayers())
((CraftPlayer) other).getHandle().playerConnection.sendPacket(packet);
}
private Block findSpecialBlockLocation(Game game)
{
Block block = null;
@ -282,43 +284,20 @@ public class HolidayManager implements Listener
}
return null;
}
}
@EventHandler
public void specialBlockInteract(PlayerInteractEvent event)
{
if (UtilPlayer.isSpectator(event.getPlayer()))
return;
if (!UtilEvent.isAction(event, ActionType.R_BLOCK))
return;
if (event.getClickedBlock() == null)
return;
if (event.getClickedBlock().getType() != Material.CHEST)
return;
if (!_active.contains(event.getClickedBlock()))
return;
event.setCancelled(true);
specialBlockBreak(event.getPlayer(), event.getClickedBlock());
}
@EventHandler
public void specialBlockDamage(BlockDamageEvent event)
{
if (UtilPlayer.isSpectator(event.getPlayer()))
return;
if (Manager.GetGame() != null && !Manager.GetGame().IsAlive(event.getPlayer()))
return;
if (!_active.contains(event.getBlock()))
return;
specialBlockBreak(event.getPlayer(), event.getBlock());
}
@ -327,6 +306,12 @@ public class HolidayManager implements Listener
block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, type.getBlockType());
block.setType(Material.AIR);
if (player != null && Manager.GetGame() != null)
{
Manager.GetGame().AddStat(player, _statName, 1, false, true);
System.out.println("Recording Pumpkin Break for " + player.getName());
}
//Coins
for (int i=0 ; i < 4 + Math.random()*8 ; i++)
{
@ -386,7 +371,7 @@ public class HolidayManager implements Listener
{
if (UtilPlayer.isSpectator(event.getPlayer()))
return;
if (_coins.contains(event.getItem()))
{
event.setCancelled(true);
@ -411,7 +396,7 @@ public class HolidayManager implements Listener
event.setCancelled(true);
}
}
@EventHandler
public void itemClean(UpdateEvent event)
{
@ -457,4 +442,13 @@ public class HolidayManager implements Listener
}
}
}
@EventHandler
public void spawnDebug(PlayerCommandPreprocessEvent event)
{
if (event.getPlayer().isOp() && event.getPlayer().getName().equals("Chiss") && event.getMessage().contains("pumpkin"))
{
spawnSpecialBlock(event.getPlayer().getLocation().getBlock());
}
}
}