mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
removed redundant calls to copy()
This commit is contained in:
parent
2d0842f320
commit
35d993c3c1
8 changed files with 11 additions and 11 deletions
|
@ -142,7 +142,7 @@ class MyrWelderContinuousEffect extends ContinuousEffectImpl<MyrWelderContinuous
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
for (Ability ability: card.getAbilities()) {
|
for (Ability ability: card.getAbilities()) {
|
||||||
if (ability instanceof ActivatedAbility) {
|
if (ability instanceof ActivatedAbility) {
|
||||||
perm.addAbility(ability.copy());
|
perm.addAbility(ability);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,10 +118,10 @@ class PhyrexianMetamorphEffect extends ContinuousEffectImpl<PhyrexianMetamorphEf
|
||||||
permanent.setExpansionSetCode(card.getExpansionSetCode());
|
permanent.setExpansionSetCode(card.getExpansionSetCode());
|
||||||
permanent.getAbilities().clear();
|
permanent.getAbilities().clear();
|
||||||
for (Ability ability0: card.getAbilities()) {
|
for (Ability ability0: card.getAbilities()) {
|
||||||
Ability ability = ability0.copy();
|
// Ability ability = ability0.copy();
|
||||||
ability.newId();
|
// ability.newId();
|
||||||
ability.setSourceId(card.getId());
|
// ability.setSourceId(card.getId());
|
||||||
permanent.addAbility(ability);
|
permanent.addAbility(ability0);
|
||||||
}
|
}
|
||||||
permanent.getPower().setValue(card.getPower().getValue());
|
permanent.getPower().setValue(card.getPower().getValue());
|
||||||
permanent.getToughness().setValue(card.getToughness().getValue());
|
permanent.getToughness().setValue(card.getToughness().getValue());
|
||||||
|
|
|
@ -111,7 +111,7 @@ class NecroticOozeEffect extends ContinuousEffectImpl<NecroticOozeEffect> {
|
||||||
if (card.getCardType().contains(CardType.CREATURE)) {
|
if (card.getCardType().contains(CardType.CREATURE)) {
|
||||||
for (Ability ability: card.getAbilities()) {
|
for (Ability ability: card.getAbilities()) {
|
||||||
if (ability instanceof ActivatedAbility) {
|
if (ability instanceof ActivatedAbility) {
|
||||||
perm.addAbility(ability.copy());
|
perm.addAbility(ability);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,7 +93,7 @@ public class GainAbilityAllEffect extends ContinuousEffectImpl<GainAbilityAllEff
|
||||||
for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter)) {
|
for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter)) {
|
||||||
if (!this.affectedObjectsSet || objects.contains(perm.getId())) {
|
if (!this.affectedObjectsSet || objects.contains(perm.getId())) {
|
||||||
if (!(excludeSource && perm.getId().equals(source.getSourceId()))) {
|
if (!(excludeSource && perm.getId().equals(source.getSourceId()))) {
|
||||||
perm.addAbility(ability.copy());
|
perm.addAbility(ability);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,7 @@ public class GainAbilityAttachedEffect extends ContinuousEffectImpl<GainAbilityA
|
||||||
if (equipment != null && equipment.getAttachedTo() != null) {
|
if (equipment != null && equipment.getAttachedTo() != null) {
|
||||||
Permanent creature = game.getPermanent(equipment.getAttachedTo());
|
Permanent creature = game.getPermanent(equipment.getAttachedTo());
|
||||||
if (creature != null)
|
if (creature != null)
|
||||||
creature.addAbility(ability.copy());
|
creature.addAbility(ability);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,7 +93,7 @@ public class GainAbilityControlledEffect extends ContinuousEffectImpl<GainAbilit
|
||||||
for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId())) {
|
for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId())) {
|
||||||
if (!this.affectedObjectsSet || objects.contains(perm.getId())) {
|
if (!this.affectedObjectsSet || objects.contains(perm.getId())) {
|
||||||
if (!(excludeSource && perm.getId().equals(source.getSourceId()))) {
|
if (!(excludeSource && perm.getId().equals(source.getSourceId()))) {
|
||||||
perm.addAbility(ability.copy());
|
perm.addAbility(ability);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,7 +73,7 @@ public class GainAbilitySourceEffect extends ContinuousEffectImpl<GainAbilitySou
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||||
if (permanent != null) {
|
if (permanent != null) {
|
||||||
permanent.addAbility(ability.copy());
|
permanent.addAbility(ability);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -69,7 +69,7 @@ public class GainAbilityTargetEffect extends ContinuousEffectImpl {
|
||||||
for (UUID permanentId : source.getTargets().get(0).getTargets()) {
|
for (UUID permanentId : source.getTargets().get(0).getTargets()) {
|
||||||
Permanent permanent = game.getPermanent(permanentId);
|
Permanent permanent = game.getPermanent(permanentId);
|
||||||
if (permanent != null) {
|
if (permanent != null) {
|
||||||
permanent.addAbility(ability.copy());
|
permanent.addAbility(ability);
|
||||||
affectedTargets++;
|
affectedTargets++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue