Merge pull request #62 from magefree/master

merge
This commit is contained in:
theelk801 2017-09-13 11:11:16 -04:00 committed by GitHub
commit 9b5dd0a8fc
9 changed files with 47 additions and 40 deletions

View file

@ -53,7 +53,7 @@ import mage.game.permanent.Permanent;
public class Anthroplasm extends CardImpl {
public Anthroplasm(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{U}{U}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}{U}");
this.subtype.add(SubType.SHAPESHIFTER);
this.power = new MageInt(0);
@ -65,7 +65,7 @@ public class Anthroplasm extends CardImpl {
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AnthroplasmEffect(), new ManaCostsImpl("{X}"));
ability.addCost(new TapSourceCost());
this.addAbility(ability);
}
public Anthroplasm(final Anthroplasm card) {
@ -80,12 +80,12 @@ public class Anthroplasm extends CardImpl {
class AnthroplasmEffect extends OneShotEffect {
AnthroplasmEffect ( ) {
AnthroplasmEffect() {
super(Outcome.Benefit);
staticText = "Remove all +1/+1 counters from Anthroplasm and put X +1/+1 counters on it";
staticText = "Remove all +1/+1 counters from {this} and put X +1/+1 counters on it";
}
AnthroplasmEffect ( AnthroplasmEffect effect ) {
AnthroplasmEffect(AnthroplasmEffect effect) {
super(effect);
}

View file

@ -50,13 +50,10 @@ public class KumenasSpeaker extends CardImpl {
private static final FilterPermanent filter = new FilterPermanent("another Merfolk or an Island");
static {
filter.add(new AnotherPredicate());
filter.add(Predicates.or(
new SubtypePredicate(SubType.ISLAND),
Predicates.and(
new SubtypePredicate(SubType.MERFOLK),
new AnotherPredicate()
)
));
new SubtypePredicate(SubType.MERFOLK)));
}
public KumenasSpeaker(UUID ownerId, CardSetInfo setInfo) {

View file

@ -29,6 +29,7 @@ package mage.cards.p;
import java.util.Iterator;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.EntersBattlefieldTappedAbility;
@ -44,6 +45,7 @@ import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.stack.Spell;
import mage.players.Player;
/**
*
@ -105,19 +107,24 @@ class PathOfAncestryTriggeredAbility extends TriggeredAbilityImpl {
if (event.getData().equals(abilityOriginalId)) {
Spell spell = game.getStack().getSpell(event.getTargetId());
if (spell != null && spell.isCreature()) {
Iterator<SubType> spellSubs = spell.getSubtype(game).iterator();
while (spellSubs.hasNext()) {
SubType sType = spellSubs.next();
if (sType.getSubTypeSet() == SubTypeSet.CreatureType) {
for (UUID cmdr : game.getPlayer(spell.getControllerId()).getCommandersIds()) {
if (game.getObject(cmdr).getSubtype(game).contains(sType)) {
return true;
Player controller = game.getPlayer(getControllerId());
if (controller != null && controller.getCommandersIds() != null && !controller.getCommandersIds().isEmpty()) {
Iterator<SubType> spellSubs = spell.getSubtype(game).iterator();
while (spellSubs.hasNext()) {
SubType sType = spellSubs.next();
if (sType.getSubTypeSet() == SubTypeSet.CreatureType) {
for (UUID cmdr : controller.getCommandersIds()) {
MageObject commander = game.getObject(cmdr);
if (commander != null && commander.getSubtype(game).contains(sType)) {
return true;
}
}
}
}
}
}
}
return false;
}

View file

@ -32,6 +32,7 @@ import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DiesCreatureTriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.LoseLifeOpponentsEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.abilities.keyword.MenaceAbility;
import mage.cards.CardImpl;
@ -77,7 +78,7 @@ public class PlagueBelcher extends CardImpl {
this.addAbility(ability);
// Whenever another Zombie you control dies, each opponent loses 1 life.
this.addAbility(new DiesCreatureTriggeredAbility(new LoseLifeOpponentsEffect(), false, filter));
this.addAbility(new DiesCreatureTriggeredAbility(new LoseLifeOpponentsEffect(1), false, filter));
}
public PlagueBelcher(final PlagueBelcher card) {

View file

@ -36,8 +36,8 @@ import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
@ -91,7 +91,7 @@ class VerdantSunsAvatarTriggeredAbility extends TriggeredAbilityImpl {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Permanent permanent = game.getPermanent(event.getTargetId());
if (permanent.isCreature()
if (permanent != null && permanent.isCreature()
&& permanent.getControllerId().equals(this.controllerId)) {
Effect effect = this.getEffects().get(0);
// Life is determined during resolution so it has to be retrieved there (e.g. Giant Growth before resolution)

View file

@ -28,14 +28,14 @@
package mage.abilities.condition.common;
import mage.abilities.Ability;
import mage.constants.ComparisonType;
import mage.abilities.condition.Condition;
import mage.constants.ComparisonType;
import mage.filter.FilterPermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
/**
* Battlefield checking condition. This condition can decorate other conditions
* Battlefield checking condition. This condition can decorate other conditions
* as well as be used standalone.
*
* @author nantuko
@ -63,9 +63,10 @@ public class PermanentsOnTheBattlefieldCondition implements Condition {
}
/**
* Applies a filter, a {@link ComparisonType}, and count to permanents on the
* battlefield when checking the condition during the
* {@link #apply(mage.game.Game, mage.abilities.Ability) apply} method invocation.
* Applies a filter, a {@link ComparisonType}, and count to permanents on
* the battlefield when checking the condition during the
* {@link #apply(mage.game.Game, mage.abilities.Ability) apply} method
* invocation.
*
* @param filter
* @param type
@ -83,10 +84,10 @@ public class PermanentsOnTheBattlefieldCondition implements Condition {
}
/**
* Applies a filter, a {@link ComparisonType}, and count to permanents on the
* battlefield and calls the decorated condition to see if it
* {@link #apply(mage.game.Game, mage.abilities.Ability) applies}
* as well. This will force both conditions to apply for this to be true.
* Applies a filter, a {@link ComparisonType}, and count to permanents on
* the battlefield and calls the decorated condition to see if it
* {@link #apply(mage.game.Game, mage.abilities.Ability) applies} as well.
* This will force both conditions to apply for this to be true.
*
* @param filter
* @param type
@ -100,7 +101,7 @@ public class PermanentsOnTheBattlefieldCondition implements Condition {
@Override
public boolean apply(Game game, Ability source) {
boolean conditionApplies = false;
boolean conditionApplies;
FilterPermanent localFilter = filter.copy();
if (onlyControlled) {

View file

@ -27,6 +27,11 @@
*/
package mage.cards;
import java.lang.reflect.Constructor;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import mage.MageObject;
import mage.MageObjectImpl;
import mage.Mana;
@ -48,12 +53,6 @@ import mage.util.SubTypeList;
import mage.watchers.Watcher;
import org.apache.log4j.Logger;
import java.lang.reflect.Constructor;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
public abstract class CardImpl extends MageObjectImpl implements Card {
private static final long serialVersionUID = 1L;
@ -669,7 +668,9 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
@Override
public void removeCounters(Counter counter, Game game) {
removeCounters(counter.getName(), counter.getCount(), game);
if (counter != null) {
removeCounters(counter.getName(), counter.getCount(), game);
}
}
@Override

View file

@ -650,12 +650,12 @@ public interface Player extends MageItem, Copyable<Player> {
/**
* Set the commanderId of the player
*
* @param commandersIds
* @param commanderId
*/
void addCommanderId(UUID commanderId);
/**
* Get the commanderId of the player
* Get the commanderIds of the player
*
* @return
*/

View file

@ -75,7 +75,7 @@ public class UserData implements Serializable {
this.autoOrderTrigger = userData.autoOrderTrigger;
this.useFirstManaAbility = userData.useFirstManaAbility;
this.userIdStr = userData.userIdStr;
// todo: why we don't copy user stats here?
// todo: why we don't update user stats here? => can't be updated from client side
}
public static UserData getDefaultUserDataView() {