mirror of
https://github.com/correl/mage.git
synced 2024-12-26 19:16:54 +00:00
* Starke of Rath - Fixed cast exception.
This commit is contained in:
parent
ea4af25c77
commit
eb0ad63eca
1 changed files with 6 additions and 9 deletions
|
@ -29,7 +29,6 @@ package mage.cards.s;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.MageObject;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.costs.common.TapSourceCost;
|
import mage.abilities.costs.common.TapSourceCost;
|
||||||
|
@ -63,7 +62,7 @@ public class StarkeOfRath extends CardImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
public StarkeOfRath(UUID ownerId, CardSetInfo setInfo) {
|
public StarkeOfRath(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{R}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}{R}");
|
||||||
addSuperType(SuperType.LEGENDARY);
|
addSuperType(SuperType.LEGENDARY);
|
||||||
this.subtype.add("Human");
|
this.subtype.add("Human");
|
||||||
this.subtype.add("Rogue");
|
this.subtype.add("Rogue");
|
||||||
|
@ -110,13 +109,11 @@ class StarkeOfRathEffect extends OneShotEffect {
|
||||||
Permanent targetPermanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
Permanent targetPermanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||||
if (targetPermanent != null) {
|
if (targetPermanent != null) {
|
||||||
targetPermanent.destroy(source.getSourceId(), game, false);
|
targetPermanent.destroy(source.getSourceId(), game, false);
|
||||||
}
|
|
||||||
MageObject sourceObject = source.getSourceObjectIfItStillExists(game);
|
|
||||||
if ((sourceObject instanceof Permanent) && targetPermanent != null) {
|
|
||||||
ContinuousEffect effect = new StarkeOfRathControlEffect();
|
ContinuousEffect effect = new StarkeOfRathControlEffect();
|
||||||
effect.setTargetPointer(new FixedTarget(targetPermanent.getControllerId()));
|
effect.setTargetPointer(new FixedTarget(targetPermanent.getControllerId()));
|
||||||
game.addEffect(effect, source);
|
game.addEffect(effect, source);
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -140,10 +137,10 @@ class StarkeOfRathControlEffect extends ContinuousEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Permanent permanent = (Permanent) source.getSourceObjectIfItStillExists(game);
|
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||||
Player controller = game.getPlayer(getTargetPointer().getFirst(game, source));
|
Player newController = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||||
if (permanent != null && controller != null) {
|
if (permanent != null && newController != null) {
|
||||||
return permanent.changeControllerId(getTargetPointer().getFirst(game, source), game);
|
return permanent.changeControllerId(newController.getId(), game);
|
||||||
} else {
|
} else {
|
||||||
discard();
|
discard();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue