Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MKC] Implement Redemption Arc #11842

Merged
merged 1 commit into from
Feb 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions Mage.Sets/src/mage/cards/r/RedemptionArc.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package mage.cards.r;

import java.util.UUID;

import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.ExileAttachedEffect;
import mage.abilities.effects.common.combat.GoadAttachedEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.IndestructibleAbility;
import mage.constants.*;
import mage.target.common.TargetCreaturePermanent;
import mage.abilities.effects.common.AttachEffect;
import mage.target.TargetPermanent;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;

/**
*
* @author jimga150
*/
public final class RedemptionArc extends CardImpl {

public RedemptionArc(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}");

this.subtype.add(SubType.AURA);

// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment));
this.addAbility(new EnchantAbility(auraTarget));

// Enchanted creature has indestructible and is goaded.
Effect effect = new GainAbilityAttachedEffect(IndestructibleAbility.getInstance(),
AttachmentType.AURA, Duration.WhileOnBattlefield);
effect.setText("Enchanted creature has indestructible");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, is this not the generated text?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, i did not catch that.

effect.setOutcome(Outcome.Benefit);

Effect effect2 = new GoadAttachedEffect();
effect2.setOutcome(Outcome.Benefit);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure about setting outcomes but only affects AI

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, i dont fully understand how the value proposition of a play is made in terms of the AI. i should have set the goaded thing to detriment by my judgement (in a general case), but setting one effect to benefit and the other to detriment on the same card seems like a strange thing to hand the computer. Is there a place this is documented?

Copy link
Member

@JayDi85 JayDi85 Feb 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If ability has multiple effects or different outcomes then you can use Ability::addCustomOutcome -- it will help AI with some decisions (see below about put to battlefield).

AI uses outcomes in few places like battle score calculation, targets selections, yes/no choices, etc. Basic logic:

  • player need make some choice;
  • AI look at effect's outcome and try make good choice: activate good effect/choice, ignore bad effect/choice
  • If AI need choose targets then it will try to choose own creatures for good effects and opponent's creatures for bad effects. It it possible to cancel on bad effect without opponent targets then it will cancel it. And so on.
  • Look in CopyAITest and GainControlAITest for some examples;

Also it used in some AI optimizations like activation of "put to battlefield" abilities before combat:
shot_240224_115617


Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect);
ability.addEffect(effect2);
this.addAbility(ability);

// {1}{W}: Exile enchanted creature.
this.addAbility(new SimpleActivatedAbility(new ExileAttachedEffect(), new ManaCostsImpl<>("{1}{W}")));
}

private RedemptionArc(final RedemptionArc card) {
super(card);
}

@Override
public RedemptionArc copy() {
return new RedemptionArc(this);
}
}
1 change: 1 addition & 0 deletions Mage.Sets/src/mage/sets/MurdersAtKarlovManorCommander.java
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ private MurdersAtKarlovManorCommander() {
cards.add(new SetCardInfo("Psychosis Crawler", 234, Rarity.RARE, mage.cards.p.PsychosisCrawler.class));
cards.add(new SetCardInfo("Ravenous Chupacabra", 136, Rarity.UNCOMMON, mage.cards.r.RavenousChupacabra.class));
cards.add(new SetCardInfo("Reanimate", 137, Rarity.RARE, mage.cards.r.Reanimate.class));
cards.add(new SetCardInfo("Redemption Arc", 13, Rarity.RARE, mage.cards.r.RedemptionArc.class));
cards.add(new SetCardInfo("Reliquary Tower", 282, Rarity.UNCOMMON, mage.cards.r.ReliquaryTower.class));
cards.add(new SetCardInfo("Return of the Wildspeaker", 181, Rarity.RARE, mage.cards.r.ReturnOfTheWildspeaker.class));
cards.add(new SetCardInfo("Rise of the Dark Realms", 138, Rarity.MYTHIC, mage.cards.r.RiseOfTheDarkRealms.class));
Expand Down
Loading