mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
Make yield string methods robust to effects that don't have a host card
This commit is contained in:
@@ -581,9 +581,13 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// key for autoyield - the card description (including number) plus the effect description
|
// key for autoyield - the card description (including number) (if there is a card) plus the effect description
|
||||||
public String yieldKey() {
|
public String yieldKey() {
|
||||||
|
if ( getHostCard() != null ) {
|
||||||
return getHostCard().toString() + ": " + toUnsuppressedString();
|
return getHostCard().toString() + ": " + toUnsuppressedString();
|
||||||
|
} else {
|
||||||
|
return toUnsuppressedString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getStackDescription() {
|
public String getStackDescription() {
|
||||||
|
|||||||
@@ -193,7 +193,11 @@ public class WrappedAbility extends Ability {
|
|||||||
@Override
|
@Override
|
||||||
public String yieldKey() {
|
public String yieldKey() {
|
||||||
if ( getTrigger() != null ) {
|
if ( getTrigger() != null ) {
|
||||||
|
if ( getHostCard() != null ) {
|
||||||
return getHostCard().toString() + ": " + getTrigger().toString();
|
return getHostCard().toString() + ": " + getTrigger().toString();
|
||||||
|
} else {
|
||||||
|
return getTrigger().toString();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return super.yieldKey();
|
return super.yieldKey();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user