Player: fixed BloodThrist also counting LostPlayers

also make Ferocious shorter using filterPower
This commit is contained in:
Hanmac
2016-08-14 08:51:41 +00:00
parent 1c00fdb204
commit 444b01ce8f

View File

@@ -1902,8 +1902,8 @@ public class Player extends GameEntity implements Comparable<Player> {
} }
public final boolean hasBloodthirst() { public final boolean hasBloodthirst() {
for (Player opp : getOpponents()) { for (Player p : game.getRegisteredPlayers()) {
if (opp.getAssignedDamage() > 0) { if (p.isOpponentOf(this) && p.getAssignedDamage() > 0) {
return true; return true;
} }
} }
@@ -1911,20 +1911,15 @@ public class Player extends GameEntity implements Comparable<Player> {
} }
public boolean hasFerocious() { public boolean hasFerocious() {
final CardCollectionView list = getCreaturesInPlay(); return !CardLists.filterPower(getCreaturesInPlay(), 4).isEmpty();
final CardCollectionView ferocious = CardLists.filter(list, new Predicate<Card>() {
@Override
public boolean apply(final Card c) {
return c.getNetPower() > 3;
}
});
return !ferocious.isEmpty();
} }
public final int getBloodthirstAmount() { public final int getBloodthirstAmount() {
int blood = 0; int blood = 0;
for (Player opp : getOpponents()) { for (Player p : game.getRegisteredPlayers()) {
blood += opp.getAssignedDamage(); if (p.isOpponentOf(this)) {
blood += p.getAssignedDamage();
}
} }
return blood; return blood;
} }