Improving animations and some text.

This commit is contained in:
Sarah 2015-08-10 14:00:40 +02:00
parent aa13bcf5c6
commit 5781009f4e
8 changed files with 58 additions and 23 deletions

View File

@ -251,7 +251,10 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
if (!_enabled) if (!_enabled)
return; return;
if(_pendingExplosions.get(0) instanceof String) if(_pendingExplosions.get(0) instanceof String
&& !((String)_pendingExplosions.get(0)).contentEquals("RANK")
&& !((String)_pendingExplosions.get(0)).contentEquals("DAILY")
&& !((String)_pendingExplosions.get(0)).contentEquals("VOTE"))
{ {
String name = (String)_pendingExplosions.get(0); String name = (String)_pendingExplosions.get(0);
Bukkit.broadcastMessage("Recieved Vote: " + name); Bukkit.broadcastMessage("Recieved Vote: " + name);

View File

@ -1,6 +1,7 @@
package mineplex.core.bonuses.animations; package mineplex.core.bonuses.animations;
import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAction;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.reward.Reward; import mineplex.core.reward.Reward;
import mineplex.core.reward.RewardData; import mineplex.core.reward.RewardData;
import mineplex.core.treasure.animation.Animation; import mineplex.core.treasure.animation.Animation;
@ -32,23 +33,44 @@ public class AnimationCarl extends Animation
{ {
if(_type instanceof String) if(_type instanceof String)
{ {
if (getTicks() < 40) if(((String) _type).contentEquals("DAILY"))
{ {
Item gem = _creeper.getWorld().dropItem(_creeper.getLocation().add(0.5, 2, 0.5), new ItemStack(Material.EMERALD)); for (int i = 1; i < 60; i++)
{
//Velocity Item gem = _creeper.getWorld().dropItem(_creeper.getLocation().add(0.5, 2, 0.5), ItemStackFactory.Instance.CreateStack(Material.EMERALD, (byte) 0, 1, "" + i));
long passed = System.currentTimeMillis() - _startTime; Item coin = _creeper.getWorld().dropItem(_creeper.getLocation().add(0.5, 2, 0.5), ItemStackFactory.Instance.CreateStack(Material.DOUBLE_PLANT, (byte) 0, 1, "" + i));
Vector vel = new Vector(Math.sin(passed/5d), 0, Math.cos(passed/5d)); Vector vel = new Vector(Math.sin(i * 7/5d), 0, Math.cos(i * 7/5d));
UtilAction.velocity(gem, vel, Math.abs(Math.sin(i * 7/3000d)), false, 0, 0.2 + Math.abs(Math.cos(i * 7/3000d))*0.6, 1, false);
UtilAction.velocity(gem, vel, Math.abs(Math.sin(passed/3000d)), false, 0, 0.2 + Math.abs(Math.cos(passed/3000d))*0.6, 1, false); UtilAction.velocity(coin, vel, Math.abs(Math.sin(i * 8/3000d)), false, 0, 0.2 + Math.abs(Math.cos(i * 8/3000d))*0.6, 1, false);
coin.setTicksLived(1160);
gem.setTicksLived(1170); gem.setTicksLived(1160);
} }
else }
if(((String) _type).contentEquals("RANK"))
{ {
for (int i = 1; i < 100; i++)
{
Item coin = _creeper.getWorld().dropItem(_creeper.getLocation().add(0.5, 2, 0.5), ItemStackFactory.Instance.CreateStack(Material.DOUBLE_PLANT, (byte) 0, 1, "" + i));
Vector vel = new Vector(Math.sin(i * 7/5d), 0, Math.cos(i * 7/5d));
UtilAction.velocity(coin, vel, Math.abs(Math.sin(i * 7/3000d)), false, 0, 0.2 + Math.abs(Math.cos(i * 7/3000d))*0.6, 1, false);
coin.setTicksLived(1160);
}
}
if(!((String) _type).contentEquals("DAILY")&& !((String) _type).contentEquals("RANK"))
{
for (int i = 1; i < 60; i++)
{
Item gem = _creeper.getWorld().dropItem(_creeper.getLocation().add(0.5, 2, 0.5), ItemStackFactory.Instance.CreateStack(Material.EMERALD, (byte) 0, 1, "" + i));
Item paper = _creeper.getWorld().dropItem(_creeper.getLocation().add(0.5, 2, 0.5), ItemStackFactory.Instance.CreateStack(Material.PAPER, (byte) 0, 1, "" + i));
Vector vel = new Vector(Math.sin(i * 7/5d), 0, Math.cos(i * 7/5d));
UtilAction.velocity(gem, vel, Math.abs(Math.sin(i * 7/3000d)), false, 0, 0.2 + Math.abs(Math.cos(i + 7/3000d))*0.6, 1, false);
UtilAction.velocity(paper, vel, Math.abs(Math.sin(i * 8/3000d)), false, 0, 0.2 + Math.abs(Math.cos(i + 8/3000d))*0.6, 1, false);
paper.setTicksLived(1160);
gem.setTicksLived(1160);
}
}
finish(); finish();
} }
}
if(_type instanceof Reward) if(_type instanceof Reward)
{ {
RewardData rewardData = ((Reward)_type).getFakeRewardData(null); RewardData rewardData = ((Reward)_type).getFakeRewardData(null);

View File

@ -23,6 +23,9 @@ public class AnimationCommand extends CommandBase<BonusManager>{
_plugin.addPendingExplosion(caller, "Chiss"); _plugin.addPendingExplosion(caller, "Chiss");
_plugin.addPendingExplosion(caller, "Phinary"); _plugin.addPendingExplosion(caller, "Phinary");
_plugin.addPendingExplosion(caller, "xXVevzZXx"); _plugin.addPendingExplosion(caller, "xXVevzZXx");
_plugin.addPendingExplosion(caller, "RANK");
_plugin.addPendingExplosion(caller, "DAILY");
} }
} }

View File

@ -29,7 +29,7 @@ public class BonusGui extends SimpleGui
setItem(14, new DailyBonusButton(getPlugin(), player, this, manager)); setItem(14, new DailyBonusButton(getPlugin(), player, this, manager));
setItem(16, new PollButton(getPlugin(), player, manager.getPollManager(), manager.getClientManager(), this)); setItem(16, new PollButton(getPlugin(), player, manager.getPollManager(), manager.getClientManager(), this, manager));
setItem(31, new CarlSpinButton(getPlugin(), player, manager, rewardManager)); setItem(31, new CarlSpinButton(getPlugin(), player, manager, rewardManager));
} }

View File

@ -86,6 +86,7 @@ public class DailyBonusButton implements GuiItem, Listener
} else { } else {
UtilPlayer.message(getPlayer(), F.main("Bonus", "Bonus collected!")); UtilPlayer.message(getPlayer(), F.main("Bonus", "Bonus collected!"));
} }
_bonusManager.addPendingExplosion(getPlayer(), "DAILY");
getPlayer().playSound(getPlayer().getLocation(), Sound.NOTE_PLING, 1, 1.6f); getPlayer().playSound(getPlayer().getLocation(), Sound.NOTE_PLING, 1, 1.6f);
} else { } else {
if (getPlayer().getOpenInventory() != null) { if (getPlayer().getOpenInventory() != null) {
@ -120,7 +121,7 @@ public class DailyBonusButton implements GuiItem, Listener
if (isAvailable()) if (isAvailable())
{ {
material = Material.CHEST; material = Material.CHEST;
itemName = C.cGreen + C.Bold + "Daily Bonus"; itemName = C.cGreen + C.Bold + "Daily Reward";
lore.add(" "); lore.add(" ");
lore.add(ChatColor.RESET + "Click to Claim!"); lore.add(ChatColor.RESET + "Click to Claim!");
@ -128,7 +129,7 @@ public class DailyBonusButton implements GuiItem, Listener
else else
{ {
material = Material.REDSTONE_BLOCK; material = Material.REDSTONE_BLOCK;
itemName = C.cRed + C.Bold + "Daily Bonus"; itemName = C.cRed + C.Bold + "Daily Reward";
lore.add(" "); lore.add(" ");
lore.add(ChatColor.RESET + "Next reward in " + UtilTime.convertString(timeLeft(), 0, TimeUnit.FIT) + "!"); lore.add(ChatColor.RESET + "Next reward in " + UtilTime.convertString(timeLeft(), 0, TimeUnit.FIT) + "!");

View File

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import mineplex.core.account.CoreClientManager; import mineplex.core.account.CoreClientManager;
import mineplex.core.bonuses.BonusManager;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilText;
import mineplex.core.gui.GuiInventory; import mineplex.core.gui.GuiInventory;
@ -29,6 +30,7 @@ public class PollButton extends SimpleGui implements GuiItem {
protected boolean _create; protected boolean _create;
private PollManager _pollManager; private PollManager _pollManager;
private BonusManager _bonusManager;
private CoreClientManager _clientManager; private CoreClientManager _clientManager;
private GuiInventory _master; private GuiInventory _master;
@ -36,7 +38,7 @@ public class PollButton extends SimpleGui implements GuiItem {
private Poll _poll; private Poll _poll;
public PollButton(Plugin plugin, Player player, PollManager pollManager, CoreClientManager clientManager, GuiInventory master) public PollButton(Plugin plugin, Player player, PollManager pollManager, CoreClientManager clientManager, GuiInventory master, BonusManager bonusManager)
{ {
super(plugin, player, "Poll:", 6 * 9); super(plugin, player, "Poll:", 6 * 9);
this._create = true; this._create = true;
@ -44,6 +46,7 @@ public class PollButton extends SimpleGui implements GuiItem {
this._clientManager = clientManager; this._clientManager = clientManager;
this._pollManager = pollManager; this._pollManager = pollManager;
hard.put(0, new BackBotton(master)); hard.put(0, new BackBotton(master));
_bonusManager = bonusManager;
} }
@Override @Override
@ -75,7 +78,8 @@ public class PollButton extends SimpleGui implements GuiItem {
ArrayList<String> lore = new ArrayList<>(); ArrayList<String> lore = new ArrayList<>();
if (_poll == null) if (_poll == null)
{ {
lore.add(C.cRed + "You've voted on all of the polls!"); lore.add("");
lore.add(C.cWhite + "You've voted on all of the polls!");
return ItemStackFactory.Instance.CreateStack(Material.REDSTONE_BLOCK, (byte) 0, 1, ChatColor.RED + C.Bold + "Vote on Poll", lore); return ItemStackFactory.Instance.CreateStack(Material.REDSTONE_BLOCK, (byte) 0, 1, ChatColor.RED + C.Bold + "Vote on Poll", lore);
} }
else else
@ -190,6 +194,7 @@ public class PollButton extends SimpleGui implements GuiItem {
getPlayer().playSound(getPlayer().getLocation(), Sound.NOTE_PLING, 1, 1.6f); getPlayer().playSound(getPlayer().getLocation(), Sound.NOTE_PLING, 1, 1.6f);
new TimedMessageWindow(getPlugin(), getPlayer(), ItemStackFactory.Instance.CreateStack(Material.EMERALD_BLOCK, (byte) 0, 1, ChatColor.GREEN + "Your anwser:", wrap(getPoll().getAnswers()[num])), ChatColor.GREEN + "Moo", 6 * 9, 50, getMaster()).openInventory(); new TimedMessageWindow(getPlugin(), getPlayer(), ItemStackFactory.Instance.CreateStack(Material.EMERALD_BLOCK, (byte) 0, 1, ChatColor.GREEN + "Your anwser:", wrap(getPoll().getAnswers()[num])), ChatColor.GREEN + "Moo", 6 * 9, 50, getMaster()).openInventory();
_bonusManager.addPendingExplosion(getPlayer(), "VOTE");
getPlayer().closeInventory(); getPlayer().closeInventory();
} }

View File

@ -99,6 +99,7 @@ public class RankBonusButton implements GuiItem, Listener {
{ {
UtilPlayer.message(getPlayer(), F.main("Bonus", "Bonus collected!")); UtilPlayer.message(getPlayer(), F.main("Bonus", "Bonus collected!"));
} }
_bonusManager.addPendingExplosion(getPlayer(), "RANK");
getPlayer().playSound(getPlayer().getLocation(), Sound.NOTE_PLING, 1, 1.6f); getPlayer().playSound(getPlayer().getLocation(), Sound.NOTE_PLING, 1, 1.6f);
} }
else else
@ -144,7 +145,7 @@ public class RankBonusButton implements GuiItem, Listener {
if (!hasRank) if (!hasRank)
{ {
material = Material.COAL_BLOCK; material = Material.REDSTONE_BLOCK;
itemName = C.cRed + ChatColor.BOLD + "Rank Monthly Bonus"; itemName = C.cRed + ChatColor.BOLD + "Rank Monthly Bonus";
lore.add(" "); lore.add(" ");
lore.add(ChatColor.WHITE + "Players with a Rank get a Monthly Bonus!"); lore.add(ChatColor.WHITE + "Players with a Rank get a Monthly Bonus!");

View File

@ -108,7 +108,7 @@ public class VoteButton implements GuiItem, Listener {
if (isAvailable()) if (isAvailable())
{ {
material = Material.JUKEBOX; material = Material.JUKEBOX;
itemName = C.cGreen + C.Bold + "Vote Bonus"; itemName = C.cGreen + C.Bold + "Vote for Mineplex";
lore.add(" "); lore.add(" ");
lore.add(ChatColor.RESET + "Click to Vote!"); lore.add(ChatColor.RESET + "Click to Vote!");
@ -116,7 +116,7 @@ public class VoteButton implements GuiItem, Listener {
else else
{ {
material = Material.REDSTONE_BLOCK; material = Material.REDSTONE_BLOCK;
itemName = C.cRed + C.Bold + "Vote Bonus"; itemName = C.cRed + C.Bold + "Vote for Mineplex";
lore.add(" "); lore.add(" ");
lore.add(ChatColor.RESET + "Next vote in " + UtilTime.convertString(timeLeft(), 0, TimeUnit.FIT) + "!"); lore.add(ChatColor.RESET + "Next vote in " + UtilTime.convertString(timeLeft(), 0, TimeUnit.FIT) + "!");