Fix NPE with Starforged Sword (#6188)

* Fix NPE

* Fix The Lord of Pain

---------

Co-authored-by: TRT <>
This commit is contained in:
tool4ever
2024-09-22 19:54:02 +02:00
committed by GitHub
parent 11a7f7b271
commit aebde7a1d0
4 changed files with 8 additions and 8 deletions

View File

@@ -64,7 +64,7 @@ public abstract class SpellAbilityEffect {
// prelude for when this is root ability // prelude for when this is root ability
if (!(sa instanceof AbilitySub)) { if (!(sa instanceof AbilitySub)) {
sb.append(sa.getHostCard()).append(" -"); sb.append(sa.getHostCard()).append(" -");
if (sa.getHostCard().hasPromisedGift()) { if (sa.getHostCard().hasPromisedGift() && sa.hasAdditionalAbility("GiftAbility")) {
sb.append(" Gift "). sb.append(" Gift ").
append(sa.getAdditionalAbility("GiftAbility").getParam("GiftDescription")). append(sa.getAdditionalAbility("GiftAbility").getParam("GiftDescription")).
append(" to ").append(sa.getHostCard().getPromisedGift()).append(". "); append(" to ").append(sa.getHostCard().getPromisedGift()).append(". ");

View File

@@ -24,11 +24,11 @@ public class PlayerProperty {
public static boolean playerHasProperty(Player player, String property, Player sourceController, Card source, CardTraitBase spellAbility) { public static boolean playerHasProperty(Player player, String property, Player sourceController, Card source, CardTraitBase spellAbility) {
Game game = player.getGame(); Game game = player.getGame();
if (property.endsWith("Activator")) { if (property.equals("Activator")) {
sourceController = spellAbility.getHostCard().getController(); if (!player.equals(spellAbility.getHostCard().getController())) {
property = property.substring(0, property.length() - 9); return false;
} }
if (property.equals("You")) { } else if (property.equals("You")) {
if (!player.equals(sourceController)) { if (!player.equals(sourceController)) {
return false; return false;
} }

View File

@@ -3,6 +3,6 @@ ManaCost:2 U
Types:Instant Types:Instant
A:SP$ Pump | ValidTgts$ Creature.OppCtrl | TgtPrompt$ Choose up to one target creature each opponent controls | TargetMin$ 0 | TargetMax$ OneEach | TargetsForEachPlayer$ True | SubAbility$ DBRepeat | SpellDescription$ For each opponent, choose up to one target creature that player controls, then return that creature to its owner's hand unless its controller has you draw a card. A:SP$ Pump | ValidTgts$ Creature.OppCtrl | TgtPrompt$ Choose up to one target creature each opponent controls | TargetMin$ 0 | TargetMax$ OneEach | TargetsForEachPlayer$ True | SubAbility$ DBRepeat | SpellDescription$ For each opponent, choose up to one target creature that player controls, then return that creature to its owner's hand unless its controller has you draw a card.
SVar:DBRepeat:DB$ RepeatEach | DefinedCards$ Targeted | RepeatSubAbility$ DBReturn SVar:DBRepeat:DB$ RepeatEach | DefinedCards$ Targeted | RepeatSubAbility$ DBReturn
SVar:DBReturn:DB$ ChangeZone | Defined$ Remembered | Origin$ Battlefield | Destination$ Hand | UnlessCost$ Draw<1/Player.YouActivator> | UnlessPayer$ RememberedController SVar:DBReturn:DB$ ChangeZone | Defined$ Remembered | Origin$ Battlefield | Destination$ Hand | UnlessCost$ Draw<1/Player.Activator> | UnlessPayer$ RememberedController
SVar:OneEach:PlayerCountOpponents$Amount SVar:OneEach:PlayerCountOpponents$Amount
Oracle:For each opponent, choose up to one target creature that player controls, then return that creature to its owner's hand unless its controller has you draw a card. Oracle:For each opponent, choose up to one target creature that player controls, then return that creature to its owner's hand unless its controller has you draw a card.

View File

@@ -12,5 +12,5 @@ Name:Development
ManaCost:3 U R ManaCost:3 U R
Types:Instant Types:Instant
A:SP$ Repeat | RepeatSubAbility$ DBToken | MaxRepeat$ 3 | StackDescription$ SpellDescription | SpellDescription$ Create a 3/1 red Elemental creature token unless any opponent has you draw a card. Repeat this process two more times. A:SP$ Repeat | RepeatSubAbility$ DBToken | MaxRepeat$ 3 | StackDescription$ SpellDescription | SpellDescription$ Create a 3/1 red Elemental creature token unless any opponent has you draw a card. Repeat this process two more times.
SVar:DBToken:DB$ Token | TokenAmount$ 1 | TokenScript$ r_3_1_elemental | TokenOwner$ You | UnlessPayer$ Player.Opponent | UnlessCost$ Draw<1/Player.YouActivator> | UnlessAI$ MorePowerful SVar:DBToken:DB$ Token | TokenAmount$ 1 | TokenScript$ r_3_1_elemental | TokenOwner$ You | UnlessPayer$ Player.Opponent | UnlessCost$ Draw<1/Player.Activator> | UnlessAI$ MorePowerful
Oracle:Create a 3/1 red Elemental creature token unless any opponent has you draw a card. Repeat this process two more times. Oracle:Create a 3/1 red Elemental creature token unless any opponent has you draw a card. Repeat this process two more times.