Ain't a normal month without a Henzie fix (#5671)

This commit is contained in:
tool4ever
2024-07-22 07:19:28 +00:00
committed by GitHub
parent bf855aae82
commit fc803cdbda
29 changed files with 32 additions and 52 deletions

View File

@@ -235,6 +235,7 @@ public final class GameActionUtil {
stackCopy = CardCopyService.getLKICopy(source);
}
stackCopy.setLastKnownZone(game.getStackZone());
stackCopy.setCastFrom(oldZone);
lkicheck = true;
stackCopy.clearStaticChangedCardKeywords(false);

View File

@@ -2050,37 +2050,16 @@ public class CardProperty {
strZone = strZone.substring(0, strZone.indexOf("ByYou", 0));
}
final ZoneType realZone = ZoneType.smartValueOf(strZone);
if (card.getCastFrom() == null || (zoneOwner != null && !card.getCastFrom().getPlayer().equals(zoneOwner))
if (card.getCastFrom() == null || card.getCastSA() == null || (zoneOwner != null && !card.getCastFrom().getPlayer().equals(zoneOwner))
|| (byYou && !sourceController.equals(card.getCastSA().getActivatingPlayer()))
|| realZone != card.getCastFrom().getZoneType()) {
return false;
}
} else if (property.startsWith("wasNotCastFrom")) {
boolean byYou = property.contains("ByYou");
String strZone = property.substring(14);
Player zoneOwner = null;
if (property.contains("Your")) {
strZone = strZone.substring(4);
zoneOwner = sourceController;
}
if (property.contains("Their")) {
strZone = strZone.substring(5);
zoneOwner = controller;
}
if (byYou) {
strZone = strZone.substring(0, strZone.indexOf("ByYou", 0));
}
final ZoneType realZone = ZoneType.smartValueOf(strZone);
if (card.getCastFrom() != null && (zoneOwner == null || card.getCastFrom().getPlayer().equals(zoneOwner))
&& (!byYou || sourceController.equals(card.getCastSA().getActivatingPlayer()))
&& realZone == card.getCastFrom().getZoneType()) {
return false;
}
} else if (property.startsWith("wasCast")) {
} else if (property.startsWith("wasCast")) {
if (!card.wasCast()) {
return false;
}
if (property.contains("ByYou") && !sourceController.equals(card.getCastSA().getActivatingPlayer())) {
if (property.contains("ByYou") && card.getCastSA() != null && !sourceController.equals(card.getCastSA().getActivatingPlayer())) {
return false;
}
} else if (property.equals("wasNotCast")) {