Prowl: use sharesCreatureTypeWith

This commit is contained in:
Hans Mackowiak
2024-06-20 11:16:26 +02:00
parent 145d4d347f
commit dc02e5e52d
2 changed files with 3 additions and 7 deletions

View File

@@ -2132,12 +2132,8 @@ public class Player extends GameEntity implements Comparable<Player> {
return lost;
}
public final boolean hasProwl(final Set<String> types) {
StringBuilder sb = new StringBuilder();
for (String type : types) {
sb.append("Card.YouCtrl+").append(type).append(",");
}
return !game.getDamageDoneThisTurn(true, true, sb.toString(), "Player", null, this, null).isEmpty();
public final boolean hasProwl(final SpellAbility sa) {
return !game.getDamageDoneThisTurn(true, true, "Card.YouCtrl+sharesCreatureTypeWith", "Player", sa.getHostCard(), this, sa).isEmpty();
}
public final boolean hasFreerunning() {

View File

@@ -440,7 +440,7 @@ public class SpellAbilityRestriction extends SpellAbilityVariables {
}
}
if (sa.isProwl()) {
if (!activator.hasProwl(c.getType().getCreatureTypes())) {
if (!activator.hasProwl(sa)) {
return false;
}
}