near final xmas push :D

This commit is contained in:
Chiss 2014-12-11 15:23:01 +11:00
parent 3a8ab0afb0
commit 3af8a90d3b
6 changed files with 63 additions and 12 deletions

Binary file not shown.

View File

@ -32,6 +32,7 @@ import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.packethandler.IPacketHandler;
import mineplex.core.packethandler.PacketInfo;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
@ -391,7 +392,7 @@ public class Christmas extends SoloGame
Announce(C.cRed + C.Bold + "Santa: " + ChatColor.RESET + C.cYellow + string);
//Audio
if (audio != null && UtilTime.elapsed(_santaSayTime, 2000))
if (audio != null && UtilTime.elapsed(_santaSayTime, 1500))
{
_santaSayTime = System.currentTimeMillis();
@ -450,6 +451,8 @@ public class Christmas extends SoloGame
if (_parts.isEmpty() && _part.IsDone())
{
SantaSay("Well done! You've saved Christmas!", ChristmasAudio.END_WIN2);
for (Player player : GetPlayers(false))
{
Manager.GetDonation().PurchaseUnknownSalesPackage(null, player.getName(), player.getUniqueId(), "Christmas Elf", false, 0, true);
@ -640,4 +643,38 @@ public class Christmas extends SoloGame
if (_part != null)
HandlerList.unregisterAll(_part);
}
@EventHandler
public void DamageElf(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
if (event.GetDamagerPlayer(true) == null)
return;
if (event.GetDamageeEntity() instanceof Villager)
{
if (!Recharge.Instance.use(event.GetDamagerPlayer(true), "Elf Hit", 2000, false, false))
return;
event.AddMod("Elf", "Negate", -event.GetDamageInitial(), false);
event.AddMod("Elf", "Add", 4, false);
double r = Math.random();
ChristmasAudio audio = ChristmasAudio.ELF1;
if (r > 0.2) audio = ChristmasAudio.ELF2;
if (r > 0.4) audio = ChristmasAudio.ELF3;
if (r > 0.6) audio = ChristmasAudio.ELF4;
if (r > 0.8) audio = ChristmasAudio.ELF5;
PacketPlayOutNamedSoundEffect packet = new PacketPlayOutNamedSoundEffect(audio.getName(),
event.GetDamageeEntity().getLocation().getBlockX(), event.GetDamageeEntity().getLocation().getBlockY(), event.GetDamageeEntity().getLocation().getBlockZ(),
10f, 1.2F);
for (Player player : UtilServer.getPlayers())
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
}
}
}

View File

@ -2,6 +2,12 @@ package nautilus.game.arcade.game.games.christmas;
public enum ChristmasAudio
{
ELF1("christmas.elf1"),
ELF2("christmas.elf2"),
ELF3("christmas.elf3"),
ELF4("christmas.elf4"),
ELF5("christmas.elf5"),
GENERAL_LETS_GO("christmas.general_lets_go"),
GENERAL_FOLLOW_ME("christmas.general_follow_me"),
GENERAL_WELL_DONE("christmas.general_well_done"),
@ -46,6 +52,7 @@ public enum ChristmasAudio
STAY_ON_WHITE("christmas.color_white"),
END_WIN("christmas.end_win"),
END_WIN2("christmas.end_win2"),
END_LOSE("christmas.end_lose");
private String _name;

View File

@ -35,7 +35,7 @@ public class SnowmanBoss
private ArrayList<SnowmanMinion> _minions;
private IronGolem _heart;
private boolean _sword = false;
private boolean _joke = false;
private boolean _joke = true;
public SnowmanBoss(Christmas host, Location spawn)
{
@ -198,7 +198,7 @@ public class SnowmanBoss
Entity ent = _heart;
while (ent.getVehicle() != null)
{
ent = _heart.getVehicle();
ent = ent.getVehicle();
size++;
}

View File

@ -105,18 +105,25 @@ public abstract class Part implements Listener
SetObjectiveText("Follow Santa", 1);
if (Math.random() > 0.5)
Host.SantaSay("Let's go!", ChristmasAudio.GENERAL_LETS_GO);
else
Host.SantaSay("Follow me!", ChristmasAudio.GENERAL_FOLLOW_ME);
if (!(this instanceof Part5))
{
if (Math.random() > 0.5)
Host.SantaSay("Let's go!", ChristmasAudio.GENERAL_LETS_GO);
else
Host.SantaSay("Follow me!", ChristmasAudio.GENERAL_FOLLOW_ME);
}
return true;
}
else if (!_presentsAnnounce)
{
SetObjectivePresents();
Host.SantaSay("Collect the presents!", ChristmasAudio.GENERAL_COLLECT_PRESENTS);
if (!(this instanceof Part5))
{
Host.SantaSay("Collect the presents!", ChristmasAudio.GENERAL_COLLECT_PRESENTS);
}
_presentsAnnounce = true;
}
}

View File

@ -160,7 +160,7 @@ public class Part5 extends Part
_dialogueDelay = System.currentTimeMillis();
Host.SantaSay("WHO ARE YOU?!", ChristmasAudio.BANTER_C);
}
else if (_c && !_d && UtilTime.elapsed(_dialogueDelay, _delayTime - 1500))
else if (_c && !_d && UtilTime.elapsed(_dialogueDelay, _delayTime - 1800))
{
_d = true;
_dialogueDelay = System.currentTimeMillis();
@ -182,7 +182,7 @@ public class Part5 extends Part
_dialogueDelay = System.currentTimeMillis();
Host.SantaSay("My friends beat you before, they'll do it again!", ChristmasAudio.BANTER_F);
}
else if (_f && !_g && UtilTime.elapsed(_dialogueDelay, _delayTime + 1500))
else if (_f && !_g && UtilTime.elapsed(_dialogueDelay, _delayTime + 500))
{
_g = true;
_dialogueDelay = System.currentTimeMillis();