mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28: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 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();
|
||||
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")) {
|
||||
CardCollection lists = AbilityUtils.getDefinedCards(source, sa.getParam("Object"), sa);
|
||||
attachments = AbilityUtils.getDefinedCards(source, sa.getParam("Object"), sa);
|
||||
if (sa.hasParam("ChooseAnObject")) {
|
||||
card = p.getController().chooseSingleEntityForEffect(lists, sa, sa.getParam("ChooseAnObject"));
|
||||
} else {
|
||||
card = Iterables.getFirst(lists, null);
|
||||
}
|
||||
if (card == null) {
|
||||
return;
|
||||
Card c = p.getController().chooseSingleEntityForEffect(attachments, sa, sa.getParam("ChooseAnObject"));
|
||||
attachments.clear();
|
||||
attachments.add(c);
|
||||
}
|
||||
} else {
|
||||
attachments = new CardCollection(source);
|
||||
}
|
||||
|
||||
// If Cast Targets will be checked on the Stack
|
||||
for (final Object o : targets) {
|
||||
handleAttachment(card, o, sa);
|
||||
for (final Card attachment : attachments) {
|
||||
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
|
||||
Types:Artifact Creature Construct
|
||||
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$ 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.)
|
||||
SVar:TrigPump:AB$ Pump | Cost$ 0 | ValidTgts$ Equipment | TargetMin$ 0 | TargetMax$ MaxTargets | TgtPrompt$ Select target equipment | SubAbility$ DBAttachAll | StackDescription$ None
|
||||
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$ 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:DBAttach:DB$ Attach | ValidTgts$ Equipment | TargetMin$ 0 | TargetMax$ MaxTargets | Object$ Targeted | Defined$ Self
|
||||
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: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.)
|
||||
|
||||
Reference in New Issue
Block a user