made it so games can set another game as its 'kit source' so games can share kit unlocks

This commit is contained in:
Mini-Chiss 2015-08-03 11:38:16 +02:00
parent 8d7b7f8c8b
commit bb2e15c4fd
4 changed files with 18 additions and 7 deletions

View File

@ -41,8 +41,8 @@ public enum GameDisplay
Sheep("Sheep Quest", Material.WOOL, (byte)4, GameCategory.ARCADE, 33),
Smash("Super Smash Mobs", Material.SKULL_ITEM, (byte)4, GameCategory.CLASSICS, 34),
SmashDomination("Super Smash Mobs", Material.SKULL_ITEM, (byte)4, GameCategory.EXTRA, 36),
SmashTeams("Super Smash Mobs", Material.SKULL_ITEM, (byte)4, GameCategory.TEAM_VARIANT, 35),
SmashDomination("Super Smash Mobs Domination", "Super Smash Mobs", Material.SKULL_ITEM, (byte)4, GameCategory.EXTRA, 36),
SmashTeams("Super Smash Mobs Teams", "Super Smash Mobs", Material.SKULL_ITEM, (byte)4, GameCategory.TEAM_VARIANT, 35),
Snake("Snake", Material.WOOL, (byte)0, GameCategory.ARCADE, 37),
SneakyAssassins("Sneaky Assassins", Material.INK_SACK, (byte)0, GameCategory.ARCADE, 38),
SnowFight("Snow Fight", Material.SNOW_BALL, (byte)0, GameCategory.EXTRA, 39),
@ -51,7 +51,7 @@ public enum GameDisplay
SquidShooter("Squid Shooter", Material.FIREWORK_CHARGE, (byte)0, GameCategory.ARCADE, 43),
Stacker("Super Stacker", Material.BOWL, (byte)0, GameCategory.ARCADE, 42),
SurvivalGames("Survival Games", Material.IRON_SWORD, (byte)0, GameCategory.SURVIVAL, 22),
SurvivalGamesTeams("Survival Games", Material.IRON_SWORD, (byte)0, GameCategory.TEAM_VARIANT, 23),
SurvivalGamesTeams("Survival Games Teams", "Survival Games", Material.IRON_SWORD, (byte)0, GameCategory.TEAM_VARIANT, 23),
Tug("Tug of Wool", Material.WHEAT, (byte)0, GameCategory.ARCADE, 44),
TurfWars("Turf Wars", Material.STAINED_CLAY, (byte)14, GameCategory.ARCADE, 45),
UHC("Ultra Hardcore", Material.GOLDEN_APPLE, (byte)0, GameCategory.SURVIVAL, 46),
@ -62,7 +62,7 @@ public enum GameDisplay
Build("Master Builders", Material.WOOD, (byte)0, GameCategory.CLASSICS, 50),
Cards("Craft Against Humanity", Material.MAP, (byte)0, GameCategory.CLASSICS, 51),
Skywars("Skywars", Material.FEATHER, (byte) 0, GameCategory.SURVIVAL, 52),
SkywarsTeams("Skywars", Material.FEATHER, (byte)5, GameCategory.TEAM_VARIANT, 53),
SkywarsTeams("Skywars Teams", "Skywars", Material.FEATHER, (byte)5, GameCategory.TEAM_VARIANT, 53),
Event("Mineplex Event", Material.CAKE, (byte)0, GameCategory.EVENT, 999);
@ -126,4 +126,10 @@ public enum GameDisplay
return null;
}
//May need to actually add this to each game individually, but for now, LobbyName works fine
public String getKitGameName()
{
return _lobbyName;
}
}

View File

@ -219,4 +219,9 @@ public enum GameType
return _display.getGameCategory();
}
public String GetKitGameName()
{
return _display.getKitGameName();
}
}

View File

@ -1065,7 +1065,7 @@ public class GameLobbyManager implements Listener, IPacketHandler
Manager.hasKitsUnlocked(player) || //YouTube
(ent.GetKit().GetAvailability() == KitAvailability.Achievement &&
Manager.GetAchievement().hasCategory(player, ent.GetKit().getAchievementRequirement())) || //Achievement
donor.OwnsUnknownPackage(Manager.GetGame().GetName() + " " + ent.GetKit().GetName()) || //Green
donor.OwnsUnknownPackage(Manager.GetGame().GetType().GetKitGameName() + " " + ent.GetKit().GetName()) || //Green
Manager.GetClients().Get(player).GetRank().Has(Rank.MAPDEV) || //STAFF
donor.OwnsUnknownPackage(Manager.GetServerConfig().ServerType + " ULTRA") || //Single Ultra (Old)
Manager.GetServerConfig().Tournament) //Tournament

View File

@ -334,7 +334,7 @@ public class GamePlayerManager implements Listener
(kit.GetAvailability() == KitAvailability.Achievement && //Achievement
Manager.GetAchievement().hasCategory(player, kit.getAchievementRequirement())) ||
donor.OwnsUnknownPackage(Manager.GetGame().GetName() + " " + kit.GetName()) || //Green
donor.OwnsUnknownPackage(Manager.GetGame().GetType().GetKitGameName() + " " + kit.GetName()) || //Green
Manager.GetClients().Get(player).GetRank().Has(Rank.MAPDEV) || //STAFF
@ -357,7 +357,7 @@ public class GamePlayerManager implements Listener
((CraftPlayer) player).getHandle().playerConnection.sendPacket(new PacketPlayOutEntityMetadata(entity.getEntityId(), ((CraftEntity) entity).getHandle().getDataWatcher(), true));
}
}
}, null, new KitPackage(Manager.GetGame().GetName(), kit), CurrencyType.Gems, player));
}, null, new KitPackage(Manager.GetGame().GetType().GetKitGameName(), kit), CurrencyType.Gems, player));
}
else if (kit.GetAvailability() == KitAvailability.Achievement)
{