mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 02:38:02 +00:00
Merge branch 'update_wrapped_description' into 'master'
Update the implementation of trigger replacing ABILITY text Closes #1914 See merge request core-developers/forge!4976
This commit is contained in:
@@ -28,7 +28,7 @@ public class RollDiceEffect extends SpellAbilityEffect {
|
||||
String [] kv = ab.split(":");
|
||||
String desc = sa.getAdditionalAbility(kv[0]).getDescription();
|
||||
if (!desc.isEmpty()) {
|
||||
sb.append("\n\n").append(desc);
|
||||
sb.append("\n").append(desc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,13 +193,13 @@ public abstract class Trigger extends TriggerReplacementBase {
|
||||
if (ApiType.Charm.equals(sa.getApi())) {
|
||||
saDesc = sa.getStackDescription();
|
||||
} else {
|
||||
saDesc = sa.getDescription();
|
||||
saDesc = sa.toString();
|
||||
}
|
||||
} else if (ApiType.Charm.equals(sa.getApi())) {
|
||||
// use special formating, can be used in Card Description
|
||||
saDesc = CharmEffect.makeFormatedDescription(sa);
|
||||
} else {
|
||||
saDesc = sa.getDescription();
|
||||
saDesc = sa.toString();
|
||||
}
|
||||
// string might have leading whitespace
|
||||
saDesc = saDesc.trim();
|
||||
|
||||
@@ -25,7 +25,6 @@ import forge.game.spellability.AbilitySub;
|
||||
import forge.game.spellability.AlternativeCost;
|
||||
import forge.game.spellability.SpellAbility;
|
||||
import forge.game.spellability.SpellAbilityRestriction;
|
||||
import forge.game.spellability.SpellAbilityView;
|
||||
import forge.game.spellability.TargetChoices;
|
||||
import forge.game.spellability.TargetRestrictions;
|
||||
|
||||
@@ -62,12 +61,11 @@ public class WrappedAbility extends Ability {
|
||||
boolean mandatory = false;
|
||||
|
||||
public WrappedAbility(final Trigger regtrig0, final SpellAbility sa0, final Player decider0) {
|
||||
super(sa0.getHostCard(), ManaCost.ZERO, sa0.getView());
|
||||
super(sa0.getHostCard(), ManaCost.ZERO);
|
||||
setTrigger(regtrig0);
|
||||
sa = sa0;
|
||||
sa.setTrigger(regtrig0);
|
||||
decider = decider0;
|
||||
sa.setDescription(this.getStackDescription());
|
||||
}
|
||||
|
||||
public SpellAbility getWrappedAbility() {
|
||||
@@ -202,16 +200,6 @@ public class WrappedAbility extends Ability {
|
||||
return sa.getSATargetingCard();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Card getHostCard() {
|
||||
return sa.getHostCard();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpellAbilityView getView() {
|
||||
return sa.getView();
|
||||
}
|
||||
|
||||
// key for autoyield - if there is a trigger use its description as the wrapper now has triggering information in its description
|
||||
@Override
|
||||
public String yieldKey() {
|
||||
@@ -241,6 +229,7 @@ public class WrappedAbility extends Ability {
|
||||
@Override
|
||||
public String getStackDescription() {
|
||||
final Trigger regtrig = getTrigger();
|
||||
if (regtrig == null) return "";
|
||||
final StringBuilder sb = new StringBuilder(regtrig.replaceAbilityText(regtrig.toString(true), this));
|
||||
List<TargetChoices> allTargets = sa.getAllTargetChoices();
|
||||
if (!allTargets.isEmpty()) {
|
||||
|
||||
@@ -2,9 +2,9 @@ Name:Aberrant Mind Sorcerer
|
||||
ManaCost:4 U
|
||||
Types:Creature Human Elf Shaman
|
||||
PT:3/4
|
||||
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Creature.Self | Execute$ TrigPump | TriggerDescription$ Psionic Spells – When CARDNAME enters the battlefield, choose target instant or sorcery card in your graveyard, then roll a d20.
|
||||
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Creature.Self | Execute$ TrigPump | TriggerDescription$ Psionic Spells – When CARDNAME enters the battlefield, choose target instant or sorcery card in your graveyard, then ABILITY
|
||||
SVar:TrigPump:DB$ Pump | ValidTgts$ Instant.YouOwn,Sorcery.YouOwn | TgtZone$ Graveyard | TgtPrompt$ Choose target instant or sorcery card in your graveyard | SubAbility$ DBRollDice
|
||||
SVar:DBRollDice:DB$ RollDice | Sides$ 20 | ResultSubAbilities$ 1-9:DBLibrary,10-20:DBHand
|
||||
SVar:DBRollDice:DB$ RollDice | Sides$ 20 | ResultSubAbilities$ 1-9:DBLibrary,10-20:DBHand | SpellDescription$ roll a d20.
|
||||
SVar:DBLibrary:DB$ ChangeZone | Defined$ Targeted | Origin$ Graveyard | Destination$ Library | LibraryPosition$ 0 | Optional$ True | SpellDescription$ 1-9 VERT You may put that card on top of your library.
|
||||
SVar:DBHand:DB$ ChangeZone | Defined$ Targeted | Origin$ Graveyard | Destination$ Hand | SpellDescription$ 10-20 VERT Return that card to your hand.
|
||||
Oracle:Psionic Spells — When Aberrant Mind Sorcerer enters the battlefield, choose target instant or sorcery card in your graveyard, then roll a d20.\n1-9 | You may put that card on top of your library.\n10-20 | Return that card to your hand.
|
||||
|
||||
Reference in New Issue
Block a user