gpt4 book ai didi

mage.game.events.ZoneChangeEvent.getTarget()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 10:16:59 29 4
gpt4 key购买 nike

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

ZoneChangeEvent.getTarget介绍

暂无

代码示例

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

@Override
public boolean checkTrigger(GameEvent event, Game game) {
  ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
  if (zEvent.isDiesEvent() && zEvent.getTarget() != null && StaticFilters.FILTER_PERMANENT_CREATURES.match(zEvent.getTarget(), sourceId, controllerId, game)) {
    return true;
  }
  return false;
}

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

@Override
public void watch(GameEvent event, Game game) {
  if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
    ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
    if (zEvent.isDiesEvent()
        && zEvent.getTarget() != null
        && zEvent.getTarget().isCreature()) {
      diedThisTurn.add(zEvent.getTargetId());
    }
  }
}

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

@Override
public void watch(GameEvent event, Game game) {
  if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
    ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
    if (zEvent.getToZone() == Zone.BATTLEFIELD
        && zEvent.getTarget().isPlaneswalker()) {
      players.add(zEvent.getTarget().getControllerId());
    }
  }
}

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

@Override
public void watch(GameEvent event, Game game) {
  if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
    ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
    if (zEvent.isDiesEvent() && zEvent.getTarget() != null
        && zEvent.getTarget().isCreature()
        && !(zEvent.getTarget() instanceof PermanentToken)) {
      int count = getAmountOfNontokenCreatureDiedThisTurn(zEvent.getTargetId());
      amountOfCreaturesThatDied.put(zEvent.getTarget().getControllerId(), ++count);
    }
  }
}

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

@Override
public boolean applies(GameEvent event, Ability source, Game game) {
  ZoneChangeEvent zce = (ZoneChangeEvent) event;
  return zce.isDiesEvent() && zce.getTarget().isCreature();
}

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

@Override
public boolean checkTrigger(GameEvent event, Game game) {
  ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
  if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getTarget() != null && zEvent.getTargetId().equals(getTargets().getFirstTarget())) {
    this.getTargets().clear(); // else spell fizzles because target creature died
    return true;
  }
  return false;
}

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

@Override
public boolean checkTrigger(GameEvent event, Game game) {
  ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
  if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
    if (zEvent.getTarget().isOwnedBy(getControllerId())
        && zEvent.getTarget().isCreature()
        && !zEvent.getTarget().getId().equals(getSourceId())) {
      return true;
    }
  }
  return false;
}

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

@Override
public boolean checkTrigger(GameEvent event, Game game) {
  ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
  if (zEvent.isDiesEvent() && zEvent.getTarget() != null && zEvent.getTargetId().equals(getTargets().getFirstTarget())) {
    this.getTargets().clear(); // else spell fizzles because target creature died
    Target target = new TargetPlayer();
    target.add(zEvent.getTarget().getControllerId(), game);
    this.addTarget(target);
    return true;
  }
  return false;
}

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

@Override
public boolean checkTrigger(GameEvent event, Game game) {
  ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
  if (zEvent.getFromZone() == Zone.BATTLEFIELD
      && zEvent.getToZone() == Zone.GRAVEYARD
      && zEvent.getTarget().isArtifact()
      && !Objects.equals(zEvent.getTarget().getId(), this.getSourceId())) {
    this.getTargets().get(0).add(zEvent.getTarget().getControllerId(), game);
    return true;
  }
  return false;
}

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

@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
  Permanent permanent = ((ZoneChangeEvent) event).getTarget();
  Player controller = game.getPlayer(source.getControllerId());
  if (controller != null && permanent != null) {
    return controller.moveCards(permanent, Zone.EXILED, source, game);
  }
  return false;
}

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

@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
  Permanent permanent = ((ZoneChangeEvent) event).getTarget();
  if (permanent != null) {
    Player player = game.getPlayer(permanent.getControllerId());
    if (player != null) {
      return player.moveCards(permanent, Zone.EXILED, source, game);
    }
  }
  return false;
}

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

@Override
public void watch(GameEvent event, Game game) {
  if (condition) {
    return;
  }
  if (event.getType() == GameEvent.EventType.ZONE_CHANGE
      && ((ZoneChangeEvent) event).isDiesEvent()
      && ((ZoneChangeEvent) event).getTarget().isCreature()) {
    condition = true;
  }
}

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

@Override
public boolean checkTrigger(GameEvent event, Game game) {
  if (super.checkTrigger(event, game)) {
    Permanent permanent = ((ZoneChangeEvent) event).getTarget();
    if (permanent.getCounters(game).getCount(CounterType.M1M1) == 0) {
      return true;
    }
  }
  return false;
}

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

@Override
public boolean checkTrigger(GameEvent event, Game game) {
  if (((ZoneChangeEvent) event).isDiesEvent()) {
    ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
    Object object = game.getState().getValue(getSourceId().toString() + "returnedCreature");
    if ((object instanceof MageObjectReference) && ((MageObjectReference) object).refersTo(zEvent.getTarget(), game)) {
      return true;
    }
  }
  return false;
}

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

@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
  Permanent permanent = ((ZoneChangeEvent) event).getTarget();
  Player controller = game.getPlayer(source.getControllerId());
  if (controller != null && permanent != null) {
    return controller.moveCardToExileWithInfo(permanent, null, null, source.getSourceId(), game, Zone.BATTLEFIELD, true);
  }
  return false;
}

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

@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
  Permanent permanent = ((ZoneChangeEvent) event).getTarget();
  Player controller = game.getPlayer(source.getControllerId());
  if (controller != null && permanent != null) {
    return controller.moveCardToExileWithInfo(permanent, null, "", source.getSourceId(), game, Zone.BATTLEFIELD, true);
  }
  return false;
}

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

@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
  Permanent permanent = ((ZoneChangeEvent)event).getTarget();
  if (permanent != null) {
    permanent.moveToExile(null, "", source.getSourceId(), game);
    new AddExtraTurnControllerEffect().apply(game, source);
    return true;
  }
  return false;
}

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

@Override
public boolean checkTrigger(GameEvent event, Game game) {
  ZoneChangeEvent zce = (ZoneChangeEvent) event;
  if (zce.isDiesEvent()) {
    DamagedByWatcher watcher = game.getState().getWatcher(DamagedByWatcher.class, this.getSourceId());
    if (watcher != null) {
      return watcher.wasDamaged(zce.getTarget(), game);
    }
  }
  return false;
}

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

@Override
public boolean checkTrigger(GameEvent event, Game game) {
  ZoneChangeEvent zce = (ZoneChangeEvent)event;
  if(zce.getFromZone() == Zone.BATTLEFIELD && zce.getToZone() == Zone.HAND) {
    for(Effect effect: getEffects()) {
      effect.setTargetPointer(new FixedTarget(zce.getTarget().getOwnerId()));
    }
    return true;
  }
  return false;
}

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

@Override
public boolean checkTrigger(GameEvent event, Game game) {
  ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
  if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
    if (zEvent.getTarget().isCreature()) {
      Effect effect = this.getEffects().get(0);
      effect.setTargetPointer(new FixedTarget(event.getTargetId()));
      return true;
    }
  }
  return false;
}

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com