[SPM] Implement Marvel's Spider-Man

This commit is contained in:
theelk801 2025-07-26 08:43:20 -04:00
parent 100fff9c6a
commit 379a3b504d
6 changed files with 121 additions and 114 deletions

View file

@ -0,0 +1,37 @@
package mage.abilities.effects.common;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.constants.Outcome;
import mage.game.Game;
import mage.players.Player;
/**
* @author TheElk801
*/
public class DrawCardsEqualToDifferenceEffect extends OneShotEffect {
private final int amount;
public DrawCardsEqualToDifferenceEffect(int amount) {
super(Outcome.Benefit);
this.amount = amount;
staticText = "draw cards equal to the difference";
}
private DrawCardsEqualToDifferenceEffect(final DrawCardsEqualToDifferenceEffect effect) {
super(effect);
this.amount = effect.amount;
}
@Override
public DrawCardsEqualToDifferenceEffect copy() {
return new DrawCardsEqualToDifferenceEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
return player != null && player.drawCards(Math.max(amount - player.getHand().size(), 0), source, game) > 0;
}
}