forked from External/mage
* Fixed a bug if casting split cards from other players e.g with Mindclaw Shaman (fixes #3867).
This commit is contained in:
parent
ff22a75f34
commit
cba7a510ea
5 changed files with 177 additions and 19 deletions
|
|
@ -966,6 +966,7 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
if (game == null || ability == null) {
|
||||
return false;
|
||||
}
|
||||
ability.setControllerId(getId());
|
||||
if (ability.getSpellAbilityType() != SpellAbilityType.BASE) {
|
||||
ability = chooseSpellAbilityForCast(ability, game, noMana);
|
||||
}
|
||||
|
|
@ -1241,22 +1242,35 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
LinkedHashMap<UUID, ActivatedAbility> useable = new LinkedHashMap<>();
|
||||
for (Ability ability : object.getAbilities()) {
|
||||
if (ability instanceof SpellAbility) {
|
||||
if (((SpellAbility) ability).getSpellAbilityType() == SpellAbilityType.SPLIT_FUSED) {
|
||||
if (zone == Zone.HAND) {
|
||||
// Fix so you don't need to choose Fuse twice
|
||||
useable.clear();
|
||||
useable.put(ability.getId(), (SpellAbility) ability);
|
||||
switch (((SpellAbility) ability).getSpellAbilityType()) {
|
||||
case SPLIT_FUSED:
|
||||
if (zone == Zone.HAND) {
|
||||
if (((SpellAbility) ability).canChooseTarget(game)) {
|
||||
useable.put(ability.getId(), (SpellAbility) ability);
|
||||
}
|
||||
}
|
||||
case SPLIT:
|
||||
if (((SplitCard) object).getLeftHalfCard().getSpellAbility().canChooseTarget(game)) {
|
||||
useable.put(((SplitCard) object).getLeftHalfCard().getSpellAbility().getId(), ((SplitCard) object).getLeftHalfCard().getSpellAbility());
|
||||
}
|
||||
if (((SplitCard) object).getRightHalfCard().getSpellAbility().canChooseTarget(game)) {
|
||||
useable.put(((SplitCard) object).getRightHalfCard().getSpellAbility().getId(), ((SplitCard) object).getRightHalfCard().getSpellAbility());
|
||||
}
|
||||
return useable;
|
||||
} else {
|
||||
// Fuse only allowed from hand
|
||||
continue;
|
||||
}
|
||||
case SPLIT_AFTERMATH:
|
||||
if (zone == Zone.GRAVEYARD) {
|
||||
if (((SplitCard) object).getRightHalfCard().getSpellAbility().canChooseTarget(game)) {
|
||||
useable.put(((SplitCard) object).getRightHalfCard().getSpellAbility().getId(), ((SplitCard) object).getRightHalfCard().getSpellAbility());
|
||||
}
|
||||
} else {
|
||||
if (((SplitCard) object).getLeftHalfCard().getSpellAbility().canChooseTarget(game)) {
|
||||
useable.put(((SplitCard) object).getLeftHalfCard().getSpellAbility().getId(), ((SplitCard) object).getLeftHalfCard().getSpellAbility());
|
||||
}
|
||||
}
|
||||
return useable;
|
||||
default:
|
||||
useable.put(ability.getId(), (SpellAbility) ability);
|
||||
}
|
||||
if (((SpellAbility) ability).getSpellAbilityType() == SpellAbilityType.SPLIT
|
||||
|| ((SpellAbility) ability).getSpellAbilityType() == SpellAbilityType.SPLIT_AFTERMATH) {
|
||||
continue;
|
||||
}
|
||||
useable.put(ability.getId(), (SpellAbility) ability);
|
||||
}
|
||||
}
|
||||
return useable;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue