It is currently 25 Apr 2024, 02:30
   
Text Size

More Bug Fixing of Core Cards

Moderator: CCGHQ Admins

Re: More Bug Fixing of Core Cards

Postby pcastellazzi » 09 May 2012, 14:25

Pesi wrote:Regarding the Wolfbriar Elemental thing, is the same true of Verdeloth The Ancient?
I tested it and its not the case.
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.
User avatar
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

Postby 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.
User avatar
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

Postby 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
Code: Select all
Object():GetSpec()
and
Code: Select all
MTG():ObtainTokenFromSpec
, save it in the data chest, and make sure it stays there after a zone change with
Code: Select all
Object():RetainDataChest()
. After that a continous action with
Code: Select all
Object():TurnIntoCopyOf()
keep the card working.

The line
Code: Select all
Object():GetCurrentCharacteristics():Power_Add(0)
is a workaround to keep the continous action working. It seems under certain circunstances its not applied, but if i force a card's power change it work as expected.
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.
User avatar
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

Postby 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...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 721 times

Platinum Angel

Postby 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:

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>
Any ideas about what's wrong with it?
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.
User avatar
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

Postby 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:
Code: Select all
<STATIC_ABILITY influencing_zone="player" layer="8">
I noticed that the layer gives the game a better understanding of what the ability does. In fact, I tried to use layer="0" instead of layer="1" for my transform mechanic, and the transformed cards suddenly stopped gaining static abilities (like first strike on Village Ironsmith). So, try this one first.

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>
I'm making the assumption that FilteredPlayer() is set once and for all in the <DURATION> block as soon as the action is performed, which should be true but I'm not 100% sure. Oh and I used forced_skip="1" because this shouldn't even be a comes-into-play ability so nobody should answer to it (maybe internal works too, but it's better to test with forced_skip first, because it has no restrictions on what can be done).
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
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

Postby 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.
User avatar
pcastellazzi
 
Posts: 184
Joined: 25 Apr 2012, 00:40
Location: Montevideo, Uruguay
Has thanked: 11 times
Been thanked: 30 times

Previous

Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 22 guests


Who is online

In total there are 22 users online :: 0 registered, 0 hidden and 22 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 22 guests

Login Form