本文整理了Java中mage.abilities.Ability.newOriginalId()
方法的一些代码示例,展示了Ability.newOriginalId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ability.newOriginalId()
方法的具体详情如下:
包路径:mage.abilities.Ability
类名称:Ability
方法名:newOriginalId
[英]Assigns a new java.util.UUID
[中]分配一个新的java。util。UUID
代码示例来源:origin: magefree/mage
@Override
public void newOriginalId() {
for (Ability ability : this) {
ability.newOriginalId();
}
}
代码示例来源:origin: magefree/mage
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getSourceId());
Permanent creature = game.getPermanent(source.getTargets().getFirstTarget());
if (permanent != null && creature != null) {
for (ActivatedAbility ability : creature.getAbilities().getActivatedAbilities(Zone.BATTLEFIELD)) {
Ability newAbility = ability.copy();
newAbility.newOriginalId();
game.addEffect(new GainAbilitySourceEffect(newAbility, Duration.EndOfTurn), source);
}
return true;
}
return false;
}
}
代码示例来源:origin: magefree/mage
ability.newOriginalId(); // The token is independant from the copy from object so it need a new original Id, otherwise there are problems to check for created continuous effects to check if the source (the Token) has still this ability
内容来源于网络,如有侵权,请联系作者删除!