forked from External/mage
[Refactor] Merged some similar abilities together
This commit is contained in:
parent
e4727a1063
commit
e057bde150
85 changed files with 412 additions and 845 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue