added Somberwald Vigilante and Soul of the Harvest

master
beholder 2012-06-16 13:35:06 +02:00
parent 90d1a80510
commit 7b5cc9e4e8
4 changed files with 118 additions and 0 deletions

View File

@ -0,0 +1,13 @@
name=Somberwald Vigilante
url=http://magiccards.info/avr/en/156.html
image=http://magiccards.info/scans/en/avr/156.jpg
value=1
rarity=C
type=Creature
subtype=Human,Warrior
color=r
converted=1
cost={R}
pt=1/1
timing=main
requires_card_code

View File

@ -0,0 +1,14 @@
name=Soul of the Harvest
url=http://magiccards.info/avr/en/195.html
image=http://magiccards.info/scans/en/avr/195.jpg
value=5
rarity=R
type=Creature
subtype=Elemental
color=g
converted=6
cost={4}{G}{G}
pt=6/6
ability=trample
timing=main
requires_card_code

View File

@ -0,0 +1,44 @@
package magic.card;
import magic.model.MagicDamage;
import magic.model.MagicGame;
import magic.model.MagicPermanent;
import magic.model.MagicPermanentList;
import magic.model.action.MagicDealDamageAction;
import magic.model.event.MagicEvent;
import magic.model.trigger.MagicWhenBecomesBlockedTrigger;
public class Somberwald_Vigilante {
public static final MagicWhenBecomesBlockedTrigger T = new MagicWhenBecomesBlockedTrigger() {
@Override
public MagicEvent executeTrigger(
final MagicGame game,
final MagicPermanent permanent,
final MagicPermanent creature) {
if (creature == permanent) {
final MagicPermanentList plist = permanent.getBlockingCreatures();
return new MagicEvent(
permanent,
permanent.getController(),
new Object[]{permanent,plist},
this,
permanent + " deals 1 damage to blocking creature.");
}
return MagicEvent.NONE;
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object data[],
final Object[] choiceResults) {
final MagicPermanent permanent = (MagicPermanent)data[0];
final MagicPermanentList plist = (MagicPermanentList)data[1];
for (final MagicPermanent blocker : plist) {
final MagicDamage damage = new MagicDamage(permanent,blocker,1,false);
game.doAction(new MagicDealDamageAction(damage));
}
}
};
}

View File

@ -0,0 +1,47 @@
package magic.card;
import magic.model.MagicGame;
import magic.model.MagicPermanent;
import magic.model.action.MagicDrawAction;
import magic.model.choice.MagicChoice;
import magic.model.choice.MagicSimpleMayChoice;
import magic.model.event.MagicEvent;
import magic.model.trigger.MagicWhenOtherComesIntoPlayTrigger;
public class Soul_of_the_Harvest {
public static final MagicWhenOtherComesIntoPlayTrigger T = new MagicWhenOtherComesIntoPlayTrigger() {
@Override
public MagicEvent executeTrigger(
final MagicGame game,
final MagicPermanent permanent,
final MagicPermanent otherPermanent) {
return (otherPermanent != permanent &&
!otherPermanent.getCard().isToken() &&
otherPermanent.isCreature() &&
otherPermanent.getController() == permanent.getController()) ?
new MagicEvent(
permanent,
permanent.getController(),
new MagicSimpleMayChoice(
"You may draw a card.",
MagicSimpleMayChoice.DRAW_CARDS,
1,
MagicSimpleMayChoice.DEFAULT_NONE),
MagicEvent.NO_DATA,
this,
"You may$ draw a card."):
MagicEvent.NONE;
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object data[],
final Object[] choiceResults) {
if (MagicChoice.isYesChoice(choiceResults[0])) {
game.doAction(new MagicDrawAction(event.getPlayer(),1));
}
}
};
}