Decreased the cooldown time for the changeling feed ability

This commit is contained in:
Sollace 2019-02-09 14:26:41 +02:00
parent 259819c7dc
commit 0d837f89da

View file

@ -41,12 +41,12 @@ public class PowerFeed implements IPower<Hit> {
@Override
public int getWarmupTime(IPlayer player) {
return 20;
return 5;
}
@Override
public int getCooldownTime(IPlayer player) {
return 50;
return canFeed(player) ? 15 : 80;
}
@Override
@ -57,7 +57,7 @@ public class PowerFeed implements IPower<Hit> {
@Nullable
@Override
public Hit tryActivate(IPlayer player) {
if (player.getOwner().getHealth() < player.getOwner().getMaxHealth() || player.getOwner().canEat(false)) {
if (canFeed(player)) {
if (!getTargets(player).isEmpty()) {
return new Hit();
}
@ -66,6 +66,10 @@ public class PowerFeed implements IPower<Hit> {
return null;
}
private boolean canFeed(IPlayer player) {
return player.getOwner().getHealth() < player.getOwner().getMaxHealth() || player.getOwner().canEat(false);
}
private boolean canDrain(Entity e) {
return (e instanceof EntityLivingBase)
&& (e instanceof EntityCow