Card Contributions
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: Card Contributions
by 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
by 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
by 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
by 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
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.
Re: Card Contributions
by friarsol » 06 Aug 2014, 18:33
I believe Swordshine already took care of this yesterday.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
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Contributions
by 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.'"
Re: Card Contributions
by 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
by 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
by 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
by friarsol » 14 Dec 2014, 21:25
Yea, the damage source should still be the same. Maybe try it with: DamageSource$ ReplacedSourcekrimsen 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.
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
by 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
by 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.
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
by 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
by 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
Who is online
Users browsing this forum: No registered users and 20 guests