mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
add cast check
This commit is contained in:
@@ -47,6 +47,14 @@ public class AttachEffect extends SpellAbilityEffect {
|
|||||||
attachTo = targets.get(0);
|
attachTo = targets.get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String attachToName = null;
|
||||||
|
if (attachTo instanceof Card) {
|
||||||
|
attachToName = CardTranslation.getTranslatedName(((Card)attachTo).getName());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
attachToName = attachTo.toString();
|
||||||
|
}
|
||||||
|
|
||||||
final Player p = sa.getActivatingPlayer();
|
final Player p = sa.getActivatingPlayer();
|
||||||
|
|
||||||
if (sa.hasParam("Object")) {
|
if (sa.hasParam("Object")) {
|
||||||
@@ -62,7 +70,7 @@ public class AttachEffect extends SpellAbilityEffect {
|
|||||||
|
|
||||||
// If Cast Targets will be checked on the Stack
|
// If Cast Targets will be checked on the Stack
|
||||||
for (final Card attachment : attachments) {
|
for (final Card attachment : attachments) {
|
||||||
String message = Localizer.getInstance().getMessage("lblDoYouWantAttachSourceToTarget", CardTranslation.getTranslatedName(attachment.getName()), CardTranslation.getTranslatedName(((Card)attachTo).getName()));
|
String message = Localizer.getInstance().getMessage("lblDoYouWantAttachSourceToTarget", CardTranslation.getTranslatedName(attachment.getName()), attachToName);
|
||||||
if ( sa.hasParam("Optional") && !p.getController().confirmAction(sa, null, message) )
|
if ( sa.hasParam("Optional") && !p.getController().confirmAction(sa, null, message) )
|
||||||
continue;
|
continue;
|
||||||
handleAttachment(attachment, attachTo, sa);
|
handleAttachment(attachment, attachTo, sa);
|
||||||
|
|||||||
Reference in New Issue
Block a user