some gadget stuff

This commit is contained in:
Cheese 2015-12-11 13:17:38 +11:00
parent 4d8b8bd58b
commit 31cea3342e
25 changed files with 56 additions and 51 deletions

View File

@ -4,6 +4,8 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
@ -83,23 +85,30 @@ public class GadgetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
List<String> itemLore = new ArrayList<String>();
if (gadget.GetCost(CurrencyType.Coins) >= 0)
{
itemLore.add(C.cYellow + gadget.GetCost(CurrencyType.Coins) + " Coins");
}
else if (gadget.GetCost(CurrencyType.Coins) == -2)
{
itemLore.add(C.cGold + "Found in Treasure Chests.");
}
else if (gadget.GetCost(CurrencyType.Coins) == -3)
{
}
itemLore.add(C.cBlack);
itemLore.addAll(Arrays.asList(gadget.GetDescription()));
if (gadget.GetCost(CurrencyType.Coins) >= 0)
{
itemLore.add(C.cBlack);
itemLore.add(C.cAqua + "Cost: " + ChatColor.RESET + gadget.GetCost(CurrencyType.Coins) + " Treasure Shards");
}
else if (gadget.GetCost(CurrencyType.Coins) == -1)
{
//Nothing
}
else if (gadget.GetCost(CurrencyType.Coins) == -2)
{
itemLore.add(C.cBlack);
itemLore.add(C.cGray + "Found in Treasure Chests");
}
else if (gadget.GetCost(CurrencyType.Coins) == -3)
{
itemLore.add(C.cBlack);
itemLore.add(C.cRed + "Found in Winter Holiday Treasure Chests");
}
if (gadget instanceof ItemGadget)
{
itemLore.add(C.cBlack);

View File

@ -21,7 +21,7 @@ public class ArrowTrailCandyCane extends ArrowEffectGadget
{
C.cWhite + "We whish you a marry " + C.Scramble + "christmas" + C.cWhite + ".",
},
1,
-3,
Material.SNOW_BALL, (byte)0);
}

View File

@ -21,7 +21,7 @@ public class ArrowTrailFrostLord extends ArrowEffectGadget
C.cWhite + "Your double jumps and arrows",
C.cWhite + "are enchanted with snow powers.",
},
10,
-3,
Material.SNOW_BALL, (byte)0, "Frost Lord");
}

View File

@ -26,7 +26,7 @@ public class ArrowTrailTitan extends ArrowEffectGadget
" ",
C.cRed + "Unlocked with Titan Rank",
},
-3,
-1,
Material.FIREBALL, (byte)0);
}

View File

@ -21,7 +21,7 @@ public class DeathCandyCane extends DeathEffectGadget
C.cWhite + "COLORS FTW!",
C.cWhite + "Take damage with SWAG B)",
},
10,
-3,
Material.SNOW_BALL, (byte)0);
}

View File

@ -18,7 +18,7 @@ public class DeathFrostLord extends DeathEffectGadget
C.cWhite + "Your double jumps and arrows",
C.cWhite + "are enchanted with snow powers.",
},
10,
-3,
Material.SNOW_BALL, (byte)0, "Frost Lord");
}

View File

@ -22,7 +22,7 @@ public class DeathTitan extends DeathEffectGadget
" ",
C.cRed + "Unlocked with Titan Rank",
},
-3,
-1,
Material.FIREBALL, (byte)0);
}

View File

@ -20,7 +20,7 @@ public class DoubleJumpCandyCane extends DoubleJumpEffectGadget
{
C.cWhite + "We whish you a marry " + C.Scramble + "christmas" + C.cWhite + ".",
},
1,
-3,
Material.SNOW_BALL, (byte)0);
}

View File

@ -19,7 +19,7 @@ public class DoubleJumpFrostLord extends DoubleJumpEffectGadget
{
C.cWhite + "More snow incomming.",
},
1,
-3,
Material.SNOW_BALL, (byte)0, "Frost Lord");
}

View File

@ -27,7 +27,7 @@ public class DoubleJumpTitan extends DoubleJumpEffectGadget
" ",
C.cRed + "Unlocked with Titan Rank",
},
-3,
-1,
Material.FIREBALL, (byte)0);
}

View File

@ -12,7 +12,7 @@ public class HatCoal extends HatGadget
public HatCoal(GadgetManager manager)
{
super(manager, "Coal Hat", new String[]{C.cWhite + "Coal Hat"}, 10, new ItemStack(Material.COAL_BLOCK));
super(manager, "Coal Hat", new String[]{C.cWhite + "Coal Hat"}, -3, new ItemStack(Material.COAL_BLOCK));
}
}

View File

@ -9,7 +9,7 @@ public class HatPresent extends HatGadget
public HatPresent(GadgetManager manager)
{
super(manager, "Present Hat", new String[]{C.cWhite + "Present Hat"}, 10, "christmasgift");
super(manager, "Present Hat", new String[]{C.cWhite + "Present Hat"}, -3, "christmasgift");
}
}

View File

@ -9,7 +9,7 @@ public class HatSanta extends HatGadget
public HatSanta(GadgetManager manager)
{
super(manager, "Santa Hat", new String[]{C.cWhite + "Santa Hat"}, 10, "Presents");
super(manager, "Santa Hat", new String[]{C.cWhite + "Santa Hat"}, -3, "Presents");
}
}

View File

@ -9,7 +9,7 @@ public class HatSnowman extends HatGadget
public HatSnowman(GadgetManager manager)
{
super(manager, "Snowman Hat", new String[]{C.cWhite + "Snowman Hat"}, 10, "snowman002");
super(manager, "Snowman Hat", new String[]{C.cWhite + "Snowman Hat"}, -3, "snowman002");
}
}

View File

@ -45,12 +45,12 @@ public class ItemCoal extends ItemGadget
C.cDGray + "Exclusive Coal!",
C.cDGray + "Earned by beeing naughty"
}
, -1, Material.COAL, (byte) 0, 1000, new Ammo("Coal", "1 Piece of Coal", Material.COAL, (byte) 0, new String[]
, 1, Material.COAL, (byte) 0, 1000, new Ammo("Coal", "1 Piece of Coal", Material.COAL, (byte) 0, new String[]
{
C.cDGray + "Exclusive Coal!",
C.cDGray + "Earned by beeing naughty"
}
, 100, 100));
, 1, 1));
}
@Override
@ -65,7 +65,7 @@ public class ItemCoal extends ItemGadget
{
if(data)
{
player.sendMessage(F.main("Coal", "You unlocked " + C.cDGray + "COAL FUMES!"));
player.sendMessage(F.main("Coal", "You unlocked " + C.cGreen + "Legendary Coal Fumes" + C.cGray + "."));
UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, player.getLocation().add(0, 0.5, 0), 0.2f, 0.5f, 0.2f, 0, 500, ViewDist.LONG);
UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, player.getLocation(), 1.5f, 0.0f, 1.5f, 0, 500, ViewDist.LONG);
player.getWorld().playSound(player.getLocation(), Sound.WITHER_DEATH, 0.8f, 0);

View File

@ -51,10 +51,10 @@ public class ItemFreezeCannon extends ItemGadget implements IThrown
{
C.cWhite + "Freeze your nemesis inside a block of ice!"
}
, -1, Material.ICE, (byte) 0, 2000, new Ammo("Freeze Cannon", "100 Ice Blocks", Material.ICE, (byte) 0, new String[]
, 1, Material.ICE, (byte) 0, 2000, new Ammo("Freeze Cannon", "100 Ice Blocks", Material.ICE, (byte) 0, new String[]
{
C.cWhite + "100 Ice Blocks for you to launch!"
}, 500, 100));
}, -1, 1));
}
@Override

View File

@ -9,6 +9,7 @@ import org.bukkit.entity.Item;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.util.Vector;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilAction;
@ -33,29 +34,29 @@ public class ItemPartyPopper extends ItemGadget implements IThrown
super(manager, "Confetti Bomb", new String[]
{
C.cWhite + "POP BANG!",
}, -1, Material.GOLDEN_CARROT, (byte) 0, 1000, new Ammo("Confetti Bomb", "100 Party Poppers", Material.DIAMOND_BARDING,
}, 1, Material.GOLDEN_CARROT, (byte) 0, 1000, new Ammo("Confetti Bomb", "1 Party Popper", Material.GOLDEN_CARROT,
(byte) 0, new String[]
{
C.cWhite + "100 Party Poppers for you to shoot!"
}, 500, 100));
}, -2, 1));
}
@Override
public void ActivateCustom(Player player)
{
Item ent = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()),
ItemStackFactory.Instance.CreateStack(Material.REDSTONE_LAMP_OFF, (byte)0, 1, "Lamp" + Math.random()));
// Item ent = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()),
// ItemStackFactory.Instance.CreateStack(Material.REDSTONE_LAMP_OFF, (byte)0, 1, "Lamp" + Math.random()));
//
// UtilAction.velocity(ent, player.getLocation().getDirection().normalize().multiply(0.1), 1, false, 0, 0.2, 10, false);
//
// Manager.getProjectileManager().AddThrow(ent, player, this, 3000, false, false, true, true, 0.5f);
UtilAction.velocity(ent, player.getLocation().getDirection().normalize().multiply(0.1), 1, false, 0, 0.2, 10, false);
Manager.getProjectileManager().AddThrow(ent, player, this, 3000, false, false, true, true, 0.5f);
/*
for(int data : new int[]{1,2,4,5,6,9,10,11,12,13,14,15})
{
UtilParticle.PlayParticleToAll(ParticleType.ICON_CRACK.getParticle(Material.INK_SACK, data), player.getEyeLocation(), null, 0.4f, 50, ViewDist.LONG);
/*
for(int i = 0; i < 10; i++)
{
Vector v = new Vector(Math.random() - 0.5, Math.random() - 0.3, Math.random() - 0.5);
@ -67,7 +68,7 @@ public class ItemPartyPopper extends ItemGadget implements IThrown
UtilParticle.PlayParticleToAll(ParticleType.ICON_CRACK.getParticle(Material.INK_SACK, data), player.getEyeLocation(), v, 1, 0, ViewDist.LONG);
}
/*
Item ent = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()),
ItemStackFactory.Instance.CreateStack(Material.INK_SACK, (byte)data, 1, "Ink" + Math.random()));
_items.add(ent);
@ -79,8 +80,8 @@ public class ItemPartyPopper extends ItemGadget implements IThrown
UtilAction.velocity(ent, player.getLocation().getDirection().normalize().multiply(0.3).add(random), 1 + 0.4 * Math.random(), false, 0, 0.2, 10, false);
Manager.getProjectileManager().AddThrow(ent, player, this, 3000, false, false, true, true, 0.5f);
*/
// }
}
// Sound
for(int i = 0; i < 3; i++)
{

View File

@ -29,11 +29,11 @@ public class ItemSnowball extends ItemGadget
C.cWhite + "Throw snowball!",
C.cWhite + "Start epic snowfights!"
}
, -1, Material.SNOW_BALL, (byte) 0, 1, new Ammo("Snowball", "50 Snowballs", Material.SNOW_BALL, (byte) 0, new String[]
, 1, Material.SNOW_BALL, (byte) 0, 1, new Ammo("Snowball", "1 Snowball", Material.SNOW_BALL, (byte) 0, new String[]
{
C.cWhite + "50 Snowballs for you to throw!"
}
, 100, 50));
, -3, 1));
}

View File

@ -42,7 +42,7 @@ public class MorphSnowman extends MorphGadget
super(manager, "Snowman Morph",
new String[]{ C.cWhite + "Do you wanna build a snowman?", C.cWhite + "It doesn't have to be a snowman...",
C.cWhite + "Or... it kind of does...", " ", C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Snowball", },
6000, Material.SNOW_BALL, (byte) 0);
-3, Material.SNOW_BALL, (byte) 0);
}
@Override

View File

@ -9,9 +9,7 @@ import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Zombie;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerJoinEvent;
@ -19,7 +17,6 @@ import org.bukkit.util.Vector;
import mineplex.core.common.Rank;
import mineplex.core.common.util.C;
import mineplex.core.common.util.MapUtil;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilEnt;
@ -54,7 +51,7 @@ public class MorphTitan extends MorphGadget
C.cRed + "Unlocked with Titan Rank",
},
-1,
Material.PRISMARINE_SHARD, (byte)0);
Material.PRISMARINE_CRYSTALS, (byte)0);
}
@Override

View File

@ -25,7 +25,7 @@ public class ParticleCandyCane extends ParticleGadget
public ParticleCandyCane(GadgetManager manager)
{
super(manager, "Candy Cane Particle", new String[]{"Christmas. Nuf said."}, 10, Material.CHEST, (byte)0);
super(manager, "Candy Cane Particle", new String[]{"Christmas. Nuf said."}, -3, Material.CHEST, (byte)0);
}
@EventHandler

View File

@ -23,8 +23,6 @@ import mineplex.core.updater.event.UpdateEvent;
public class ParticleFrostLord extends ParticleGadget
{
private HashSet<Arrow> _arrows = new HashSet<Arrow>();
public ParticleFrostLord(GadgetManager manager)
{
super(manager, "Wind of the Frost Lord", new String[]
@ -33,7 +31,7 @@ public class ParticleFrostLord extends ParticleGadget
C.cWhite + "Your double jumps and arrows",
C.cWhite + "are enchanted with snow powers.",
},
10,
-3,
Material.SNOW_BALL, (byte)0, "Frost Lord");
}

View File

@ -26,7 +26,7 @@ public class ParticleLegend extends ParticleGadget
" ",
C.cGreen + "Unlocked with Legend Rank",
},
-3,
-1,
Material.ENDER_PORTAL_FRAME, (byte)0);
}

View File

@ -32,7 +32,7 @@ public class ParticleTitan extends ParticleGadget
" ",
C.cRed + "Unlocked with Titan Rank",
},
-3,
-1,
Material.FIREBALL, (byte)0);
}

View File

@ -33,7 +33,7 @@ public class MountBabyReindeer extends HorseMount
{
C.cWhite + "One of Santa's baby reindeers",
C.cWhite + "Still trying to learn how to fly"
}, Material.SNOW_BALL, (byte) 0, 10, Color.CREAMY, Style.WHITEFIELD, Variant.HORSE, 0, null);
}, Material.SNOW_BALL, (byte) 0, -3, Color.CREAMY, Style.WHITEFIELD, Variant.HORSE, 0, null);
}
@EventHandler