Added some more Nano achievements

This commit is contained in:
Sam 2018-09-14 20:08:24 +01:00 committed by Alexander Meech
parent bd3b9ffc07
commit 4372854775
10 changed files with 63 additions and 16 deletions

View File

@ -1470,7 +1470,7 @@ public enum Achievement
NANO_WINNER("Nano Winner", 0,
new String[]{"Nano Games.Wins"},
new String[]{"Win Nano Games"},
new int[][] {new int[] {100,0,1000}, new int[] {0,0,5000}, new int[]{0,0,10000}, new int[]{0,0,25000}, new int[]{0,0,50000}},
new int[][] {new int[] {0,0,1000}, new int[] {0,0,5000}, new int[]{0,0,10000}, new int[]{0,0,25000}, new int[]{0,0,50000}},
new int[]{2,10,50,100,500},
"I",
new String[] {"II","III","IV","V","X"},
@ -1500,6 +1500,33 @@ public enum Achievement
new int[]{1},
AchievementCategory.NANO_GAMES),
NANO_SHARE_FIRST("Best Friends", 500,
new String[]{"Nano Games.ShareFirst"},
new String[]{"Share first place with at least", "one other player"},
new int[]{1},
AchievementCategory.NANO_GAMES),
NANO_COPY_CAT_LEVEL("Copy Kitty", 4000,
new String[]{"Nano Games.CopyCatLevel10"},
new String[]{"Reach Level 10 in Copy Cat"},
new int[]{1},
AchievementCategory.NANO_GAMES),
NANO_QUICK_GAMES("QUICK!!!", 0,
new String[]{"Nano Games.QuickWins"},
new String[]{"Complete Quick Challenges"},
new int[][] {new int[] {0,0,1000}, new int[] {0,0,5000}, new int[]{0,0,10000}, new int[]{0,0,25000}, new int[]{0,0,50000}},
new int[]{10,25,50,100,500},
"I",
new String[] {"II","III","IV","V","X"},
AchievementCategory.NANO_GAMES),
NANO_SLIME_TAIL("Not dead yet", 3000,
new String[]{"Nano Games.SlimeCyclesTail"},
new String[]{"Get a trail length of 60 blocks", "in Slime Cycles"},
new int[]{1},
AchievementCategory.NANO_GAMES),
;
private final String _name;

View File

@ -58,11 +58,13 @@ public class NanoFavourite extends MiniDbClientPlugin<List<NanoDisplay>>
return;
}
NanoDisplay display = NanoDisplay.getFromId(resultSet.getInt("gameId"));
int gameId = resultSet.getInt("gameId");
NanoDisplay display = NanoDisplay.getFromId(gameId);
if (display == null)
{
return;
_repository.setFavourite(accountId, gameId, false);
continue;
}
games.add(display);

View File

@ -108,8 +108,6 @@ public class GameStatsComponent extends GameComponent<Game> implements StatsComp
logs.forEach((achievement, log) ->
{
player.sendMessage(achievement.getName() + " - " + log.LevelUp + " " + log.Amount);
AchievementData data = manager.get(player, achievement);
if (log.LevelUp)

View File

@ -71,11 +71,19 @@ public class GeneralStatsTracker extends StatTracker<Game>
int timeInGame = (int) TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis() - _gameStartTime);
allPlayers.forEach(player -> addStat(player, "TimeInGame", timeInGame, true, true));
allPlayers.removeAll(winners);
if (winners != null)
{
// Wins & Losses
winners.forEach(player -> addStat(player, "Wins", 1, true, false));
// Wins & Losses
winners.forEach(player -> addStat(player, "Wins", 1, true, false));
allPlayers.forEach(player -> addStat(player, "Losses", 1, true, false));
if (_game.getTeams().size() > 1 && winners.size() > 1)
{
winners.forEach(player -> addStat(player, "ShareFirst", 1, true, false));
}
allPlayers.removeAll(winners);
allPlayers.forEach(player -> addStat(player, "Losses", 1, true, false));
}
// Second & Third
List<Player> second = placements.getPlayersAtPlace(1), third = placements.getPlayersAtPlace(2);

View File

@ -121,6 +121,11 @@ public class CopyCat extends RoomedSoloGame<SealBreakerRoom>
player.getInventory().clear();
room.Colours.forEach((material, amount) -> player.getInventory().addItem(new ItemStack(material, amount)));
if (room.Level == 10)
{
addStat(player, "CopyCatLevel10", 1, true, false);
}
}
});
}

View File

@ -115,7 +115,10 @@ public class MineKart extends SoloGame implements IPacketHandler
{
super(manager, GameType.MINEKART, new String[]
{
"#BringBackMineKart"
"Control your Kart like a " + C.cYellow + "Boat" + C.Reset + "!",
C.cGreen + "Hold Jump" + C.Reset + " to charge a " + C.cYellow + "Drift" + C.Reset + ".",
C.cYellow + "Release Jump" + C.Reset + " to discharge your " + C.cYellow + "Drift" + C.Reset + ".",
C.cYellow + "3 Laps" + C.Reset + " to win!"
});
_checkpoints = new ArrayList<>();

View File

@ -49,9 +49,8 @@ public class MusicMinecarts extends SoloGame
private Location _center;
private List<Location> _floor;
private double _floorRadiusInitial, _floorRadius;
private double _floorRadius;
private boolean _spawned;
private int _startingPlayers;
public MusicMinecarts(NanoManager manager)
{
@ -107,7 +106,6 @@ public class MusicMinecarts extends SoloGame
_floor.sort((o1, o2) -> Double.compare(UtilMath.offset2dSquared(_center, o2), UtilMath.offset2dSquared(_center, o1)));
_floor.forEach(location -> MapUtil.QuickChangeBlockAt(location, floorType, floorData));
_floorRadius = UtilMath.offset2d(_center, _floor.get(0));
_floorRadiusInitial = _floorRadius;
}
@Override
@ -130,7 +128,6 @@ public class MusicMinecarts extends SoloGame
return;
}
_startingPlayers = getAlivePlayers().size();
runRound(true);
}
@ -235,7 +232,7 @@ public class MusicMinecarts extends SoloGame
private void updateArenaSize()
{
double radius = Math.max(_floorRadiusInitial * ((double) getAlivePlayers().size() / _startingPlayers), 10);
double radius = Math.max(getAlivePlayers().size() * 4, 10);
if (_floorRadius > radius)
{

View File

@ -115,6 +115,8 @@ public abstract class Challenge extends ListenerComponent implements Lifetimed,
player.sendMessage(F.main(_game.getManager().getName(), "You completed the challenge."));
_game.incrementScore(player, 1);
_game.addStat(player, "QuickWins", 1, false, false);
if (out)
{
_game.onOut(player, true);

View File

@ -153,6 +153,11 @@ public class SlimeCycles extends SoloGame
}
_trailSize++;
if (_trailSize == 60)
{
getAlivePlayers().forEach(player -> addStat(player, "SlimeCyclesTail", 1, true, false));
}
}
int getTrailSize()

View File

@ -35,7 +35,7 @@ public class SpellTNT extends Spell
TNTPrimed tnt = location.getWorld().spawn(location, TNTPrimed.class);
tnt.setVelocity(location.getDirection());
tnt.setFuseTicks(10);
tnt.setFuseTicks(20);
_owner.put(tnt, player);
}