* Regeneration abilities - added card hint about activated and used regeneration;

This commit is contained in:
Oleg Agafonov 2020-08-01 21:29:08 +04:00
parent 4ba7c18d43
commit c7595ca476
15 changed files with 244 additions and 87 deletions

View file

@ -0,0 +1,33 @@
package mage.abilities.condition.common;
import mage.abilities.Ability;
import mage.abilities.condition.Condition;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
* Source must be attached to permanent
*
* @author JayDi85
*/
public class AttachedToPermanentCondition implements Condition {
final UUID permanentId;
public AttachedToPermanentCondition(UUID permanentId) {
this.permanentId = permanentId;
}
@Override
public boolean apply(Game game, Ability source) {
Permanent attachment = game.getPermanent(source.getSourceId());
Permanent permanent = game.getPermanent(this.permanentId);
if (attachment != null && permanent != null) {
return permanent.getAttachments().contains(attachment.getId());
}
return false;
}
}