Merge branch 'rocks' into 'master'

Fix Chained to the Rocks crash

See merge request core-developers/forge!6098
This commit is contained in:
Anthony Calosa
2022-01-30 22:39:16 +00:00
4 changed files with 7 additions and 6 deletions

View File

@@ -125,8 +125,9 @@ public class AttachAi extends SpellAbilityAi {
if (ComputerUtilAbility.getAbilitySourceName(sa).equals("Chained to the Rocks")) {
final SpellAbility effectExile = AbilityFactory.getAbility(source.getSVar("TrigExile"), source);
effectExile.setActivatingPlayer(ai);
final TargetRestrictions exile_tgt = effectExile.getTargetRestrictions();
final CardCollection targets = CardLists.filter(CardUtil.getValidCardsToTarget(exile_tgt, effectExile), CardPredicates.canBeAttached(source));
final List<Card> targets = CardUtil.getValidCardsToTarget(exile_tgt, effectExile);
return !targets.isEmpty();
}

View File

@@ -19,7 +19,7 @@ public class MillEffect extends SpellAbilityEffect {
public void resolve(SpellAbility sa) {
final Card source = sa.getHostCard();
final Game game = source.getGame();
final int numCards = AbilityUtils.calculateAmount(sa.getHostCard(), sa.getParam("NumCards"), sa);
final int numCards = sa.hasParam("NumCards") ? AbilityUtils.calculateAmount(sa.getHostCard(), sa.getParam("NumCards"), sa) : 1;
final boolean bottom = sa.hasParam("FromBottom");
final boolean facedown = sa.hasParam("ExileFaceDown");
final boolean reveal = !sa.hasParam("NoReveal");
@@ -84,7 +84,7 @@ public class MillEffect extends SpellAbilityEffect {
@Override
protected String getStackDescription(SpellAbility sa) {
final StringBuilder sb = new StringBuilder();
final int numCards = AbilityUtils.calculateAmount(sa.getHostCard(), sa.getParam("NumCards"), sa);
final int numCards = sa.hasParam("NumCards") ? AbilityUtils.calculateAmount(sa.getHostCard(), sa.getParam("NumCards"), sa) : 1;
sb.append(Lang.joinHomogenous(getTargetPlayers(sa))).append(" ");

View File

@@ -3108,7 +3108,7 @@ public class Player extends GameEntity implements Comparable<Player> {
{
final String drawTrig = "Mode$ Phase | Phase$ End of Turn | TriggerZones$ Command | " +
"ValidPlayer$ You | TriggerDescription$ At the beginning of your end step, draw a card.";
final String drawEff = "AB$Draw | Cost$ 0 | Defined$ You | NumCards$ 1";
final String drawEff = "AB$ Draw | Cost$ 0 | Defined$ You";
final Trigger drawTrigger = TriggerHandler.parseTrigger(drawTrig, monarchEffect, true);
@@ -3119,7 +3119,7 @@ public class Player extends GameEntity implements Comparable<Player> {
{
final String damageTrig = "Mode$ DamageDone | ValidSource$ Creature | ValidTarget$ You | CombatDamage$ True | TriggerZones$ Command |" +
" TriggerDescription$ Whenever a creature deals combat damage to you, its controller becomes the monarch.";
final String damageEff = "AB$BecomeMonarch | Cost$ 0 | Defined$ TriggeredSourceController";
final String damageEff = "AB$ BecomeMonarch | Cost$ 0 | Defined$ TriggeredSourceController";
final Trigger damageTrigger = TriggerHandler.parseTrigger(damageTrig, monarchEffect, true);

View File

@@ -4,7 +4,7 @@ Types:Legendary Planeswalker Domri
Loyalty:3
S:Mode$ Continuous | Affected$ Creature.YouCtrl | AddPower$ 1 | Description$ Creatures you control get +1/+0.
SVar:PlayMain1:TRUE
A:AB$ Mana | Cost$ AddCounter<1/LOYALTY> | Planeswalker$ True | Produced$ Combo R G | Amount$ 1 | AILogic$ Always | SubAbility$ DBEffect | SpellDescription$ Add {R} or {G}. Creature spells you cast this turn can't be countered.
A:AB$ Mana | Cost$ AddCounter<1/LOYALTY> | Planeswalker$ True | Produced$ Combo R G | Amount$ 1 | AILogic$ Always | SubAbility$ DBEffect | SpellDescription$ Add {R} or {G}.
SVar:DBEffect:DB$ Effect | Name$ Domri, Anarch of Bolas Effect | StaticAbilities$ AntiMagic | SpellDescription$ Creature spells you cast this turn can't be countered
SVar:AntiMagic:Mode$ Continuous | Affected$ Creature.YouCtrl | AffectedZone$ Stack | EffectZone$ Command | AddHiddenKeyword$ CARDNAME can't be countered.
A:AB$ Pump | Planeswalker$ True | Cost$ SubCounter<2/LOYALTY> | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Choose target creature you control | AILogic$ Fight | SpellDescription$ Target creature you control fights target creature you don't control. | SubAbility$ DBFight