mirror of
https://github.com/magefree/mage.git
synced 2025-12-28 22:42:03 -08:00
[SLD] Implemented Ken, Burning Brawler
This commit is contained in:
parent
87aa1b326b
commit
c276e8479b
2 changed files with 95 additions and 9 deletions
89
Mage.Sets/src/mage/cards/k/KenBurningBrawler.java
Normal file
89
Mage.Sets/src/mage/cards/k/KenBurningBrawler.java
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
package mage.cards.k;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DealsCombatDamageTriggeredAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
|
||||
import mage.abilities.effects.common.cost.CastWithoutPayingManaCostEffect;
|
||||
import mage.abilities.keyword.FirstStrikeAbility;
|
||||
import mage.abilities.keyword.ProwessAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.game.Game;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class KenBurningBrawler extends CardImpl {
|
||||
|
||||
public KenBurningBrawler(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}{R}");
|
||||
|
||||
this.addSuperType(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.WARRIOR);
|
||||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// Prowess
|
||||
this.addAbility(new ProwessAbility());
|
||||
|
||||
// {R/W}: Ken gains first strike until end of turn.
|
||||
this.addAbility(new SimpleActivatedAbility(new GainAbilitySourceEffect(
|
||||
FirstStrikeAbility.getInstance(), Duration.EndOfTurn
|
||||
), new ManaCostsImpl<>("{R/W}")));
|
||||
|
||||
// Shoryuken—Whenever Ken deals combat damage, you may cast a sorcery spell from your hand with mana value less than or equal to that damage without paying its mana cost.
|
||||
this.addAbility(new DealsCombatDamageTriggeredAbility(
|
||||
new KenBurningBrawlerEffect(), false
|
||||
).withFlavorWord("Shoryuken"));
|
||||
}
|
||||
|
||||
private KenBurningBrawler(final KenBurningBrawler card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public KenBurningBrawler copy() {
|
||||
return new KenBurningBrawler(this);
|
||||
}
|
||||
}
|
||||
|
||||
class KenBurningBrawlerEffect extends OneShotEffect {
|
||||
|
||||
private static final FilterCard filter = new FilterCard("sorcery spell");
|
||||
|
||||
static {
|
||||
filter.add(CardType.SORCERY.getPredicate());
|
||||
}
|
||||
|
||||
KenBurningBrawlerEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "you may cast a sorcery spell from your hand with mana value " +
|
||||
"less than or equal to that damage without paying its mana cost";
|
||||
}
|
||||
|
||||
private KenBurningBrawlerEffect(final KenBurningBrawlerEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public KenBurningBrawlerEffect copy() {
|
||||
return new KenBurningBrawlerEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return new CastWithoutPayingManaCostEffect(
|
||||
StaticValue.get((Integer) getValue("damage")), filter
|
||||
).apply(game, source);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
package mage.abilities.common;
|
||||
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
|
|
@ -26,13 +24,13 @@ public class DealsCombatDamageTriggeredAbility extends TriggeredAbilityImpl {
|
|||
}
|
||||
|
||||
public DealsCombatDamageTriggeredAbility(final DealsCombatDamageTriggeredAbility ability) {
|
||||
super(ability);
|
||||
this.usedInPhase = ability.usedInPhase;
|
||||
super(ability);
|
||||
this.usedInPhase = ability.usedInPhase;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DealsCombatDamageTriggeredAbility copy() {
|
||||
return new DealsCombatDamageTriggeredAbility(this);
|
||||
return new DealsCombatDamageTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -47,10 +45,10 @@ public class DealsCombatDamageTriggeredAbility extends TriggeredAbilityImpl {
|
|||
&& event.getSourceId().equals(this.sourceId)
|
||||
&& ((DamagedEvent) event).isCombatDamage()) {
|
||||
usedInPhase = true;
|
||||
getEffects().setValue("damage", event.getAmount());
|
||||
return true;
|
||||
|
||||
}
|
||||
if (event.getType()== GameEvent.EventType.COMBAT_DAMAGE_STEP_PRE) {
|
||||
if (event.getType() == GameEvent.EventType.COMBAT_DAMAGE_STEP_PRE) {
|
||||
usedInPhase = false;
|
||||
}
|
||||
return false;
|
||||
|
|
@ -58,7 +56,6 @@ public class DealsCombatDamageTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public String getTriggerPhrase() {
|
||||
return "Whenever {this} deals combat damage, " ;
|
||||
return "Whenever {this} deals combat damage, ";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue