foul-magics/Mage.Sets/src/mage/cards/b/BarrowBlade.java
Tiago Gil 6a20840f4e
[LTR] Implement Barrow-Blade (#10539)
* [LTR] Implement Barrow-Blade

* Took ideas from Wooden Stake, Humble and Shadowspear
* Play tested effects

* Simpler constructor for equip

* Revamped BlocksOrBlockedAttachedTriggeredAbility

* New logic in `BlocksOrBlockedAttachedTriggeredAbility`
* Changed `Ferocity` and `Gift Of The Woods`
* Removed custom class from `Barrow Blade`

* New class, revert changes in cards

* Added the new class `BlocksOrBlockedByCreatureAttachedTriggeredAbility()`
* Reverted changes to `BlocksOrBlockedAttachedTriggeredAbility()` but including `AttachmentType` in constructor
* Reverted changes to `Ferocity` and `GiftOfTheWoods`
* Changed `Barrow-Blade` to use `BlocksOrBlockedByCreatureAttachedTriggeredAbility()`
* Added a few comments
* Tried optimizing the IF statements in the new class but whenever I tried some condition would stop working, accepting suggestions

* Null check added

* Added a null check for game.getPermanent(sourceId)
* Changed checks to the top to avoid unnecessary processing when encountering any null variable
* Removed unnecessary import
2023-07-02 18:21:17 -04:00

47 lines
No EOL
1.6 KiB
Java

package mage.cards.b;
import java.util.UUID;
import mage.abilities.common.BlocksOrBlockedAttachedTriggeredAbility;
import mage.abilities.common.BlocksOrBlockedByCreatureAttachedTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.continuous.BoostEquippedEffect;
import mage.abilities.effects.common.continuous.LoseAllAbilitiesTargetEffect;
import mage.abilities.keyword.EquipAbility;
import mage.constants.*;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
/**
* @author TiagoMDG
*/
public final class BarrowBlade extends CardImpl {
public BarrowBlade(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}");
this.subtype.add(SubType.EQUIPMENT);
// Equipped creature gets +1/+1.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(1, 1)));
// Whenever equipped creature blocks or becomes blocked by a creature, that creature loses all abilities until end of turn.
this.addAbility(new BlocksOrBlockedByCreatureAttachedTriggeredAbility(
new LoseAllAbilitiesTargetEffect(Duration.EndOfTurn)
.setText("that creature loses all abilities " +
"until end of turn."), AttachmentType.EQUIPMENT, false));
// Equip {1}
this.addAbility(new EquipAbility(1, true));
}
private BarrowBlade(final BarrowBlade card) {
super(card);
}
@Override
public BarrowBlade copy() {
return new BarrowBlade(this);
}
}