mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
Fix Chef's Kiss
This commit is contained in:
@@ -65,8 +65,6 @@ public class ChangeTargetsEffect extends SpellAbilityEffect {
|
||||
changingTgtSI = changingTgtSI.getSubInstance();
|
||||
}
|
||||
if (allTargets.isEmpty()) {
|
||||
// is it an error or not?
|
||||
System.err.println("Player managed to target a spell without targets with Spellskite's ability.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -98,7 +96,6 @@ public class ChangeTargetsEffect extends SpellAbilityEffect {
|
||||
// random target and DefinedMagnet works on single targets
|
||||
if (sa.hasParam("RandomTarget")) {
|
||||
int div = changingTgtSA.getTotalDividedValue();
|
||||
changingTgtSA.resetTargets();
|
||||
List<GameEntity> candidates = changingTgtSA.getTargetRestrictions().getAllCandidates(changingTgtSA, true);
|
||||
if (sa.hasParam("RandomTargetRestriction")) {
|
||||
candidates.removeIf(new java.util.function.Predicate<GameEntity>() {
|
||||
@@ -108,6 +105,11 @@ public class ChangeTargetsEffect extends SpellAbilityEffect {
|
||||
}
|
||||
});
|
||||
}
|
||||
// CR 115.7a If a target can't be changed to another legal target, the original target is unchanged
|
||||
if (candidates.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
changingTgtSA.resetTargets();
|
||||
GameEntity choice = Aggregates.random(candidates);
|
||||
changingTgtSA.getTargets().add(choice);
|
||||
if (changingTgtSA.isDividedAsYouChoose()) {
|
||||
|
||||
@@ -180,8 +180,10 @@ public class CopySpellAbilityEffect extends SpellAbilityEffect {
|
||||
}
|
||||
});
|
||||
}
|
||||
GameEntity choice = Aggregates.random(candidates);
|
||||
resetFirstTargetOnCopy(copy, choice, chosenSA);
|
||||
if (!candidates.isEmpty()) {
|
||||
GameEntity choice = Aggregates.random(candidates);
|
||||
resetFirstTargetOnCopy(copy, choice, chosenSA);
|
||||
}
|
||||
}
|
||||
|
||||
// extra case for Epic to remove the keyword and the last part of the SpellAbility
|
||||
|
||||
Reference in New Issue
Block a user