It is currently 18 Apr 2024, 04:53
   
Text Size

Card Contributions

Post MTG Forge Related Programming Questions Here

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

Re: Card Contributions

Postby swordshine » 10 Mar 2014, 23:52

Recent scripted cards are used in Commander decks. I fixed a bug in ComputerUtilCost (ai reset activating player when choosing targets) and added some code to support "targets of an opponent's choice he or she controls". So Arena and friends are scriptable now. The remaining work is ai support. I don't think ai is able to handle Arena, so it might be marked unplayable for ai.
swordshine
 
Posts: 682
Joined: 11 Jul 2010, 02:37
Has thanked: 116 times
Been thanked: 87 times

Re: Card Contributions

Postby friarsol » 01 Aug 2014, 13:34

elcnesh, do you have access to the Forge Remaining spreadsheet? When you add cards in the future can you just strike them through, so we can keep track of which categories of cards we have remaining? If not, I'll send you a link.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Contributions

Postby elcnesh » 01 Aug 2014, 19:40

I have read-only access. Could you give me write access? That'd probably be easiest. Thanks! :)
elcnesh
 
Posts: 290
Joined: 16 May 2014, 15:11
Location: Netherlands
Has thanked: 34 times
Been thanked: 92 times

Re: Card Contributions

Postby Hanmac » 06 Aug 2014, 18:25

tiny fix about Scholar of Athreos
need to change "Defined$ Opponent" to "Defined$ Player.Opponent" because it does hit all opponents and not only one, otherwise it does only damage to one opponent and thats wrong

Code: Select all
Name:Scholar of Athreos
ManaCost:2 W
Types:Creature Human Cleric
PT:1/4
A:AB$ LoseLife | Cost$ 2 B | Defined$ Player.Opponent | LifeAmount$ 1 | SubAbility$ DBGainLife | SpellDescription$ Each opponent loses 1 life. You gain life equal to the life lost this way.
SVar:DBGainLife:DB$ GainLife | Defined$ You | LifeAmount$ AFLifeLost
SVar:AFLifeLost:Number$0
SVar:Picture:http://www.wizards.com/global/images/magic/general/scholar_of_athreos.jpg
Oracle:{2}{B}: Each opponent loses 1 life. You gain life equal to the life lost this way.
Hanmac
 
Posts: 954
Joined: 06 May 2013, 18:44
Has thanked: 229 times
Been thanked: 158 times

Re: Card Contributions

Postby friarsol » 06 Aug 2014, 18:33

Hanmac wrote:tiny fix about Scholar of Athreos
need to change "Defined$ Opponent" to "Defined$ Player.Opponent" because it does hit all opponents and not only one, otherwise it does only damage to one opponent and thats wrong
I believe Swordshine already took care of this yesterday.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Contributions

Postby Marek14 » 27 Oct 2014, 15:48

OK, I'll try my hand with Reef Worm, based on Mitotic Slime.

Code: Select all
Name:Reef Worm
ManaCost:3 U
Types:Creature Worm
PT:0/1
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Card.Self | Execute$ TrigTokenFish | TriggerController$ TriggeredCardController | TriggerDescription$ When CARDNAME dies, put a 3/3 blue Fish creature token onto the battlefield with "When this creature dies, put a 6/6 blue Whale creaure token onto the battlefield with 'When this creature dies, put a 9/9 blue Kraken creature token onto the battlefield.'"
SVar:TrigTokenFish:AB$Token | Cost$ 0 | TokenImage$ u 3 3 fish | TokenName$ Fish | TokenTypes$ Creature,Fish | TokenColors$ Blue | TokenOwner$ You | TokenPower$ 3 | TokenToughness$ 3 | TokenAmount$ 1 | TokenTriggers$ TriggerWhale | TokenSVars$ TrigTokenWhale
SVar:TriggerWhale:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Card.Self | Execute$ TrigTokenWhale | TriggerController$ TriggeredCardController | TriggerDescription$ When this creature dies, put a 6/6 blue Whale creaure token onto the battlefield with "When this creature dies, put a 9/9 blue Kraken creature token onto the battlefield."
SVar:TrigTokenWhale:AB$Token | Cost$ 0 | TokenImage$ u 6 6 whale | TokenName$ Whale | TokenTypes$ Creature,Whale | TokenColors$ Blue | TokenOwner$ You | TokenPower$ 6 | TokenToughness$ 6 | TokenAmount$ 1 | TokenTriggers$ TriggerKraken | TokenSVars$ TrigTokenKraken
SVar:TriggerKraken:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Card.Self | Execute$ TrigTokenKraken | TriggerController$ TriggeredCardController | TriggerDescription$ When this creature dies, put a 9/9 blue Kraken creature token onto the battlefield.
SVar:TrigTokenKraken:AB$Token | Cost$ 0 | TokenImage$ u 9 9 kraken c14 | TokenName$ Kraken | TokenTypes$ Creature,Kraken | TokenColors$ Blue | TokenOwner$ You | TokenPower$ 9 | TokenToughness$ 9 | TokenAmount$ 1
SVar:Picture:http://www.wizards.com/global/images/magic/general/reef_worm.jpg
Oracle:When Reef Worm dies, put a 3/3 blue Fish creature token onto the battlefield with "When this creature dies, put a 6/6 blue Whale creaure token onto the battlefield with 'When this creature dies, put a 9/9 blue Kraken creature token onto the battlefield.'"
Would this work?
Marek14
Tester
 
Posts: 2759
Joined: 07 Jun 2008, 07:54
Has thanked: 0 time
Been thanked: 296 times

Re: Card Contributions

Postby elcnesh » 09 Dec 2014, 10:56

When looking through the remaining cards, I noticed Fatespinner is not yet implemented... Is that AI consideration or something else? I think it should be easy to implement it using a GenericChoice, although AI support would be problematic. Though we could set it to random for the time being...
elcnesh
 
Posts: 290
Joined: 16 May 2014, 15:11
Location: Netherlands
Has thanked: 34 times
Been thanked: 92 times

Re: Card Contributions

Postby krimsen » 14 Dec 2014, 20:11

First attempt at scripting for Forge. Seems to be working okay, although I don't know if the damage's source is supposed to change. Redirected deathtouch damage does not kill atm.

Code: Select all
Name:Kor Chant
ManaCost:2 W
Types:Instant
A:SP$ Effect | Cost$ 2 W | Name$ Kor Chant Effect | ReplacementEffects$ RPreventFromSource | SVars$ RPreventFromSource,DamageCreatureInstead,X | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select target creature you control | RememberObjects$ Targeted | SpellDescription$ All damage that would be dealt this turn to target creature you control by a source of your choice is dealt to another target creature instead.
SVar:RPreventFromSource:Event$ DamageDone | ValidTarget$ Card.IsRemembered | ReplaceWith$ DamageCreatureInstead | PreventionEffect$ True | Description$ The next time the chosen source deals damage to you, prevent that damage.
SVar:DamageCreatureInstead:DB$ DealDamage | ValidTgts$ Creature | TgtPrompt$ Select target creature | NumDmg$ X | References$ X
SVar:X:ReplaceCount$DamageAmount
Oracle:All damage that would be dealt this turn to target creature you control by a source of your choice is dealt to another target creature instead.
Last edited by krimsen on 14 Dec 2014, 20:26, edited 1 time in total.
krimsen
 
Posts: 5
Joined: 11 Dec 2014, 20:43
Has thanked: 0 time
Been thanked: 0 time

Re: Card Contributions

Postby elcnesh » 14 Dec 2014, 20:16

Cool! Actually, there's about 20 cards of that form I thought weren't scriptable... Is there something we're missing about these kind of cards?
elcnesh
 
Posts: 290
Joined: 16 May 2014, 15:11
Location: Netherlands
Has thanked: 34 times
Been thanked: 92 times

Re: Card Contributions

Postby friarsol » 14 Dec 2014, 21:25

krimsen wrote:First attempt at scripting for Forge. Seems to be working okay, although I don't know if the damage's source is supposed to change. Redirected deathtouch damage does not kill atm.
Yea, the damage source should still be the same. Maybe try it with: DamageSource$ ReplacedSource

Although I'm not sure this script is quite right. When you cast Kor Chant (and it's cousin Kor Dirge), you have to target the creature you are protecting, the source of the damage, and the creature to redirect the damage to. If I'm reading the script correctly, you are only targeting the protected creature on casting, and targeting the redirected creature during the replacement effect. And I Don't see anything that selects the damage source (like what you see on Circles of Protection)
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Contributions

Postby elcnesh » 14 Dec 2014, 21:52

How about having the effect remember (a) the damaged creature, (b) the damage source and (c) the target to redirect it to? Might need some coding to handle three different kinds of remembering objects though.
elcnesh
 
Posts: 290
Joined: 16 May 2014, 15:11
Location: Netherlands
Has thanked: 34 times
Been thanked: 92 times

Re: Card Contributions

Postby krimsen » 14 Dec 2014, 21:56

You're right, I read the rules text sloppily.

The way remembering works is not documented (or I didn't find that part). From looking at the code, I got that it is a list, though I haven't figured out if it's shared between an Ability and its SubAbilities, and if you can address elements of that list by index or name. If so, this should be doable.


elcnesh wrote:How about having the effect remember (a) the damaged creature, (b) the damage source and (c) the target to redirect it to? Might need some coding to handle three different kinds of remembering objects though.
krimsen
 
Posts: 5
Joined: 11 Dec 2014, 20:43
Has thanked: 0 time
Been thanked: 0 time

Re: Card Contributions

Postby elcnesh » 14 Dec 2014, 21:58

It is a list, and it's tied to the card (or effect in this case), so it's shared between all abilities. It's not accessible by index, however, which is why some additional code is necessary here. Normally we could use Imprint as a second remembered list, but now we need three. Maybe ChosenCard? Would become a bit ugly, but it might work :)
elcnesh
 
Posts: 290
Joined: 16 May 2014, 15:11
Location: Netherlands
Has thanked: 34 times
Been thanked: 92 times

Re: Card Contributions

Postby krimsen » 14 Dec 2014, 23:15

Sounds messy indeed. I'll take another shot at this sometime next week.


elcnesh wrote:It is a list, and it's tied to the card (or effect in this case), so it's shared between all abilities. It's not accessible by index, however, which is why some additional code is necessary here. Normally we could use Imprint as a second remembered list, but now we need three. Maybe ChosenCard? Would become a bit ugly, but it might work :)
krimsen
 
Posts: 5
Joined: 11 Dec 2014, 20:43
Has thanked: 0 time
Been thanked: 0 time

Re: Card Contributions

Postby mastroego » 15 Dec 2014, 00:58

This would allow even cards like Harm's Way, right?

Well, for what is worth, you have my support :D
mastroego
 
Posts: 236
Joined: 22 Sep 2013, 14:04
Has thanked: 28 times
Been thanked: 16 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: KeithOvart and 34 guests

cron

Who is online

In total there are 35 users online :: 1 registered, 0 hidden and 34 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: KeithOvart and 34 guests

Login Form