Gem fix, now correctly displays scaled gems.

UHC public changes
Snake fixes.
This commit is contained in:
Chiss 2013-10-13 08:42:49 +11:00
parent c8386bbc40
commit 377f4b0680
3 changed files with 56 additions and 27 deletions

View File

@ -136,10 +136,10 @@ public class Snake extends SoloGame
for (Player player : GetPlayers(true)) for (Player player : GetPlayers(true))
{ {
double mult = 0.5; double mult = 0.3;
if (_tail.containsKey(player)) if (_tail.containsKey(player))
mult += Math.min(0.8, (double)_tail.get(player).size() / _maxSpeed); mult += Math.min(0.9, (double)_tail.get(player).size() / _maxSpeed);
if (_speed.containsKey(player)) if (_speed.containsKey(player))
mult = mult * 1.7; mult = mult * 1.7;
@ -165,7 +165,7 @@ public class Snake extends SoloGame
loc = tail.getLocation().add(UtilAlg.getTrajectory(tail.getLocation(), loc).multiply(12)); loc = tail.getLocation().add(UtilAlg.getTrajectory(tail.getLocation(), loc).multiply(12));
//Move Mult //Move Mult
double moveMult = 1.1; double moveMult = 1.2;
//Move //Move
EntityCreature ec = ((CraftCreature)tail).getHandle(); EntityCreature ec = ((CraftCreature)tail).getHandle();
@ -206,23 +206,8 @@ public class Snake extends SoloGame
if (UtilMath.offset(player, tail) < 1.2) if (UtilMath.offset(player, tail) < 1.2)
{ {
//Damage Event KillPlayer(player, other);
Manager.GetDamage().NewDamageEvent(player, other, null,
DamageCause.CUSTOM, 500, false, true, false,
other.getName(), "Snake Tail");
if (_tail.containsKey(player))
{
for (Creature cur : _tail.get(player))
{
cur.playEffect(EntityEffect.HURT);
cur.remove();
}
_tail.get(player).clear();
}
done = true; done = true;
break; break;
} }
@ -233,6 +218,28 @@ public class Snake extends SoloGame
} }
} }
} }
public void KillPlayer(Player player, Player killer)
{
if (killer != null)
{
//Damage Event
Manager.GetDamage().NewDamageEvent(player, killer, null,
DamageCause.CUSTOM, 500, false, true, false,
killer.getName(), "Snake Tail");
}
if (_tail.containsKey(player))
{
for (Creature cur : _tail.get(player))
{
cur.playEffect(EntityEffect.HURT);
cur.remove();
}
_tail.get(player).clear();
}
}
@EventHandler @EventHandler
public void SpawnFood(UpdateEvent event) public void SpawnFood(UpdateEvent event)
@ -334,6 +341,17 @@ public class Snake extends SoloGame
@EventHandler @EventHandler
public void DamageCancel(CustomDamageEvent event) public void DamageCancel(CustomDamageEvent event)
{ {
if (event.GetCause() == DamageCause.LAVA)
{
if (event.GetDamageePlayer() != null)
KillPlayer(event.GetDamageePlayer(), null);
else
event.AddMod("Lava", "Lava", 5000, false);
return;
}
if (event.GetCause() != DamageCause.CUSTOM) if (event.GetCause() != DamageCause.CUSTOM)
event.SetCancelled("Snake Damage"); event.SetCancelled("Snake Damage");
} }

View File

@ -108,7 +108,7 @@ public class UHC extends TeamGame
new String[] { new String[] {
"20 minutes of no PvP", "20 minutes of no PvP",
"Borders at -1000 and 1000", "Borders at -1250 and 1250",
"No default health regeneration", "No default health regeneration",
"Last player/team alive wins!" "Last player/team alive wins!"
}); });
@ -138,11 +138,11 @@ public class UHC extends TeamGame
this.DeathMessages = false; this.DeathMessages = false;
this.IdleKick = false;
this.AutoStart = false;
this.SoupEnabled = false; this.SoupEnabled = false;
this.IdleKick = true;
this.AutoStart = true;
this.CompassEnabled = true;
CraftRecipes(); CraftRecipes();
@ -406,7 +406,7 @@ public class UHC extends TeamGame
double dist = 250; double dist = 250;
if (_soloGame) if (_soloGame)
dist = 200; dist = 80;
//Ensure 250 Blocks between Teams //Ensure 250 Blocks between Teams
while (true) while (true)
@ -577,7 +577,9 @@ public class UHC extends TeamGame
public void PlayerQuit(PlayerQuitEvent event) public void PlayerQuit(PlayerQuitEvent event)
{ {
Player player = event.getPlayer(); Player player = event.getPlayer();
GameTeam team = GetTeam(player); GameTeam team = GetTeam(player);
if (team == null) return; if (team == null) return;
@ -591,6 +593,15 @@ public class UHC extends TeamGame
if (player.isDead()) if (player.isDead())
return; return;
if (true)
{
//Announcement
Announce(team.GetColor() + C.Bold + player.getName() + " was killed for disconnecting.");
player.damage(5000);
return;
}
if (_combatTime.containsKey(player.getName()) && !UtilTime.elapsed(_combatTime.get(player.getName()), 15000)) if (_combatTime.containsKey(player.getName()) && !UtilTime.elapsed(_combatTime.get(player.getName()), 15000))
{ {

View File

@ -172,7 +172,7 @@ public class GameGemManager implements Listener
if (amount > 0) if (amount > 0)
amountStr = amount + " "; amountStr = amount + " ";
UtilPlayer.message(player, F.elem(C.cGreen + "+" + gemCount + " Gems") + " for " + F.elem(amountStr + type)); UtilPlayer.message(player, F.elem(C.cGreen + "+" + (gemCount * game.GemMultiplier) + " Gems") + " for " + F.elem(amountStr + type));
} }
earnedGems = (int) (earnedGems * game.GemMultiplier); earnedGems = (int) (earnedGems * game.GemMultiplier);