[Refactor] Merged some similar abilities together

This commit is contained in:
Styxo 2017-01-05 14:12:18 +01:00
parent e4727a1063
commit e057bde150
85 changed files with 412 additions and 845 deletions

View file

@ -37,7 +37,6 @@ import mage.game.permanent.Permanent;
*
* @author LevelX2
*/
public class CantBeBlockedByCreaturesWithGreaterPowerEffect extends RestrictionEffect {
public CantBeBlockedByCreaturesWithGreaterPowerEffect() {
@ -51,18 +50,12 @@ public class CantBeBlockedByCreaturesWithGreaterPowerEffect extends RestrictionE
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getId().equals(source.getSourceId())) {
return true;
}
return false;
return permanent.getId().equals(source.getSourceId());
}
@Override
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) {
if (blocker.getPower().getValue() > attacker.getPower().getValue()) {
return false;
}
return true;
return blocker.getPower().getValue() <= attacker.getPower().getValue();
}
@Override

View file

@ -50,18 +50,12 @@ public class CantBeBlockedByCreaturesWithLessPowerEffect extends RestrictionEffe
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getId().equals(source.getSourceId())) {
return true;
}
return false;
return permanent.getId().equals(source.getSourceId());
}
@Override
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) {
if (blocker.getPower().getValue() < attacker.getPower().getValue()) {
return false;
}
return true;
return (blocker.getPower().getValue() >= attacker.getPower().getValue());
}
@Override