mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
add more isActivePlayer and isAttachedTo calls
This commit is contained in:
parent
490217facd
commit
c456a1961e
83 changed files with 109 additions and 122 deletions
|
|
@ -48,8 +48,7 @@ public class DealsDamageToACreatureAttachedTriggeredAbility extends TriggeredAbi
|
|||
if (!combatOnly || ((DamagedCreatureEvent) event).isCombatDamage()) {
|
||||
Permanent attachment = game.getPermanent(this.getSourceId());
|
||||
if (attachment != null
|
||||
&& attachment.getAttachedTo() != null
|
||||
&& event.getSourceId().equals(attachment.getAttachedTo())) {
|
||||
&& attachment.isAttachedTo(event.getSourceId())) {
|
||||
if (setTargetPointer) {
|
||||
for (Effect effect : this.getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public class CantBeBlockedAttachedEffect extends RestrictionEffect {
|
|||
@Override
|
||||
public boolean applies(Permanent permanent, Ability source, Game game) {
|
||||
Permanent attachment = game.getPermanent(source.getSourceId());
|
||||
return attachment != null && attachment.getAttachedTo() != null
|
||||
&& attachment.getAttachedTo().equals(permanent.getId());
|
||||
return attachment != null
|
||||
&& attachment.isAttachedTo(permanent.getId());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ public class CantCastMoreThanOneSpellEffect extends ContinuousRuleModifyingEffec
|
|||
break;
|
||||
case CONTROLLER_ATTACHED_TO:
|
||||
Permanent attachment = game.getPermanent(source.getSourceId());
|
||||
if (attachment == null || !attachment.getAttachedTo().equals(event.getPlayerId())) {
|
||||
if (attachment == null || !attachment.isAttachedTo(event.getPlayerId())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -630,11 +630,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
|
|||
|
||||
@Override
|
||||
public List<UUID> getConnectedCards(String key) {
|
||||
if (this.connectedCards.containsKey(key)) {
|
||||
return this.connectedCards.get(key);
|
||||
} else {
|
||||
return emptyList;
|
||||
}
|
||||
return this.connectedCards.getOrDefault(key, emptyList);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue