Fixed kit purchase in SuperSmashMobs

This commit is contained in:
Jonathan Williams 2013-09-03 12:13:15 -07:00
parent b894aea72a
commit c2ec238af5
12 changed files with 44 additions and 12 deletions

View File

@ -41,7 +41,8 @@ public class KitBlaze extends SmashKit
new PerkFirefly()
},
EntityType.BLAZE,
null);
null,
Material.BLAZE_ROD);
}

View File

@ -35,7 +35,8 @@ public class KitChicken extends SmashKit
},
EntityType.CHICKEN,
null);
null,
Material.EGG);
}

View File

@ -42,7 +42,8 @@ public class KitEnderman extends SmashKit
new PerkBlockToss()
},
EntityType.ENDERMAN,
null);
null,
Material.ENDER_PEARL);
}

View File

@ -33,7 +33,8 @@ public class KitGolem extends SmashKit
},
EntityType.IRON_GOLEM,
null);
null,
Material.IRON_BLOCK);
}
@Override

View File

@ -31,7 +31,8 @@ public class KitKnight extends SmashKit
new PerkDoubleJump("Double Jump", 0.9, 0.9, false),
},
EntityType.HORSE,
null);
null,
Material.IRON_CHESTPLATE);
}
@Override

View File

@ -34,7 +34,8 @@ public class KitSkySquid extends SmashKit
new PerkInkBlast(),
},
EntityType.SQUID,
null);
null,
Material.INK_SACK);
}
@Override

View File

@ -34,7 +34,8 @@ public class KitSlime extends SmashKit
new PerkSlimeRocket(),
},
EntityType.SLIME,
null);
null,
Material.SLIME_BALL);
}
@Override

View File

@ -38,7 +38,8 @@ public class KitSnowman extends SmashKit
new PerkIcePath(),
},
EntityType.SNOWMAN,
null);
null,
Material.SNOW_BALL);
}

View File

@ -34,7 +34,8 @@ public class KitSpider extends SmashKit
new PerkWebShot(),
},
EntityType.SPIDER,
null);
null,
Material.STRING);
}
@Override

View File

@ -9,6 +9,7 @@ import nautilus.game.arcade.ArcadeManager;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
@ -31,7 +32,9 @@ public abstract class Kit implements Listener
protected EntityType _entityType;
protected ItemStack _itemInHand;
public Kit(ArcadeManager manager, String name, KitAvailability kitAvailability, String[] kitDesc, Perk[] kitPerks, EntityType entityType, ItemStack itemInHand)
protected Material _displayItem;
public Kit(ArcadeManager manager, String name, KitAvailability kitAvailability, String[] kitDesc, Perk[] kitPerks, EntityType entityType, ItemStack itemInHand, Material displayItem)
{
Manager = manager;
@ -46,6 +49,12 @@ public abstract class Kit implements Listener
_entityType = entityType;
_itemInHand = itemInHand;
_displayItem = displayItem;
}
public Kit(ArcadeManager manager, String name, KitAvailability kitAvailability, String[] kitDesc, Perk[] kitPerks, EntityType entityType, ItemStack itemInHand)
{
this(manager, name, kitAvailability, kitDesc, kitPerks, entityType, itemInHand, itemInHand.getType());
}
public String GetFormattedName()
@ -163,4 +172,9 @@ public abstract class Kit implements Listener
{
return 2000;
}
public Material getDisplayMaterial()
{
return _displayItem;
}
}

View File

@ -5,6 +5,7 @@ import mineplex.core.common.util.UtilPlayer;
import nautilus.game.arcade.ArcadeFormat;
import nautilus.game.arcade.ArcadeManager;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
@ -19,6 +20,13 @@ public abstract class SmashKit extends Kit
super(manager, name, kitAvailability, kitDesc, kitPerks, entityType, itemInHand);
}
public SmashKit(ArcadeManager manager, String name,
KitAvailability kitAvailability, String[] kitDesc, Perk[] kitPerks,
EntityType entityType, ItemStack itemInHand, Material displayItem)
{
super(manager, name, kitAvailability, kitDesc, kitPerks, entityType, itemInHand, displayItem);
}
public void DisplayDesc(Player player)
{
for (int i=0 ; i<3 ; i++)

View File

@ -1,5 +1,6 @@
package nautilus.game.arcade.shop;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import nautilus.game.arcade.kit.Kit;
@ -10,9 +11,9 @@ public class KitPackage extends SalesPackageBase
{
public KitPackage(String gameName, Kit kit)
{
super(gameName + " " + kit.GetName(), kit.GetItemInHand().getType(), kit.GetDesc());
super(gameName + " " + kit.GetName(), kit.getDisplayMaterial(), kit.GetDesc());
KnownPackage = false;
CurrencyCostMap.put(CurrencyType.Gems, 2000);
CurrencyCostMap.put(CurrencyType.Gems, kit.GetCost());
}
@Override