- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中mage.game.events.ZoneChangeEvent
类的一些代码示例,展示了ZoneChangeEvent
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZoneChangeEvent
类的具体详情如下:
包路径:mage.game.events.ZoneChangeEvent
类名称:ZoneChangeEvent
暂无
代码示例来源: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
@Override
public boolean checkTrigger(GameEvent event, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getToZone() == Zone.GRAVEYARD
&& zEvent.getFromZone() == Zone.BATTLEFIELD
&& zEvent.getTarget().isArtifact()
&& zEvent.getTarget().isOwnedBy(this.controllerId)) {
this.getEffects().setTargetPointer(new FixedTarget(zEvent.getTargetId()));
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 && StaticFilters.FILTER_PERMANENT_CREATURES.match(zEvent.getTarget(), sourceId, controllerId, game)) {
return true;
}
return false;
}
代码示例来源:origin: magefree/mage
@Override
public boolean checkTrigger(GameEvent event, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
return zEvent.getFromZone() == Zone.GRAVEYARD && zEvent.getToZone() == Zone.BATTLEFIELD;
}
代码示例来源:origin: magefree/mage
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
return zEvent.getToZone() == Zone.GRAVEYARD
&& zEvent.getTargetId().equals(this.cardId);
}
}
代码示例来源:origin: magefree/mage
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
return zEvent.getTarget() != null
&& zEvent.getTarget().isCreature()
&& zEvent.getFromZone() == Zone.BATTLEFIELD
&& zEvent.getToZone() == Zone.GRAVEYARD;
}
代码示例来源:origin: magefree/mage
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getToZone() == Zone.BATTLEFIELD && (zEvent.getFromZone() == Zone.GRAVEYARD || zEvent.getFromZone() == Zone.LIBRARY)) {
Card card = game.getCard(zEvent.getTargetId());
if (card != null && card.isCreature()) {
return true;
}
}
return false;
}
代码示例来源:origin: magefree/mage
MeldCard meld = game.getMeldCard(info.event.getTargetId());
for (Iterator<ZoneChangeInfo> itr = unmelded.subInfo.iterator(); itr.hasNext();) {
ZoneChangeInfo subInfo = itr.next();
if (!maybeRemoveFromSourceZone(subInfo, game)) {
itr.remove();
} else if (Objects.equals(subInfo.event.getTargetId(), meld.getTopHalfCard().getId())) {
meld.setTopLastZoneChangeCounter(meld.getTopHalfCard().getZoneChangeCounter(game));
} else if (Objects.equals(subInfo.event.getTargetId(), meld.getBottomHalfCard().getId())) {
meld.setBottomLastZoneChangeCounter(meld.getBottomHalfCard().getZoneChangeCounter(game));
Card card = getTargetCard(game, event.getTargetId());
if (card == null) {
Zone fromZone = event.getFromZone();
if (event.getToZone() == Zone.BATTLEFIELD) {
permanent = new PermanentMeld(card, event.getPlayerId(), game);
} else if (card instanceof Permanent) {
permanent = new PermanentCard(card, event.getPlayerId(), game);
if (permanent.entersBattlefield(event.getSourceId(), game, fromZone, true)
&& card.removeFromZone(game, fromZone, event.getSourceId())) {
success = true;
event.setTarget(permanent);
} else {
} else if (event.getTarget() != null) {
card.setFaceDown(info.faceDown, game);
代码示例来源: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 ((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
@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 updateZoneChangeCounter(Game game, ZoneChangeEvent event) {
boolean skullBriarEffectApplied = false;
if (event.getToZone() != Zone.HAND && event.getToZone() != Zone.LIBRARY) {
for (StaticAbility ability : getAbilities(game).getStaticAbilities(event.getFromZone())) {
for (Effect effect : ability.getEffects(game, EffectType.REPLACEMENT)) {
if (effect instanceof SkullbriarEffect && event.getAppliedEffects().contains(effect.getId())) {
skullBriarEffectApplied = true;
if (event.getTarget() != null && event.getFromZone() == Zone.BATTLEFIELD) {
copyFrom = new Counters(event.getTarget().getCounters(game));
} else {
copyFrom = new Counters(this.getCounters(game));
if (event.getTarget() != null && event.getToZone() == Zone.BATTLEFIELD) {
if (event.getFromZone() != Zone.BATTLEFIELD) {
copyTo = event.getTarget().getCounters(game);
代码示例来源:origin: magefree/mage
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE
&& ((ZoneChangeEvent) event).isDiesEvent()) {
//400.3 Intercept only the controller's events
cards.add(event.getTargetId());
}
}
代码示例来源: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.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
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
if (((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD) {
Permanent permanent = ((ZoneChangeEvent) event).getTarget();
if (permanent != null) {
Player player = game.getPlayer(permanent.getOwnerId());
if (player != null && player.chooseUse(Outcome.Benefit, "Move commander to command zone?", source, game)) {
((ZoneChangeEvent) event).setToZone(Zone.COMMAND);
if (!game.isSimulation()) {
game.informPlayers(player.getLogName() + " has moved their commander to the command zone");
if (((ZoneChangeEvent) event).getFromZone() == Zone.STACK) {
Spell spell = game.getStack().getSpell(event.getTargetId());
if (spell != null) {
Player player = game.getPlayer(card.getOwnerId());
if (player != null && player.chooseUse(Outcome.Benefit, "Move commander to command zone?", source, game)) {
((ZoneChangeEvent) event).setToZone(Zone.COMMAND);
if (!game.isSimulation()) {
game.informPlayers(player.getLogName() + " has moved their commander to the command zone");
代码示例来源:origin: magefree/mage
@Override
public boolean checkTrigger(GameEvent event, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getFromZone() == Zone.GRAVEYARD) {
Card card = game.getCard(zEvent.getTargetId());
Player controller = game.getPlayer(getControllerId());
return card != null
&& card.isCreature()
&& controller != null
&& controller.hasOpponent(card.getOwnerId(), game);
}
return false;
}
代码示例来源:origin: magefree/mage
for (Card card : cards) {
fromZone = game.getState().getZone(card.getId());
ZoneChangeEvent event = new ZoneChangeEvent(card.getId(), source.getSourceId(), byOwner ? card.getOwnerId() : getId(), fromZone, Zone.BATTLEFIELD, appliedEffects);
infoList.add(new ZoneChangeInfo.Battlefield(event, faceDown, tapped));
Permanent permanent = game.getPermanent(info.event.getTargetId());
if (permanent != null) {
successfulMovedCards.add(permanent);
if (!game.isSimulation()) {
Player eventPlayer = game.getPlayer(info.event.getPlayerId());
if (eventPlayer != null && fromZone != null) {
game.informPlayers(eventPlayer.getLogName() + " puts "
if (card instanceof Permanent) {
game.getBattlefield().removePermanent(card.getId());
ZoneChangeEvent event = new ZoneChangeEvent(card.getId(), (source == null ? null : source.getSourceId()),
byOwner ? card.getOwnerId() : getId(), Zone.BATTLEFIELD, Zone.OUTSIDE, appliedEffects);
game.fireEvent(event);
代码示例来源: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 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;
}
我刚开始使用 Magento,特别是关于模型和 ORM 的工作原理。 这三种方法我都用过 Mage::getResourceModel() Mage::getModel() Mage::getSing
任何机构都可以说两者之间有什么区别 法师:应用程序和法师:: 例如: Mage::getModel('catalog/product'); Mage::app->getLayout->createBl
本文整理了Java中mage.constants.Zone类的一些代码示例,展示了Zone类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项
本文整理了Java中mage.game.events.ZoneChangeEvent类的一些代码示例,展示了ZoneChangeEvent类的具体用法。这些代码示例主要来源于Github/Stacko
本文整理了Java中mage.watchers.common.ZuberasDiedWatcher类的一些代码示例,展示了ZuberasDiedWatcher类的具体用法。这些代码示例主要来源于Git
从布局来看,我该如何设置 crumbInfo/link Mage::getBaseUrl() 是面包屑吗? Ac
我有一个需要在每台服务器上更改的配置文件,因此一旦服务器上安装了我们的软件,客户端安装程序的配置文件就会设置为匹配该服务器的特定设置,然后复制到公共(public)Web 上用于部署的文件夹。 由于我
我目前正在学习 Magento,特别是模型和 ORM 的工作原理。 据我所知,有模型(它们是实际的实体)、资源模型(直接与数据库适配器链接)和集合(它们是保存模型集合的容器)。 为什么有大量的代码和示
My Mage::log() 函数无法正常工作。 var/log 文件夹是 777,并且从管理面板启用日志记录。我仍然无法记录任何内容 最佳答案 你在记录什么? 这里有一些需要考虑的事情: 您确定您的
我正在开发一个示例,我在其中使用 Octopus Deploy 在安装时配置和创建 clickonce 程序包,但我在“生产”机器上使用 mage.exe 时遇到了一些问题。我已经包含了 mage.e
我正在使用 Mage.exe 为我的 winform 应用程序创建单击一次部署。浏览文件并单击填充按钮后,我无法选择任何文件作为入口点。 这会导致Windows 窗体应用程序不支持 customHos
在我以前这样做之前: $response['url'] = Mage::getBaseUrl() .'module/controller/action?sku=' . $request['sku']
我有一个简单的问题。为什么 Mage::log 在 Adminhtml block 中不起作用?? 我知道文件正在读取/加载,因为当我在文件的第一行输入 die() 时,我得到一个空白屏幕,删除/重命
本文整理了Java中mage.constants.Zone.match()方法的一些代码示例,展示了Zone.match()的具体用法。这些代码示例主要来源于Github/Stackoverflow/
本文整理了Java中mage.constants.Zone.toString()方法的一些代码示例,展示了Zone.toString()的具体用法。这些代码示例主要来源于Github/Stackove
本文整理了Java中mage.game.permanent.token.ZombieWizardToken类的一些代码示例,展示了ZombieWizardToken类的具体用法。这些代码示例主要来源于
我已经在这里呆了几个小时了。 Magento 一直试图从 Mage 命名空间而不是我自己的命名空间调用我的块。 错误: /Library/WebServer/Documents/magento/app
我有一个模块:app/code/local/Namespace/Resize/ 所以我添加了一个通过 Magento 管理禁用/启用选项的选项。 系统 > 配置 > 命名空间 > 调整大小 但是当我尝
我正在尝试将 Magento 的一些功能集成到我的自定义 CMS 中,以便我的客户更轻松地更新他们的一些产品。 我已经编写了类来检索我需要的所有数据信息,但我正在尝试弄清楚如何以相同的方式保存对产品的
我目前在开发服务器(远程、SSH 访问)和生产服务器(云实例、SSH 访问)上设置了 Magento。当前设置是更新开发/生产服务器的颠覆导出。这很好用。 如果我通过 SSH 进入开发服务器,我可以导
我是一名优秀的程序员,十分优秀!