mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 03:51:58 -08:00
Implement Predatory Focus
This commit is contained in:
parent
6dce0c26f3
commit
9108104fe5
4 changed files with 92 additions and 5 deletions
81
Mage.Sets/src/mage/cards/p/PredatoryFocus.java
Normal file
81
Mage.Sets/src/mage/cards/p/PredatoryFocus.java
Normal file
|
|
@ -0,0 +1,81 @@
|
||||||
|
package mage.cards.p;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import mage.MageObject;
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.effects.AsThoughEffect;
|
||||||
|
import mage.abilities.effects.AsThoughEffectImpl;
|
||||||
|
import mage.cards.Card;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.constants.AsThoughEffectType;
|
||||||
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.Duration;
|
||||||
|
import mage.constants.Outcome;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.players.Player;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author noahg
|
||||||
|
*/
|
||||||
|
public final class PredatoryFocus extends CardImpl {
|
||||||
|
|
||||||
|
public PredatoryFocus(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{G}{G}");
|
||||||
|
|
||||||
|
|
||||||
|
// You may have creatures you control assign their combat damage this turn as though they weren't blocked.
|
||||||
|
this.getSpellAbility().addEffect(new PredatoryFocusEffect());
|
||||||
|
}
|
||||||
|
|
||||||
|
public PredatoryFocus(final PredatoryFocus card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PredatoryFocus copy() {
|
||||||
|
return new PredatoryFocus(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class PredatoryFocusEffect extends AsThoughEffectImpl {
|
||||||
|
|
||||||
|
private boolean choseUse;
|
||||||
|
|
||||||
|
public PredatoryFocusEffect() {
|
||||||
|
super(AsThoughEffectType.DAMAGE_NOT_BLOCKED, Duration.EndOfTurn, Outcome.Damage);
|
||||||
|
this.staticText = "You may have creatures you control assign their combat damage this turn as though they weren't blocked.";
|
||||||
|
}
|
||||||
|
|
||||||
|
public PredatoryFocusEffect(PredatoryFocusEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(Ability source, Game game) {
|
||||||
|
super.init(source, game);
|
||||||
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
|
String sourceName = source.getSourceObject(game).getLogName();
|
||||||
|
choseUse = controller.chooseUse(Outcome.Damage, "Have creatures you control deal combat damage this turn" +
|
||||||
|
" as though they weren't blocked?", source, game);
|
||||||
|
game.informPlayers(choseUse ? controller.getName()+" chose to use "+sourceName+"'s effect" :
|
||||||
|
controller.getName()+" chose not to use "+sourceName+"'s effect.");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) {
|
||||||
|
return choseUse && affectedControllerId.equals(source.getControllerId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PredatoryFocusEffect copy() {
|
||||||
|
return new PredatoryFocusEffect(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -130,6 +130,7 @@ public final class Guildpact extends ExpansionSet {
|
||||||
cards.add(new SetCardInfo("Pillory of the Sleepless", 125, Rarity.COMMON, mage.cards.p.PilloryOfTheSleepless.class));
|
cards.add(new SetCardInfo("Pillory of the Sleepless", 125, Rarity.COMMON, mage.cards.p.PilloryOfTheSleepless.class));
|
||||||
cards.add(new SetCardInfo("Plagued Rusalka", 56, Rarity.UNCOMMON, mage.cards.p.PlaguedRusalka.class));
|
cards.add(new SetCardInfo("Plagued Rusalka", 56, Rarity.UNCOMMON, mage.cards.p.PlaguedRusalka.class));
|
||||||
cards.add(new SetCardInfo("Poisonbelly Ogre", 57, Rarity.COMMON, mage.cards.p.PoisonbellyOgre.class));
|
cards.add(new SetCardInfo("Poisonbelly Ogre", 57, Rarity.COMMON, mage.cards.p.PoisonbellyOgre.class));
|
||||||
|
cards.add(new SetCardInfo("Predatory Focus", 92, Rarity.UNCOMMON, mage.cards.p.PredatoryFocus.class));
|
||||||
cards.add(new SetCardInfo("Primeval Light", 93, Rarity.UNCOMMON, mage.cards.p.PrimevalLight.class));
|
cards.add(new SetCardInfo("Primeval Light", 93, Rarity.UNCOMMON, mage.cards.p.PrimevalLight.class));
|
||||||
cards.add(new SetCardInfo("Pyromatics", 72, Rarity.COMMON, mage.cards.p.Pyromatics.class));
|
cards.add(new SetCardInfo("Pyromatics", 72, Rarity.COMMON, mage.cards.p.Pyromatics.class));
|
||||||
cards.add(new SetCardInfo("Quicken", 31, Rarity.RARE, mage.cards.q.Quicken.class));
|
cards.add(new SetCardInfo("Quicken", 31, Rarity.RARE, mage.cards.q.Quicken.class));
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ public enum AsThoughEffectType {
|
||||||
BLOCK_SWAMPWALK,
|
BLOCK_SWAMPWALK,
|
||||||
BLOCK_MOUNTAINWALK,
|
BLOCK_MOUNTAINWALK,
|
||||||
BLOCK_FORESTWALK,
|
BLOCK_FORESTWALK,
|
||||||
|
DAMAGE_NOT_BLOCKED,
|
||||||
BE_BLOCKED,
|
BE_BLOCKED,
|
||||||
PLAY_FROM_NOT_OWN_HAND_ZONE,
|
PLAY_FROM_NOT_OWN_HAND_ZONE,
|
||||||
CAST_AS_INSTANT,
|
CAST_AS_INSTANT,
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import mage.abilities.keyword.DeathtouchAbility;
|
||||||
import mage.abilities.keyword.DoubleStrikeAbility;
|
import mage.abilities.keyword.DoubleStrikeAbility;
|
||||||
import mage.abilities.keyword.FirstStrikeAbility;
|
import mage.abilities.keyword.FirstStrikeAbility;
|
||||||
import mage.abilities.keyword.TrampleAbility;
|
import mage.abilities.keyword.TrampleAbility;
|
||||||
|
import mage.constants.AsThoughEffectType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.filter.StaticFilters;
|
import mage.filter.StaticFilters;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
|
@ -124,12 +125,15 @@ public class CombatGroup implements Serializable, Copyable<CombatGroup> {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
Player player = game.getPlayer(defenderAssignsCombatDamage(game) ? defendingPlayerId : attacker.getControllerId());
|
Player player = game.getPlayer(defenderAssignsCombatDamage(game) ? defendingPlayerId : attacker.getControllerId());
|
||||||
if (attacker.getAbilities().containsKey(DamageAsThoughNotBlockedAbility.getInstance().getId())) { // for handling creatures like Thorn Elemental
|
if ((attacker.getAbilities().containsKey(DamageAsThoughNotBlockedAbility.getInstance().getId()) &&
|
||||||
if (player.chooseUse(Outcome.Damage, "Do you wish to assign damage for " + attacker.getLogName() + " as though it weren't blocked?", null, game)) {
|
player.chooseUse(Outcome.Damage, "Do you wish to assign damage for "
|
||||||
|
+ attacker.getLogName() + " as though it weren't blocked?", null, game)) ||
|
||||||
|
game.getContinuousEffects().asThough(attacker.getId(), AsThoughEffectType.DAMAGE_NOT_BLOCKED
|
||||||
|
, null, attacker.getControllerId(), game) != null) {
|
||||||
|
// for handling creatures like Thorn Elemental
|
||||||
blocked = false;
|
blocked = false;
|
||||||
unblockedDamage(first, game);
|
unblockedDamage(first, game);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (blockers.size() == 1) {
|
if (blockers.size() == 1) {
|
||||||
singleBlockerDamage(player, first, game);
|
singleBlockerDamage(player, first, game);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue