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))
{
double mult = 0.5;
double mult = 0.3;
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))
mult = mult * 1.7;
@ -165,7 +165,7 @@ public class Snake extends SoloGame
loc = tail.getLocation().add(UtilAlg.getTrajectory(tail.getLocation(), loc).multiply(12));
//Move Mult
double moveMult = 1.1;
double moveMult = 1.2;
//Move
EntityCreature ec = ((CraftCreature)tail).getHandle();
@ -205,11 +205,29 @@ public class Snake extends SoloGame
Creature tail = _tail.get(other).get(i);
if (UtilMath.offset(player, tail) < 1.2)
{
KillPlayer(player, other);
done = true;
break;
}
}
if (done)
break;
}
}
}
public void KillPlayer(Player player, Player killer)
{
if (killer != null)
{
//Damage Event
Manager.GetDamage().NewDamageEvent(player, other, null,
Manager.GetDamage().NewDamageEvent(player, killer, null,
DamageCause.CUSTOM, 500, false, true, false,
other.getName(), "Snake Tail");
killer.getName(), "Snake Tail");
}
if (_tail.containsKey(player))
{
@ -221,17 +239,6 @@ public class Snake extends SoloGame
_tail.get(player).clear();
}
done = true;
break;
}
}
if (done)
break;
}
}
}
@EventHandler
@ -334,6 +341,17 @@ public class Snake extends SoloGame
@EventHandler
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)
event.SetCancelled("Snake Damage");
}

View File

@ -108,7 +108,7 @@ public class UHC extends TeamGame
new String[] {
"20 minutes of no PvP",
"Borders at -1000 and 1000",
"Borders at -1250 and 1250",
"No default health regeneration",
"Last player/team alive wins!"
});
@ -138,12 +138,12 @@ public class UHC extends TeamGame
this.DeathMessages = false;
this.IdleKick = false;
this.AutoStart = false;
this.SoupEnabled = false;
this.IdleKick = true;
this.AutoStart = true;
this.CompassEnabled = true;
CraftRecipes();
///_listHealth = this.GetScoreboard().registerNewObjective("Health", "health");
@ -406,7 +406,7 @@ public class UHC extends TeamGame
double dist = 250;
if (_soloGame)
dist = 200;
dist = 80;
//Ensure 250 Blocks between Teams
while (true)
@ -578,6 +578,8 @@ public class UHC extends TeamGame
{
Player player = event.getPlayer();
GameTeam team = GetTeam(player);
if (team == null) return;
@ -592,6 +594,15 @@ public class UHC extends TeamGame
if (player.isDead())
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))
{
//Announcement

View File

@ -172,7 +172,7 @@ public class GameGemManager implements Listener
if (amount > 0)
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);