It is currently 08 Nov 2025, 21:40
   
Text Size

Card Contributions

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins

Re: Card Contributions

Postby swordshine » 24 Jun 2013, 01:34

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.
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.
swordshine
 
Posts: 682
Joined: 11 Jul 2010, 02:37
Has thanked: 116 times
Been thanked: 87 times

Re: Card Contributions

Postby Agetian » 24 Jun 2013, 11:02

swordshine wrote:
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.
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.
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. :)

- Agetian
Agetian
Programmer
 
Posts: 3490
Joined: 14 Mar 2011, 05:58
Has thanked: 684 times
Been thanked: 572 times

Re: Card Contributions

Postby 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.
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

Postby Agetian » 25 Jun 2013, 13:48

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.
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 (Wall of Shadows Wall of Corpses, Abu Ja'far, Kithkin Mourncaller) to work except the card type/subtype and maybe the card color (for Protection mechanics? Not sure if e.g. Abu Ja'far blocks a card and then the blocked card gains Protection from White via an instant the card would still be destroyed... I think so, but need confirmation). The subtype is useful for Kithkin Mourncaller as it's looking specifically for an attacking Kithkin or Elf. That'd be my guess.

- 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

Postby 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.

  • 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.
This will allow to test if a LKI cards was attacking (+get target), was blocking or blocked. This would also allow to get remaning in play combatants fighting the LKI one.

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

Postby friarsol » 25 Jun 2013, 15:15

Max mtg wrote:PS: Wall of Shadows target restrictions drive me crazy. Are they scriptable?
I don't believe we have an equivilant of hasProperty for Target.ValidTgts. I believe the function that checks this is SpellAbility.canTargetSpellAbility()
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Contributions

Postby Agetian » 25 Jun 2013, 15:18

Max mtg wrote:PS: Wall of Shadows target restrictions drive me crazy. Are they scriptable?
Oh, sorry, my bad - I meant Wall of Corpses, not Wall of Shadows...

- Agetian
Agetian
Programmer
 
Posts: 3490
Joined: 14 Mar 2011, 05:58
Has thanked: 684 times
Been thanked: 572 times

Re: Card Contributions

Postby 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
Programmer
 
Posts: 3490
Joined: 14 Mar 2011, 05:58
Has thanked: 684 times
Been thanked: 572 times

Re: Card Contributions

Postby friarsol » 25 Jun 2013, 17:24

Agetian 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
Here are a few similar examples
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

Postby 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.
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

Postby friarsol » 25 Jun 2013, 18:01

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.
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.

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

Postby 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.
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

Postby Agetian » 26 Jun 2013, 04:47

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.
Seems to work great, Max, thanks! :) Do you have an idea why the "creature buried" sound effect doesn't fire when Abu Ja'far destroys the card? Should there be an extra notification about the event somewhere that would still notify the sound system if the LKI of the card is used when determining that the card should be buried?..

- Agetian
Agetian
Programmer
 
Posts: 3490
Joined: 14 Mar 2011, 05:58
Has thanked: 684 times
Been thanked: 572 times

Re: Card Contributions

Postby 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

Postby swordshine » 27 Jun 2013, 02:08

kevvo 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.
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 difficult :mrgreen: . BTW, M14 spoiler season is coming, if you are interested in some of the cards, you have plenty of opportunities to script them. http://www.slightlymagic.net/forum/viewtopic.php?f=52&t=10360
swordshine
 
Posts: 682
Joined: 11 Jul 2010, 02:37
Has thanked: 116 times
Been thanked: 87 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 79 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 79 users online :: 0 registered, 0 hidden and 79 guests (based on users active over the past 10 minutes)
Most users ever online was 9298 on 10 Oct 2025, 12:54

Users browsing this forum: No registered users and 79 guests

Login Form