mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
fix CardFactoryUtil.input_targetType to check canTarget()
This commit is contained in:
@@ -2631,18 +2631,22 @@ public class CardFactoryUtil {
|
|||||||
}
|
}
|
||||||
public void selectButtonCancel() {stop();}
|
public void selectButtonCancel() {stop();}
|
||||||
public void selectCard(Card card, PlayerZone zone) {
|
public void selectCard(Card card, PlayerZone zone) {
|
||||||
boolean foundCardType = false;
|
boolean foundCardType = false;
|
||||||
StringTokenizer st = new StringTokenizer(cardTypeList, ";");
|
StringTokenizer st = new StringTokenizer(cardTypeList, ";");
|
||||||
if( cardTypeList.equals("All") ) {
|
if( cardTypeList.equals("All") ) {
|
||||||
foundCardType = true;
|
foundCardType = true;
|
||||||
} else {
|
} else {
|
||||||
while( st.hasMoreTokens() ) {
|
while( st.hasMoreTokens() ) {
|
||||||
if( card.getType().contains( st.nextToken() )) {
|
if( card.getType().contains( st.nextToken() )) {
|
||||||
foundCardType = true;
|
foundCardType = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( foundCardType && zone.is(Constant.Zone.Play)) {
|
if(!canTarget(spell, card)) {
|
||||||
|
AllZone.Display.showMessage("Cannot target this card (Shroud? Protection?).");
|
||||||
|
}
|
||||||
|
|
||||||
|
else if( foundCardType && zone.is(Constant.Zone.Play)) {
|
||||||
spell.setTargetCard(card);
|
spell.setTargetCard(card);
|
||||||
if(spell.getManaCost().equals("0") || this.isFree())//for "sacrifice this card" abilities
|
if(spell.getManaCost().equals("0") || this.isFree())//for "sacrifice this card" abilities
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user