mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
Merge branch 'reconfigureWithoutStatic' into 'master'
Reconfigure: use unattach command instead of Static Ability on Card See merge request core-developers/forge!6265
This commit is contained in:
@@ -3482,6 +3482,23 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
|||||||
runParams.put(AbilityKey.AttachSource, this);
|
runParams.put(AbilityKey.AttachSource, this);
|
||||||
runParams.put(AbilityKey.AttachTarget, entity);
|
runParams.put(AbilityKey.AttachTarget, entity);
|
||||||
getController().getGame().getTriggerHandler().runTrigger(TriggerType.Attached, runParams, false);
|
getController().getGame().getTriggerHandler().runTrigger(TriggerType.Attached, runParams, false);
|
||||||
|
|
||||||
|
if (hasKeyword(Keyword.RECONFIGURE)) {
|
||||||
|
// need extra time stamp so it doesn't collide with existing ones
|
||||||
|
long ts = getGame().getNextTimestamp();
|
||||||
|
// TODO make it use a Static Layer Effect instead
|
||||||
|
addChangedCardTypes(null, CardType.parse("Creature", true), false, false, false, false, false, false, false, false, ts, 0, true, false);
|
||||||
|
|
||||||
|
GameCommand unattach = new GameCommand() {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
removeChangedCardTypes(ts, 0);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
addUnattachCommand(unattach);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void unattachFromEntity(final GameEntity entity) {
|
public final void unattachFromEntity(final GameEntity entity) {
|
||||||
|
|||||||
@@ -3122,7 +3122,7 @@ public class CardFactoryUtil {
|
|||||||
attachStr.append("AB$ Attach | ValidTgts$ Creature.YouCtrl+Other | TgtPrompt$ Select target creature you ");
|
attachStr.append("AB$ Attach | ValidTgts$ Creature.YouCtrl+Other | TgtPrompt$ Select target creature you ");
|
||||||
attachStr.append("control | AILogic$ Pump | Secondary$ True | SpellDescription$ Attach ").append(bothStr);
|
attachStr.append("control | AILogic$ Pump | Secondary$ True | SpellDescription$ Attach ").append(bothStr);
|
||||||
final StringBuilder unattachStr = new StringBuilder();
|
final StringBuilder unattachStr = new StringBuilder();
|
||||||
unattachStr.append("AB$ Unattach | Defined$ Self | SpellDescription$ Unattach | Secondary$ True ");
|
unattachStr.append("AB$ Unattach | Defined$ Self | SpellDescription$ Unattach | Secondary$ True | IsPresent$ Card.Self+AttachedTo Creature");
|
||||||
unattachStr.append(bothStr);
|
unattachStr.append(bothStr);
|
||||||
// instantiate attach ability
|
// instantiate attach ability
|
||||||
SpellAbility attachSA = AbilityFactory.getAbility(attachStr.toString(), card);
|
SpellAbility attachSA = AbilityFactory.getAbility(attachStr.toString(), card);
|
||||||
@@ -3606,10 +3606,6 @@ public class CardFactoryUtil {
|
|||||||
}
|
}
|
||||||
effect += " | Description$ " + desc;
|
effect += " | Description$ " + desc;
|
||||||
inst.addStaticAbility(StaticAbility.create(effect, state.getCard(), state, intrinsic));
|
inst.addStaticAbility(StaticAbility.create(effect, state.getCard(), state, intrinsic));
|
||||||
} else if (keyword.startsWith("Reconfigure")) {
|
|
||||||
String effect = "Mode$ Continuous | Affected$ Card.Self | IsPresent$ Card.Self+AttachedTo Creature | "
|
|
||||||
+ "RemoveType$ Creature | Secondary$ True | Description$ Reconfigure (" + inst.getReminderText() + ")";
|
|
||||||
inst.addStaticAbility(StaticAbility.create(effect, state.getCard(), state, intrinsic));
|
|
||||||
} else if (keyword.equals("Shroud")) {
|
} else if (keyword.equals("Shroud")) {
|
||||||
String effect = "Mode$ CantTarget | Shroud$ True | ValidCard$ Card.Self | Secondary$ True"
|
String effect = "Mode$ CantTarget | Shroud$ True | ValidCard$ Card.Self | Secondary$ True"
|
||||||
+ " | Description$ Shroud (" + inst.getReminderText() + ")";
|
+ " | Description$ Shroud (" + inst.getReminderText() + ")";
|
||||||
|
|||||||
Reference in New Issue
Block a user