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