forked from External/mage
add isOwned and isControlled methods. remove some null-checks, remove some unnecessary casts
This commit is contained in:
parent
e46ad02918
commit
9f06046f22
464 changed files with 567 additions and 562 deletions
|
|
@ -60,7 +60,7 @@ class AjaniSteadfastPreventEffect extends PreventionEffectImpl {
|
|||
|
||||
if (event.getType() == GameEvent.EventType.DAMAGE_PLANESWALKER) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent != null && permanent.getControllerId().equals(source.getControllerId())) {
|
||||
if (permanent != null && permanent.isControlledBy(source.getControllerId())) {
|
||||
return super.applies(event, source, game);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ class DarettiScrapSavantTriggeredAbility extends TriggeredAbilityImpl {
|
|||
if (zEvent.getToZone() == Zone.GRAVEYARD
|
||||
&& zEvent.getFromZone() == Zone.BATTLEFIELD
|
||||
&& zEvent.getTarget().isArtifact()
|
||||
&& zEvent.getTarget().getOwnerId().equals(this.controllerId)) {
|
||||
&& zEvent.getTarget().isOwnedBy(this.controllerId)) {
|
||||
this.getEffects().setTargetPointer(new FixedTarget(zEvent.getTargetId()));
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ class TrailOfTheMageRingsReboundEffect extends ContinuousEffectImpl {
|
|||
}
|
||||
for (Iterator<StackObject> iterator = game.getStack().iterator(); iterator.hasNext();) {
|
||||
StackObject stackObject = iterator.next();
|
||||
if (stackObject instanceof Spell && stackObject.getControllerId().equals(source.getControllerId())) {
|
||||
if (stackObject instanceof Spell && stackObject.isControlledBy(source.getControllerId())) {
|
||||
Spell spell = (Spell) stackObject;
|
||||
Card card = spell.getCard();
|
||||
if (card != null) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue