Re: Card Contributions
Hold fire PalladiaMors. Your scripts are safely stored in the source control system at http://code.google.com/r/projectfiremin ... ource/list. No need to re-write.
High Quality Resources for Collectible Card Games and Home of the CCGHQ Team
https://www.slightlymagic.net/forum/
https://www.slightlymagic.net/forum/viewtopic.php?f=82&t=5894
Do you have any code?PalladiaMors wrote:I was trying to do some cards that require exiling cards from the top of your library as part of the activation cost, such as Royal Herbalist or Whirling Catapult (bit of an effort to raise Alliances' %). The cards load alright but then crash later during play, the crash log points at the cost part of the script as the reason. I was adding both the remove and the move actions, too. Did I make some kind of mistake or did I stumble upon something that can't be done yet?
[
new MagicPermanentActivation(
new MagicActivationHints(MagicTiming.Removal),
"Damage"
) {
@Override
public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
return [
new MagicPayManaCostEvent(source,"{2}"),
new MagicRemoveCardAction(source.getController().getLibrary().getCardAtTop(),MagicLocationType.OwnersLibrary),
new MagicMoveCardAction(source.getController().getLibrary().getCardAtTop(),MagicLocationType.OwnersLibrary,MagicLocationType.Exile),
new MagicRemoveCardAction(source.getController().getLibrary().getCardAtTop(),MagicLocationType.OwnersLibrary),
new MagicMoveCardAction(source.getController().getLibrary().getCardAtTop(),MagicLocationType.OwnersLibrary,MagicLocationType.Exile)
];
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
return new MagicEvent(
source,
this,
"SN deals 1 damage to each creature and player."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final int amount = 1;
final Collection<MagicPermanent> targets=
game.filterPermanents(event.getPlayer(),MagicTargetFilterFactory.CREATURE_WITHOUT_FLYING);
for (final MagicPermanent target : targets) {
final MagicDamage damage=new MagicDamage(event.getSource(),target,amount);
game.doAction(new MagicDealDamageAction(damage));
}
for (final MagicPlayer player : game.getAPNAP()) {
final MagicDamage damage=new MagicDamage(event.getSource(),player,amount);
game.doAction(new MagicDealDamageAction(damage));
}
}
}
]

Always good to test the boundariesPalladiaMors wrote:Whirling CatapultI studied this a bit more an am now pretty much convinced that it won't work, everything that goes in the costs is always "events", I can't find anything at all with "action". Crashes as soon as I get the card into play, crash log: "Exception from controller.runGame: magic.model.action.MagicRemoveCardAction cannot be cast to magic.model.event.MagicEvent
- Code: Select all
[
new MagicPermanentActivation(
new MagicActivationHints(MagicTiming.Removal),
"Damage"
) {
@Override
public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
return [
new MagicPayManaCostEvent(source,"{2}"),
new MagicRemoveCardAction(source.getController().getLibrary().getCardAtTop(),MagicLocationType.OwnersLibrary),
new MagicMoveCardAction(source.getController().getLibrary().getCardAtTop(),MagicLocationType.OwnersLibrary,MagicLocationType.Exile),
new MagicRemoveCardAction(source.getController().getLibrary().getCardAtTop(),MagicLocationType.OwnersLibrary),
new MagicMoveCardAction(source.getController().getLibrary().getCardAtTop(),MagicLocationType.OwnersLibrary,MagicLocationType.Exile)
];
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
return new MagicEvent(
source,
this,
"SN deals 1 damage to each creature and player."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final int amount = 1;
final Collection<MagicPermanent> targets=
game.filterPermanents(event.getPlayer(),MagicTargetFilterFactory.CREATURE_WITHOUT_FLYING);
for (final MagicPermanent target : targets) {
final MagicDamage damage=new MagicDamage(event.getSource(),target,amount);
game.doAction(new MagicDealDamageAction(damage));
}
for (final MagicPlayer player : game.getAPNAP()) {
final MagicDamage damage=new MagicDamage(event.getSource(),player,amount);
game.doAction(new MagicDealDamageAction(damage));
}
}
}
]
java.lang.ClassCastException: magic.model.action.MagicRemoveCardAction cannot be cast to magic.model.event.MagicEvent"
Don't worry about this, it's just me trying to learn a bit more
Oh, not at all - the exile top of library appears elsewhere, though not always as a cost. Crumbling Sanctuary, Chaos Harlequin, Primal Surge to name a fewPalladiaMors wrote:Wow, what a disappointment. All that work ended up netting just 3 cards, two of which are terrible. At least Arc-Slogger is a very popular card, but seems like I kind of lead you guys into a false path this time... Sorry about that.
The exile target picker only assumes it's targeting an opponent's permanent, so calculates values that way. Flicker type cards should really allow for resetting damage and etb tricks, but the vast majority use a negative picker. This is possibly for speeding up the AI.PalladiaMors wrote:I've submitted Flickerwisp with MagicTargetHint.Negative, but now noticed that's a massive error. Most of the time, the card seems to be used with your own permanents for enters/leaves battlefield combos.