@Override public ContinuousEffects getContinuousEffects() { return state.getContinuousEffects(); }
/** * Called before applyEffects */ private void reset() { // All gained abilities have to be removed to prevent adding it multiple times triggers.removeAllGainedAbilities(); getContinuousEffects().removeAllTemporaryEffects(); this.setLegendaryRuleActive(true); for (CardState state : cardState.values()) { state.clearAbilities(); } cardAttribute.clear(); }
@Override public boolean canBlockAny(Game game) { if (tapped && null == game.getState().getContinuousEffects().asThough(this.getId(), AsThoughEffectType.BLOCK_TAPPED, null, this.getControllerId(), game)) { return false; } //20101001 - 509.1b for (Map.Entry<RestrictionEffect, Set<Ability>> entry : game.getContinuousEffects().getApplicableRestrictionEffects(this, game).entrySet()) { RestrictionEffect effect = entry.getKey(); for (Ability ability : entry.getValue()) { if (!effect.canBlock(null, this, ability, game)) { return false; } } } return true; }
sb.append(state.getCommand()); sb.append("<br>getContinuousEffects: "); sb.append(state.getContinuousEffects()); sb.append("<br>getCopiedCards: "); sb.append(state.getCopiedCards());
@Override public boolean apply(Permanent input, Game game) { return !input.isTapped() || null != game.getState().getContinuousEffects().asThough(input.getId(), AsThoughEffectType.BLOCK_TAPPED, null, input.getControllerId(), game); }
if (permanent.isTapped() && null == game.getState().getContinuousEffects().asThough(this.getId(), AsThoughEffectType.BLOCK_TAPPED, source, blocker.getControllerId(), game)) { return false;
@Override public boolean canBlock(UUID attackerId, Game game) { if (tapped && null == game.getState().getContinuousEffects().asThough(this.getId(), AsThoughEffectType.BLOCK_TAPPED, null, this.getControllerId(), game)) { return false;
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanent(source.getSourceId()); if (controller != null && permanent != null) { permanent.removeAllAbilities(source.getSourceId(), game); // Set any previous copy effects to 'discarded' for (Effect effect : game.getState().getContinuousEffects().getLayeredEffects(game)) { if (effect instanceof CopyEffect) { CopyEffect copyEffect = (CopyEffect) effect; if (copyEffect.getSourceId().equals(permanent.getId())) { copyEffect.discard(); } } } permanent.turnFaceDown(game, source.getControllerId()); permanent.setManifested(false); permanent.setMorphed(true); return permanent.isFaceDown(game); } return false; } }
this.getState().getContinuousEffects().removeInactiveEffects(this); getStack().removeIf(object -> object.isControlledBy(playerId));
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = source.getSourceObject(game); Permanent sourcePermanent = game.getPermanent(source.getSourceId()); Player newController = game.getPlayer(getTargetPointer().getFirst(game, source)); if (newController != null && controller != null && sourceObject != null && sourceObject.equals(sourcePermanent)) { // remove old control effects of the same player for (ContinuousEffect effect : game.getState().getContinuousEffects().getLayeredEffects(game)) { if (effect instanceof GainControlTargetEffect) { UUID checkId = (UUID) effect.getValue("RiskyMoveSourceId"); UUID controllerId = (UUID) effect.getValue("RiskyMoveControllerId"); if (source.getSourceId().equals(checkId) && newController.getId().equals(controllerId)) { effect.discard(); } } } ContinuousEffect effect = new GainControlTargetEffect(Duration.Custom, true, newController.getId()); effect.setValue("RiskyMoveSourceId", source.getSourceId()); effect.setValue("RiskyMoveControllerId", newController.getId()); effect.setTargetPointer(new FixedTarget(sourcePermanent.getId())); effect.setText("and gains control of it"); game.addEffect(effect, source); return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = source.getSourceObject(game); Permanent sourcePermanent = game.getPermanent(source.getSourceId()); Player newController = game.getPlayer(getTargetPointer().getFirst(game, source)); if (newController != null && controller != null && sourceObject != null && sourceObject.equals(sourcePermanent)) { sourcePermanent.untap(game); game.informPlayers(newController.getLogName() + " untaps " + sourceObject.getIdName()); // remove old control effects of the same player for (ContinuousEffect effect : game.getState().getContinuousEffects().getLayeredEffects(game)) { if (effect instanceof GainControlTargetEffect) { UUID checkId = (UUID) effect.getValue("KaronaFalseGodSourceId"); UUID controllerId = (UUID) effect.getValue("KaronaFalseGodControllerId"); if (source.getSourceId().equals(checkId) && newController.getId().equals(controllerId)) { effect.discard(); } } } ContinuousEffect effect = new GainControlTargetEffect(Duration.Custom, true, newController.getId()); effect.setValue("KaronaFalseGodSourceId", source.getSourceId()); effect.setValue("KaronaFalseGodControllerId", newController.getId()); effect.setTargetPointer(new FixedTarget(sourcePermanent.getId())); effect.setText("and gains control of it"); game.addEffect(effect, source); return true; } return false; } }
Permanent newBluePrint = null; for (Effect effect : getState().getContinuousEffects().getLayeredEffects(this)) { if (effect instanceof CopyEffect) { CopyEffect copyEffect = (CopyEffect) effect; for (Effect effect : getState().getContinuousEffects().getLayeredEffects(this)) { if (effect instanceof CopyEffect) { CopyEffect copyEffect = (CopyEffect) effect;
for (Effect effect : game.getState().getContinuousEffects().getLayeredEffects(game)) { if (effect instanceof CopyEffect) { CopyEffect copyEffect = (CopyEffect) effect;