2015-09-25 10:17:20 +02:00
|
|
|
package nautilus.game.arcade.stats;
|
|
|
|
|
|
|
|
import nautilus.game.arcade.game.Game;
|
|
|
|
import nautilus.game.arcade.game.games.common.CaptureTheFlag;
|
2015-10-10 05:15:19 +02:00
|
|
|
import nautilus.game.arcade.game.games.common.ctf_data.CarrierCombatDeathEvent;
|
2015-09-25 10:17:20 +02:00
|
|
|
|
|
|
|
import org.bukkit.event.EventHandler;
|
|
|
|
import org.bukkit.event.EventPriority;
|
|
|
|
|
|
|
|
public class ClutchStatTracker extends StatTracker<CaptureTheFlag>
|
|
|
|
{
|
|
|
|
private final String _stat;
|
|
|
|
|
|
|
|
public ClutchStatTracker(CaptureTheFlag game, String stat)
|
|
|
|
{
|
|
|
|
super(game);
|
|
|
|
_stat = stat;
|
|
|
|
}
|
|
|
|
|
|
|
|
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
|
2015-10-10 05:15:19 +02:00
|
|
|
public void onCombatDeath(CarrierCombatDeathEvent event)
|
2015-09-25 10:17:20 +02:00
|
|
|
{
|
|
|
|
if (getGame().GetState() != Game.GameState.Live)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (!getGame().isSuddenDeath())
|
|
|
|
return;
|
|
|
|
|
2015-10-10 05:15:19 +02:00
|
|
|
addStat(event.GetPlayer(true), getStat(), 1, false, false);
|
2015-09-25 10:17:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public String getStat()
|
|
|
|
{
|
|
|
|
return _stat;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|