Some stats fixes
This commit is contained in:
parent
b2b208bdba
commit
4afafe2d51
@ -68,7 +68,9 @@ import nautilus.game.arcade.kit.Kit;
|
||||
import nautilus.game.arcade.kit.NullKit;
|
||||
import nautilus.game.arcade.stats.AssistsStatTracker;
|
||||
import nautilus.game.arcade.stats.BloodThirstyStatTracker;
|
||||
import nautilus.game.arcade.stats.KingDamageStatTracker;
|
||||
import nautilus.game.arcade.stats.KingSlayerStatTracker;
|
||||
import nautilus.game.arcade.stats.WinAsTeamStatTracker;
|
||||
|
||||
public class CastleSiege extends TeamGame
|
||||
{
|
||||
@ -190,10 +192,21 @@ public class CastleSiege extends TeamGame
|
||||
|
||||
_kingName = C.cYellow + C.Bold + "King Sparklez";
|
||||
|
||||
GameTeam notRedTeam = null;
|
||||
for (GameTeam team : GetTeamList())
|
||||
{
|
||||
if (team.GetColor() != ChatColor.RED)
|
||||
{
|
||||
notRedTeam = team;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
registerStatTrackers(
|
||||
new WinAsTeamStatTracker(this, notRedTeam, "ForTheKing"),
|
||||
new KingSlayerStatTracker(this),
|
||||
new BloodThirstyStatTracker(this),
|
||||
new AssistsStatTracker(this)
|
||||
new KingDamageStatTracker(this)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -15,6 +15,7 @@ import nautilus.game.arcade.game.games.common.Domination;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
import nautilus.game.arcade.stats.ElectrocutionStatTracker;
|
||||
import nautilus.game.arcade.stats.SeismicSlamStatTracker;
|
||||
import nautilus.game.arcade.stats.TheLongestShotStatTracker;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@ -56,6 +57,7 @@ public class ChampionsDominate extends Domination
|
||||
|
||||
registerStatTrackers(
|
||||
new ElectrocutionStatTracker(this),
|
||||
new TheLongestShotStatTracker(this),
|
||||
new SeismicSlamStatTracker(this)
|
||||
);
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ import nautilus.game.arcade.kit.Kit;
|
||||
import nautilus.game.arcade.stats.ElectrocutionStatTracker;
|
||||
import nautilus.game.arcade.stats.KillAllOpposingStatTracker;
|
||||
import nautilus.game.arcade.stats.SeismicSlamStatTracker;
|
||||
import nautilus.game.arcade.stats.TheLongestShotStatTracker;
|
||||
import nautilus.game.arcade.stats.WinWithoutLosingTeammateStatTracker;
|
||||
|
||||
public class ChampionsTDM extends TeamDeathmatch
|
||||
@ -48,7 +49,7 @@ public class ChampionsTDM extends TeamDeathmatch
|
||||
"Gold/Iron Weapons deal 6 damage",
|
||||
"Diamond Weapons deal 7 damage",
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
this.Manager.GetDamage().UseSimpleWeaponDamage = false;
|
||||
|
||||
@ -56,6 +57,7 @@ public class ChampionsTDM extends TeamDeathmatch
|
||||
new WinWithoutLosingTeammateStatTracker(this, "FlawlessVictory"),
|
||||
new KillAllOpposingStatTracker(this),
|
||||
new ElectrocutionStatTracker(this),
|
||||
new TheLongestShotStatTracker(this),
|
||||
new SeismicSlamStatTracker(this)
|
||||
);
|
||||
}
|
||||
|
@ -81,6 +81,7 @@ import nautilus.game.arcade.kit.Kit;
|
||||
import nautilus.game.arcade.kit.NullKit;
|
||||
import nautilus.game.arcade.stats.BadHiderStatTracker;
|
||||
import nautilus.game.arcade.stats.HunterKillerStatTracker;
|
||||
import nautilus.game.arcade.stats.HunterOfTheYearStatTracker;
|
||||
import nautilus.game.arcade.stats.MeowStatTracker;
|
||||
|
||||
import net.minecraft.server.v1_7_R4.EntityCreature;
|
||||
@ -213,6 +214,7 @@ public class HideSeek extends TeamGame
|
||||
new HunterKillerStatTracker(this),
|
||||
new MeowStatTracker(this),
|
||||
new HunterKillerStatTracker(this),
|
||||
new HunterOfTheYearStatTracker(this),
|
||||
new BadHiderStatTracker(this)
|
||||
);
|
||||
}
|
||||
|
@ -0,0 +1,43 @@
|
||||
package nautilus.game.arcade.stats;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
|
||||
import nautilus.game.arcade.game.Game;
|
||||
|
||||
public class BackstabKillStatTracker extends StatTracker<Game>
|
||||
{
|
||||
public BackstabKillStatTracker(Game game)
|
||||
{
|
||||
super(game);
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
|
||||
public void onCombatDeath(CombatDeathEvent event)
|
||||
{
|
||||
if (event.GetLog().GetKiller() == null)
|
||||
return;
|
||||
|
||||
if (!event.GetLog().GetKiller().IsPlayer())
|
||||
return;
|
||||
|
||||
Player killer = UtilPlayer.searchExact(event.GetLog().GetKiller().GetName());
|
||||
if (killer == null)
|
||||
return;
|
||||
|
||||
if (event.GetLog().GetPlayer() == null)
|
||||
return;
|
||||
|
||||
if (!event.GetLog().GetPlayer().IsPlayer())
|
||||
return;
|
||||
|
||||
Player player = UtilPlayer.searchExact(event.GetLog().GetPlayer().GetName());
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
if (event.GetLog().GetLastDamager().)
|
||||
}
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package nautilus.game.arcade.stats;
|
||||
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
|
||||
import nautilus.game.arcade.game.Game;
|
||||
|
||||
public class TheLongestShotStatTracker extends StatTracker<Game>
|
||||
{
|
||||
public TheLongestShotStatTracker(Game game)
|
||||
{
|
||||
super(game);
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
|
||||
public void onCombatDeath(CombatDeathEvent event)
|
||||
{
|
||||
if (event.GetLog().GetKiller() == null)
|
||||
return;
|
||||
|
||||
if (!event.GetLog().GetKiller().IsPlayer())
|
||||
return;
|
||||
|
||||
Player killer = UtilPlayer.searchExact(event.GetLog().GetKiller().GetName());
|
||||
if (killer == null)
|
||||
return;
|
||||
|
||||
if (event.GetLog().GetPlayer() == null)
|
||||
return;
|
||||
|
||||
if (!event.GetLog().GetPlayer().IsPlayer())
|
||||
return;
|
||||
|
||||
Player player = UtilPlayer.searchExact(event.GetLog().GetPlayer().GetName());
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
if (player.getLastDamageCause() instanceof EntityDamageByEntityEvent)
|
||||
{
|
||||
EntityDamageByEntityEvent edbee = (EntityDamageByEntityEvent) player.getLastDamageCause();
|
||||
|
||||
if (edbee.getDamager() instanceof Arrow)
|
||||
{
|
||||
Arrow arrow = (Arrow) edbee.getDamager();
|
||||
|
||||
if (arrow.getShooter() == killer && killer.getLocation().distanceSquared(player.getLocation()) <= 64 * 64)
|
||||
getGame().AddStat(killer, "TheLongestShot", 1, false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user