Merge branch 'mimicvat' into 'master'

Mimic Vat: Update trigger so it doesn't resolve when card moved

See merge request core-developers/forge!4741
This commit is contained in:
Michael Kamensky
2021-05-26 04:34:55 +00:00
5 changed files with 8 additions and 13 deletions

View File

@@ -111,8 +111,7 @@ public abstract class DamageAiBase extends SpellAbilityAi {
final CardCollectionView hand = comp.getCardsIn(ZoneType.Hand); final CardCollectionView hand = comp.getCardsIn(ZoneType.Hand);
if ((enemy.getLife() - restDamage) < 5) { if ((enemy.getLife() - restDamage) < 5) {
// drop the human to less than 5 // drop the human to less than 5 life
// life
return true; return true;
} }
@@ -147,12 +146,12 @@ public abstract class DamageAiBase extends SpellAbilityAi {
} }
} }
} }
if (value > 0) { //more likely to burn with larger hand if (value > 0) { //more likely to burn with larger hand
for (int i = 3; i < hand.size(); i++) { for (int i = 3; i < hand.size(); i++) {
value *= 1.1f; value *= 1.1f;
} }
} }
if (value < 0.2f) { //hard floor to reduce ridiculous odds for instants over time if (value < 0.2f) { //hard floor to reduce ridiculous odds for instants over time
return false; return false;
} else { } else {
final float chance = MyRandom.getRandom().nextFloat(); final float chance = MyRandom.getRandom().nextFloat();

View File

@@ -732,12 +732,10 @@ public class DamageDealAi extends DamageAiBase {
} }
// When giving priority to targeting Creatures for mandatory // When giving priority to targeting Creatures for mandatory
// triggers // triggers feel free to add the Human after we run out of good targets
// feel free to add the Human after we run out of good targets
// TODO: add check here if card is about to die from something // TODO: add check here if card is about to die from something
// on the stack // on the stack or from taking combat damage
// or from taking combat damage
final Cost abCost = sa.getPayCosts(); final Cost abCost = sa.getPayCosts();
boolean freePing = immediately || abCost == null boolean freePing = immediately || abCost == null
@@ -982,7 +980,6 @@ public class DamageDealAi extends DamageAiBase {
@Override @Override
protected boolean doTriggerAINoCost(Player ai, SpellAbility sa, boolean mandatory) { protected boolean doTriggerAINoCost(Player ai, SpellAbility sa, boolean mandatory) {
final Card source = sa.getHostCard(); final Card source = sa.getHostCard();
final String damage = sa.getParam("NumDmg"); final String damage = sa.getParam("NumDmg");
int dmg = AbilityUtils.calculateAmount(source, damage, sa); int dmg = AbilityUtils.calculateAmount(source, damage, sa);

View File

@@ -348,7 +348,6 @@ public abstract class CardTraitBase extends GameObject implements IHasCardView,
} }
list = CardLists.getValidCards(list, sIsPresent.split(","), this.getHostCard().getController(), this.getHostCard(), this); list = CardLists.getValidCards(list, sIsPresent.split(","), this.getHostCard().getController(), this.getHostCard(), this);
final String rightString = presentCompare.substring(2); final String rightString = presentCompare.substring(2);
int right = AbilityUtils.calculateAmount(getHostCard(), rightString, this); int right = AbilityUtils.calculateAmount(getHostCard(), rightString, this);
final int left = list.size(); final int left = list.size();

View File

@@ -340,7 +340,7 @@ public abstract class Trigger extends TriggerReplacementBase {
} }
} }
if ( !meetsCommonRequirements(this.mapParams)) if (!meetsCommonRequirements(this.mapParams))
return false; return false;
return true; return true;

View File

@@ -2,8 +2,8 @@ Name:Mimic Vat
ManaCost:3 ManaCost:3
Types:Artifact Types:Artifact
T:Mode$ ChangesZone | ValidCard$ Creature.nonToken | Origin$ Battlefield | Destination$ Graveyard | OptionalDecider$ You | Execute$ TrigReturn | TriggerZones$ Battlefield | TriggerDescription$ Imprint — Whenever a nontoken creature dies, you may exile that card. If you do, return each other card exiled with CARDNAME to its owner's graveyard. T:Mode$ ChangesZone | ValidCard$ Creature.nonToken | Origin$ Battlefield | Destination$ Graveyard | OptionalDecider$ You | Execute$ TrigReturn | TriggerZones$ Battlefield | TriggerDescription$ Imprint — Whenever a nontoken creature dies, you may exile that card. If you do, return each other card exiled with CARDNAME to its owner's graveyard.
SVar:TrigReturn:DB$ ChangeZone | Origin$ Exile | Destination$ Graveyard | Defined$ Imprinted | SubAbility$ DBCleanup SVar:TrigReturn:DB$ ChangeZone | Origin$ Exile | Destination$ Graveyard | Defined$ Imprinted | SubAbility$ DBCleanup | ConditionPresent$ Card.inRealZone Graveyard | ConditionDefined$ TriggeredNewCardLKICopy | ConditionCompare$ EQ1
SVar:DBCleanup:DB$ Cleanup | ClearImprinted$ True | SubAbility$ DBExile SVar:DBCleanup:DB$ Cleanup | ClearImprinted$ True | SubAbility$ DBExile | ConditionPresent$ Card.inRealZone Graveyard | ConditionDefined$ TriggeredNewCardLKICopy | ConditionCompare$ EQ1
SVar:DBExile:DB$ ChangeZone | Imprint$ True | Origin$ Graveyard | Destination$ Exile | Defined$ TriggeredNewCardLKICopy | AILogic$ MimicVat SVar:DBExile:DB$ ChangeZone | Imprint$ True | Origin$ Graveyard | Destination$ Exile | Defined$ TriggeredNewCardLKICopy | AILogic$ MimicVat
A:AB$ CopyPermanent | Cost$ 3 T | Defined$ Imprinted.ExiledWithSource | Choices$ Card | PumpKeywords$ Haste | AtEOT$ Exile | AILogic$ MimicVat | SpellDescription$ Create a token that's a copy of a card exiled with CARDNAME. It gains haste. Exile it at the beginning of the next end step. A:AB$ CopyPermanent | Cost$ 3 T | Defined$ Imprinted.ExiledWithSource | Choices$ Card | PumpKeywords$ Haste | AtEOT$ Exile | AILogic$ MimicVat | SpellDescription$ Create a token that's a copy of a card exiled with CARDNAME. It gains haste. Exile it at the beginning of the next end step.
T:Mode$ ChangesZone | Origin$ Exile | Destination$ Any | Static$ True | ValidCard$ Card.IsImprinted+ExiledWithSource | Execute$ DBForget T:Mode$ ChangesZone | Origin$ Exile | Destination$ Any | Static$ True | ValidCard$ Card.IsImprinted+ExiledWithSource | Execute$ DBForget