add game param to card type checks missing it (#10781)

This commit is contained in:
xenohedron 2023-08-12 01:20:33 -04:00 committed by GitHub
parent d68c5ac0aa
commit b7d2be077c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 19 additions and 18 deletions

View file

@ -91,7 +91,7 @@ class BlueDragonEffect extends ContinuousEffectImpl {
int affectedTargets = 0;
for (Target target : source.getTargets()) {
Permanent permanent = game.getPermanent(target.getFirstTarget());
if (permanent != null && permanent.isCreature()) {
if (permanent != null && permanent.isCreature(game)) {
permanent.addPower(power);
affectedTargets++;
}

View file

@ -76,13 +76,13 @@ class CapriciousHellraiserEffect extends OneShotEffect {
if (card != null) {
toExile.add(card);
cardsInGraveyard.remove(card);
if (!card.isCreature() && !card.isLand()) {
if (!card.isCreature(game) && !card.isLand(game)) {
cardsToChooseFrom.add(card);
}
}
}
controller.moveCards(toExile, Zone.EXILED, source, game);
if (cardsToChooseFrom.size() > 0) {
if (!cardsToChooseFrom.isEmpty()) {
TargetCard targetCard = new TargetCard(1, Zone.EXILED, StaticFilters.FILTER_CARD);
controller.choose(Outcome.Copy, cardsToChooseFrom, targetCard, source, game);
Card cardToCopy = game.getCard(targetCard.getTargets().get(0));

View file

@ -85,7 +85,7 @@ class CarthTheLionTriggeredAbility extends TriggeredAbilityImpl {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.isDiesEvent()) {
Permanent permanent = game.getPermanentOrLKIBattlefield(zEvent.getTargetId());
return permanent != null && permanent.isPlaneswalker();
return permanent != null && permanent.isPlaneswalker(game);
}
}
return false;

View file

@ -60,7 +60,7 @@ class DesertionEffect extends OneShotEffect {
return false;
}
return game.getStack().counter(spell.getId(), source, game,
spell.isArtifact() || spell.isCreature() ? PutCards.BATTLEFIELD : PutCards.GRAVEYARD
spell.isArtifact(game) || spell.isCreature(game) ? PutCards.BATTLEFIELD : PutCards.GRAVEYARD
);
}
}

View file

@ -121,7 +121,7 @@ class EtherealValkyrieEffect extends OneShotEffect {
game.getState().setValue(exileCard.getMainCard().getId().toString() + "Foretell Cost", creatureCost);
game.getState().setValue(exileCard.getMainCard().getId().toString() + "Foretell Split Cost", spellCost);
foretellAbility = new ForetellAbility(exileCard, creatureCost, spellCost);
} else if (!exileCard.isLand()){
} else if (!exileCard.isLand(game)){
// normal card
String costText = CardUtil.reduceCost(exileCard.getManaCost(), 2).getText();
game.getState().setValue(exileCard.getId().toString() + "Foretell Cost", costText);

View file

@ -147,11 +147,9 @@ class FiendlashEffect extends OneShotEffect {
}
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent != null) {
if (permanent.isPlaneswalker()) {
permanent.damage(damage, creature.getId(), source, game);
return true;
}
if (permanent != null && (permanent.isPlaneswalker(game))) {
permanent.damage(damage, creature.getId(), source, game);
return true;
}
Player player = game.getPlayer(source.getFirstTarget());
if (player != null) {

View file

@ -96,7 +96,7 @@ class GaleWaterdeepProdigyTriggeredAbility extends SpellCastControllerTriggeredA
}
FilterCard filterCard;
if (spell.isSorcery()) {
if (spell.isSorcery(game)) {
filterCard = INSTANT_FILTER;
} else {
filterCard = SORCERY_FILTER;

View file

@ -84,7 +84,7 @@ class GauntletOfPowerTapForManaAllTriggeredAbility extends TriggeredManaAbility
public boolean checkTrigger(GameEvent event, Game game) {
TappedForManaEvent mEvent = (TappedForManaEvent) event;
Permanent permanent = mEvent.getPermanent();
if (permanent == null || !permanent.isLand() || !permanent.isBasic(game)) {
if (permanent == null || !permanent.isLand(game) || !permanent.isBasic(game)) {
return false;
}
ObjectColor color = (ObjectColor) game.getState().getValue(getSourceId() + "_color");

View file

@ -87,7 +87,7 @@ class MechanizedWarfareEffect extends ReplacementEffectImpl {
return sourceObject != null
&& event.getAmount() > 0
&& (sourceObject.getColor(game).isRed() || sourceObject.isArtifact());
&& (sourceObject.getColor(game).isRed() || sourceObject.isArtifact(game));
}
private static UUID getControllerOrSelf(UUID id, Game game) {
@ -99,4 +99,4 @@ class MechanizedWarfareEffect extends ReplacementEffectImpl {
public MechanizedWarfareEffect copy() {
return new MechanizedWarfareEffect(this);
}
}
}

View file

@ -64,12 +64,15 @@ class SithEternalLightningEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller == null) {
return false;
}
Set<UUID> opponents = game.getOpponents(controller.getId());
if (controller != null && opponents != null) {
if (opponents != null) {
for (UUID opponent : opponents) {
List<Permanent> permanents = game.getBattlefield().getActivePermanents(opponent, game);
for (Permanent permanent : permanents) {
if (permanent.isCreature() && permanent.getControllerId() == opponent) {
if (permanent.isCreature(game) && opponent.equals(permanent.getControllerId())) {
permanent.tap(source, game);
DontUntapInControllersNextUntapStepTargetEffect effect = new DontUntapInControllersNextUntapStepTargetEffect();
effect.setTargetPointer(new FixedTarget(permanent.getId(), game));

View file

@ -166,7 +166,7 @@ class YasharnImplacableEarthEffect extends ContinuousRuleModifyingEffectImpl {
return true; // can't pay with life
}
if (cost instanceof SacrificeSourceCost
&& !permanent.isLand()) {
&& !permanent.isLand(game)) {
return true;
}
if (cost instanceof SacrificeTargetCost) {