IncubateEffect

This commit is contained in:
Northmoc
2023-03-29 12:52:12 -04:00
parent 298df71ea7
commit 3519dba3e1
4 changed files with 66 additions and 1 deletions

View File

@@ -100,6 +100,7 @@ public enum ApiType {
Investigate (InvestigateEffect.class), Investigate (InvestigateEffect.class),
Intensify (IntensifyEffect.class), Intensify (IntensifyEffect.class),
ImmediateTrigger (ImmediateTriggerEffect.class), ImmediateTrigger (ImmediateTriggerEffect.class),
Incubate (IncubateEffect.class),
Learn (LearnEffect.class), Learn (LearnEffect.class),
LookAt (LookAtEffect.class), LookAt (LookAtEffect.class),
LoseLife (LifeLoseEffect.class), LoseLife (LifeLoseEffect.class),

View File

@@ -0,0 +1,62 @@
package forge.game.ability.effects;
import forge.game.Game;
import forge.game.ability.AbilityUtils;
import forge.game.card.*;
import forge.game.event.GameEventCombatChanged;
import forge.game.event.GameEventTokenCreated;
import forge.game.player.Player;
import forge.game.spellability.SpellAbility;
import forge.util.Lang;
import org.apache.commons.lang3.mutable.MutableBoolean;
public class IncubateEffect extends TokenEffectBase {
@Override
protected String getStackDescription(SpellAbility sa) {
final StringBuilder sb = new StringBuilder("Incubate ");
final Card card = sa.getHostCard();
final int amount = AbilityUtils.calculateAmount(card, sa.getParamOrDefault("Amount", "1"), sa);
final int times = AbilityUtils.calculateAmount(card, sa.getParamOrDefault("Times", "1"), sa);
sb.append(amount);
if (times > 1) {
sb.append(" ").append(times == 2 ? "twice" : Lang.nounWithNumeral(amount, "times"));
}
sb.append(".").append(" (Create an Incubator token with ");
sb.append(Lang.nounWithNumeral(amount, "+1/+1 counter"));
sb.append(" on it and \"{2}: Transform this artifact.\" It transforms into a 0/0 Phyrexian artifact creature.)");
return sb.toString();
}
@Override
public void resolve(SpellAbility sa) {
final Card card = sa.getHostCard();
final Game game = card.getGame();
final Player activator = sa.getActivatingPlayer();
final String amtString = sa.getParamOrDefault("Amount", "1");
final int times = AbilityUtils.calculateAmount(card, sa.getParamOrDefault("Times", "1"), sa);
// create incubator token
CardZoneTable triggerList = new CardZoneTable();
MutableBoolean combatChanged = new MutableBoolean(false);
sa.putParam("WithCountersType", "P1P1");
sa.putParam("WithCountersAmount", amtString);
makeTokenTable(makeTokenTableInternal(activator, "incubator", times, sa), false,
triggerList, combatChanged, sa);
triggerList.triggerChangesZoneAll(game, sa);
triggerList.clear();
game.fireEvent(new GameEventTokenCreated());
if (combatChanged.isTrue()) {
game.updateCombatForView();
game.fireEvent(new GameEventCombatChanged());
}
}
}

View File

@@ -9,4 +9,4 @@ SVar:Transform:DB$ SetState | Defined$ Valid Incubator.token+YouCtrl | Mode$ Tra
SVar:PumpAll:DB$ PumpAll | ValidCards$ Phyrexian.YouCtrl | KW$ First Strike & Deathtouch | SpellDescription$ Phyrexians you control gain first strike and deathtouch until end of turn. SVar:PumpAll:DB$ PumpAll | ValidCards$ Phyrexian.YouCtrl | KW$ First Strike & Deathtouch | SpellDescription$ Phyrexians you control gain first strike and deathtouch until end of turn.
DeckHas:Ability$Token|Counters & Type$Artifact DeckHas:Ability$Token|Counters & Type$Artifact
DeckHints:Type$Phyrexian DeckHints:Type$Phyrexian
Oracle:At the beginning of combat on your turn, choose one —\n• Incubate 2 twice. (To incubate 2, create an Incubator token with three +1/+1 counters on it and "{2}: Transform this artifact." It transforms into a 0/0 Phyrexian artifact creature.)\n• Transform all Incubator tokens you control.\n• Phyrexians you control gain first strike and deathtouch until end of turn. Oracle:At the beginning of combat on your turn, choose one —\n• Incubate 2 twice. (To incubate 2, create an Incubator token with two +1/+1 counters on it and "{2}: Transform this artifact." It transforms into a 0/0 Phyrexian artifact creature.)\n• Transform all Incubator tokens you control.\n• Phyrexians you control gain first strike and deathtouch until end of turn.

View File

@@ -4,5 +4,7 @@ Types:Creature Phyrexian Knight
PT:1/1 PT:1/1
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigIncubate | TriggerDescription$ When CARDNAME enters the battlefield, incubate 2. T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigIncubate | TriggerDescription$ When CARDNAME enters the battlefield, incubate 2.
SVar:TrigIncubate:DB$ Incubate | Amount$ 2 SVar:TrigIncubate:DB$ Incubate | Amount$ 2
T:Mode$ Transformed | ValidCard$ Phyrexian.YouCtrl | Execute$ TrigPutCounter | TriggerZones$ Battlefield | TriggerDescription$ Whenever a permanent you control transforms into a Phyrexian, put a +1/+1 counter on it.
SVar:TrigPutCounter:DB$ PutCounter | Defined$ TriggeredCard | CounterType$ P1P1
DeckHas:Ability$Token|Counters & Type$Artifact DeckHas:Ability$Token|Counters & Type$Artifact
Oracle:When Norn's Inquisitor enters the battlefield, incubate 2.\nWhenever a permanent you control transforms into a Phyrexian, put a +1/+1 counter on it. Oracle:When Norn's Inquisitor enters the battlefield, incubate 2.\nWhenever a permanent you control transforms into a Phyrexian, put a +1/+1 counter on it.