Farmers lose 5 milk when dying.

This commit is contained in:
Chiss 2013-09-15 14:21:10 +10:00
parent 6b5373c20c
commit 6f03c57c22

View File

@ -17,6 +17,7 @@ import org.bukkit.entity.Pig;
import org.bukkit.entity.Player;
import org.bukkit.entity.Villager;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerBucketFillEvent;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.event.player.PlayerItemConsumeEvent;
@ -75,11 +76,13 @@ public class MilkCow extends SoloGame
new String[]
{
"Each Farmer must gather milk.",
"Drink 15 buckets of milk to win!",
"Farmers get 1 point for drinking milk.",
"You lose 5 points for dying!",
"",
"Cow must stop his herd from being milked.",
"Kill all the farmers to win!"
"Cows get 1 point for killing farmers.",
"Defend your herd to stop farmers!",
"",
"First player to 15 points wins!"
});
this.CompassEnabled = true;
@ -330,6 +333,12 @@ public class MilkCow extends SoloGame
this.AddGems(event.getPlayer(), 0.5, "Milk Drunk", true);
}
@EventHandler
public void LoseMilk(PlayerDeathEvent event)
{
SetScore(event.getEntity(), Math.max(0, GetScore(event.getEntity()) - 5));
}
@EventHandler
public void KillFarmer(CombatDeathEvent event)
{