added Rhox and Break of Day

master
beholder 2012-02-19 14:09:41 +01:00
parent 9b84f3c425
commit d0f5d4a032
4 changed files with 136 additions and 0 deletions

View File

@ -0,0 +1,11 @@
>Break of Day
url=http://magiccards.info/dka/en/3.html
image=http://magiccards.info/scans/en/dka/3.jpg
value=3
rarity=C
type=Instant
color=w
converted=2
cost={1}{W}
timing=pump
requires_card_code

View File

@ -0,0 +1,14 @@
>Rhox
url=http://magiccards.info/10e/en/291.html
image=http://magiccards.info/scans/en/10e/291.jpg
value=5
rarity=R
type=Creature
subtype=Beast
color=g
converted=6
cost={4}{G}{G}
pt=5/5
timing=main
ability=regenerate {2}{G}
requires_card_code

View File

@ -0,0 +1,52 @@
package magic.card;
import magic.model.MagicAbility;
import magic.model.MagicGame;
import magic.model.MagicPayedCost;
import magic.model.MagicPermanent;
import magic.model.MagicPlayer;
import magic.model.action.MagicChangeTurnPTAction;
import magic.model.action.MagicMoveCardAction;
import magic.model.action.MagicSetAbilityAction;
import magic.model.event.MagicEvent;
import magic.model.event.MagicSpellCardEvent;
import magic.model.stack.MagicCardOnStack;
import magic.model.target.MagicTarget;
import magic.model.target.MagicTargetFilter;
import java.util.Collection;
public class Break_of_Day {
public static final MagicSpellCardEvent S = new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
final MagicPlayer player=cardOnStack.getController();
return new MagicEvent(
cardOnStack.getCard(),
player,
new Object[]{cardOnStack,player},
this,
"Creatures you control get +1/+1 until end of turn.");
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object[] data,
final Object[] choiceResults) {
game.doAction(new MagicMoveCardAction((MagicCardOnStack)data[0]));
final MagicPlayer player = (MagicPlayer)data[1];
final Collection<MagicTarget> targets = game.filterTargets(
player,
MagicTargetFilter.TARGET_CREATURE_YOU_CONTROL);
final boolean fatefulHour = player.getLife() <= 5;
for (final MagicTarget target : targets) {
final MagicPermanent creature = (MagicPermanent)target;
game.doAction(new MagicChangeTurnPTAction(creature,1,1));
if (fatefulHour) {
game.doAction(new MagicSetAbilityAction(creature,MagicAbility.Indestructible));
}
}
}
};
}

59
src/magic/card/Rhox.java Normal file
View File

@ -0,0 +1,59 @@
package magic.card;
import magic.model.MagicDamage;
import magic.model.MagicGame;
import magic.model.MagicPermanent;
import magic.model.MagicPermanentState;
import magic.model.MagicPlayer;
import magic.model.action.MagicChangeStateAction;
import magic.model.action.MagicDealDamageAction;
import magic.model.choice.MagicMayChoice;
import magic.model.event.MagicEvent;
import magic.model.target.MagicTarget;
import magic.model.trigger.MagicWhenBecomesBlockedTrigger;
public class Rhox {
public static final MagicWhenBecomesBlockedTrigger T = new MagicWhenBecomesBlockedTrigger() {
@Override
public MagicEvent executeTrigger(
final MagicGame game,
final MagicPermanent permanent,
final MagicPermanent data) {
final MagicPlayer player = permanent.getController();
final MagicPlayer defendingPlayer = game.getOpponent(player);
return (permanent == data ) ?
new MagicEvent(
permanent,
player,
new MagicMayChoice(
player + " may have Rhox deal its combat damage " +
"to defending player as though it weren't blocked."),
new Object[]{permanent,defendingPlayer},
this,
player + " may$ have Rhox deal its combat damage " +
"to defending player as though it weren't blocked."):
MagicEvent.NONE;
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object data[],
final Object[] choiceResults) {
if (MagicMayChoice.isYesChoice(choiceResults[0])) {
final MagicPermanent permanent = (MagicPermanent)data[0];
final MagicDamage damage = new MagicDamage(
permanent,
(MagicTarget)data[1],
permanent.getPower(game),
true);
game.doAction(new MagicDealDamageAction(damage));
game.doAction(new MagicChangeStateAction(
permanent,
MagicPermanentState.NoCombatDamage,
true));
}
}
};
}