added Golden Urn. added missing Glint Hawk Idol class

master
beholder 2011-10-04 11:38:02 +02:00
parent 1fbe822fd3
commit 83c366f843
4 changed files with 225 additions and 0 deletions

View File

@ -11860,3 +11860,12 @@ type=Artifact
converted=2
cost={2}
timing=artifact
>Golden Urn
image=http://magiccards.info/scans/en/som/158.jpg
value=2
rarity=C
type=Artifact
converted=1
cost={1}
timing=artifact

View File

@ -0,0 +1,122 @@
package magic.card;
import java.util.EnumSet;
import magic.model.MagicAbility;
import magic.model.MagicGame;
import magic.model.MagicManaCost;
import magic.model.MagicPayedCost;
import magic.model.MagicPermanent;
import magic.model.MagicPlayer;
import magic.model.MagicPowerToughness;
import magic.model.MagicSource;
import magic.model.MagicSubType;
import magic.model.MagicType;
import magic.model.action.MagicBecomesCreatureAction;
import magic.model.choice.MagicMayChoice;
import magic.model.choice.MagicSimpleMayChoice;
import magic.model.condition.MagicArtificialCondition;
import magic.model.condition.MagicCondition;
import magic.model.event.MagicActivationHints;
import magic.model.event.MagicEvent;
import magic.model.event.MagicPayManaCostEvent;
import magic.model.event.MagicPermanentActivation;
import magic.model.event.MagicTiming;
import magic.model.mstatic.MagicLayer;
import magic.model.mstatic.MagicStatic;
import magic.model.trigger.MagicWhenOtherComesIntoPlayTrigger;
public class Glint_Hawk_Idol {
private static final MagicStatic PT = new MagicStatic(MagicLayer.SetPT, MagicStatic.UntilEOT) {
@Override
public void getPowerToughness(final MagicGame game,final MagicPermanent permanent,final MagicPowerToughness pt) {
pt.set(2,2);
}
};
private static final MagicStatic AB = new MagicStatic(MagicLayer.Ability, MagicStatic.UntilEOT) {
@Override
public long getAbilityFlags(final MagicGame game,final MagicPermanent permanent,final long flags) {
return flags|MagicAbility.Flying.getMask();
}
};
private static final MagicStatic ST = new MagicStatic(MagicLayer.Type, MagicStatic.UntilEOT) {
@Override
public EnumSet<MagicSubType> getSubTypeFlags(final MagicPermanent permanent,final EnumSet<MagicSubType> flags) {
final EnumSet<MagicSubType> mod = flags.clone();
mod.add(MagicSubType.Bird);
return mod;
}
@Override
public int getTypeFlags(final MagicPermanent permanent,final int flags) {
return flags|MagicType.Creature.getMask();
}
};
public static final MagicWhenOtherComesIntoPlayTrigger T = new MagicWhenOtherComesIntoPlayTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent otherPermanent) {
final MagicPlayer player = permanent.getController();
return (otherPermanent != permanent &&
otherPermanent.isArtifact() &&
otherPermanent.getController() == player) ?
new MagicEvent(
permanent,
player,
new MagicSimpleMayChoice(
"You may have " + permanent + " become a 2/2 Bird " +
"artifact creature with flying until end of turn.",
MagicSimpleMayChoice.BECOME_CREATURE,
0,
MagicSimpleMayChoice.DEFAULT_YES),
new Object[]{permanent},
this,
"You may$ have " + permanent + " become a 2/2 Bird " +
"artifact creature with flying until end of turn."):
MagicEvent.NONE;
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object data[],
final Object[] choiceResults) {
if (MagicMayChoice.isYesChoice(choiceResults[0])) {
game.doAction(new MagicBecomesCreatureAction((MagicPermanent)data[0],PT,AB,ST));
}
}
};
public static final MagicPermanentActivation A = new MagicPermanentActivation(
new MagicCondition[]{
MagicManaCost.WHITE.getCondition(),
new MagicArtificialCondition(
MagicManaCost.ZERO.getCondition(),
MagicCondition.ABILITY_ONCE_CONDITION)
},
new MagicActivationHints(MagicTiming.Animate),
"Animate") {
@Override
public MagicEvent[] getCostEvent(final MagicSource source) {
return new MagicEvent[]{new MagicPayManaCostEvent(source,source.getController(),MagicManaCost.WHITE)};
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
return new MagicEvent(
source,
source.getController(),
new Object[]{source},
this,
source + " becomes a 2/2 Bird artifact " +
"creature with flying until end of turn.");
}
@Override
public void executeEvent(final MagicGame game,final MagicEvent event,
final Object[] data,final Object[] choiceResults) {
game.doAction(new MagicBecomesCreatureAction((MagicPermanent)data[0],PT,AB,ST));
}
};
}

View File

@ -0,0 +1,93 @@
package magic.card;
import magic.model.MagicCounterType;
import magic.model.MagicGame;
import magic.model.MagicManaCost;
import magic.model.MagicPayedCost;
import magic.model.MagicPermanent;
import magic.model.MagicPlayer;
import magic.model.MagicSource;
import magic.model.action.MagicChangeCountersAction;
import magic.model.action.MagicChangeLifeAction;
import magic.model.action.MagicDrawAction;
import magic.model.choice.MagicMayChoice;
import magic.model.choice.MagicSimpleMayChoice;
import magic.model.condition.MagicCondition;
import magic.model.event.MagicActivationHints;
import magic.model.event.MagicEvent;
import magic.model.event.MagicPayManaCostEvent;
import magic.model.event.MagicPermanentActivation;
import magic.model.event.MagicSacrificeEvent;
import magic.model.event.MagicTapEvent;
import magic.model.event.MagicTiming;
import magic.model.trigger.MagicAtUpkeepTrigger;
public class Golden_Urn {
public static final MagicAtUpkeepTrigger T = new MagicAtUpkeepTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer data) {
final MagicPlayer player = permanent.getController();
return (player == data) ?
new MagicEvent(
permanent,
player,
new MagicSimpleMayChoice(
"You may put a charge counter on " + permanent + ".",
MagicSimpleMayChoice.ADD_CHARGE_COUNTER,
1,
MagicSimpleMayChoice.DEFAULT_YES),
new Object[]{permanent},
this,
"You may$ put a charge counter on " + permanent + "."):
MagicEvent.NONE;
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object data[],
final Object[] choiceResults) {
if (MagicMayChoice.isYesChoice(choiceResults[0])) {
game.doAction(new MagicChangeCountersAction((MagicPermanent)data[0],MagicCounterType.Charge,1,true));
}
}
};
public static final MagicPermanentActivation A = new MagicPermanentActivation(
new MagicCondition[]{MagicCondition.CAN_TAP_CONDITION},
new MagicActivationHints(MagicTiming.Pump),
"Gain life") {
@Override
public MagicEvent[] getCostEvent(final MagicSource source) {
final MagicPermanent permanent = (MagicPermanent)source;
return new MagicEvent[]{
new MagicTapEvent(permanent),
new MagicSacrificeEvent(permanent)};
}
@Override
public MagicEvent getPermanentEvent(
final MagicPermanent source,
final MagicPayedCost payedCost) {
final MagicPlayer player = source.getController();
final int amount = source.getCounters(MagicCounterType.Charge);
return amount > 0 ?
new MagicEvent(
source,
player,
new Object[]{player,amount},
this,
player + " gains " + amount + " life.") :
MagicEvent.NONE;
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object[] data,
final Object[] choiceResults) {
game.doAction(new MagicChangeLifeAction((MagicPlayer)data[0],(Integer)data[1]));
}
};
}

View File

@ -21,6 +21,7 @@ public class MagicSimpleMayChoice extends MagicChoice {
public static final int OPPONENT_LOSE_LIFE = 4; // always returns YES_CHOICE_LIST
public static final int UNTAP = 5; // always returns YES_CHOICE_LIST
public static final int BECOME_CREATURE = 6; // always returns YES_CHOICE_LIST
public static final int ADD_CHARGE_COUNTER = 7; // always returns YES_CHOICE_LIST
public static final int DEFAULT_NONE = 0;
public static final int DEFAULT_NO = 1;