mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
* Bestow Ability - Fixed that a card cast with Bestow will be recognized as Aura for cost reduction (e.g. Hero of Iroas).
This commit is contained in:
parent
72fabb13ac
commit
68fed320f7
4 changed files with 14 additions and 6 deletions
|
@ -94,10 +94,10 @@ class HornetNestDealDamageEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
int amount = (Integer) getValue("damage");
|
||||
if (amount > 0) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
int amount = (Integer) getValue("damage");
|
||||
if (amount > 0) {
|
||||
return new CreateTokenEffect(new HornetNestInsectToken(), amount).apply(game, source);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ import mage.target.common.TargetCardInYourGraveyard;
|
|||
*/
|
||||
public class LoyalRetainers extends CardImpl {
|
||||
|
||||
private static final FilterCreatureCard filter = new FilterCreatureCard("legendary creature card");
|
||||
private static final FilterCreatureCard filter = new FilterCreatureCard("legendary creature card from your graveyard");
|
||||
|
||||
static {
|
||||
filter.add(new SupertypePredicate("Legendary"));
|
||||
|
|
|
@ -57,7 +57,7 @@ public class DealtDamageToSourceTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) {
|
||||
if (event.getTargetId().equals(this.sourceId)) {
|
||||
if (event.getTargetId().equals(getSourceId())) {
|
||||
for (Effect effect : this.getEffects()) {
|
||||
effect.setValue("damage", event.getAmount());
|
||||
}
|
||||
|
|
|
@ -572,6 +572,14 @@ public class Spell implements StackObject, Card {
|
|||
|
||||
@Override
|
||||
public boolean hasSubtype(String subtype) {
|
||||
if (this.getSpellAbility() instanceof BestowAbility) { // workaround for Bestow (don't like it)
|
||||
List<String> subtypes = new ArrayList<>();
|
||||
subtypes.addAll(card.getSubtype());
|
||||
subtypes.add("Aura");
|
||||
if (subtypes.contains(subtype)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return card.hasSubtype(subtype);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue