Added Spellweaver Volute.

This commit is contained in:
LevelX2 2018-01-02 23:48:07 +01:00
parent bec07fb530
commit bc490ef91a
14 changed files with 835 additions and 353 deletions

View file

@ -94,6 +94,8 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
protected boolean morphCard;
protected boolean allCreatureTypes;
protected List<UUID> attachments = new ArrayList<>();
public CardImpl(UUID ownerId, CardSetInfo setInfo, CardType[] cardTypes, String costs) {
this(ownerId, setInfo, cardTypes, costs, SpellAbilityType.BASE);
}
@ -169,6 +171,7 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
flipCardName = card.flipCardName;
splitCard = card.splitCard;
usesVariousArt = card.usesVariousArt;
this.attachments.addAll(card.attachments);
}
@Override
@ -840,11 +843,53 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
return super.getSubtype(game);
}
@Override
public boolean isAllCreatureTypes() {
return allCreatureTypes;
}
@Override
public void setIsAllCreatureTypes(boolean value) {
allCreatureTypes = value;
}
@Override
public List<UUID> getAttachments() {
return attachments;
}
@Override
public boolean addAttachment(UUID permanentId, Game game) {
if (!this.attachments.contains(permanentId)) {
Permanent attachment = game.getPermanent(permanentId);
if (attachment == null) {
attachment = game.getPermanentEntering(permanentId);
}
if (attachment != null) {
if (!game.replaceEvent(new GameEvent(GameEvent.EventType.ATTACH, objectId, permanentId, attachment.getControllerId()))) {
this.attachments.add(permanentId);
attachment.attachTo(objectId, game);
game.fireEvent(new GameEvent(GameEvent.EventType.ATTACHED, objectId, permanentId, attachment.getControllerId()));
return true;
}
}
}
return false;
}
@Override
public boolean removeAttachment(UUID permanentId, Game game) {
if (this.attachments.contains(permanentId)) {
Permanent attachment = game.getPermanent(permanentId);
if (attachment != null) {
attachment.unattach(game);
}
if (!game.replaceEvent(new GameEvent(GameEvent.EventType.UNATTACH, objectId, permanentId, attachment != null ? attachment.getControllerId() : null))) {
this.attachments.remove(permanentId);
game.fireEvent(new GameEvent(GameEvent.EventType.UNATTACHED, objectId, permanentId, attachment != null ? attachment.getControllerId() : null));
return true;
}
}
return false;
}
}