mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
- Fix Armory Automaton
This commit is contained in:
@@ -36,30 +36,36 @@ public class AttachEffect extends SpellAbilityEffect {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Card source = sa.getHostCard();
|
Card source = sa.getHostCard();
|
||||||
Card card = sa.getHostCard();
|
|
||||||
|
|
||||||
final List<GameObject> targets = getTargets(sa);
|
CardCollection attachments;
|
||||||
|
final List<GameObject> targets = getDefinedOrTargeted(sa, "Defined");
|
||||||
|
GameObject attachTo;
|
||||||
|
|
||||||
|
if (targets.isEmpty()) {
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
attachTo = targets.get(0);
|
||||||
|
}
|
||||||
|
|
||||||
final Player p = sa.getActivatingPlayer();
|
final Player p = sa.getActivatingPlayer();
|
||||||
String message = "Do you want to attach " + card + " to " + targets + "?";
|
|
||||||
if ( sa.hasParam("Optional") && !p.getController().confirmAction(sa, null, message) )
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (sa.hasParam("Object")) {
|
if (sa.hasParam("Object")) {
|
||||||
CardCollection lists = AbilityUtils.getDefinedCards(source, sa.getParam("Object"), sa);
|
attachments = AbilityUtils.getDefinedCards(source, sa.getParam("Object"), sa);
|
||||||
if (sa.hasParam("ChooseAnObject")) {
|
if (sa.hasParam("ChooseAnObject")) {
|
||||||
card = p.getController().chooseSingleEntityForEffect(lists, sa, sa.getParam("ChooseAnObject"));
|
Card c = p.getController().chooseSingleEntityForEffect(attachments, sa, sa.getParam("ChooseAnObject"));
|
||||||
|
attachments.clear();
|
||||||
|
attachments.add(c);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
card = Iterables.getFirst(lists, null);
|
attachments = new CardCollection(source);
|
||||||
}
|
|
||||||
if (card == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If Cast Targets will be checked on the Stack
|
// If Cast Targets will be checked on the Stack
|
||||||
for (final Object o : targets) {
|
for (final Card attachment : attachments) {
|
||||||
handleAttachment(card, o, sa);
|
String message = "Do you want to attach " + attachment + " to " + attachTo + "?";
|
||||||
|
if ( sa.hasParam("Optional") && !p.getController().confirmAction(sa, null, message) )
|
||||||
|
continue;
|
||||||
|
handleAttachment(attachment, attachTo, sa);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,12 +2,10 @@ Name:Armory Automaton
|
|||||||
ManaCost:3
|
ManaCost:3
|
||||||
Types:Artifact Creature Construct
|
Types:Artifact Creature Construct
|
||||||
PT:2/2
|
PT:2/2
|
||||||
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigPump | OptionalDecider$ You | TriggerDescription$ Whenever CARDNAME enters the battlefield, you may attach any number of target Equipment to it. (Control of the Equipment doesn't change.)
|
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ DBAttach | OptionalDecider$ You | TriggerDescription$ Whenever CARDNAME enters the battlefield or attacks, you may attach any number of target Equipment to it. (Control of the Equipment doesn't change.)
|
||||||
T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ TrigPump | TriggerZones$ Battlefield | OptionalDecider$ You | TriggerDescription$ Whenever CARDNAME attacks, you may attach any number of target Equipment to it. (Control of the Equipment doesn't change.)
|
T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ DBAttach | TriggerZones$ Battlefield | OptionalDecider$ You | Secondary$ True | TriggerDescription$ Whenever CARDNAME attacks, you may attach any number of target Equipment to it. (Control of the Equipment doesn't change.)
|
||||||
SVar:TrigPump:AB$ Pump | Cost$ 0 | ValidTgts$ Equipment | TargetMin$ 0 | TargetMax$ MaxTargets | TgtPrompt$ Select target equipment | SubAbility$ DBAttachAll | StackDescription$ None
|
SVar:DBAttach:DB$ Attach | ValidTgts$ Equipment | TargetMin$ 0 | TargetMax$ MaxTargets | Object$ Targeted | Defined$ Self
|
||||||
SVar:MaxTargets:Count$Valid Equipment
|
SVar:MaxTargets:Count$Valid Equipment
|
||||||
SVar:TrigAttachAll:AB$ RepeatEach | Cost$ 0 | RepeatSubAbility$ DBAttach | RepeatCards$ ParentTarget | SpellDescription$ attach all Equipment on the battlefield to CARDNAME.
|
|
||||||
SVarDBAttach:DB$ Attach | Object$ Remembered | Defined$ Self
|
|
||||||
SVar:HasAttackEffect:TRUE
|
SVar:HasAttackEffect:TRUE
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/armory_automaton.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/armory_automaton.jpg
|
||||||
Oracle:Whenever Armory Automaton enters the battlefield or attacks, you may attach any number of target Equipment to it. (Control of the Equipment doesn't change.)
|
Oracle:Whenever Armory Automaton enters the battlefield or attacks, you may attach any number of target Equipment to it. (Control of the Equipment doesn't change.)
|
||||||
|
|||||||
Reference in New Issue
Block a user