mirror of
https://github.com/correl/mage.git
synced 2025-03-07 20:53:18 -10:00
remove hasSubType(String s)
This commit is contained in:
parent
c094251061
commit
f793504ba0
44 changed files with 170 additions and 213 deletions
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
|
@ -47,6 +46,8 @@ import mage.game.permanent.Permanent;
|
|||
import mage.players.Player;
|
||||
import mage.target.common.TargetOpponent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author escplan9 (Derek Monturo - dmontur1 at gmail dot com)
|
||||
|
@ -96,7 +97,7 @@ class AetherChargeTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent.isCreature() && permanent.hasSubtype("Beast", game)
|
||||
if (permanent.isCreature() && permanent.hasSubtype(SubType.BEAST, game)
|
||||
&& permanent.getControllerId().equals(this.controllerId)) {
|
||||
Effect effect = this.getEffects().get(0);
|
||||
effect.setValue("damageSource", event.getTargetId());
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
|
@ -47,6 +46,8 @@ import mage.game.permanent.Permanent;
|
|||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInOpponentsGraveyard;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
|
@ -98,7 +99,7 @@ class AgadeemOccultistEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
int allycount = 0;
|
||||
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(source.getControllerId())) {
|
||||
if (permanent.hasSubtype("Ally", game)) {
|
||||
if (permanent.hasSubtype(SubType.ALLY, game)) {
|
||||
allycount++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
|
@ -47,6 +46,8 @@ import mage.players.Player;
|
|||
import mage.target.common.TargetCreatureOrPlayer;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author fireshoes
|
||||
|
@ -146,7 +147,7 @@ class AkoumHellkiteDamageEffect extends OneShotEffect {
|
|||
Permanent land = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
|
||||
Player player = game.getPlayer(source.getFirstTarget());
|
||||
if (land != null && player != null) {
|
||||
if (land.hasSubtype("Mountain", game)) {
|
||||
if (land.hasSubtype(SubType.MOUNTAIN, game)) {
|
||||
player.damage(2, source.getSourceId(), game, false, true);
|
||||
} else {
|
||||
player.damage(1, source.getSourceId(), game, false, true);
|
||||
|
@ -155,7 +156,7 @@ class AkoumHellkiteDamageEffect extends OneShotEffect {
|
|||
}
|
||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||
if (land != null && permanent != null) {
|
||||
if (land.hasSubtype("Mountain", game)) {
|
||||
if (land.hasSubtype(SubType.MOUNTAIN, game)) {
|
||||
permanent.damage(2, source.getSourceId(), game, false, true);
|
||||
} else {
|
||||
permanent.damage(1, source.getSourceId(), game, false, true);
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
|
@ -46,6 +45,8 @@ import mage.game.events.ZoneChangeEvent;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.SpiritWhiteToken;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
|
@ -99,7 +100,7 @@ class AvacynsCollarTriggeredAbility extends TriggeredAbilityImpl {
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (((ZoneChangeEvent) event).isDiesEvent()) {
|
||||
Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
|
||||
if (permanent.getAttachments().contains(this.getSourceId()) && permanent.hasSubtype("Human", game)) {
|
||||
if (permanent.getAttachments().contains(this.getSourceId()) && permanent.hasSubtype(SubType.HUMAN, game)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,8 +27,6 @@
|
|||
*/
|
||||
package mage.cards.b;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
|
@ -48,6 +46,9 @@ import mage.game.permanent.Permanent;
|
|||
import mage.players.Player;
|
||||
import mage.target.common.TargetCreatureOrPlayer;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
|
@ -104,7 +105,7 @@ class BlazingTorchEvasionEffect extends RestrictionEffect {
|
|||
|
||||
@Override
|
||||
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) {
|
||||
return !blocker.hasSubtype("Vampire", game) && !blocker.hasSubtype("Zombie", game);
|
||||
return !blocker.hasSubtype(SubType.VAMPIRE, game) && !blocker.hasSubtype(SubType.ZOMBIE, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.b;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
|
@ -46,6 +45,8 @@ import mage.game.Game;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author fireshoes
|
||||
|
@ -110,8 +111,8 @@ class BoldwyrIntimidatorEffect extends RestrictionEffect {
|
|||
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) {
|
||||
if (attacker != null && blocker != null) {
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
if (sourcePermanent != null && attacker.hasSubtype("Warrior", game)) {
|
||||
return !blocker.hasSubtype("Coward", game);
|
||||
if (sourcePermanent != null && attacker.hasSubtype(SubType.WARRIOR, game)) {
|
||||
return !blocker.hasSubtype(SubType.COWARD, game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
|
@ -35,12 +34,15 @@ import mage.cards.CardImpl;
|
|||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author fireshoes
|
||||
|
@ -88,7 +90,7 @@ class CemeteryRecruitmentEffect extends OneShotEffect {
|
|||
Card card = game.getCard(targetPointer.getFirst(game, source));
|
||||
if (card != null) {
|
||||
if (controller.moveCards(card, Zone.HAND, source, game)
|
||||
&& card.hasSubtype("Zombie", game)) {
|
||||
&& card.hasSubtype(SubType.ZOMBIE, game)) {
|
||||
controller.drawCards(1, game);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.common.AsEntersBattlefieldAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.ChooseCreatureTypeEffect;
|
||||
|
@ -35,14 +34,13 @@ import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
|
|||
import mage.abilities.keyword.FearAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.constants.*;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
@ -87,8 +85,8 @@ class FilterCoverOfDarkness extends FilterCreaturePermanent {
|
|||
@Override
|
||||
public boolean match(Permanent permanent, UUID sourceId, UUID playerId, Game game) {
|
||||
if (super.match(permanent, sourceId, playerId, game)) {
|
||||
String subtype = (String) game.getState().getValue(sourceId + "_type");
|
||||
if (subtype != null && !subtype.isEmpty() && permanent.hasSubtype(subtype, game)) {
|
||||
SubType subtype = (SubType) game.getState().getValue(sourceId + "_type");
|
||||
if (subtype != null && permanent.hasSubtype(subtype, game)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.d;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
|
@ -35,10 +34,7 @@ import mage.abilities.effects.ReplacementEffectImpl;
|
|||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.constants.*;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.EntersTheBattlefieldEvent;
|
||||
|
@ -46,6 +42,8 @@ import mage.game.events.GameEvent;
|
|||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author nantuko
|
||||
*/
|
||||
|
@ -93,7 +91,7 @@ class DearlyDepartedEntersBattlefieldEffect extends ReplacementEffectImpl {
|
|||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget();
|
||||
if (permanent != null && permanent.getControllerId().equals(source.getControllerId()) && permanent.hasSubtype("Human", game)) {
|
||||
if (permanent != null && permanent.getControllerId().equals(source.getControllerId()) && permanent.hasSubtype(SubType.HUMAN, game)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.d;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
|
@ -35,12 +34,15 @@ import mage.cards.CardImpl;
|
|||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
|
@ -88,7 +90,7 @@ class DeathsCaressEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
Permanent creature = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD);
|
||||
if (player != null && creature != null && creature.hasSubtype("Human", game)) {
|
||||
if (player != null && creature != null && creature.hasSubtype(SubType.HUMAN, game)) {
|
||||
player.gainLife(creature.getToughness().getValue(), game);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.d;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
|
@ -44,6 +43,8 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
|
|||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author MarcoMarin
|
||||
|
@ -67,7 +68,7 @@ public class DesertNomads extends CardImpl {
|
|||
this.addAbility(new LandwalkAbility(filter));
|
||||
|
||||
// Prevent all damage that would be dealt to Desert Nomads by Deserts.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PreventDamageToSourceBySubtypeEffect("Desert")));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PreventDamageToSourceBySubtypeEffect(SubType.DESERT)));
|
||||
}
|
||||
|
||||
public DesertNomads(final DesertNomads card) {
|
||||
|
@ -82,13 +83,9 @@ public class DesertNomads extends CardImpl {
|
|||
|
||||
class PreventDamageToSourceBySubtypeEffect extends PreventAllDamageToSourceEffect {
|
||||
|
||||
private String subtype;
|
||||
|
||||
public PreventDamageToSourceBySubtypeEffect(){
|
||||
this("a");
|
||||
}
|
||||
private SubType subtype;
|
||||
|
||||
public PreventDamageToSourceBySubtypeEffect(String sub){
|
||||
public PreventDamageToSourceBySubtypeEffect(SubType sub){
|
||||
super(Duration.WhileOnBattlefield);
|
||||
subtype = sub;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.d;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.AsEntersBattlefieldAbility;
|
||||
|
@ -49,6 +48,8 @@ import mage.game.events.GameEvent.EventType;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.game.stack.Spell;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Plopman
|
||||
|
@ -142,7 +143,7 @@ class BoostCreatureEffectEffect extends ContinuousEffectImpl {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
String subtype = (String) game.getState().getValue(permanent.getId() + "_type");
|
||||
SubType subtype = (SubType) game.getState().getValue(permanent.getId() + "_type");
|
||||
if (subtype != null) {
|
||||
for (Permanent perm : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURES, source.getControllerId(), game)) {
|
||||
if (perm.hasSubtype(subtype, game)) {
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.d;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
|
@ -40,6 +39,8 @@ import mage.filter.StaticFilters;
|
|||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author brikr
|
||||
|
@ -78,8 +79,8 @@ class DralnusCrusadeEffect extends ContinuousEffectImpl {
|
|||
for (Permanent permanent : game.getState().getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE_GOBLINS, source.getControllerId(), source.getSourceId(), game)) {
|
||||
switch (layer) {
|
||||
case TypeChangingEffects_4:
|
||||
if (!permanent.hasSubtype("Zombie", game)) {
|
||||
permanent.getSubtype(game).add("Zombie");
|
||||
if (!permanent.hasSubtype(SubType.ZOMBIE, game)) {
|
||||
permanent.getSubtype(game).add(SubType.ZOMBIE);
|
||||
}
|
||||
break;
|
||||
case ColorChangingEffects_5:
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.e;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
|
@ -37,6 +36,7 @@ import mage.cards.CardImpl;
|
|||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
|
@ -44,6 +44,8 @@ import mage.game.events.GameEvent.EventType;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author cbt33
|
||||
|
@ -97,7 +99,7 @@ class DealsDamageAllTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent creature = game.getPermanent(event.getSourceId());
|
||||
if (creature != null && creature.hasSubtype("Sliver", game)) {
|
||||
if (creature != null && creature.hasSubtype(SubType.SLIVER, game)) {
|
||||
for (Effect effect : this.getEffects()) {
|
||||
effect.setValue("damage", event.getAmount());
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.f;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
|
@ -38,15 +37,14 @@ import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
|
|||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.constants.*;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
|
@ -101,7 +99,7 @@ class FalkenrathTorturerEffect extends OneShotEffect {
|
|||
if (cost instanceof SacrificeTargetCost) {
|
||||
Permanent sacrificedCreature = ((SacrificeTargetCost) cost).getPermanents().get(0);
|
||||
Permanent sourceCreature = game.getPermanent(source.getSourceId());
|
||||
if (sacrificedCreature.hasSubtype("Human", game) && sourceCreature != null) {
|
||||
if (sacrificedCreature.hasSubtype(SubType.HUMAN, game) && sourceCreature != null) {
|
||||
sourceCreature.addCounters(CounterType.P1P1.createInstance(), source, game);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.f;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
|
||||
|
@ -35,12 +34,15 @@ import mage.cards.CardImpl;
|
|||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author fireshoes
|
||||
|
@ -85,7 +87,7 @@ class FearsomeAwakeningEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||
if (permanent != null && permanent.hasSubtype("Dragon", game)) {
|
||||
if (permanent != null && permanent.hasSubtype(SubType.DRAGON, game)) {
|
||||
permanent.addCounters(CounterType.P1P1.createInstance(2), source, game);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.g;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
|
@ -49,6 +48,8 @@ import mage.players.Player;
|
|||
import mage.target.targetpointer.FixedTarget;
|
||||
import mage.watchers.Watcher;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author fireshoes
|
||||
|
@ -167,7 +168,7 @@ class GisaAndGeralfWatcher extends Watcher {
|
|||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getZone() == Zone.GRAVEYARD) {
|
||||
Spell spell = (Spell) game.getObject(event.getTargetId());
|
||||
if (spell.isCreature() && spell.hasSubtype("Zombie", game)) {
|
||||
if (spell.isCreature() && spell.hasSubtype(SubType.ZOMBIE, game)) {
|
||||
abilityUsed = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.g;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.ConditionalMana;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
|
@ -54,6 +53,8 @@ import mage.filter.predicate.permanent.AttackingPredicate;
|
|||
import mage.game.Game;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
@ -117,7 +118,7 @@ class GnarlrootTrapperManaCondition extends CreatureCastManaCondition {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
if (super.apply(game, source)) {
|
||||
MageObject object = game.getObject(source.getSourceId());
|
||||
if (object.hasSubtype("Elf", game)
|
||||
if (object.hasSubtype(SubType.ELF, game)
|
||||
&& object.isCreature()) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.g;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
|
@ -37,16 +36,15 @@ import mage.abilities.effects.common.continuous.BoostAllEffect;
|
|||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.constants.*;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetLandPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author nigelzor
|
||||
|
@ -88,7 +86,7 @@ class AttachedToBasicMountainCondition implements Condition {
|
|||
if (enchantment != null) {
|
||||
Permanent enchanted = game.getPermanent(enchantment.getAttachedTo());
|
||||
if (enchanted != null) {
|
||||
if (enchanted.hasSubtype("Mountain", game) && enchanted.isBasic()) {
|
||||
if (enchanted.hasSubtype(SubType.MOUNTAIN, game) && enchanted.isBasic()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.g;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
|
@ -46,6 +45,8 @@ import mage.game.events.GameEvent.EventType;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
|
@ -110,7 +111,7 @@ class GreatbowDoyenTriggeredAbility extends TriggeredAbilityImpl {
|
|||
Permanent damagedCreature = game.getPermanent(event.getTargetId());
|
||||
if (creature != null && damagedCreature != null
|
||||
&& creature.isCreature()
|
||||
&& creature.hasSubtype("Archer", game)
|
||||
&& creature.hasSubtype(SubType.ARCHER, game)
|
||||
&& creature.getControllerId().equals(controllerId)) {
|
||||
this.getEffects().get(0).setValue("damageAmount", event.getAmount());
|
||||
this.getEffects().get(0).setValue("controller", damagedCreature.getControllerId());
|
||||
|
|
|
@ -27,9 +27,6 @@
|
|||
*/
|
||||
package mage.cards.h;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
|
@ -45,6 +42,10 @@ import mage.game.permanent.Permanent;
|
|||
import mage.players.Player;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
@ -93,7 +94,7 @@ class HourOfGloryEffect extends OneShotEffect {
|
|||
Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
if (targetCreature != null) {
|
||||
controller.moveCards(targetCreature, Zone.EXILED, source, game);
|
||||
if (targetCreature.hasSubtype(SubType.GOD.getDescription(), game)) {
|
||||
if (targetCreature.hasSubtype(SubType.GOD, game)) {
|
||||
game.applyEffects();
|
||||
Player targetController = game.getPlayer(targetCreature.getControllerId());
|
||||
if (targetController != null) {
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.k;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
|
@ -42,6 +41,8 @@ import mage.game.Game;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author fireshoes
|
||||
*/
|
||||
|
@ -92,7 +93,7 @@ class KasetoEffect extends OneShotEffect {
|
|||
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
if (permanent != null) {
|
||||
game.addEffect(new CantBeBlockedTargetEffect(Duration.EndOfTurn), source);
|
||||
if (permanent.hasSubtype("Snake", game)) {
|
||||
if (permanent.hasSubtype(SubType.SNAKE, game)) {
|
||||
game.addEffect(new BoostTargetEffect(2, 2, Duration.EndOfTurn), source);
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -27,8 +27,6 @@
|
|||
*/
|
||||
package mage.cards.k;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
|
@ -36,15 +34,13 @@ import mage.abilities.effects.ContinuousEffectImpl;
|
|||
import mage.abilities.keyword.VigilanceAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Layer;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.constants.Zone;
|
||||
import mage.constants.*;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
|
@ -101,7 +97,7 @@ class KembasLegionEffect extends ContinuousEffectImpl {
|
|||
int count = 0;
|
||||
for (UUID attachmentId : attachments) {
|
||||
Permanent attachment = game.getPermanent(attachmentId);
|
||||
if (attachment != null && attachment.hasSubtype("Equipment", game)) {
|
||||
if (attachment != null && attachment.hasSubtype(SubType.EQUIPMENT, game)) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.l;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
|
@ -43,6 +42,8 @@ import mage.game.Game;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author emerald000
|
||||
*/
|
||||
|
@ -95,12 +96,12 @@ class LifeAndLimbEffect extends ContinuousEffectImpl {
|
|||
switch (layer) {
|
||||
case TypeChangingEffects_4:
|
||||
permanent.addCardType(CardType.CREATURE);
|
||||
if (!permanent.hasSubtype("Saproling", game)) {
|
||||
permanent.getSubtype(game).add("Saproling");
|
||||
if (!permanent.hasSubtype(SubType.SAPROLING, game)) {
|
||||
permanent.getSubtype(game).add(SubType.SAPROLING);
|
||||
}
|
||||
permanent.addCardType(CardType.LAND);
|
||||
if (!permanent.hasSubtype("Forest", game)) {
|
||||
permanent.getSubtype(game).add("Forest");
|
||||
if (!permanent.hasSubtype(SubType.FOREST, game)) {
|
||||
permanent.getSubtype(game).add(SubType.FOREST);
|
||||
}
|
||||
break;
|
||||
case ColorChangingEffects_5:
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.m;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DealsDamageToACreatureTriggeredAbility;
|
||||
|
@ -37,19 +36,15 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
|||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Layer;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.constants.*;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
|
@ -117,8 +112,8 @@ class MephidrossVampireEffect extends ContinuousEffectImpl {
|
|||
creature.addAbility(new DealsDamageToACreatureTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false, false, false), source.getSourceId(), game);
|
||||
break;
|
||||
case TypeChangingEffects_4:
|
||||
if (!creature.hasSubtype("Vampire", game)) {
|
||||
creature.getSubtype(game).add("Vampire");
|
||||
if (!creature.hasSubtype(SubType.VAMPIRE, game)) {
|
||||
creature.getSubtype(game).add(SubType.VAMPIRE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.m;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AsEntersBattlefieldAbility;
|
||||
|
@ -44,6 +43,8 @@ import mage.game.events.EntersTheBattlefieldEvent;
|
|||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Styxo
|
||||
|
@ -104,7 +105,7 @@ class MetallicMimicReplacementEffect extends ReplacementEffectImpl {
|
|||
&& enteringCreature.getControllerId().equals(source.getControllerId())
|
||||
&& enteringCreature.isCreature()
|
||||
&& !event.getTargetId().equals(source.getSourceId())) {
|
||||
String subtype = (String) game.getState().getValue(sourcePermanent.getId() + "_type");
|
||||
SubType subtype = (SubType) game.getState().getValue(sourcePermanent.getId() + "_type");
|
||||
return subtype != null && enteringCreature.hasSubtype(subtype, game);
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.m;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
|
@ -47,6 +46,8 @@ import mage.game.events.GameEvent;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
|
@ -111,7 +112,7 @@ class MikaeusTheUnhallowedAbility extends TriggeredAbilityImpl {
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getTargetId().equals(this.controllerId)) {
|
||||
Permanent permanent = game.getPermanent(event.getSourceId());
|
||||
if (permanent != null && permanent.hasSubtype("Human", game)) {
|
||||
if (permanent != null && permanent.hasSubtype(SubType.HUMAN, game)) {
|
||||
this.getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.n;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
|
@ -45,6 +44,8 @@ import mage.game.events.ManaEvent;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author emerald000
|
||||
|
@ -155,10 +156,10 @@ class NakedSingularityEffect extends ReplacementEffectImpl {
|
|||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
Permanent permanent = game.getPermanent(event.getSourceId());
|
||||
return permanent != null
|
||||
&& (permanent.hasSubtype("Plains", game)
|
||||
|| permanent.hasSubtype("Island", game)
|
||||
|| permanent.hasSubtype("Swamp", game)
|
||||
|| permanent.hasSubtype("Mountain", game)
|
||||
|| permanent.hasSubtype("Forest", game));
|
||||
&& (permanent.hasSubtype(SubType.PLAINS, game)
|
||||
|| permanent.hasSubtype(SubType.ISLAND, game)
|
||||
|| permanent.hasSubtype(SubType.SWAMP, game)
|
||||
|| permanent.hasSubtype(SubType.MOUNTAIN, game)
|
||||
|| permanent.hasSubtype(SubType.FOREST, game));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.n;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
|
@ -48,6 +47,8 @@ import mage.game.permanent.token.NissaSageAnimistToken;
|
|||
import mage.players.Player;
|
||||
import mage.target.common.TargetLandPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author emerald000
|
||||
|
@ -146,8 +147,8 @@ class NissaSageAnimistMinusSevenEffect extends ContinuousEffectImpl {
|
|||
switch (layer) {
|
||||
case TypeChangingEffects_4:
|
||||
permanent.addCardType(CardType.CREATURE);
|
||||
if (!permanent.hasSubtype("Elemental", game)) {
|
||||
permanent.getSubtype(game).add("Elemental");
|
||||
if (!permanent.hasSubtype(SubType.ELEMENTAL, game)) {
|
||||
permanent.getSubtype(game).add(SubType.ELEMENTAL);
|
||||
}
|
||||
break;
|
||||
case PTChangingEffects_7:
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.o;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AsEntersBattlefieldAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
|
@ -36,16 +35,13 @@ import mage.abilities.effects.common.ChooseCreatureTypeEffect;
|
|||
import mage.abilities.keyword.ConvokeAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Layer;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.constants.Zone;
|
||||
import mage.constants.*;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author emerald000
|
||||
|
@ -97,7 +93,7 @@ class ObeliskOfUrdBoostEffect extends ContinuousEffectImpl {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
String subtype = (String) game.getState().getValue(permanent.getId() + "_type");
|
||||
SubType subtype = (SubType) game.getState().getValue(permanent.getId() + "_type");
|
||||
if (subtype != null) {
|
||||
for (Permanent perm : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
|
||||
if (perm.hasSubtype(subtype, game)) {
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.p;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
|
@ -39,11 +38,14 @@ import mage.abilities.effects.common.SacrificeSourceEffect;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.util.functions.ApplyToPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
|
@ -55,8 +57,8 @@ public class PhantasmalImage extends CardImpl {
|
|||
ApplyToPermanent phantasmalImageApplier = new ApplyToPermanent() {
|
||||
@Override
|
||||
public boolean apply(Game game, Permanent permanent, Ability source, UUID copyToObjectId) {
|
||||
if (!permanent.hasSubtype("Illusion", game)) {
|
||||
permanent.getSubtype(game).add("Illusion");
|
||||
if (!permanent.hasSubtype(SubType.ILLUSION, game)) {
|
||||
permanent.getSubtype(game).add(SubType.ILLUSION);
|
||||
}
|
||||
// Add directly because the created permanent is only used to copy from, so there is no need to add the ability to e.g. TriggeredAbilities
|
||||
permanent.getAbilities().add(new BecomesTargetTriggeredAbility(new SacrificeSourceEffect()));
|
||||
|
@ -66,8 +68,8 @@ public class PhantasmalImage extends CardImpl {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, MageObject mageObject, Ability source, UUID copyToObjectId) {
|
||||
if (!mageObject.hasSubtype("Illusion", game)) {
|
||||
mageObject.getSubtype(game).add("Illusion");
|
||||
if (!mageObject.hasSubtype(SubType.ILLUSION, game)) {
|
||||
mageObject.getSubtype(game).add(SubType.ILLUSION);
|
||||
}
|
||||
// Add directly because the created permanent is only used to copy from, so there is no need to add the ability to e.g. TriggeredAbilities
|
||||
mageObject.getAbilities().add(new BecomesTargetTriggeredAbility(new SacrificeSourceEffect()));
|
||||
|
|
|
@ -27,13 +27,13 @@
|
|||
*/
|
||||
package mage.cards.r;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
|
@ -43,6 +43,8 @@ import mage.game.events.GameEvent.EventType;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
|
@ -95,7 +97,7 @@ class RakishHeirTriggeredAbility extends TriggeredAbilityImpl {
|
|||
DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
|
||||
Permanent permanent = game.getPermanent(event.getSourceId());
|
||||
if (damageEvent.isCombatDamage() && permanent != null
|
||||
&& permanent.hasSubtype("Vampire", game) && permanent.getControllerId().equals(controllerId)) {
|
||||
&& permanent.hasSubtype(SubType.VAMPIRE, game) && permanent.getControllerId().equals(controllerId)) {
|
||||
this.getEffects().clear();
|
||||
AddCountersTargetEffect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance());
|
||||
effect.setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
|
@ -37,10 +36,7 @@ import mage.abilities.effects.common.SacrificeSourceEffect;
|
|||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ComparisonType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.*;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterControlledLandPermanent;
|
||||
import mage.game.Game;
|
||||
|
@ -49,6 +45,8 @@ import mage.players.Player;
|
|||
import mage.target.Target;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author MarcoMarin
|
||||
|
@ -107,7 +105,7 @@ class SerendibDjinnEffect extends OneShotEffect {
|
|||
Permanent permanent = game.getPermanent(target.getFirstTarget());
|
||||
if (permanent != null) {
|
||||
permanent.sacrifice(source.getSourceId(), game);
|
||||
if (permanent.hasSubtype("Island", game)) {
|
||||
if (permanent.hasSubtype(SubType.ISLAND, game)) {
|
||||
controller.damage(3, source.getSourceId(), game, false, true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
|
@ -45,6 +44,8 @@ import mage.game.events.GameEvent;
|
|||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author Loki
|
||||
*/
|
||||
|
@ -103,7 +104,7 @@ class SeshiroTheAnointedAbility extends TriggeredAbilityImpl {
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
|
||||
Permanent p = game.getPermanent(event.getSourceId());
|
||||
if (damageEvent.isCombatDamage() && p != null && p.hasSubtype("Snake", game) && p.getControllerId().equals(controllerId)) {
|
||||
if (damageEvent.isCombatDamage() && p != null && p.hasSubtype(SubType.SNAKE, game) && p.getControllerId().equals(controllerId)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
|
@ -38,6 +37,7 @@ import mage.cards.Card;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
|
@ -46,6 +46,8 @@ import mage.game.permanent.token.WolfToken;
|
|||
import mage.game.stack.Spell;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author fireshoes
|
||||
|
@ -99,7 +101,7 @@ class CreaturesYouControlBecomesTargetTriggeredAbility extends TriggeredAbilityI
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent != null && permanent.getControllerId().equals(this.controllerId) && (permanent.hasSubtype("Wolf", game) || permanent.hasSubtype("Werewolf", game))) {
|
||||
if (permanent != null && permanent.getControllerId().equals(this.controllerId) && (permanent.hasSubtype(SubType.WOLF, game) || permanent.hasSubtype(SubType.WEREWOLF, game))) {
|
||||
MageObject object = game.getObject(event.getSourceId());
|
||||
if (object != null && object instanceof Spell) {
|
||||
Card c = (Spell) object;
|
||||
|
|
|
@ -27,22 +27,15 @@
|
|||
*/
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.ConditionalMana;
|
||||
import mage.MageObject;
|
||||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.decorator.ConditionalActivatedAbility;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.mana.ColorlessManaAbility;
|
||||
import mage.abilities.mana.ConditionalAnyColorManaAbility;
|
||||
import mage.abilities.mana.builder.ConditionalManaBuilder;
|
||||
import mage.abilities.mana.conditional.ConditionalSpellManaBuilder;
|
||||
import mage.abilities.mana.conditional.CreatureCastManaCondition;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
@ -51,9 +44,10 @@ import mage.constants.Zone;
|
|||
import mage.filter.FilterSpell;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.token.SliverToken;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author emerald000
|
||||
|
@ -96,41 +90,4 @@ public class SliverHive extends CardImpl {
|
|||
public SliverHive copy() {
|
||||
return new SliverHive(this);
|
||||
}
|
||||
}
|
||||
|
||||
class SliverHiveManaBuilder extends ConditionalManaBuilder {
|
||||
|
||||
@Override
|
||||
public ConditionalMana build(Object... options) {
|
||||
this.mana.setFlag(true); // indicates that the mana is from second ability
|
||||
return new SliverHiveConditionalMana(this.mana);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Spend this mana only to cast a Sliver spell.";
|
||||
}
|
||||
}
|
||||
|
||||
class SliverHiveConditionalMana extends ConditionalMana {
|
||||
|
||||
SliverHiveConditionalMana(Mana mana) {
|
||||
super(mana);
|
||||
staticText = "Spend this mana only to cast a Sliver spell.";
|
||||
addCondition(new SliverHiveManaCondition());
|
||||
}
|
||||
}
|
||||
|
||||
class SliverHiveManaCondition extends CreatureCastManaCondition {
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source, UUID manaProducer, Cost costToPay) {
|
||||
if (super.apply(game, source)) {
|
||||
MageObject object = game.getObject(source.getSourceId());
|
||||
if (object.hasSubtype("Sliver", game)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.ConditionalMana;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
|
@ -39,8 +38,11 @@ import mage.abilities.mana.builder.ConditionalManaBuilder;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.Game;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
|
@ -96,7 +98,7 @@ class SmokebraiderManaCondition implements Condition {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
MageObject object = game.getObject(source.getSourceId());
|
||||
if (object != null && object.hasSubtype("Elemental", game)) {
|
||||
if (object != null && object.hasSubtype(SubType.ELEMENTAL, game)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
|
@ -48,6 +47,8 @@ import mage.game.events.GameEvent.EventType;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX
|
||||
|
@ -114,7 +115,7 @@ class SosukeSonOfSeshiroTriggeredAbility extends TriggeredAbilityImpl {
|
|||
Permanent sourceCreature = game.getPermanent(event.getSourceId());
|
||||
Permanent targetCreature = game.getPermanent(event.getTargetId());
|
||||
if (sourceCreature != null && sourceCreature.getControllerId().equals(this.getControllerId())
|
||||
&& targetCreature != null && sourceCreature.hasSubtype("Warrior", game)) {
|
||||
&& targetCreature != null && sourceCreature.hasSubtype(SubType.WARRIOR, game)) {
|
||||
this.getEffects().get(0).setTargetPointer(new FixedTarget(targetCreature.getId()));
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.common.AsEntersBattlefieldAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.ChooseCreatureTypeEffect;
|
||||
|
@ -35,14 +34,13 @@ import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
|
|||
import mage.abilities.keyword.ShroudAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.constants.*;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author markedagain
|
||||
|
@ -85,8 +83,8 @@ class FilterSteelyResolve extends FilterCreaturePermanent {
|
|||
@Override
|
||||
public boolean match(Permanent permanent, UUID sourceId, UUID playerId, Game game) {
|
||||
if (super.match(permanent, sourceId, playerId, game)) {
|
||||
String subtype = (String) game.getState().getValue(sourceId + "_type");
|
||||
if (subtype != null && !subtype.isEmpty() && permanent.hasSubtype(subtype, game)) {
|
||||
SubType subtype = (SubType) game.getState().getValue(sourceId + "_type");
|
||||
if (subtype != null && permanent.hasSubtype(subtype, game)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,11 +27,6 @@
|
|||
*/
|
||||
package mage.cards.t;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.MageObjectReference;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
|
@ -39,6 +34,7 @@ import mage.abilities.effects.common.ExileTargetEffect;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.WatcherScope;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
|
@ -50,8 +46,9 @@ import mage.target.TargetPermanent;
|
|||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.watchers.Watcher;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class TimeToReflect extends CardImpl {
|
||||
|
@ -118,10 +115,10 @@ class BlockedOrWasBlockedByAZombieWatcher extends Watcher {
|
|||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.BLOCKER_DECLARED) {
|
||||
if (game.getPermanent(event.getTargetId()).hasSubtype("Zombie", game)) {
|
||||
if (game.getPermanent(event.getTargetId()).hasSubtype(SubType.ZOMBIE, game)) {
|
||||
this.blockedOrWasBlockedByAZombieWatcher.add(new MageObjectReference(event.getSourceId(), game));
|
||||
}
|
||||
if (game.getPermanent(event.getSourceId()).hasSubtype( "Zombie", game)) {
|
||||
if (game.getPermanent(event.getSourceId()).hasSubtype(SubType.ZOMBIE, game)) {
|
||||
this.blockedOrWasBlockedByAZombieWatcher.add(new MageObjectReference(event.getTargetId(), game));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ public class UncheckedGrowth extends CardImpl {
|
|||
int affectedTargets = 0;
|
||||
for (UUID permanentId : targetPointer.getTargets(game, source)) {
|
||||
Permanent permanent = game.getPermanent(permanentId);
|
||||
if (permanent != null && permanent.hasSubtype("Spirit", game)) {
|
||||
if (permanent != null && permanent.hasSubtype(SubType.SPIRIT, game)) {
|
||||
permanent.addAbility(TrampleAbility.getInstance(), game);
|
||||
affectedTargets++;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.u;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
|
@ -38,10 +37,7 @@ import mage.abilities.effects.common.ExileTargetEffect;
|
|||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.constants.*;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.DamagePlayerEvent;
|
||||
import mage.game.events.GameEvent;
|
||||
|
@ -51,6 +47,8 @@ import mage.game.permanent.token.ZombieToken;
|
|||
import mage.players.Player;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward
|
||||
|
@ -152,7 +150,7 @@ class UndeadAlchemistEffect extends ReplacementEffectImpl {
|
|||
if (damageEvent.isCombatDamage()) {
|
||||
UUID controllerId = source.getControllerId();
|
||||
Permanent permanent = game.getPermanent(event.getSourceId());
|
||||
if (permanent != null && permanent.hasSubtype("Zombie", game) && permanent.getControllerId() == controllerId) {
|
||||
if (permanent != null && permanent.hasSubtype(SubType.ZOMBIE, game) && permanent.getControllerId().equals(controllerId)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.mage.test.cards.single;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.permanent.Permanent;
|
||||
import org.junit.Assert;
|
||||
|
@ -28,7 +29,7 @@ public class SpiritMirrorTest extends CardTestPlayerBase {
|
|||
|
||||
assertPermanentCount(playerA, "Reflection", 1);
|
||||
Permanent reflection = getPermanent("Reflection");
|
||||
Assert.assertTrue(reflection.hasSubtype("Reflection", currentGame));
|
||||
Assert.assertTrue(reflection.hasSubtype(SubType.REFLECTION, currentGame));
|
||||
}
|
||||
|
||||
|
||||
|
@ -60,7 +61,7 @@ public class SpiritMirrorTest extends CardTestPlayerBase {
|
|||
// Only one token created
|
||||
assertPermanentCount(playerA, "Reflection", 1);
|
||||
Permanent reflection = getPermanent("Reflection");
|
||||
Assert.assertTrue(reflection.hasSubtype("Reflection", currentGame));
|
||||
Assert.assertTrue(reflection.hasSubtype(SubType.REFLECTION, currentGame));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -36,10 +36,6 @@ public interface MageObject extends MageItem, Serializable {
|
|||
|
||||
boolean hasSubtype(SubType subtype, Game game);
|
||||
|
||||
default boolean hasSubtype(String subtype, Game game){
|
||||
return hasSubtype(SubType.byDescription(subtype), game);
|
||||
}
|
||||
|
||||
EnumSet<SuperType> getSuperType();
|
||||
|
||||
Abilities<Ability> getAbilities();
|
||||
|
|
Loading…
Add table
Reference in a new issue