Trove of Temptation working for Human.

This commit is contained in:
LevelX2 2017-09-15 17:51:54 +02:00
parent 24c2c69a81
commit 5996aa12e6
8 changed files with 45 additions and 38 deletions

View file

@ -27,6 +27,9 @@
*/
package mage.game.permanent;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import mage.MageObject;
import mage.MageObjectReference;
import mage.abilities.Ability;
@ -37,10 +40,6 @@ import mage.game.Controllable;
import mage.game.Game;
import mage.game.GameState;
import java.util.List;
import java.util.Set;
import java.util.UUID;
public interface Permanent extends Card, Controllable {
void setControllerId(UUID controllerId);
@ -223,16 +222,24 @@ public interface Permanent extends Card, Controllable {
*/
void setMaxBlockedBy(int maxBlockedBy);
boolean canAttack(Game game);
/**
*
* @param defenderId id of planeswalker or player to attack
* @param defenderId id of planeswalker or player to attack - can be empty
* to check generally
* @param game
* @return
*/
boolean canAttack(UUID defenderId, Game game);
/**
* Checks if a creature can attack (also if it is tapped)
*
* @param defenderId
* @param game
* @return
*/
boolean canAttackInPrinciple(UUID defenderId, Game game);
boolean canBlock(UUID attackerId, Game game);
boolean canBlockAny(Game game);

View file

@ -1029,16 +1029,16 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
return game.replaceEvent(GameEvent.getEvent(eventType, this.objectId, ownerId));// controllerId seems to me more logical (LevelX2)
}
@Override
public boolean canAttack(Game game) {
return canAttack(null, game);
}
@Override
public boolean canAttack(UUID defenderId, Game game) {
if (tapped) {
return false;
}
return canAttackInPrinciple(defenderId, game);
}
@Override
public boolean canAttackInPrinciple(UUID defenderId, Game game) {
if (hasSummoningSickness() && !game.getContinuousEffects().asThough(this.objectId, AsThoughEffectType.ATTACK_AS_HASTE, this.getControllerId(), game)) {
return false;
}