mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
Player: fixed BloodThrist also counting LostPlayers
also make Ferocious shorter using filterPower
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user