Titles base

This commit is contained in:
Sam 2017-08-12 19:23:07 +01:00
parent 2000d8ee12
commit 4c3a8e267f
8 changed files with 179 additions and 36 deletions

View File

@ -61,9 +61,17 @@ public class GameCosmeticCategoryPage extends GadgetPage
C.cGreen + "Left-Click to view " + category.getCategoryName() + " cosmetics"
);
addButton(slots[index++], builder.build(), (player, clickType) -> getShop().openPageForPlayer(player, category.getGadgetPage(this)));
}
GadgetPage page = category.getGadgetPage(this);
addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[0], 1, false), (player, clickType) -> getShop().openPageForPlayer(getPlayer(), new GameCosmeticsPage(getPlugin(), getShop(), getClientManager(), getDonationManager(), player)));
addButton(slots[index++], builder.build(), (player, clickType) ->
{
if (page != null)
{
getShop().openPageForPlayer(player, page);
}
});
addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[0], 1, false), (player, clickType) -> getShop().openPageForPlayer(getPlayer(), new GameCosmeticsPage(getPlugin(), getShop(), getClientManager(), getDonationManager(), player)));
}
}
}

View File

@ -30,12 +30,16 @@ import mineplex.core.account.CoreClientManager;
import mineplex.core.achievement.AchievementManager;
import mineplex.core.blockrestore.BlockRestore;
import mineplex.core.common.Rank;
import mineplex.core.common.skin.SkinData;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.cosmetic.ui.page.GadgetPage;
import mineplex.core.cosmetic.ui.page.gamemodifiers.GameCosmeticCategoryPage;
import mineplex.core.cosmetic.ui.page.gamemodifiers.moba.HeroSkinCategoryPage;
import mineplex.core.disguise.DisguiseManager;
import mineplex.core.donation.DonationManager;
import mineplex.core.gadget.commands.AmmoCommand;
@ -99,6 +103,7 @@ import mineplex.core.gadget.gadgets.gamemodifiers.GameCosmeticManager;
import mineplex.core.gadget.gadgets.gamemodifiers.GameCosmeticType;
import mineplex.core.gadget.gadgets.gamemodifiers.minestrike.GameModifierMineStrikeSkin;
import mineplex.core.gadget.gadgets.gamemodifiers.minestrike.MineStrikeSkin;
import mineplex.core.gadget.gadgets.gamemodifiers.moba.HeroSkinGadget;
import mineplex.core.gadget.gadgets.gamemodifiers.moba.shopmorph.ShopMorphGadget;
import mineplex.core.gadget.gadgets.gamemodifiers.moba.shopmorph.ShopMorphType;
import mineplex.core.gadget.gadgets.hat.HatItem;
@ -731,21 +736,21 @@ public class GadgetManager extends MiniPlugin
@Override
public void addCategories()
{
// new GameCosmeticCategory(this, "Hero Skins", SkinData.HATTORI.getSkull(), true)
// {
// @Override
// public void addGadgets()
// {
// HeroSkinGadget.getSkins().values().forEach(heroSkins -> heroSkins.forEach(skinData -> addGameGadget(new HeroSkinGadget(getManager(), this, skinData))));
// }
//
// @Override
// public GadgetPage getGadgetPage(GameCosmeticCategoryPage parent)
// {
// return new HeroSkinCategoryPage(parent.getPlugin(), parent.getShop(), parent.getClientManager(), parent.getDonationManager(), getCategoryName(), parent.getClient().GetPlayer(), parent);
// }
// };
new GameCosmeticCategory(this, "Shop Morph", new ItemStack(Material.SKULL_ITEM), false)
new GameCosmeticCategory(this, "Hero Skins", SkinData.HATTORI.getSkull(), true)
{
@Override
public void addGadgets()
{
HeroSkinGadget.getSkins().values().forEach(heroSkins -> heroSkins.forEach(skinData -> addGameGadget(new HeroSkinGadget(getManager(), this, skinData))));
}
@Override
public GadgetPage getGadgetPage(GameCosmeticCategoryPage parent)
{
return new HeroSkinCategoryPage(parent.getPlugin(), parent.getShop(), parent.getClientManager(), parent.getDonationManager(), getCategoryName(), parent.getClient().GetPlayer(), parent);
}
};
new GameCosmeticCategory(this, "Shop Morph", new ItemStack(Material.GOLD_INGOT), false)
{
@Override
public void addGadgets()
@ -756,6 +761,14 @@ public class GadgetManager extends MiniPlugin
}
}
};
new GameCosmeticCategory(this, "Emblems", new ItemStack(Material.NETHER_STAR), false)
{
@Override
public void addGadgets()
{
}
};
}
};
for (GadgetType gadgetType : GadgetType.values())

View File

@ -33,7 +33,7 @@ public enum ShopMorphType
SHEEP("Sheep", Material.SHEARS, DisguiseSheep.class, RewardRarity.UNCOMMON),
COW("Cow", Material.LEATHER, DisguiseCow.class, RewardRarity.UNCOMMON),
MOOSHROOM("Mooshroom", Material.RED_MUSHROOM, DisguiseMooshroom.class, RewardRarity.UNCOMMON),
PIG("Pig", Material.COOKED_BEEF, DisguisePig.class, RewardRarity.UNCOMMON),
PIG("Pig", Material.GRILLED_PORK, DisguisePig.class, RewardRarity.UNCOMMON),
HORSE("Horse", Material.SADDLE, DisguiseHorse.class, RewardRarity.UNCOMMON),
SNOW_GOLEM("Snowman", Material.SNOW_BALL, DisguiseSnowman.class, RewardRarity.UNCOMMON),
IRON_GOLEM("Iron Golem", Material.IRON_BLOCK, DisguiseIronGolem.class, RewardRarity.UNCOMMON),

View File

@ -0,0 +1,62 @@
package mineplex.core.titles.tracks.standard;
import net.md_5.bungee.api.ChatColor;
import mineplex.core.titles.tracks.Track;
import mineplex.core.titles.tracks.TrackFormat;
import mineplex.core.titles.tracks.TrackTier;
public class MobaAssassinWinsTrack extends Track
{
public MobaAssassinWinsTrack()
{
super("hog-assassin-wins", "Assassin", "This track is unlocked by winning as an Assassin in Heroes of GWEN");
getRequirements()
.addTier(new TrackTier(
"Initiate Guardian",
"Kill 100 players in Heroes of GWEN",
this::getStat,
100,
new TrackFormat(ChatColor.GRAY)
))
.addTier(new TrackTier(
"Lieutenant Guardian",
"Kill 250 players in Heroes of GWEN",
this::getStat,
250,
new TrackFormat(ChatColor.LIGHT_PURPLE)
))
.addTier(new TrackTier(
"Captain Guardian",
"Kill 500 players in Heroes of GWEN",
this::getStat,
500,
new TrackFormat(ChatColor.BLUE)
))
.addTier(new TrackTier(
"Noble Guardian",
"Kill 1000 players in Heroes of GWEN",
this::getStat,
1000,
new TrackFormat(ChatColor.GREEN)
))
.addTier(new TrackTier(
"Champion Guardian",
"Kill 5000 players in Heroes of GWEN",
this::getStat,
5000,
new TrackFormat(ChatColor.RED, ChatColor.RED)
));
getRequirements()
.withRequirement(1, "Win as an Assassin in Heroes of GWEN");
}
@Override
public String getStatName()
{
return "Heroes of GWEN.Assassin.Wins";
}
}

View File

@ -0,0 +1,62 @@
package mineplex.core.titles.tracks.standard;
import net.md_5.bungee.api.ChatColor;
import mineplex.core.titles.tracks.Track;
import mineplex.core.titles.tracks.TrackFormat;
import mineplex.core.titles.tracks.TrackTier;
public class MobaKillsTrack extends Track
{
public MobaKillsTrack()
{
super("hog-kills", "HOG Killer", "This track is unlocked by killing players in Heroes of GWEN");
getRequirements()
.addTier(new TrackTier(
"Initiate Guardian",
"Kill 100 players in Heroes of GWEN",
this::getStat,
100,
new TrackFormat(ChatColor.GRAY)
))
.addTier(new TrackTier(
"Lieutenant Guardian",
"Kill 250 players in Heroes of GWEN",
this::getStat,
250,
new TrackFormat(ChatColor.LIGHT_PURPLE)
))
.addTier(new TrackTier(
"Captain Guardian",
"Kill 500 players in Heroes of GWEN",
this::getStat,
500,
new TrackFormat(ChatColor.BLUE)
))
.addTier(new TrackTier(
"Noble Guardian",
"Kill 1000 players in Heroes of GWEN",
this::getStat,
1000,
new TrackFormat(ChatColor.GREEN)
))
.addTier(new TrackTier(
"Champion Guardian",
"Kill 5000 players in Heroes of GWEN",
this::getStat,
5000,
new TrackFormat(ChatColor.RED, ChatColor.RED)
));
getRequirements()
.withRequirement(1, "Kill in Heroes of GWEN");
}
@Override
public String getStatName()
{
return "Heroes of GWEN.Kills";
}
}

View File

@ -1,25 +1,25 @@
package nautilus.game.arcade.game.games.moba.gold;
import java.util.HashMap;
import java.util.Map;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerQuitEvent;
import mineplex.core.common.Rank;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.DebugCommand;
import nautilus.game.arcade.game.Game.GameState;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.games.moba.Moba;
import nautilus.game.arcade.game.games.moba.structure.point.CapturePoint;
import nautilus.game.arcade.game.games.moba.structure.point.CapturePointCaptureEvent;
import nautilus.game.arcade.game.games.moba.structure.tower.TowerDestroyEvent;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerQuitEvent;
import java.util.HashMap;
import java.util.Map;
public class GoldManager implements Listener
{
@ -144,7 +144,7 @@ public class GoldManager implements Listener
{
_playerGold.putIfAbsent(player, 0);
_playerGold.put(player, _playerGold.get(player) + amount);
_host.getArcadeManager().GetStatsManager().incrementStat(player, _host.GetName() + ".GoldEarned", amount);
_host.AddStat(player, "GoldEarned", amount, false, false);
if (amount > 20 && reason != null)
{

View File

@ -11,6 +11,7 @@ import org.bukkit.inventory.PlayerInventory;
import com.mojang.authlib.GameProfile;
import mineplex.core.common.Rank;
import mineplex.core.common.skin.SkinData;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilItem;
@ -89,7 +90,7 @@ public class HeroKit extends Kit
public boolean ownsKit(Player player)
{
MobaProgression progression = ((Moba) Manager.GetGame()).getProgression();
return _unlockLevel == 0 || Manager.GetDonation().Get(player).ownsUnknownSalesPackage(progression.getPackageName(this));
return _unlockLevel == 0 || Manager.GetDonation().Get(player).ownsUnknownSalesPackage(progression.getPackageName(this)) || Manager.GetClients().hasRank(player, Rank.MODERATOR);
}
public void setAmmo(ItemStack ammo, long giveTime)
@ -294,7 +295,7 @@ public class HeroKit extends Kit
GameDisplay.MOBA,
"Hero Skins",
gadget -> gadget instanceof HeroSkinGadget &&
((HeroSkinGadget) gadget).getGadgetData().getHero().equals(GetName())
((HeroSkinGadget) gadget).getGadgetData().getHero().equals(GetName())
);
disguise(player, skinGadget == null ? _skin : skinGadget.getGadgetData().getSkinData());

View File

@ -69,7 +69,7 @@ public class MobaShop implements Listener
public MobaShop(Moba host)
{
_host = host;
_entities = new HashMap<>(2);
_entities = new HashMap<>(8);
_roleMenus = new HashMap<>(4);
_upgrades = new HashMap<>();
@ -130,10 +130,7 @@ public class MobaShop implements Listener
return;
}
_entities.forEach((player, npc) ->
{
_host.getArcadeManager().getPacketHandler().removePacketHandler(npc);
});
_entities.forEach((player, npc) -> _host.getArcadeManager().getPacketHandler().removePacketHandler(npc));
}
public void openShop(Player player)