mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
CostTap change keyword check to static check
This commit is contained in:
@@ -20,6 +20,7 @@ package forge.game.cost;
|
||||
import forge.game.card.Card;
|
||||
import forge.game.player.Player;
|
||||
import forge.game.spellability.SpellAbility;
|
||||
import forge.game.staticability.StaticAbilityActivateAbilityAsIfHaste;
|
||||
|
||||
/**
|
||||
* The Class CostTap.
|
||||
@@ -61,7 +62,7 @@ public class CostTap extends CostPart {
|
||||
@Override
|
||||
public final boolean canPay(final SpellAbility ability, final Player payer, final boolean effect) {
|
||||
final Card source = ability.getHostCard();
|
||||
return source.isUntapped() && (!source.isSick() || source.hasKeyword("CARDNAME may activate abilities as though it has haste."));
|
||||
return source.isUntapped() && !isAbilitySick(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -74,4 +75,10 @@ public class CostTap extends CostPart {
|
||||
return visitor.visit(this);
|
||||
}
|
||||
|
||||
public boolean isAbilitySick(final Card source) {
|
||||
if (!source.isSick()) {
|
||||
return false;
|
||||
}
|
||||
return !StaticAbilityActivateAbilityAsIfHaste.canActivate(source);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user