It is currently 12 Sep 2025, 15:09
   
Text Size

Last known information

Post MTG Forge Related Programming Questions Here

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

Last known information

Postby Sloth » 31 Aug 2011, 07:49

The last try to fix triggers using last known information by Hellfish has some side-effects:
When I use Giant Growth on a creature and then Unsummon it, it will retain it's bonus in my hand :shock: .

I know this has been a problem for a long time now, but has anyone a good solution for this?
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Last known information

Postby Hellfish » 31 Aug 2011, 10:59

Doi...
I see the problem, it's not a terribly hard fix. I'm on it right after work!

EDIT:Done. Check out r10115!
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
User avatar
Hellfish
Programmer
 
Posts: 1297
Joined: 07 Jun 2009, 10:41
Location: South of the Pumphouse
Has thanked: 110 times
Been thanked: 169 times

Re: Last known information

Postby Sloth » 31 Aug 2011, 18:57

Hellfish wrote:Doi...
I see the problem, it's not a terribly hard fix. I'm on it right after work!

EDIT:Done. Check out r10115!
This looks like the right way to implement it. All my testing turned out positive. Good work Hellfish! =D>

Should we copy some more variables over to the LastKnownInfo?

I can imagine these:
1. counters, (EDIT: there already)
2. extrinsicKeyword
3. cardColor, changedCardTypes, newPT (can all be changed by AF Animate or static effects)
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Last known information

Postby friarsol » 31 Aug 2011, 20:24

I had something similar to this in place at one point and ran into a problem where a card still appeared to be Enchanted by an Aura after this copying. Does this also fix cards like Carapace? I remember trying some code awfully similar to this, but ran into problems with Aura still granting powers to cards while no longer in play.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Last known information

Postby Hellfish » 01 Sep 2011, 05:13

I don't think that this helps Carapace, it was mainly to help triggers do their thing to the right thing, if you know what I mean.
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
User avatar
Hellfish
Programmer
 
Posts: 1297
Joined: 07 Jun 2009, 10:41
Location: South of the Pumphouse
Has thanked: 110 times
Been thanked: 169 times

Re: Last known information

Postby Sloth » 02 Sep 2011, 08:49

I did some research about the error 0000219 you reported in the issue tracker Hellfish.

It's this part in the changeZone function that causes it:
Code: Select all
        for (Trigger trigger : c.getTriggers())
            trigger.setHostCard(lastKnownInfo);
If I replace "lastKnownInfo" with "copied" the EtB triggers work again. Would this break your lkI fix?

EDIT: I've just tested Proper Burial with Giant Growth and it still works. I will submit it.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Last known information

Postby Hellfish » 02 Sep 2011, 13:06

That *may* break the Anodet Lurker-case that was on the issue tracker.
I'll have a go tonight.

EDIT:Well, test cases seem fine. I'm cautiously optimistic :D
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
User avatar
Hellfish
Programmer
 
Posts: 1297
Joined: 07 Jun 2009, 10:41
Location: South of the Pumphouse
Has thanked: 110 times
Been thanked: 169 times

Re: Last known information

Postby slapshot5 » 05 Sep 2011, 05:38

Hey Hellfish,

A commit related to this: r10115 has some other side-effects. This broke the graft keyword, and I fear some other things with defined in AFs.

See bug 231 for the problem. It works in r10114, but is broken in r10115.

I was testing with Aquastrand Spider. Basically, the Card object I get from AllZoneUtil.getCardsInPlay("Aquastrand Spider").get(0) returns a different Card object than AbilityFactory.getDefinedCards(...) using "Self".

Can you take a look?

Thanks,
slapshot5
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

Re: Last known information

Postby Hellfish » 05 Sep 2011, 06:02

Sure thing, I was going to anyway before I saw you were assigned to the issue ;)
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
User avatar
Hellfish
Programmer
 
Posts: 1297
Joined: 07 Jun 2009, 10:41
Location: South of the Pumphouse
Has thanked: 110 times
Been thanked: 169 times

Re: Last known information

Postby slapshot5 » 05 Sep 2011, 16:41

Hellfish wrote:Sure thing, I was going to anyway before I saw you were assigned to the issue ;)
I made the Graft keyword, so I took the issue. Investigation just led me to this. Feel free to take over the issue if you wish.

-slapshot5
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 34 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 34 users online :: 0 registered, 0 hidden and 34 guests (based on users active over the past 10 minutes)
Most users ever online was 7967 on 09 Sep 2025, 23:08

Users browsing this forum: No registered users and 34 guests

Login Form