Board index Programs with AI or Rules Enforcement Magic: The Gathering - Duels of the Planeswalkers Programming Talk
More Bug Fixing of Core Cards
Moderator: CCGHQ Admins
Re: More Bug Fixing of Core Cards
by pcastellazzi » 09 May 2012, 14:25
I tested it and its not the case.Pesi wrote:Regarding the Wolfbriar Elemental thing, is the same true of Verdeloth The Ancient?
The lights then came up and the crowd erupted in applause, because that's what the crowd does after it watches destruction on a large screen.
— Ben Kuchera, Mordern Warfare 3 review.
— Ben Kuchera, Mordern Warfare 3 review.
-
pcastellazzi - Posts: 184
- Joined: 25 Apr 2012, 00:40
- Location: Montevideo, Uruguay
- Has thanked: 11 times
- Been thanked: 30 times
Re: More Bug Fixing of Core Cards
by pcastellazzi » 21 May 2012, 03:25
Added fix for Black Sun's Zenith. When you use it with zero mana or when there is no creatures on the battlefield now it return to the library as expected. Original version goes to the graveyard.
The lights then came up and the crowd erupted in applause, because that's what the crowd does after it watches destruction on a large screen.
— Ben Kuchera, Mordern Warfare 3 review.
— Ben Kuchera, Mordern Warfare 3 review.
-
pcastellazzi - Posts: 184
- Joined: 25 Apr 2012, 00:40
- Location: Montevideo, Uruguay
- Has thanked: 11 times
- Been thanked: 30 times
Re: More Bug Fixing of Core Cards
by pcastellazzi » 21 May 2012, 21:00
Added fix for Clone. Please test this, since it was way more complex than a single line fix.
For those interested in the gory details it uses an in memory token created with
The line
For those interested in the gory details it uses an in memory token created with
- Code: Select all
Object():GetSpec()
- Code: Select all
MTG():ObtainTokenFromSpec
- Code: Select all
Object():RetainDataChest()
- Code: Select all
Object():TurnIntoCopyOf()
The line
- Code: Select all
Object():GetCurrentCharacteristics():Power_Add(0)
The lights then came up and the crowd erupted in applause, because that's what the crowd does after it watches destruction on a large screen.
— Ben Kuchera, Mordern Warfare 3 review.
— Ben Kuchera, Mordern Warfare 3 review.
-
pcastellazzi - Posts: 184
- Joined: 25 Apr 2012, 00:40
- Location: Montevideo, Uruguay
- Has thanked: 11 times
- Been thanked: 30 times
Re: More Bug Fixing of Core Cards
by thefiremind » 21 May 2012, 22:16
Nabeshin made a fixed Clone that uses an invisible card to keep the information, some time ago. I used the same model for my version of the transform mechanic. But it's nice that you found a way to do it without invisible cards.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 721 times
Platinum Angel
by pcastellazzi » 27 May 2012, 00:36
As far i understand Platinum Angel ability affect the current controler. If you have negative life, and you lose its control you lose. This not happend with the current implementation. At first i thought it was because the code uses GetPlayer() instead of GetCurrentController(), but it is not the case.
Here is the relevant code:
Here is the relevant code:
- Code: Select all
<STATIC_ABILITY influencing_zone="player">
<FILTER>
return (FilteredPlayer() ~= nil and FilteredPlayer() == Object():GetPlayer())
</FILTER>
<CONTINUOUS_ACTION>
FilteredPlayer():GetCurrentCharacteristics():Bool_Set(PLAYER_CHARACTERISTIC_CANT_LOSE, 1)
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
<STATIC_ABILITY>
<FILTER>
return (FilteredPlayer() ~= nil and FilteredPlayer():GetTeam() ~= Object():GetPlayer():GetTeam())
</FILTER>
<CONTINUOUS_ACTION>
FilteredPlayer():GetCurrentCharacteristics():Bool_Set(PLAYER_CHARACTERISTIC_CANT_WIN, 1)
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
The lights then came up and the crowd erupted in applause, because that's what the crowd does after it watches destruction on a large screen.
— Ben Kuchera, Mordern Warfare 3 review.
— Ben Kuchera, Mordern Warfare 3 review.
-
pcastellazzi - Posts: 184
- Joined: 25 Apr 2012, 00:40
- Location: Montevideo, Uruguay
- Has thanked: 11 times
- Been thanked: 30 times
Re: More Bug Fixing of Core Cards
by thefiremind » 27 May 2012, 08:58
By looking at the code, nothing seems wrong, but sometimes it happened to me that a card still enforced its static abilities even when it shouldn't (a pumped Kruin Striker still showed the trample badge in the graveyard). I think there must be a bug in the game's code that shows up only in specific cases.
The first thing I would try is very easy and the chances of fixing the bug are really low, but it's worth trying: give both static abilities the influencing_zone and a layer:
The second solution would be to make both abilities triggered when the Angel comes into play, duplicate them for when the Angel changes controller, and add a <DURATION> block that goes on until the Angel leaves play or changes controller.
The first thing I would try is very easy and the chances of fixing the bug are really low, but it's worth trying: give both static abilities the influencing_zone and a layer:
- Code: Select all
<STATIC_ABILITY influencing_zone="player" layer="8">
The second solution would be to make both abilities triggered when the Angel comes into play, duplicate them for when the Angel changes controller, and add a <DURATION> block that goes on until the Angel leaves play or changes controller.
- Code: Select all
<TRIGGERED_ABILITY forced_skip="1" influencing_zone="player">
<TRIGGER value="COMES_INTO_PLAY" simple_qualifier="self" />
<FILTER>
return (FilteredPlayer() ~= nil and FilteredPlayer() == Object():GetPlayer())
</FILTER>
<CONTINUOUS_ACTION>
FilteredPlayer():GetCurrentCharacteristics():Bool_Set(PLAYER_CHARACTERISTIC_CANT_LOSE, 1)
</CONTINUOUS_ACTION>
<DURATION>
return Object():GetZone() ~= ZONE_IN_PLAY or Object():GetController() ~= FilteredPlayer()
</DURATION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY forced_skip="1" influencing_zone="player">
<TRIGGER value="COMES_INTO_PLAY" simple_qualifier="self" />
<FILTER>
return (FilteredPlayer() ~= nil and FilteredPlayer():GetTeam() ~= Object():GetPlayer():GetTeam())
</FILTER>
<CONTINUOUS_ACTION>
FilteredPlayer():GetCurrentCharacteristics():Bool_Set(PLAYER_CHARACTERISTIC_CANT_WIN, 1)
</CONTINUOUS_ACTION>
<DURATION>
return Object():GetZone() ~= ZONE_IN_PLAY or Object():GetController():GetTeam() ~= FilteredPlayer():GetTeam()
</DURATION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY forced_skip="1" influencing_zone="player">
<TRIGGER value="CONTROLLER_CHANGED" simple_qualifier="self" />
<FILTER>
return (FilteredPlayer() ~= nil and FilteredPlayer() == Object():GetPlayer())
</FILTER>
<CONTINUOUS_ACTION>
FilteredPlayer():GetCurrentCharacteristics():Bool_Set(PLAYER_CHARACTERISTIC_CANT_LOSE, 1)
</CONTINUOUS_ACTION>
<DURATION>
return Object():GetZone() ~= ZONE_IN_PLAY or Object():GetController() ~= FilteredPlayer()
</DURATION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY forced_skip="1" influencing_zone="player">
<TRIGGER value="CONTROLLER_CHANGED" simple_qualifier="self" />
<FILTER>
return (FilteredPlayer() ~= nil and FilteredPlayer():GetTeam() ~= Object():GetPlayer():GetTeam())
</FILTER>
<CONTINUOUS_ACTION>
FilteredPlayer():GetCurrentCharacteristics():Bool_Set(PLAYER_CHARACTERISTIC_CANT_WIN, 1)
</CONTINUOUS_ACTION>
<DURATION>
return Object():GetZone() ~= ZONE_IN_PLAY or Object():GetController():GetTeam() ~= FilteredPlayer():GetTeam()
</DURATION>
</TRIGGERED_ABILITY>
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 721 times
Re: More Bug Fixing of Core Cards
by pcastellazzi » 27 May 2012, 21:01
The layer="8" fixed the problem. Thank you for advice. The fixed card is now on the repo too.
The lights then came up and the crowd erupted in applause, because that's what the crowd does after it watches destruction on a large screen.
— Ben Kuchera, Mordern Warfare 3 review.
— Ben Kuchera, Mordern Warfare 3 review.
-
pcastellazzi - Posts: 184
- Joined: 25 Apr 2012, 00:40
- Location: Montevideo, Uruguay
- Has thanked: 11 times
- Been thanked: 30 times
37 posts
• Page 3 of 3 • 1, 2, 3
Who is online
Users browsing this forum: No registered users and 22 guests