Card Contributions
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins
Re: Card Contributions
by swordshine » 24 Jun 2013, 01:34
Have you tested this card? The script looks good, but AFAIK, this card hasn't been scripted because LKI info in Forge doesn't contain combat information. So when a attacking Kithkin or Elf dies, it would never trigger.squee1968 wrote:
- Kithkin Mourncaller | Open
- Name:Kithkin Mourncaller
ManaCost:2 G
Types:Creature Kithkin Scout
PT:2/2
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Creature.Kithkin+attacking+YouOwn,Creature.Elf+attacking+YouOwn | Execute$ TrigDraw | OptionalDecider$ You | TriggerZones$ Battlefield | TriggerDescription$ Whenever an attacking Kithkin or Elf is put into your graveyard from the battlefield, you may draw a card.
SVar:TrigDraw:AB$ Draw | Cost$ 0 | Defined$ You | NumCards$ 1
SVar:RemRandomDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/kithkin_mourncaller.jpg
EDIT: Fixed, thank you, Sol.
- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Re: Card Contributions
by Agetian » 24 Jun 2013, 11:02
This is actually an issue with several cards that are already in the game despite the fact that they don't work correctly as far as post-mortem triggers go (such as Abu Ja'Far - it was marked as a known issue a while ago and has been an issue for almost a year by now, actually), too bad it's apparently difficult to fix - I tried to work on it about a month ago but didn't get anywhere with it. If anyone can actually get the game to remember the relevant combat info for triggers such as this one to actually fire, I'd much appreciate it.swordshine wrote:Have you tested this card? The script looks good, but AFAIK, this card hasn't been scripted because LKI info in Forge doesn't contain combat information. So when a attacking Kithkin or Elf dies, it would never trigger.squee1968 wrote:
- Kithkin Mourncaller | Open
- Name:Kithkin Mourncaller
ManaCost:2 G
Types:Creature Kithkin Scout
PT:2/2
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Creature.Kithkin+attacking+YouOwn,Creature.Elf+attacking+YouOwn | Execute$ TrigDraw | OptionalDecider$ You | TriggerZones$ Battlefield | TriggerDescription$ Whenever an attacking Kithkin or Elf is put into your graveyard from the battlefield, you may draw a card.
SVar:TrigDraw:AB$ Draw | Cost$ 0 | Defined$ You | NumCards$ 1
SVar:RemRandomDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/kithkin_mourncaller.jpg
EDIT: Fixed, thank you, Sol.
- Agetian
- Agetian
- Programmer
- Posts: 3490
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: Card Contributions
by Max mtg » 25 Jun 2013, 13:37
Speaking of Combat LKI,
the only place where that sort of data has to be collected seems to be GameAction.changeZone method, line about 228, when the removed from combat creature leaves battlefield.
So the lki probably could be done by saving values related to that card in Combat instance. Every check related to isAttacking/Blocked etc should test firstly card.isInPlay() and if false, use LKI. The LKI itself could be stored as a map from card to CombatLastKnownInfo.
I am wondering what kind of data has to be stored in that structure, that is which fields the CombatLastKnownInfo class is going to have.
the only place where that sort of data has to be collected seems to be GameAction.changeZone method, line about 228, when the removed from combat creature leaves battlefield.
So the lki probably could be done by saving values related to that card in Combat instance. Every check related to isAttacking/Blocked etc should test firstly card.isInPlay() and if false, use LKI. The LKI itself could be stored as a map from card to CombatLastKnownInfo.
I am wondering what kind of data has to be stored in that structure, that is which fields the CombatLastKnownInfo class is going to have.
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: Card Contributions
by Agetian » 25 Jun 2013, 13:48
Hmm, I guess that the structure fields can be added incrementally as they are required by potential cards in the future, but I wonder if we actually need any fields at the moment for the current stuff (Max mtg wrote:Speaking of Combat LKI,
.....
I am wondering what kind of data has to be stored in that structure, that is which fields the CombatLastKnownInfo class is going to have.
- Agetian
Last edited by Agetian on 25 Jun 2013, 15:18, edited 1 time in total.
- Agetian
- Programmer
- Posts: 3490
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: Card Contributions
by Max mtg » 25 Jun 2013, 14:56
Then it results in just a couple of fields. CombatLki is to contain a reference to AttackingBand and a boolean flag.
PS: Wall of Shadows target restrictions drive me crazy. Are they scriptable?
- If the flag equals true, then the Band indicates attacking band this creature used to belong to (note, that empty bands must not be cleared from combat). Given the band, we can get the (remaining in play) creatures blocking it and the defender.
- If the flag is false, the Band reference indicates the attackers blocked by that creature.
PS: Wall of Shadows target restrictions drive me crazy. Are they scriptable?
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: Card Contributions
by friarsol » 25 Jun 2013, 15:15
I don't believe we have an equivilant of hasProperty for Target.ValidTgts. I believe the function that checks this is SpellAbility.canTargetSpellAbility()Max mtg wrote:PS: Wall of Shadows target restrictions drive me crazy. Are they scriptable?
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Contributions
by Agetian » 25 Jun 2013, 15:18
Oh, sorry, my bad - I meant Wall of Corpses, not Wall of Shadows...Max mtg wrote:PS: Wall of Shadows target restrictions drive me crazy. Are they scriptable?
- Agetian
- Agetian
- Programmer
- Posts: 3490
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: Card Contributions
by Agetian » 25 Jun 2013, 17:03
By the way, speaking of cards that could benefit from combat LKI - is anyone aware of what other cards are currently scripted or scriptable (in addition to the three mentioned above) that rely on combat LKI for resolution of effects? If anybody knows other cards like that, it might be important to provide that information so that it's possible to decide what information needs to be passed around in the CombatLki structure.
- Agetian
- Agetian
- Agetian
- Programmer
- Posts: 3490
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: Card Contributions
by friarsol » 25 Jun 2013, 17:24
Here are a few similar examplesAgetian wrote:By the way, speaking of cards that could benefit from combat LKI - is anyone aware of what other cards are currently scripted or scriptable (in addition to the three mentioned above) that rely on combat LKI for resolution of effects? If anybody knows other cards like that, it might be important to provide that information so that it's possible to decide what information needs to be passed around in the CombatLki structure.
- Agetian
Urborg Panther, Coils of the Medusa, Dauthi Jackal, War-Torch Goblin, Tinder Wall
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Contributions
by Max mtg » 25 Jun 2013, 17:45
None of these require combatLki.
The abilities using targets are targeted before payment is made - at that moment the creature is still alive and in combat.
Coils of the Medusa is destroyed but the creature it enchants remains in play, so no Lki needed again.
The abilities using targets are targeted before payment is made - at that moment the creature is still alive and in combat.
Coils of the Medusa is destroyed but the creature it enchants remains in play, so no Lki needed again.
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: Card Contributions
by friarsol » 25 Jun 2013, 18:01
Targeting is rechecked on ability resolution for fizzling. Since the card (like Urborg Panther) is in the graveyard and no longer actually blocked by whatever creature it was blocked by on activation, the ability fizzles, thus it needs LKI.Max mtg wrote:None of these require combatLki.
The abilities using targets are targeted before payment is made - at that moment the creature is still alive and in combat.
Coils of the Medusa is destroyed but the creature it enchants remains in play, so no Lki needed again.
Edit: Direction of blocking
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Contributions
by Max mtg » 25 Jun 2013, 20:28
Ok, I've commited a couple of changes: 22287 and 22289.
My tests have shown that Kithkin Mourncaller and Abu Ja'far now work as intended.
Please see that yourselves and script the remaining cards.
My tests have shown that Kithkin Mourncaller and Abu Ja'far now work as intended.
Please see that yourselves and script the remaining cards.
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: Card Contributions
by Agetian » 26 Jun 2013, 04:47
Seems to work great, Max, thanks!Max mtg wrote:Ok, I've commited a couple of changes: 22287 and 22289.
My tests have shown that Kithkin Mourncaller and Abu Ja'far now work as intended.
Please see that yourselves and script the remaining cards.
- Agetian
- Agetian
- Programmer
- Posts: 3490
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: Card Contributions
by kevvo » 26 Jun 2013, 23:48
This is my very first card, so apologies if it's wrong. Is anyone doing banding cards? I'd be happy to start back at Alpha and start adding banding cards if no one else is doing it. I'm not sure I'm ready to handle Battering Ram but if this card is right I can surely handle Timber Wolves and Benalish Hero. I did test in Forge and everything seems to work.
- Code: Select all
Name:Soraya the Falconer
ManaCost:1 W W
Types:Legendary Creature Human
PT:2/2
S:Mode$ Continuous | Affected$ Creature.Bird | AddPower$ 1 | AddToughness$ 1 | Description$ Bird Creatures get +1/+1.
A:AB$ Pump | Cost$ 1 W | ValidTgts$ Creature.Bird | TgtPrompt$ Select target Bird creature | KW$ Banding | SpellDescription$ Target Bird creature gains banding until end of turn.
- kevvo
- Posts: 2
- Joined: 26 Jun 2013, 22:33
- Has thanked: 0 time
- Been thanked: 0 time
Re: Card Contributions
by swordshine » 27 Jun 2013, 02:08
Thanks, kevvo. The card script is correct, but if you downloaded the latest snapshothttp://cardforge.org/releases/snapshots/forge/forge/, you'll find this card is already scripted. We have recently discussed the remaining cards here http://www.slightlymagic.net/forum/viewtopic.php?f=52&t=10868 and http://www.slightlymagic.net/forum/viewtopic.php?f=52&t=10432. Most of them are really difficultkevvo wrote:This is my very first card, so apologies if it's wrong. Is anyone doing banding cards? I'd be happy to start back at Alpha and start adding banding cards if no one else is doing it. I'm not sure I'm ready to handle Battering Ram but if this card is right I can surely handle Timber Wolves and Benalish Hero. I did test in Forge and everything seems to work.
- Code: Select all
Name:Soraya the Falconer
ManaCost:1 W W
Types:Legendary Creature Human
PT:2/2
S:Mode$ Continuous | Affected$ Creature.Bird | AddPower$ 1 | AddToughness$ 1 | Description$ Bird Creatures get +1/+1.
A:AB$ Pump | Cost$ 1 W | ValidTgts$ Creature.Bird | TgtPrompt$ Select target Bird creature | KW$ Banding | SpellDescription$ Target Bird creature gains banding until end of turn.
- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Who is online
Users browsing this forum: No registered users and 40 guests