mirror of
https://github.com/correl/mage.git
synced 2024-11-14 19:19:32 +00:00
Additional fixes for 9d9916280a
This commit is contained in:
parent
9d9916280a
commit
3c66dc8706
5 changed files with 8 additions and 3 deletions
|
@ -110,7 +110,7 @@ class PortalMageEffect extends OneShotEffect {
|
|||
// Select the new defender
|
||||
TargetDefender target = new TargetDefender(defenders);
|
||||
if (controller.chooseTarget(Outcome.Damage, target, source, game)) {
|
||||
if (!combatGroupTarget.getDefenderId().equals(target.getFirstTarget())) {
|
||||
if (combatGroupTarget.getDefenderId() != null && !combatGroupTarget.getDefenderId().equals(target.getFirstTarget())) {
|
||||
if (combatGroupTarget.changeDefenderPostDeclaration(target.getFirstTarget(), game)) {
|
||||
String attacked = "";
|
||||
Player player = game.getPlayer(target.getFirstTarget());
|
||||
|
|
|
@ -212,7 +212,7 @@ class TheEternalWandererAttackRestrictionEffect extends RestrictionEffect {
|
|||
|
||||
//If there is already a creature attacking The Eternal Wanderer, dont let another creature attack it
|
||||
for(CombatGroup group : game.getCombat().getGroups()){
|
||||
if(group.getDefenderId().equals(source.getSourceId())){
|
||||
if(group.getDefenderId() != null && group.getDefenderId().equals(source.getSourceId())){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ public enum CreaturesAttackingYouCount implements DynamicValue {
|
|||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
int count = 0;
|
||||
for (CombatGroup combatGroup : game.getCombat().getGroups()) {
|
||||
if (combatGroup.getDefenderId().equals(sourceAbility.getControllerId())) {
|
||||
if (combatGroup.getDefenderId() != null && combatGroup.getDefenderId().equals(sourceAbility.getControllerId())) {
|
||||
count += combatGroup.getAttackers().size();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ public class AttackingSameNotBandedPredicate implements Predicate<Permanent> {
|
|||
return combatGroup != null
|
||||
&& input.isAttacking()
|
||||
&& input.getBandedCards().isEmpty()
|
||||
&& combatGroup.getDefenderId() != null
|
||||
&& combatGroup.getDefenderId().equals(defenderId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -66,6 +66,10 @@ public class CombatGroup implements Serializable, Copyable<CombatGroup> {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return can be null
|
||||
*/
|
||||
public UUID getDefenderId() {
|
||||
return defenderId;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue