Hanmac's Refactoring Thread
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: Hanmac's Refactoring Thread
by Agetian » 08 Jan 2017, 10:59
Wow, MTG sure has some complicated rules :/ At any rate, I believe you can get this right for sure, and I wish you the best of luck in your ongoing efforts! They are very highly appreciated!
- Agetian
- Agetian
- Agetian
- Programmer
- Posts: 3472
- Joined: 14 Mar 2011, 05:58
- Has thanked: 677 times
- Been thanked: 561 times
Re: Hanmac's Refactoring Thread
by friarsol » 08 Jan 2017, 13:40
So it's a new damage effect each time the card name is used on the card. Maybe just add a new damage effect in the card script and key off that.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Hanmac's Refactoring Thread
by Hanmac » 08 Jan 2017, 13:45
friarsol: ah okay yeah thats make sense ...
the problem are cards like Cone of Flame where we need Two or more DealDamage Effects because of different values to different targets ...
OR what do you think about using "| NumDmg$ 1:2:3" ? the DamageDeal Effect does need to be changed but it will understand that "1" is dealt to the first Target, "2" to the second and "3" to the third?
with that Cone of Flame could be done in one DamageEffect
the problem are cards like Cone of Flame where we need Two or more DealDamage Effects because of different values to different targets ...
OR what do you think about using "| NumDmg$ 1:2:3" ? the DamageDeal Effect does need to be changed but it will understand that "1" is dealt to the first Target, "2" to the second and "3" to the third?
with that Cone of Flame could be done in one DamageEffect
Re: Hanmac's Refactoring Thread
by friarsol » 08 Jan 2017, 14:58
I think that might be too complex. Do we know how many cards deal damage on multiple effect lines? Maybe in these cards the script can have a new param like "BuildDamageMap" which holds onto the damage effect as is getting each of the recipients, then releases as a single batch.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Hanmac's Refactoring Thread
by Hanmac » 08 Jan 2017, 15:19
a very short look got me this list:
cards my parser did found but should not combined:
i am currently reworking CounterMove for Aetherborn Marauder and other cards.
(also adding entry points for the AI)
- Code: Select all
// spell with multiple targets dealing different damages
Arc Trail
Cone of Flame
Hail Storm
Serpentine Spike
Cunning Strike
Punish the Enemy
// currently a repeat, does need to be done different?
Incite Rebellion
// Effects which does deal damage to target and damage to you
Goblin Artillery
Orcish Artillery
Orcish Cannonade
Orcish Cannoneers
// Effects which does deal damage to target and itself
Psionic Entity
Psionic Sliver
// condition extra damage (for them BuildDamageMap might not work nicely)
Kamahl's Sledge
cards my parser did found but should not combined:
i am currently reworking CounterMove for Aetherborn Marauder and other cards.
(also adding entry points for the AI)
Re: Hanmac's Refactoring Thread
by Hanmac » 22 Jan 2017, 15:42
other Topics i want to do:
===
etbCounter and similar effects (and keywords) should only cause one replacement effect and trigger.
two Metallic Mimic, the second one didn't get the boost from he first (choosing the same Type) should only causes one trigger by Animation Module.
Example: with bloodthirst
702.53c If an object has multiple instances of bloodthirst, each applies separately.
there are Two + replacement effects, but Animation Module (and other?) should still only trigger once.
means to get it right, i need to add a DamagePreventionMap variable to the damage dealt functions to map the prevented part too. (collect the data and trigger only once)615.12
If Selfless Squire is hanging out while three creatures attacking you get lost in a Fog, does its ability trigger once or three times? Here, have a new rule to cover that—it triggers once.
===
etbCounter and similar effects (and keywords) should only cause one replacement effect and trigger.
two Metallic Mimic, the second one didn't get the boost from he first (choosing the same Type) should only causes one trigger by Animation Module.
Example: with bloodthirst
702.53c If an object has multiple instances of bloodthirst, each applies separately.
there are Two + replacement effects, but Animation Module (and other?) should still only trigger once.
Re: Hanmac's Refactoring Thread
by Marek14 » 23 Jan 2017, 07:28
Hm, are you sure that Animation Module should trigger only once? There ARE two separate effects that add the counters and Hardened Scales would apply to each separately.
Re: Hanmac's Refactoring Thread
by Hanmac » 26 Jan 2017, 02:28
@Marek14: magicjudge didn't published yet but she says that both only should trigger/replace once. Means i will need to find a way to rework ETB counter effects.
Re: Hanmac's Refactoring Thread
by Hanmac » 02 Feb 2017, 06:11
Did EtbCounter stuff.
Tested it with multiple Replacement Effects in combination with Hardened Scales.
Master Biomancer + Cytoplast Root-Kin + Hardened Scales = 2 + 4 + 1 = 7
Tested it with multiple Replacement Effects in combination with Hardened Scales.
Master Biomancer + Cytoplast Root-Kin + Hardened Scales = 2 + 4 + 1 = 7
54 posts
• Page 4 of 4 • 1, 2, 3, 4
Who is online
Users browsing this forum: No registered users and 70 guests