mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
implement [MH3] Shilgengar, Sire of Famine
This commit is contained in:
parent
a9662ce63f
commit
a63d0d079e
3 changed files with 167 additions and 8 deletions
|
|
@ -9,8 +9,10 @@ import mage.game.Game;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author nantuko
|
||||
* @author nantuko, Susucr
|
||||
*/
|
||||
public class AddCardSubTypeTargetEffect extends ContinuousEffectImpl {
|
||||
|
||||
|
|
@ -28,15 +30,20 @@ public class AddCardSubTypeTargetEffect extends ContinuousEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent target = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
if (target != null) {
|
||||
target.addSubType(game, addedSubType);
|
||||
} else {
|
||||
if (duration == Duration.Custom) {
|
||||
discard();
|
||||
boolean result = false;
|
||||
for (UUID targetId : getTargetPointer().getTargets(game, source)) {
|
||||
Permanent target = game.getPermanent(targetId);
|
||||
if (target != null) {
|
||||
target.addSubType(game, addedSubType);
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
if (!result) {
|
||||
if (this.getDuration() == Duration.Custom) {
|
||||
this.discard();
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue