mage.abilities.Ability.copy()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(109)

本文整理了Java中mage.abilities.Ability.copy()方法的一些代码示例,展示了Ability.copy()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ability.copy()方法的具体详情如下:
包路径:mage.abilities.Ability
类名称:Ability
方法名:copy

Ability.copy介绍

[英]Creates a fresh copy of this ability.
[中]创建此技能的新副本。

代码示例

代码示例来源:origin: magefree/mage

public BecomesFaceDownCreatureEffect(final BecomesFaceDownCreatureEffect effect) {
  super(effect);
  this.zoneChangeCounter = effect.zoneChangeCounter;
  if (effect.turnFaceUpAbility != null) {
    this.turnFaceUpAbility = effect.turnFaceUpAbility.copy();
  }
  this.objectReference = effect.objectReference;
  this.foundPermanent = effect.foundPermanent;
  this.faceDownType = effect.faceDownType;
}

代码示例来源:origin: magefree/mage

public LoseAbilityAttachedEffect(final LoseAbilityAttachedEffect effect) {
  super(effect);
  this.ability = effect.ability.copy();
  this.attachmentType = effect.attachmentType;
}

代码示例来源:origin: magefree/mage

private BloodlordOfVaasgothEffect(final BloodlordOfVaasgothEffect effect) {
  super(effect);
  this.ability = effect.ability.copy();
  this.zoneChangeCounter = effect.zoneChangeCounter;
  this.permanentId = effect.permanentId;
}

代码示例来源:origin: magefree/mage

public GainAbilityControllerEffect(final GainAbilityControllerEffect effect) {
  super(effect);
  this.ability = effect.ability.copy();
}

代码示例来源:origin: magefree/mage

public VraskaTheUnseenGainAbilityEffect(final VraskaTheUnseenGainAbilityEffect effect) {
  super(effect);
  this.ability = effect.ability.copy();
}

代码示例来源:origin: magefree/mage

public LoseAbilityTargetEffect(final LoseAbilityTargetEffect effect) {
  super(effect);
  this.ability = effect.ability.copy();
}

代码示例来源:origin: magefree/mage

public LoseAbilitySourceEffect(final LoseAbilitySourceEffect effect) {
  super(effect);
  this.ability = effect.ability.copy();
}

代码示例来源:origin: magefree/mage

public LoseAbilityOrAnotherAbilityTargetEffect(final LoseAbilityOrAnotherAbilityTargetEffect effect) {
  super(effect);
  this.ability2 = effect.ability2.copy();
}

代码示例来源:origin: magefree/mage

public AbilitiesImpl(final AbilitiesImpl<T> abilities) {
  for (T ability : abilities) {
    this.add((T) ability.copy());
  }
}

代码示例来源:origin: magefree/mage

public GainAbilityAttachedEffect(final GainAbilityAttachedEffect effect) {
  super(effect);
  this.ability = effect.ability.copy();
  ability.newId(); // This is needed if the effect is copied e.g. by a clone so the ability can be added multiple times to permanents
  this.attachmentType = effect.attachmentType;
  this.independentEffect = effect.independentEffect;
}

代码示例来源:origin: magefree/mage

public GainAbilityTargetEffect(final GainAbilityTargetEffect effect) {
  super(effect);
  this.ability = effect.ability.copy();
  ability.newId(); // This is needed if the effect is copied e.g. by a clone so the ability can be added multiple times to permanents
  this.onCard = effect.onCard;
  this.durationPhaseStep = effect.durationPhaseStep;
  this.durationPlayerId = effect.durationPlayerId;
  this.sameStep = effect.sameStep;
}

代码示例来源:origin: magefree/mage

public StackAbility(final StackAbility stackAbility) {
  this.ability = stackAbility.ability.copy();
  this.controllerId = stackAbility.controllerId;
  this.copy = stackAbility.copy;
  this.copyFrom = (stackAbility.copyFrom != null ? stackAbility.copyFrom.copy() : null);
  this.name = stackAbility.name;
  this.expansionSetCode = stackAbility.expansionSetCode;
  this.targetAdjuster = stackAbility.targetAdjuster;
  this.targetChanged = stackAbility.targetChanged;
  this.costAdjuster = stackAbility.costAdjuster;
}

代码示例来源:origin: magefree/mage

public GainAbilitySourceEffect(final GainAbilitySourceEffect effect) {
  super(effect);
  this.ability = effect.ability.copy();
  ability.newId(); // This is needed if the effect is copied e.g. by a clone so the ability can be added multiple times to permanents
  this.onCard = effect.onCard;
}

代码示例来源:origin: magefree/mage

public GainAbilityPairedEffect(final GainAbilityPairedEffect effect) {
  super(effect);
  this.ability = effect.ability.copy();
  ability.newId(); // This is needed if the effect is copied e.g. by a clone so the ability can be added multiple times to permanents
}

代码示例来源:origin: magefree/mage

public ContinuousEffectsList(final ContinuousEffectsList<T> effects) {
  this.ensureCapacity(effects.size());
  for (ContinuousEffect cost : effects) {
    this.add((T) cost.copy());
  }
  for (Map.Entry<UUID, Set<Ability>> entry : effects.effectAbilityMap.entrySet()) {
    Set<Ability> newSet = new HashSet<>();
    for (Ability ability : entry.getValue()) {
      newSet.add(ability.copy());
    }
    effectAbilityMap.put(entry.getKey(), newSet);
  }
}

代码示例来源:origin: magefree/mage

public GainAbilityAllEffect(Ability ability, Duration duration, FilterPermanent filter, boolean excludeSource, Layer layer, SubLayer subLayer) {
  super(duration, layer, subLayer, Outcome.AddAbility);
  this.ability = ability.copy();
  this.ability.newId();
  this.filter = filter;
  this.excludeSource = excludeSource;
  this.addDependencyType(DependencyType.AddingAbility);
}

代码示例来源:origin: magefree/mage

public GainAbilityAllEffect(final GainAbilityAllEffect effect) {
  super(effect);
  this.ability = effect.ability.copy();
  ability.newId(); // This is needed if the effect is copied e.g. by a clone so the ability can be added multiple times to permanents
  this.filter = effect.filter.copy();
  this.excludeSource = effect.excludeSource;
}

代码示例来源:origin: magefree/mage

public Commander(Card card) {
  this.sourceObject = card;
  abilities.add(new CastCommanderAbility(card));
  for (Ability ability : card.getAbilities()) {
    if (!(ability instanceof SpellAbility)) {
      Ability newAbility = ability.copy();
      abilities.add(newAbility);
    }
  }
}

代码示例来源:origin: magefree/mage

@Override
public void addEffect(ContinuousEffect continuousEffect, Ability source) {
  Ability newAbility = source.copy();
  newAbility.setSourceObjectZoneChangeCounter(getState().getZoneChangeCounter(source.getSourceId()));
  ContinuousEffect newEffect = continuousEffect.copy();
  newEffect.newId();
  newEffect.init(newAbility, this);
  state.addEffect(newEffect, newAbility);
}

代码示例来源:origin: magefree/mage

private void addCostTargetOptions(List<Ability> options, Ability option, int targetNum, Game game) {
  for (UUID targetId : option.getCosts().getTargets().get(targetNum).possibleTargets(option.getSourceId(), playerId, game)) {
    Ability newOption = option.copy();
    newOption.getCosts().getTargets().get(targetNum).addTarget(targetId, option, game, true);
    if (targetNum < option.getCosts().getTargets().size() - 1) {
      addCostTargetOptions(options, newOption, targetNum + 1, game);
    } else {
      options.add(newOption);
    }
  }
}

相关文章