mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 05:22:02 -08:00
[VOW] Implemented Spiked Ripsaw
This commit is contained in:
parent
2ed7aff291
commit
902fec22dd
4 changed files with 72 additions and 3 deletions
|
|
@ -8,6 +8,7 @@ import mage.constants.Zone;
|
|||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
|
|
@ -19,6 +20,7 @@ import java.util.Locale;
|
|||
public class AttacksAttachedTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
private AttachmentType attachmentType;
|
||||
private final boolean setTargetPointer;
|
||||
|
||||
public AttacksAttachedTriggeredAbility(Effect effect) {
|
||||
this(effect, false);
|
||||
|
|
@ -29,13 +31,19 @@ public class AttacksAttachedTriggeredAbility extends TriggeredAbilityImpl {
|
|||
}
|
||||
|
||||
public AttacksAttachedTriggeredAbility(Effect effect, AttachmentType attachmentType, boolean optional) {
|
||||
this(effect, attachmentType, optional, false);
|
||||
}
|
||||
|
||||
public AttacksAttachedTriggeredAbility(Effect effect, AttachmentType attachmentType, boolean optional, boolean setTargetPointer) {
|
||||
super(Zone.BATTLEFIELD, effect, optional);
|
||||
this.attachmentType = attachmentType;
|
||||
this.setTargetPointer = setTargetPointer;
|
||||
}
|
||||
|
||||
public AttacksAttachedTriggeredAbility(final AttacksAttachedTriggeredAbility abiltity) {
|
||||
super(abiltity);
|
||||
this.attachmentType = abiltity.attachmentType;
|
||||
this.setTargetPointer = abiltity.setTargetPointer;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -56,7 +64,12 @@ public class AttacksAttachedTriggeredAbility extends TriggeredAbilityImpl {
|
|||
getEffects().setValue("sourceId", event.getSourceId());
|
||||
// TODO: Passing a permanent object like this can cause bugs. May need refactoring to use UUID instead.
|
||||
// See https://github.com/magefree/mage/issues/8377
|
||||
getEffects().setValue("attachedPermanent", game.getPermanent(event.getSourceId()));
|
||||
// 11-08-2021: Added a new constructor to set target pointer. Should probably be using this instead.
|
||||
Permanent attachedPermanent = game.getPermanent(event.getSourceId());
|
||||
getEffects().setValue("attachedPermanent", attachedPermanent);
|
||||
if (setTargetPointer && attachedPermanent != null) {
|
||||
getEffects().setTargetPointer(new FixedTarget(attachedPermanent, game));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue