Prevented 0 damage prevention events.

This commit is contained in:
LevelX2 2013-09-27 16:14:13 +02:00
parent 8674bbf10d
commit 0357dcb59d
4 changed files with 5 additions and 4 deletions

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Config.xsd">
<server serverAddress="0.0.0.0" serverName="mage-server" port="17171" maxGameThreads="10" maxSecondsIdle="600"/>
<server serverAddress="0.0.0.0" serverName="mage-server" port="17171" maxGameThreads="10" maxSecondsIdle="600" minUserNameLength="3" maxUserNameLength="14" userNamePattern="[^a-z0-9_]"/>
<playerTypes>
<playerType name="Human" jar="Mage.Player.Human.jar" className="mage.player.human.HumanPlayer"/>
<playerType name="Computer - default" jar="Mage.Player.AI.jar" className="mage.player.ai.ComputerPlayer"/>

View file

@ -59,7 +59,7 @@ public class NimbleMongoose extends CardImpl<NimbleMongoose> {
// Shroud
this.addAbility(ShroudAbility.getInstance());
// Threshold - Nimble Mongoose gets +2/+2 as long as seven or more cards are in your graveyard.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield), new CardsInControllerGraveCondition(7), "{this} gets +2/+2 as long as seven or more cards are in your graveyard")));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield), new CardsInControllerGraveCondition(7), "<i> Threshold</i> - {this} gets +2/+2 as long as seven or more cards are in your graveyard")));
}
public NimbleMongoose(final NimbleMongoose card) {

View file

@ -52,7 +52,7 @@ public class PreventAllDamageEffect extends PreventionEffectImpl<PreventAllDamag
this.onlyCombat = onlyCombat;
}
public PreventAllDamageEffect(Duration duration, boolean onlyCombat) {
public PreventAllDamageEffect(Duration duration, boolean onlyCombat) {
super(duration);
this.onlyCombat = onlyCombat;
}
@ -100,7 +100,7 @@ public class PreventAllDamageEffect extends PreventionEffectImpl<PreventAllDamag
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
if (super.applies(event, source, game) && event instanceof DamageEvent) {
if (super.applies(event, source, game) && event instanceof DamageEvent && event.getAmount() > 0) {
DamageEvent damageEvent = (DamageEvent) event;
if (damageEvent.isCombatDamage() || !onlyCombat) {
if (filter == null) {

View file

@ -619,6 +619,7 @@ public abstract class PermanentImpl<T extends PermanentImpl<T>> extends CardImpl
*/
private int damage(int damageAmount, UUID sourceId, Game game, boolean preventable, boolean combat, boolean markDamage, ArrayList<UUID> appliedEffects) {
int damageDone = 0;
// because of "Doran, the Siege Tower" we can't check here for 0 damage.
if (canDamage(game.getObject(sourceId), game)) {
if (cardType.contains(CardType.PLANESWALKER)) {
damageDone = damagePlaneswalker(damageAmount, sourceId, game, preventable, combat, markDamage, appliedEffects);