Sheep Quest update

lowered exp on loss
removed Participation exp
This commit is contained in:
Chiss 2014-11-09 10:06:04 +11:00
parent 403165edf4
commit ad933400b9
5 changed files with 36 additions and 21 deletions

View File

@ -27,6 +27,7 @@ import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerEvent;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.event.player.PlayerItemHeldEvent;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
@ -136,7 +137,7 @@ public class SheepGame extends TeamGame
new String[]
{
C.cYellow + "Right-Click" + C.cGray + " with Saddle to " + C.cGreen + "Grab Sheep",
C.cYellow + "Hold Saddle" + C.cGray + " to " + C.cGreen + "Grab/Hold Sheep",
"Return Sheep to your Team Pen!",
"Most sheep at 5 minutes wins!"
});
@ -397,6 +398,12 @@ public class SheepGame extends TeamGame
{
DropSheep(event.getEntity(), 0);
}
@EventHandler
public void DeathDrop(PlayerItemHeldEvent event)
{
DropSheep(event.getPlayer(), 0);
}
public void DropSheep(Player player, long cooldown)
{
@ -494,20 +501,20 @@ public class SheepGame extends TeamGame
}
}
@EventHandler(priority = EventPriority.LOW)
public void DamageSheepCancel(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
if (event.GetDamagerPlayer(true) != null)
{
if (event.GetDamagerPlayer(true).getPassenger() != null)
{
event.SetCancelled("SQ: Has Passenger");
}
}
}
// @EventHandler(priority = EventPriority.LOW)
// public void DamageSheepCancel(CustomDamageEvent event)
// {
// if (event.IsCancelled())
// return;
//
// if (event.GetDamagerPlayer(true) != null)
// {
// if (event.GetDamagerPlayer(true).getPassenger() != null)
// {
// event.SetCancelled("SQ: Has Passenger");
// }
// }
// }
@EventHandler(priority = EventPriority.LOW)
public void DamagePassOn(CustomDamageEvent event)
@ -549,7 +556,7 @@ public class SheepGame extends TeamGame
Player player = event.GetDamageePlayer();
if (player == null) return;
DropSheep(player, 2000);
DropSheep(player, 1000);
Bukkit.getPluginManager().callEvent(new DropEnemySheepEvent(event.GetDamagerPlayer(true), player));
}

View File

@ -47,7 +47,7 @@ public class KitArcher extends Kit
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.WOOD_SWORD));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BOW));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.SADDLE, (byte)0, 1,
C.cYellow + C.Bold + "Move Near Sheep" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Pick Up Sheep"));
C.cYellow + C.Bold + "Hold This" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Grab/Hold Sheep"));
}
@Override

View File

@ -38,7 +38,7 @@ public class KitBeserker extends Kit
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.SADDLE, (byte)0, 1,
C.cYellow + C.Bold + "Move Near Sheep" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Pick Up Sheep"));
C.cYellow + C.Bold + "Hold This" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Grab/Hold Sheep"));
}
@Override

View File

@ -39,7 +39,7 @@ public class KitBrute extends Kit
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.SADDLE, (byte)0, 1,
C.cYellow + C.Bold + "Move Near Sheep" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Pick Up Sheep"));
C.cYellow + C.Bold + "Hold This" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Grab/Hold Sheep"));
}
@Override

View File

@ -42,8 +42,16 @@ public class ExperienceStatTracker extends StatTracker<Game>
{
//Tally Gems
double gems = 0;
for (GemData gem : event.GetGame().GetGems(player).values())
for (String reason : event.GetGame().GetGems(player).keySet())
{
if (reason.toLowerCase().contains("participation"))
continue;
GemData gem = event.GetGame().GetGems(player).get(reason);
gems += (int)gem.Gems;
}
gems = Math.min(gems, 250);
//Game Time
@ -52,7 +60,7 @@ public class ExperienceStatTracker extends StatTracker<Game>
//Mult
double mult = 1;
if (!winners.contains(player))
mult = 0.5;
mult = 0.25;
//Exp
int expGained = (int)(time*gems*mult);