コード例 #1
0
ファイル: Game.java プロジェクト: BenLoe/SuperSpleef
 public static void Win(Player p) {
   Game.gs = GameState.WIN;
   sendToAllPlus("§b✦§a-----------------------§b✦");
   sendToAllPlus("");
   sendToAllPlus("  §a§lWinner:");
   if (p == null) {
     sendToAllPlus("  §eWell... no-one won.");
   } else {
     sendToAllPlus("  §l" + p.getName());
   }
   sendToAllPlus("");
   sendToAllPlus("§b✦§a-----------------------§b✦");
   if (p != null) {
     int needed = 0;
     if (LetterType.getPlayerLetter(p) == LetterType.A) {
       needed = 2000;
     } else {
       needed = LetterType.getPlayerLetter(p).getNeeded().getMoney();
     }
     int amount = Math.round(needed / 30);
     p.sendMessage(ChatColor.GREEN + "+" + amount + "$");
     MoneyAPI.addMoney(p, amount);
     Stats.getStats(p).addWins(1).addGamesPlayed(1);
   }
 }
コード例 #2
0
ファイル: Game.java プロジェクト: BenLoe/SuperSpleef
 public static void Die(Player p) {
   sendToAllPlus(
       Game.tag
           + "§c"
           + p.getName()
           + " §ehas fallen and burned to death. §c"
           + (Game.ingame.size() - 1)
           + " §eplayers remain.");
   Game.ingame.remove(p.getName());
   p.teleport(getLocation("Lobby"));
   SpeedTrait.setCorrectSpeed(p);
   p.getInventory().clear();
   p.getInventory().clear();
   p.getInventory().setBoots(null);
   p.getInventory().setLeggings(null);
   p.getInventory().setChestplate(null);
   p.getInventory().setHelmet(null);
   p.updateInventory();
   p.getInventory().setContents(Game.invs.get(p.getName()));
   p.getInventory().setArmorContents(Game.armors.get(p.getName()));
   p.updateInventory();
   Stats.getStats(p).addGamesPlayed(1);
   for (String s : Game.ingame) {
     Player p1 = Bukkit.getPlayer(s);
     int needed = 0;
     if (LetterType.getPlayerLetter(p1) == LetterType.A) {
       needed = 2000;
     } else {
       needed = LetterType.getPlayerLetter(p1).getNeeded().getMoney();
     }
     int amount = Math.round(needed / 70);
     p1.sendMessage(ChatColor.GREEN + "+" + amount + "$");
     MoneyAPI.addMoney(p1, amount);
   }
   if (Bomber.ultimate.contains(p.getName())) {
     Bomber.ultimate.remove(p.getName());
   }
   if (!Game.watching.contains(p.getName())) {
     Game.watching.add(p.getName());
   }
 }