Removes morphs from gadget persistence (PC-429)
This commit is contained in:
parent
c5cbca3ed0
commit
cb71bf4ba5
@ -937,4 +937,10 @@ public class UtilPlayer
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void removeAllowedCommands(Player player)
|
||||
{
|
||||
if (ALLOWED_COMMANDS.containsKey(player.getUniqueId()))
|
||||
ALLOWED_COMMANDS.remove(player.getUniqueId());
|
||||
}
|
||||
}
|
||||
|
@ -1067,6 +1067,8 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
||||
public void Quit(PlayerQuitEvent event)
|
||||
{
|
||||
_showCarl.remove(event.getPlayer().getName());
|
||||
// Removes from allow command map
|
||||
UtilPlayer.removeAllowedCommands(event.getPlayer());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -2,6 +2,7 @@ package mineplex.core.cosmetic.ui.page;
|
||||
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.cosmetic.CosmeticManager;
|
||||
import mineplex.core.cosmetic.ui.CosmeticShop;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
@ -53,11 +54,7 @@ public class KitGameModifierPage extends GadgetPage
|
||||
|
||||
if(slot%9 == 8) slot += 2;
|
||||
}
|
||||
else
|
||||
continue;
|
||||
}
|
||||
else
|
||||
continue;
|
||||
}
|
||||
|
||||
addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton()
|
||||
|
@ -198,7 +198,7 @@ public class Menu extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
});
|
||||
|
||||
type = GadgetType.WinEffect;
|
||||
lore = getLore(ownedCount.get(type), maxCount.get(type), "Winning a game with your friends all good and dandy, but then being able to also show off awsome effects is even more fun!", "Usable in Lobbies", enabled.get(type));
|
||||
lore = getLore(ownedCount.get(type), maxCount.get(type), "Winning a game with your friends all good and dandy, but then being able to also show off awesome effects is even more fun!", "Usable in Lobbies", enabled.get(type));
|
||||
addButton(winEffectSlot, new ShopItem(Material.CAKE, "Win Effects", lore, 1, false), new OpenWinEffect(this, enabled.get(type)));
|
||||
if (enabled.containsKey(type)) addGlow(winEffectSlot);
|
||||
|
||||
|
@ -187,7 +187,12 @@ public class PetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
itemLore.add(C.cWhite + "You must have an active pet to use this!");
|
||||
getInventory().setItem(slot, new ShopItem(petExtra.GetMaterial(), (byte)0, C.cRed + petExtra.getName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false).getHandle());
|
||||
}
|
||||
else if (getPlugin().getPetManager().getActivePet(getPlayer().getName()).getType() != EntityType.WITHER)
|
||||
// Silverfish = Wither disguised
|
||||
// Villager = Elf
|
||||
// Zombie = Pumpkin
|
||||
else if (getPlugin().getPetManager().getActivePet(getPlayer().getName()).getType() != EntityType.SILVERFISH
|
||||
|| getPlugin().getPetManager().getActivePet(getPlayer().getName()).getType() != EntityType.VILLAGER
|
||||
|| getPlugin().getPetManager().getActivePet(getPlayer().getName()).getType() != EntityType.ZOMBIE)
|
||||
{
|
||||
addButton(slot, new ShopItem(petExtra.GetMaterial(), (byte) 0, "Rename " + getPlugin().getPetManager().getActivePet(getPlayer().getName()).getCustomName() + " for " + C.cYellow + petExtra.getCost(CurrencyType.Coins) + C.cGreen + " Shards", itemLore.toArray(new String[itemLore.size()]), 1, false, false), new RenamePetButton(this));
|
||||
}
|
||||
|
@ -1,5 +1,13 @@
|
||||
package mineplex.core.disguise.disguises;
|
||||
|
||||
public class DisguiseAnimalBase
|
||||
import org.bukkit.entity.EntityType;
|
||||
|
||||
public class DisguiseAnimalBase extends DisguiseAnimal
|
||||
{
|
||||
|
||||
public DisguiseAnimalBase(EntityType entityType, org.bukkit.entity.Entity entity)
|
||||
{
|
||||
super(entityType, entity);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -4,11 +4,12 @@ import java.util.*;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import mineplex.core.gadget.commands.LockCosmeticsCommand;
|
||||
import mineplex.core.gadget.event.GadgetAppliedEvent;
|
||||
import mineplex.core.gadget.event.GadgetEnableEvent;
|
||||
import mineplex.core.gadget.gadgets.outfit.windupsuit.OutfitWindUpSuitBoosterManager;
|
||||
import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifier;
|
||||
import mineplex.core.gadget.gadgets.outfit.windupsuit.*;
|
||||
import mineplex.core.gadget.gadgets.particle.candycane.ParticleCandyCane;
|
||||
import mineplex.core.gadget.persistence.UserGadgetPersistence;
|
||||
import mineplex.core.gadget.set.suits.SetWindUpSuit;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
@ -260,8 +261,7 @@ public class GadgetManager extends MiniPlugin
|
||||
//Costumes
|
||||
addSet(new SetRaveSuit(this));
|
||||
addSet(new SetSpaceSuit(this));
|
||||
//Removes WindUp suit for now, as it's not going to be released
|
||||
//addSet(new SetWindUpSuit(this));
|
||||
addSet(new SetWindUpSuit(this));
|
||||
addSet(new SetParty(this));
|
||||
addSet(new SetCupidsLove(this));
|
||||
addSet(new SetEmerald(this));
|
||||
@ -306,10 +306,10 @@ public class GadgetManager extends MiniPlugin
|
||||
addGadget(new OutfitSpaceSuitLeggings(this));
|
||||
addGadget(new OutfitSpaceSuitBoots(this));
|
||||
|
||||
//addGadget(new OutfitWindUpSuitHelmet(this));
|
||||
//addGadget(new OutfitWindUpSuitChestplate(this));
|
||||
//addGadget(new OutfitWindUpSuitLeggings(this));
|
||||
//addGadget(new OutfitWindUpSuitBoots(this));
|
||||
addGadget(new OutfitWindUpSuitHelmet(this));
|
||||
addGadget(new OutfitWindUpSuitChestplate(this));
|
||||
addGadget(new OutfitWindUpSuitLeggings(this));
|
||||
addGadget(new OutfitWindUpSuitBoots(this));
|
||||
|
||||
addGadget(new OutfitTeam(this, "Team Helmet", -1, ArmorSlot.Helmet, Material.LEATHER_HELMET, (byte)0));
|
||||
addGadget(new OutfitTeam(this, "Team Shirt", -1, ArmorSlot.Chest, Material.LEATHER_CHESTPLATE, (byte)0));
|
||||
@ -461,29 +461,16 @@ public class GadgetManager extends MiniPlugin
|
||||
|
||||
|
||||
// Survival Games
|
||||
// Also not being released in this update
|
||||
// Beastmaster
|
||||
//addGadget(new ChickenKitGameModifier(this));
|
||||
//addGadget(new MiniGuardianKitGameModifier(this));
|
||||
//addGadget(new PigKitGameModifier(this));
|
||||
//addGadget(new SquidKitGameModifier(this));
|
||||
|
||||
// Horseman
|
||||
//addGadget(new MuleKitGameModifier(this));
|
||||
//addGadget(new SkeletonHorseKitGameModifier(this));
|
||||
|
||||
// Necromancer
|
||||
//addGadget(new WitherSkeletonKitGameModifier(this));
|
||||
|
||||
|
||||
// Bridges
|
||||
//addGadget(new PotatoKitGameModifier(this));
|
||||
for (KitModifier kitModifier : KitModifier.values())
|
||||
{
|
||||
addGadget(new KitGameModifier(this, kitModifier));
|
||||
}
|
||||
|
||||
for(GadgetType type : GadgetType.values())
|
||||
{
|
||||
if(!_gadgets.containsKey(type))
|
||||
{
|
||||
_gadgets.put(type, new ArrayList<Gadget>());
|
||||
_gadgets.put(type, new ArrayList<>());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -829,21 +816,15 @@ public class GadgetManager extends MiniPlugin
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void quit(PlayerQuitEvent event)
|
||||
public void onPlayerQuit(PlayerQuitEvent event)
|
||||
{
|
||||
saveGadgets(event.getPlayer());
|
||||
disableAll(event.getPlayer(), false);
|
||||
_lastMove.remove(event.getPlayer());
|
||||
_playerActiveGadgetMap.remove(event.getPlayer());
|
||||
event.getPlayer().setWalkSpeed(0.2f);
|
||||
event.getPlayer().setFlySpeed(0.1f);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void join(PlayerJoinEvent event)
|
||||
{
|
||||
event.getPlayer().setWalkSpeed(0.2f);
|
||||
event.getPlayer().setFlySpeed(0.1f);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void death(PlayerDeathEvent event)
|
||||
@ -975,43 +956,79 @@ public class GadgetManager extends MiniPlugin
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onGadgetApplied(GadgetAppliedEvent event)
|
||||
private void saveGadgets(Player player)
|
||||
{
|
||||
Player player = event.getPlayer();
|
||||
Gadget gadget = event.getGadget();
|
||||
GadgetType gadgetType = gadget.getGadgetType();
|
||||
switch (gadgetType)
|
||||
Map<String, String> cache = new HashMap<>();
|
||||
for (Gadget gadget : getAllGadgets())
|
||||
{
|
||||
case MusicDisc:
|
||||
case Item:
|
||||
break;
|
||||
case Costume:
|
||||
OutfitGadget outfitGadget = (OutfitGadget) gadget;
|
||||
switch (outfitGadget.getSlot())
|
||||
if (gadget.ownsGadget(player))
|
||||
{
|
||||
GadgetType gadgetType = gadget.getGadgetType();
|
||||
switch (gadgetType)
|
||||
{
|
||||
case Helmet:
|
||||
_userGadgetPersistence.save(player, "activeCostumeHelmet", outfitGadget.getName());
|
||||
case MusicDisc:
|
||||
case Item:
|
||||
case Morph:
|
||||
break;
|
||||
case Chest:
|
||||
_userGadgetPersistence.save(player, "activeCostumeChestplate", outfitGadget.getName());
|
||||
case Costume:
|
||||
OutfitGadget outfitGadget = (OutfitGadget) gadget;
|
||||
String key = "activeCostume" + outfitGadget.getSlot().getDatabaseKey();
|
||||
if (cache.containsKey(key))
|
||||
continue;
|
||||
if (outfitGadget.isActive(player))
|
||||
cache.put(key, outfitGadget.getName());
|
||||
break;
|
||||
case Legs:
|
||||
_userGadgetPersistence.save(player, "activeCostumeLeggings", outfitGadget.getName());
|
||||
case GameModifier:
|
||||
GadgetGameModifier gadgetGameModifier = (GadgetGameModifier) gadget;
|
||||
if (gadgetGameModifier.canAllowMultiple())
|
||||
{
|
||||
if (cache.containsKey(gadget.getName()))
|
||||
continue;
|
||||
cache.put(gadget.getName(), (gadget.isActive(player)) ? "enabled" : "disabled");
|
||||
}
|
||||
else
|
||||
{
|
||||
String dataKey = "activeModifier" + gadgetGameModifier.getGameType().getName().replace(" ", "");
|
||||
if (cache.containsKey(dataKey))
|
||||
continue;
|
||||
if (gadget.isActive(player))
|
||||
cache.put(dataKey, gadget.getName());
|
||||
}
|
||||
break;
|
||||
case Boots:
|
||||
_userGadgetPersistence.save(player, "activeCostumeBoots", outfitGadget.getName());
|
||||
default:
|
||||
if (cache.containsKey(gadgetType.getDatabaseKey()))
|
||||
continue;
|
||||
if (gadget.isActive(player))
|
||||
cache.put(gadgetType.getDatabaseKey(), gadget.getName());
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case GameModifier:
|
||||
GadgetGameModifier gadgetGameModifier = (GadgetGameModifier) gadget;
|
||||
String key = "active" + gadget.getName().replace(" ", "") + gadgetGameModifier.getGameType().getName().replace(" ", "");
|
||||
_userGadgetPersistence.save(player, key, "enabled");
|
||||
break;
|
||||
default:
|
||||
_userGadgetPersistence.save(player, gadgetType.getDatabaseKey(), gadget.getName());
|
||||
break;
|
||||
}
|
||||
}
|
||||
_userGadgetPersistence.save(player, cache);
|
||||
}
|
||||
|
||||
public boolean isKitModifierActive(KitModifier kitModifier, Player player)
|
||||
{
|
||||
for (Gadget gadget : getGadgets(GadgetType.GameModifier))
|
||||
{
|
||||
if (gadget instanceof KitGameModifier)
|
||||
{
|
||||
KitGameModifier kitGameModifier = (KitGameModifier) gadget;
|
||||
if (kitGameModifier.getKitModifier().equals(kitModifier))
|
||||
return kitGameModifier.isActive(player);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public KitModifier getActiveKitModifier(KitModifierType kitModifierType, Player player)
|
||||
{
|
||||
for (KitModifier kitModifier : KitModifier.values())
|
||||
{
|
||||
if (kitModifier.getKitModifierType().equals(kitModifierType))
|
||||
if (isKitModifierActive(kitModifier, player))
|
||||
return kitModifier;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -17,17 +17,15 @@ import java.util.function.Predicate;
|
||||
public class KitGameModifier extends GadgetGameModifier
|
||||
{
|
||||
|
||||
private KitModifierType _kitType;
|
||||
private String _kit;
|
||||
private String _id;
|
||||
private KitModifier _kitModifier;
|
||||
private KitModifierType _kitType;
|
||||
|
||||
public KitGameModifier(GadgetManager manager, GameModifierType gameType, KitModifierType kitType, String name, String[] desc,
|
||||
int cost, Material material, byte data, String kit, String id)
|
||||
public KitGameModifier(GadgetManager manager, KitModifier kitModifier)
|
||||
{
|
||||
super(manager, gameType, name, desc, cost, material, data);
|
||||
_kitType = kitType;
|
||||
_kit = kit;
|
||||
_id = id;
|
||||
super(manager, kitModifier.getKitModifierType().getGameModifierType(), kitModifier.getName(), kitModifier.getLore(), kitModifier.getCost(),
|
||||
kitModifier.getMaterial(), kitModifier.getData(), false);
|
||||
_kitModifier = kitModifier;
|
||||
_kitType = kitModifier.getKitModifierType();
|
||||
}
|
||||
|
||||
public KitModifierType getKitType()
|
||||
@ -35,36 +33,31 @@ public class KitGameModifier extends GadgetGameModifier
|
||||
return _kitType;
|
||||
}
|
||||
|
||||
public String getKit()
|
||||
{
|
||||
return _kit;
|
||||
}
|
||||
|
||||
public String getId()
|
||||
{
|
||||
return _id;
|
||||
}
|
||||
public KitModifier getKitModifier()
|
||||
{
|
||||
return _kitModifier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableCustom(Player player)
|
||||
{
|
||||
Manager.getGameModifiers(getGameType()).stream().filter(getKitFilter(_kit)).forEach(g -> g.disable(player));
|
||||
Manager.getGameModifiers(getGameType()).stream().filter(getKitFilter(_kitType)).forEach(g -> g.disable(player));
|
||||
|
||||
super.enableCustom(player);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters kit based on name
|
||||
* @param kitName
|
||||
* Filters kit based on type
|
||||
* @param kitModifierType
|
||||
* @return
|
||||
*/
|
||||
public static Predicate<GadgetGameModifier> getKitFilter(String kitName)
|
||||
public static Predicate<GadgetGameModifier> getKitFilter(KitModifierType kitModifierType)
|
||||
{
|
||||
return new Predicate<GadgetGameModifier>() {
|
||||
@Override
|
||||
public boolean test(GadgetGameModifier g) {
|
||||
if (!(g instanceof KitGameModifier)) { return false; }
|
||||
return ((KitGameModifier)g).getKit().equalsIgnoreCase(kitName);
|
||||
return ((KitGameModifier)g).getKitType().equals(kitModifierType);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -1,22 +1,77 @@
|
||||
package mineplex.core.gadget.gadgets.gamemodifiers.kits;
|
||||
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.EntityType;
|
||||
|
||||
public enum KitModifier
|
||||
{
|
||||
|
||||
// Bridges
|
||||
Bridges_Apple_Potato,
|
||||
Bridges_Apple_Potato(KitModifierType.Bridges_AppleKit, "Potato", new String[] {"Placeholder"}, Material.POTATO_ITEM, 0),
|
||||
|
||||
// Survival Games
|
||||
Survival_Games_Beastmaster_Chicken,
|
||||
Survival_Games_Beastmaster_Mini_Guardian,
|
||||
Survival_Games_Beastmaster_Pig,
|
||||
Survival_Games_Beastmaster_Squid,
|
||||
Survival_Games_Horseman_Mule,
|
||||
Survival_Games_Horseman_Skeleton_Horse,
|
||||
Survival_Games_Horseman_Zombie_Horse,
|
||||
Survival_Games_Necromancer_Wither_Skeleton,
|
||||
Survival_Games_Necromancer_Zombie
|
||||
Survival_Games_Beastmaster_Chicken(KitModifierType.SurvivalGames_BeastmasterKit, "Chicken", new String[] {"Placeholder"}, Material.MONSTER_EGG, UtilEnt.getEntityEggData(EntityType.CHICKEN), 0),
|
||||
Survival_Games_Beastmaster_Mini_Guardian(KitModifierType.SurvivalGames_BeastmasterKit, "Mini Guardian", new String[] {"Placeholder"}, Material.MONSTER_EGG, UtilEnt.getEntityEggData(EntityType.GUARDIAN), 0),
|
||||
Survival_Games_Beastmaster_Pig(KitModifierType.SurvivalGames_BeastmasterKit, "Pig", new String[] {"Placeholder"}, Material.MONSTER_EGG, UtilEnt.getEntityEggData(EntityType.PIG), 0),
|
||||
Survival_Games_Beastmaster_Squid(KitModifierType.SurvivalGames_BeastmasterKit, "Squid", new String[] {"Placeholder"}, Material.MONSTER_EGG, UtilEnt.getEntityEggData(EntityType.SQUID), 0),
|
||||
Survival_Games_Horseman_Mule(KitModifierType.SurvivalGames_HorsemanKit, "Mule", new String[] {"Placeholder"}, Material.CHEST, 0),
|
||||
Survival_Games_Horseman_Skeleton_Horse(KitModifierType.SurvivalGames_HorsemanKit, "Skeleton Horse", new String[] {"Placeholder"}, Material.BONE, 0),
|
||||
Survival_Games_Horseman_Zombie_Horse(KitModifierType.SurvivalGames_HorsemanKit, "Zombie Horse", new String[] {"Placeholder"}, Material.ROTTEN_FLESH, 0),
|
||||
Survival_Games_Horseman_Donkey(KitModifierType.SurvivalGames_HorsemanKit, "Donkey", new String[] {"Placeholder"}, Material.CHEST, 0),
|
||||
Survival_Games_Necromancer_Wither_Skeleton(KitModifierType.SurvivalGames_NecromancerKit, "Wither Skeleton", new String[] {"Placeholder"}, Material.SKULL_ITEM, (byte) 1, 0),
|
||||
Survival_Games_Necromancer_Zombie(KitModifierType.SurvivalGames_NecromancerKit, "Zombie", new String[] {"Placeholder"}, Material.SKULL_ITEM, (byte) 2, 0);
|
||||
|
||||
KitModifier
|
||||
private final KitModifierType _kitModifierType;
|
||||
private final String _name;
|
||||
private final String[] _lore;
|
||||
private final Material _material;
|
||||
private final byte _data;
|
||||
private final int _cost;
|
||||
|
||||
KitModifier(KitModifierType kitModifierType, String name, String[] lore, Material material, int cost)
|
||||
{
|
||||
this(kitModifierType, name, lore, material, (byte) 0, cost);
|
||||
}
|
||||
|
||||
KitModifier(KitModifierType kitModifierType, String name, String[] lore, Material material, byte data, int cost)
|
||||
{
|
||||
_kitModifierType = kitModifierType;
|
||||
_name = name;
|
||||
_lore = lore;
|
||||
_material = material;
|
||||
_data = data;
|
||||
_cost = cost;
|
||||
}
|
||||
|
||||
public KitModifierType getKitModifierType()
|
||||
{
|
||||
return _kitModifierType;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return _name;
|
||||
}
|
||||
|
||||
public String[] getLore()
|
||||
{
|
||||
return _lore;
|
||||
}
|
||||
|
||||
public Material getMaterial()
|
||||
{
|
||||
return _material;
|
||||
}
|
||||
|
||||
public byte getData()
|
||||
{
|
||||
return _data;
|
||||
}
|
||||
|
||||
public int getCost()
|
||||
{
|
||||
return _cost;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ public class GameModifierMineStrikeSkin extends GadgetGameModifier
|
||||
int cost, Material displayMat, int displayData)
|
||||
{
|
||||
super(manager, GameModifierType.MineStrike, name,
|
||||
UtilText.splitLinesToArray(lore, LineFormat.LORE), cost, displayMat, (byte) displayData);
|
||||
UtilText.splitLinesToArray(lore, LineFormat.LORE), cost, displayMat, (byte) displayData, true);
|
||||
_weapon = weaponName;
|
||||
_skinMat = newSkin;
|
||||
_skinData = newSkinData;
|
||||
|
@ -56,12 +56,12 @@ public class ItemFleshHook extends ItemGadget implements IThrown
|
||||
@Override
|
||||
public void Collide(LivingEntity target, Block block, ProjectileUser data)
|
||||
{
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
|
||||
if (!(data.GetThrower() instanceof Player))
|
||||
if (!(data.getThrower() instanceof Player))
|
||||
return;
|
||||
|
||||
Player player = (Player)data.GetThrower();
|
||||
Player player = (Player)data.getThrower();
|
||||
|
||||
if (target == null)
|
||||
return;
|
||||
@ -85,12 +85,12 @@ public class ItemFleshHook extends ItemGadget implements IThrown
|
||||
@Override
|
||||
public void Idle(ProjectileUser data)
|
||||
{
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Expire(ProjectileUser data)
|
||||
{
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
}
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ public class ItemFreezeCannon extends ItemGadget implements IThrown
|
||||
target.playEffect(EntityEffect.HURT);
|
||||
}
|
||||
|
||||
smash(data.GetThrown());
|
||||
smash(data.getThrown());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -173,13 +173,13 @@ public class ItemFreezeCannon extends ItemGadget implements IThrown
|
||||
@Override
|
||||
public void Idle(ProjectileUser data)
|
||||
{
|
||||
smash(data.GetThrown());
|
||||
smash(data.getThrown());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Expire(ProjectileUser data)
|
||||
{
|
||||
smash(data.GetThrown());
|
||||
smash(data.getThrown());
|
||||
}
|
||||
|
||||
public void smash(Entity ent)
|
||||
|
@ -73,26 +73,26 @@ public class ItemMelonLauncher extends ItemGadget implements IThrown
|
||||
{
|
||||
//Push
|
||||
UtilAction.velocity(target,
|
||||
UtilAlg.getTrajectory2d(data.GetThrown().getLocation(), target.getLocation()),
|
||||
UtilAlg.getTrajectory2d(data.getThrown().getLocation(), target.getLocation()),
|
||||
1.4, false, 0, 0.8, 1.5, true);
|
||||
|
||||
//Effect
|
||||
target.playEffect(EntityEffect.HURT);
|
||||
}
|
||||
|
||||
smash(data.GetThrown());
|
||||
smash(data.getThrown());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Idle(ProjectileUser data)
|
||||
{
|
||||
smash(data.GetThrown());
|
||||
smash(data.getThrown());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Expire(ProjectileUser data)
|
||||
{
|
||||
smash(data.GetThrown());
|
||||
smash(data.getThrown());
|
||||
}
|
||||
|
||||
public void smash(Entity ent)
|
||||
|
@ -124,20 +124,20 @@ public class ItemPartyPopper extends ItemGadget implements IThrown
|
||||
{
|
||||
for(int type : new int[]{1,2,4,5,6,9,10,11,12,13,14,15})
|
||||
{
|
||||
UtilParticle.PlayParticleToAll(ParticleType.ICON_CRACK.getParticle(Material.INK_SACK, type), data.GetThrown().getLocation(), null, 0.4f, 50, ViewDist.LONG);
|
||||
UtilParticle.PlayParticleToAll(ParticleType.ICON_CRACK.getParticle(Material.INK_SACK, type), data.getThrown().getLocation(), null, 0.4f, 50, ViewDist.LONG);
|
||||
}
|
||||
data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.LAVA_POP, 0.75f, 1.25f);
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.LAVA_POP, 0.75f, 1.25f);
|
||||
data.getThrown().remove();
|
||||
/*
|
||||
if (data.GetThrown() instanceof Item)
|
||||
if (data.getThrown() instanceof Item)
|
||||
{
|
||||
Item item = (Item) data.GetThrown();
|
||||
Item item = (Item) data.getThrown();
|
||||
byte b = item.getItemStack().getData().getData();
|
||||
UtilParticle.PlayParticleToAll(ParticleType.ICON_CRACK.getParticle(Material.INK_SACK, b), item.getLocation(), 0, 0, 0, 0.2f, 80, ViewDist.LONG);
|
||||
_items.remove(item);
|
||||
}
|
||||
data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.LAVA_POP, 0.75f, 1.25f);
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.LAVA_POP, 0.75f, 1.25f);
|
||||
data.getThrown().remove();
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
@ -134,24 +134,24 @@ public class MorphBat extends MorphGadget implements IThrown
|
||||
target.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 80, 1), true);
|
||||
|
||||
//Inform
|
||||
UtilPlayer.message(target, F.main("Skill", F.name(UtilEnt.getName(data.GetThrower())) + " hit you with " + F.skill("Bat Poop") + "."));
|
||||
UtilPlayer.message(target, F.main("Skill", F.name(UtilEnt.getName(data.getThrower())) + " hit you with " + F.skill("Bat Poop") + "."));
|
||||
|
||||
UtilPlayer.message(data.GetThrower(), F.main("Skill", "You hit " + F.name(UtilEnt.getName(target)) + " with " + F.skill("Bat Poop") + "."));
|
||||
UtilPlayer.message(data.getThrower(), F.main("Skill", "You hit " + F.name(UtilEnt.getName(target)) + " with " + F.skill("Bat Poop") + "."));
|
||||
}
|
||||
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Idle(ProjectileUser data)
|
||||
{
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Expire(ProjectileUser data)
|
||||
{
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -114,16 +114,16 @@ public class MorphVillager extends MorphGadget implements IThrown
|
||||
return;
|
||||
|
||||
if (target instanceof Player)
|
||||
if (Manager.collideEvent((Player) data.GetThrower(), this, (Player) target))
|
||||
if (Manager.collideEvent((Player) data.getThrower(), this, (Player) target))
|
||||
return;
|
||||
|
||||
//Pull
|
||||
UtilAction.velocity(target,
|
||||
UtilAlg.getTrajectory(data.GetThrown().getLocation(), target.getEyeLocation()),
|
||||
UtilAlg.getTrajectory(data.getThrown().getLocation(), target.getEyeLocation()),
|
||||
1, false, 0, 0.2, 0.8, true);
|
||||
|
||||
UtilAction.velocity(data.GetThrown(),
|
||||
UtilAlg.getTrajectory(target, data.GetThrown()),
|
||||
UtilAction.velocity(data.getThrown(),
|
||||
UtilAlg.getTrajectory(target, data.getThrown()),
|
||||
0.5, false, 0, 0, 0.8, true);
|
||||
|
||||
//Effect
|
||||
|
@ -10,6 +10,7 @@ import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.types.Gadget;
|
||||
import mineplex.core.gadget.types.GadgetGameModifier;
|
||||
import mineplex.core.gadget.types.GadgetType;
|
||||
import mineplex.core.gadget.types.OutfitGadget;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class UserGadgetPersistence
|
||||
@ -21,7 +22,7 @@ public class UserGadgetPersistence
|
||||
public UserGadgetPersistence(GadgetManager manager)
|
||||
{
|
||||
_manager = manager;
|
||||
_repository = new PlayerKeyValueRepository<>("gadgets", PreparedStatement::setString, ResultSet::getString, "VARCHAR(255)");
|
||||
_repository = new PlayerKeyValueRepository<>("gadgets", PreparedStatement::setString, ResultSet::getString);
|
||||
}
|
||||
|
||||
public void load(Player player)
|
||||
@ -29,38 +30,45 @@ public class UserGadgetPersistence
|
||||
_repository.getAll(player.getUniqueId()).thenCompose(BukkitFuture.accept(values -> {
|
||||
if (player.isOnline())
|
||||
{
|
||||
for (GadgetType gadgetType : GadgetType.values())
|
||||
for (Gadget gadget : _manager.getAllGadgets())
|
||||
{
|
||||
GadgetType gadgetType = gadget.getGadgetType();
|
||||
switch (gadgetType)
|
||||
{
|
||||
case MusicDisc:
|
||||
case Item:
|
||||
case Morph:
|
||||
break;
|
||||
case Costume:
|
||||
String[] costumeParts = new String[] {"activeCostumeHelmet", "activeCostumeChestplate",
|
||||
"activeCostumeLeggings", "activeCostumeBoots"};
|
||||
for (String costumePart : costumeParts)
|
||||
{
|
||||
Gadget costumeGadget = _manager.getGadget(values.get(costumePart), gadgetType);
|
||||
if (costumeGadget != null)
|
||||
costumeGadget.enable(player);
|
||||
}
|
||||
OutfitGadget outfitGadget = (OutfitGadget) gadget;
|
||||
String key = "activeCostume" + outfitGadget.getSlot().getDatabaseKey();
|
||||
if (!values.containsKey(key))
|
||||
continue;
|
||||
if (values.get(key).equals(gadget.getName()))
|
||||
gadget.enable(player);
|
||||
break;
|
||||
case GameModifier:
|
||||
List<Gadget> gameModifiers = _manager.getGadgets(gadgetType);
|
||||
for (Gadget gadget : gameModifiers)
|
||||
GadgetGameModifier gadgetGameModifier = (GadgetGameModifier) gadget;
|
||||
if (gadgetGameModifier.canAllowMultiple())
|
||||
{
|
||||
GadgetGameModifier gadgetGameModifier = (GadgetGameModifier) gadget;
|
||||
String key = "active" + gadget.getName().replace(" ", "") +
|
||||
gadgetGameModifier.getGameType().getName().replace(" ", "");
|
||||
if (values.get(key) != null)
|
||||
if (values.get(key).equalsIgnoreCase("enabled"))
|
||||
gadget.enable(player);
|
||||
if (!values.containsKey(gadget.getName()))
|
||||
continue;
|
||||
if (values.get(gadget.getName()).equals("enabled"))
|
||||
gadget.enable(player);
|
||||
}
|
||||
else
|
||||
{
|
||||
String dataKey = "activeModifier" + gadgetGameModifier.getGameType().getName().replace(" ", "");
|
||||
if (!values.containsKey(dataKey))
|
||||
continue;
|
||||
if (values.get(dataKey).equals(gadget.getName()))
|
||||
gadget.enable(player);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
Gadget gadget = _manager.getGadget(values.get(gadgetType.getDatabaseKey()), gadgetType);
|
||||
if (gadget != null)
|
||||
if (!values.containsKey(gadgetType.getDatabaseKey()))
|
||||
continue;
|
||||
if (values.get(gadgetType.getDatabaseKey()).equals(gadget.getName()))
|
||||
gadget.enable(player);
|
||||
break;
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ public abstract class GadgetGameModifier extends Gadget
|
||||
{
|
||||
|
||||
protected final GameModifierType _type;
|
||||
private final boolean _allowMultiple;
|
||||
|
||||
/**
|
||||
* @param manager Normal GadgetManager
|
||||
@ -25,16 +26,22 @@ public abstract class GadgetGameModifier extends Gadget
|
||||
* @param mat The display material used in GUIs
|
||||
* @param data The display data used in GUIs
|
||||
*/
|
||||
public GadgetGameModifier(GadgetManager manager, GameModifierType type, String name, String[] desc, int cost, Material mat, byte data)
|
||||
public GadgetGameModifier(GadgetManager manager, GameModifierType type, String name, String[] desc, int cost, Material mat, byte data, boolean allowMultiple)
|
||||
{
|
||||
super(manager, GadgetType.GameModifier, name, desc, cost, mat, data);
|
||||
_type = type;
|
||||
_allowMultiple = allowMultiple;
|
||||
}
|
||||
|
||||
public GameModifierType getGameType()
|
||||
{
|
||||
return _type;
|
||||
}
|
||||
|
||||
public boolean canAllowMultiple()
|
||||
{
|
||||
return _allowMultiple;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableCustom(Player player)
|
||||
|
@ -12,10 +12,22 @@ public abstract class OutfitGadget extends Gadget
|
||||
{
|
||||
public enum ArmorSlot
|
||||
{
|
||||
Helmet,
|
||||
Chest,
|
||||
Legs,
|
||||
Boots
|
||||
Helmet ("Helmet"),
|
||||
Chest ("Chestplate"),
|
||||
Legs ("Leggings"),
|
||||
Boots ("Boots");
|
||||
|
||||
private String _databaseKey;
|
||||
|
||||
ArmorSlot(String databaseKey)
|
||||
{
|
||||
_databaseKey = databaseKey;
|
||||
}
|
||||
|
||||
public String getDatabaseKey()
|
||||
{
|
||||
return _databaseKey;
|
||||
}
|
||||
}
|
||||
|
||||
protected ArmorSlot _slot;
|
||||
|
@ -10,7 +10,6 @@ import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Entity;
|
||||
@ -40,7 +39,7 @@ public class ProjectileManager extends MiniPlugin
|
||||
{
|
||||
if (_thrown.containsKey(thrown))
|
||||
{
|
||||
return _thrown.get(thrown).GetThrower();
|
||||
return _thrown.get(thrown).getThrower();
|
||||
}
|
||||
|
||||
return null;
|
||||
@ -174,14 +173,14 @@ public class ProjectileManager extends MiniPlugin
|
||||
iterator.remove();
|
||||
continue;
|
||||
}
|
||||
else if (_thrown.get(cur).Collision())
|
||||
else if (_thrown.get(cur).collision())
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
|
||||
//Effects
|
||||
for (ProjectileUser cur : _thrown.values())
|
||||
cur.Effect(event);
|
||||
cur.effect(event);
|
||||
}
|
||||
|
||||
@EventHandler(priority=EventPriority.LOW)
|
||||
@ -191,7 +190,7 @@ public class ProjectileManager extends MiniPlugin
|
||||
return;
|
||||
|
||||
if (_thrown.containsKey(event.getItem()))
|
||||
if (!_thrown.get(event.getItem()).CanPickup(event.getPlayer()))
|
||||
if (!_thrown.get(event.getItem()).canPickup(event.getPlayer()))
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
|
@ -143,7 +143,7 @@ public class ProjectileUser
|
||||
_canHit = canHit;
|
||||
}
|
||||
|
||||
public void Effect(UpdateEvent event)
|
||||
public void effect(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != _effectRate)
|
||||
return;
|
||||
@ -160,7 +160,7 @@ public class ProjectileUser
|
||||
|
||||
}
|
||||
|
||||
public boolean Collision()
|
||||
public boolean collision()
|
||||
{
|
||||
if (_expireTime != -1 && System.currentTimeMillis() > (_startTime + _expireTime))
|
||||
{
|
||||
@ -317,17 +317,17 @@ public class ProjectileUser
|
||||
return _callback;
|
||||
}
|
||||
|
||||
public LivingEntity GetThrower()
|
||||
public LivingEntity getThrower()
|
||||
{
|
||||
return _thrower;
|
||||
}
|
||||
|
||||
public Entity GetThrown()
|
||||
public Entity getThrown()
|
||||
{
|
||||
return _thrown;
|
||||
}
|
||||
|
||||
public boolean CanPickup(LivingEntity thrower)
|
||||
public boolean canPickup(LivingEntity thrower)
|
||||
{
|
||||
if (!thrower.equals(_thrower))
|
||||
return false;
|
||||
|
@ -119,9 +119,9 @@ public class PotatoManager extends MiniPlugin implements IThrown
|
||||
give(player, 1);
|
||||
}
|
||||
|
||||
data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.CHICKEN_EGG_POP, 1f, 1.6f);
|
||||
data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.CHICKEN_EGG_POP, 1f, 1.6f);
|
||||
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -302,7 +302,7 @@ public class StackerManager extends MiniPlugin implements IThrown
|
||||
System.out.println("Stacker collide.");
|
||||
|
||||
//Velocity
|
||||
UtilAction.velocity(target, UtilAlg.getTrajectory2d(data.GetThrown(), target), 1, true, 0.8, 0, 10, true);
|
||||
UtilAction.velocity(target, UtilAlg.getTrajectory2d(data.getThrown(), target), 1, true, 0.8, 0, 10, true);
|
||||
|
||||
Entity rider = target.getPassenger();
|
||||
while (rider != null)
|
||||
@ -315,10 +315,10 @@ public class StackerManager extends MiniPlugin implements IThrown
|
||||
rider = rider.getPassenger();
|
||||
}
|
||||
|
||||
UtilPlayer.message(target, F.main("Stacker", F.name(UtilEnt.getName(data.GetThrower())) + " hit you with " + F.name(UtilEnt.getName(data.GetThrown()))));
|
||||
UtilPlayer.message(target, F.main("Stacker", F.name(UtilEnt.getName(data.getThrower())) + " hit you with " + F.name(UtilEnt.getName(data.getThrown()))));
|
||||
|
||||
//Effect
|
||||
data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.HURT_FLESH, 1f, 1f);
|
||||
data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.HURT_FLESH, 1f, 1f);
|
||||
|
||||
//Portal Delay
|
||||
Manager.SetPortalDelay(target);
|
||||
|
@ -37,7 +37,6 @@ import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.minecraft.game.classcombat.Skill.SkillCharge;
|
||||
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
|
||||
import mineplex.minecraft.game.classcombat.Skill.event.BlockTossEvent;
|
||||
import mineplex.minecraft.game.classcombat.Skill.event.BlockTossExpireEvent;
|
||||
import mineplex.minecraft.game.classcombat.Skill.event.BlockTossLandEvent;
|
||||
import mineplex.minecraft.game.classcombat.Skill.event.SkillEvent;
|
||||
@ -281,19 +280,19 @@ public class BlockToss extends SkillCharge implements IThrown
|
||||
if (target == null)
|
||||
return;
|
||||
|
||||
int level = getLevel(data.GetThrower());
|
||||
int level = getLevel(data.getThrower());
|
||||
|
||||
//Damage Event
|
||||
Factory.Damage().NewDamageEvent(target, data.GetThrower(), null,
|
||||
DamageCause.CUSTOM, data.GetThrown().getVelocity().length() * (3 + 0.6 * level), true, true, false,
|
||||
UtilEnt.getName(data.GetThrower()), GetName());
|
||||
Factory.Damage().NewDamageEvent(target, data.getThrower(), null,
|
||||
DamageCause.CUSTOM, data.getThrown().getVelocity().length() * (3 + 0.6 * level), true, true, false,
|
||||
UtilEnt.getName(data.getThrower()), GetName());
|
||||
|
||||
//Block to Item
|
||||
if (data.GetThrown() instanceof FallingBlock)
|
||||
if (data.getThrown() instanceof FallingBlock)
|
||||
{
|
||||
FallingBlock thrown = (FallingBlock) data.GetThrown();
|
||||
FallingBlock thrown = (FallingBlock) data.getThrown();
|
||||
|
||||
FallingBlock newThrown = data.GetThrown().getWorld().spawnFallingBlock(data.GetThrown().getLocation(), thrown.getMaterial(), thrown.getBlockData());
|
||||
FallingBlock newThrown = data.getThrown().getWorld().spawnFallingBlock(data.getThrown().getLocation(), thrown.getMaterial(), thrown.getBlockData());
|
||||
newThrown.setDropItem(false);
|
||||
|
||||
//Remove Old
|
||||
@ -301,8 +300,8 @@ public class BlockToss extends SkillCharge implements IThrown
|
||||
thrown.remove();
|
||||
|
||||
//Add New
|
||||
if (data.GetThrower() instanceof Player)
|
||||
_falling.put(newThrown, (Player)data.GetThrower());
|
||||
if (data.getThrower() instanceof Player)
|
||||
_falling.put(newThrown, (Player)data.getThrower());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,6 @@ package mineplex.minecraft.game.classcombat.Skill.Brute;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Item;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -126,13 +125,13 @@ public class FleshHook extends SkillActiveCharge implements IThrown
|
||||
public void Collide(LivingEntity target, Block block, ProjectileUser data)
|
||||
{
|
||||
//Remove
|
||||
double velocity = data.GetThrown().getVelocity().length();
|
||||
data.GetThrown().remove();
|
||||
double velocity = data.getThrown().getVelocity().length();
|
||||
data.getThrown().remove();
|
||||
|
||||
if (!(data.GetThrower() instanceof Player))
|
||||
if (!(data.getThrower() instanceof Player))
|
||||
return;
|
||||
|
||||
Player player = (Player)data.GetThrower();
|
||||
Player player = (Player)data.getThrower();
|
||||
|
||||
//Level
|
||||
int level = getLevel(player);
|
||||
@ -172,13 +171,13 @@ public class FleshHook extends SkillActiveCharge implements IThrown
|
||||
public void Idle(ProjectileUser data)
|
||||
{
|
||||
//Remove
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Expire(ProjectileUser data)
|
||||
{
|
||||
//Remove
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,6 @@ package mineplex.minecraft.game.classcombat.Skill.Knight;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.block.Block;
|
||||
@ -27,7 +26,6 @@ import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.projectile.IThrown;
|
||||
import mineplex.core.projectile.ProjectileUser;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.minecraft.game.classcombat.Skill.SkillActive;
|
||||
@ -100,33 +98,33 @@ public class AxeThrow extends SkillActive implements IThrown
|
||||
@Override
|
||||
public void Collide(LivingEntity target, Block block, ProjectileUser data)
|
||||
{
|
||||
Rebound(data.GetThrower(), data.GetThrown());
|
||||
Rebound(data.getThrower(), data.getThrown());
|
||||
|
||||
if (target == null)
|
||||
return;
|
||||
|
||||
int level = getLevel(data.GetThrower());
|
||||
int level = getLevel(data.getThrower());
|
||||
if (level <= 0)
|
||||
return;
|
||||
|
||||
double damage = 5.5 + 0.5 * level;
|
||||
|
||||
//Damage Event
|
||||
Factory.Damage().NewDamageEvent(target, data.GetThrower(), null,
|
||||
Factory.Damage().NewDamageEvent(target, data.getThrower(), null,
|
||||
DamageCause.CUSTOM, damage, true, true, false,
|
||||
UtilEnt.getName(data.GetThrower()), GetName());
|
||||
UtilEnt.getName(data.getThrower()), GetName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Idle(ProjectileUser data)
|
||||
{
|
||||
Rebound(data.GetThrower(), data.GetThrown());
|
||||
Rebound(data.getThrower(), data.getThrown());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Expire(ProjectileUser data)
|
||||
{
|
||||
Rebound(data.GetThrower(), data.GetThrown());
|
||||
Rebound(data.getThrower(), data.getThrown());
|
||||
}
|
||||
|
||||
public void Rebound(LivingEntity player, Entity ent)
|
||||
|
@ -100,23 +100,23 @@ public class FreezingBlast extends SkillActive implements IThrown
|
||||
public void Action(LivingEntity target, ProjectileUser data)
|
||||
{
|
||||
//Effect
|
||||
data.GetThrown().getWorld().playEffect(data.GetThrown().getLocation(), Effect.STEP_SOUND, 79);
|
||||
data.getThrown().getWorld().playEffect(data.getThrown().getLocation(), Effect.STEP_SOUND, 79);
|
||||
|
||||
//Remove
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
|
||||
//Thrower
|
||||
if (!(data.GetThrower() instanceof Player))
|
||||
if (!(data.getThrower() instanceof Player))
|
||||
return;
|
||||
|
||||
Player player = (Player)data.GetThrower();
|
||||
Player player = (Player)data.getThrower();
|
||||
|
||||
//Level
|
||||
int level = getLevel(player);
|
||||
if (level == 0) return;
|
||||
|
||||
//Snow Spread
|
||||
HashMap<Block, Double> blocks = UtilBlock.getInRadius(data.GetThrown().getLocation(), 4d);
|
||||
HashMap<Block, Double> blocks = UtilBlock.getInRadius(data.getThrown().getLocation(), 4d);
|
||||
for (Block cur : blocks.keySet())
|
||||
{
|
||||
if (UtilBlock.airFoliage(cur) && UtilBlock.solid(cur.getRelative(BlockFace.DOWN)))
|
||||
@ -127,7 +127,7 @@ public class FreezingBlast extends SkillActive implements IThrown
|
||||
}
|
||||
|
||||
//Slow Players
|
||||
for (Player curPlayer : UtilPlayer.getNearby(data.GetThrown().getLocation(), 4))
|
||||
for (Player curPlayer : UtilPlayer.getNearby(data.getThrown().getLocation(), 4))
|
||||
Factory.Condition().Factory().Slow(GetName(), curPlayer, player, 2.9, 0, false, true, true, true);
|
||||
|
||||
if (target == null)
|
||||
|
@ -7,17 +7,14 @@ import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Item;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
|
||||
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.core.projectile.IThrown;
|
||||
import mineplex.core.projectile.ProjectileUser;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
@ -83,38 +80,38 @@ public class GlacialBlade extends SkillActive implements IThrown
|
||||
public void Collide(LivingEntity target, Block block, ProjectileUser data)
|
||||
{
|
||||
//Effect
|
||||
data.GetThrown().getWorld().playEffect(data.GetThrown().getLocation(), Effect.STEP_SOUND, 20);
|
||||
data.getThrown().getWorld().playEffect(data.getThrown().getLocation(), Effect.STEP_SOUND, 20);
|
||||
|
||||
//Remove
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
|
||||
if (target == null)
|
||||
return;
|
||||
|
||||
//Damage
|
||||
Factory.Damage().NewDamageEvent(target, data.GetThrower(), null,
|
||||
Factory.Damage().NewDamageEvent(target, data.getThrower(), null,
|
||||
DamageCause.CUSTOM, 3.5, false, true, false,
|
||||
UtilEnt.getName(data.GetThrower()), GetName());
|
||||
UtilEnt.getName(data.getThrower()), GetName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Idle(ProjectileUser data)
|
||||
{
|
||||
//Effect
|
||||
data.GetThrown().getWorld().playEffect(data.GetThrown().getLocation(), Effect.STEP_SOUND, 20);
|
||||
data.getThrown().getWorld().playEffect(data.getThrown().getLocation(), Effect.STEP_SOUND, 20);
|
||||
|
||||
//Remove
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Expire(ProjectileUser data)
|
||||
{
|
||||
//Effect
|
||||
data.GetThrown().getWorld().playEffect(data.GetThrown().getLocation(), Effect.STEP_SOUND, 20);
|
||||
data.getThrown().getWorld().playEffect(data.getThrown().getLocation(), Effect.STEP_SOUND, 20);
|
||||
|
||||
//Remove
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -101,22 +101,22 @@ public class IcePrison extends SkillActive implements IThrown
|
||||
public void Action(LivingEntity target, ProjectileUser data)
|
||||
{
|
||||
//Effect
|
||||
data.GetThrown().getWorld().playEffect(data.GetThrown().getLocation(), Effect.STEP_SOUND, 79);
|
||||
data.getThrown().getWorld().playEffect(data.getThrown().getLocation(), Effect.STEP_SOUND, 79);
|
||||
|
||||
//Remove
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
|
||||
//Thrower
|
||||
if (!(data.GetThrower() instanceof Player))
|
||||
if (!(data.getThrower() instanceof Player))
|
||||
return;
|
||||
|
||||
Player player = (Player)data.GetThrower();
|
||||
Player player = (Player)data.getThrower();
|
||||
|
||||
//Level
|
||||
int level = getLevel(player);
|
||||
if (level == 0) return;
|
||||
|
||||
Block block = data.GetThrown().getLocation().getBlock();
|
||||
Block block = data.getThrown().getLocation().getBlock();
|
||||
|
||||
//Sphere
|
||||
HashMap<Block, Double> blocks = UtilBlock.getInRadius(block, 3.8d);
|
||||
|
@ -132,20 +132,20 @@ public class LightningOrb extends SkillActive implements IThrown
|
||||
public void Strike(LivingEntity target, ProjectileUser data)
|
||||
{
|
||||
//Remove
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
|
||||
//Thrower
|
||||
if (!(data.GetThrower() instanceof Player))
|
||||
if (!(data.getThrower() instanceof Player))
|
||||
return;
|
||||
|
||||
Player player = (Player)data.GetThrower();
|
||||
Player player = (Player)data.getThrower();
|
||||
|
||||
//Level
|
||||
int level = getLevel(player);
|
||||
if (level == 0) return;
|
||||
|
||||
|
||||
HashMap<LivingEntity, Double> hit = UtilEnt.getInRadius(data.GetThrown().getLocation(), 3 + 0.5 * level);
|
||||
HashMap<LivingEntity, Double> hit = UtilEnt.getInRadius(data.getThrown().getLocation(), 3 + 0.5 * level);
|
||||
|
||||
List<LivingEntity> struck = new ArrayList<>();
|
||||
|
||||
|
@ -56,18 +56,18 @@ public class Apple extends ItemUsable
|
||||
return;
|
||||
|
||||
//Damage Event
|
||||
Factory.Damage().NewDamageEvent(target, data.GetThrower(), null,
|
||||
Factory.Damage().NewDamageEvent(target, data.getThrower(), null,
|
||||
DamageCause.CUSTOM, 2, true, true, false,
|
||||
UtilEnt.getName(data.GetThrower()), GetName());
|
||||
UtilEnt.getName(data.getThrower()), GetName());
|
||||
|
||||
//Effect
|
||||
data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.CHICKEN_EGG_POP, 1f, 1.6f);
|
||||
data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.CHICKEN_EGG_POP, 1f, 1.6f);
|
||||
|
||||
//Re-Drop
|
||||
if (data.GetThrown() instanceof Item)
|
||||
data.GetThrown().getWorld().dropItem(data.GetThrown().getLocation(), ItemStackFactory.Instance.CreateStack(((Item)data.GetThrown()).getItemStack().getType())).setPickupDelay(60);
|
||||
if (data.getThrown() instanceof Item)
|
||||
data.getThrown().getWorld().dropItem(data.getThrown().getLocation(), ItemStackFactory.Instance.CreateStack(((Item)data.getThrown()).getItemStack().getType())).setPickupDelay(60);
|
||||
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -39,24 +39,24 @@ public class PoisonBall extends ItemUsable
|
||||
@Override
|
||||
public void Collide(LivingEntity target, Block block, ProjectileUser data)
|
||||
{
|
||||
Rebound(data.GetThrower(), data.GetThrown());
|
||||
Rebound(data.getThrower(), data.getThrown());
|
||||
|
||||
if (target == null)
|
||||
return;
|
||||
|
||||
Factory.Condition().Factory().Poison(GetName(), target, data.GetThrower(), 6, 0, false, true, true);
|
||||
Factory.Condition().Factory().Poison(GetName(), target, data.getThrower(), 6, 0, false, true, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Idle(ProjectileUser data)
|
||||
{
|
||||
Rebound(data.GetThrower(), data.GetThrown());
|
||||
Rebound(data.getThrower(), data.getThrown());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Expire(ProjectileUser data)
|
||||
{
|
||||
Rebound(data.GetThrower(), data.GetThrown());
|
||||
Rebound(data.getThrower(), data.getThrown());
|
||||
}
|
||||
|
||||
public void Rebound(LivingEntity player, Entity ent)
|
||||
|
@ -1,7 +1,6 @@
|
||||
package mineplex.minecraft.game.classcombat.item.Throwable;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
@ -79,33 +78,33 @@ public class ProximityExplosive extends ItemUsable
|
||||
public void Collide(LivingEntity target, Block block, ProjectileUser data)
|
||||
{
|
||||
//Arm
|
||||
_armed.put(data.GetThrown(), data.GetThrower());
|
||||
_armed.put(data.getThrown(), data.getThrower());
|
||||
|
||||
//Effect
|
||||
data.GetThrown().getWorld().playEffect(data.GetThrown().getLocation(), Effect.STEP_SOUND, 7);
|
||||
data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.NOTE_PLING, 0.5f, 2f);
|
||||
data.getThrown().getWorld().playEffect(data.getThrown().getLocation(), Effect.STEP_SOUND, 7);
|
||||
data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.NOTE_PLING, 0.5f, 2f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Idle(ProjectileUser data)
|
||||
{
|
||||
//Arm
|
||||
_armed.put(data.GetThrown(), data.GetThrower());
|
||||
_armed.put(data.getThrown(), data.getThrower());
|
||||
|
||||
//Effect
|
||||
data.GetThrown().getWorld().playEffect(data.GetThrown().getLocation(), Effect.STEP_SOUND, 7);
|
||||
data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.NOTE_PLING, 0.5f, 2f);
|
||||
data.getThrown().getWorld().playEffect(data.getThrown().getLocation(), Effect.STEP_SOUND, 7);
|
||||
data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.NOTE_PLING, 0.5f, 2f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Expire(ProjectileUser data)
|
||||
{
|
||||
//Arm
|
||||
_armed.put(data.GetThrown(), data.GetThrower());
|
||||
_armed.put(data.getThrown(), data.getThrower());
|
||||
|
||||
//Effect
|
||||
data.GetThrown().getWorld().playEffect(data.GetThrown().getLocation(), Effect.STEP_SOUND, 7);
|
||||
data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.NOTE_PLING, 0.5f, 2f);
|
||||
data.getThrown().getWorld().playEffect(data.getThrown().getLocation(), Effect.STEP_SOUND, 7);
|
||||
data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.NOTE_PLING, 0.5f, 2f);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
|
@ -1,12 +1,10 @@
|
||||
package mineplex.minecraft.game.classcombat.item.Throwable;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.block.Block;
|
||||
@ -77,33 +75,33 @@ public class ProximityZapper extends ItemUsable
|
||||
public void Collide(LivingEntity target, Block block, ProjectileUser data)
|
||||
{
|
||||
//Arm
|
||||
_armed.put(data.GetThrown(), data.GetThrower());
|
||||
_armed.put(data.getThrown(), data.getThrower());
|
||||
|
||||
//Effect
|
||||
data.GetThrown().getWorld().playEffect(data.GetThrown().getLocation(), Effect.STEP_SOUND, 7);
|
||||
data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.NOTE_PLING, 0.5f, 2f);
|
||||
data.getThrown().getWorld().playEffect(data.getThrown().getLocation(), Effect.STEP_SOUND, 7);
|
||||
data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.NOTE_PLING, 0.5f, 2f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Idle(ProjectileUser data)
|
||||
{
|
||||
//Arm
|
||||
_armed.put(data.GetThrown(), data.GetThrower());
|
||||
_armed.put(data.getThrown(), data.getThrower());
|
||||
|
||||
//Effect
|
||||
data.GetThrown().getWorld().playEffect(data.GetThrown().getLocation(), Effect.STEP_SOUND, 7);
|
||||
data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.NOTE_PLING, 0.5f, 2f);
|
||||
data.getThrown().getWorld().playEffect(data.getThrown().getLocation(), Effect.STEP_SOUND, 7);
|
||||
data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.NOTE_PLING, 0.5f, 2f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Expire(ProjectileUser data)
|
||||
{
|
||||
//Arm
|
||||
_armed.put(data.GetThrown(), data.GetThrower());
|
||||
_armed.put(data.getThrown(), data.getThrower());
|
||||
|
||||
//Effect
|
||||
data.GetThrown().getWorld().playEffect(data.GetThrown().getLocation(), Effect.STEP_SOUND, 7);
|
||||
data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.NOTE_PLING, 0.5f, 2f);
|
||||
data.getThrown().getWorld().playEffect(data.getThrown().getLocation(), Effect.STEP_SOUND, 7);
|
||||
data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.NOTE_PLING, 0.5f, 2f);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
|
@ -80,17 +80,17 @@ public class WaterBottle extends ItemUsable
|
||||
public void Break(ProjectileUser data)
|
||||
{
|
||||
//Splash
|
||||
data.GetThrown().getWorld().playEffect(data.GetThrown().getLocation(), Effect.STEP_SOUND, 20);
|
||||
data.GetThrown().getWorld().playEffect(data.GetThrown().getLocation(), Effect.STEP_SOUND, 8);
|
||||
data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.SPLASH, 1f, 1.4f);
|
||||
data.getThrown().getWorld().playEffect(data.getThrown().getLocation(), Effect.STEP_SOUND, 20);
|
||||
data.getThrown().getWorld().playEffect(data.getThrown().getLocation(), Effect.STEP_SOUND, 8);
|
||||
data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.SPLASH, 1f, 1.4f);
|
||||
|
||||
//Extinguish
|
||||
Factory.Fire().RemoveNear(data.GetThrown().getLocation(), 3);
|
||||
Factory.Fire().RemoveNear(data.getThrown().getLocation(), 3);
|
||||
|
||||
//Remove
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
|
||||
for (Player player : UtilPlayer.getNearby(data.GetThrown().getLocation(), 3))
|
||||
for (Player player : UtilPlayer.getNearby(data.getThrown().getLocation(), 3))
|
||||
{
|
||||
//Extinguish
|
||||
player.setFireTicks(-20);
|
||||
|
@ -7,7 +7,6 @@ import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
@ -47,27 +46,27 @@ public class Web extends ItemUsable
|
||||
{
|
||||
if (target != null)
|
||||
{
|
||||
double distance = UtilMath.offset(target.getLocation(), data.GetThrown().getLocation());
|
||||
double distance = UtilMath.offset(target.getLocation(), data.getThrown().getLocation());
|
||||
|
||||
if (distance > .75)
|
||||
{
|
||||
data.GetThrown().teleport(data.GetThrown().getLocation().add(new Vector(0, -distance / 2, 0)));
|
||||
data.getThrown().teleport(data.getThrown().getLocation().add(new Vector(0, -distance / 2, 0)));
|
||||
}
|
||||
}
|
||||
|
||||
CreateWeb(data.GetThrown());
|
||||
CreateWeb(data.getThrown());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Idle(ProjectileUser data)
|
||||
{
|
||||
CreateWeb(data.GetThrown());
|
||||
CreateWeb(data.getThrown());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Expire(ProjectileUser data)
|
||||
{
|
||||
CreateWeb(data.GetThrown());
|
||||
CreateWeb(data.getThrown());
|
||||
}
|
||||
|
||||
public void CreateWeb(Entity ent)
|
||||
|
@ -109,27 +109,27 @@ public class RocketAbility extends SlimeAbility implements IThrown
|
||||
public void Collide(LivingEntity target, Block block, ProjectileUser data)
|
||||
{
|
||||
// Bukkit.broadcastMessage("COLLIDE " + target);
|
||||
UtilParticle.PlayParticle(UtilParticle.ParticleType.LARGE_EXPLODE, data.GetThrown().getLocation(), 0, 0, 0, 0, 1, UtilParticle.ViewDist.LONG, UtilServer.getPlayers());
|
||||
UtilParticle.PlayParticle(UtilParticle.ParticleType.LARGE_EXPLODE, data.getThrown().getLocation(), 0, 0, 0, 0, 1, UtilParticle.ViewDist.LONG, UtilServer.getPlayers());
|
||||
target.getLocation().getWorld().playSound(target.getLocation(), Sound.SPLASH, 1, 2);
|
||||
getSlime().getEvent().getDamageManager().NewDamageEvent(target, getSlime().getEntity(), null,
|
||||
EntityDamageEvent.DamageCause.PROJECTILE, 3 + getSlime().getSize() * 3, true, true, false,
|
||||
getSlime().getName(), "Slime Rocket");
|
||||
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
_rocketsHit++;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Idle(ProjectileUser data)
|
||||
{
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
_rocketsHit++;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Expire(ProjectileUser data)
|
||||
{
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
_rocketsHit++;
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,6 @@ package mineplex.minecraft.game.core.boss.spider.attacks;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Item;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
@ -12,7 +11,6 @@ import mineplex.core.common.util.UtilParticle;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||
import mineplex.core.disguise.disguises.DisguiseSlime;
|
||||
import mineplex.core.projectile.IThrown;
|
||||
import mineplex.core.projectile.ProjectileUser;
|
||||
import mineplex.minecraft.game.core.boss.EventCreature;
|
||||
@ -53,9 +51,9 @@ public class SpiderPoison implements IThrown
|
||||
|
||||
private void burst(ProjectileUser data)
|
||||
{
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
|
||||
UtilParticle.PlayParticle(ParticleType.ICON_CRACK.getParticle(Material.SLIME_BALL, 0), data.GetThrown().getLocation(),
|
||||
UtilParticle.PlayParticle(ParticleType.ICON_CRACK.getParticle(Material.SLIME_BALL, 0), data.getThrown().getLocation(),
|
||||
0.3F, 0.3F, 0.3F, 0, 30, ViewDist.NORMAL, UtilServer.getPlayers());
|
||||
}
|
||||
|
||||
|
@ -175,24 +175,24 @@ public class PerkBlockTossEVO extends Perk implements IThrown
|
||||
return;
|
||||
|
||||
//Damage Event
|
||||
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null,
|
||||
DamageCause.PROJECTILE, data.GetThrown().getVelocity().length() * 4, true, true, false,
|
||||
UtilEnt.getName(data.GetThrower()), GetName());
|
||||
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null,
|
||||
DamageCause.PROJECTILE, data.getThrown().getVelocity().length() * 4, true, true, false,
|
||||
UtilEnt.getName(data.getThrower()), GetName());
|
||||
|
||||
//Block to Item
|
||||
if (data.GetThrown() instanceof FallingBlock)
|
||||
if (data.getThrown() instanceof FallingBlock)
|
||||
{
|
||||
FallingBlock thrown = (FallingBlock) data.GetThrown();
|
||||
FallingBlock thrown = (FallingBlock) data.getThrown();
|
||||
|
||||
FallingBlock newThrown = data.GetThrown().getWorld().spawnFallingBlock(data.GetThrown().getLocation(), thrown.getMaterial(), (byte)0);
|
||||
FallingBlock newThrown = data.getThrown().getWorld().spawnFallingBlock(data.getThrown().getLocation(), thrown.getMaterial(), (byte)0);
|
||||
|
||||
//Remove Old
|
||||
_falling.remove(thrown);
|
||||
thrown.remove();
|
||||
|
||||
//Add New
|
||||
if (data.GetThrower() instanceof Player)
|
||||
_falling.put(newThrown, (Player)data.GetThrower());
|
||||
if (data.getThrower() instanceof Player)
|
||||
_falling.put(newThrown, (Player)data.getThrower());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -103,9 +103,9 @@ public class PerkSulphurBombEVO extends Perk implements IThrown
|
||||
return;
|
||||
|
||||
//Damage Event
|
||||
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null,
|
||||
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null,
|
||||
DamageCause.PROJECTILE, 5, true, true, false,
|
||||
UtilEnt.getName(data.GetThrower()), GetName());
|
||||
UtilEnt.getName(data.getThrower()), GetName());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -122,10 +122,10 @@ public class PerkSulphurBombEVO extends Perk implements IThrown
|
||||
|
||||
public void Explode(ProjectileUser data)
|
||||
{
|
||||
UtilParticle.PlayParticle(ParticleType.LARGE_EXPLODE, data.GetThrown().getLocation(), 0, 0, 0, 0, 1,
|
||||
UtilParticle.PlayParticle(ParticleType.LARGE_EXPLODE, data.getThrown().getLocation(), 0, 0, 0, 0, 1,
|
||||
ViewDist.MAX, UtilServer.getPlayers());
|
||||
data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.EXPLODE, 1f, 1.5f);
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.EXPLODE, 1f, 1.5f);
|
||||
data.getThrown().remove();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -85,7 +85,7 @@ public class PerkWebEVO extends Perk implements IThrown
|
||||
{
|
||||
if (Manager.GetGame().IsAlive((Player)target))
|
||||
{
|
||||
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null, DamageCause.CUSTOM, 8, false, false, false, "Web Shot", "Webbed Net");
|
||||
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.CUSTOM, 8, false, false, false, "Web Shot", "Webbed Net");
|
||||
target.playEffect(EntityEffect.HURT);
|
||||
}
|
||||
else
|
||||
@ -112,9 +112,9 @@ public class PerkWebEVO extends Perk implements IThrown
|
||||
|
||||
public void Web(ProjectileUser data)
|
||||
{
|
||||
Location loc = data.GetThrown().getLocation();
|
||||
Location loc = data.getThrown().getLocation();
|
||||
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
|
||||
if (loc.getBlock().getType() != Material.AIR)
|
||||
return;
|
||||
|
@ -566,26 +566,26 @@ public class BombLobbers extends TeamGame implements IThrown
|
||||
@Override
|
||||
public void Collide(LivingEntity target, Block block, ProjectileUser data)
|
||||
{
|
||||
if (!(data.GetThrown() instanceof TNTPrimed))
|
||||
if (!(data.getThrown() instanceof TNTPrimed))
|
||||
return;
|
||||
|
||||
if (!(data.GetThrower() instanceof Player))
|
||||
if (!(data.getThrower() instanceof Player))
|
||||
return;
|
||||
|
||||
if (!(target instanceof Player))
|
||||
return;
|
||||
|
||||
if (GetTeam((Player) target) == GetTeam((Player) data.GetThrower()))
|
||||
if (GetTeam((Player) target) == GetTeam((Player) data.getThrower()))
|
||||
return;
|
||||
|
||||
data.GetThrown().setVelocity(new Vector());
|
||||
data.getThrown().setVelocity(new Vector());
|
||||
|
||||
if (target != null)
|
||||
UtilAction.velocity(target, UtilAlg.getTrajectory2d(data.GetThrown().getLocation(), target.getLocation()), .2, false, 0, 0.2, .4, true);
|
||||
UtilAction.velocity(target, UtilAlg.getTrajectory2d(data.getThrown().getLocation(), target.getLocation()), .2, false, 0, 0.2, .4, true);
|
||||
|
||||
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null, DamageCause.PROJECTILE, 10.0, false, false, false, "Throwing TNT", "Throwing TNT Direct Hit");
|
||||
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.PROJECTILE, 10.0, false, false, false, "Throwing TNT", "Throwing TNT Direct Hit");
|
||||
|
||||
AddGems((Player) data.GetThrower(), 4.0, "Direct Hit", true, true);
|
||||
AddGems((Player) data.getThrower(), 4.0, "Direct Hit", true, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -310,18 +310,18 @@ public class Runner extends SoloGame implements IThrown
|
||||
return;
|
||||
}
|
||||
|
||||
if (target.getLocation().getY() > data.GetThrown().getLocation().getY() + 0.5)
|
||||
if (target.getLocation().getY() > data.getThrown().getLocation().getY() + 0.5)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//Damage Event
|
||||
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null,
|
||||
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null,
|
||||
DamageCause.ENTITY_ATTACK, 6, true, true, false,
|
||||
"Falling Block", "Falling Block");
|
||||
|
||||
BlockSmash(data.GetThrown());
|
||||
BlockSmash(data.getThrown());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -173,26 +173,26 @@ public class PerkFishFlurry extends SmashPerk implements IThrown
|
||||
if (target != null)
|
||||
{
|
||||
//Damage Event
|
||||
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null,
|
||||
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null,
|
||||
DamageCause.PROJECTILE, 3, true, true, false,
|
||||
UtilEnt.getName(data.GetThrower()), GetName());
|
||||
UtilEnt.getName(data.getThrower()), GetName());
|
||||
|
||||
UtilParticle.PlayParticle(ParticleType.EXPLODE, target.getLocation().add(0, 1, 0), 1f, 1f, 1f, 0, 12, ViewDist.LONG, UtilServer.getPlayers());
|
||||
}
|
||||
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Idle(ProjectileUser data)
|
||||
{
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Expire(ProjectileUser data)
|
||||
{
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
}
|
||||
|
||||
|
||||
|
@ -170,14 +170,14 @@ public class Stacker extends SoloGame implements IThrown
|
||||
hit = hit.getVehicle();
|
||||
|
||||
//Hit Own Stack > Rethrow
|
||||
if (hit.equals(data.GetThrower()))
|
||||
if (hit.equals(data.getThrower()))
|
||||
{
|
||||
Manager.GetProjectile().AddThrow(data.GetThrown(), data.GetThrower(), this, -1, true, false, true, false, 1f);
|
||||
Manager.GetProjectile().AddThrow(data.getThrown(), data.getThrower(), this, -1, true, false, true, false, 1f);
|
||||
return;
|
||||
}
|
||||
|
||||
//Velocity on base component
|
||||
UtilAction.velocity(hit, UtilAlg.getTrajectory2d(data.GetThrown(), target), 1, true, 0.8, 0, 10, true);
|
||||
UtilAction.velocity(hit, UtilAlg.getTrajectory2d(data.getThrown(), target), 1, true, 0.8, 0, 10, true);
|
||||
|
||||
//Shuffle Up
|
||||
Entity top = target;
|
||||
@ -192,10 +192,10 @@ public class Stacker extends SoloGame implements IThrown
|
||||
rider = rider.getPassenger();
|
||||
}
|
||||
|
||||
UtilPlayer.message(target, F.main("Game", F.name(UtilEnt.getName(data.GetThrower())) + " hit you with " + F.name(UtilEnt.getName(data.GetThrown()))));
|
||||
UtilPlayer.message(target, F.main("Game", F.name(UtilEnt.getName(data.getThrower())) + " hit you with " + F.name(UtilEnt.getName(data.getThrown()))));
|
||||
|
||||
//Effect
|
||||
data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.HURT_FLESH, 1f, 1f);
|
||||
data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.HURT_FLESH, 1f, 1f);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -24,7 +24,7 @@ public class KitBeastmaster extends Kit
|
||||
|
||||
new Perk[]
|
||||
{
|
||||
new PerkWolfPet(30, 1, false, true)
|
||||
new PerkWolfPet(manager, 30, 1, false, true)
|
||||
},
|
||||
EntityType.ZOMBIE,
|
||||
new ItemStack(Material.BONE));
|
||||
|
@ -25,7 +25,7 @@ public class KitHorseman extends Kit
|
||||
|
||||
new Perk[]
|
||||
{
|
||||
new PerkHorsePet()
|
||||
new PerkHorsePet(manager)
|
||||
},
|
||||
EntityType.HORSE,
|
||||
new ItemStack(Material.DIAMOND_BARDING));
|
||||
|
@ -24,7 +24,7 @@ public class KitNecromancer extends Kit
|
||||
|
||||
new Perk[]
|
||||
{
|
||||
new PerkSkeletons(true)
|
||||
new PerkSkeletons(manager, true)
|
||||
},
|
||||
EntityType.ZOMBIE,
|
||||
new ItemStack(Material.SKULL_ITEM));
|
||||
|
@ -67,7 +67,7 @@ public class SpellIcePrison extends Spell implements SpellClick, IThrown
|
||||
@Override
|
||||
public void Collide(LivingEntity target, Block block, ProjectileUser data)
|
||||
{
|
||||
if (target != data.GetThrower())
|
||||
if (target != data.getThrower())
|
||||
{
|
||||
IcePrison(data);
|
||||
}
|
||||
@ -81,11 +81,11 @@ public class SpellIcePrison extends Spell implements SpellClick, IThrown
|
||||
|
||||
public void IcePrison(ProjectileUser data)
|
||||
{
|
||||
Location loc = data.GetThrown().getLocation();
|
||||
data.GetThrown().remove();
|
||||
Location loc = data.getThrown().getLocation();
|
||||
data.getThrown().remove();
|
||||
|
||||
HashMap<Block, Double> blocks = UtilBlock.getInRadius(loc.getBlock(),
|
||||
data.GetThrown().getMetadata("PrisonStrength").get(0).asDouble(), true);
|
||||
data.getThrown().getMetadata("PrisonStrength").get(0).asDouble(), true);
|
||||
|
||||
for (Block block : blocks.keySet())
|
||||
{
|
||||
|
@ -85,7 +85,7 @@ public class SpellIceShards extends Spell implements SpellClick, IThrown
|
||||
// Damage Event
|
||||
Wizards.getArcadeManager()
|
||||
.GetDamage()
|
||||
.NewDamageEvent(target, data.GetThrower(), null, DamageCause.PROJECTILE, 4 /*+ (timesHit * 2)*/, true, true,
|
||||
.NewDamageEvent(target, data.getThrower(), null, DamageCause.PROJECTILE, 4 /*+ (timesHit * 2)*/, true, true,
|
||||
false, "Ice Shard", "Ice Shard");
|
||||
|
||||
}
|
||||
@ -95,8 +95,8 @@ public class SpellIceShards extends Spell implements SpellClick, IThrown
|
||||
|
||||
private void handleShard(ProjectileUser data)
|
||||
{
|
||||
data.GetThrown().remove();
|
||||
Location loc = data.GetThrown().getLocation();
|
||||
data.getThrown().remove();
|
||||
Location loc = data.getThrown().getLocation();
|
||||
|
||||
UtilParticle.PlayParticle(ParticleType.BLOCK_CRACK.getParticle(Material.PACKED_ICE, 0), loc, 0.3F, 0.3F, 0.3F, 0, 12,
|
||||
ViewDist.LONG, UtilServer.getPlayers());
|
||||
@ -118,7 +118,7 @@ public class SpellIceShards extends Spell implements SpellClick, IThrown
|
||||
}
|
||||
}
|
||||
|
||||
_lastParticles.remove(data.GetThrown());
|
||||
_lastParticles.remove(data.getThrown());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -19,7 +19,6 @@ import org.bukkit.Sound;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
|
||||
public class SpellWebShot extends Spell implements SpellClick, IThrown
|
||||
{
|
||||
@ -67,9 +66,9 @@ public class SpellWebShot extends Spell implements SpellClick, IThrown
|
||||
@Override
|
||||
public void Collide(LivingEntity target, Block block, ProjectileUser data)
|
||||
{
|
||||
if (target != data.GetThrower())
|
||||
if (target != data.getThrower())
|
||||
{
|
||||
Location loc = data.GetThrown().getLocation();
|
||||
Location loc = data.getThrown().getLocation();
|
||||
|
||||
if (target != null)
|
||||
{
|
||||
@ -94,7 +93,7 @@ public class SpellWebShot extends Spell implements SpellClick, IThrown
|
||||
// Damage Event
|
||||
/* Wizards.getArcadeManager()
|
||||
.GetDamage()
|
||||
.NewDamageEvent(target, data.GetThrower(), null, DamageCause.PROJECTILE, 2, false, false, false,
|
||||
.NewDamageEvent(target, data.getThrower(), null, DamageCause.PROJECTILE, 2, false, false, false,
|
||||
"Web Shot", "Web Shot");*/
|
||||
}
|
||||
|
||||
@ -149,18 +148,18 @@ public class SpellWebShot extends Spell implements SpellClick, IThrown
|
||||
@Override
|
||||
public void Idle(ProjectileUser data)
|
||||
{
|
||||
Web(data, data.GetThrown().getLocation());
|
||||
Web(data, data.getThrown().getLocation());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Expire(ProjectileUser data)
|
||||
{
|
||||
Web(data, data.GetThrown().getLocation());
|
||||
Web(data, data.getThrown().getLocation());
|
||||
}
|
||||
|
||||
public void Web(ProjectileUser data, Location loc)
|
||||
{
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
|
||||
Block block = getValidLocation(loc);
|
||||
|
||||
|
@ -1,5 +1,8 @@
|
||||
package nautilus.game.arcade.kit.perks;
|
||||
|
||||
import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifier;
|
||||
import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifierType;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.block.Block;
|
||||
@ -21,19 +24,21 @@ import mineplex.core.projectile.ProjectileUser;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
|
||||
public class PerkApple extends Perk implements IThrown
|
||||
{
|
||||
|
||||
public PerkApple(ArcadeManager manager)
|
||||
private final ArcadeManager _manager;
|
||||
|
||||
public PerkApple(ArcadeManager manager)
|
||||
{
|
||||
super("Apple Thrower", new String[]
|
||||
{
|
||||
C.cGray + "Receive 1 Apple every 10 seconds",
|
||||
C.cYellow + "Left-Click" + C.cGray + " with Apple to " + C.cGreen + "Throw Apple",
|
||||
});
|
||||
_manager = manager;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -53,10 +58,10 @@ public class PerkApple extends Perk implements IThrown
|
||||
if (!Manager.GetGame().IsAlive(player))
|
||||
continue;
|
||||
|
||||
if (!Recharge.Instance.use(player, "Apple Spawn", 10000, false, false))
|
||||
if (!Recharge.Instance.use(player, getMessage(player), 10000, false, false))
|
||||
continue;
|
||||
|
||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(260));
|
||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(getMaterial(player)));
|
||||
player.playSound(player.getLocation(), Sound.ITEM_PICKUP, 2f, 1f);
|
||||
}
|
||||
}
|
||||
@ -70,7 +75,7 @@ public class PerkApple extends Perk implements IThrown
|
||||
if (event.getPlayer().getItemInHand() == null)
|
||||
return;
|
||||
|
||||
if (event.getPlayer().getItemInHand().getType() != Material.APPLE)
|
||||
if (event.getPlayer().getItemInHand().getType() != getMaterial(event.getPlayer()))
|
||||
return;
|
||||
|
||||
Player player = event.getPlayer();
|
||||
@ -80,10 +85,10 @@ public class PerkApple extends Perk implements IThrown
|
||||
|
||||
event.setCancelled(true);
|
||||
|
||||
UtilInv.remove(player, Material.APPLE, (byte)0, 1);
|
||||
UtilInv.remove(player, getMaterial(player), (byte)0, 1);
|
||||
UtilInv.Update(player);
|
||||
|
||||
org.bukkit.entity.Item ent = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.APPLE));
|
||||
org.bukkit.entity.Item ent = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(getMaterial(player)));
|
||||
UtilAction.velocity(ent, player.getLocation().getDirection(), 1.2, false, 0, 0.2, 10, false);
|
||||
Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, false, 0.5f);
|
||||
}
|
||||
@ -96,25 +101,25 @@ public class PerkApple extends Perk implements IThrown
|
||||
|
||||
if (target instanceof Player)
|
||||
{
|
||||
if (!Manager.GetGame().IsAlive((Player)target))
|
||||
if (!Manager.GetGame().IsAlive(target))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//Damage Event
|
||||
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null,
|
||||
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null,
|
||||
DamageCause.CUSTOM, 3, true, false, false,
|
||||
UtilEnt.getName(data.GetThrower()), GetName());
|
||||
UtilEnt.getName(data.getThrower()), GetName());
|
||||
|
||||
//Effect
|
||||
data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.CHICKEN_EGG_POP, 1f, 1.6f);
|
||||
data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.CHICKEN_EGG_POP, 1f, 1.6f);
|
||||
|
||||
//Re-Drop
|
||||
if (data.GetThrown() instanceof Item)
|
||||
data.GetThrown().getWorld().dropItem(data.GetThrown().getLocation(), ItemStackFactory.Instance.CreateStack(Material.APPLE)).setPickupDelay(60);
|
||||
if (data.getThrown() instanceof Item && data.getThrown() instanceof Player)
|
||||
data.getThrown().getWorld().dropItem(data.getThrown().getLocation(), ItemStackFactory.Instance.CreateStack(getMaterial((Player) data.getThrower()))).setPickupDelay(60);
|
||||
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -128,4 +133,22 @@ public class PerkApple extends Perk implements IThrown
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private Material getMaterial(Player player)
|
||||
{
|
||||
if (_manager.getCosmeticManager().getGadgetManager().isKitModifierActive(KitModifier.Bridges_Apple_Potato, player))
|
||||
{
|
||||
return Material.POTATO_ITEM;
|
||||
}
|
||||
return Material.APPLE;
|
||||
}
|
||||
|
||||
private String getMessage(Player player)
|
||||
{
|
||||
if (_manager.getCosmeticManager().getGadgetManager().isKitModifierActive(KitModifier.Bridges_Apple_Potato, player))
|
||||
{
|
||||
return "Potato Spawn";
|
||||
}
|
||||
return "Apple Spawn";
|
||||
}
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ public class PerkAxeThrower extends Perk implements IThrown
|
||||
if (!Manager.GetGame().IsAlive((Player)target))
|
||||
return;
|
||||
|
||||
Item item = (Item)data.GetThrown();
|
||||
Item item = (Item)data.getThrown();
|
||||
|
||||
int damage = 4;
|
||||
if (item.getItemStack().getType() == Material.STONE_AXE) damage = 5;
|
||||
@ -82,18 +82,18 @@ public class PerkAxeThrower extends Perk implements IThrown
|
||||
else if (item.getItemStack().getType() == Material.DIAMOND_AXE) damage = 7;
|
||||
|
||||
//Damage Event
|
||||
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null,
|
||||
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null,
|
||||
DamageCause.CUSTOM, damage, true, true, false,
|
||||
UtilEnt.getName(data.GetThrower()), GetName());
|
||||
UtilEnt.getName(data.getThrower()), GetName());
|
||||
|
||||
//Effect
|
||||
data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.ZOMBIE_WOOD, 1f, 1.6f);
|
||||
data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.ZOMBIE_WOOD, 1f, 1.6f);
|
||||
|
||||
//Re-Drop
|
||||
data.GetThrown().getWorld().dropItem(data.GetThrown().getLocation(), ItemStackFactory.Instance.CreateStack(item.getItemStack().getType())).setPickupDelay(60);
|
||||
data.getThrown().getWorld().dropItem(data.getThrown().getLocation(), ItemStackFactory.Instance.CreateStack(item.getItemStack().getType())).setPickupDelay(60);
|
||||
|
||||
//Remove
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -89,9 +89,9 @@ public class PerkBaconBlast extends Perk implements IThrown
|
||||
return;
|
||||
|
||||
//Damage Event
|
||||
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null,
|
||||
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null,
|
||||
DamageCause.PROJECTILE, 6, true, true, false,
|
||||
UtilEnt.getName(data.GetThrower()), GetName());
|
||||
UtilEnt.getName(data.getThrower()), GetName());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -109,8 +109,8 @@ public class PerkBaconBlast extends Perk implements IThrown
|
||||
public void Explode(ProjectileUser data)
|
||||
{
|
||||
// for whatever reason, you can't put a location in createExplosion if you don't want it to break blocks >.>
|
||||
Location loc = data.GetThrown().getLocation();
|
||||
data.GetThrown().getWorld().createExplosion(loc.getX(), loc.getY(), loc.getZ(), 0.5f, false, false);
|
||||
data.GetThrown().remove();
|
||||
Location loc = data.getThrown().getLocation();
|
||||
data.getThrown().getWorld().createExplosion(loc.getX(), loc.getY(), loc.getZ(), 0.5f, false, false);
|
||||
data.getThrown().remove();
|
||||
}
|
||||
}
|
||||
|
@ -66,19 +66,19 @@ public class PerkBlockRestorer extends Perk implements IThrown
|
||||
@Override
|
||||
public void Collide(LivingEntity target, Block block, ProjectileUser data)
|
||||
{
|
||||
restore(data.GetThrown());
|
||||
restore(data.getThrown());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Idle(ProjectileUser data)
|
||||
{
|
||||
restore(data.GetThrown());
|
||||
restore(data.getThrown());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Expire(ProjectileUser data)
|
||||
{
|
||||
restore(data.GetThrown());
|
||||
restore(data.getThrown());
|
||||
}
|
||||
|
||||
public void restore(Entity entity)
|
||||
|
@ -166,24 +166,24 @@ public class PerkBlockToss extends SmashPerk implements IThrown
|
||||
return;
|
||||
|
||||
//Damage Event
|
||||
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null,
|
||||
DamageCause.PROJECTILE, data.GetThrown().getVelocity().length() * 10, true, true, false,
|
||||
UtilEnt.getName(data.GetThrower()), GetName());
|
||||
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null,
|
||||
DamageCause.PROJECTILE, data.getThrown().getVelocity().length() * 10, true, true, false,
|
||||
UtilEnt.getName(data.getThrower()), GetName());
|
||||
|
||||
//Block to Item
|
||||
if (data.GetThrown() instanceof FallingBlock)
|
||||
if (data.getThrown() instanceof FallingBlock)
|
||||
{
|
||||
FallingBlock thrown = (FallingBlock) data.GetThrown();
|
||||
FallingBlock thrown = (FallingBlock) data.getThrown();
|
||||
|
||||
FallingBlock newThrown = data.GetThrown().getWorld().spawnFallingBlock(data.GetThrown().getLocation(), thrown.getMaterial(), (byte)0);
|
||||
FallingBlock newThrown = data.getThrown().getWorld().spawnFallingBlock(data.getThrown().getLocation(), thrown.getMaterial(), (byte)0);
|
||||
|
||||
//Remove Old
|
||||
_falling.remove(thrown);
|
||||
thrown.remove();
|
||||
|
||||
//Add New
|
||||
if (data.GetThrower() instanceof Player)
|
||||
_falling.put(newThrown, (Player)data.GetThrower());
|
||||
if (data.getThrower() instanceof Player)
|
||||
_falling.put(newThrown, (Player)data.getThrower());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -141,12 +141,12 @@ public class PerkBoneRush extends SmashPerk implements IThrown
|
||||
@Override
|
||||
public void Collide(LivingEntity target, Block block, ProjectileUser data)
|
||||
{
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
|
||||
if (target == null)
|
||||
return;
|
||||
|
||||
Player damager = (Player)data.GetThrower();
|
||||
Player damager = (Player)data.getThrower();
|
||||
|
||||
double damage = 0.7;
|
||||
String reason = GetName();
|
||||
@ -158,23 +158,23 @@ public class PerkBoneRush extends SmashPerk implements IThrown
|
||||
}
|
||||
|
||||
//Damage Event
|
||||
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null,
|
||||
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null,
|
||||
DamageCause.CUSTOM, damage, false, true, false,
|
||||
UtilEnt.getName(data.GetThrower()), reason);
|
||||
UtilEnt.getName(data.getThrower()), reason);
|
||||
|
||||
UtilAction.velocity(target, data.GetThrown().getVelocity());
|
||||
UtilAction.velocity(target, data.getThrown().getVelocity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Idle(ProjectileUser data)
|
||||
{
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Expire(ProjectileUser data)
|
||||
{
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -96,9 +96,9 @@ public class PerkCowBomb extends Perk implements IThrown
|
||||
return;
|
||||
|
||||
//Damage Event
|
||||
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null,
|
||||
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null,
|
||||
DamageCause.PROJECTILE, 4, true, true, false,
|
||||
UtilEnt.getName(data.GetThrower()), GetName());
|
||||
UtilEnt.getName(data.getThrower()), GetName());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -116,11 +116,11 @@ public class PerkCowBomb extends Perk implements IThrown
|
||||
public void Explode(ProjectileUser data)
|
||||
{
|
||||
//Effect
|
||||
data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.COW_HURT, 2f, 1.2f);
|
||||
data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.COW_HURT, 2f, 1.2f);
|
||||
data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.COW_HURT, 2f, 1.2f);
|
||||
data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.COW_HURT, 2f, 1.2f);
|
||||
|
||||
data.GetThrown().getWorld().createExplosion(data.GetThrown().getLocation(), 0.5f);
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().getWorld().createExplosion(data.getThrown().getLocation(), 0.5f);
|
||||
data.getThrown().remove();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -27,7 +27,6 @@ import mineplex.core.projectile.ProjectileUser;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
import nautilus.game.arcade.kit.SmashPerk;
|
||||
|
||||
public class PerkCreeperSulphurBomb extends SmashPerk implements IThrown
|
||||
@ -99,9 +98,9 @@ public class PerkCreeperSulphurBomb extends SmashPerk implements IThrown
|
||||
return;
|
||||
|
||||
//Damage Event
|
||||
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null,
|
||||
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null,
|
||||
DamageCause.PROJECTILE, 7, true, true, false,
|
||||
UtilEnt.getName(data.GetThrower()), GetName());
|
||||
UtilEnt.getName(data.getThrower()), GetName());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -118,10 +117,10 @@ public class PerkCreeperSulphurBomb extends SmashPerk implements IThrown
|
||||
|
||||
public void Explode(ProjectileUser data)
|
||||
{
|
||||
UtilParticle.PlayParticle(ParticleType.LARGE_EXPLODE, data.GetThrown().getLocation(), 0, 0, 0, 0, 1,
|
||||
UtilParticle.PlayParticle(ParticleType.LARGE_EXPLODE, data.getThrown().getLocation(), 0, 0, 0, 0, 1,
|
||||
ViewDist.MAX, UtilServer.getPlayers());
|
||||
data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.EXPLODE, 1f, 1.5f);
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.EXPLODE, 1f, 1.5f);
|
||||
data.getThrown().remove();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -130,7 +130,7 @@ public class PerkHammerThrow extends Perk implements IThrown
|
||||
@Override
|
||||
public void Collide(LivingEntity target, Block block, ProjectileUser data)
|
||||
{
|
||||
Rebound(data.GetThrower(), data.GetThrown());
|
||||
Rebound(data.getThrower(), data.getThrown());
|
||||
|
||||
if (target == null)
|
||||
return;
|
||||
@ -140,21 +140,21 @@ public class PerkHammerThrow extends Perk implements IThrown
|
||||
damage = 8;
|
||||
|
||||
//Damage Event
|
||||
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null,
|
||||
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null,
|
||||
DamageCause.LIGHTNING, damage, true, true, false,
|
||||
UtilEnt.getName(data.GetThrower()), GetName());
|
||||
UtilEnt.getName(data.getThrower()), GetName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Idle(ProjectileUser data)
|
||||
{
|
||||
Rebound(data.GetThrower(), data.GetThrown());
|
||||
Rebound(data.getThrower(), data.getThrown());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Expire(ProjectileUser data)
|
||||
{
|
||||
Rebound(data.GetThrower(), data.GetThrown());
|
||||
Rebound(data.getThrower(), data.getThrown());
|
||||
}
|
||||
|
||||
public void Rebound(LivingEntity player, Entity ent)
|
||||
|
@ -3,7 +3,10 @@ package nautilus.game.arcade.kit.perks;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifier;
|
||||
import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifierType;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Entity;
|
||||
@ -31,16 +34,17 @@ import nautilus.game.arcade.kit.Perk;
|
||||
|
||||
public class PerkHorsePet extends Perk
|
||||
{
|
||||
private ArcadeManager _manager;
|
||||
private HashMap<Player, Horse> _horseMap = new HashMap<Player, Horse>();
|
||||
private HashMap<Player, Long> _deathTime = new HashMap<Player, Long>();
|
||||
|
||||
public PerkHorsePet()
|
||||
public PerkHorsePet(ArcadeManager manager)
|
||||
{
|
||||
super("Horse Master", new String[]
|
||||
{
|
||||
C.cGray + "You have a loyal horse companion.",
|
||||
});
|
||||
|
||||
_manager = manager;
|
||||
//Bukkit.getPluginManager().registerEvents(this, Manager.getPlugin());
|
||||
}
|
||||
|
||||
@ -63,7 +67,32 @@ public class PerkHorsePet extends Perk
|
||||
horse.setAgeLock(true);
|
||||
horse.setColor(Color.BROWN);
|
||||
horse.setStyle(Style.NONE);
|
||||
horse.setVariant(Variant.HORSE);
|
||||
KitModifier kitModifier = getHorseType(player);
|
||||
if (kitModifier != null)
|
||||
{
|
||||
switch (getHorseType(player))
|
||||
{
|
||||
case Survival_Games_Horseman_Mule:
|
||||
horse.setVariant(Variant.MULE);
|
||||
break;
|
||||
case Survival_Games_Horseman_Skeleton_Horse:
|
||||
horse.setVariant(Variant.SKELETON_HORSE);
|
||||
break;
|
||||
case Survival_Games_Horseman_Zombie_Horse:
|
||||
horse.setVariant(Variant.UNDEAD_HORSE);
|
||||
break;
|
||||
case Survival_Games_Horseman_Donkey:
|
||||
horse.setVariant(Variant.DONKEY);
|
||||
break;
|
||||
default:
|
||||
horse.setVariant(Variant.HORSE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
horse.setVariant(Variant.HORSE);
|
||||
}
|
||||
horse.setOwner(player);
|
||||
horse.setMaxDomestication(1);
|
||||
horse.setJumpStrength(1);
|
||||
@ -228,4 +257,10 @@ public class PerkHorsePet extends Perk
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private KitModifier getHorseType(Player player)
|
||||
{
|
||||
GadgetManager gadgetManager = _manager.getCosmeticManager().getGadgetManager();
|
||||
return gadgetManager.getActiveKitModifier(KitModifierType.SurvivalGames_HorsemanKit, player);
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
package nautilus.game.arcade.kit.perks;
|
||||
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.block.Block;
|
||||
@ -118,9 +117,9 @@ public class PerkInkBlast extends SmashPerk implements IThrown
|
||||
return;
|
||||
|
||||
//Damage Event
|
||||
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null,
|
||||
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null,
|
||||
DamageCause.PROJECTILE, _damagePerBullet, true, true, false,
|
||||
UtilEnt.getName(data.GetThrower()), GetName());
|
||||
UtilEnt.getName(data.getThrower()), GetName());
|
||||
|
||||
UtilParticle.PlayParticle(ParticleType.EXPLODE, target.getLocation().add(0, 1, 0), 1f, 1f, 1f, 0, 12, ViewDist.LONG, UtilServer.getPlayers());
|
||||
}
|
||||
@ -139,8 +138,8 @@ public class PerkInkBlast extends SmashPerk implements IThrown
|
||||
|
||||
public void Explode(ProjectileUser data)
|
||||
{
|
||||
data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.EXPLODE, 0.75f, 1.25f);
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.EXPLODE, 0.75f, 1.25f);
|
||||
data.getThrown().remove();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -77,13 +77,13 @@ public class PerkIronHook extends Perk implements IThrown
|
||||
public void Collide(LivingEntity target, Block block, ProjectileUser data)
|
||||
{
|
||||
//Remove
|
||||
double velocity = data.GetThrown().getVelocity().length();
|
||||
data.GetThrown().remove();
|
||||
double velocity = data.getThrown().getVelocity().length();
|
||||
data.getThrown().remove();
|
||||
|
||||
if (!(data.GetThrower() instanceof Player))
|
||||
if (!(data.getThrower() instanceof Player))
|
||||
return;
|
||||
|
||||
Player player = (Player)data.GetThrower();
|
||||
Player player = (Player)data.getThrower();
|
||||
|
||||
if (target == null)
|
||||
return;
|
||||
@ -109,14 +109,14 @@ public class PerkIronHook extends Perk implements IThrown
|
||||
public void Idle(ProjectileUser data)
|
||||
{
|
||||
//Remove
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Expire(ProjectileUser data)
|
||||
{
|
||||
//Remove
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -7,22 +7,11 @@ import mineplex.core.common.util.NautHashMap;
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilInv;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilParticle;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.disguise.disguises.DisguiseBase;
|
||||
import mineplex.core.disguise.disguises.DisguiseBlaze;
|
||||
import mineplex.core.disguise.disguises.DisguiseCow;
|
||||
import mineplex.core.disguise.disguises.DisguiseInsentient;
|
||||
import mineplex.core.disguise.disguises.DisguisePig;
|
||||
import mineplex.core.disguise.disguises.DisguisePigZombie;
|
||||
import mineplex.core.disguise.disguises.DisguiseSkeleton;
|
||||
import mineplex.core.disguise.disguises.DisguiseSlime;
|
||||
import mineplex.core.disguise.disguises.DisguiseSpider;
|
||||
import mineplex.core.disguise.disguises.DisguiseZombie;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.core.projectile.IThrown;
|
||||
import mineplex.core.projectile.ProjectileUser;
|
||||
@ -36,7 +25,6 @@ import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Cow;
|
||||
import org.bukkit.entity.Creature;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -185,9 +173,9 @@ public class PerkMadScientist extends Perk implements IThrown
|
||||
|
||||
if (target != null)
|
||||
{
|
||||
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null,
|
||||
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null,
|
||||
DamageCause.CUSTOM, 1.5D, true, false, false,
|
||||
UtilEnt.getName(data.GetThrower()), GetName());
|
||||
UtilEnt.getName(data.getThrower()), GetName());
|
||||
|
||||
}
|
||||
|
||||
@ -210,28 +198,28 @@ public class PerkMadScientist extends Perk implements IThrown
|
||||
|
||||
public void spawnMobs(ProjectileUser data)
|
||||
{
|
||||
data.GetThrown()
|
||||
data.getThrown()
|
||||
.getWorld()
|
||||
.playSound(data.GetThrown().getLocation(), Sound.EXPLODE, 1f,
|
||||
.playSound(data.getThrown().getLocation(), Sound.EXPLODE, 1f,
|
||||
1.6f);
|
||||
|
||||
UtilParticle.PlayParticle(ParticleType.EXPLODE, data.GetThrown()
|
||||
UtilParticle.PlayParticle(ParticleType.EXPLODE, data.getThrown()
|
||||
.getLocation(), 0F, 0F, 0F, 1F, 5, ViewDist.SHORT, UtilServer
|
||||
.getPlayers());
|
||||
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
|
||||
Manager.GetGame().CreatureAllowOverride = true;
|
||||
|
||||
Zombie zombie = (Zombie) data.GetThrown().getWorld()
|
||||
.spawn(data.GetThrown().getLocation(), Zombie.class);
|
||||
Zombie zombie = (Zombie) data.getThrown().getWorld()
|
||||
.spawn(data.getThrown().getLocation(), Zombie.class);
|
||||
zombie.setRemoveWhenFarAway(false);
|
||||
zombie.setMaxHealth(10.0D);
|
||||
zombie.setHealth(10.0D);
|
||||
UtilEnt.silence(zombie, true);
|
||||
|
||||
//Name
|
||||
zombie.setCustomName(C.cAqua + UtilEnt.getName(data.GetThrower()) + "'s Minion");
|
||||
zombie.setCustomName(C.cAqua + UtilEnt.getName(data.getThrower()) + "'s Minion");
|
||||
zombie.setCustomNameVisible(true);
|
||||
|
||||
// double r = Math.random();
|
||||
@ -261,13 +249,13 @@ public class PerkMadScientist extends Perk implements IThrown
|
||||
//
|
||||
// if (disguise instanceof DisguiseInsentient)
|
||||
// {
|
||||
// if (((Player) data.GetThrower()).getName().toLowerCase().endsWith("s"))
|
||||
// if (((Player) data.getThrower()).getName().toLowerCase().endsWith("s"))
|
||||
// {
|
||||
// ((DisguiseInsentient)disguise).setName(C.cAqua + UtilEnt.getName(data.GetThrower()) + "' Minion");
|
||||
// ((DisguiseInsentient)disguise).setName(C.cAqua + UtilEnt.getName(data.getThrower()) + "' Minion");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// ((DisguiseInsentient)disguise).setName(C.cAqua + UtilEnt.getName(data.GetThrower()) + "' Minion");
|
||||
// ((DisguiseInsentient)disguise).setName(C.cAqua + UtilEnt.getName(data.getThrower()) + "' Minion");
|
||||
// }
|
||||
//
|
||||
// ((DisguiseInsentient)disguise).setCustomNameVisible(true);
|
||||
|
@ -104,30 +104,30 @@ public class PerkPigBaconBounce extends SmashPerk implements IThrown
|
||||
@Override
|
||||
public void Collide(LivingEntity target, Block block, ProjectileUser data)
|
||||
{
|
||||
Rebound(data.GetThrower(), data.GetThrown());
|
||||
Rebound(data.getThrower(), data.getThrown());
|
||||
|
||||
if (target == null)
|
||||
return;
|
||||
|
||||
//Damage Event
|
||||
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null,
|
||||
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null,
|
||||
DamageCause.CUSTOM, 4, true, true, false,
|
||||
UtilEnt.getName(data.GetThrower()), GetName());
|
||||
UtilEnt.getName(data.getThrower()), GetName());
|
||||
|
||||
Item item = (Item)data.GetThrown();
|
||||
Item item = (Item)data.getThrown();
|
||||
item.setItemStack(new ItemStack(Material.GRILLED_PORK));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Idle(ProjectileUser data)
|
||||
{
|
||||
Rebound(data.GetThrower(), data.GetThrown());
|
||||
Rebound(data.getThrower(), data.getThrown());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Expire(ProjectileUser data)
|
||||
{
|
||||
Rebound(data.GetThrower(), data.GetThrown());
|
||||
Rebound(data.getThrower(), data.getThrown());
|
||||
}
|
||||
|
||||
public void Rebound(LivingEntity player, Entity ent)
|
||||
|
@ -147,22 +147,22 @@ public class PerkRevealer extends Perk implements IThrown
|
||||
{
|
||||
// Workaround to make firework effect always visible
|
||||
for (int i = 0; i < 3; i++)
|
||||
UtilFirework.playFirework(data.GetThrown().getLocation(), REVEALER_FIREWORK_EFFECT);
|
||||
UtilFirework.playFirework(data.getThrown().getLocation(), REVEALER_FIREWORK_EFFECT);
|
||||
|
||||
data.GetThrown().getLocation().getWorld().playSound(data.GetThrown().getLocation(), Sound.ZOMBIE_UNFECT, 2f, 0.5f);
|
||||
data.getThrown().getLocation().getWorld().playSound(data.getThrown().getLocation(), Sound.ZOMBIE_UNFECT, 2f, 0.5f);
|
||||
|
||||
for (Player player : Manager.GetGame().GetPlayers(true))
|
||||
{
|
||||
if (player == data.GetThrower())
|
||||
if (player == data.getThrower())
|
||||
continue;
|
||||
|
||||
if (player.getLocation().getWorld() == data.GetThrown().getWorld() && player.getLocation().distanceSquared(data.GetThrown().getLocation()) <= 12 * 12)
|
||||
if (player.getLocation().getWorld() == data.getThrown().getWorld() && player.getLocation().distanceSquared(data.getThrown().getLocation()) <= 12 * 12)
|
||||
{
|
||||
RevealedPlayerInfo info = getRevealedPlayers().get(player);
|
||||
|
||||
if (info == null)
|
||||
{
|
||||
Bukkit.getPluginManager().callEvent(new PlayerRevealEvent(player, data.GetThrower()));
|
||||
Bukkit.getPluginManager().callEvent(new PlayerRevealEvent(player, data.getThrower()));
|
||||
|
||||
info = new RevealedPlayerInfo(Manager.GetDisguise().getDisguise(player));
|
||||
getRevealedPlayers().put(player, info);
|
||||
@ -175,7 +175,7 @@ public class PerkRevealer extends Perk implements IThrown
|
||||
}
|
||||
}
|
||||
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
}
|
||||
|
||||
public Map<Player, RevealedPlayerInfo> getRevealedPlayers()
|
||||
|
@ -1,10 +1,15 @@
|
||||
package nautilus.game.arcade.kit.perks;
|
||||
|
||||
import mineplex.core.common.util.*;
|
||||
import mineplex.core.disguise.disguises.DisguiseZombie;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifier;
|
||||
import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifierType;
|
||||
import mineplex.core.updater.*;
|
||||
import mineplex.core.updater.event.*;
|
||||
import mineplex.minecraft.game.core.combat.event.*;
|
||||
import mineplex.minecraft.game.core.damage.*;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.kit.*;
|
||||
import net.minecraft.server.v1_8_R3.*;
|
||||
|
||||
@ -52,18 +57,20 @@ public class PerkSkeletons extends Perk
|
||||
}
|
||||
}
|
||||
|
||||
private ArcadeManager _manager;
|
||||
|
||||
private HashMap<Player, ArrayList<Skeleton>> _minions = new HashMap<Player, ArrayList<Skeleton>>();
|
||||
|
||||
private boolean _name;
|
||||
private int _maxDist = 8;
|
||||
|
||||
public PerkSkeletons(boolean name)
|
||||
public PerkSkeletons(ArcadeManager manager, boolean name)
|
||||
{
|
||||
super("Skeleton Minons", new String[]
|
||||
{
|
||||
C.cGray + "Killing an opponent summons a skeletal minion."
|
||||
});
|
||||
|
||||
_manager = manager;
|
||||
_name = name;
|
||||
}
|
||||
|
||||
@ -112,6 +119,29 @@ public class PerkSkeletons extends Perk
|
||||
skel.getEquipment().setLeggingsDropChance(1f);
|
||||
skel.getEquipment().setBootsDropChance(1f);
|
||||
|
||||
KitModifier kitModifier = getSkeletonType(killer);
|
||||
if (kitModifier != null)
|
||||
{
|
||||
switch (kitModifier)
|
||||
{
|
||||
case Survival_Games_Necromancer_Wither_Skeleton:
|
||||
skel.setSkeletonType(Skeleton.SkeletonType.WITHER);
|
||||
break;
|
||||
case Survival_Games_Necromancer_Zombie:
|
||||
skel.setSkeletonType(Skeleton.SkeletonType.NORMAL);
|
||||
DisguiseZombie disguiseZombie = new DisguiseZombie(skel);
|
||||
_manager.getCosmeticManager().getGadgetManager().getDisguiseManager().disguise(disguiseZombie);
|
||||
break;
|
||||
default:
|
||||
skel.setSkeletonType(Skeleton.SkeletonType.NORMAL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
skel.setSkeletonType(Skeleton.SkeletonType.NORMAL);
|
||||
}
|
||||
|
||||
if (_name)
|
||||
{
|
||||
skel.setCustomName("Skeletal " + UtilEnt.getName(event.GetEvent().getEntity()));
|
||||
@ -119,7 +149,7 @@ public class PerkSkeletons extends Perk
|
||||
}
|
||||
|
||||
if (!_minions.containsKey(killer))
|
||||
_minions.put(killer, new ArrayList<Skeleton>());
|
||||
_minions.put(killer, new ArrayList<>());
|
||||
|
||||
_minions.get(killer).add(skel);
|
||||
|
||||
@ -292,4 +322,10 @@ public class PerkSkeletons extends Perk
|
||||
{
|
||||
return _minions.get(player);
|
||||
}
|
||||
|
||||
private KitModifier getSkeletonType(Player player)
|
||||
{
|
||||
GadgetManager gadgetManager = _manager.getCosmeticManager().getGadgetManager();
|
||||
return gadgetManager.getActiveKitModifier(KitModifierType.SurvivalGames_NecromancerKit, player);
|
||||
}
|
||||
}
|
||||
|
@ -220,15 +220,15 @@ public class PerkSlimeRocket extends SmashPerk implements IThrown
|
||||
if (target == null)
|
||||
return;
|
||||
|
||||
if (!(data.GetThrown() instanceof Slime))
|
||||
if (!(data.getThrown() instanceof Slime))
|
||||
return;
|
||||
|
||||
Slime slime = (Slime)data.GetThrown();
|
||||
Slime slime = (Slime)data.getThrown();
|
||||
|
||||
//Damage Event
|
||||
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null,
|
||||
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null,
|
||||
DamageCause.PROJECTILE, 3 + slime.getSize() * 3, true, true, false,
|
||||
UtilEnt.getName(data.GetThrower()), GetName());
|
||||
UtilEnt.getName(data.getThrower()), GetName());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -136,9 +136,9 @@ public class PerkSquidRifle extends Perk implements IThrown
|
||||
return;
|
||||
|
||||
//Damage Event
|
||||
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null,
|
||||
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null,
|
||||
DamageCause.PROJECTILE, 50, false, true, false,
|
||||
UtilEnt.getName(data.GetThrower()), GetName());
|
||||
UtilEnt.getName(data.getThrower()), GetName());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -155,13 +155,13 @@ public class PerkSquidRifle extends Perk implements IThrown
|
||||
|
||||
public void Explode(ProjectileUser data)
|
||||
{
|
||||
if (!(data.GetThrown() instanceof Firework))
|
||||
if (!(data.getThrown() instanceof Firework))
|
||||
{
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
return;
|
||||
}
|
||||
|
||||
Firework fw = (Firework)data.GetThrown();
|
||||
Firework fw = (Firework)data.getThrown();
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -145,14 +145,14 @@ public class PerkSquidShotgun extends Perk implements IThrown
|
||||
return;
|
||||
|
||||
//Damage Event
|
||||
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null,
|
||||
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null,
|
||||
DamageCause.PROJECTILE, 12, false, true, false,
|
||||
UtilEnt.getName(data.GetThrower()), GetName());
|
||||
UtilEnt.getName(data.getThrower()), GetName());
|
||||
|
||||
//Recharge
|
||||
if (data.GetThrower() instanceof Player)
|
||||
if (data.getThrower() instanceof Player)
|
||||
{
|
||||
Player player = (Player)data.GetThrower();
|
||||
Player player = (Player)data.getThrower();
|
||||
Recharge.Instance.recharge(player, GetName());
|
||||
player.playSound(player.getLocation(), Sound.NOTE_STICKS, 3f, 1f);
|
||||
}
|
||||
@ -172,13 +172,13 @@ public class PerkSquidShotgun extends Perk implements IThrown
|
||||
|
||||
public void Explode(ProjectileUser data)
|
||||
{
|
||||
if (!(data.GetThrown() instanceof Firework))
|
||||
if (!(data.getThrown() instanceof Firework))
|
||||
{
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
return;
|
||||
}
|
||||
|
||||
Firework fw = (Firework)data.GetThrown();
|
||||
Firework fw = (Firework)data.getThrown();
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -136,14 +136,14 @@ public class PerkSquidSniper extends Perk implements IThrown
|
||||
return;
|
||||
|
||||
//Damage Event
|
||||
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null,
|
||||
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null,
|
||||
DamageCause.PROJECTILE, 50, false, true, false,
|
||||
UtilEnt.getName(data.GetThrower()), GetName());
|
||||
UtilEnt.getName(data.getThrower()), GetName());
|
||||
|
||||
//Recharge
|
||||
if (data.GetThrower() instanceof Player)
|
||||
if (data.getThrower() instanceof Player)
|
||||
{
|
||||
Player player = (Player)data.GetThrower();
|
||||
Player player = (Player)data.getThrower();
|
||||
Recharge.Instance.recharge(player, GetName());
|
||||
player.playSound(player.getLocation(), Sound.NOTE_STICKS, 3f, 1f);
|
||||
}
|
||||
@ -163,13 +163,13 @@ public class PerkSquidSniper extends Perk implements IThrown
|
||||
|
||||
public void Explode(ProjectileUser data)
|
||||
{
|
||||
if (!(data.GetThrown() instanceof Firework))
|
||||
if (!(data.getThrown() instanceof Firework))
|
||||
{
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
return;
|
||||
}
|
||||
|
||||
Firework fw = (Firework)data.GetThrown();
|
||||
Firework fw = (Firework)data.getThrown();
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -97,21 +97,21 @@ public class PerkThrower extends Perk implements IThrown
|
||||
}
|
||||
|
||||
//Damage Event
|
||||
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null,
|
||||
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null,
|
||||
DamageCause.CUSTOM, 6, false, true, false,
|
||||
UtilEnt.getName(data.GetThrower()), GetName());
|
||||
UtilEnt.getName(data.getThrower()), GetName());
|
||||
|
||||
//Bounce
|
||||
Vector dir = UtilAlg.getTrajectory(data.GetThrown(), target);
|
||||
Vector dir = UtilAlg.getTrajectory(data.getThrown(), target);
|
||||
if (dir.getY() < 0) dir.setY(0);
|
||||
UtilAction.velocity(target, dir, 1.2, false, 0, 0.4, 1, true);
|
||||
|
||||
dir = UtilAlg.getTrajectory(target, data.GetThrown());
|
||||
dir = UtilAlg.getTrajectory(target, data.getThrown());
|
||||
if (dir.getY() < 0) dir.setY(0);
|
||||
UtilAction.velocity(data.GetThrown(), dir, 0.2, false, 0, 0.2, 1, true);
|
||||
UtilAction.velocity(data.getThrown(), dir, 0.2, false, 0, 0.2, 1, true);
|
||||
|
||||
//Effect
|
||||
data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.SHEEP_IDLE, 3f, 5f);
|
||||
data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.SHEEP_IDLE, 3f, 5f);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -131,8 +131,8 @@ public class PerkWeb extends Perk implements IThrown
|
||||
|
||||
public void Web(ProjectileUser data)
|
||||
{
|
||||
Location loc = data.GetThrown().getLocation();
|
||||
data.GetThrown().remove();
|
||||
Location loc = data.getThrown().getLocation();
|
||||
data.getThrown().remove();
|
||||
|
||||
Manager.GetBlockRestore().add(loc.getBlock(), 30, (byte) 0, 4000);
|
||||
}
|
||||
|
@ -91,14 +91,14 @@ public class PerkWebShot extends SmashPerk implements IThrown
|
||||
{
|
||||
if (target != null)
|
||||
{
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
|
||||
Manager.GetBlockRestore().add(target.getLocation().getBlock(), 30, (byte) 0, 3000);
|
||||
|
||||
//Damage Event
|
||||
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null,
|
||||
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null,
|
||||
DamageCause.PROJECTILE, 6, false, false, false,
|
||||
UtilEnt.getName(data.GetThrower()), GetName());
|
||||
UtilEnt.getName(data.getThrower()), GetName());
|
||||
|
||||
UtilAction.zeroVelocity(target);
|
||||
|
||||
@ -122,10 +122,10 @@ public class PerkWebShot extends SmashPerk implements IThrown
|
||||
|
||||
public void Web(ProjectileUser data)
|
||||
{
|
||||
Location loc = data.GetThrown().getLocation();
|
||||
data.GetThrown().remove();
|
||||
Location loc = data.getThrown().getLocation();
|
||||
data.getThrown().remove();
|
||||
|
||||
if (data.GetThrown().getTicksLived() > 3)
|
||||
if (data.getThrown().getTicksLived() > 3)
|
||||
Manager.GetBlockRestore().add(loc.getBlock(), 30, (byte) 0, 2000);
|
||||
}
|
||||
}
|
||||
|
@ -98,10 +98,10 @@ public class PerkWitherWeb extends Perk implements IThrown
|
||||
|
||||
public void Web(ProjectileUser data)
|
||||
{
|
||||
Location loc = data.GetThrown().getLocation();
|
||||
data.GetThrown().remove();
|
||||
Location loc = data.getThrown().getLocation();
|
||||
data.getThrown().remove();
|
||||
|
||||
if (data.GetThrown().getTicksLived() > 3)
|
||||
if (data.getThrown().getTicksLived() > 3)
|
||||
Manager.GetBlockRestore().add(loc.getBlock(), 30, (byte) 0, 3000);
|
||||
}
|
||||
}
|
||||
|
@ -4,18 +4,19 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
|
||||
import mineplex.core.disguise.disguises.*;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifier;
|
||||
import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifierType;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.EntityEffect;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftCreature;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftLivingEntity;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftWolf;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Wolf;
|
||||
import org.bukkit.entity.*;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.entity.EntityTargetEvent;
|
||||
@ -30,28 +31,28 @@ import mineplex.core.updater.UpdateType;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
import net.minecraft.server.v1_8_R3.EntityCreature;
|
||||
import net.minecraft.server.v1_8_R3.Navigation;
|
||||
import net.minecraft.server.v1_8_R3.NavigationAbstract;
|
||||
|
||||
public class PerkWolfPet extends Perk
|
||||
{
|
||||
private HashMap<Player, ArrayList<Wolf>> _wolfMap = new HashMap<Player, ArrayList<Wolf>>();
|
||||
private HashMap<Player, ArrayList<Wolf>> _petMap = new HashMap<>();
|
||||
|
||||
private HashMap<Wolf, Long> _tackle = new HashMap<Wolf, Long>();
|
||||
private HashMap<Wolf, Long> _tackle = new HashMap<>();
|
||||
|
||||
private ArcadeManager _manager;
|
||||
private int _spawnRate;
|
||||
private int _max;
|
||||
private boolean _baby;
|
||||
private boolean _name;
|
||||
|
||||
public PerkWolfPet(int spawnRate, int max, boolean baby, boolean name)
|
||||
public PerkWolfPet(ArcadeManager manager, int spawnRate, int max, boolean baby, boolean name)
|
||||
{
|
||||
super("Wolf Master", new String[]
|
||||
{
|
||||
C.cGray + "Spawn 1 Wolf every " + spawnRate + " seconds. Maximum of " + max + ".",
|
||||
C.cYellow + "Right-Click" + C.cGray + " with Sword/Axe to use " + C.cGreen + "Wolf Tackle",
|
||||
});
|
||||
|
||||
_manager = manager;
|
||||
_spawnRate = spawnRate;
|
||||
_max = max;
|
||||
_baby = baby;
|
||||
@ -65,7 +66,7 @@ public class PerkWolfPet extends Perk
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void CubSpawn(UpdateEvent event)
|
||||
public void cubSpawn(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.FAST)
|
||||
return;
|
||||
@ -81,16 +82,14 @@ public class PerkWolfPet extends Perk
|
||||
if (!Recharge.Instance.use(cur, GetName(), _spawnRate*1000, false, false))
|
||||
continue;
|
||||
|
||||
if (!_wolfMap.containsKey(cur))
|
||||
_wolfMap.put(cur, new ArrayList<Wolf>());
|
||||
if (!_petMap.containsKey(cur))
|
||||
_petMap.put(cur, new ArrayList<>());
|
||||
|
||||
if (_wolfMap.get(cur).size() >= _max)
|
||||
if (_petMap.get(cur).size() >= _max)
|
||||
continue;
|
||||
|
||||
Manager.GetGame().CreatureAllowOverride = true;
|
||||
Wolf wolf = cur.getWorld().spawn(cur.getLocation(), Wolf.class);
|
||||
Manager.GetGame().CreatureAllowOverride = false;
|
||||
|
||||
SpigotUtil.setOldOwner_RemoveMeWhenSpigotFixesThis(wolf, cur);
|
||||
wolf.setOwner(cur);
|
||||
wolf.setCollarColor(DyeColor.GREEN);
|
||||
@ -106,33 +105,33 @@ public class PerkWolfPet extends Perk
|
||||
{
|
||||
wolf.setCustomName(cur.getName() + "'s Wolf");
|
||||
}
|
||||
|
||||
|
||||
_wolfMap.get(cur).add(wolf);
|
||||
|
||||
_petMap.get(cur).add(wolf);
|
||||
Manager.GetGame().CreatureAllowOverride = false;
|
||||
cur.playSound(cur.getLocation(), Sound.WOLF_HOWL, 1f, 1f);
|
||||
disguise(wolf, cur);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void CubTargetCancel(EntityTargetEvent event)
|
||||
public void cubTargetCancel(EntityTargetEvent event)
|
||||
{
|
||||
if (!_wolfMap.containsKey(event.getTarget()))
|
||||
if (!_petMap.containsKey(event.getTarget()))
|
||||
return;
|
||||
|
||||
if (_wolfMap.get(event.getTarget()).contains(event.getEntity()))
|
||||
if (_petMap.get(event.getTarget()).contains(event.getEntity()))
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
// Note: Why are there 4 different update event handlers?
|
||||
@EventHandler
|
||||
public void CubUpdate(UpdateEvent event)
|
||||
public void cubUpdate(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.FAST)
|
||||
return;
|
||||
|
||||
for (Player player : _wolfMap.keySet())
|
||||
for (Player player : _petMap.keySet())
|
||||
{
|
||||
Iterator<Wolf> wolfIterator = _wolfMap.get(player).iterator();
|
||||
Iterator<Wolf> wolfIterator = _petMap.get(player).iterator();
|
||||
|
||||
while (wolfIterator.hasNext())
|
||||
{
|
||||
@ -149,7 +148,7 @@ public class PerkWolfPet extends Perk
|
||||
|
||||
if (player.isSneaking())
|
||||
{
|
||||
((CraftWolf)wolf).getHandle().setGoalTarget(null);
|
||||
((CraftWolf) wolf).getHandle().setGoalTarget(null);
|
||||
}
|
||||
|
||||
//Return to Owner
|
||||
@ -167,7 +166,7 @@ public class PerkWolfPet extends Perk
|
||||
speed = 1.4f;
|
||||
|
||||
//Move
|
||||
EntityCreature ec = ((CraftCreature)wolf).getHandle();
|
||||
EntityCreature ec = ((CraftCreature) wolf).getHandle();
|
||||
NavigationAbstract nav = ec.getNavigation();
|
||||
nav.a(target.getX(), target.getY(), target.getZ(), speed);
|
||||
|
||||
@ -178,7 +177,7 @@ public class PerkWolfPet extends Perk
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void CubStrikeTrigger(PlayerInteractEvent event)
|
||||
public void cubStrikeTrigger(PlayerInteractEvent event)
|
||||
{
|
||||
if (event.isCancelled())
|
||||
return;
|
||||
@ -200,7 +199,7 @@ public class PerkWolfPet extends Perk
|
||||
if (!Kit.HasKit(player))
|
||||
return;
|
||||
|
||||
if (!_wolfMap.containsKey(player) || _wolfMap.get(player).isEmpty())
|
||||
if (!_petMap.containsKey(player) || _petMap.get(player).isEmpty())
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Game", "You have no Wolf Cubs."));
|
||||
return;
|
||||
@ -209,7 +208,7 @@ public class PerkWolfPet extends Perk
|
||||
if (!Recharge.Instance.use(player, "Cub Strike", 4000, true, true))
|
||||
return;
|
||||
|
||||
Wolf wolf = _wolfMap.get(player).get(UtilMath.r(_wolfMap.get(player).size()));
|
||||
Wolf wolf = _petMap.get(player).get(UtilMath.r(_petMap.get(player).size()));
|
||||
|
||||
UtilAction.velocity(wolf, player.getLocation().getDirection(), 1.4, false, 0, 0.2, 1.2, true);
|
||||
|
||||
@ -225,7 +224,7 @@ public class PerkWolfPet extends Perk
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void CubStrikeEnd(UpdateEvent event)
|
||||
public void cubStrikeEnd(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.TICK)
|
||||
return;
|
||||
@ -244,7 +243,7 @@ public class PerkWolfPet extends Perk
|
||||
if (other.equals(wolf.getOwner()))
|
||||
continue;
|
||||
|
||||
CubStrikeHit((Player)wolf.getOwner(), other, wolf);
|
||||
cubStrikeHit((Player)wolf.getOwner(), other, wolf);
|
||||
wolfIterator.remove();
|
||||
return;
|
||||
}
|
||||
@ -259,11 +258,11 @@ public class PerkWolfPet extends Perk
|
||||
}
|
||||
}
|
||||
|
||||
public void CubStrikeHit(Player damager, LivingEntity damagee, Wolf wolf)
|
||||
public void cubStrikeHit(Player damager, LivingEntity damagee, Wolf wolf)
|
||||
{
|
||||
//Damage Event
|
||||
((CraftWolf)wolf).getHandle().setGoalTarget(((CraftLivingEntity)damagee).getHandle(), EntityTargetEvent.TargetReason.CUSTOM, false);
|
||||
|
||||
|
||||
//Sound
|
||||
damagee.getWorld().playSound(damagee.getLocation(), Sound.WOLF_BARK, 1.5f, 1.5f);
|
||||
|
||||
@ -276,12 +275,12 @@ public class PerkWolfPet extends Perk
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void CubHeal(UpdateEvent event)
|
||||
public void cubHeal(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.SEC)
|
||||
return;
|
||||
|
||||
for (ArrayList<Wolf> wolves : _wolfMap.values())
|
||||
for (ArrayList<Wolf> wolves : _petMap.values())
|
||||
{
|
||||
for (Wolf wolf : wolves)
|
||||
{
|
||||
@ -292,9 +291,9 @@ public class PerkWolfPet extends Perk
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void PlayerDeath(PlayerDeathEvent event)
|
||||
public void playerDeath(PlayerDeathEvent event)
|
||||
{
|
||||
ArrayList<Wolf> wolves = _wolfMap.remove(event.getEntity());
|
||||
ArrayList<Wolf> wolves = _petMap.remove(event.getEntity());
|
||||
|
||||
if (wolves == null)
|
||||
return;
|
||||
@ -306,9 +305,9 @@ public class PerkWolfPet extends Perk
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void PlayerQuit(PlayerQuitEvent event)
|
||||
public void playerQuit(PlayerQuitEvent event)
|
||||
{
|
||||
ArrayList<Wolf> wolves = _wolfMap.remove(event.getPlayer());
|
||||
ArrayList<Wolf> wolves = _petMap.remove(event.getPlayer());
|
||||
|
||||
if (wolves == null)
|
||||
return;
|
||||
@ -319,9 +318,9 @@ public class PerkWolfPet extends Perk
|
||||
wolves.clear();
|
||||
}
|
||||
|
||||
public boolean IsMinion(Entity ent)
|
||||
public boolean isMinion(Entity ent)
|
||||
{
|
||||
for (ArrayList<Wolf> minions : _wolfMap.values())
|
||||
for (ArrayList<Wolf> minions : _petMap.values())
|
||||
{
|
||||
for (Wolf minion : minions)
|
||||
{
|
||||
@ -336,12 +335,12 @@ public class PerkWolfPet extends Perk
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void Damage(CustomDamageEvent event)
|
||||
public void damage(CustomDamageEvent event)
|
||||
{
|
||||
if (event.GetDamagerEntity(true) == null)
|
||||
return;
|
||||
|
||||
if (!IsMinion(event.GetDamagerEntity(true)))
|
||||
if (!isMinion(event.GetDamagerEntity(true)))
|
||||
return;
|
||||
|
||||
double damage = 3;
|
||||
@ -349,4 +348,47 @@ public class PerkWolfPet extends Perk
|
||||
event.AddMod("Wolf Minion", "Negate", -event.GetDamageInitial(), false);
|
||||
event.AddMod("Wolf Minion", "Damage", damage, false);
|
||||
}
|
||||
|
||||
private void disguise(Entity wolf, Player player)
|
||||
{
|
||||
EntityType entityType = getDisguiseType(player);
|
||||
if (entityType != null)
|
||||
{
|
||||
if (entityType.equals(EntityType.GUARDIAN))
|
||||
{
|
||||
DisguiseGuardian disguiseGuardian = new DisguiseGuardian(wolf);
|
||||
_manager.getCosmeticManager().getGadgetManager().getDisguiseManager().disguise(disguiseGuardian);
|
||||
return;
|
||||
}
|
||||
else if (entityType.equals(EntityType.SQUID))
|
||||
{
|
||||
DisguiseSquid disguiseSquid = new DisguiseSquid(wolf);
|
||||
_manager.getCosmeticManager().getGadgetManager().getDisguiseManager().disguise(disguiseSquid);
|
||||
return;
|
||||
}
|
||||
DisguiseAnimalBase disguiseAnimal = new DisguiseAnimalBase(entityType, wolf);
|
||||
_manager.getCosmeticManager().getGadgetManager().getDisguiseManager().disguise(disguiseAnimal);
|
||||
}
|
||||
}
|
||||
|
||||
private EntityType getDisguiseType(Player player)
|
||||
{
|
||||
GadgetManager gadgetManager = _manager.getCosmeticManager().getGadgetManager();
|
||||
KitModifier kitModifier = gadgetManager.getActiveKitModifier(KitModifierType.SurvivalGames_BeastmasterKit, player);
|
||||
if (kitModifier != null)
|
||||
{
|
||||
switch (kitModifier)
|
||||
{
|
||||
case Survival_Games_Beastmaster_Chicken:
|
||||
return EntityType.CHICKEN;
|
||||
case Survival_Games_Beastmaster_Mini_Guardian:
|
||||
return EntityType.GUARDIAN;
|
||||
case Survival_Games_Beastmaster_Pig:
|
||||
return EntityType.PIG;
|
||||
case Survival_Games_Beastmaster_Squid:
|
||||
return EntityType.SQUID;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -241,27 +241,27 @@ public class PerkWoolBomb extends Perk implements IThrown
|
||||
@Override
|
||||
public void Collide(LivingEntity target, Block block, ProjectileUser data)
|
||||
{
|
||||
solidify(data.GetThrower(), false);
|
||||
solidify(data.getThrower(), false);
|
||||
|
||||
if (target == null)
|
||||
return;
|
||||
|
||||
//Damage Event
|
||||
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null,
|
||||
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null,
|
||||
DamageCause.PROJECTILE, 4, true, true, false,
|
||||
UtilEnt.getName(data.GetThrower()), GetName());
|
||||
UtilEnt.getName(data.getThrower()), GetName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Idle(ProjectileUser data)
|
||||
{
|
||||
solidify(data.GetThrower(), false);
|
||||
solidify(data.getThrower(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Expire(ProjectileUser data)
|
||||
{
|
||||
solidify(data.GetThrower(), false);
|
||||
solidify(data.getThrower(), false);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -133,7 +133,7 @@ public class PerkZombieBile extends SmashPerk implements IThrown
|
||||
@Override
|
||||
public void Collide(LivingEntity target, Block block, ProjectileUser data)
|
||||
{
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
|
||||
if (target == null)
|
||||
return;
|
||||
@ -143,23 +143,23 @@ public class PerkZombieBile extends SmashPerk implements IThrown
|
||||
return;
|
||||
|
||||
//Damage Event
|
||||
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null,
|
||||
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null,
|
||||
DamageCause.CUSTOM, 3, true, false, false,
|
||||
UtilEnt.getName(data.GetThrower()), GetName());
|
||||
UtilEnt.getName(data.getThrower()), GetName());
|
||||
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Idle(ProjectileUser data)
|
||||
{
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Expire(ProjectileUser data)
|
||||
{
|
||||
data.GetThrown().remove();
|
||||
data.getThrown().remove();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -310,7 +310,7 @@ public class GameChatManager implements Listener
|
||||
{
|
||||
if (!_manager.GetGame().GetStats().containsKey(player))
|
||||
{
|
||||
temp.add(new AbstractMap.SimpleEntry<String, String>(C.cGray + "Retrieving stats..", ""));
|
||||
temp.add(new AbstractMap.SimpleEntry<String, String>(C.cGray + "Retrieving stats...", ""));
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user