Card Contributions
by ubeefx
Moderators: ubeefx, beholder, melvin, ShawnieBoy, Lodici, CCGHQ Admins
Re: Card Contributions
by PalladiaMors » 11 Aug 2014, 02:35
Wow, I sure made a lot of mistakes on the ones I submitted today... If I had noticed that you had changed the Covetous' groovy, I'd have used the new one instead of forcing you to correct every single one of them. And the Kukemssa Pirates, I even forgot the "get power" line from Dwarven Vigilantes in the middle of the code, lol. What happened in that one is that I tried to do it from Thalakos Deceiver, failed, and started over from Vigilantes. The result was that mess. Anyway, sorry for all the trouble.
I'm pretty sure I've outlived my usefulness here - I've done most of the cards I could, I saw one or two things that maybe I could still manage but this *is* time consuming and unfortunately I've got other things to care about. I wish you guys all the best. What you're doing here is amazing. I'll try to show up every now and then to help in the limited manner I can with the huge effort that this project is. Doing the little bit of copy-pasting I did was enough to make me understand the amount of hours that have gone into building Magarena.
Great job!
I'm pretty sure I've outlived my usefulness here - I've done most of the cards I could, I saw one or two things that maybe I could still manage but this *is* time consuming and unfortunately I've got other things to care about. I wish you guys all the best. What you're doing here is amazing. I'll try to show up every now and then to help in the limited manner I can with the huge effort that this project is. Doing the little bit of copy-pasting I did was enough to make me understand the amount of hours that have gone into building Magarena.
Great job!
- PalladiaMors
- Posts: 343
- Joined: 12 Jul 2014, 17:40
- Has thanked: 36 times
- Been thanked: 22 times
Re: Card Contributions
by melvin » 11 Aug 2014, 08:24
I think you're being too hard on yourself. Out of the card submissions I've seen, the quality of your submissions are above average. It shows that you've play tested the cards before submitting.
The Covetous code was updated to be shorter and simpler, that happens all the time. When we find a better way to achieve a particular effect, it usually involves rewriting bits of existing cards to use the better method. The first attempt is usually not how it will end up, that's just the nature of things.
The Covetous code was updated to be shorter and simpler, that happens all the time. When we find a better way to achieve a particular effect, it usually involves rewriting bits of existing cards to use the better method. The first attempt is usually not how it will end up, that's just the nature of things.
-
melvin - AI Programmer
- Posts: 1062
- Joined: 21 Mar 2010, 12:26
- Location: Singapore
- Has thanked: 36 times
- Been thanked: 459 times
Re: Card Contributions
by PalladiaMors » 15 Aug 2014, 18:43
I was watching some of the recent updates and with the new "~" symbol I thought that this would be an easy include. "Activate only during your upkeep" has also recently been implemented, else it would be simple to use {YourUpkeep} like before. However, it's crashing pretty bad - Magarena closes suddenly during play, without even leaving a crash log. What did I do wrong?
edit2: nope, it's the cards. Working as normal without them.
- Code: Select all
name=Marjhan
image=http://mtgimage.com/card/marjhan.jpg
value=2.500
rarity=R
type=Creature
subtype=Leviathan
cost={5}{U}{U}
pt=8/8
ability=SN doesn't untap during your untap step.;\
{U}{U}, Sacrifice a creature: Untap SN. Activate this ability only during your upkeep.;\
{U}{U}: SN gets -1/-0 until end of turn.~SN deals 1 damage to target attacking creature without flying.
timing=main
requires_groovy_code=Sea_Serpent
oracle=Marjhan doesn't untap during your untap step. {U}{U}, Sacrifice a creature: Untap Marjhan. Activate this ability only during your upkeep. Marjhan can't attack unless defending player controls an Island. {U}{U}: Marjhan gets -1/-0 until end of turn and deals 1 damage to target attacking creature without flying. When you control no Islands, sacrifice Marjhan.
edit2: nope, it's the cards. Working as normal without them.
- PalladiaMors
- Posts: 343
- Joined: 12 Jul 2014, 17:40
- Has thanked: 36 times
- Been thanked: 22 times
Re: Card Contributions
by ShawnieBoy » 15 Aug 2014, 21:26
It looks as though it is due to the second part of Marjhan's second activated ability. It essentially reads as:PalladiaMors wrote:I was watching some of the recent updates and with the new "~" symbol I thought that this would be an easy include. "Activate only during your upkeep" has also recently been implemented, else it would be simple to use {YourUpkeep} like before. However, it's crashing pretty bad - Magarena closes suddenly during play, without even leaving a crash log. What did I do wrong?edit: I'm trying other cards and they're also crashing all the time like that. I don't think the problem is in the cards, the current build seems to be crashing during play.
- Code: Select all
name=Marjhan
image=http://mtgimage.com/card/marjhan.jpg
value=2.500
rarity=R
type=Creature
subtype=Leviathan
cost={5}{U}{U}
pt=8/8
ability=SN doesn't untap during your untap step.;\
{U}{U}, Sacrifice a creature: Untap SN. Activate this ability only during your upkeep.;\
{U}{U}: SN gets -1/-0 until end of turn.~SN deals 1 damage to target attacking creature without flying.
timing=main
requires_groovy_code=Sea_Serpent
oracle=Marjhan doesn't untap during your untap step. {U}{U}, Sacrifice a creature: Untap Marjhan. Activate this ability only during your upkeep. Marjhan can't attack unless defending player controls an Island. {U}{U}: Marjhan gets -1/-0 until end of turn and deals 1 damage to target attacking creature without flying. When you control no Islands, sacrifice Marjhan.
edit2: nope, it's the cards. Working as normal without them.
: SN gets -1/-0 until end of turn. SN deals 1 damage to target attacking creature without flying.
As the first part of the ability doesn't need a target, the second one doesn't know what it should be targeting. Swapping them around should solve this as a cheap fix.
-
ShawnieBoy - Programmer
- Posts: 601
- Joined: 02 Apr 2012, 22:42
- Location: UK
- Has thanked: 80 times
- Been thanked: 50 times
Re: Card Contributions
by melvin » 16 Aug 2014, 01:17
PalladiaMors, your fast! The multiple effects concept is relatively new, and it is fairly restrictive at the moment. Only the first effect can have a target, the rest which I denote as riders cannot have a target. Common riders include effects like "Draw a card."
I've added some validation in [1] to ensure that riders do not have targets so you should get an error message on startup. More than one rider is also supported in [1]
[1] https://code.google.com/p/magarena/sour ... de38962e66
I've added some validation in [1] to ensure that riders do not have targets so you should get an error message on startup. More than one rider is also supported in [1]
[1] https://code.google.com/p/magarena/sour ... de38962e66
-
melvin - AI Programmer
- Posts: 1062
- Joined: 21 Mar 2010, 12:26
- Location: Singapore
- Has thanked: 36 times
- Been thanked: 459 times
Re: Card Contributions
by PalladiaMors » 16 Aug 2014, 18:13
Trying to do Lord of the Pit (which would lead to a couple other cards) using Demonic Taskmaster as a start. I think the leftover issue should be relatively simple (though not for me), if I'm wrong just ignore this. The problem here seems to be the "if (player.controlsPermanent(MagicType.Creature))" line. It checks if the player controls a creature to figure out whether the "if" or the "else" events are going to take place. Since as long as the player controls LotP he will always control a creature, it never gets to play the "else" event (the damage). The rest of the script seems to work fine; if it can't find a creature other than LotP to sacrifice the ability fizzles.
I tried player.controlsOtherPermanent but that obviously doesn't exist. I've looked at a lot of cards but can't figure out how to get a card to check for permanents of its type other than itself. Most of the cards with "creature/artifact/whatever other than this" don't require groovy, which makes it harder to find in groovy form. Again, if I'm way off and this isn't the way to do this card, never mind this post.
I tried player.controlsOtherPermanent but that obviously doesn't exist. I've looked at a lot of cards but can't figure out how to get a card to check for permanents of its type other than itself. Most of the cards with "creature/artifact/whatever other than this" don't require groovy, which makes it harder to find in groovy form. Again, if I'm way off and this isn't the way to do this card, never mind this post.
- Code: Select all
[
new MagicAtUpkeepTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer upkeepPlayer) {
return permanent.isController(upkeepPlayer) ?
new MagicEvent(
permanent,
this,
"PN sacrifices a creature other than SN."
) :
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final MagicPermanent permanent = event.getPermanent();
final MagicPlayer player = event.getPlayer();
final MagicTargetChoice targetChoice = new MagicTargetChoice(
new MagicOtherPermanentTargetFilter(
MagicTargetFilterFactory.CREATURE_YOU_CONTROL,
permanent
),
MagicTargetHint.None,
"a creature other than " + permanent + " to sacrifice"
);
if (player.controlsPermanent(MagicType.Creature)) {
game.addEvent(new MagicSacrificePermanentEvent(permanent,player,targetChoice));
} else {
final MagicDamage damage = new MagicDamage(event.getSource(),event.getPlayer(),7)
game.doAction(new MagicDealDamageAction(damage));
}
}
}
]
- PalladiaMors
- Posts: 343
- Joined: 12 Jul 2014, 17:40
- Has thanked: 36 times
- Been thanked: 22 times
Re: Card Contributions
by PalladiaMors » 17 Aug 2014, 23:31
Why in the world is this activating the life loss both during my turn and the opponent's turn? I've copy/pasted & adapted it from Stenchskipper, which seemed to be working fine... Oh yeah, this is Scourge of Numai, one of several creatures in Kamigawa block with Ogre/Demon related triggers.
- Code: Select all
[
new MagicAtUpkeepTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer upkeepPlayer) {
return permanent.getController().controlsPermanent(MagicSubType.Ogre) == false ?
new MagicEvent(
permanent,
this,
"If PN controls no Ogres, lose 2 life."
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.getPlayer().controlsPermanent(MagicSubType.Ogre) == false) {
game.doAction(new MagicChangeLifeAction(event.getPlayer(),-2));
}
}
}
]
- PalladiaMors
- Posts: 343
- Joined: 12 Jul 2014, 17:40
- Has thanked: 36 times
- Been thanked: 22 times
Re: Card Contributions
by ShawnieBoy » 18 Aug 2014, 00:31
Stenchskipper activates at the end of every turn. you need a
- Code: Select all
permanent.isController(upkeepPlayer)
-
ShawnieBoy - Programmer
- Posts: 601
- Joined: 02 Apr 2012, 22:42
- Location: UK
- Has thanked: 80 times
- Been thanked: 50 times
Re: Card Contributions
by jerichopumpkin » 23 Aug 2014, 09:57
Are multiple kickers like Ana Battlemage implementable? That would mean there's a bunch of cards avaible
- jerichopumpkin
- Posts: 212
- Joined: 12 Sep 2013, 11:21
- Has thanked: 19 times
- Been thanked: 13 times
Re: Card Contributions
by PalladiaMors » 24 Aug 2014, 20:15
I noticed a couple mistakes on the cards I've submitted today:
1- Grave Servitude can sometimes be used as removal so it should be "enchant=pump,creature" instead of pos creature.
2- I was trying to do the token for Balduvian Dead and was really happy to find it in the scripts folder already done and with a nice pic. So I added the "sacrifice SN at end of turn" necessary for Balduvian and submitted it. Only later I found out why that token was already available: there's another card (Sek'Kuar, Deathkeeper) already using that same token, but that one doesn't get sacrificed at end of turn. I don't know if it's going to be possible to have two tokens with the same name but different abilities in the game, so if there's no simple way around that, please ignore the submission. It's a pity, I looked pretty hard to find something that could bring Alliances above 30% . I've already failed Exile, which should have been simple, a couple times.
@Jericho, I'm not the person indicated to answer that but since no card with two kickers is currently available, I've listed those as currently unimplementable in the list I've been keeping at the 50% topic.
1- Grave Servitude can sometimes be used as removal so it should be "enchant=pump,creature" instead of pos creature.
2- I was trying to do the token for Balduvian Dead and was really happy to find it in the scripts folder already done and with a nice pic. So I added the "sacrifice SN at end of turn" necessary for Balduvian and submitted it. Only later I found out why that token was already available: there's another card (Sek'Kuar, Deathkeeper) already using that same token, but that one doesn't get sacrificed at end of turn. I don't know if it's going to be possible to have two tokens with the same name but different abilities in the game, so if there's no simple way around that, please ignore the submission. It's a pity, I looked pretty hard to find something that could bring Alliances above 30% . I've already failed Exile, which should have been simple, a couple times.
@Jericho, I'm not the person indicated to answer that but since no card with two kickers is currently available, I've listed those as currently unimplementable in the list I've been keeping at the 50% topic.
- PalladiaMors
- Posts: 343
- Joined: 12 Jul 2014, 17:40
- Has thanked: 36 times
- Been thanked: 22 times
Re: Card Contributions
by melvin » 25 Aug 2014, 01:27
It is, but would be a bit of a hack as only one number is stored in the payed cost to represent the number of times the kicker cost is payed. So we'd have to divide up the number into two parts since there are four cases, non paid (store 0), first kicker paid (store 1), second kicker paid (store 2), first and second kicker paid (store 3).jerichopumpkin wrote:Are multiple kickers like Ana Battlemage implementable? That would mean there's a bunch of cards avaible
There would be two separate additional cost in the groovy code, the first one if paid would set kicker to 1, the second if paid would add 2 to the current kicker value.
Then the first trigger would check if the kicker is odd, the second trigger would check if the kicker >= 2
Thanks for the note, implemented in https://code.google.com/p/magarena/sour ... 1606a01b28PalladiaMors wrote:1- Grave Servitude can sometimes be used as removal so it should be "enchant=pump,creature" instead of pos creature.
The sacrifice effect is not part of the characteristic of the token so it shouldn't be in the token script as it is not worked as 'Put ... and it has "Sacrifice it at end of turn"'. Rather it is modification of the token by the effect, so I implemented it in groovy code, see https://code.google.com/p/magarena/sour ... 914928346fPalladiaMors wrote:2- I was trying to do the token for Balduvian Dead and was really happy to find it in the scripts folder already done and with a nice pic. So I added the "sacrifice SN at end of turn" necessary for Balduvian and submitted it.
-
melvin - AI Programmer
- Posts: 1062
- Joined: 21 Mar 2010, 12:26
- Location: Singapore
- Has thanked: 36 times
- Been thanked: 459 times
Re: Card Contributions
by jerichopumpkin » 25 Aug 2014, 16:54
Would not it be simpler to have 2 separate kicker triggers? After all, as far as I know there are no cards with more than two separate kicker costs... I know it's not a best practice as it is not scalable, but it would keep it nicely separated from multikickermelvin wrote:It is, but would be a bit of a hack as only one number is stored in the payed cost to represent the number of times the kicker cost is payed. So we'd have to divide up the number into two parts since there are four cases, non paid (store 0), first kicker paid (store 1), second kicker paid (store 2), first and second kicker paid (store 3).jerichopumpkin wrote:Are multiple kickers like Ana Battlemage implementable? That would mean there's a bunch of cards avaible
There would be two separate additional cost in the groovy code, the first one if paid would set kicker to 1, the second if paid would add 2 to the current kicker value.
Then the first trigger would check if the kicker is odd, the second trigger would check if the kicker >= 2
- jerichopumpkin
- Posts: 212
- Joined: 12 Sep 2013, 11:21
- Has thanked: 19 times
- Been thanked: 13 times
Re: Card Contributions
by melvin » 26 Aug 2014, 00:38
I am suggesting two separate kicker costs and two separate kicker triggers. Just that between paying the kicker cost and the trigger happening, we need to store the fact that the cost is paid somewhere and the only place as it stands is a single integer which is used for multikicker. Kicker for us is just a special case of multikicker where you can only pay once.jerichopumpkin wrote:Would not it be simpler to have 2 separate kicker triggers? After all, as far as I know there are no cards with more than two separate kicker costs... I know it's not a best practice as it is not scalable, but it would keep it nicely separated from multikicker
-
melvin - AI Programmer
- Posts: 1062
- Joined: 21 Mar 2010, 12:26
- Location: Singapore
- Has thanked: 36 times
- Been thanked: 459 times
Re: Card Contributions
by PalladiaMors » 30 Aug 2014, 15:22
Trying to do Profane Prayers, but for some reason I can't understand, it's giving life to the opponent. The final part of the script seems to me identical to every card with groovy I can find that involves dealing damage/gaining life, so I can't figure out what I did wrong. Can someone please help?
- Code: Select all
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
final int X = cardOnStack.getGame().getNrOfPermanents(MagicSubType.Cleric);
return new MagicEvent(
cardOnStack,
MagicTargetChoice.NEG_TARGET_CREATURE_OR_PLAYER,
new MagicDamageTargetPicker(X),
this,
"SN deals X damage to target creature\$ or player\$ and PN gains X life, where X is the number of Clerics on the battlefield."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game, {
final int X = game.getNrOfPermanents(MagicSubType.Cleric);
final MagicDamage damage=new MagicDamage(event.getSource(),it,X);
game.doAction(new MagicDealDamageAction(damage));
game.doAction(new MagicChangeLifeAction(event.getPlayer(),X));
});
}
}
]
- PalladiaMors
- Posts: 343
- Joined: 12 Jul 2014, 17:40
- Has thanked: 36 times
- Been thanked: 22 times
Re: Card Contributions
by PalladiaMors » 01 Sep 2014, 12:13
Argh, it looks like some cards I submitted yesterday ended up lost in all those Firemind hiccups (Firemind had been hiccupping the entire day). I can recall Downhill Charge, Harpoon Sniper, Hellkite Igniter and Strength of Cedars. The worst part is that I stupidly... deleted all the scripts! Don't ask, it's an OCD-related thing. Anyway, those are all pretty easy so I'll just to them again, just thought I should say something about it. Could be a disaster in case I had actually managed to do something difficult, although in the end it's my own fault for deleting the cards after I send them...
- PalladiaMors
- Posts: 343
- Joined: 12 Jul 2014, 17:40
- Has thanked: 36 times
- Been thanked: 22 times
Who is online
Users browsing this forum: No registered users and 8 guests