本文整理了Java中mage.game.events.ZoneChangeEvent.getPlayerId()
方法的一些代码示例,展示了ZoneChangeEvent.getPlayerId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZoneChangeEvent.getPlayerId()
方法的具体详情如下:
包路径:mage.game.events.ZoneChangeEvent
类名称:ZoneChangeEvent
方法名:getPlayerId
暂无
代码示例来源:origin: magefree/mage
if (event instanceof ZoneChangeEvent) {
ZoneChangeEvent castEvent = (ZoneChangeEvent) event;
ZoneChangeData key = new ZoneChangeData(castEvent.getSourceId(), castEvent.getPlayerId(), castEvent.getFromZone(), castEvent.getToZone());
if (eventsByKey.containsKey(key)) {
eventsByKey.get(key).add(event);
代码示例来源:origin: magefree/mage
@Override
public boolean checkTrigger(GameEvent event, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if ((fromZone == null || zEvent.getFromZone() == fromZone)
&& (toZone == null || zEvent.getToZone() == toZone)) {
Permanent permanentThatMoved = null;
if (zEvent.getTarget() != null) {
permanentThatMoved = zEvent.getTarget();
}
if (permanentThatMoved != null
&& filter.match(permanentThatMoved, sourceId, controllerId, game)
&& zEvent.getPlayerId().equals(controllerId)) { //The controller's hand is where the permanent moved to.
return true;
}
}
return false;
}
代码示例来源:origin: magefree/mage
public static boolean cast(ZoneChangeInfo info, Game game) {
if (maybeRemoveFromSourceZone(info, game)) {
placeInDestinationZone(info, game);
// create a group zone change event if a card is moved to stack for casting (it's always only one card, but some effects check for group events (one or more xxx))
Set<Card> cards = new HashSet<>();
Card targetCard = getTargetCard(game, info.event.getTargetId());
cards.add(targetCard);
game.fireEvent(new ZoneChangeGroupEvent(cards, info.event.getSourceId(), info.event.getPlayerId(), info.event.getFromZone(), info.event.getToZone()));
// normal movement
game.fireEvent(info.event);
return true;
}
return false;
}
代码示例来源:origin: magefree/mage
@Override
public boolean checkTrigger(GameEvent event, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getFromZone() == Zone.LIBRARY && zEvent.getToZone() == Zone.GRAVEYARD && game.getOpponents(this.getControllerId()).contains(zEvent.getPlayerId())) {
Card card = game.getCard(event.getTargetId());
if (card != null && card.isCreature()) {
this.getEffects().get(0).setTargetPointer(new FixedTarget(card.getId()));
return true;
}
}
return false;
}
代码示例来源:origin: magefree/mage
public Unmelded(ZoneChangeInfo info, Game game) {
super(info.event);
MeldCard meld = game.getMeldCard(info.event.getTargetId());
if (meld != null) {
if (meld.hasTopHalf(game)) {
ZoneChangeEvent topEvent = new ZoneChangeEvent(meld.getTopHalfCard().getId(), event.getSourceId(),
event.getPlayerId(), event.getFromZone(), event.getToZone(), event.getAppliedEffects());
ZoneChangeInfo topInfo = info.copy();
topInfo.event = topEvent;
subInfo.add(topInfo);
}
if (meld.hasBottomHalf(game)) {
ZoneChangeEvent bottomEvent = new ZoneChangeEvent(meld.getBottomHalfCard().getId(), event.getSourceId(),
event.getPlayerId(), event.getFromZone(), event.getToZone(), event.getAppliedEffects());
ZoneChangeInfo bottomInfo = info.copy();
bottomInfo.event = bottomEvent;
subInfo.add(bottomInfo);
}
}
}
}
代码示例来源:origin: magefree/mage
successfulMovedCards.add(permanent);
if (!game.isSimulation()) {
Player eventPlayer = game.getPlayer(info.event.getPlayerId());
if (eventPlayer != null && fromZone != null) {
game.informPlayers(eventPlayer.getLogName() + " puts "
代码示例来源:origin: magefree/mage
permanent = new PermanentMeld(card, event.getPlayerId(), game);
} else if (card instanceof Permanent) {
permanent = new PermanentCard(card, event.getPlayerId(), game);
内容来源于网络,如有侵权,请联系作者删除!