[PIP] Implement Power Fist

This commit is contained in:
PurpleCrowbar 2024-04-09 17:48:21 +01:00
parent 69b480a150
commit 25a4ef3368
2 changed files with 80 additions and 0 deletions

View file

@ -0,0 +1,78 @@
package mage.cards.p;
import mage.abilities.Ability;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.EquipAbility;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
* @author PurpleCrowbar
*/
public final class PowerFist extends CardImpl {
public PowerFist(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}{G}");
this.subtype.add(SubType.EQUIPMENT);
// Equipped creature has trample and "Whenever this creature deals combat damage to a player, put that many +1/+1 counters on it."
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(TrampleAbility.getInstance(), AttachmentType.EQUIPMENT));
ability.addEffect(new GainAbilityAttachedEffect(
new DealsCombatDamageToAPlayerTriggeredAbility(new PowerFistEffect(), false, true), AttachmentType.EQUIPMENT
).setText("and \"Whenever this creature deals combat damage to a player, put that many +1/+1 counters on it.\""));
this.addAbility(ability);
// Equip {2}
this.addAbility(new EquipAbility(2, false));
}
private PowerFist(final PowerFist card) {
super(card);
}
@Override
public PowerFist copy() {
return new PowerFist(this);
}
}
class PowerFistEffect extends OneShotEffect {
PowerFistEffect() {
super(Outcome.Benefit);
staticText = "put that many +1/+1 counters on it";
}
private PowerFistEffect(final PowerFistEffect effect) {
super(effect);
}
@Override
public PowerFistEffect copy() {
return new PowerFistEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = source.getSourcePermanentIfItStillExists(game);
int damage = (Integer) getValue("damage");
if (permanent == null || damage < 1) {
return false;
}
return permanent.addCounters(
CounterType.P1P1.createInstance(damage),
source.getControllerId(), source, game
);
}
}

View file

@ -226,6 +226,8 @@ public final class Fallout extends ExpansionSet {
cards.add(new SetCardInfo("Pitiless Plunderer", 187, Rarity.UNCOMMON, mage.cards.p.PitilessPlunderer.class));
cards.add(new SetCardInfo("Plains", 317, Rarity.LAND, mage.cards.basiclands.Plains.class, FULL_ART_BFZ_VARIOUS));
cards.add(new SetCardInfo("Powder Ganger", 65, Rarity.RARE, mage.cards.p.PowderGanger.class));
cards.add(new SetCardInfo("Power Fist", 81, Rarity.RARE, mage.cards.p.PowerFist.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Power Fist", 400, Rarity.RARE, mage.cards.p.PowerFist.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Prairie Stream", 280, Rarity.RARE, mage.cards.p.PrairieStream.class));
cards.add(new SetCardInfo("Pre-War Formalwear", 21, Rarity.RARE, mage.cards.p.PreWarFormalwear.class));
cards.add(new SetCardInfo("Puresteel Paladin", 170, Rarity.RARE, mage.cards.p.PuresteelPaladin.class));