Skip to content

Commit

Permalink
Implemented Unstable cards & fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Zzooouhh authored Sep 30, 2018
1 parent 4e640dc commit 650986a
Show file tree
Hide file tree
Showing 8 changed files with 497 additions and 6 deletions.
36 changes: 36 additions & 0 deletions Mage.Sets/src/mage/cards/b/BeastInShow.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

package mage.cards.b;

import java.util.UUID;
import mage.MageInt;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;

/**
*
* @author L_J
*/
public final class BeastInShow extends CardImpl {

public BeastInShow(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{G}{G}");
this.subtype.add(SubType.BEAST);
this.power = new MageInt(6);
this.toughness = new MageInt(4);

// Trample
this.addAbility(TrampleAbility.getInstance());
}

public BeastInShow(final BeastInShow card) {
super(card);
}

@Override
public BeastInShow copy() {
return new BeastInShow(this);
}
}
33 changes: 33 additions & 0 deletions Mage.Sets/src/mage/cards/d/DelightedKillbot.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

package mage.cards.d;

import java.util.UUID;
import mage.MageInt;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;

/**
*
* @author spjspj
*/
public final class DelightedKillbot extends CardImpl {

public DelightedKillbot(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{2}");

this.subtype.add(SubType.KILLBOT);
this.power = new MageInt(2);
this.toughness = new MageInt(1);
}

public DelightedKillbot(final DelightedKillbot card) {
super(card);
}

@Override
public DelightedKillbot copy() {
return new DelightedKillbot(this);
}
}
33 changes: 33 additions & 0 deletions Mage.Sets/src/mage/cards/d/DespondentKillbot.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

package mage.cards.d;

import java.util.UUID;
import mage.MageInt;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;

/**
*
* @author spjspj
*/
public final class DespondentKillbot extends CardImpl {

public DespondentKillbot(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{2}");

this.subtype.add(SubType.KILLBOT);
this.power = new MageInt(2);
this.toughness = new MageInt(1);
}

public DespondentKillbot(final DespondentKillbot card) {
super(card);
}

@Override
public DespondentKillbot copy() {
return new DespondentKillbot(this);
}
}
33 changes: 33 additions & 0 deletions Mage.Sets/src/mage/cards/e/EnragedKillbot.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

package mage.cards.e;

import java.util.UUID;
import mage.MageInt;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;

/**
*
* @author spjspj
*/
public final class EnragedKillbot extends CardImpl {

public EnragedKillbot(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{2}");

this.subtype.add(SubType.KILLBOT);
this.power = new MageInt(2);
this.toughness = new MageInt(1);
}

public EnragedKillbot(final EnragedKillbot card) {
super(card);
}

@Override
public EnragedKillbot copy() {
return new EnragedKillbot(this);
}
}
154 changes: 154 additions & 0 deletions Mage.Sets/src/mage/cards/h/HammerJammer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@

package mage.cards.h;

import java.util.ArrayList;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.counters.Counter;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.players.Player;

/**
*
* @author spjspj & L_J
*/
public final class HammerJammer extends CardImpl {

public HammerJammer(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}");
this.subtype.add(SubType.GOBLIN);
this.subtype.add(SubType.WARRIOR);
this.power = new MageInt(0);
this.toughness = new MageInt(0);

// As Hammer Jammer enters the battlefield, roll a six-sided die. Hammer Jammer enters the battlefield with a number of +1/+1 counters on it equal to the result.
this.addAbility(new EntersBattlefieldAbility(new HammerJammerEntersEffect(CounterType.P1P1.createInstance())));

// Whenever you roll a die, remove all +1/+1 counters from Hammer Jammer, then put a number of +1/+1 counters on it equal to the result.
this.addAbility(new HammerJammerTriggeredAbility());

}

public HammerJammer(final HammerJammer card) {
super(card);
}

@Override
public HammerJammer copy() {
return new HammerJammer(this);
}
}

class HammerJammerEntersEffect extends EntersBattlefieldWithXCountersEffect {

public HammerJammerEntersEffect(Counter counter) {
super(counter);
}

public HammerJammerEntersEffect(EntersBattlefieldWithXCountersEffect effect) {
super(effect);
}

@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanentEntering(source.getSourceId());
if (controller != null && permanent != null) {
int amount = controller.rollDice(game, 6);
ArrayList<UUID> appliedEffects = (ArrayList<UUID>) this.getValue("appliedEffects"); // the basic event is the EntersBattlefieldEvent, so use already applied replacement effects from that event
permanent.addCounters(CounterType.P1P1.createInstance(amount), source, game, appliedEffects);
return super.apply(game, source);
}
return false;
}

@Override
public EntersBattlefieldWithXCountersEffect copy() {
return new HammerJammerEntersEffect(this);
}
}

class HammerJammerTriggeredAbility extends TriggeredAbilityImpl {

public HammerJammerTriggeredAbility() {
super(Zone.BATTLEFIELD, new HammerJammerEffect(), false);
}

public HammerJammerTriggeredAbility(final HammerJammerTriggeredAbility ability) {
super(ability);
}

@Override
public HammerJammerTriggeredAbility copy() {
return new HammerJammerTriggeredAbility(this);
}

@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.DICE_ROLLED;
}

@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (this.getControllerId().equals(event.getPlayerId()) && event.getFlag()) {
for (Effect effect : this.getEffects()) {
effect.setValue("rolled", event.getAmount());
}
return true;
}
return false;
}

@Override
public String getRule() {
return "Whenever you roll a die, " + super.getRule();
}
}

class HammerJammerEffect extends OneShotEffect {

public HammerJammerEffect() {
super(Outcome.Benefit);
this.staticText = "remove all +1/+1 counters from {this}, then put a number of +1/+1 counters on it equal to the result";
}

public HammerJammerEffect(final HammerJammerEffect effect) {
super(effect);
}

@Override
public HammerJammerEffect copy() {
return new HammerJammerEffect(this);
}

@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getSourceId());
if (controller != null && permanent != null) {
if (getValue("rolled") != null) {
int amount = (Integer) getValue("rolled");
permanent.removeCounters(CounterType.P1P1.createInstance(permanent.getCounters(game).getCount(CounterType.P1P1)), game);
permanent.addCounters(CounterType.P1P1.createInstance(amount), source, game);
return true;
}
}
return false;

}
}
39 changes: 39 additions & 0 deletions Mage.Sets/src/mage/cards/n/Novellamental.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

package mage.cards.n;

import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.CanBlockOnlyFlyingAbility;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;

/**
*
* @author L_J
*/
public final class Novellamental extends CardImpl {

public Novellamental(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}");
this.subtype.add(SubType.ELEMENTAL);
this.power = new MageInt(2);
this.toughness = new MageInt(1);

// Flying
this.addAbility(FlyingAbility.getInstance());
// Novellamental can block only creatures with flying.
this.addAbility(new CanBlockOnlyFlyingAbility());
}

public Novellamental(final Novellamental card) {
super(card);
}

@Override
public Novellamental copy() {
return new Novellamental(this);
}
}
Loading

0 comments on commit 650986a

Please sign in to comment.