mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
[ONE] Implement Blade of Shared Souls
This commit is contained in:
parent
35cf249236
commit
16fe17316e
4 changed files with 195 additions and 17 deletions
|
|
@ -14,7 +14,7 @@ public class AttachedToCreatureSourceTriggeredAbility extends TriggeredAbilityIm
|
|||
|
||||
public AttachedToCreatureSourceTriggeredAbility(Effect effect, boolean optional) {
|
||||
super(Zone.BATTLEFIELD, effect, optional);
|
||||
setTriggerPhrase("As {this} becomes attached to a creature, ");
|
||||
setTriggerPhrase("Whenever {this} becomes attached to a creature, ");
|
||||
}
|
||||
|
||||
public AttachedToCreatureSourceTriggeredAbility(final AttachedToCreatureSourceTriggeredAbility ability) {
|
||||
|
|
@ -23,15 +23,20 @@ public class AttachedToCreatureSourceTriggeredAbility extends TriggeredAbilityIm
|
|||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.ATTACHED
|
||||
&& event.getSourceId() != null
|
||||
&& event.getSourceId().equals(this.getSourceId());
|
||||
return event.getType() == GameEvent.EventType.ATTACHED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (!event.getSourceId().equals(this.getSourceId())) {
|
||||
return false;
|
||||
}
|
||||
Permanent attachedPermanent = game.getPermanent(event.getTargetId());
|
||||
return attachedPermanent != null && attachedPermanent.isCreature(game);
|
||||
if (attachedPermanent == null || !attachedPermanent.isCreature(game)) {
|
||||
return false;
|
||||
}
|
||||
this.getEffects().setValue("attachedPermanent", attachedPermanent);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue