Skip to content

Use Predicate for getDamageDoneThisTurn #11014

Description

@Hanmac

These two should probably be rewritten when getDamageDoneThisTurn supports Predicates for the Source and Target

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() {
return !game.getDamageDoneThisTurn(true, true, "Card.Assassin+YouCtrl,Card.IsCommander+YouCtrl", "Player", null, this, null).isEmpty();
}

These two should probably be reworked into Predicates

if (sourceToTarget != null) {
if (validSourceCard != null && !sourceToTarget.getLeft().isValid(validSourceCard.split(","), sourceController, source == null ? sourceToTarget.getLeft() : source, ctb)) {
continue;
}
if (validTargetEntity != null && !sourceToTarget.getRight().isValid(validTargetEntity.split(","), sourceController, source, ctb)) {
continue;
}

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions