Slime enrage

This commit is contained in:
Shaun Bennett 2015-06-06 15:39:51 -05:00
parent 6ea000fd22
commit 24a1016836
4 changed files with 20 additions and 7 deletions

View File

@ -125,21 +125,26 @@ public class SlimeBoss extends AbstractBoss
}
}
public int getSplitSize(int currSize)
private int getSplitSize(int slimeSize)
{
return currSize / 2;
return slimeSize / 2;
}
public int getSplitCount(int currSize)
private int getSplitCount(int slimeSize)
{
return 4;
}
public double getMaxSlimeHealth(int slimeSize)
private double getMaxSlimeHealth(int slimeSize)
{
return slimeSize * 20;
}
private int getEnrageTicks(int slimeSize)
{
return 20 * slimeSize;
}
private void splitSlime(SlimePart slime)
{
int splitCount = getSplitCount(slime.getSize());
@ -156,7 +161,7 @@ public class SlimeBoss extends AbstractBoss
private SlimePart spawnSlime(Location location, int size)
{
SlimePart slimePart = new SlimePart(this, location, size, getMaxSlimeHealth(size));
SlimePart slimePart = new SlimePart(this, location, size, getMaxSlimeHealth(size), getEnrageTicks(size));
_slimes.add(slimePart);
return slimePart;
}

View File

@ -20,8 +20,9 @@ public class SlimePart
private int _size;
private double _maxHealth;
private int _ticksLived;
private int _enrageTicks;
public SlimePart(SlimeBoss boss, Location location, int size, double maxHealth)
public SlimePart(SlimeBoss boss, Location location, int size, double maxHealth, int enrageTicks)
{
_boss = boss;
_spawnLocation = location;
@ -29,6 +30,7 @@ public class SlimePart
_size = size;
_maxHealth = maxHealth;
_ticksLived = 0;
_enrageTicks = enrageTicks;
spawn(location);
}
@ -71,6 +73,11 @@ public class SlimePart
}
}
if (!_enraged && _ticksLived >= _enrageTicks)
{
setEnraged(true);
}
_currentAbility.tick();
}

View File

@ -147,6 +147,7 @@ public class SlamAbility extends SlimeAbility
if (target != null)
{
_target = target;
_hasTarget = true;
_foundTicks = getTicks();
Bukkit.broadcastMessage("Target placed on " + _target);
}

View File

@ -85,7 +85,7 @@ public class GoldManager extends MiniPlugin
{
event.setCancelled(true);
event.getItem().remove();
event.getPlayer().playSound(event.getPlayer().getEyeLocation(), Sound.ORB_PICKUP, 1F, 1F);
event.getPlayer().playSound(event.getPlayer().getEyeLocation(), Sound.ORB_PICKUP, 1F, 2F);
addGold(event.getPlayer(), 1);
}
}