mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
[EMN] Added the missing white cards (without meld).
This commit is contained in:
parent
29b3a2398d
commit
7c0b11c641
61 changed files with 2195 additions and 117 deletions
|
|
@ -1,16 +1,16 @@
|
|||
/*
|
||||
* Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
|
|
@ -20,19 +20,19 @@
|
|||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.abilities.common;
|
||||
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.DelayedTriggeredAbility;
|
||||
import mage.abilities.StaticAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
|
|
@ -58,7 +58,7 @@ public class ChancellorAbility extends StaticAbility {
|
|||
return new ChancellorAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "You may reveal this card from your opening hand. If you do, " + super.getRule();
|
||||
}
|
||||
|
|
@ -67,9 +67,9 @@ public class ChancellorAbility extends StaticAbility {
|
|||
|
||||
class ChancellorEffect extends OneShotEffect {
|
||||
|
||||
private DelayedTriggeredAbility ability;
|
||||
private final DelayedTriggeredAbility ability;
|
||||
|
||||
ChancellorEffect (DelayedTriggeredAbility ability, String text) {
|
||||
ChancellorEffect(DelayedTriggeredAbility ability, String text) {
|
||||
super(Outcome.Benefit);
|
||||
this.ability = ability;
|
||||
staticText = text;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,87 @@
|
|||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.effects.PreventionEffectImpl;
|
||||
import mage.constants.Duration;
|
||||
import mage.filter.FilterObject;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.DamageEvent;
|
||||
import mage.game.events.GameEvent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class PreventAllDamageByAllObjectsEffect extends PreventionEffectImpl {
|
||||
|
||||
private FilterObject filter;
|
||||
|
||||
public PreventAllDamageByAllObjectsEffect(Duration duration) {
|
||||
this(null, duration, false);
|
||||
}
|
||||
|
||||
public PreventAllDamageByAllObjectsEffect(Duration duration, boolean onlyCombat) {
|
||||
this(null, duration, onlyCombat);
|
||||
}
|
||||
|
||||
public PreventAllDamageByAllObjectsEffect(FilterObject filter, Duration duration, boolean onlyCombat) {
|
||||
super(duration, Integer.MAX_VALUE, onlyCombat);
|
||||
this.filter = filter;
|
||||
}
|
||||
|
||||
public PreventAllDamageByAllObjectsEffect(final PreventAllDamageByAllObjectsEffect effect) {
|
||||
super(effect);
|
||||
if (effect.filter != null) {
|
||||
this.filter = effect.filter.copy();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PreventAllDamageByAllObjectsEffect copy() {
|
||||
return new PreventAllDamageByAllObjectsEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (super.applies(event, source, game) && event instanceof DamageEvent && event.getAmount() > 0) {
|
||||
DamageEvent damageEvent = (DamageEvent) event;
|
||||
if (damageEvent.isCombatDamage() || !onlyCombat) {
|
||||
if (filter == null) {
|
||||
return true;
|
||||
}
|
||||
MageObject damageSource = game.getObject(damageEvent.getSourceId());
|
||||
if (damageSource != null && filter.match(damageSource, game)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(Mode mode) {
|
||||
if (staticText != null && !staticText.isEmpty()) {
|
||||
return staticText;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder("Prevent all ");
|
||||
if (onlyCombat) {
|
||||
sb.append("combat ");
|
||||
}
|
||||
sb.append("damage that would be dealt");
|
||||
if (duration.equals(Duration.EndOfTurn)) {
|
||||
sb.append(" this turn");
|
||||
}
|
||||
if (filter != null) {
|
||||
sb.append(" by ");
|
||||
sb.append(filter.getMessage());
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -42,24 +42,24 @@ import mage.game.permanent.Permanent;
|
|||
*
|
||||
* @author LevelX
|
||||
*/
|
||||
public class PreventAllDamageByAllEffect extends PreventionEffectImpl {
|
||||
public class PreventAllDamageByAllPermanentsEffect extends PreventionEffectImpl {
|
||||
|
||||
private FilterPermanent filter;
|
||||
|
||||
public PreventAllDamageByAllEffect(Duration duration) {
|
||||
public PreventAllDamageByAllPermanentsEffect(Duration duration) {
|
||||
this(null, duration, false);
|
||||
}
|
||||
|
||||
public PreventAllDamageByAllEffect(Duration duration, boolean onlyCombat) {
|
||||
public PreventAllDamageByAllPermanentsEffect(Duration duration, boolean onlyCombat) {
|
||||
this(null, duration, onlyCombat);
|
||||
}
|
||||
|
||||
public PreventAllDamageByAllEffect(FilterCreaturePermanent filter, Duration duration, boolean onlyCombat) {
|
||||
public PreventAllDamageByAllPermanentsEffect(FilterCreaturePermanent filter, Duration duration, boolean onlyCombat) {
|
||||
super(duration, Integer.MAX_VALUE, onlyCombat);
|
||||
this.filter = filter;
|
||||
}
|
||||
|
||||
public PreventAllDamageByAllEffect(final PreventAllDamageByAllEffect effect) {
|
||||
public PreventAllDamageByAllPermanentsEffect(final PreventAllDamageByAllPermanentsEffect effect) {
|
||||
super(effect);
|
||||
if (effect.filter != null) {
|
||||
this.filter = effect.filter.copy();
|
||||
|
|
@ -67,8 +67,8 @@ public class PreventAllDamageByAllEffect extends PreventionEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public PreventAllDamageByAllEffect copy() {
|
||||
return new PreventAllDamageByAllEffect(this);
|
||||
public PreventAllDamageByAllPermanentsEffect copy() {
|
||||
return new PreventAllDamageByAllPermanentsEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class SetPlayerLifeSourceEffect extends OneShotEffect {
|
||||
|
||||
protected DynamicValue amount;
|
||||
|
||||
public SetPlayerLifeSourceEffect(int amount) {
|
||||
this(new StaticValue(amount));
|
||||
}
|
||||
|
||||
public SetPlayerLifeSourceEffect(DynamicValue amount) {
|
||||
super(Outcome.Neutral);
|
||||
this.amount = amount;
|
||||
this.staticText = setText();
|
||||
}
|
||||
|
||||
public SetPlayerLifeSourceEffect(final SetPlayerLifeSourceEffect effect) {
|
||||
super(effect);
|
||||
this.amount = effect.amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SetPlayerLifeSourceEffect copy() {
|
||||
return new SetPlayerLifeSourceEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
player.setLife(amount.calculate(game, source, this), game);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private String setText() {
|
||||
StringBuilder sb = new StringBuilder("your life total becomes ");
|
||||
sb.append(amount.toString());
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -2368,7 +2368,7 @@ public abstract class GameImpl implements Game, Serializable {
|
|||
}
|
||||
if (!game.isSimulation()) {
|
||||
StringBuilder message = new StringBuilder(preventionSource.getLogName()).append(": Prevented ");
|
||||
message.append(Integer.toString(result.getPreventedDamage())).append(" damage from ").append(damageSource.getName());
|
||||
message.append(Integer.toString(result.getPreventedDamage())).append(" damage from ").append(damageSource.getLogName());
|
||||
if (!targetName.isEmpty()) {
|
||||
message.append(" to ").append(targetName);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue