It is currently 17 Jul 2019, 02:32
   
Text Size

Hanmac's Refactoring Thread

Post MTG Forge Related Programming Questions Here

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

Re: Hanmac's Refactoring Thread

Postby 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
Programmer
 
Posts: 3341
Joined: 14 Mar 2011, 05:58
Has thanked: 641 times
Been thanked: 495 times

Re: Hanmac's Refactoring Thread

Postby 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: 7455
Joined: 15 May 2010, 04:20
Has thanked: 240 times
Been thanked: 930 times

Re: Hanmac's Refactoring Thread

Postby 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
Hanmac
 
Posts: 942
Joined: 06 May 2013, 18:44
Has thanked: 229 times
Been thanked: 153 times

Re: Hanmac's Refactoring Thread

Postby 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: 7455
Joined: 15 May 2010, 04:20
Has thanked: 240 times
Been thanked: 930 times

Re: Hanmac's Refactoring Thread

Postby Hanmac » 08 Jan 2017, 15:19

a very short look got me this list:
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

how they need to be changed i don't know yet ...

cards my parser did found but should not combined:
Code: Select all
Burn the Impure
Sarkhan's Rage
Ravaging Blaze
Starfall
Draconic Roar
Illuminate
i am currently reworking CounterMove for Aetherborn Marauder and other cards.
(also adding entry points for the AI)
Hanmac
 
Posts: 942
Joined: 06 May 2013, 18:44
Has thanked: 229 times
Been thanked: 153 times

Re: Hanmac's Refactoring Thread

Postby Hanmac » 22 Jan 2017, 15:42

other Topics i want to do:
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.
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)

===
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.
Hanmac
 
Posts: 942
Joined: 06 May 2013, 18:44
Has thanked: 229 times
Been thanked: 153 times

Re: Hanmac's Refactoring Thread

Postby 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.
Marek14
Tester
 
Posts: 2647
Joined: 07 Jun 2008, 07:54
Has thanked: 0 time
Been thanked: 262 times

Re: Hanmac's Refactoring Thread

Postby 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.
Hanmac
 
Posts: 942
Joined: 06 May 2013, 18:44
Has thanked: 229 times
Been thanked: 153 times

Re: Hanmac's Refactoring Thread

Postby 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
Hanmac
 
Posts: 942
Joined: 06 May 2013, 18:44
Has thanked: 229 times
Been thanked: 153 times

Previous

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 8 guests


Who is online

In total there are 8 users online :: 0 registered, 0 hidden and 8 guests (based on users active over the past 10 minutes)
Most users ever online was 287 on 31 Mar 2019, 04:11

Users browsing this forum: No registered users and 8 guests

Login Form